all-for-claudecode 2.5.0 → 2.6.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/README.md +13 -2
- package/commands/auto.md +1 -1
- package/commands/doctor.md +63 -22
- package/commands/init.md +8 -5
- package/commands/qa.md +191 -0
- package/commands/resume.md +1 -1
- package/docs/phase-gate-protocol.md +1 -1
- package/package.json +5 -3
- package/scripts/afc-bash-guard.sh +3 -3
- package/scripts/afc-config-change.sh +8 -0
- package/scripts/afc-consistency-check.sh +58 -19
- package/scripts/afc-dag-validate.sh +1 -1
- package/scripts/afc-doctor.sh +445 -0
- package/scripts/afc-failure-hint.sh +24 -2
- package/scripts/afc-qa-audit.sh +536 -0
- package/scripts/afc-state.sh +3 -3
- package/scripts/afc-sync-cache.sh +49 -0
- package/scripts/afc-triage.sh +14 -3
- package/scripts/pre-compact-checkpoint.sh +2 -2
- package/scripts/session-start-context.sh +27 -1
- package/scripts/track-afc-changes.sh +3 -3
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
},
|
|
7
7
|
"metadata": {
|
|
8
8
|
"description": "Automated pipeline for Claude Code — spec → plan → implement → review → clean",
|
|
9
|
-
"version": "2.
|
|
9
|
+
"version": "2.6.0"
|
|
10
10
|
},
|
|
11
11
|
"plugins": [
|
|
12
12
|
{
|
|
13
13
|
"name": "afc",
|
|
14
14
|
"source": "./",
|
|
15
15
|
"description": "Automated pipeline for Claude Code. Automates the full development cycle: spec → plan → implement → review → clean.",
|
|
16
|
-
"version": "2.
|
|
16
|
+
"version": "2.6.0",
|
|
17
17
|
"category": "automation",
|
|
18
18
|
"tags": ["pipeline", "automation", "spec", "plan", "implement", "review", "critic-loop"]
|
|
19
19
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "afc",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.0",
|
|
4
4
|
"description": "Automated pipeline for Claude Code. Automates the full development cycle: spec → plan → implement → review → clean.",
|
|
5
5
|
"author": { "name": "jhlee0409", "email": "relee6203@gmail.com" },
|
|
6
6
|
"homepage": "https://github.com/jhlee0409/all-for-claudecode",
|
package/README.md
CHANGED
|
@@ -122,7 +122,11 @@ Performance: ✓ no N+1 queries
|
|
|
122
122
|
| `/afc:launch` | Generate release artifacts (changelog, tag, publish) |
|
|
123
123
|
| `/afc:validate` | Verify artifact consistency |
|
|
124
124
|
| `/afc:analyze` | General-purpose code and component analysis |
|
|
125
|
+
| `/afc:qa` | Project quality audit — test confidence, error resilience, code health |
|
|
125
126
|
| `/afc:consult` | Expert consultation (backend, infra, PM, design, marketing) |
|
|
127
|
+
| `/afc:triage` | Analyze open PRs and issues in parallel |
|
|
128
|
+
| `/afc:pr-comment` | Generate structured PR review comments |
|
|
129
|
+
| `/afc:release-notes` | Generate release notes from git history |
|
|
126
130
|
| `/afc:clarify` | Resolve spec ambiguities |
|
|
127
131
|
|
|
128
132
|
### Individual Command Examples
|
|
@@ -142,6 +146,12 @@ Performance: ✓ no N+1 queries
|
|
|
142
146
|
|
|
143
147
|
# Explore and structure a product idea
|
|
144
148
|
/afc:ideate "real-time collaboration feature"
|
|
149
|
+
|
|
150
|
+
# Triage open PRs and issues
|
|
151
|
+
/afc:triage # all open PRs + issues
|
|
152
|
+
/afc:triage --pr # PRs only
|
|
153
|
+
/afc:triage --deep # deep analysis with diff review
|
|
154
|
+
/afc:triage 42 99 # specific items by number
|
|
145
155
|
```
|
|
146
156
|
|
|
147
157
|
## Hook Events
|
|
@@ -161,7 +171,7 @@ Every hook fires automatically — no configuration needed after install.
|
|
|
161
171
|
| `Notification` | Desktop alerts (macOS/Linux) |
|
|
162
172
|
| `TaskCompleted` | CI gate (shell) + acceptance criteria verification (LLM) |
|
|
163
173
|
| `SubagentStop` | Tracks subagent completion in pipeline log |
|
|
164
|
-
| `UserPromptSubmit` | Injects Phase/Feature context
|
|
174
|
+
| `UserPromptSubmit` | Injects Phase/Feature context + drift checkpoint during active pipeline |
|
|
165
175
|
| `PermissionRequest` | Auto-allows CI commands during implement/review |
|
|
166
176
|
| `ConfigChange` | Audits/blocks settings changes during active pipeline |
|
|
167
177
|
| `TeammateIdle` | Prevents Agent Teams idle during implement/review |
|
|
@@ -176,7 +186,8 @@ Handler types: `command` (shell scripts, all events), `prompt` (LLM single-turn,
|
|
|
176
186
|
|---|---|
|
|
177
187
|
| `afc-architect` | Remembers ADR decisions and architecture patterns across sessions. Auto-invoked during Plan (ADR recording) and Review (architecture compliance). |
|
|
178
188
|
| `afc-security` | Remembers vulnerability patterns and false positives across sessions. Auto-invoked during Review (security scanning). Runs in isolated worktree. |
|
|
179
|
-
| `afc-impl-worker` | Parallel implementation worker. Receives pre-assigned tasks from orchestrator. Ephemeral (no memory). |
|
|
189
|
+
| `afc-impl-worker` | Parallel implementation worker. Receives pre-assigned tasks from orchestrator. Ephemeral (no memory). Max 50 turns, auto-approve edits. |
|
|
190
|
+
| `afc-pr-analyst` | PR deep analysis worker for triage. Runs in isolated worktree with diff access. Max 15 turns. |
|
|
180
191
|
|
|
181
192
|
## Expert Consultation
|
|
182
193
|
|
package/commands/auto.md
CHANGED
|
@@ -499,7 +499,7 @@ Artifact cleanup and codebase hygiene check after implementation and review:
|
|
|
499
499
|
```
|
|
500
500
|
- Create `.claude/afc/memory/quality-history/` directory if it does not exist
|
|
501
501
|
6. **Checkpoint reset**:
|
|
502
|
-
- Clear `.claude/afc/memory/checkpoint.md` **and** `~/.claude/projects/{ENCODED_PATH}/
|
|
502
|
+
- Clear `.claude/afc/memory/checkpoint.md` **and** `~/.claude/projects/{ENCODED_PATH}/memory/checkpoint.md` (pipeline complete = session goal achieved, dual-delete prevents stale checkpoint in either location; `ENCODED_PATH` = project path with `/` replaced by `-`)
|
|
503
503
|
7. **Timeline finalize**:
|
|
504
504
|
```bash
|
|
505
505
|
"${CLAUDE_PLUGIN_ROOT}/scripts/afc-pipeline-manage.sh" log pipeline-end "Pipeline complete: {feature}"
|
package/commands/doctor.md
CHANGED
|
@@ -59,7 +59,7 @@ Run ALL checks regardless of earlier failures. Do not short-circuit.
|
|
|
59
59
|
|-------|-----|------|------|
|
|
60
60
|
| Global CLAUDE.md exists | Read `~/.claude/CLAUDE.md` | File exists | ⚠ Warning: no global CLAUDE.md. all-for-claudecode skills won't auto-trigger from intent. Fix: run `/afc:init` |
|
|
61
61
|
| all-for-claudecode block present | Grep for `<!-- AFC:START -->` and `<!-- AFC:END -->` in `~/.claude/CLAUDE.md` | Both markers found | Fix: run `/afc:init` to inject all-for-claudecode block |
|
|
62
|
-
| all-for-claudecode block version | Extract version from `<!-- AFC:VERSION:X.Y.Z -->` in CLAUDE.md.
|
|
62
|
+
| all-for-claudecode block version | Extract version from `<!-- AFC:VERSION:X.Y.Z -->` in CLAUDE.md. Read `${CLAUDE_PLUGIN_ROOT}/package.json` (`.version`) to get the actual plugin version. Compare the two. | Block version = plugin version | ⚠ Warning: all-for-claudecode block is outdated (found {block_version}, current {plugin_version}). Fix: run `/afc:init` to update |
|
|
63
63
|
| No conflicting routing | Grep for conflicting agent patterns (`executor`, `deep-executor`, `debugger`, `code-reviewer`) outside all-for-claudecode block that could intercept afc intents | No conflicts or conflicts are inside other tool blocks | ⚠ Warning: found agent routing that may conflict with afc skills. Review `~/.claude/CLAUDE.md` |
|
|
64
64
|
|
|
65
65
|
### Category 4: Legacy Migration (v1.x → v2.0)
|
|
@@ -112,36 +112,56 @@ Run ALL checks regardless of earlier failures. Do not short-circuit.
|
|
|
112
112
|
|
|
113
113
|
| Check | How | Pass | Fail |
|
|
114
114
|
|-------|-----|------|------|
|
|
115
|
-
| Version triple match | Compare versions in `package.json
|
|
115
|
+
| Version triple match | Compare versions in `package.json` (`.version`), `.claude-plugin/plugin.json` (`.version`), `.claude-plugin/marketplace.json` (`.metadata.version` and `.plugins[0].version`) | All identical | ✗ Fix: update mismatched files to the same version |
|
|
116
116
|
| Cache in sync | Compare `commands/auto.md` content between source and `~/.claude/plugins/cache/all-for-claudecode/afc/{version}/commands/auto.md` | Content matches | ⚠ Warning: plugin cache is stale. Fix: copy source files to cache directory |
|
|
117
117
|
|
|
118
|
+
### Category 9: Command Definitions (development only)
|
|
119
|
+
|
|
120
|
+
> Only run if current directory is the all-for-claudecode source repo (same condition as Category 8).
|
|
121
|
+
|
|
122
|
+
| Check | How | Pass | Fail |
|
|
123
|
+
|-------|-----|------|------|
|
|
124
|
+
| Frontmatter exists | Each `commands/*.md` file has opening and closing `---` block | All files have frontmatter | ✗ Fix: add YAML frontmatter block to `commands/{file}.md` |
|
|
125
|
+
| Required fields | Each command frontmatter contains `name:` and `description:` | All files have both fields | ✗ Fix: add missing `name:` or `description:` to `commands/{file}.md` |
|
|
126
|
+
| Name-filename match | `name:` value follows `afc:{filename}` pattern (e.g. `auto.md` → `name: afc:auto`) | All names match filenames | ✗ Fix: rename `name:` field in `commands/{file}.md` to `afc:{filename}` |
|
|
127
|
+
| Fork-agent reference | Commands with `context: fork` and `agent:` field reference a file that exists in `agents/` (e.g. `agent: afc-architect` → `agents/afc-architect.md` exists) | All agent references resolve | ✗ Fix: create missing agent file `agents/{name}.md` or fix `agent:` field in `commands/{file}.md` |
|
|
128
|
+
|
|
129
|
+
### Category 10: Agent Definitions (development only)
|
|
130
|
+
|
|
131
|
+
> Only run if current directory is the all-for-claudecode source repo (same condition as Category 8).
|
|
132
|
+
|
|
133
|
+
| Check | How | Pass | Fail |
|
|
134
|
+
|-------|-----|------|------|
|
|
135
|
+
| Frontmatter exists | Each `agents/*.md` file has opening and closing `---` block | All files have frontmatter | ✗ Fix: add YAML frontmatter block to `agents/{file}.md` |
|
|
136
|
+
| Required fields | Each agent frontmatter contains `name:`, `description:`, and `model:` | All files have all 3 fields | ✗ Fix: add missing field to `agents/{file}.md` |
|
|
137
|
+
| Name-filename match | `name:` value equals the filename without extension (e.g. `afc-architect.md` → `name: afc-architect`) | All names match filenames | ✗ Fix: rename `name:` field in `agents/{file}.md` to match filename |
|
|
138
|
+
| Expert memory | All 8 expert consultation agents (`afc-backend-expert`, `afc-infra-expert`, `afc-pm-expert`, `afc-design-expert`, `afc-marketing-expert`, `afc-legal-expert`, `afc-appsec-expert`, `afc-tech-advisor`) have `memory: project` | All experts have memory field | ✗ Fix: add `memory: project` to `agents/{name}.md` frontmatter |
|
|
139
|
+
| Worker maxTurns | `afc-impl-worker` and `afc-pr-analyst` have `maxTurns:` field | Both workers have maxTurns | ✗ Fix: add `maxTurns:` to `agents/{name}.md` frontmatter |
|
|
140
|
+
|
|
141
|
+
### Category 11: Doc References (development only)
|
|
142
|
+
|
|
143
|
+
> Only run if current directory is the all-for-claudecode source repo (same condition as Category 8).
|
|
144
|
+
|
|
145
|
+
| Check | How | Pass | Fail |
|
|
146
|
+
|-------|-----|------|------|
|
|
147
|
+
| Referenced docs exist | Scan commands and agents for file references to `docs/` (e.g. `docs/critic-loop-rules.md`, `docs/phase-gate-protocol.md`). Each referenced file must exist. | All referenced docs found | ✗ Fix: create missing `docs/{file}.md` or fix the reference |
|
|
148
|
+
| Domain adapters exist | `docs/domain-adapters/` directory contains at least one `.md` file | ≥ 1 adapter file found | ✗ Fix: add domain adapter files to `docs/domain-adapters/` |
|
|
149
|
+
|
|
118
150
|
---
|
|
119
151
|
|
|
120
152
|
## Execution
|
|
121
153
|
|
|
122
|
-
1.
|
|
154
|
+
1. Run the automated health check script:
|
|
123
155
|
```
|
|
124
|
-
|
|
125
|
-
=======================
|
|
156
|
+
"${CLAUDE_PLUGIN_ROOT}/scripts/afc-doctor.sh" $ARGUMENTS
|
|
126
157
|
```
|
|
158
|
+
This covers Categories 1-8 automatically.
|
|
127
159
|
|
|
128
|
-
2.
|
|
129
|
-
- Print ` ✓ {check name}` on pass
|
|
130
|
-
- Print ` ⚠ {check name}: {brief reason}` on warning
|
|
131
|
-
- Print ` ✗ {check name}: {brief reason}` on fail
|
|
132
|
-
- On fail/warning, print ` Fix: {command}` indented below
|
|
160
|
+
2. Print the script's stdout output as-is (already formatted with pass/warn/fail markers).
|
|
133
161
|
|
|
134
|
-
3. If
|
|
135
|
-
- Print additional details for each check (command output, file paths, versions found)
|
|
162
|
+
3. If in the source repo (package.json `name` = `"all-for-claudecode"`), continue with Categories 9-11 manually using the check tables above.
|
|
136
163
|
|
|
137
|
-
4. Print summary
|
|
138
|
-
```
|
|
139
|
-
─────────────────────────
|
|
140
|
-
Results: {pass} passed, {warn} warnings, {fail} failures
|
|
141
|
-
```
|
|
142
|
-
- If all pass: `No issues found!`
|
|
143
|
-
- If warnings only: `{N} warnings found. Non-blocking but review recommended.`
|
|
144
|
-
- If any failures: `{N} issues need attention. Run the Fix commands above.`
|
|
164
|
+
4. Print combined summary (script summary + any additional findings from Categories 9-11).
|
|
145
165
|
|
|
146
166
|
## Example Output
|
|
147
167
|
|
|
@@ -178,8 +198,29 @@ Hook Health
|
|
|
178
198
|
✓ All scripts exist
|
|
179
199
|
✓ All scripts executable
|
|
180
200
|
|
|
201
|
+
Version Sync (dev)
|
|
202
|
+
✓ Version triple match
|
|
203
|
+
✓ Cache in sync
|
|
204
|
+
|
|
205
|
+
Command Definitions (dev)
|
|
206
|
+
✓ Frontmatter exists (25 files)
|
|
207
|
+
✓ Required fields present
|
|
208
|
+
✓ Name-filename match
|
|
209
|
+
✓ Fork-agent references valid
|
|
210
|
+
|
|
211
|
+
Agent Definitions (dev)
|
|
212
|
+
✓ Frontmatter exists (12 files)
|
|
213
|
+
✓ Required fields present
|
|
214
|
+
✓ Name-filename match
|
|
215
|
+
✓ Expert memory configured (8/8)
|
|
216
|
+
✓ Worker maxTurns configured (2/2)
|
|
217
|
+
|
|
218
|
+
Doc References (dev)
|
|
219
|
+
✓ Referenced docs exist
|
|
220
|
+
✓ Domain adapters exist (3 files)
|
|
221
|
+
|
|
181
222
|
─────────────────────────
|
|
182
|
-
Results:
|
|
223
|
+
Results: 28 passed, 2 warnings, 0 failures
|
|
183
224
|
2 warnings found. Non-blocking but review recommended.
|
|
184
225
|
```
|
|
185
226
|
|
|
@@ -189,4 +230,4 @@ Results: 14 passed, 2 warnings, 0 failures
|
|
|
189
230
|
- **Always run all checks**: do not stop on first failure. The full picture is the value.
|
|
190
231
|
- **Actionable fixes**: every non-pass result must include a Fix line. Never report a problem without a solution.
|
|
191
232
|
- **Fast execution**: skip CI/gate command checks if `--fast` is in arguments (these are the slowest checks).
|
|
192
|
-
- **Development checks**:
|
|
233
|
+
- **Development checks**: Categories 8–11 (Version Sync, Command Definitions, Agent Definitions, Doc References) only run when inside the all-for-claudecode source repo.
|
package/commands/init.md
CHANGED
|
@@ -41,10 +41,12 @@ Before anything else, detect and migrate v1.x (selfish-pipeline) artifacts:
|
|
|
41
41
|
- Rename: `mv .claude/selfish .claude/afc`
|
|
42
42
|
- Print: `Migrated: .claude/selfish/ → .claude/afc/`
|
|
43
43
|
|
|
44
|
-
**D. Git tag
|
|
45
|
-
- Check `git tag -l 'selfish
|
|
46
|
-
- If any found:
|
|
47
|
-
-
|
|
44
|
+
**D. Git tag cleanup**
|
|
45
|
+
- Check `git tag -l 'selfish/*'`
|
|
46
|
+
- If any found:
|
|
47
|
+
- Known patterns (`selfish/pre-*`, `selfish/phase-*`): rename to `afc/` equivalent (`git tag afc/... selfish/... && git tag -d selfish/...`)
|
|
48
|
+
- All remaining `selfish/*`: delete (`git tag -d`)
|
|
49
|
+
- Print: `Migrated: {renamed} renamed, {deleted} deleted`
|
|
48
50
|
|
|
49
51
|
### 2. Check for Existing Config
|
|
50
52
|
|
|
@@ -237,9 +239,11 @@ Classify the user's intent and route to the matching skill. Use semantic underst
|
|
|
237
239
|
| Test | `afc:test` | User wants to write tests, improve coverage, or verify behavior |
|
|
238
240
|
| Validate | `afc:validate` | User wants to check consistency or validate existing pipeline artifacts |
|
|
239
241
|
| Analyze | `afc:analyze` | User wants to understand, explore, or audit existing code without modifying it |
|
|
242
|
+
| QA Audit | `afc:qa` | User wants project quality audit, test confidence check, or runtime quality gaps |
|
|
240
243
|
| Research | `afc:research` | User wants deep investigation of external tools, libraries, APIs, or technical concepts |
|
|
241
244
|
| Ideate | `afc:ideate` | User wants to brainstorm ideas, explore possibilities, or draft a product brief |
|
|
242
245
|
| Consult | `afc:consult` | User wants expert advice on a decision: library choice, architecture direction, legal/security/infra guidance |
|
|
246
|
+
| Launch | `afc:launch` | User wants to prepare a release — generate changelog, release notes, version bump, or tag |
|
|
243
247
|
| Tasks | `afc:tasks` | User explicitly wants to decompose work into a task breakdown |
|
|
244
248
|
| Ambiguous | `afc:clarify` | User's request is too vague or underspecified to route confidently |
|
|
245
249
|
|
|
@@ -250,7 +254,6 @@ Classify the user's intent and route to the matching skill. Use semantic underst
|
|
|
250
254
|
3. **Design-first**: When scope is non-trivial (multiple files, architectural decisions needed), prefer `afc:auto` or `afc:plan` over direct `afc:implement`.
|
|
251
255
|
|
|
252
256
|
User-only (not auto-triggered — inform user on request):
|
|
253
|
-
- `afc:launch` — inform user when release artifact generation is requested
|
|
254
257
|
- `afc:doctor` — inform user when health check is requested
|
|
255
258
|
- `afc:architect` — inform user when architecture review is requested
|
|
256
259
|
- `afc:security` — inform user when security scan is requested
|
package/commands/qa.md
ADDED
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: afc:qa
|
|
3
|
+
description: "Project quality audit — detect gaps between structure and runtime behavior"
|
|
4
|
+
argument-hint: "[scope: all, tests, errors, coverage, or specific concern]"
|
|
5
|
+
user-invocable: true
|
|
6
|
+
context: fork
|
|
7
|
+
allowed-tools:
|
|
8
|
+
- Read
|
|
9
|
+
- Grep
|
|
10
|
+
- Glob
|
|
11
|
+
- Bash
|
|
12
|
+
model: sonnet
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# /afc:qa — Project Quality Audit
|
|
16
|
+
|
|
17
|
+
> Detects quality gaps between structural correctness and actual runtime behavior.
|
|
18
|
+
> **Read-only** — does not modify any files. Reports findings to console only.
|
|
19
|
+
|
|
20
|
+
## Arguments
|
|
21
|
+
|
|
22
|
+
- `$ARGUMENTS` — (optional) scope of audit. Defaults to `all`.
|
|
23
|
+
- `all` — run all 5 categories
|
|
24
|
+
- `tests` — category A only (Test Confidence)
|
|
25
|
+
- `errors` — category B only (Error Resilience)
|
|
26
|
+
- `coverage` — categories A + D (Test Confidence + API & Contract Safety)
|
|
27
|
+
- Or a free-form concern (e.g., "are error messages user-friendly", "check for dead exports")
|
|
28
|
+
|
|
29
|
+
## Config Load
|
|
30
|
+
|
|
31
|
+
**Always** read `.claude/afc.config.md` first. This file contains free-form markdown sections:
|
|
32
|
+
- `## Architecture` — architecture pattern, layers, import rules
|
|
33
|
+
- `## Code Style` — language, naming conventions, lint rules
|
|
34
|
+
- `## CI Commands` — test, lint, gate commands (YAML)
|
|
35
|
+
- `## Project Context` — framework, state management, testing strategy
|
|
36
|
+
|
|
37
|
+
If config file is missing: read `CLAUDE.md` for project info. Proceed without config if neither exists.
|
|
38
|
+
|
|
39
|
+
## Audit Categories
|
|
40
|
+
|
|
41
|
+
### A. Test Confidence
|
|
42
|
+
|
|
43
|
+
Evaluate whether the test suite actually catches regressions.
|
|
44
|
+
|
|
45
|
+
Checks:
|
|
46
|
+
- **Assertion density**: ratio of assertions to test functions (low ratio = weak tests)
|
|
47
|
+
- **Test-to-code ratio**: test LOC vs source LOC per layer (guided by `{config.architecture}`)
|
|
48
|
+
- **Mock overuse**: tests that mock so much they only test the mock setup
|
|
49
|
+
- **Runtime verification**: execute `{config.test}` and analyze output (pass/fail counts, skipped tests, timing)
|
|
50
|
+
- **Missing coverage**: source files/modules with zero test coverage
|
|
51
|
+
|
|
52
|
+
### B. Error Resilience
|
|
53
|
+
|
|
54
|
+
Evaluate whether errors are handled consistently and helpfully.
|
|
55
|
+
|
|
56
|
+
Checks:
|
|
57
|
+
- **Catch consistency**: unhandled promise rejections, empty catch blocks, swallowed errors
|
|
58
|
+
- **Error propagation**: errors that lose context through the call chain
|
|
59
|
+
- **User-facing messages**: cryptic error strings, raw stack traces exposed to users
|
|
60
|
+
- **Boundary validation**: missing input validation at API/CLI/form boundaries
|
|
61
|
+
- Apply `{config.code_style}` error handling rules if available
|
|
62
|
+
|
|
63
|
+
### C. Build & CI Integrity
|
|
64
|
+
|
|
65
|
+
Evaluate whether CI pipeline is healthy and reproducible.
|
|
66
|
+
|
|
67
|
+
Checks:
|
|
68
|
+
- **CI execution**: run `{config.ci}` and `{config.gate}` commands, verify they pass
|
|
69
|
+
- **Lock file integrity**: lock file present, consistent with manifest (package.json vs lock, etc.)
|
|
70
|
+
- **Unused dependencies**: declared but never imported packages
|
|
71
|
+
- **Build reproducibility**: environment-dependent paths, hardcoded secrets, missing env vars
|
|
72
|
+
|
|
73
|
+
### D. API & Contract Safety
|
|
74
|
+
|
|
75
|
+
Evaluate whether interfaces between modules are sound.
|
|
76
|
+
|
|
77
|
+
Checks:
|
|
78
|
+
- **Type mismatches**: function signatures vs actual usage at call sites
|
|
79
|
+
- **Dead exports**: exported symbols never imported elsewhere
|
|
80
|
+
- **Deprecated usage**: calls to deprecated APIs (internal or external)
|
|
81
|
+
- **Layer boundary violations**: imports that cross architecture boundaries (guided by `{config.architecture}`)
|
|
82
|
+
|
|
83
|
+
### E. Code Health Signals
|
|
84
|
+
|
|
85
|
+
Evaluate general code quality indicators.
|
|
86
|
+
|
|
87
|
+
Checks:
|
|
88
|
+
- **Complexity hotspots**: deeply nested logic, functions exceeding ~50 LOC
|
|
89
|
+
- **Duplication**: near-identical code blocks across files
|
|
90
|
+
- **Magic numbers/strings**: unexplained literals in logic
|
|
91
|
+
- **TODO/FIXME accumulation**: stale markers (count, age if git history available)
|
|
92
|
+
- Compare against `{config.code_style}` rules if available
|
|
93
|
+
|
|
94
|
+
## Execution Steps
|
|
95
|
+
|
|
96
|
+
### 1. Load Config
|
|
97
|
+
|
|
98
|
+
Read `.claude/afc.config.md` (or fallback to `CLAUDE.md`). Extract:
|
|
99
|
+
- Test command (`{config.test}`)
|
|
100
|
+
- CI/gate commands (`{config.ci}`, `{config.gate}`)
|
|
101
|
+
- Architecture layers (`{config.architecture}`)
|
|
102
|
+
- Code style rules (`{config.code_style}`)
|
|
103
|
+
|
|
104
|
+
### 2. Parse Scope
|
|
105
|
+
|
|
106
|
+
Interpret `$ARGUMENTS` to determine which categories to run:
|
|
107
|
+
|
|
108
|
+
| Argument | Categories |
|
|
109
|
+
|----------|-----------|
|
|
110
|
+
| `all` or empty | A, B, C, D, E |
|
|
111
|
+
| `tests` | A |
|
|
112
|
+
| `errors` | B |
|
|
113
|
+
| `coverage` | A, D |
|
|
114
|
+
| free-form text | best-matching subset |
|
|
115
|
+
|
|
116
|
+
### 3. Lightweight Runtime
|
|
117
|
+
|
|
118
|
+
Run commands that produce real output:
|
|
119
|
+
- `{config.test}` — capture pass/fail/skip counts and timing
|
|
120
|
+
- `{config.gate}` or `{config.ci}` — capture exit code and output
|
|
121
|
+
|
|
122
|
+
Only run commands that exist in config. Skip gracefully if not configured.
|
|
123
|
+
|
|
124
|
+
### 4. Codebase Scan
|
|
125
|
+
|
|
126
|
+
For each active category:
|
|
127
|
+
1. Use Glob to discover relevant files
|
|
128
|
+
2. Use Grep for pattern-based detection (empty catches, TODO markers, etc.)
|
|
129
|
+
3. Use Read for targeted inspection of flagged files
|
|
130
|
+
4. Cross-reference findings against `{config.architecture}` layer structure
|
|
131
|
+
|
|
132
|
+
### 5. Critic Loop
|
|
133
|
+
|
|
134
|
+
Apply `docs/critic-loop-rules.md` with **safety cap: 3 rounds**.
|
|
135
|
+
|
|
136
|
+
Focus the critic on:
|
|
137
|
+
- Are the findings actionable or just noise?
|
|
138
|
+
- Did I miss obvious quality gaps?
|
|
139
|
+
- Are severity ratings justified by evidence?
|
|
140
|
+
|
|
141
|
+
### 6. Console Report
|
|
142
|
+
|
|
143
|
+
Output the final report in this format:
|
|
144
|
+
|
|
145
|
+
```markdown
|
|
146
|
+
## QA Audit: {project name or directory}
|
|
147
|
+
|
|
148
|
+
### Category A: Test Confidence
|
|
149
|
+
{findings with file:line references}
|
|
150
|
+
Verdict: PASS | WARN | FAIL
|
|
151
|
+
|
|
152
|
+
### Category B: Error Resilience
|
|
153
|
+
{findings with file:line references}
|
|
154
|
+
Verdict: PASS | WARN | FAIL
|
|
155
|
+
|
|
156
|
+
### Category C: Build & CI Integrity
|
|
157
|
+
{findings with file:line references}
|
|
158
|
+
Verdict: PASS | WARN | FAIL
|
|
159
|
+
|
|
160
|
+
### Category D: API & Contract Safety
|
|
161
|
+
{findings with file:line references}
|
|
162
|
+
Verdict: PASS | WARN | FAIL
|
|
163
|
+
|
|
164
|
+
### Category E: Code Health Signals
|
|
165
|
+
{findings with file:line references}
|
|
166
|
+
Verdict: PASS | WARN | FAIL
|
|
167
|
+
|
|
168
|
+
### Summary
|
|
169
|
+
├─ A: Test Confidence — {PASS|WARN|FAIL} {(N issues) if any}
|
|
170
|
+
├─ B: Error Resilience — {PASS|WARN|FAIL} {(N issues) if any}
|
|
171
|
+
├─ C: Build & CI — {PASS|WARN|FAIL} {(N issues) if any}
|
|
172
|
+
├─ D: API & Contract — {PASS|WARN|FAIL} {(N issues) if any}
|
|
173
|
+
└─ E: Code Health — {PASS|WARN|FAIL} {(N issues) if any}
|
|
174
|
+
|
|
175
|
+
Total: {N} PASS, {N} WARN, {N} FAIL
|
|
176
|
+
Priority fixes: {top 3 most impactful issues}
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
## Verdict Criteria
|
|
180
|
+
|
|
181
|
+
- **PASS** — no issues found, or only cosmetic observations
|
|
182
|
+
- **WARN** — issues found but not blocking; quality could degrade over time
|
|
183
|
+
- **FAIL** — critical gaps that likely cause bugs, outages, or security issues
|
|
184
|
+
|
|
185
|
+
## Notes
|
|
186
|
+
|
|
187
|
+
- **Read-only**: Do not modify any files. Report only.
|
|
188
|
+
- **Evidence-based**: Every finding must include a `file:line` reference or command output.
|
|
189
|
+
- **Config-aware**: Adapt checks to the project's declared architecture and conventions.
|
|
190
|
+
- **Scope discipline**: Only run categories matching the requested scope.
|
|
191
|
+
- **Not a linter**: Focus on semantic quality gaps that automated tools miss.
|
package/commands/resume.md
CHANGED
|
@@ -22,7 +22,7 @@ allowed-tools:
|
|
|
22
22
|
### 1. Load Checkpoint
|
|
23
23
|
|
|
24
24
|
Read `.claude/afc/memory/checkpoint.md`:
|
|
25
|
-
- If not found: check **auto-memory fallback** — read `~/.claude/projects/{ENCODED_PATH}/
|
|
25
|
+
- If not found: check **auto-memory fallback** — read `~/.claude/projects/{ENCODED_PATH}/memory/checkpoint.md` (where `ENCODED_PATH` = project path with `/` replaced by `-`):
|
|
26
26
|
- If fallback found: use it as the checkpoint source (auto-memory is written by `pre-compact-checkpoint.sh` during context compaction)
|
|
27
27
|
- If fallback also not found: output "No saved checkpoint found. Use `/afc:checkpoint` to create one, or checkpoints are created automatically on context compaction." then **stop**
|
|
28
28
|
- If found: parse the full contents (extract branch, commit hash, pipeline feature, task progress, modified files)
|
|
@@ -34,7 +34,7 @@ Quantitatively inspect changed files within the Phase against `{config.code_styl
|
|
|
34
34
|
After passing the Phase gate, automatically save session state:
|
|
35
35
|
|
|
36
36
|
1. Create `.claude/afc/memory/` directory if it does not exist
|
|
37
|
-
2. Write/update `.claude/afc/memory/checkpoint.md` **and** `~/.claude/projects/{ENCODED_PATH}/
|
|
37
|
+
2. Write/update `.claude/afc/memory/checkpoint.md` **and** `~/.claude/projects/{ENCODED_PATH}/memory/checkpoint.md` (dual-write for compaction resilience — `ENCODED_PATH` = project path with `/` replaced by `-`):
|
|
38
38
|
|
|
39
39
|
```markdown
|
|
40
40
|
# Phase Gate Checkpoint
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "all-for-claudecode",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.0",
|
|
4
4
|
"description": "Claude Code plugin that automates the full dev cycle — spec, plan, implement, review, clean.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"all-for-claudecode": "bin/cli.mjs"
|
|
@@ -35,9 +35,11 @@
|
|
|
35
35
|
},
|
|
36
36
|
"scripts": {
|
|
37
37
|
"lint": "shellcheck -x --source-path=scripts --severity=warning scripts/*.sh && bash scripts/afc-schema-validate.sh --all && bash scripts/afc-consistency-check.sh",
|
|
38
|
+
"qa": "bash scripts/afc-qa-audit.sh",
|
|
38
39
|
"test": "vendor/shellspec/shellspec",
|
|
39
|
-
"test:all": "npm run lint && npm run test",
|
|
40
|
-
"setup:test": "bash scripts/install-shellspec.sh"
|
|
40
|
+
"test:all": "npm run lint && npm run qa && npm run test",
|
|
41
|
+
"setup:test": "bash scripts/install-shellspec.sh",
|
|
42
|
+
"sync:cache": "bash scripts/afc-sync-cache.sh"
|
|
41
43
|
},
|
|
42
44
|
"engines": {
|
|
43
45
|
"node": ">=18"
|
|
@@ -14,15 +14,15 @@ cleanup() {
|
|
|
14
14
|
}
|
|
15
15
|
trap cleanup EXIT
|
|
16
16
|
|
|
17
|
+
# Consume stdin immediately (prevents SIGPIPE if exiting early)
|
|
18
|
+
INPUT=$(cat)
|
|
19
|
+
|
|
17
20
|
# If pipeline is inactive -> allow
|
|
18
21
|
if ! afc_state_is_active; then
|
|
19
22
|
printf '{"hookSpecificOutput":{"permissionDecision":"allow"}}\n'
|
|
20
23
|
exit 0
|
|
21
24
|
fi
|
|
22
25
|
|
|
23
|
-
# Parse tool input from stdin
|
|
24
|
-
INPUT=$(cat)
|
|
25
|
-
|
|
26
26
|
# If stdin is empty -> allow
|
|
27
27
|
if [ -z "$INPUT" ]; then
|
|
28
28
|
printf '{"hookSpecificOutput":{"permissionDecision":"allow"}}\n'
|
|
@@ -48,6 +48,14 @@ FILE_PATH=$(printf '%s' "$FILE_PATH" | head -1 | tr -d '\n\r' | cut -c1-500)
|
|
|
48
48
|
|
|
49
49
|
TIMESTAMP="$(date '+%Y-%m-%d %H:%M:%S')"
|
|
50
50
|
|
|
51
|
+
# Auto-rotate if audit log exceeds 1 MB
|
|
52
|
+
if [ -f "$AUDIT_LOG" ]; then
|
|
53
|
+
LOG_SIZE=$(wc -c < "$AUDIT_LOG" | tr -d ' ')
|
|
54
|
+
if [ "$LOG_SIZE" -ge 1048576 ]; then
|
|
55
|
+
mv "$AUDIT_LOG" "${AUDIT_LOG}.1"
|
|
56
|
+
fi
|
|
57
|
+
fi
|
|
58
|
+
|
|
51
59
|
# policy_settings changes are logged only (not blocked)
|
|
52
60
|
if [ "$SOURCE" = "policy_settings" ]; then
|
|
53
61
|
printf '[%s] source=%s path=%s\n' "$TIMESTAMP" "$SOURCE" "$FILE_PATH" >> "$AUDIT_LOG"
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
set -euo pipefail
|
|
3
3
|
|
|
4
4
|
# afc-consistency-check.sh — Cross-reference validation for project consistency
|
|
5
|
-
# Checks: config placeholders, agent names, hook scripts, test coverage
|
|
5
|
+
# Checks: config placeholders, agent names, hook scripts, test coverage, command docs
|
|
6
6
|
# Run as part of: npm run lint
|
|
7
7
|
|
|
8
8
|
# shellcheck disable=SC2329
|
|
@@ -32,6 +32,15 @@ ok() {
|
|
|
32
32
|
printf "[afc:consistency] ✓ %s\n" "$1"
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
+
# Extract a field value from command file YAML frontmatter
|
|
36
|
+
get_cmd_field() {
|
|
37
|
+
local file="$1" field="$2"
|
|
38
|
+
awk '/^---$/{n++; next} n==1{print} n>=2{exit}' "$file" \
|
|
39
|
+
| grep "^${field}:" \
|
|
40
|
+
| sed "s/^${field}:[[:space:]]*//" \
|
|
41
|
+
| tr -d '"' | head -1 || true
|
|
42
|
+
}
|
|
43
|
+
|
|
35
44
|
# --- Check 1: Config Placeholder Validation ---
|
|
36
45
|
# Verify all {config.*} references in commands/ and docs/ map to known config keys
|
|
37
46
|
|
|
@@ -240,30 +249,59 @@ check_phase_ssot() {
|
|
|
240
249
|
fi
|
|
241
250
|
done
|
|
242
251
|
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
252
|
+
if [ "$issues" -eq 0 ]; then
|
|
253
|
+
ok "Phase SSOT: no hardcoded phase lists in scripts"
|
|
254
|
+
fi
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
# --- Check 7: Command Documentation Cross-Reference ---
|
|
258
|
+
# Verify commands are documented in README.md, init.md, and CLAUDE.md
|
|
259
|
+
|
|
260
|
+
check_command_docs() {
|
|
247
261
|
local commands_dir="$PROJECT_DIR/commands"
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
262
|
+
[ -d "$commands_dir" ] || return
|
|
263
|
+
|
|
264
|
+
local readme="$PROJECT_DIR/README.md"
|
|
265
|
+
local init_cmd="$commands_dir/init.md"
|
|
266
|
+
local claude_md="$PROJECT_DIR/CLAUDE.md"
|
|
267
|
+
local issues=0
|
|
268
|
+
|
|
269
|
+
for cmd_file in "$commands_dir"/*.md; do
|
|
270
|
+
[ -f "$cmd_file" ] || continue
|
|
271
|
+
local cmd_name
|
|
272
|
+
cmd_name=$(basename "$cmd_file" .md)
|
|
273
|
+
|
|
274
|
+
# Sub-check A: README.md should mention /afc:{name}
|
|
275
|
+
if [ -f "$readme" ]; then
|
|
276
|
+
if ! grep -qE "/afc:${cmd_name}([^a-z0-9-]|$)" "$readme" 2>/dev/null; then
|
|
277
|
+
warn "Command '$cmd_name' missing from README.md command table"
|
|
278
|
+
issues=$((issues + 1))
|
|
256
279
|
fi
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
280
|
+
fi
|
|
281
|
+
|
|
282
|
+
# Sub-check B: init.md should mention afc:{name} for user-invocable commands
|
|
283
|
+
local invocable
|
|
284
|
+
invocable=$(get_cmd_field "$cmd_file" "user-invocable")
|
|
285
|
+
if [ "$invocable" != "false" ] && [ -f "$init_cmd" ]; then
|
|
286
|
+
if ! grep -qE "afc:${cmd_name}([^a-z0-9-]|$)" "$init_cmd" 2>/dev/null; then
|
|
287
|
+
warn "Command '$cmd_name' missing from init.md skill routing"
|
|
260
288
|
issues=$((issues + 1))
|
|
261
289
|
fi
|
|
262
|
-
|
|
263
|
-
|
|
290
|
+
fi
|
|
291
|
+
|
|
292
|
+
# Sub-check C: CLAUDE.md fork list for context:fork commands
|
|
293
|
+
local ctx
|
|
294
|
+
ctx=$(get_cmd_field "$cmd_file" "context")
|
|
295
|
+
if [ "$ctx" = "fork" ] && [ -f "$claude_md" ]; then
|
|
296
|
+
if ! grep "context: fork" "$claude_md" 2>/dev/null | grep -qE "([(, ])${cmd_name}([,) ]|$)"; then
|
|
297
|
+
warn "Command '$cmd_name' (context:fork) missing from CLAUDE.md fork list"
|
|
298
|
+
issues=$((issues + 1))
|
|
299
|
+
fi
|
|
300
|
+
fi
|
|
301
|
+
done
|
|
264
302
|
|
|
265
303
|
if [ "$issues" -eq 0 ]; then
|
|
266
|
-
ok "
|
|
304
|
+
ok "Command docs: all commands referenced in README.md, init.md, CLAUDE.md"
|
|
267
305
|
fi
|
|
268
306
|
}
|
|
269
307
|
|
|
@@ -277,6 +315,7 @@ check_hook_scripts
|
|
|
277
315
|
check_test_coverage
|
|
278
316
|
check_version_sync
|
|
279
317
|
check_phase_ssot
|
|
318
|
+
check_command_docs
|
|
280
319
|
|
|
281
320
|
printf "\n[afc:consistency] Done: %d errors, %d warnings\n" "$ERRORS" "$WARNINGS"
|
|
282
321
|
|
|
@@ -100,7 +100,7 @@ dfs_check() {
|
|
|
100
100
|
if [ "$color" = "0" ]; then
|
|
101
101
|
printf '1' > "$color_file"
|
|
102
102
|
|
|
103
|
-
neighbors="$(grep -E "^${current}
|
|
103
|
+
neighbors="$(grep -E "^${current} " "$EDGES_FILE" | cut -f2 || true)"
|
|
104
104
|
if [ -n "$neighbors" ]; then
|
|
105
105
|
while IFS= read -r neighbor; do
|
|
106
106
|
[ -z "$neighbor" ] && continue
|