all-for-claudecode 2.11.0 → 2.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +1 -1
- package/MIGRATION.md +2 -2
- package/README.md +10 -4
- package/bin/cli.mjs +1 -0
- package/package.json +1 -1
- package/scripts/afc-consistency-check.sh +6 -6
- package/scripts/afc-doctor.sh +18 -4
- package/scripts/afc-user-prompt-submit.sh +5 -1
- package/scripts/session-start-context.sh +1 -1
- package/skills/architect/SKILL.md +1 -1
- package/skills/auto/SKILL.md +24 -24
- package/skills/clean/SKILL.md +3 -3
- package/skills/debug/SKILL.md +1 -1
- package/skills/doctor/SKILL.md +23 -19
- package/skills/implement/SKILL.md +8 -8
- package/skills/init/SKILL.md +19 -176
- package/skills/issue/SKILL.md +216 -0
- package/skills/plan/SKILL.md +1 -1
- package/skills/qa/SKILL.md +1 -1
- package/skills/resolve/SKILL.md +245 -0
- package/skills/review/SKILL.md +1 -1
- package/skills/setup/SKILL.md +219 -0
- package/skills/spec/SKILL.md +6 -5
- package/skills/tasks/SKILL.md +4 -4
- package/skills/test/SKILL.md +1 -1
- package/skills/triage/SKILL.md +1 -1
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: afc:resolve
|
|
3
|
+
description: "Analyze and address LLM review comments on PR — use when the user asks to resolve, fix, or respond to bot review comments (CodeRabbit, Copilot, Codex) on a pull request"
|
|
4
|
+
argument-hint: "<PR URL, owner/repo#number, #number, or number>"
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Read
|
|
7
|
+
- Grep
|
|
8
|
+
- Glob
|
|
9
|
+
- Bash
|
|
10
|
+
- Edit
|
|
11
|
+
- Write
|
|
12
|
+
- AskUserQuestion
|
|
13
|
+
model: sonnet
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
# /afc:resolve — LLM Review Comment Resolution
|
|
17
|
+
|
|
18
|
+
> Collects LLM bot review comments (CodeRabbit, Copilot, Codex, etc.) from a PR, classifies each as VALID/NOISE/DISCUSS, applies fixes for VALID items, and asks the user about DISCUSS items.
|
|
19
|
+
> Creates a single commit with all fixes and outputs a summary report.
|
|
20
|
+
|
|
21
|
+
## Arguments
|
|
22
|
+
|
|
23
|
+
- `$ARGUMENTS` — (required) One of:
|
|
24
|
+
- PR number: `456` or `#456`
|
|
25
|
+
- GitHub URL: `https://github.com/owner/repo/pull/456`
|
|
26
|
+
- Cross-repo: `owner/repo#456`
|
|
27
|
+
|
|
28
|
+
## Execution Steps
|
|
29
|
+
|
|
30
|
+
### 1. Prerequisites Check
|
|
31
|
+
|
|
32
|
+
Verify `gh` CLI is available and authenticated:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
gh --version >/dev/null 2>&1 && gh auth status >/dev/null 2>&1
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
If either check fails:
|
|
39
|
+
- Output: `[afc:resolve] Error: GitHub CLI (gh) is not installed or not authenticated. Install from https://cli.github.com/ and run 'gh auth login'.`
|
|
40
|
+
- **Abort immediately.**
|
|
41
|
+
|
|
42
|
+
### 2. Parse Input
|
|
43
|
+
|
|
44
|
+
Determine the input format and extract owner, repo, and PR number:
|
|
45
|
+
|
|
46
|
+
1. **GitHub URL** (`https://github.com/{owner}/{repo}/pull/{number}`):
|
|
47
|
+
- Extract owner, repo, number from URL path segments
|
|
48
|
+
- Set `GH_REPO_FLAG="--repo {owner}/{repo}"`
|
|
49
|
+
|
|
50
|
+
2. **Cross-repo** (`{owner}/{repo}#{number}`):
|
|
51
|
+
- Split on `#` — left part is `owner/repo`, right part is number
|
|
52
|
+
- Set `GH_REPO_FLAG="--repo {owner}/{repo}"`
|
|
53
|
+
|
|
54
|
+
3. **Local number** (`456` or `#456`):
|
|
55
|
+
- Strip leading `#` if present
|
|
56
|
+
- Set `GH_REPO_FLAG=""` (use current repo from git remote)
|
|
57
|
+
|
|
58
|
+
### 3. Collect Review Comments
|
|
59
|
+
|
|
60
|
+
Collect all review comments from the PR:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
gh pr view {number} {GH_REPO_FLAG} --json reviews,comments,url,title,headRefName
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Additionally, collect inline review comments:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
gh api repos/{owner}/{repo}/pulls/{number}/comments --paginate
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
If `--repo` flag was not used, derive owner/repo from `gh repo view --json owner,name`.
|
|
73
|
+
|
|
74
|
+
If API call fails → output the error and **abort**.
|
|
75
|
+
|
|
76
|
+
### 4. Filter Bot Comments
|
|
77
|
+
|
|
78
|
+
Identify LLM bot comments by checking the comment author's login:
|
|
79
|
+
|
|
80
|
+
**Known bot patterns**:
|
|
81
|
+
- `coderabbitai[bot]` — CodeRabbit
|
|
82
|
+
- `copilot[bot]` or `github-copilot[bot]` — GitHub Copilot
|
|
83
|
+
- `codex[bot]` — Codex
|
|
84
|
+
- Any login ending with `[bot]` — generic bot detection
|
|
85
|
+
|
|
86
|
+
**Filter rules**:
|
|
87
|
+
- Keep only comments where the author matches a bot pattern
|
|
88
|
+
- Discard all human reviewer comments (MVP scope)
|
|
89
|
+
- If an inline comment is marked as `outdated` by GitHub → tag as `[OUTDATED]`
|
|
90
|
+
|
|
91
|
+
If 0 bot comments found:
|
|
92
|
+
- Output: `No LLM bot review comments found on PR #{number}.`
|
|
93
|
+
- **Exit gracefully** (success, not error).
|
|
94
|
+
|
|
95
|
+
### 5. Classify Each Comment
|
|
96
|
+
|
|
97
|
+
For each bot comment, analyze the content and classify:
|
|
98
|
+
|
|
99
|
+
| Classification | Criteria | Action |
|
|
100
|
+
|---------------|----------|--------|
|
|
101
|
+
| **VALID** | Real bug, security issue, clear improvement, correct suggestion with code context | Auto-fix |
|
|
102
|
+
| **NOISE** | Style preference difference, intentional design choice, false positive, already addressed | Skip |
|
|
103
|
+
| **DISCUSS** | Architecture decision needed, tradeoff exists, multiple valid approaches, no code `path`/`position` (non-code feedback) | Ask user |
|
|
104
|
+
|
|
105
|
+
**Classification guidelines**:
|
|
106
|
+
- If the comment points to a concrete bug (null check, off-by-one, resource leak) → **VALID**
|
|
107
|
+
- If the comment is about naming convention or style that differs from project rules → **NOISE**
|
|
108
|
+
- If the comment suggests a refactor with pros/cons → **DISCUSS**
|
|
109
|
+
- If multiple bots give conflicting advice on the same line → **DISCUSS**
|
|
110
|
+
- If the comment is on an `[OUTDATED]` diff → **NOISE** (code already changed)
|
|
111
|
+
|
|
112
|
+
Also collect from each comment:
|
|
113
|
+
- `file_path`: the file the comment targets
|
|
114
|
+
- `line`: the line number (if available)
|
|
115
|
+
- `suggestion`: the suggested change (if available)
|
|
116
|
+
- `body`: the full comment text
|
|
117
|
+
|
|
118
|
+
### 6. Present Classification Summary
|
|
119
|
+
|
|
120
|
+
Before making any changes, present the classification to the user:
|
|
121
|
+
|
|
122
|
+
```
|
|
123
|
+
PR #{number}: {title}
|
|
124
|
+
Branch: {headRefName}
|
|
125
|
+
|
|
126
|
+
Bot comments: {total_count} ({bot_names})
|
|
127
|
+
|
|
128
|
+
VALID ({count}):
|
|
129
|
+
1. [{bot}] {file}:{line} — {1-line summary of issue}
|
|
130
|
+
2. [{bot}] {file}:{line} — {1-line summary of issue}
|
|
131
|
+
|
|
132
|
+
NOISE ({count}):
|
|
133
|
+
1. [{bot}] {file}:{line} — {reason for skipping}
|
|
134
|
+
|
|
135
|
+
DISCUSS ({count}):
|
|
136
|
+
1. [{bot}] {file}:{line} — {question for user}
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### 7. Handle DISCUSS Items
|
|
140
|
+
|
|
141
|
+
For each DISCUSS item, present to the user:
|
|
142
|
+
|
|
143
|
+
```
|
|
144
|
+
[DISCUSS #{n}] {bot_name} on {file}:{line}
|
|
145
|
+
|
|
146
|
+
Comment:
|
|
147
|
+
> {original comment text, truncated to 500 chars}
|
|
148
|
+
|
|
149
|
+
Target code:
|
|
150
|
+
> {relevant code snippet, 5 lines context}
|
|
151
|
+
|
|
152
|
+
If applied: {description of what would change}
|
|
153
|
+
Tradeoff: {why this is not a clear-cut decision}
|
|
154
|
+
|
|
155
|
+
Options:
|
|
156
|
+
1. Apply — treat as VALID, fix the code
|
|
157
|
+
2. Skip — treat as NOISE, record skip reason
|
|
158
|
+
3. Defer — skip for now, revisit later
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
Wait for user response. Reclassify based on choice:
|
|
162
|
+
- `Apply` → move to VALID list
|
|
163
|
+
- `Skip` → move to NOISE list with user's reason
|
|
164
|
+
- `Defer` → keep as DISCUSS in report
|
|
165
|
+
|
|
166
|
+
### 8. Apply VALID Fixes
|
|
167
|
+
|
|
168
|
+
For each VALID comment (including user-accepted DISCUSS items):
|
|
169
|
+
|
|
170
|
+
1. **Read the target file** before modifying
|
|
171
|
+
2. **Identify the exact location** from the comment's `file_path` and `line`
|
|
172
|
+
3. **Apply the fix** using Edit tool:
|
|
173
|
+
- If the bot provided a specific code suggestion → apply it
|
|
174
|
+
- If the bot described the issue without a suggestion → implement the fix based on the description
|
|
175
|
+
4. **Verify** the fix doesn't break the immediate surrounding code context
|
|
176
|
+
|
|
177
|
+
If the target file is in a dirty state (uncommitted changes unrelated to this PR):
|
|
178
|
+
- Warn user: `{file} has uncommitted changes not related to this PR. Proceed?`
|
|
179
|
+
- If user declines → skip this fix, note in report
|
|
180
|
+
|
|
181
|
+
If the target file was deleted in the PR branch:
|
|
182
|
+
- Skip, note `[FILE DELETED]` in report
|
|
183
|
+
|
|
184
|
+
### 9. Commit Changes
|
|
185
|
+
|
|
186
|
+
**Before committing**, show the user a summary of all changes:
|
|
187
|
+
|
|
188
|
+
```
|
|
189
|
+
Changes to commit:
|
|
190
|
+
{file1}: {description of change}
|
|
191
|
+
{file2}: {description of change}
|
|
192
|
+
Total: {N} files changed
|
|
193
|
+
|
|
194
|
+
Proceed with commit? (y/n)
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
**Wait for user confirmation** before committing. This is a safety requirement.
|
|
198
|
+
|
|
199
|
+
**Commit strategy**:
|
|
200
|
+
- If VALID items ≤ 9: single commit
|
|
201
|
+
- If VALID items ≥ 10: group by file/module into 2-3 commits
|
|
202
|
+
|
|
203
|
+
**Commit message format** (single commit):
|
|
204
|
+
```
|
|
205
|
+
resolve LLM review comments on #{number}
|
|
206
|
+
|
|
207
|
+
- fix: {description} ({bot_name})
|
|
208
|
+
- fix: {description} ({bot_name})
|
|
209
|
+
- skip: {reason} (NOISE, {count} items)
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
Do **NOT** push automatically. The user decides when to push.
|
|
213
|
+
|
|
214
|
+
### 10. Output Report
|
|
215
|
+
|
|
216
|
+
```
|
|
217
|
+
Resolve complete
|
|
218
|
+
├─ PR: #{number} — {title}
|
|
219
|
+
├─ Bot comments: {total} ({bot_names})
|
|
220
|
+
├─ VALID: {count} (applied)
|
|
221
|
+
├─ NOISE: {count} (skipped)
|
|
222
|
+
├─ DISCUSS: {count} (applied: {n}, skipped: {n}, deferred: {n})
|
|
223
|
+
├─ Commit: {hash} ({files_changed} files, +{additions}/-{deletions})
|
|
224
|
+
└─ Push: not pushed (run 'git push' when ready)
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
If no VALID items were found (all NOISE/DISCUSS-skipped):
|
|
228
|
+
```
|
|
229
|
+
Resolve complete
|
|
230
|
+
├─ PR: #{number} — {title}
|
|
231
|
+
├─ Bot comments: {total} ({bot_names})
|
|
232
|
+
├─ VALID: 0
|
|
233
|
+
├─ NOISE: {count}
|
|
234
|
+
├─ DISCUSS: {count} (all skipped/deferred)
|
|
235
|
+
└─ No changes made
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
## Notes
|
|
239
|
+
|
|
240
|
+
- **MVP scope**: Only bot comments are analyzed. Human reviewer comments are ignored. Use `afc:review` for human-initiated code review.
|
|
241
|
+
- **No auto-push**: Changes are committed but never pushed automatically. The user controls when to push.
|
|
242
|
+
- **User confirmation required**: All code changes must be confirmed by the user before committing (NFR-003 safety requirement).
|
|
243
|
+
- **Not part of auto pipeline**: This is a standalone skill invoked manually.
|
|
244
|
+
- **Idempotency**: Re-running on the same PR will skip comments that have already been addressed (the code diff won't match the bot's original concern).
|
|
245
|
+
- **Relationship to other skills**: `afc:review` does full code review. `afc:pr-comment` posts review comments. `afc:resolve` addresses existing bot comments. They are complementary.
|
package/skills/review/SKILL.md
CHANGED
|
@@ -276,7 +276,7 @@ If `.claude/afc/memory/retrospectives/` directory exists, load the **most recent
|
|
|
276
276
|
|
|
277
277
|
### 6. Critic Loop
|
|
278
278
|
|
|
279
|
-
> **Always** read `${
|
|
279
|
+
> **Always** read `${CLAUDE_SKILL_DIR}/../../docs/critic-loop-rules.md` first and follow it.
|
|
280
280
|
|
|
281
281
|
Run the critic loop until convergence. Safety cap: 5 passes.
|
|
282
282
|
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: afc:setup
|
|
3
|
+
description: "Global CLAUDE.md configuration — use when the user asks to set up afc routing in their global config, update the AFC block version, or resolve routing conflicts"
|
|
4
|
+
argument-hint: "[--force]"
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Read
|
|
7
|
+
- Write
|
|
8
|
+
- Bash
|
|
9
|
+
- Glob
|
|
10
|
+
model: sonnet
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# /afc:setup — Global CLAUDE.md Configuration
|
|
14
|
+
|
|
15
|
+
> Manages the all-for-claudecode routing block in `~/.claude/CLAUDE.md`.
|
|
16
|
+
> Handles injection, updates, conflict detection, and legacy migration of the AFC block.
|
|
17
|
+
> This is a **global config** operation — it modifies `~/.claude/CLAUDE.md`, NOT project files.
|
|
18
|
+
> For project-local setup (config, rules, profile), use `/afc:init` instead.
|
|
19
|
+
|
|
20
|
+
This skill is a **prompt-only skill** — there is no bash script.
|
|
21
|
+
All steps below are instructions for the LLM to execute directly using its allowed tools.
|
|
22
|
+
|
|
23
|
+
## Arguments
|
|
24
|
+
|
|
25
|
+
- `$ARGUMENTS` — (optional) flags:
|
|
26
|
+
- `--force` — skip conflict prompts and use coexistence mode
|
|
27
|
+
|
|
28
|
+
## Execution Steps
|
|
29
|
+
|
|
30
|
+
### 1. Version Resolution
|
|
31
|
+
|
|
32
|
+
Read `${CLAUDE_SKILL_DIR}/../../package.json` and extract the `"version"` field. Use this value as `{PLUGIN_VERSION}` throughout.
|
|
33
|
+
|
|
34
|
+
### 2. Check Current State
|
|
35
|
+
|
|
36
|
+
Read `~/.claude/CLAUDE.md`. If file does not exist, create it with an empty body and proceed to Step 5.
|
|
37
|
+
|
|
38
|
+
Check for:
|
|
39
|
+
- `<!-- AFC:START -->` marker → existing AFC block found
|
|
40
|
+
- `<!-- SELFISH:START -->` marker → legacy v1.x block found
|
|
41
|
+
- Neither → fresh install
|
|
42
|
+
|
|
43
|
+
**If existing AFC block found:**
|
|
44
|
+
- Extract version from `<!-- AFC:VERSION:X.Y.Z -->`
|
|
45
|
+
- If version matches `{PLUGIN_VERSION}`: print `AFC block already up to date (v{PLUGIN_VERSION})` and **stop**
|
|
46
|
+
- If version differs: proceed to Step 3 (will replace)
|
|
47
|
+
|
|
48
|
+
**If legacy SELFISH block found:**
|
|
49
|
+
- Remove entire `<!-- SELFISH:START -->` ~ `<!-- SELFISH:END -->` block
|
|
50
|
+
- Print: `Removed legacy SELFISH block`
|
|
51
|
+
- Proceed to Step 3
|
|
52
|
+
|
|
53
|
+
### 3. Conflict Pattern Scan
|
|
54
|
+
|
|
55
|
+
Search `~/.claude/CLAUDE.md` for routing conflicts. **IMPORTANT: EXCLUDE content inside any marker blocks (`<!-- *:START -->` ~ `<!-- *:END -->`). Only scan unguarded content outside marker blocks.** Other tools (OMC, etc.) manage their own blocks — their internal agent names are not conflicts.
|
|
56
|
+
|
|
57
|
+
**A. Marker Block Detection**
|
|
58
|
+
- Regex: `<!-- ([A-Z0-9_-]+):START -->` ~ `<!-- \1:END -->`
|
|
59
|
+
- Record all found block names and line ranges
|
|
60
|
+
- **Strip these ranges from the scan target** — only scan lines NOT inside any marker block
|
|
61
|
+
|
|
62
|
+
**B. Agent Routing Conflict Detection**
|
|
63
|
+
In the **unguarded** (non-marker-block) content only, find directives containing these keywords:
|
|
64
|
+
- `executor`, `deep-executor` — conflicts with afc:implement
|
|
65
|
+
- `code-reviewer`, `quality-reviewer`, `style-reviewer`, `api-reviewer`, `security-reviewer`, `performance-reviewer` — conflicts with afc:review
|
|
66
|
+
- `debugger` (in agent routing context) — conflicts with afc:debug
|
|
67
|
+
- `planner` (in agent routing context) — conflicts with afc:plan
|
|
68
|
+
- `analyst`, `verifier` — conflicts with afc:validate
|
|
69
|
+
- `test-engineer` — conflicts with afc:test
|
|
70
|
+
|
|
71
|
+
**C. Skill Routing Conflict Detection**
|
|
72
|
+
In the **unguarded** content only, find these patterns:
|
|
73
|
+
- Another tool's skill trigger table (e.g., tables like `| situation | skill |`)
|
|
74
|
+
- `delegate to`, `route to`, `always use` + agent name combinations
|
|
75
|
+
- Directives related to `auto-trigger`, `intent detection`, `intent-based routing`
|
|
76
|
+
|
|
77
|
+
**D. Legacy Block Detection**
|
|
78
|
+
Previous versions without markers or with old branding:
|
|
79
|
+
- `## all-for-claudecode Auto-Trigger Rules`
|
|
80
|
+
- `## all-for-claudecode Integration`
|
|
81
|
+
- `<selfish-pipeline>` / `</selfish-pipeline>` XML tags
|
|
82
|
+
|
|
83
|
+
### 4. Report Conflicts and User Choice
|
|
84
|
+
|
|
85
|
+
**No conflicts found** → proceed directly to Step 5
|
|
86
|
+
|
|
87
|
+
**Conflicts found** (skip if `--force` flag present — default to coexistence):
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
CLAUDE.md Scan Results
|
|
91
|
+
├─ Tool blocks found: {block name list} (lines {range})
|
|
92
|
+
├─ Agent routing conflicts: {conflict count}
|
|
93
|
+
│ e.g., "executor" (line XX) ↔ afc:implement
|
|
94
|
+
│ e.g., "code-reviewer" (line XX) ↔ afc:review
|
|
95
|
+
└─ Skill routing conflicts: {conflict count}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Ask user:
|
|
99
|
+
|
|
100
|
+
> "Directives overlapping with afc were found. How would you like to proceed?"
|
|
101
|
+
>
|
|
102
|
+
> 1. **afc-exclusive mode** — Adds override rules in the AFC block to cover conflicting directives.
|
|
103
|
+
> Does not modify other tools' marker block contents.
|
|
104
|
+
> 2. **coexistence mode** — Adds only the AFC block without overrides.
|
|
105
|
+
> Since it's at the end of the file, afc directives will likely take priority.
|
|
106
|
+
> 3. **manual cleanup** — Shows the conflict list only and stops.
|
|
107
|
+
|
|
108
|
+
Based on choice:
|
|
109
|
+
- **Option 1**: AFC block includes explicit override rules (see conflict-overrides section below)
|
|
110
|
+
- **Option 2**: AFC block added without overrides (base template as-is)
|
|
111
|
+
- **Option 3**: Print conflict list only and abort without modifying CLAUDE.md
|
|
112
|
+
|
|
113
|
+
### 5. Inject AFC Block
|
|
114
|
+
|
|
115
|
+
Add the following block at the **very end** of `~/.claude/CLAUDE.md` (later-positioned directives have higher priority).
|
|
116
|
+
|
|
117
|
+
Replace existing AFC block if present, otherwise append.
|
|
118
|
+
If legacy block (`## all-for-claudecode Auto-Trigger Rules` etc.) exists, remove it then append.
|
|
119
|
+
|
|
120
|
+
```markdown
|
|
121
|
+
<!-- AFC:START -->
|
|
122
|
+
<!-- AFC:VERSION:{PLUGIN_VERSION} -->
|
|
123
|
+
<afc-pipeline>
|
|
124
|
+
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.
|
|
125
|
+
|
|
126
|
+
## Skill Routing
|
|
127
|
+
|
|
128
|
+
Classify the user's intent and route to the matching skill. Use semantic understanding — not keyword matching.
|
|
129
|
+
|
|
130
|
+
| User Intent | Skill | Route When |
|
|
131
|
+
|-------------|-------|------------|
|
|
132
|
+
| Full lifecycle | `afc:auto` | User wants end-to-end feature development, or the request is a non-trivial new feature without an existing plan |
|
|
133
|
+
| Specification | `afc:spec` | User wants to define or write requirements, acceptance criteria, or success conditions |
|
|
134
|
+
| Design/Plan | `afc:plan` | User wants to plan HOW to implement before coding — approach, architecture decisions, design |
|
|
135
|
+
| Implement | `afc:implement` | User wants specific code changes with a clear scope: add feature, refactor, modify. Requires existing plan or precise instructions |
|
|
136
|
+
| Review | `afc:review` | User wants code review, PR review, or quality check on existing/changed code |
|
|
137
|
+
| Debug/Fix | `afc:debug` | User reports a bug, error, or broken behavior and wants diagnosis and fix |
|
|
138
|
+
| Test | `afc:test` | User wants to write tests, improve coverage, or verify behavior |
|
|
139
|
+
| Validate | `afc:validate` | User wants to check consistency or validate existing pipeline artifacts |
|
|
140
|
+
| Analyze | `afc:analyze` | User wants to understand, explore, or audit existing code without modifying it |
|
|
141
|
+
| QA Audit | `afc:qa` | User wants project quality audit, test confidence check, or runtime quality gaps |
|
|
142
|
+
| Research | `afc:research` | User wants deep investigation of external tools, libraries, APIs, or technical concepts |
|
|
143
|
+
| Ideate | `afc:ideate` | User wants to brainstorm ideas, explore possibilities, or draft a product brief |
|
|
144
|
+
| Consult | `afc:consult` | User wants expert advice on a decision: library choice, architecture direction, legal/security/infra guidance |
|
|
145
|
+
| Launch | `afc:launch` | User wants to prepare a release — generate changelog, release notes, version bump, or tag |
|
|
146
|
+
| Tasks | `afc:tasks` | User explicitly wants to decompose work into a task breakdown |
|
|
147
|
+
| Ambiguous | `afc:clarify` | User's request is too vague or underspecified to route confidently |
|
|
148
|
+
|
|
149
|
+
### Routing Rules
|
|
150
|
+
|
|
151
|
+
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.
|
|
152
|
+
2. **Compound intents**: Route to the primary intent. The pipeline handles sequencing internally.
|
|
153
|
+
3. **Design-first**: When scope is non-trivial (multiple files, architectural decisions needed), prefer `afc:auto` or `afc:plan` over direct `afc:implement`.
|
|
154
|
+
|
|
155
|
+
User-only (not auto-triggered — when user invokes directly via `/afc:X`, execute the skill immediately):
|
|
156
|
+
- `afc:doctor` — plugin health check
|
|
157
|
+
- `afc:setup` — global CLAUDE.md configuration
|
|
158
|
+
- `afc:init` — project-local setup
|
|
159
|
+
- `afc:architect` — architecture review
|
|
160
|
+
- `afc:security` — security scan
|
|
161
|
+
- `afc:checkpoint` — session save
|
|
162
|
+
- `afc:resume` — session restore
|
|
163
|
+
- `afc:principles` — project principles management
|
|
164
|
+
- `afc:clean` — pipeline cleanup (artifact cleanup, dead code scan, pipeline flag release)
|
|
165
|
+
- `afc:triage` — parallel PR/issue triage
|
|
166
|
+
- `afc:issue` — analyze a single GitHub issue
|
|
167
|
+
- `afc:resolve` — address LLM bot review comments on a PR
|
|
168
|
+
- `afc:learner` — pattern learning or rule promotion
|
|
169
|
+
- `afc:pr-comment` — post PR review comments to GitHub
|
|
170
|
+
- `afc:release-notes` — generate release notes from git history
|
|
171
|
+
|
|
172
|
+
## Pipeline
|
|
173
|
+
|
|
174
|
+
spec → plan → implement → review → clean
|
|
175
|
+
|
|
176
|
+
## Override Rules
|
|
177
|
+
|
|
178
|
+
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.
|
|
179
|
+
|
|
180
|
+
## Source Verification
|
|
181
|
+
|
|
182
|
+
When analyzing or making claims about external systems, APIs, SDKs, or third-party tools:
|
|
183
|
+
- Verify against official documentation, NOT project-internal docs
|
|
184
|
+
- Do not hardcode reference data when delegating to sub-agents — instruct them to look up primary sources
|
|
185
|
+
- Cross-verify high-severity findings before reporting
|
|
186
|
+
</afc-pipeline>
|
|
187
|
+
<!-- AFC:END -->
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
**When Option 1 (afc-exclusive mode) is selected**, add the following directly below the Override Rules:
|
|
191
|
+
|
|
192
|
+
```markdown
|
|
193
|
+
## Detected Conflicts
|
|
194
|
+
|
|
195
|
+
This environment has other agent routing tools that overlap with afc.
|
|
196
|
+
The following rules were auto-generated to resolve conflicts:
|
|
197
|
+
- The Skill Routing table above always takes priority over the agent routing directives of {detected tool blocks}
|
|
198
|
+
- This block is at the end of the file and therefore has the highest priority
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
### 6. Final Output
|
|
202
|
+
|
|
203
|
+
```
|
|
204
|
+
all-for-claudecode setup complete
|
|
205
|
+
├─ CLAUDE.md: {injected|updated|already current|user aborted}
|
|
206
|
+
├─ Version: {PLUGIN_VERSION}
|
|
207
|
+
│ {if conflicts found} └─ Conflict resolution: {afc-exclusive|coexistence|user cleanup}
|
|
208
|
+
└─ Next step: /afc:init (project setup) or /afc:auto (start building)
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
## Notes
|
|
212
|
+
|
|
213
|
+
- **Idempotent**: safe to run multiple times. If version matches, it's a no-op.
|
|
214
|
+
- **Global only**: this skill only touches `~/.claude/CLAUDE.md`. For project config, use `/afc:init`.
|
|
215
|
+
- **Global CLAUDE.md principles**:
|
|
216
|
+
- Never modify content outside the `<!-- AFC:START/END -->` markers
|
|
217
|
+
- Never modify content inside other tools' marker blocks (`<!-- *:START/END -->`)
|
|
218
|
+
- Always place the AFC block at the very end of the file (ensures priority)
|
|
219
|
+
- Conflict resolution is handled only via override rules (do not delete or modify other blocks)
|
package/skills/spec/SKILL.md
CHANGED
|
@@ -41,7 +41,8 @@ If config file is missing:
|
|
|
41
41
|
2. Determine **feature name**:
|
|
42
42
|
- Extract 2-3 key keywords from `$ARGUMENTS`
|
|
43
43
|
- Convert to kebab-case (e.g., "add user authentication" → `user-auth`)
|
|
44
|
-
|
|
44
|
+
- Prepend today's date in `YYYY-MM-DD` format (e.g., `2026-03-13-user-auth`)
|
|
45
|
+
3. **Create directory**: `.claude/afc/specs/{YYYY-MM-DD}-{feature-name}/` (create parent `.claude/afc/specs/` directory if it does not exist)
|
|
45
46
|
4. If already exists, confirm with user: "Overwrite existing spec?"
|
|
46
47
|
|
|
47
48
|
### 2. Explore Codebase
|
|
@@ -67,7 +68,7 @@ Detect whether `$ARGUMENTS` references external libraries, APIs, or technologies
|
|
|
67
68
|
4. **If external references detected**:
|
|
68
69
|
- For each unknown reference, run a focused WebSearch query: `"{library/API name} latest stable version usage guide {current year}"`
|
|
69
70
|
- Optionally use Context7 (`mcp__context7__resolve-library-id` → `mcp__context7__query-docs`) for library-specific documentation
|
|
70
|
-
- Record findings to `.claude/afc/specs/{feature-name}/research-notes.md` (lightweight spec-scoped notes; distinct from plan phase's `research.md` which covers deep technical research)
|
|
71
|
+
- Record findings to `.claude/afc/specs/{YYYY-MM-DD}-{feature-name}/research-notes.md` (lightweight spec-scoped notes; distinct from plan phase's `research.md` which covers deep technical research)
|
|
71
72
|
- Also use findings inline as context for spec writing
|
|
72
73
|
- Tag each researched item in spec with `[RESEARCHED]` for traceability
|
|
73
74
|
|
|
@@ -75,7 +76,7 @@ Detect whether `$ARGUMENTS` references external libraries, APIs, or technologies
|
|
|
75
76
|
|
|
76
77
|
### 3. Write Spec
|
|
77
78
|
|
|
78
|
-
Create `.claude/afc/specs/{feature-name}/spec.md` following the template in `${CLAUDE_SKILL_DIR}/spec-template.md`. Read it first, then generate the spec using that structure.
|
|
79
|
+
Create `.claude/afc/specs/{YYYY-MM-DD}-{feature-name}/spec.md` following the template in `${CLAUDE_SKILL_DIR}/spec-template.md`. Read it first, then generate the spec using that structure.
|
|
79
80
|
|
|
80
81
|
### 3.5. Inline Clarification (standalone mode only)
|
|
81
82
|
|
|
@@ -98,7 +99,7 @@ If `.claude/afc/memory/retrospectives/` directory exists, load the **most recent
|
|
|
98
99
|
|
|
99
100
|
### 5. Critic Loop
|
|
100
101
|
|
|
101
|
-
> **Always** read `${
|
|
102
|
+
> **Always** read `${CLAUDE_SKILL_DIR}/../../docs/critic-loop-rules.md` first and follow it.
|
|
102
103
|
|
|
103
104
|
Run the critic loop until convergence. Safety cap: 5 passes.
|
|
104
105
|
|
|
@@ -127,7 +128,7 @@ When not running inside `/afc:auto`, save progress for `/afc:resume`:
|
|
|
127
128
|
|
|
128
129
|
```
|
|
129
130
|
Spec generated
|
|
130
|
-
├─ .claude/afc/specs/{feature-name}/spec.md
|
|
131
|
+
├─ .claude/afc/specs/{YYYY-MM-DD}-{feature-name}/spec.md
|
|
131
132
|
├─ User Stories: {count}
|
|
132
133
|
├─ Requirements: FR {count}, NFR {count}
|
|
133
134
|
├─ Research: {N} external references researched / skipped (all internal)
|
package/skills/tasks/SKILL.md
CHANGED
|
@@ -80,8 +80,8 @@ Decompose tasks per Phase defined in plan.md.
|
|
|
80
80
|
1. **1 task = 1 file** principle (where possible)
|
|
81
81
|
2. **Same file = sequential**, **different files = [P] candidate**
|
|
82
82
|
3. **Explicit dependencies**: Use `depends: [T001, T002]` to declare blocking dependencies. Tasks without `depends:` and with [P] marker are immediately parallelizable.
|
|
83
|
-
4. **[P] physical validation**: Before finalizing tasks.md, run `"${
|
|
84
|
-
5. **Dependency graph must be a DAG**: no circular dependencies allowed. **Mandatory validation**: run `"${
|
|
83
|
+
4. **[P] physical validation**: Before finalizing tasks.md, run `"${CLAUDE_SKILL_DIR}/../../scripts/afc-parallel-validate.sh" .claude/afc/specs/{feature}/tasks.md` to verify no file path overlaps exist among [P] tasks within the same phase. Fix any conflicts before proceeding.
|
|
84
|
+
5. **Dependency graph must be a DAG**: no circular dependencies allowed. **Mandatory validation**: run `"${CLAUDE_SKILL_DIR}/../../scripts/afc-dag-validate.sh" .claude/afc/specs/{feature}/tasks.md` before output. Abort if cycle detected.
|
|
85
85
|
6. **Test tasks**: Include a verification task for each testable unit
|
|
86
86
|
7. **Phase gate**: Add a `{config.gate}` validation task at the end of each Phase
|
|
87
87
|
|
|
@@ -93,14 +93,14 @@ If `.claude/afc/memory/retrospectives/` directory exists, load the **most recent
|
|
|
93
93
|
|
|
94
94
|
### 4. Critic Loop
|
|
95
95
|
|
|
96
|
-
> **Always** read `${
|
|
96
|
+
> **Always** read `${CLAUDE_SKILL_DIR}/../../docs/critic-loop-rules.md` first and follow it.
|
|
97
97
|
|
|
98
98
|
Run the critic loop until convergence. Safety cap: 5 passes.
|
|
99
99
|
|
|
100
100
|
| Criterion | Validation |
|
|
101
101
|
|-----------|------------|
|
|
102
102
|
| **COVERAGE** | Are all files in plan.md's File Change Map included in tasks? Are all FR-* in spec.md covered? |
|
|
103
|
-
| **DEPENDENCIES** | Is the dependency graph a valid DAG? Do [P] tasks within the same phase have no file overlaps? Are all `depends:` targets valid task IDs? For physical validation of [P] file overlaps, reference the validation script: `"${
|
|
103
|
+
| **DEPENDENCIES** | Is the dependency graph a valid DAG? Do [P] tasks within the same phase have no file overlaps? Are all `depends:` targets valid task IDs? For physical validation of [P] file overlaps, reference the validation script: `"${CLAUDE_SKILL_DIR}/../../scripts/afc-parallel-validate.sh"` can be called with the tasks.md path to verify no conflicts exist. |
|
|
104
104
|
|
|
105
105
|
**On FAIL**: auto-fix and continue to next pass.
|
|
106
106
|
**On ESCALATE**: pause, present options to user, apply choice, resume.
|
package/skills/test/SKILL.md
CHANGED
|
@@ -93,7 +93,7 @@ Confirm strategy with user before proceeding.
|
|
|
93
93
|
|
|
94
94
|
### 4. Critic Loop
|
|
95
95
|
|
|
96
|
-
> **Always** read `${
|
|
96
|
+
> **Always** read `${CLAUDE_SKILL_DIR}/../../docs/critic-loop-rules.md` first and follow it.
|
|
97
97
|
|
|
98
98
|
Run the critic loop until convergence. Safety cap: 5 passes.
|
|
99
99
|
|
package/skills/triage/SKILL.md
CHANGED
|
@@ -33,7 +33,7 @@ model: sonnet
|
|
|
33
33
|
Run the metadata collection script:
|
|
34
34
|
|
|
35
35
|
```bash
|
|
36
|
-
"${
|
|
36
|
+
"${CLAUDE_SKILL_DIR}/../../scripts/afc-triage.sh" "$ARGUMENTS"
|
|
37
37
|
```
|
|
38
38
|
|
|
39
39
|
This returns JSON with PR/issue metadata. If the script is not available, fall back to direct `gh` commands:
|