From AFK
Use when the agent is about to implement, edit code, execute a plan, fix a bug, build a feature, or make repo changes, especially when task complexity or orchestration needs are unclear. Do not start editing code, writing tests, or running build or test commands directly — load this skill first to triage and route.
How this skill is triggered — by the user, by Claude, or both
Slash command
/afk:implementThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Load this skill before implementation starts. First decide whether the work is
Load this skill before implementation starts. First decide whether the work is simple enough to do directly or complex enough to justify orchestration.
Simple local changes belong in the main conversation. Complex work uses the
lead-orchestrated shape: the Opus implement-orchestrator decides the
architecture, contracts, boundaries, file ownership, data flow, error handling,
and integration order; Sonnet implementation-worker agents run bounded local
TDD slices inside those decisions.
Use this skill before any repo-changing implementation work, including:
afk:grill.Do not wait until the task feels complicated. This skill is the gate before touching files.
Before editing, classify the task.
The default for any real code change is to orchestrate. Doing it yourself in the lead is the narrow exception, reserved for changes with no behavior logic to test.
Do the work directly only when all of these are true:
Use lead-orchestrated slices when any of these are true:
afk:grill or afk:plan (brain/plans/) exists,
or the user provides a worked-out design.Per-edit size does not downgrade the triage. Many small, near-identical edits spread across many files is multi-file work — orchestrate it; do not collapse it into the lead just because each individual diff looks trivial. The fact that a shared contract must be designed first is the signal to orchestrate, not to do it all yourself: hand the plan to the orchestrator, which freezes the contract and then fans the mechanical application out to workers (see the refactor recipe below).
A finished plan does not downgrade the triage either. "The plan already froze every contract, so there is nothing left to orchestrate" is a reason to hand the plan straight to the orchestrator, not a reason to go direct — orchestration still buys bounded parallel slices and independent per-slice review even when the architecture is fully decided. Architecture-is-decided and orchestration-adds-no- value are different claims; do not conflate them.
For genuinely test-free work (docs, config, copy, formatting, a literal one-liner):
Do not create fake slices, dispatch subagents, or write a heavyweight plan for genuinely local work. Conversely, if the change needs a test, it is not this case — go to orchestrated implementation, even when it is one file.
For complex work, hand the plan directly to AFK's read-only orchestrator and let it do the research and the design:
implement-orchestrator: Opus, read-only, reads the source, decides
architecture, contracts, slice boundaries, sequencing, and reviews workers.implementation-worker: Sonnet, edit-capable, owns one fixed local TDD
slice at a time.Do not research or design first. The lead does not read the source, decide
which files or modules to change, write a delegation analysis, or build any
part of the implementation before delegating — all of that is the
orchestrator's job. The lead's only inputs to implement-orchestrator are:
brain/plans/<slug>.md from afk:grill or
brain/plans/<slug>/ from afk:plan, or the plan/design the user provided —
locate it under brain/plans/ and pass it directly.The orchestrator then reads the source, decides the contracts and slice boundaries, and briefs the workers. Hand it the plan and let it design; do not pre-chew the architecture for it.
The main conversation still owns final acceptance: after the orchestrator returns, read the diff, run verification, and decide whether the work is done.
If the packaged agents are unavailable in the current Claude Code version or plugin loading path, keep the same shape in the main conversation: read the plan, decide contracts first, then dispatch bounded workers manually.
When the work is "introduce a shared X and apply it across N files" — a new component, type, helper, or endpoint shape with many call sites — this is the default orchestration shape, not a direct edit. Hand it to the orchestrator like any other plan; do not build or freeze the shared abstraction in the lead. The orchestrator:
implementation-worker per call site (or per small group). Each worker
gets the frozen signature, the exact file, and a concrete migrated example
to mimic.Do not collapse this into the lead on the grounds that "each edit is tiny" or "the brief is longer than the diff." Across N files the brief is written once and reused; the per-file diff is the wrong unit to measure. The lead's job is to recognize the shape and route it, not to design or build the abstraction.
Use the smallest orchestration primitive that fits:
| Primitive | Use for |
|---|---|
implement-orchestrator | Default for complex AFK implementation; read-only architecture and worker delegation |
| Plain subagents | A few self-contained implementation, test, or review slices when packaged agents are unavailable |
| Agent teams | Several long-running peers that need a shared task list, direct communication, or plan approval before edits |
| Dynamic workflows | Dozens to hundreds of repeatable agents for repo-wide audits, migrations, or cross-checked research |
Subagents start with zero context unless explicitly forked. The orchestrator writes the worker briefs; in the manual fallback the lead does. Each worker brief must include:
Use implementation-worker for edit-capable implementation slices by default.
Only choose a different worker when the task clearly needs a specialized agent
or a cheaper model for mechanical boilerplate.
Each slice is a vertical tracer bullet: one behavior with its test and its implementation owned by one worker. Never split the work into a tests-only slice and a separate implementation-only slice — that is horizontal slicing, and it produces tests written against imagined behavior. Sequence the thinnest end-to-end path first to prove it works, then add edge cases as incremental slices.
Maximize parallelism: dispatch independent slices (disjoint files, no shared contract) concurrently, in the waves the plan provides when it has them. Run dependent slices sequentially. Never let two workers edit the same file concurrently.
Nested subagents are supported in modern Claude Code, but use them sparingly.
AFK's default hierarchy is implement -> implement-orchestrator ->
implementation-worker. Do not create deeper trees unless the orchestrator has
several independent review or implementation branches and can keep their
outputs concise.
For implementation slices, every worker must run red-green-refactor inside its boundary:
For behavior-preserving rewrites and migrations, a characterization or golden-master baseline captured before the change and kept green throughout is a valid substitute for per-slice red-green: the captured baseline is the failing-first signal — any drift turns it red. In that mode, brief workers to keep the baseline byte-identical rather than to author a new failing test per slice.
A worker's "done" report is a claim, not a fact.
After each worker returns:
git diff, not just the summary.When all slices land, run the full relevant test suite and read the complete diff end-to-end for integration issues that slice reviews could not see. The static gate — typecheck, unit tests, file existence — does not exercise runtime behavior or cross-slice interactions. Before accepting:
STOP before dispatching workers when:
Ask only for the missing decision or permission. Otherwise, decide in the lead context and keep moving.
| Thought | Reality |
|---|---|
| "I'll start coding and load the skill if it gets complicated" | This skill is the gate before implementation. Triage first, then act. |
| "Any implementation task should use subagents" | Simple local work is faster and safer in the main conversation. Orchestrate only when complexity justifies it. |
| "It's one file, I'll just write the code and the test myself" | A test means behavior worth verifying. One file or not, route it through implement-orchestrator and let a worker run the TDD slice. Only test-free changes stay in the lead. |
| "A worker can explore and decide the approach" | Workers get decided contracts. The orchestrator reads the source and decides architecture first, then briefs — workers never explore and pick the approach themselves. |
| "The brief is getting long, I'll just say 'follow the plan'" | The subagent has never seen the plan. Always paste the full spec verbatim, alongside the slice task. |
| "It reported success and tests pass" | Whose tests? Read the diff. Workers can delete failing tests, hardcode fixtures, or stub the hard part with a TODO. |
| "The orchestrator is read-only, so it verified everything" | Read-only means no shell verification. The main conversation must run final checks after workers edit. |
| "Nested subagents are supported, so use them for every task" | Hierarchy is overhead. Keep AFK's default tree shallow unless the branches are independent and bounded. |
| "This task is too hard for sonnet, I'll write a smarter prompt" | If it needs a smarter prompt, it needs a smarter model: do it yourself. |
| "I'll dispatch all tasks at once" | Parallelism only belongs across genuinely independent files and contracts. |
| "The edits are tiny, so I'll just do all N inline" | Per-edit size doesn't change the triage. N near-identical edits across N files is multi-file work: freeze the shared contract, then fan out. |
| "The brief would be longer than the diff" | True for one-off local work, not a fan-out. Across N files you write one parameterized brief and reuse it — the per-file diff is the wrong unit. |
| "The shared component keeps changing, so workers would collide" | That's a sequencing problem, not a reason to stay direct. The orchestrator freezes the shared file first, then dispatches the call-site edits in parallel. |
| "I'll design the shared contract in the lead and just hand workers the call sites" | Contract design is the orchestrator's job. Designing it yourself is delegated architecture in reverse. Hand it the plan; let it freeze the contract and fan out the work. |
| "The plan already fixed every contract, so I'll just execute it directly" | A decided plan is the orchestrator's input, not a reason to skip it. Frozen contracts still need bounded parallel slices and independent review. Hand the plan to implement-orchestrator. |
| "Typecheck and unit tests are green, so it's done" | The static gate doesn't exercise runtime or cross-slice behavior. Boot the page, round-trip the form, run the migration chain. Green tests have shipped blank pages, 422s, and broken foreign keys. |
| "One worker writes the tests, another writes the code" | That's horizontal slicing — tests written against imagined behavior. Each slice is one behavior with its test and implementation together, run red-green-refactor by one worker. |
| "The test passes, so it's a good test" | A green test that mocks internal collaborators, asserts call counts/order, tests private methods, or verifies through a side channel is coupled to implementation and breaks on refactor. Reject it; tests verify observable behavior through the public interface. |
Final responses after implementation should include:
When everything is green, suggest afk:simplify as the next step.
npx claudepluginhub alexanderop/afk --plugin afkFetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.
Provides a checklist for code reviews covering functionality, security, performance, maintainability, tests, and quality. Use for pull requests, audits, team standards, and developer training.