Skip to content
Back to skills

082 Claude Fae8645d

ASecurity

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

  • 9 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added May 31, 2026
developmentpythongobashfastapigitapifrontendbackend

Works with

  • claude code
  • cli
  • api

Security analysis

A96/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro scans all 2 files and shows the line behind each finding

Scanned May 31, 2026

npx -y skills add tools-only/X-Skills --skill 082-claude_fae8645d --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 082 Claude Fae8645d?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for 082 Claude Fae8645d
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tools-only-082-claude-fae8645d/badge)](https://www.skillsdirectory.com/skills/tools-only-082-claude-fae8645d)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## Commands

```bash
# Start dev server (serves both API and frontend at http://localhost:8000)
python -m backend.main

# Install dependencies
pip install -r backend/requirements.txt

# Test MiniMax API connectivity
python backend/test_minimax.py

# Required system dependency
# ffmpeg must be installed (brew install ffmpeg)
```

No build step, no linting, no test suite. Frontend is a single HTML file served via FastAPI StaticFiles.

## Architecture

Multi-agent video production pipeline. User prompt goes through 6 sequential agents, producing a final MP4.

```
POST /api/create  -->  background thread runs pipeline  -->  SSE via GET /api/stream/{job_id}

Pipeline stages (sequential):
  Director (MiniMax M1 LLM)    -> shot outline JSON
  Script   (MiniMax M1 LLM)    -> production script with video_prompt, narration, subtitle per shot
  Visual   (Hailuo 2.3 video)  -> parallel video clips (ThreadPoolExecutor, max_workers=3)
  Voice    (Speech-2.6-HD TTS) -> sequential narration audio per shot
  Music    (Music-2.0)         -> single background track (optional)
  Editor   (ffmpeg)            -> concat videos, mix audio, burn subtitles -> final.mp4
```

**Key data flow:** Each agent's `run()` returns structured data consumed by the next agent. Director outputs `{title, style, total_duration, shots[]}`. Script enriches each shot with `video_prompt` (optimized for Hailuo), polished `narration`, and `subtitle`. Visual/Voice/Music produce file paths. Editor composites everything via ffmpeg subprocess calls.

**Job lifecycle:** `main.py` stores jobs in an in-memory dict. Pipeline runs in `run_in_executor` (background thread). Progress events accumulate in `jobs[job_id]["events"]` list, polled by SSE endpoint every 1s.

**Frontend-backend coupling:** Frontend JS references stages by name (`director`, `script`, `visual`, `voice`, `music`, `editor`) in `stageMap` to highlight corresponding UI cards. These stage names must match `pipeline.py` emit calls.

## Key Conventions

- Every agent module in `backend/agents/` exposes a `run()` function as its sole public interface
- All MiniMax API calls must check `data["base_resp"]["status_code"] != 0` before accessing response payload -- API returns HTTP 200 even on business errors (insufficient balance, rate limit, etc.)
- LLM agents (director, script) strip markdown code fences from responses before JSON parsing
- Frontend uses relative API paths (`/api/...`). FastAPI `app.mount("/", StaticFiles(...))` must be registered after all API routes
- Generated media files go to `backend/output/` (gitignored). Config auto-creates this directory on import.
- Environment: single `.env` file at project root with `MINIMAX_API_KEY`

## Mistakes Log

| Mistake | Fix |
|---------|-----|
| MiniMax API 余额不足时 `choices` 为空,取值抛 NoneType | 先检查 `base_resp.status_code != 0` 再取 `choices` |
| `app.mount("/", StaticFiles(...))` 拦截 API 路由 | 必须放在所有 `@app` 路由注册之后 |
| Hailuo video generation 是异步的,直接取结果会失败 | 必须 POST 创建任务 -> 轮询 query 接口 -> 下载文件,三步走 |

Files in this skill

  • README.md773 B
  • skill.md3.2 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.