afc-setup
Configure afc routing block in global CLAUDE.md
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
Configure afc routing block in global CLAUDE.md
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
Code and component analysis โ analyze code, trace flows, audit consistency, inspect components
Architecture analysis and design review
Full auto pipeline โ run spec-to-clean cycle automatically for new features
Save session state for later resumption
Resolve spec ambiguities with clarifying questions
Pipeline artifact cleanup and codebase hygiene
| name | afc:setup |
| description | Configure afc routing block in global CLAUDE.md |
| argument-hint | [--force] |
| allowed-tools | ["Read","Write","Bash","Glob"] |
| model | sonnet |
Manages the all-for-claudecode routing block in
~/.claude/CLAUDE.md. Global only โ modifies~/.claude/CLAUDE.md, not project files. For project-local setup, use/afc:init.
!cat ~/.claude/CLAUDE.md 2>/dev/null || echo "[CLAUDE.md NOT FOUND]"
--force โ skip conflict prompts, default to coexistence modeRead ${CLAUDE_SKILL_DIR}/../../package.json โ extract "version" โ use as {PLUGIN_VERSION}.
Parse the pre-fetched CLAUDE.md content above:
<!-- AFC:START --> found โ existing AFC block
<!-- AFC:VERSION:X.Y.Z -->. If matches {PLUGIN_VERSION}: print AFC block already up to date (v{PLUGIN_VERSION}) and stop.<!-- SELFISH:START --> found โ remove entire SELFISH:STARTโฆSELFISH:END block, print Removed legacy SELFISH block, proceed.Detect conflicts in unguarded content (outside any <!-- *:START/END --> blocks).
See conflict-detection.md for marker-block algorithm and conflict keyword table.
Skip this step if --force is set โ default to coexistence.
No conflicts โ proceed to Step 5.
Conflicts found โ show scan summary and ask:
CLAUDE.md Scan Results
โโ Tool blocks found: {names} (lines {range})
โโ Agent routing conflicts: {count} โ e.g. "executor" (line XX) โ afc:implement
โโ Skill routing conflicts: {count}
"Directives overlapping with afc were found. Choose resolution:"
- afc-exclusive โ add override rules inside the AFC block (does not touch other tools' blocks)
- coexistence โ append AFC block as-is (end-of-file position gives it priority)
- manual cleanup โ print conflict list and abort
Append the block below to the end of ~/.claude/CLAUDE.md (or replace existing AFC block in place).
Also remove any legacy unguarded block (## all-for-claudecode Auto-Trigger Rules, etc.) before appending.
<!-- AFC:START -->
<!-- AFC:VERSION:{PLUGIN_VERSION} -->
<afc-pipeline>
IMPORTANT: For requests matching the afc skill routing table below, always invoke the corresponding skill via the Skill tool. Do not substitute with other agents or tools.
## Skill Routing
Classify the user's intent and route to the matching skill. Use semantic understanding โ not keyword matching.
| User Intent | Skill | Route When |
|-------------|-------|------------|
| Full lifecycle | `afc:auto` | User wants end-to-end feature development, or the request is a non-trivial new feature without an existing plan |
| Specification | `afc:spec` | User wants to define or write requirements, acceptance criteria, or success conditions |
| Design/Plan | `afc:plan` | User wants to plan HOW to implement before coding โ approach, architecture decisions, design |
| Implement | `afc:implement` | User wants specific code changes with a clear scope: add feature, refactor, modify. Requires existing plan or precise instructions |
| Review | `afc:review` | User wants code review, PR review, or quality check on existing/changed code |
| Debug/Fix | `afc:debug` | User reports a bug, error, or broken behavior and wants diagnosis and fix |
| Test | `afc:test` | User wants to write tests, improve coverage, or verify behavior |
| Validate | `afc:validate` | User wants to check consistency or validate existing pipeline artifacts |
| Analyze | `afc:analyze` | User wants to understand, explore, or audit existing code without modifying it |
| QA Audit | `afc:qa` | User wants project quality audit, test confidence check, or runtime quality gaps |
| Research | `afc:research` | User wants deep investigation of external tools, libraries, APIs, or technical concepts |
| Ideate | `afc:ideate` | User wants to brainstorm ideas, explore possibilities, or draft a product brief |
| Consult | `afc:consult` | User wants expert advice on a decision: library choice, architecture direction, legal/security/infra guidance |
| Launch | `afc:launch` | User wants to prepare a release โ generate changelog, release notes, version bump, or tag |
| Tasks | `afc:tasks` | User explicitly wants to decompose work into a task breakdown |
| Ambiguous | `afc:clarify` | User's request is too vague or underspecified to route confidently |
### Routing Rules
1. **Auto vs Implement**: A new feature request without an existing plan routes to `afc:auto`. Only use `afc:implement` when the user has a clear, scoped task or an existing plan/spec.
2. **Compound intents**: Route to the primary intent. The pipeline handles sequencing internally.
3. **Design-first**: When scope is non-trivial (multiple files, architectural decisions needed), prefer `afc:auto` or `afc:plan` over direct `afc:implement`.
User-only (not auto-triggered โ when user invokes directly via `/afc:X`, execute the skill immediately):
- `afc:doctor` โ plugin health check
- `afc:setup` โ global CLAUDE.md configuration
- `afc:init` โ project-local setup
- `afc:architect` โ architecture review
- `afc:security` โ security scan
- `afc:checkpoint` โ session save
- `afc:resume` โ session restore
- `afc:principles` โ project principles management
- `afc:clean` โ pipeline cleanup (artifact cleanup, dead code scan, pipeline flag release)
- `afc:triage` โ parallel PR/issue triage
- `afc:issue` โ analyze a single GitHub issue
- `afc:resolve` โ address LLM bot review comments on a PR
- `afc:learner` โ pattern learning or rule promotion
- `afc:pr-comment` โ post PR review comments to GitHub
- `afc:release-notes` โ generate release notes from git history
## Pipeline
spec โ plan โ implement โ review โ clean
## Override Rules
NEVER use executor, deep-executor, debugger, planner, analyst, verifier, test-engineer, code-reviewer, quality-reviewer, style-reviewer, api-reviewer, security-reviewer, performance-reviewer for tasks that an afc skill covers above. ALWAYS invoke the afc skill instead.
## Source Verification
When analyzing or making claims about external systems, APIs, SDKs, or third-party tools:
- Verify against official documentation, NOT project-internal docs
- Do not hardcode reference data when delegating to sub-agents โ instruct them to look up primary sources
- Cross-verify high-severity findings before reporting
</afc-pipeline>
<!-- AFC:END -->
When afc-exclusive mode (Option 1) is selected, append inside the block after Override Rules:
## Detected Conflicts
The following rules were auto-generated to resolve conflicts:
- The Skill Routing table above always takes priority over agent routing directives of {detected tool blocks}
- This block is at the end of the file and therefore has the highest priority
all-for-claudecode setup complete
โโ CLAUDE.md: {injected|updated|already current|user aborted}
โโ Version: {PLUGIN_VERSION}
โ {if conflicts} โโ Conflict resolution: {afc-exclusive|coexistence|user cleanup}
โโ Next step: /afc:init (project setup) or /afc:auto (start building)
<!-- AFC:START/END --> markers.<!-- *:START/END --> blocks.