content-machine — local-first short-form video skill pack and runtime for coding-agent CLIs.
Version: 0.2.x | License: MIT | Direction: skills +
45ck/prompt-languageflows + deterministic runtime, with the legacy CLI demoted
This file provides context for AI coding agents (Copilot, Claude Code, Cursor, etc.). For human docs, see README.md and docs/.
Use these first when working as Claude Code, Codex CLI, or similar coding-agent CLIs:
skills/*/SKILL.md— skill docsflows/*.flow— executable flow manifestsscripts/harness/*.ts— optional repo-side execution surfacessrc/harness/*— reusable logic behind those surfacessrc/*runtime modules — direct imports only when a runtime script does not exist yet
The legacy cm surface still exists, but new agent-facing work should
prefer skills and flows over adding more control-plane logic to
src/cli/. Runtime scripts exist to support the skills, not define
them.
When this repo is installed inside another project, the materialized
pack should live under .content-machine/. Agents should read
.content-machine/README.md, .content-machine/AGENTS.md, and the
relevant .content-machine/skills/*/SKILL.md before running tools.
Packaged runtime calls should use:
npx --no-install cm-agent <tool>For installed flows, pass "flowsDir": ".content-machine/flows" to
run-flow or flow-catalog.
If Content Machine is installed into another project as
.content-machine/, do not use the source-checkout
scripts/harness/* commands below. Use npx --no-install cm-agent <tool>
from that project and pass .content-machine/skills or
.content-machine/flows explicitly.
node --import tsx scripts/harness/doctor-report.ts
node --import tsx scripts/harness/flow-catalog.ts
node --import tsx scripts/harness/run-flow.ts
node --import tsx scripts/harness/skill-catalog.ts
node --import tsx scripts/harness/archetype-lane-catalog.ts
node --import tsx scripts/harness/generate-short.ts
node --import tsx scripts/harness/asset-ledger.ts
node --import tsx scripts/harness/brief-to-script.ts
node --import tsx scripts/harness/ingest.ts
node --import tsx scripts/harness/reverse-engineer-winner.ts
node --import tsx scripts/harness/longform-to-shorts.ts
node --import tsx scripts/harness/longform-clip-extract.ts
node --import tsx scripts/harness/longform-highlight-select.ts
node --import tsx scripts/harness/highlight-approval.ts
node --import tsx scripts/harness/boundary-snap.ts
node --import tsx scripts/harness/source-media-analyze.ts
node --import tsx scripts/harness/media-index.ts
node --import tsx scripts/harness/style-profile-library.ts
node --import tsx scripts/harness/script-to-audio.ts
node --import tsx scripts/harness/timestamps-to-visuals.ts
node --import tsx scripts/harness/video-render.ts
node --import tsx scripts/harness/caption-export.ts
node --import tsx scripts/harness/publish-prep.ts
node --import tsx scripts/harness/publish-prep-review.ts
node --import tsx scripts/harness/reddit-story-assets.ts
node --import tsx scripts/harness/install-skill-pack.ts
Discover the live skill and flow surface instead of relying on a static list:
cat <<'JSON' | node --import tsx scripts/harness/skill-catalog.ts
{}
JSON
cat <<'JSON' | node --import tsx scripts/harness/flow-catalog.ts
{}
JSONThe active agent path is skill and harness driven:
source-media-analyze
-> longform-highlight-select
-> boundary-snap
-> highlight-approval
-> longform-clip-extract
-> video-render
-> publish-prep-review
For topic-to-video generation, use generate-short or the
generate-short flow. For longform-to-short planning, use
longform-to-shorts or the longform-to-shorts flow, then use
longform-clip-extract to materialize approved source ranges before
video-render.
- Archetype: script format — data files in
assets/archetypes/, overrides in.cm/archetypes/ - Template: render preset — Remotion composition + render defaults
- Workflow: pipeline orchestration preset
Full glossary: docs/reference/GLOSSARY.md
src/
├── cli/ # Commander.js CLI entry points and commands
├── script/ # Stage 1: LLM script generation
├── audio/ # Stage 2: TTS + ASR pipeline
├── visuals/ # Stage 3: Visual asset matching
├── render/ # Stage 4: Remotion video rendering
├── core/ # Shared infrastructure (config, LLM, logger, errors)
├── score/ # Quality scoring (audio, caption, engagement, pacing)
├── validate/ # Validation systems
├── media/ # Media synthesis (Veo, Nanobanana, DepthFlow)
├── research/ # Research orchestration
├── feedback/ # Human feedback model + JSONL store
├── lab/ # Experiment Lab (review UI)
└── test/stubs/ # Test fakes (FakeLLMProvider, etc.)
- Skill Pack First — prefer skill docs and flow docs for agent-facing work; runtime scripts back execution when needed
- Dependency Injection — all providers via constructor; static factories for prod, test factories for fakes
- LLM-First Reasoning — structured outputs via validators, not regex heuristics
- Configuration-Driven — TOML/JSON config, environment variables for secrets
- Observability — structured logging (Pino), cost tracking, progress callbacks, JSONL progress events
| Category | Technology |
|---|---|
| Language | TypeScript 5.x, Node.js >= 20.6 |
| CLI | Commander.js |
| LLM | OpenAI, Anthropic, Google Gemini |
| TTS | kokoro-js (local, free) |
| ASR | @remotion/whisper-cpp |
| Visuals | Pexels, Nanobanana (AI), DepthFlow (2.5D) |
| Video | Remotion 4.0 |
| Validation | Zod validation |
| Testing | Vitest, promptfoo (LLM evals) |
- Terminology:
registry/ubiquitous-language.yaml→docs/reference/GLOSSARY.md - Repo facts:
registry/repo-facts.yaml→docs/reference/REPO-FACTS.md,docs/reference/ENVIRONMENT-VARIABLES.md
Update workflow: edit the YAML, then run npm run repo-facts:gen or npm run glossary:gen.
skills/— skill docsflows/—45ck/prompt-languageflow docs plus executable.flowmanifestsscripts/harness/— optional repo-side runnersdocs/direction/— migration plan and boundariesarchive/legacy-cli/— frozen landing zone for surfaces that will be demoted or removed
The live cm surface is intentionally small. Use it for config,
diagnostics, MCP, and render compatibility. New agent-facing work should
prefer skills, flows, and scripts/harness/*.
- Framework: Vitest (unit + integration + E2E)
- Stubs:
src/test/stubs/— FakeLLMProvider, FakeTTSProvider, FakeASRProvider, etc. - LLM evals: promptfoo configs in
evals/ - Local checks: typecheck, lint, format, and Vitest — run
npm run quality
git clone https://github.com/45ck/content-machine.git
cd content-machine && npm install && cp .env.example .env
node --import tsx scripts/harness/ingest.ts # Run a runtime script from source
npm run cm -- --help # Run legacy CLI from source
npm test # Watch mode
npm run quality # Local checksThis project uses bd (beads) for issue tracking when the bd
binary is installed. Run bd prime to see full workflow context and
commands.
bd ready # Find available work
bd show <id> # View issue details
bd update <id> --claim # Claim work
bd close <id> # Complete work- Use
bdfor ALL task tracking when available — do NOT use TodoWrite, TaskCreate, or markdown TODO lists - Run
bd primefor detailed command reference and session close protocol - Use
bd rememberfor persistent knowledge — do NOT use MEMORY.md files
Keep work local unless the user explicitly asks for a push or release. Before handoff, run the focused local checks that match the changed surface, summarize what passed, and leave the worktree status clear.