Workshop · 6 chapters · ~100 minutes · free, self-paced

Stop repeating yourself to your agent.

Encode the rule once. A prompt to write it down. A hook to block the diff. A subagent to audit the rest of the repo. A skill to name the workflow. By the end you've shipped all four against a planted bug — and ported the pattern to a rule you actually repeat.

0 of 6 complete 0%
Prompts · Hooks · Subagents · Skills

The pattern this fixes

You've corrected your agent the same way three times this week. The barrel import that breaks tree-shaking. The test file that uses `any`. The migration that ships without a backfill. The rule lives in your head — until you encode it. A prompt writes it down. A hook blocks it at the lifecycle. A subagent audits the rest of the repo. A skill gives the workflow a name you can call.

What you'll build

Four artifacts. One bug. One workflow.

Each lab ends with a working snippet you can paste into your own repo. These are the four you'll ship.

01 · Prompt

A prompt that defines the rule

A definitive instruction document in `.claude/prompts/` — what counts as a violation, what doesn't, and the suggested fix. The source of truth the next three layers reference.

.claude/prompts/no-barrel-imports.md
# .claude/prompts/no-barrel-imports.md
## Rule
A barrel import is any import whose specifier
ends in /index or resolves to a re-exporting
directory. Rewrite to the leaf path. Do not
rename symbols.

02 · Hook

A hook that rejects barrel imports

A PreToolUse hook fires on every Write/Edit and blocks the diff before the agent finishes the turn.

.claude/hooks/no-barrel-imports.sh
# .claude/hooks/no-barrel-imports.sh
grep -nE "from ['\"]\..*/index['\"]" "$CLAUDE_FILE_PATH" \
  && { echo "Barrel import. Import the leaf instead." >&2; exit 2; }

03 · Subagent

A subagent that audits the codebase

An audit subagent sweeps the rest of the repo for siblings of the bug the hook just caught, and reports them grouped by file.

.claude/agents/barrel-auditor.md
# .claude/agents/barrel-auditor.md
---
name: barrel-auditor
description: Sweep for barrel-import siblings.
tools: [Grep, Read]
---
Find every `from '.../index'` outside tests.
Group by file. Suggest the leaf path.

04 · Skill

A skill that wires both into one command

/fix-barrels invokes the auditor, applies the codemod, and re-runs the hook to verify. One name, the whole workflow.

.claude/skills/fix-barrels.md
# .claude/skills/fix-barrels.md
---
name: fix-barrels
description: Audit barrels, rewrite to leaves, verify.
---
1. Run barrel-auditor.
2. For each finding, rewrite the import.
3. Trigger the hook to confirm green.

Syllabus

Six chapters. Build forward.

Each chapter is a written lab with a working snippet at the end. Your progress is stored in this browser — resume any time.

  1. 01

    Lab setup: clone and plant the bug

    Five minutes to a working starter repo with one planted barrel-import bug. From this point onward, the labs build the hook, subagent, and skill that catch it.

    3 min
  2. 02

    Lab 1 — Prompt

    Twelve minutes. One markdown file. A definitive instruction document that says — once, in writing — what counts as a barrel import and what the agent should do about it. The source of truth the next three labs all reference.

    4 min
  3. 03

    Lab 2 — Hook

    Fifteen minutes. One shell script. Exit code 2. By the end of this lab, Claude Code physically cannot write a barrel import into the starter repo.

    3 min
  4. 04

    Lab 3 — Subagent

    Twenty minutes. One markdown file. A read-only subagent that scans for remaining barrel imports and returns a pinned table with concrete fix suggestions — the judgement call the hook can't make.

    5 min
  5. 05

    Lab 4 — Skill

    Fifteen minutes. One slash command. /de-barrel calls the auditor, walks each row, and lets the hook guard every edit. The team-facing surface that makes the workflow invocable in eight keystrokes.

    4 min
  6. 06

    Capstone: design your own stack

    Ten minutes. No code. Pick one rule you've left in PR comments three times this month and design its hook, its subagent, and its skill. A worksheet, an example, and the heuristic for when each layer earns its keep.

    6 min

Audience check

Is this for you?

Yes if

  • You already use Claude Code daily and feel the friction of repeating the same correction.
  • You want repo-local automation that ships with the code, not a vendor's dashboard.
  • You read the agent-ready trilogy and want to build the muscle, not just the model.

Probably not if

  • You're brand-new to Claude Code — start with the lifecycle primer essay first.
  • You're looking for prompt-engineering tips. This is about lifecycle code, not prompts.
  • You want a video course. Every chapter is a written lab; bring your own terminal.

Before you start

Prerequisites

Claude Code installed and authenticated
Every lab runs against your local CLI.
Node ≥ 20 and git
The starter repo is a small Node project; git lets you reset between labs.
A real repo you maintain
The capstone asks you to port the triple to a rule you already repeat.
~90 minutes, end-to-end
Labs build on each other — easier in one sitting than across days.

Questions

FAQ

Is it really free?

Yes. Every chapter is a public blog post. No login, no email gate, no upsell at the end.

Do I need a paid Claude plan?

A free Claude account is enough to run the hook and skill. The auditor subagent benefits from a higher quota — labs note where you can stub responses if you hit a limit.

Can I use my own repo instead of the starter?

After lab 1, yes. The starter exists so the planted bug is identical for everyone; once you've shipped one hook, point it at your own codebase.

How long does this really take?

~100 minutes cold. ~75 if you've already read the agent-ready trilogy. The capstone is a 10-minute worksheet — don't skip it.

What if I get stuck on a lab?

Each lab ends with a 'reset and re-run' block — drop the changes, copy the working snippet, then read the diff. Stuck for real? Ping me; the link is in the site footer.

Your turn

Ready to encode the rule?

~90 minutes from clone to capstone. Bring a terminal and the rule you keep repeating.

0:00 0:00