This lesson connects four previously separate Claude Code pieces, CLAUDE.md, skills, agents, and MCP servers, plus hooks and headless mode, into one integrated content pipeline. It covers four skills (/research, /draft, /review, /repurpose), four agents, three hooks, and three headless automation patterns that take a topic from research through drafting, review, and platform-specific repurposing.
What you will be able to do
- Wire CLAUDE.md, skills, agents, MCP servers, hooks, and headless mode into one content pipeline instead of four disconnected pieces.
- Build four slash-command skills (/research, /draft, /review, /repurpose) that pass arguments through $ARGUMENTS and route to dedicated agents.
- Run the pipeline outside the terminal with claude -p, triggered by cron, an n8n webhook, or a GitHub Action.
- Generate platform-specific copy (a LinkedIn post, an X thread, three Substack Notes) from one draft, stopping short of pushing it live.
- Apply a slug-derivation convention and an immutability rule so each skill finds the correct upstream file every time, even weeks later.
Before you start
- Claude Code set up and used interactively, ideally having built or reviewed Lessons 1 to 4 (content multiplier, CLAUDE.md/skills/hooks stack, MCP servers, the 3-agent team), since this lesson wires those pieces together rather than building them from scratch.
- MCP servers configured for Perplexity and Firecrawl, with Notion optional, since the researcher agent depends on them for live data.
- A project CLAUDE.md file that defines file conventions, brand voice rules, and slug derivation logic.
- Basic familiarity with cron, n8n, or GitHub Actions if you want to use the headless automation patterns.
Reference
| Skill / setting | What it does | Key detail |
|---|---|---|
| /research $TOPIC | Researcher agent gathers live data via MCP | Writes drafts/{slug}-research.md |
| /draft $TOPIC | Writer agent drafts from the research brief | Looks up drafts/{slug}-research.md using the same slug |
| /review | Reviewer agent scores the draft and flags fixes | permissionMode: plan, disallowedTools: Edit |
| /repurpose $PATH | Multiplier agent creates platform-specific copy | Writes distribution/{slug}/*.md, does not post or schedule |
| acceptEdits permission mode | Auto-approves file edits, still asks for bash commands | Used for trusted pipeline runs |
| plan permission mode | Read-only, cannot edit anything | Pinned into the reviewer agent's frontmatter |
| block-dangerous.sh hook | Fires on PreToolUse for Bash | Blocks rm -rf and git push --force, regardless of permission mode |
| quality-check.sh hook | Fires on PostToolUse | Flags forbidden phrases only on drafts/*-draft.md files over 1,000 words |
Common errors and fixes
| What goes wrong | The fix |
|---|---|
| quality-check hook fires on every intermediate save, the writer edits to fix the flagged phrase, which triggers the hook again (feedback loop). | Restrict the hook to PostToolUse on drafts/*-draft.md files longer than 1,000 words only, the dual guard described in Layer 5. |
| /draft cannot find the right research file, or silently picks the wrong one. | Define slug derivation (lowercase, hyphenate spaces, strip non-alphanumeric, truncate to 60 chars) in CLAUDE.md so /draft always looks for drafts/{slug}-research.md. |
| Editing a *-research.md or *-draft.md file after the next stage has already run against it breaks reproducibility across sessions and team members. | Treat those files as immutable. Re-run the upstream skill instead of hand-editing the file. |
| The reviewer agent could rewrite the draft it is supposed to be scoring. | Pin permissionMode: plan and disallowedTools: Edit in the reviewer's agent frontmatter, enforced by the system prompt regardless of what the prompt says. |
| Assuming acceptEdits or auto-mode permission settings are enough to stop a dangerous command. | Hooks like block-dangerous.sh fire on every Bash PreToolUse regardless of permission mode, so rm -rf and git push --force stay blocked even in acceptEdits. |
Read the full walkthrough
The complete lesson, with screenshots and any downloads, is published on Substack as part of Claude Code Masterclass: Build AI Systems Without Writing Code.
More in this section
Continue the course
Browse all lessons in the Claude Code Masterclass: Build AI Systems Without Writing Code course, or subscribe to the GenAI Unplugged newsletter to get new lessons in your inbox.