shawhint/claude-for-swe-teams/mux
Claude Code and agent skill by shawhint/claude-for-swe-teams
- community
Checking that the SKILL.md file is still in the repository.
Mux video integration for ABA courses. Use when working with video uploads, playback, asset management, or connecting Mux videos to course lessons. Covers the Mux Python SDK, signed playback tokens, lesson frontmatter fields, and the video player pipeline.
Install
npx vskill@latest install shawhint/claude-for-swe-teams/muxSKILL.md
Mux Video Integration
Mux hosts all course video content. Videos use signed playback (JWT tokens) — there are no public playback IDs.
Architecture
Environment Variables
Set in .env (shared) or .env.local (dev override):
| Variable | Purpose | |
|---|---|---|
MUX_TOKEN_ID | API authentication (username) — for asset queries | |
MUX_TOKEN_SECRET | API authentication (password) — for asset queries | |
MUX_SIGNING_KEY_ID | JWT signing key ID — for playback tokens | |
MUX_SIGNING_SECRET_KEY | Base64-encoded RSA private key — for playback tokens |
The first pair is for server-side API calls (listing assets, fetching duration). The second pair is for signing playback tokens that the browser sends to Mux.
Existing Utilities (utils/mux.py)
Three functions — all return None gracefully when env vars are missing:
- `get_mux_tokens(playback_id)` →
{"playback": token, "thumbnail": token, "storyboard": token}— signs JWT tokens for the<mux-player>element - `sign_mux_token(playback_id, audience, expiry, extra_claims)` → single JWT token (internal, called by
get_mux_tokens) - `fetch_asset_duration(asset_id)` → duration in minutes (rounded, min 1) — calls Mux Assets API
Lesson Frontmatter Fields
Each lesson .md file in courses/<course-slug>/ uses YAML frontmatter:
| Field | Type | Required | Description | |
|---|---|---|---|---|
title | string | yes | Display title | |
duration | int | no | Duration in minutes. Auto-fetched from Mux if asset_id is set | |
playback_id | string | no | Mux signed playback ID — drives the video player | |
asset_id | string | no | Mux asset ID — used for duration fetching |
Duration resolution order (in utils/course_loader.py):
durationin frontmatter → use itasset_idin frontmatter → callfetch_asset_duration(), write result back to frontmatter- Fallback → estimate from word count (200 words/min)
Video Player Rendering (pages/lesson.py)
The _video_player() function checks lesson.playback_id:
- Missing: renders a placeholder box
- Present: calls
get_mux_tokens()to sign JWT tokens, renders<mux-player>withplayback-id,playback-token,thumbnail-token,storyboard-token
The <mux-player> web component script is loaded via utils/config.py:
Querying Mux Assets (Ad-hoc Scripts)
Use uv run python for all ad-hoc Mux scripts. The mux_python SDK is a project dependency.
List all assets with titles
Key gotcha: Asset titles live in meta._title (the private attribute), not in passthrough or a top-level title field. The meta object is an AssetMetadata — use attribute access, not dict .get().
Naming convention for uploaded videos
Videos are titled with the pattern: c<course>-<module>_<lesson>-<slug>
Example: c4-3_2-mcp = course 4, module 3, lesson 2, slug "mcp"
Workflow: Adding Videos to a Course
- Upload videos to Mux (dashboard or API), setting the title metadata
- Run the asset listing script above to get
asset_idandplayback_idfor each video - Add
playback_idandasset_idto each lesson's frontmatter - Update
durationwith actual video duration (rounded to nearest minute, min 1) - Verify by running
uv run main.pyand navigating to a lesson page
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/mux/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/shawhint/claude-for-swe-teams/mux)