Help us improve
Share bugs, ideas, or general feedback.
From AFK Coding Pipeline
Use after all slices of a feature are implemented and before QA/review — a dedicated cleanup pass over the branch that collapses duplication across slices, removes dead code, and fixes naming, because the implementation loops will not do this on their own.
npx claudepluginhub alexanderop/afk --plugin afkHow this skill is triggered — by the user, by Claude, or both
Slash command
/afk:refactor-passThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
LLMs cheat on refactoring. Even with red-green-refactor forced in every loop,
Provides behavioral guidelines to reduce common LLM coding mistakes, focusing on simplicity, surgical changes, assumption surfacing, and verifiable success criteria.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Guides systematic root-cause debugging when tests fail, builds break, or unexpected errors occur. Provides a structured triage checklist to preserve evidence, localize, and fix issues instead of guessing.
Share bugs, ideas, or general feedback.
LLMs cheat on refactoring. Even with red-green-refactor forced in every loop, the "refactor" step shrinks to renaming a variable. The deeper work — extracting the shared helper, collapsing the duplication that four independent slices each introduced, killing dead branches — never happens, because each loop only sees its own slice. This pass sees the whole branch.
Iron Laws:
This skill runs in a forked context (diffs and test output stay out of the main
session — only the summary comes back). Orient yourself from disk: the base ref
and branch are in .afk/pipeline/<slug>.md when a pipeline is running;
otherwise use git merge-base with the default branch.
Scope: git diff {base}..HEAD --stat — only files this branch touched, plus
files they duplicate against.
Work one category at a time. In each category: find ONE offender, fix it, run
the full checks from .afk/config.json, commit. Repeat until the category is
dry, then move on:
| Category | What to hunt |
|---|---|
| Duplication | The same logic in 2+ slices (each loop solved it independently). Extract to a shared function/composable — in the location the codebase's conventions dictate. |
| Cross-slice consistency | Same concept, different names/patterns across slices (one slice's bookingDraft, another's draftBooking). Pick one, align. |
| Type holes | any, as casts, @ts-ignore, untyped boundaries. One unfixed any gets copied everywhere by the next agent. |
| Dead code | Unused exports, unreachable branches, commented-out blocks, leftover scaffolding from abandoned approaches. |
| Long units | Functions/files that grew past the codebase's norm. Split along responsibility lines. |
| Error handling | Swallowed errors, generic catch-and-log, inconsistent error shapes across the slices' endpoints. |
Small commits, one concern each — the human reviewer must be able to verify "behavior unchanged" per commit at a glance.
Every smell you fixed more than once is a candidate for backpressure. Before finishing, list the recurring ones and either:
afk:reflect to file into .afk/brain/.Every shortcut you catch the agent taking, ban it with a rule — otherwise the next pipeline run reintroduces it.
| Thought | Reality |
|---|---|
| "The code looks fine, skip the pass" | Four independent loops just wrote code without seeing each other. There IS duplication. Look. |
| "While I'm here, this function could also do X" | Behavior change. Out. File it as a follow-up instead. |
| "I'll batch all the cleanups into one commit" | One concern per commit, or the reviewer can't verify behavior is unchanged. |
| "This abstraction would be elegant" | Collapse duplication into the dumbest shared thing that works. Speculative elegance is how refactors introduce bugs. |
| "Tests are slow, I'll run them at the end" | After EVERY commit. A refactor that breaks tests at step 9 of 12 is unbisectable. |