Import Task Master's development workflow commands and guidelines, treat as if import is in the main CLAUDE.md file. @./.taskmaster/CLAUDE.md
Got it — I’ll rewrite your Claude Ops Manual for this Viral Video Generator project, keeping the TaskMaster and Context7 integration exactly as in your Snowflake Engine doc. Basically: same rigor, but instead of novels → pipeline for viral listicle videos (using your PDFs #1–29 as the methodology backbone).
Here’s a first full draft:
NOTE: Always refer to Instant Viral Templates #1–#14: Dopamine Listicles and Instant Viral Templates #15–#29: Lazy Viral Templates. They are the single sources of truth regarding viral video structure, hook formulas, and dopamine pacing. Never hallucinate, never assume, never improvise formats. Always check the templates first.
This manual defines how to operate, extend, and troubleshoot the Auto-Viral Listicle Engine that generates complete viral short-form videos end to end using the provided templates. It standardizes step gates, prompt packs, validation, error cycles, and export protocols.
The engine consumes a minimal brief (topic + template selection) and returns a complete asset pack:
- script (countdown/listicle format)
- voiceover
- B-roll/video assembly
- captions
- music/FX overlay
Artifacts are stored as JSON with human-readable mirrors.
Pipeline tiers:
- Planner → Selects viral template + topic
- Script Engine → Generates dopamine-pacing script (countdown, lazy scroll, etc.)
- Voiceover Engine → Generates AI voice timed to script
- Visual Assembly → Auto-pulls stock/B-roll/clips, attaches captions
- Conformance Validator → Persistent at every gate (ensures dopamine rules)
- Never bypass or merge template steps.
- No ad-hoc scripts outside the provided template set.
- Every downstream change can only come from revision of upstream artifact (script → voiceover → video).
Error handling:
-
Start from current repo + schema.
-
If error → begin an Error Cycle:
- Use TaskMaster to research failure mode.
- Use Context7 to load SDK docs (FFmpeg, Whisper, captioning libs).
- Apply patch, retest, increment cycle counter.
- After 20 failed cycles: mark Blocked + escalate.
-
Confirm branch synced with main.
-
Load environment variables: •
OPENAI_API_KEY(for script + voice) •ELEVENLABS_API_KEYorXTTS_PATH(voice engine) •FFMPEG_PATH•BROLL_LIBRARY_URL•MUSIC_LIBRARY_URL -
Run smoke tests: • Model reachability • JSON schema validation for script + assets • Test run on a micro-topic ("3 Fun Facts About Coffee")
-
Open TaskMaster and load viral-template task list.
-
Review Blocked items.
All technical research is initiated via TaskMaster. Example commands:
task-master init
task-master parse-prd docs/prd.md --research
task-master list
task-master research "Script validator rejects hook not in template #4"
task-master research "FFmpeg overlay mis-timing captions"Use Context7 to retrieve:
- FFmpeg command references
- Captioning schema (SRT, WebVTT)
- JSON schema for script artifacts
- MCP parameters for Claude-Flow hooks
Connect Claude Code to Context7:
claude mcp add --transport http context7 https://mcp.context7.com/mcp- Template fidelity is absolute. Must follow hook formula, pacing rules, listicle beats.
- No freeform script outside a template.
- Each video must pass dopamine pacing checks: • Hook in 0–3s • Intrigue maintained every 5–6s • Payoff at end.
- Respect countdown/list order integrity.
- Captions must sync to voice within 100ms.
- Draft only from frozen script artifact.
- Keep validators versioned.
Project bundle includes:
project.json(topic, template ID, style)script.json(structured by beats)voiceover.wavcaptions.srtandcaptions.jsonbroll_manifest.jsonvideo.mp4
Script JSON required fields:
index, hook, body, payoff, timestamp, pacing_flag
Step 1 — Template + Topic
- Required: template_id, topic, length_target
- Gate: template exists, topic string < 12 words
Step 2 — Script Generation
- Required: hook, 3–10 body beats, payoff
- Gate: passes dopamine pacing (hook < 3s, intrigue per 5s)
Step 3 — Voiceover
- Required: TTS timing matches script length
- Gate: per-line timing stored in JSON
Step 4 — Visual Assembly
- Required: b-roll match for every beat, captions aligned
- Gate: no missing assets
Step 5 — Final Video
- Required: exports to MP4 with captions and audio
- Gate: length within ±10% of target, passes validator (hook, payoff, pacing)
Every step has canonical prompts. Example for Step 2 Script:
System:
You are the Viral Script Agent. Only produce listicle scripts conforming to the selected template.
User:
Context:
- Template: {{template_id}}
- Topic: {{topic}}
Task:
Write script beats following the template.
Enforce:
- Hook in 0–3s
- Intrigue spike every 5–6s
- Final payoff at last beat
Return JSON:
[{ "index": 1, "text": "...", "role": "hook", "timestamp": 0.0, "pacing_flag": true }, ...]
Examples:
validate_hook(script)→ must be first line, <15 words.validate_pacing(script)→ intrigue every 5–6s.validate_countdown_integrity(script)→ list order intact.validate_caption_alignment(captions, voiceover)→ offset <100ms.
- Voiceover must match script JSON exactly.
- Captions locked to script JSON, not raw audio.
- Video assembly must respect beat order.
- Music overlay at -12 LUFS max.
- Identify failing tier: Script, Voiceover, Visual, Export.
- Start fix cycle: TaskMaster research, Context7 lookup, patch, retest.
- Log cycle number. Reset if fixed.
- Escalate after 20 cycles.
Automated:
- Validate dopamine pacing on every output.
- Script beat count within template bounds.
- Voiceover <1s drift vs captions.
- Export MP4 <120s.
Manual:
- Spot check hook strength.
- Verify b-roll relevance.
make setup
make test:smoke
make run:tiny # generates 15s demo clipFull generation:
make run:viral PROJECT=cats_funny TEMPLATE=4 LENGTH=60Exports:
make export:mp4
make export:json
make export:srtImport Task Master development workflow commands and guidelines.
@./.taskmaster/CLAUDE.md