Skip to content

Commit a270892

Browse files
burivuhsterclaude
andauthored
chore: Replace Playwright with GraphQL API in loom-transcript skill (no-changelog) (#25918)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 4ce9daf commit a270892

File tree

1 file changed

+72
-27
lines changed

1 file changed

+72
-27
lines changed

.claude/skills/loom-transcript/SKILL.md

Lines changed: 72 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,46 +2,85 @@
22
name: loom-transcript
33
description: Fetch and display the full transcript from a Loom video URL. Use when the user wants to get or read a Loom transcript.
44
argument-hint: [loom-url]
5-
compatibility:
6-
requires:
7-
- plugin: playwright
8-
description: Official Playwright plugin — provides browser automation tools for navigating Loom and extracting transcript content
95
---
106

117
# Loom Transcript Fetcher
128

13-
Fetch the transcript from a Loom video using Playwright browser automation.
14-
15-
## Prerequisites
16-
17-
**Required:**
18-
- **Playwright plugin** (`plugin_playwright`): This skill relies entirely on browser automation to load the Loom page and extract transcript content. Without it, the skill cannot function. The plugin must be installed from the official Claude Code plugin repository. If unavailable, stop and tell the user to install it via `/install-plugin playwright` or the equivalent command.
9+
Fetch the transcript from a Loom video using Loom's GraphQL API.
1910

2011
## Instructions
2112

2213
Given the Loom URL: $ARGUMENTS
2314

24-
1. First, load the Playwright tools using ToolSearch with query "+playwright navigate"
15+
### 1. Extract the Video ID
16+
17+
Parse the Loom URL to extract the 32-character hex video ID. Supported URL formats:
18+
- `https://www.loom.com/share/<video-id>`
19+
- `https://www.loom.com/embed/<video-id>`
20+
- `https://www.loom.com/share/<video-id>?sid=<session-id>`
21+
22+
The video ID is the 32-character hex string after `/share/` or `/embed/`.
23+
24+
### 2. Fetch Video Metadata
25+
26+
Use the `WebFetch` tool to POST to `https://www.loom.com/graphql` to get the video title and details.
27+
28+
Use this curl command via Bash:
29+
30+
```bash
31+
curl -s 'https://www.loom.com/graphql' \
32+
-H 'Content-Type: application/json' \
33+
-H 'Accept: application/json' \
34+
-H 'x-loom-request-source: loom_web_45a5bd4' \
35+
-H 'apollographql-client-name: web' \
36+
-H 'apollographql-client-version: 45a5bd4' \
37+
-d '{
38+
"operationName": "GetVideoSSR",
39+
"variables": {"id": "<VIDEO_ID>", "password": null},
40+
"query": "query GetVideoSSR($id: ID!, $password: String) { getVideo(id: $id, password: $password) { ... on RegularUserVideo { id name description createdAt owner { display_name } } } }"
41+
}'
42+
```
2543

26-
2. Navigate to the Loom URL using `mcp__plugin_playwright_playwright__browser_navigate`
44+
### 3. Fetch the Transcript URLs
2745

28-
3. Wait for the page to load, then look for a "Transcript" tab in the page snapshot
46+
Use curl via Bash to call the GraphQL API:
2947

30-
4. Click on the Transcript tab using `mcp__plugin_playwright_playwright__browser_click` with the appropriate ref
48+
```bash
49+
curl -s 'https://www.loom.com/graphql' \
50+
-H 'Content-Type: application/json' \
51+
-H 'Accept: application/json' \
52+
-H 'x-loom-request-source: loom_web_45a5bd4' \
53+
-H 'apollographql-client-name: web' \
54+
-H 'apollographql-client-version: 45a5bd4' \
55+
-d '{
56+
"operationName": "FetchVideoTranscript",
57+
"variables": {"videoId": "<VIDEO_ID>", "password": null},
58+
"query": "query FetchVideoTranscript($videoId: ID!, $password: String) { fetchVideoTranscript(videoId: $videoId, password: $password) { ... on VideoTranscriptDetails { id video_id source_url captions_source_url } ... on GenericError { message } } }"
59+
}'
60+
```
3161

32-
5. After clicking, the transcript content will appear in the page snapshot. Extract all transcript segments which include:
33-
- Timestamp (e.g., "0:00", "0:14", etc.)
34-
- Transcript text for that segment
62+
Replace `<VIDEO_ID>` with the actual video ID extracted in step 1.
3563

36-
6. Format and present the full transcript to the user with:
37-
- Video title (from page title)
38-
- Duration (if visible)
39-
- Full transcript organized by timestamp
64+
The response contains:
65+
- `source_url` — JSON transcript URL
66+
- `captions_source_url` — VTT (WebVTT) captions URL
4067

41-
## Example Output Format
68+
### 4. Download and Parse the Transcript
4269

43-
**Video:** [Title]
44-
**Duration:** [Duration]
70+
Fetch **both** URLs returned from step 3 (if available):
71+
72+
1. **VTT captions** (`captions_source_url`): Download with `curl -sL "<url>"`. This is a WebVTT file with timestamps and text.
73+
2. **JSON transcript** (`source_url`): Download with `curl -sL "<url>"`. This is a JSON file with transcript segments.
74+
75+
Prefer the VTT captions as the primary source since they include proper timestamps. Fall back to the JSON transcript if VTT is unavailable.
76+
77+
### 5. Present the Transcript
78+
79+
Format and present the full transcript to the user:
80+
81+
**Video:** [Title from metadata]
82+
**Author:** [Owner name]
83+
**Date:** [Created date]
4584

4685
---
4786

@@ -53,8 +92,14 @@ Given the Loom URL: $ARGUMENTS
5392

5493
---
5594

95+
## Error Handling
96+
97+
- If the GraphQL response contains a `GenericError`, report the error message to the user.
98+
- If both `source_url` and `captions_source_url` are null/missing, tell the user that no transcript is available for this video.
99+
- If the video URL is invalid or the ID cannot be extracted, ask the user for a valid Loom URL.
100+
56101
## Notes
57102

58-
- If the Transcript tab is not immediately visible, the page may still be loading. Wait and retry.
59-
- Some Loom videos may not have transcripts available.
60-
- The transcript is auto-generated and may contain minor errors.
103+
- No authentication or cookies are required — Loom's transcript API is publicly accessible.
104+
- Only English transcripts are available through this API.
105+
- Transcripts are auto-generated and may contain minor errors.

0 commit comments

Comments
 (0)