all-for-claudecode 2.10.0 → 2.12.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.
@@ -12,8 +12,16 @@ model: sonnet
12
12
 
13
13
  # /afc:init — Project Initial Setup
14
14
 
15
- > Creates a `.claude/afc.config.md` configuration file in the current project,
16
- > and injects afc intent-based routing rules into `~/.claude/CLAUDE.md`.
15
+ > Creates project-local configuration files for the all-for-claudecode plugin.
16
+ > Analyzes the project structure and generates config, rules, and profile.
17
+ > This is a **project-local** operation — it only creates files under `.claude/`.
18
+ > For global `~/.claude/CLAUDE.md` setup, use `/afc:setup` instead.
19
+
20
+ ## Important
21
+
22
+ This skill is a **prompt-only skill** — there is NO `afc-init.sh` script.
23
+ All steps below are instructions for the LLM to execute directly using its allowed tools (Read, Write, Bash, Glob).
24
+ Do NOT attempt to run a shell script for this skill.
17
25
 
18
26
  ## Arguments
19
27
 
@@ -72,6 +80,8 @@ Analyze the project and auto-infer configuration. Use `$ARGUMENTS` as additional
72
80
  - If no lockfile: check `packageManager` field in `package.json`
73
81
  - Non-JS projects: check `pyproject.toml` (Python), `Cargo.toml` (Rust), `go.mod` (Go)
74
82
 
83
+ > These detection rules are starting-point heuristics, not definitive. If a project uses a tool not listed here, the model should still detect it from context (e.g., `bun.lockb` for Bun, `deno.lock` for Deno). Always confirm the detected setup with the user before proceeding.
84
+
75
85
  **Step 2. Framework Detection**
76
86
  - Determine from `package.json` dependencies/devDependencies:
77
87
 
@@ -91,9 +101,11 @@ Analyze the project and auto-infer configuration. Use `$ARGUMENTS` as additional
91
101
  - Non-JS: `pyproject.toml` → Django/FastAPI/Flask, `Cargo.toml` → Rust project, `go.mod` → Go project
92
102
  - Presence of `tsconfig.json` → TypeScript indicator
93
103
 
104
+ > This list covers common frameworks but is not exhaustive. For unlisted frameworks, infer from package.json dependencies, project structure, and configuration files. Present the detection result to the user for confirmation.
105
+
94
106
  **Step 3. Architecture Detection**
95
107
  - Analyze directory structure:
96
- - FSD: requires **at least 3** of `features/`, `entities/`, `shared/`, `widgets/`, `pages/` under `src/`
108
+ - FSD: If the project's src/ directory contains a combination of FSD-characteristic directories (`features/`, `entities/`, `shared/`, `widgets/`, `pages/`, `processes/`, `app/`), assess whether the project follows FSD principles. Variant FSD structures (e.g., using `processes/` instead of `pages/`) should also be detected. Confirm with the user if the detection is uncertain.
97
109
  - `src/domain/`, `src/application/`, `src/infrastructure/` → Clean Architecture
98
110
  - `src/modules/` → Modular
99
111
  - Other → Layered
@@ -120,7 +132,7 @@ Generate `.claude/afc.config.md` in **free-form markdown** format:
120
132
  3. **Code Style** section: describe detected language, strictness, naming conventions, lint rules in free-form prose/lists
121
133
  4. **Project Context** section: describe framework, state management, styling, testing, DB/ORM, risks, and any other relevant project characteristics in free-form prose/lists
122
134
 
123
- Reference `${CLAUDE_PLUGIN_ROOT}/templates/afc.config.template.md` for the section structure.
135
+ Reference `${CLAUDE_SKILL_DIR}/../../templates/afc.config.template.md` for the section structure.
124
136
  Write sections as natural descriptions — **no YAML code blocks** except for CI Commands.
125
137
  For items that cannot be inferred: note `TODO: Adjust for your project` inline.
126
138
  Save to `.claude/afc.config.md`.
@@ -133,7 +145,7 @@ Generate `.claude/rules/afc-project.md` — a concise summary of project rules t
133
145
  2. If `.claude/rules/afc-project.md` already exists:
134
146
  - If it contains `<!-- afc:auto-generated` marker: overwrite silently (auto-generated file, safe to regenerate)
135
147
  - If it does NOT contain the marker: ask user "Project rules file exists (user-managed). Overwrite with auto-generated version?" — skip if declined
136
- 3. Reference `${CLAUDE_PLUGIN_ROOT}/templates/afc-project.template.md` for section structure
148
+ 3. Reference `${CLAUDE_SKILL_DIR}/../../templates/afc-project.template.md` for section structure
137
149
  4. Fill in from the analysis performed in Step 3:
138
150
  - **Architecture**: pattern, key layers, import rules, path alias — concise bullet points
139
151
  - **Code Style**: language, naming conventions, lint rules — concise bullet points
@@ -149,195 +161,30 @@ Generate `.claude/afc/project-profile.md` for expert consultation agents:
149
161
 
150
162
  1. Create `.claude/afc/` directory if it does not exist
151
163
  2. If `.claude/afc/project-profile.md` already exists: skip (do not overwrite)
152
- 3. If not exists: generate from the detected project information using `${CLAUDE_PLUGIN_ROOT}/templates/project-profile.template.md` as the structure
164
+ 3. If not exists: generate from the detected project information using `${CLAUDE_SKILL_DIR}/../../templates/project-profile.template.md` as the structure
153
165
  - Fill in Stack, Architecture, and Domain fields from the analysis in Step 3
154
166
  - Leave Team, Scale, and Constraints as template placeholders for user to fill
155
167
  4. Print: `Project profile: .claude/afc/project-profile.md (review and adjust team/scale/domain fields)`
156
168
 
157
- ### 5. Scan Global CLAUDE.md and Detect Conflicts
158
-
159
- Read `~/.claude/CLAUDE.md` and analyze in the following order.
160
-
161
- #### Step 1. Check for Existing all-for-claudecode or Legacy SELFISH Block
162
-
163
- Check for presence of `<!-- AFC:START -->` or `<!-- SELFISH:START -->` marker.
164
- - If `<!-- AFC:START -->` found: replace with latest version (proceed to Step 3)
165
- - If `<!-- SELFISH:START -->` found (legacy v1.x): remove the entire `SELFISH:START` ~ `SELFISH:END` block, then proceed to inject new all-for-claudecode block at Step 4. Print: `Migrated: SELFISH block → all-for-claudecode block in ~/.claude/CLAUDE.md`
166
- - If neither found: proceed to Step 2
167
-
168
- #### Step 2. Conflict Pattern Scan
169
-
170
- Search CLAUDE.md for the patterns below. **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.
171
-
172
- **A. Marker Block Detection**
173
- - Regex: `<!-- ([A-Z0-9_-]+):START -->` ~ `<!-- \1:END -->`
174
- - Record all found block names and line ranges
175
- - **Strip these ranges from the scan target** — only scan lines NOT inside any marker block
176
-
177
- **B. Agent Routing Conflict Detection**
178
- In the **unguarded** (non-marker-block) content only, find directives containing these keywords:
179
- - `executor`, `deep-executor` — conflicts with afc:implement
180
- - `code-reviewer`, `quality-reviewer`, `style-reviewer`, `api-reviewer`, `security-reviewer`, `performance-reviewer` — conflicts with afc:review
181
- - `debugger` (in agent routing context) — conflicts with afc:debug
182
- - `planner` (in agent routing context) — conflicts with afc:plan
183
- - `analyst`, `verifier` — conflicts with afc:validate
184
- - `test-engineer` — conflicts with afc:test
185
-
186
- **C. Skill Routing Conflict Detection**
187
- In the **unguarded** content only, find these patterns:
188
- - Another tool's skill trigger table (e.g., tables like `| situation | skill |`)
189
- - `delegate to`, `route to`, `always use` + agent name combinations
190
- - Directives related to `auto-trigger`, `intent detection`, `intent-based routing`
191
-
192
- **D. Legacy Block Detection**
193
- Previous versions without markers or with old branding:
194
- - `## all-for-claudecode Auto-Trigger Rules`
195
- - `## all-for-claudecode Integration`
196
- - `<!-- SELFISH:START -->` ~ `<!-- SELFISH:END -->` (v1.x block — should have been caught in Step 1, but double-check here)
197
- - `<selfish-pipeline>` / `</selfish-pipeline>` XML tags
198
-
199
- #### Step 3. Report Conflicts and User Choice
200
-
201
- **No conflicts found** → proceed directly to Step 4
202
-
203
- **Conflicts found** → report to user and present options:
204
-
205
- ```
206
- 📋 CLAUDE.md Scan Results
207
- ├─ Tool blocks found: {block name list} (lines {range})
208
- ├─ Agent routing conflicts: {conflict count}
209
- │ e.g., "executor" (line XX) ↔ afc:implement
210
- │ e.g., "code-reviewer" (line XX) ↔ afc:review
211
- └─ Skill routing conflicts: {conflict count}
212
- ```
213
-
214
- Ask user:
215
-
216
- > "Directives overlapping with afc were found. How would you like to proceed?"
217
- >
218
- > 1. **afc-exclusive mode** — Adds afc override comments to conflicting agent routing directives.
219
- > Does not modify other tools' marker block contents; covers them with override rules in the all-for-claudecode block.
220
- > 2. **coexistence mode** — Ignores conflicts and adds only the afc block.
221
- > Since it's at the end of the file, afc directives will likely take priority, but may be non-deterministic on conflict.
222
- > 3. **manual cleanup** — Shows only the current conflict list and stops.
223
- > User manually cleans up CLAUDE.md then runs init again.
224
-
225
- Based on choice:
226
- - **Option 1**: all-for-claudecode block includes explicit override rules (activates `<conflict-overrides>` section from base template)
227
- - **Option 2**: all-for-claudecode block added without overrides (base template as-is)
228
- - **Option 3**: Print conflict list only and abort without modifying CLAUDE.md
229
-
230
- #### Step 4. Inject all-for-claudecode Block
231
-
232
- **Version resolution**: Read `${CLAUDE_PLUGIN_ROOT}/package.json` and extract the `"version"` field. Use this value as `{PLUGIN_VERSION}` in the template below.
233
-
234
- Add the following block at the **very end** of the file (later-positioned directives have higher priority).
235
-
236
- Replace existing all-for-claudecode block if present, otherwise append.
237
- If legacy block (`## all-for-claudecode Auto-Trigger Rules` etc.) exists, remove it then append.
238
-
239
- ```markdown
240
- <!-- AFC:START -->
241
- <!-- AFC:VERSION:{PLUGIN_VERSION} -->
242
- <afc-pipeline>
243
- 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.
244
-
245
- ## Skill Routing
246
-
247
- Classify the user's intent and route to the matching skill. Use semantic understanding — not keyword matching.
248
-
249
- | User Intent | Skill | Route When |
250
- |-------------|-------|------------|
251
- | Full lifecycle | `afc:auto` | User wants end-to-end feature development, or the request is a non-trivial new feature without an existing plan |
252
- | Specification | `afc:spec` | User wants to define or write requirements, acceptance criteria, or success conditions |
253
- | Design/Plan | `afc:plan` | User wants to plan HOW to implement before coding — approach, architecture decisions, design |
254
- | Implement | `afc:implement` | User wants specific code changes with a clear scope: add feature, refactor, modify. Requires existing plan or precise instructions |
255
- | Review | `afc:review` | User wants code review, PR review, or quality check on existing/changed code |
256
- | Debug/Fix | `afc:debug` | User reports a bug, error, or broken behavior and wants diagnosis and fix |
257
- | Test | `afc:test` | User wants to write tests, improve coverage, or verify behavior |
258
- | Validate | `afc:validate` | User wants to check consistency or validate existing pipeline artifacts |
259
- | Analyze | `afc:analyze` | User wants to understand, explore, or audit existing code without modifying it |
260
- | QA Audit | `afc:qa` | User wants project quality audit, test confidence check, or runtime quality gaps |
261
- | Research | `afc:research` | User wants deep investigation of external tools, libraries, APIs, or technical concepts |
262
- | Ideate | `afc:ideate` | User wants to brainstorm ideas, explore possibilities, or draft a product brief |
263
- | Consult | `afc:consult` | User wants expert advice on a decision: library choice, architecture direction, legal/security/infra guidance |
264
- | Launch | `afc:launch` | User wants to prepare a release — generate changelog, release notes, version bump, or tag |
265
- | Tasks | `afc:tasks` | User explicitly wants to decompose work into a task breakdown |
266
- | Ambiguous | `afc:clarify` | User's request is too vague or underspecified to route confidently |
267
-
268
- ### Routing Rules
269
-
270
- 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.
271
- 2. **Compound intents**: Route to the primary intent. The pipeline handles sequencing internally.
272
- 3. **Design-first**: When scope is non-trivial (multiple files, architectural decisions needed), prefer `afc:auto` or `afc:plan` over direct `afc:implement`.
273
-
274
- User-only (not auto-triggered — when user invokes directly via `/afc:X`, execute the skill immediately):
275
- - `afc:doctor` — plugin health check
276
- - `afc:architect` — architecture review
277
- - `afc:security` — security scan
278
- - `afc:checkpoint` — session save
279
- - `afc:resume` — session restore
280
- - `afc:principles` — project principles management
281
- - `afc:clean` — pipeline cleanup (artifact cleanup, dead code scan, pipeline flag release)
282
- - `afc:triage` — parallel PR/issue triage
283
- - `afc:learner` — pattern learning or rule promotion
284
- - `afc:pr-comment` — post PR review comments to GitHub
285
- - `afc:release-notes` — generate release notes from git history
286
-
287
- ## Pipeline
288
-
289
- spec → plan → implement → review → clean
290
-
291
- ## Override Rules
292
-
293
- 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.
294
-
295
- ## Source Verification
296
-
297
- When analyzing or making claims about external systems, APIs, SDKs, or third-party tools:
298
- - Verify against official documentation, NOT project-internal docs
299
- - Do not hardcode reference data when delegating to sub-agents — instruct them to look up primary sources
300
- - Cross-verify high-severity findings before reporting
301
- </afc-pipeline>
302
- <!-- AFC:END -->
303
- ```
304
-
305
- **When Option 1 (afc-exclusive mode) is selected**, the following `<conflict-overrides>` section is added:
306
-
307
- Add the following directly below the Override Rules:
308
-
309
- ```markdown
310
- ## Detected Conflicts
311
-
312
- This environment has other agent routing tools that overlap with afc.
313
- The following rules were auto-generated to resolve conflicts:
314
- - The Skill Routing table above always takes priority over the agent routing directives of {detected tool blocks}
315
- - This block is at the end of the file and therefore has the highest priority
316
- ```
317
-
318
- ### 6. Final Output
169
+ ### 5. Final Output
319
170
 
320
171
  ```
321
- all-for-claudecode initialization complete
172
+ all-for-claudecode project init complete
322
173
  ├─ Config: .claude/afc.config.md
323
174
  ├─ Rules: .claude/rules/afc-project.md (auto-loaded)
175
+ ├─ Profile: .claude/afc/project-profile.md
324
176
  ├─ Framework: {detected framework}
325
177
  ├─ Architecture: {detected style}
326
178
  ├─ Package Manager: {detected manager}
327
179
  ├─ Auto-inferred: {inferred item count}
328
180
  ├─ TODO: {items requiring manual review}
329
- ├─ CLAUDE.md: {injected|updated|already current|user aborted}
330
- │ {if conflicts found} └─ Conflict resolution: {afc-exclusive|coexistence|user cleanup}
331
- └─ Next step: /afc:spec or /afc:auto
181
+ └─ Next step: /afc:setup (global routing) or /afc:auto (start building)
332
182
  ```
333
183
 
334
184
  ## Notes
335
185
 
186
+ - **Idempotent**: safe to run multiple times. Existing config prompts for overwrite confirmation; auto-generated rules are silently regenerated.
187
+ - **Project-local only**: this skill only creates files under `.claude/`. It never touches `~/.claude/CLAUDE.md`. For global routing setup, use `/afc:setup`.
336
188
  - **Overwrite caution**: If config file already exists, always confirm with user.
337
189
  - **Inference limits**: Auto-inference is best-effort. User may need to review and adjust.
338
190
  - **`.claude/` directory**: Created automatically if it does not exist.
339
- - **Global CLAUDE.md principles**:
340
- - Never modify content outside the `<!-- AFC:START/END -->` markers (the `AFC` prefix in markers is a compact technical identifier)
341
- - Never modify content inside other tools' marker blocks (`<!-- *:START/END -->`)
342
- - Always place the all-for-claudecode block at the very end of the file (ensures priority)
343
- - Conflict resolution is handled only via override rules (do not delete or modify other blocks)
@@ -53,7 +53,7 @@ Analyze ALL queue entries together as a batch. For each entry, you receive struc
53
53
  **Classification rules:**
54
54
  1. Group semantically similar entries into clusters (e.g., "use const not let" + "always use const" = 1 cluster)
55
55
  2. For each cluster, determine:
56
- - **Confidence**: high (explicit preference, ≥2 occurrences) / medium (single clear correction) / low (ambiguous excerpt)
56
+ - **Confidence**: Assess based on the strength and clarity of the signal, not occurrence count. A single explicit user correction ("never do X") is high confidence. Two ambiguous occurrences may still be medium. Consider: was the feedback direct and clear? Does it apply broadly or only to a specific case? Use high / medium / low accordingly.
57
57
  - **Rule type**: naming, style, workflow, testing, architecture
58
58
  - **Scope**: universal (all files) or file-type-specific (e.g., "In TypeScript files...")
59
59
 
@@ -73,7 +73,7 @@ For each candidate rule:
73
73
 
74
74
  ### 4. Present Suggestions
75
75
 
76
- Show clustered suggestions to user. Cap at **5 suggestions per review** (highest confidence first).
76
+ Show clustered suggestions to user, most impactful first. Present the most impactful suggestions first. If there are many high-confidence patterns, present them all rather than artificially capping. If most are low-confidence, present fewer. Let relevance and confidence drive the count, not a fixed limit.
77
77
 
78
78
  ```markdown
79
79
  ## Learned Patterns ({N} pending, showing top {M})
@@ -125,7 +125,7 @@ For each approved rule:
125
125
 
126
126
  3. **Remove consumed entries** from `.claude/.afc-learner-queue.jsonl` (entries that were approved, skipped, or rejected — only keep entries not yet reviewed)
127
127
 
128
- 4. **Rule count check**: If `afc-learned.md` now has ≥30 rules (count `<!-- afc:learned` markers), suggest consolidation:
128
+ 4. **Rule count check**: Suggest consolidation when the rules file becomes unwieldy — when rules overlap, contradict each other, or are too numerous to effectively guide behavior. Use judgment rather than a fixed count:
129
129
  ```
130
130
  afc-learned.md has {N} rules. Consider reviewing and consolidating related rules
131
131
  to keep context budget efficient. You can edit the file directly.
@@ -147,6 +147,6 @@ Learner review complete
147
147
  - **Opt-in only**: Learner signal collection requires `.claude/afc/learner.json` to exist. Run `/afc:learner enable` to start.
148
148
  - **Project-scoped rules**: All rules write to `.claude/rules/afc-learned.md` (git-tracked, team-visible). Never writes to root `CLAUDE.md`, `~/.claude/CLAUDE.md`, or auto memory.
149
149
  - **No raw prompts stored**: The signal queue contains only structured metadata (type, category, 80-char redacted excerpt, timestamp). Full prompt text is never persisted.
150
- - **Queue limits**: Max 50 entries, 7-day TTL. Stale entries are pruned at session start.
150
+ - **Queue limits**: Manage queue size to prevent unbounded growth. Remove entries that have been reviewed, are no longer relevant (the code they reference has changed significantly), or are duplicates of already-processed patterns. As a practical guideline, keep the queue focused on recent, actionable items. Stale entries are pruned at session start.
151
151
  - **Safe by design**: Anti-injection guardrails prevent propagation of harmful instructions. Category blocklist prevents rules about permissions/security/hooks.
152
152
  - **Editable output**: `afc-learned.md` is a regular markdown file. Edit, delete, or reorganize rules at any time.
@@ -119,7 +119,7 @@ After writing plan.md, verify all paths in the File Change Map:
119
119
 
120
120
  ### 5. Critic Loop
121
121
 
122
- > **Always** read `${CLAUDE_PLUGIN_ROOT}/docs/critic-loop-rules.md` first and follow it.
122
+ > **Always** read `${CLAUDE_SKILL_DIR}/../../docs/critic-loop-rules.md` first and follow it.
123
123
 
124
124
  Run the critic loop until convergence. Safety cap: 5 passes.
125
125
 
@@ -134,10 +134,10 @@ No issues found. Code looks good!
134
134
 
135
135
  Display the full review comment to the user in the console.
136
136
 
137
- Then determine the review event type:
138
- - **Critical findings exist** `REQUEST_CHANGES`
139
- - **Only Warning/Info findings** `COMMENT`
140
- - **No findings** `APPROVE`
137
+ Then determine the review event based on the actual severity and context of findings:
138
+ - **REQUEST_CHANGES**: Use when findings indicate genuine risk to production code — bugs that would affect users, security vulnerabilities, or architectural violations that would be costly to fix later. A Critical finding in test code or documentation alone does not warrant blocking the PR.
139
+ - **COMMENT**: Use when findings are improvements or concerns that the author should consider but that don't pose immediate risk. Also appropriate when Critical findings are in non-production code (tests, docs, config) or when the author has already acknowledged the concern in PR discussion.
140
+ - **APPROVE**: Use when no findings exist, or when all findings are informational and the code is ready to merge.
141
141
 
142
142
  Tell the user:
143
143
  ```
@@ -107,5 +107,5 @@ Collect principles interactively:
107
107
 
108
108
  - **Persistent storage**: Saved to .claude/afc/memory/principles.md and maintained across sessions.
109
109
  - **Auto-referenced**: Automatically loaded and validated by /afc:plan and /afc:architect.
110
- - **Keep it concise**: Maintain no more than 10 principles. Too many reduces effectiveness.
110
+ - **Keep it concise**: Keep principles concise and actionable. If the list grows long enough that principles start overlapping or becoming too granular, suggest consolidation. The goal is a set of principles that can be held in working memory — typically under 15, but the right number depends on the project's complexity.
111
111
  - **Avoid duplication with CLAUDE.md**: Do not re-register rules already present in CLAUDE.md as principles.
@@ -82,7 +82,7 @@ Checks:
82
82
  Evaluate general code quality indicators.
83
83
 
84
84
  Checks:
85
- - **Complexity hotspots**: deeply nested logic, functions exceeding ~50 LOC
85
+ - **Complexity hotspots**: deeply nested logic, functions with high cognitive complexity (many branches, side effects, or state mutations). Line count alone is not a reliable indicator — a 30-line function with nested conditionals and side effects may be more complex than a 60-line function with simple sequential logic.
86
86
  - **Duplication**: near-identical code blocks across files
87
87
  - **Magic numbers/strings**: unexplained literals in logic
88
88
  - **TODO/FIXME accumulation**: stale markers (count, age if git history available)
@@ -128,7 +128,7 @@ For each active category:
128
128
 
129
129
  ### 5. Critic Loop
130
130
 
131
- Apply `docs/critic-loop-rules.md` with **safety cap: 3 rounds**.
131
+ **Always** read `${CLAUDE_SKILL_DIR}/../../docs/critic-loop-rules.md` first and follow it. Safety cap: **5 passes**.
132
132
 
133
133
  Focus the critic on:
134
134
  - Are the findings actionable or just noise?
@@ -75,13 +75,17 @@ Flag any matches for the Breaking Changes section.
75
75
 
76
76
  Categorize each commit/PR into one of:
77
77
 
78
- | Category | Conventional Commit Prefixes | Fallback Heuristics |
79
- |----------|------------------------------|---------------------|
78
+ | Category | Conventional Commit Prefixes | Fallback (no prefix) |
79
+ |----------|------------------------------|----------------------|
80
80
  | Breaking Changes | `!:` suffix, `BREAKING` | Label: `breaking` |
81
- | New Features | `feat:` | "add", "new", "implement", "support" |
82
- | Bug Fixes | `fix:` | "fix", "resolve", "correct", "patch" |
81
+ | New Features | `feat:` | Commit introduces new user-facing functionality |
82
+ | Bug Fixes | `fix:` | Commit fixes broken or incorrect behavior |
83
83
  | Other Changes | `chore:`, `docs:`, `ci:`, `refactor:`, `perf:`, `test:`, `style:`, `build:` | Everything else |
84
84
 
85
+ **Fallback classification rule** — For commits without conventional prefixes, read the commit message semantically. Classify based on what the commit actually does: did it introduce new user-facing functionality (New Features)? Did it fix broken behavior (Bug Fixes)? Or is it a maintenance/improvement change (Other Changes)? Do not match individual words — understand the commit's purpose.
86
+
87
+ The word "add" in "add a new API endpoint" indicates a feature. The same word in "add missing test coverage" indicates a test (Other Changes). Context determines classification.
88
+
85
89
  **Rewriting rules** — transform each entry from developer-speak to user-facing language:
86
90
 
87
91
  1. Remove conventional commit prefixes (`feat:`, `fix(scope):`, etc.)
@@ -72,14 +72,14 @@ Before reviewing, identify **files affected by the changes** (not just the chang
72
72
  3. **Scope decision**:
73
73
  - Affected files are NOT full review targets (that would explode scope)
74
74
  - Instead, include them as **cross-reference context** in Step 2 and Step 3.5
75
- - If an affected file has >3 references to a changed symbol flag for closer inspection
75
+ - Flag affected files for closer inspection when they have significant coupling to the changed code consider the nature of the references (type-only imports vs behavioral calls), the criticality of the affected file, and whether the references involve the specific symbols that changed.
76
76
 
77
77
  4. **Limitations** (include in review output):
78
78
  > ⚠ Dynamic dependencies not covered: runtime dispatch (`obj[method]()`), reflection, cross-language calls, config/env-driven branching. Manual verification recommended for these patterns.
79
79
 
80
80
  ### 2. Parallel Review (scaled by file count)
81
81
 
82
- Choose review orchestration based on the number of changed files:
82
+ Assess review complexity holistically consider total diff size (lines changed), file complexity, diversity of change types, and whether changes are localized to one module or cross-cutting across multiple boundaries.
83
83
 
84
84
  **Pre-scan: Call Chain Context** (for Parallel Batch and Review Swarm modes only):
85
85
 
@@ -97,21 +97,21 @@ Before distributing files to review agents, collect cross-boundary context:
97
97
  Review findings should account for these behaviors.
98
98
  ```
99
99
 
100
- For Direct review mode (≤5 files): skip pre-scan — orchestrator already has full context.
100
+ For Direct review mode: skip pre-scan — orchestrator already has full context.
101
101
 
102
- #### 5 or fewer files: Direct review
103
- Review all files directly in the current context (no delegation).
102
+ #### Low complexity: Direct review
103
+ Appropriate when changes are small in total diff size, confined to a single module or area, and the reviewing model can hold all changed files in context without losing coherence. Review all files directly in the current context (no delegation).
104
104
 
105
- #### 6–10 files: Parallel Batch
106
- Distribute to parallel review agents (2–3 files per agent) in a **single message**:
105
+ #### Moderate complexity: Parallel Batch
106
+ Appropriate when changes span multiple files or modules, the total diff size is substantial, or different change types (e.g., API, UI, config) benefit from focused review segments. Distribute to parallel review agents (2–3 files per agent) in a **single message**:
107
107
  ```
108
108
  Task("Review: {file1, file2}", subagent_type: "general-purpose")
109
109
  Task("Review: {file3, file4}", subagent_type: "general-purpose")
110
110
  ```
111
111
  Read each agent's returned output, then write consolidated review.
112
112
 
113
- #### 11+ files: Review Swarm
114
- Create a review task pool and spawn pre-assigned review workers:
113
+ #### High complexity: Review Swarm
114
+ Appropriate when changes are large-scale, cross-cutting across many modules, involve mixed change types (security-sensitive code, architecture layers, business logic), or individual file groups require deep specialist focus. Create a review task pool and spawn pre-assigned review workers:
115
115
 
116
116
  > **Note**: Unlike implement swarm (which prohibits self-claiming due to write conflicts), review workers use orchestrator pre-assignment by file group. This is safe because review is read-only — no write race conditions.
117
117
 
@@ -204,9 +204,9 @@ For each changed file, examine from the following perspectives:
204
204
 
205
205
  After individual/parallel reviews complete, the **orchestrator** MUST perform a cross-boundary check. This is a required step, not optional — skipping it is a review defect.
206
206
 
207
- **For 11+ file reviews**: This is especially critical because individual review agents cannot see cross-file interactions. The orchestrator MUST read callee implementations directly.
207
+ **For High complexity (Review Swarm) reviews**: This is especially critical because individual review agents cannot see cross-file interactions. The orchestrator MUST read callee implementations directly.
208
208
 
209
- 0. **Impact Map integration**: Use the Impact Map from Step 1.5 to prioritize verification. Affected files with >3 references to changed symbols should be read and checked for breakage — even if no finding was raised against them.
209
+ 0. **Impact Map integration**: Use the Impact Map from Step 1.5 to prioritize verification. Affected files with significant coupling to changed symbols (behavioral call references, not just type imports, especially in critical code paths) should be read and checked for breakage — even if no finding was raised against them.
210
210
 
211
211
  1. **Filter**: From all collected findings, select those involving:
212
212
  - Call order changes (function A now calls B before C)
@@ -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 `${CLAUDE_PLUGIN_ROOT}/docs/critic-loop-rules.md` first and follow it.
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
 
@@ -41,11 +41,26 @@ For dependency audit command: infer from `packageManager` field in `package.json
41
41
  - `$ARGUMENTS` = "full" → entire `src/`
42
42
  - Not specified → changed files from `git diff --name-only HEAD`
43
43
 
44
- ### 2. Agent Teams (if more than 10 files)
44
+ ### 2. Agent Teams (when scan complexity warrants it)
45
45
 
46
- Use parallel agents for wide-scope scans:
46
+ Use Agent Teams when the scan scope is complex enough that a single-pass review would miss cross-file vulnerability patterns. Assess holistically:
47
47
 
48
- **Pre-scan: Data Flow Context** (before distributing to agents):
48
+ - **File types**: Auth handlers, trust boundary code, and input-processing layers warrant deeper multi-agent scrutiny than config files or simple utilities
49
+ - **Code volume**: Large files with dense logic benefit from focused agent attention
50
+ - **Diversity of concerns**: Multiple distinct security domains (auth + injection + data exposure) across separate modules
51
+ - **Trust boundaries**: Files that cross privilege levels (user input → DB, client → server, public → internal API)
52
+
53
+ Use Agent Teams when any of the following apply:
54
+ - Scan includes auth handlers, session management, or access control logic spanning multiple files
55
+ - Input entry points and their sanitization/consumption code live in different directories
56
+ - The scope spans multiple distinct security domains that cannot be assessed in a single coherent pass
57
+
58
+ Use direct scan (orchestrator only) when:
59
+ - Scope is a single module or tightly-coupled set of files
60
+ - Security concerns are localized (e.g., one feature, one data flow)
61
+ - No cross-file trust boundary transitions are involved
62
+
63
+ **Pre-scan: Data Flow Context** (before distributing to agents, when using Agent Teams):
49
64
 
50
65
  1. For each changed file, identify **input entry points** (user input, API params, URL params, form data) and **sanitization calls** (validation, escaping, encoding)
51
66
  2. Trace input flow across changed files: where does user input enter? Where is it sanitized? Where is it consumed?
@@ -65,7 +80,7 @@ Task("Security scan: src/shared/api/", subagent_type: general-purpose,
65
80
  prompt: "... {include Data Flow Context} ...")
66
81
  ```
67
82
 
68
- For scans with ≤10 files: skip pre-scan — orchestrator has full context.
83
+ For direct scans (orchestrator only): skip pre-scan — orchestrator has full context.
69
84
 
70
85
  ### 2.5. Cross-Boundary Verification
71
86