@curdx/flow 2.2.3 → 2.2.5
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 +3 -2
- package/.claude-plugin/plugin.json +2 -1
- package/CHANGELOG.md +4 -566
- package/README.md +47 -113
- package/agents/flow-adversary.md +1 -0
- package/agents/flow-architect.md +9 -36
- package/agents/flow-brownfield-analyst.md +7 -18
- package/agents/flow-debugger.md +1 -0
- package/agents/flow-edge-hunter.md +1 -0
- package/agents/flow-executor.md +1 -0
- package/agents/flow-planner.md +11 -37
- package/agents/flow-product-designer.md +9 -41
- package/agents/flow-qa-engineer.md +1 -0
- package/agents/flow-researcher.md +9 -45
- package/agents/flow-reviewer.md +1 -0
- package/agents/flow-security-auditor.md +1 -0
- package/agents/flow-triage-analyst.md +1 -0
- package/agents/flow-ui-researcher.md +1 -0
- package/agents/flow-ux-designer.md +1 -0
- package/agents/flow-verifier.md +1 -0
- package/cli/doctor-workflow.js +5 -914
- package/cli/install-companions.js +8 -8
- package/cli/lib/doctor-claude-settings.js +736 -0
- package/cli/lib/doctor-runtime-environment.js +196 -0
- package/cli/lib/semver.js +14 -0
- package/cli/uninstall-actions.js +323 -0
- package/cli/uninstall.js +9 -253
- package/gates/coverage-audit-gate.md +1 -3
- package/gates/tdd-gate.md +0 -6
- package/gates/verification-gate.md +1 -5
- package/knowledge/artifact-output-discipline.md +24 -0
- package/knowledge/artifact-summary-contracts.md +50 -0
- package/knowledge/execution-strategies.md +6 -4
- package/knowledge/poc-first-workflow.md +2 -6
- package/knowledge/spec-driven-development.md +0 -4
- package/knowledge/systematic-debugging.md +0 -6
- package/knowledge/two-stage-review.md +8 -6
- package/knowledge/wave-execution.md +2 -1
- package/package.json +2 -2
- package/schemas/agent-frontmatter.schema.json +4 -0
- package/skills/brownfield-index/SKILL.md +14 -20
- package/skills/brownfield-index/references/applicability.md +12 -0
- package/skills/brownfield-index/references/handoff.md +8 -0
- package/skills/brownfield-index/references/index-contract.md +10 -0
- package/skills/browser-qa/SKILL.md +15 -35
- package/skills/browser-qa/references/handoff.md +6 -0
- package/skills/browser-qa/references/prerequisites.md +10 -0
- package/skills/browser-qa/references/qa-contract.md +20 -0
- package/skills/cancel/SKILL.md +20 -61
- package/skills/cancel/references/destructive-mode.md +17 -0
- package/skills/cancel/references/reporting.md +18 -0
- package/skills/cancel/references/state-recovery.md +30 -0
- package/skills/cancel/references/target-resolution.md +7 -0
- package/skills/debug/SKILL.md +23 -87
- package/skills/debug/references/context-gathering.md +11 -0
- package/skills/debug/references/failure-guard.md +25 -0
- package/skills/debug/references/intake.md +12 -0
- package/skills/debug/references/phase-workflow.md +34 -0
- package/skills/debug/references/reporting.md +20 -0
- package/skills/epic/SKILL.md +18 -50
- package/skills/epic/references/epic-artifacts.md +20 -0
- package/skills/epic/references/epic-intake.md +9 -0
- package/skills/epic/references/slice-handoff.md +16 -0
- package/skills/fast/SKILL.md +34 -102
- package/skills/fast/references/applicability.md +25 -0
- package/skills/fast/references/clarification.md +20 -0
- package/skills/fast/references/execution-contract.md +56 -0
- package/skills/help/SKILL.md +26 -132
- package/skills/help/references/dispatch.md +20 -0
- package/skills/help/references/overview.md +39 -0
- package/skills/help/references/troubleshoot.md +47 -0
- package/skills/help/references/workflow.md +37 -0
- package/skills/implement/SKILL.md +61 -237
- package/skills/implement/references/error-recovery.md +36 -0
- package/skills/implement/references/linear-execution.md +32 -0
- package/skills/implement/references/preflight.md +43 -0
- package/skills/implement/references/progress-contract.md +32 -0
- package/skills/implement/references/state-init.md +33 -0
- package/skills/implement/references/stop-hook-execution.md +36 -0
- package/skills/implement/references/strategy-router.md +38 -0
- package/skills/implement/references/subagent-execution.md +43 -0
- package/skills/init/SKILL.md +26 -95
- package/skills/init/references/gitignore-and-health.md +26 -0
- package/skills/init/references/next-steps.md +22 -0
- package/skills/init/references/preflight.md +15 -0
- package/skills/init/references/scaffold-contract.md +27 -0
- package/skills/review/SKILL.md +45 -153
- package/skills/review/references/optional-passes.md +48 -0
- package/skills/review/references/preflight.md +38 -0
- package/skills/review/references/report-contract.md +49 -0
- package/skills/review/references/reporting.md +20 -0
- package/skills/review/references/stage-execution.md +32 -0
- package/skills/security-audit/SKILL.md +16 -34
- package/skills/security-audit/references/audit-contract.md +21 -0
- package/skills/security-audit/references/gate-handoff.md +8 -0
- package/skills/security-audit/references/scope-and-depth.md +9 -0
- package/skills/spec/SKILL.md +55 -182
- package/skills/spec/references/artifact-landing.md +31 -0
- package/skills/spec/references/phase-execution.md +50 -0
- package/skills/spec/references/planning-review.md +31 -0
- package/skills/spec/references/preflight-and-routing.md +46 -0
- package/skills/spec/references/reporting.md +21 -0
- package/skills/start/SKILL.md +40 -123
- package/skills/start/references/branch-routing.md +51 -0
- package/skills/start/references/mode-semantics.md +12 -0
- package/skills/start/references/preflight.md +13 -0
- package/skills/start/references/reporting.md +20 -0
- package/skills/start/references/state-seeding.md +44 -0
- package/skills/start/references/workflow-handoff.md +26 -0
- package/skills/status/SKILL.md +17 -61
- package/skills/status/references/gather-contract.md +27 -0
- package/skills/status/references/health-rules.md +27 -0
- package/skills/status/references/output-contract.md +24 -0
- package/skills/status/references/preflight.md +10 -0
- package/skills/status/references/recovery-hints.md +18 -0
- package/skills/ui-sketch/SKILL.md +15 -34
- package/skills/ui-sketch/references/brief-intake.md +10 -0
- package/skills/ui-sketch/references/iteration-handoff.md +5 -0
- package/skills/ui-sketch/references/variant-contract.md +15 -0
- package/skills/verify/SKILL.md +31 -86
- package/skills/verify/references/evidence-workflow.md +39 -0
- package/skills/verify/references/output-contract.md +23 -0
- package/skills/verify/references/preflight.md +11 -0
- package/skills/verify/references/report-handoff.md +35 -0
- package/skills/verify/references/strict-mode.md +12 -0
- package/README.zh.md +0 -160
package/skills/init/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: init
|
|
3
|
-
description: Initialize the
|
|
3
|
+
description: Initialize the .flow scaffold for the current repository.
|
|
4
4
|
when_to_use: Use when the current repository is not yet a CurdX-Flow project and needs the initial .flow scaffold.
|
|
5
5
|
argument-hint: "[--force]"
|
|
6
6
|
disable-model-invocation: true
|
|
@@ -9,110 +9,41 @@ allowed-tools: [Read, Write, Bash, AskUserQuestion]
|
|
|
9
9
|
|
|
10
10
|
# Initialize CurdX-Flow Project
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
Bootstrap `.flow/` for the current repository. Keep the entrypoint focused on
|
|
13
|
+
safe preflight checks, scaffold contracts, and next-step routing. Detailed init
|
|
14
|
+
rules live in:
|
|
13
15
|
|
|
14
|
-
|
|
16
|
+
- `references/preflight.md`
|
|
17
|
+
- `references/scaffold-contract.md`
|
|
18
|
+
- `references/gitignore-and-health.md`
|
|
19
|
+
- `references/next-steps.md`
|
|
15
20
|
|
|
16
|
-
|
|
21
|
+
## Arguments
|
|
17
22
|
|
|
18
|
-
|
|
19
|
-
# Confirm a reasonable project root
|
|
20
|
-
pwd
|
|
21
|
-
ls -la
|
|
22
|
-
```
|
|
23
|
+
`$ARGUMENTS` may include `--force`.
|
|
23
24
|
|
|
24
|
-
|
|
25
|
-
- If `.flow/` already exists:
|
|
26
|
-
- With `--force` → continue but warn about overwriting
|
|
27
|
-
- Without `--force` → stop and prompt the user to inspect `.flow/` directly, or run `/curdx-flow:start --list` to see existing specs
|
|
25
|
+
Use `references/preflight.md` for:
|
|
28
26
|
|
|
29
|
-
|
|
27
|
+
- dangerous-root rejection
|
|
28
|
+
- existing `.flow/` handling
|
|
29
|
+
- `--force` repair semantics
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
mkdir -p .flow/specs
|
|
33
|
-
mkdir -p .flow/_epics
|
|
34
|
-
mkdir -p .flow/checkpoints
|
|
35
|
-
mkdir -p .flow/threads
|
|
36
|
-
mkdir -p .flow/seeds
|
|
37
|
-
```
|
|
31
|
+
`--force` is for scaffold repair, not blind overwrites.
|
|
38
32
|
|
|
39
|
-
|
|
33
|
+
## Scaffold Contract
|
|
40
34
|
|
|
41
|
-
|
|
35
|
+
Use `references/scaffold-contract.md` for the required directory skeleton,
|
|
36
|
+
template rendering, and placeholder substitution contract.
|
|
42
37
|
|
|
43
|
-
|
|
44
|
-
|-----------------|-------------|-------------|
|
|
45
|
-
| `templates/PROJECT.md.tmpl` | `.flow/PROJECT.md` | Project vision (user fills in later) |
|
|
46
|
-
| `templates/CONTEXT.md.tmpl` | `.flow/CONTEXT.md` | User preferences |
|
|
47
|
-
| `templates/STATE.md.tmpl` | `.flow/STATE.md` | Cross-session state (empty) |
|
|
48
|
-
| `templates/ROADMAP.md.tmpl` | `.flow/ROADMAP.md` | Roadmap |
|
|
49
|
-
| `templates/config.json.tmpl` | `.flow/config.json` | Configuration (default standard mode) |
|
|
38
|
+
## Gitignore and Health
|
|
50
39
|
|
|
51
|
-
|
|
52
|
-
- `{{PROJECT_NAME}}` — inferred from the current directory name (user may be asked)
|
|
53
|
-
- `{{CREATED_DATE}}` — `$(date +%Y-%m-%d)`
|
|
54
|
-
- `{{USER_NAME}}` — from git config
|
|
40
|
+
Use `references/gitignore-and-health.md` for:
|
|
55
41
|
|
|
56
|
-
|
|
42
|
+
- runtime ignore entries
|
|
43
|
+
- committed-vs-runtime file boundaries
|
|
44
|
+
- doctor / dependency health guidance
|
|
57
45
|
|
|
58
|
-
|
|
46
|
+
## Output and Handoff
|
|
59
47
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
.flow/checkpoints/
|
|
63
|
-
.flow/threads/
|
|
64
|
-
.flow/seeds/
|
|
65
|
-
.flow/.active-spec
|
|
66
|
-
.flow/specs/*/.state.json
|
|
67
|
-
.flow/specs/*/.progress.md
|
|
68
|
-
.flow/_epics/*/.epic-state.json
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
**Note**: the primary state files (PROJECT.md / CONTEXT.md / STATE.md / ROADMAP.md / config.json)
|
|
72
|
-
**should be committed to version control** so team members share the same view.
|
|
73
|
-
|
|
74
|
-
### Step 5: Health Check
|
|
75
|
-
|
|
76
|
-
Do NOT shell out to a new terminal for this step — you are already inside
|
|
77
|
-
Claude Code. Verify inline via the information the plugin already has:
|
|
78
|
-
|
|
79
|
-
- Read `~/.claude/plugins/data/curdx-flow/.deps-checked` (optional — the
|
|
80
|
-
SessionStart hook already refreshes this once per day).
|
|
81
|
-
- If the user asks for the full report, suggest they run
|
|
82
|
-
`npx @curdx/flow doctor` in a separate terminal — don't try to spawn
|
|
83
|
-
it from inside the Claude Code session (output won't render cleanly
|
|
84
|
-
and the user has to alt-tab to see it).
|
|
85
|
-
|
|
86
|
-
Items the CLI doctor covers (for user reference):
|
|
87
|
-
- 2 bundled MCPs (context7 / sequential-thinking) — visible in `claude mcp list`
|
|
88
|
-
- 4 recommended plugins (pua / claude-mem / frontend-design / chrome-devtools-mcp)
|
|
89
|
-
- Runtime PATH guards for `bun` / `uv` (relevant only when claude-mem is installed)
|
|
90
|
-
|
|
91
|
-
### Step 6: Prompt Next Steps
|
|
92
|
-
|
|
93
|
-
Output:
|
|
94
|
-
|
|
95
|
-
```
|
|
96
|
-
✓ CurdX-Flow project initialized
|
|
97
|
-
.flow/
|
|
98
|
-
├── PROJECT.md ← fill in your project vision
|
|
99
|
-
├── CONTEXT.md ← fill in your preferences
|
|
100
|
-
├── STATE.md
|
|
101
|
-
├── ROADMAP.md
|
|
102
|
-
└── config.json (mode: standard)
|
|
103
|
-
|
|
104
|
-
Next steps (in order):
|
|
105
|
-
1. Edit .flow/PROJECT.md to add the project goal
|
|
106
|
-
2. (already handled) — recommended plugins installed via `npx @curdx/flow install --all`
|
|
107
|
-
3. npx @curdx/flow doctor — verify health
|
|
108
|
-
4. /curdx-flow:start <name> "<goal>" — begin your first feature spec
|
|
109
|
-
|
|
110
|
-
Start development:
|
|
111
|
-
5. /curdx-flow:start <name> "<goal>" — kick off the first spec
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
## Error Handling
|
|
115
|
-
|
|
116
|
-
- Directory creation failure → report the specific error (permissions/disk/path issue)
|
|
117
|
-
- Missing template file → check whether `${CLAUDE_PLUGIN_ROOT}/templates/` is complete
|
|
118
|
-
- User interrupts with Ctrl+C → leave no partial state, prompt that re-running is safe
|
|
48
|
+
The user-facing success output and route to `/curdx-flow:start` live in
|
|
49
|
+
`references/next-steps.md`.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Init Gitignore and Health — Runtime Hygiene
|
|
2
|
+
|
|
3
|
+
Append these runtime-only entries to `.gitignore` if they are missing:
|
|
4
|
+
|
|
5
|
+
```gitignore
|
|
6
|
+
# CurdX-Flow runtime files
|
|
7
|
+
.flow/checkpoints/
|
|
8
|
+
.flow/threads/
|
|
9
|
+
.flow/seeds/
|
|
10
|
+
.flow/.active-spec
|
|
11
|
+
.flow/specs/*/.state.json
|
|
12
|
+
.flow/specs/*/.progress.md
|
|
13
|
+
.flow/_epics/*/.epic-state.json
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
The canonical shared files should stay committed:
|
|
17
|
+
|
|
18
|
+
- `.flow/PROJECT.md`
|
|
19
|
+
- `.flow/CONTEXT.md`
|
|
20
|
+
- `.flow/STATE.md`
|
|
21
|
+
- `.flow/ROADMAP.md`
|
|
22
|
+
- `.flow/config.json`
|
|
23
|
+
|
|
24
|
+
Do not spawn a separate CLI subprocess from inside the skill just to show the
|
|
25
|
+
doctor output. If the user wants the full environment report, route them to
|
|
26
|
+
run `npx @curdx/flow doctor` in a terminal.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Init Handoff — What to Tell the User Next
|
|
2
|
+
|
|
3
|
+
Success output should confirm the scaffold exists and route the user into the
|
|
4
|
+
main workflow:
|
|
5
|
+
|
|
6
|
+
```text
|
|
7
|
+
✓ CurdX-Flow project initialized
|
|
8
|
+
.flow/
|
|
9
|
+
├── PROJECT.md
|
|
10
|
+
├── CONTEXT.md
|
|
11
|
+
├── STATE.md
|
|
12
|
+
├── ROADMAP.md
|
|
13
|
+
└── config.json
|
|
14
|
+
|
|
15
|
+
Next:
|
|
16
|
+
1. Fill in .flow/PROJECT.md with the project goal
|
|
17
|
+
2. Run npx @curdx/flow doctor if environment health needs verification
|
|
18
|
+
3. Start the first spec with /curdx-flow:start <name> "<goal>"
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
If `--force` repaired a partial scaffold, say that the existing project context
|
|
22
|
+
was preserved and only missing runtime pieces were backfilled.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Init Preflight — Safe Bootstrap Rules
|
|
2
|
+
|
|
3
|
+
Before writing `.flow/`:
|
|
4
|
+
|
|
5
|
+
- confirm the current directory is the intended repository root
|
|
6
|
+
- reject dangerous locations such as `/`, the home directory, or other obvious
|
|
7
|
+
non-project folders
|
|
8
|
+
- if `.flow/` already exists and `--force` is absent, stop and route the user
|
|
9
|
+
to inspect it or run `/curdx-flow:start --list`
|
|
10
|
+
|
|
11
|
+
`--force` means "repair or complete the scaffold" rather than "overwrite user
|
|
12
|
+
content". Existing committed files such as `.flow/PROJECT.md`,
|
|
13
|
+
`.flow/CONTEXT.md`, `.flow/STATE.md`, `.flow/ROADMAP.md`, and
|
|
14
|
+
`.flow/config.json` should be preserved unless the user explicitly asks to
|
|
15
|
+
replace them.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Init Scaffold Contract — What Must Be Created
|
|
2
|
+
|
|
3
|
+
Create the runtime skeleton:
|
|
4
|
+
|
|
5
|
+
- `.flow/specs/`
|
|
6
|
+
- `.flow/_epics/`
|
|
7
|
+
- `.flow/checkpoints/`
|
|
8
|
+
- `.flow/threads/`
|
|
9
|
+
- `.flow/seeds/`
|
|
10
|
+
|
|
11
|
+
Render the canonical scaffold files from `${CLAUDE_PLUGIN_ROOT}/templates/`:
|
|
12
|
+
|
|
13
|
+
- `templates/PROJECT.md.tmpl` -> `.flow/PROJECT.md`
|
|
14
|
+
- `templates/CONTEXT.md.tmpl` -> `.flow/CONTEXT.md`
|
|
15
|
+
- `templates/STATE.md.tmpl` -> `.flow/STATE.md`
|
|
16
|
+
- `templates/ROADMAP.md.tmpl` -> `.flow/ROADMAP.md`
|
|
17
|
+
- `templates/config.json.tmpl` -> `.flow/config.json`
|
|
18
|
+
|
|
19
|
+
Populate placeholders with:
|
|
20
|
+
|
|
21
|
+
- `{{PROJECT_NAME}}` from the current directory name unless the user gave a
|
|
22
|
+
better project label
|
|
23
|
+
- `{{CREATED_DATE}}` from the current date
|
|
24
|
+
- `{{USER_NAME}}` from git config when available
|
|
25
|
+
|
|
26
|
+
Create missing scaffold files. Do not overwrite user-edited canonical files
|
|
27
|
+
unless the user explicitly asks for a reset.
|
package/skills/review/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: review
|
|
3
|
-
description:
|
|
3
|
+
description: Run two-stage review with optional adversarial, edge-case, and DevEx passes.
|
|
4
4
|
when_to_use: Use when implementation exists and the user wants review findings, spec-compliance checks, adversarial review, edge-case hunting, or a DevEx audit.
|
|
5
5
|
argument-hint: "[--stage=<1|2|both>] [--adversarial] [--edge-case] [--devex]"
|
|
6
6
|
disable-model-invocation: true
|
|
@@ -10,174 +10,66 @@ allowed-tools: [Read, Bash, Agent, Grep, Glob]
|
|
|
10
10
|
# Two-Stage Code Review
|
|
11
11
|
|
|
12
12
|
Distinct from `/curdx-flow:verify`:
|
|
13
|
-
- **verify** checks that the spec's stated goals actually work (goal-backward).
|
|
14
|
-
- **review** checks that the code is good (spec compliance + craftsmanship).
|
|
15
13
|
|
|
16
|
-
|
|
14
|
+
- `verify` checks whether the spec's user-visible goals work
|
|
15
|
+
- `review` checks whether the implementation is correct, aligned, and maintainable
|
|
16
|
+
|
|
17
|
+
Keep this entrypoint focused on review routing, pass selection, and final
|
|
18
|
+
report handoff.
|
|
19
|
+
|
|
20
|
+
When this skill is used for follow-up work after prior review comments, apply
|
|
21
|
+
`@${CLAUDE_PLUGIN_ROOT}/knowledge/review-feedback-intake.md` first so accepted
|
|
22
|
+
fixes and technical pushback are recorded in `.progress.md`.
|
|
23
|
+
|
|
24
|
+
Detailed review protocols live in:
|
|
25
|
+
|
|
26
|
+
- `references/preflight.md`
|
|
27
|
+
- `references/stage-execution.md`
|
|
28
|
+
- `references/optional-passes.md`
|
|
29
|
+
- `references/report-contract.md`
|
|
30
|
+
- `references/reporting.md`
|
|
17
31
|
|
|
18
32
|
## Flags
|
|
19
33
|
|
|
20
34
|
| Flag | Default | Purpose |
|
|
21
35
|
|------|---------|---------|
|
|
22
36
|
| `--stage=<1\|2\|both>` | `both` | Stage 1 = spec compliance only. Stage 2 = code quality only. `both` = sequential. |
|
|
23
|
-
| `--adversarial` | off | Add an adversarial review pass across applicable categories
|
|
24
|
-
| `--edge-case` | off | Add edge-case hunting across applicable categories. Produces a test-gap checklist. |
|
|
25
|
-
| `--devex` | off |
|
|
37
|
+
| `--adversarial` | off (`enterprise` -> on) | Add an adversarial review pass across applicable categories. |
|
|
38
|
+
| `--edge-case` | off (`enterprise` -> on) | Add edge-case hunting across applicable categories. Produces a test-gap checklist. |
|
|
39
|
+
| `--devex` | off (`enterprise` -> on) | Add the DevEx audit for naming, comments, structure, error handling, setup, types, tests, and developer loop. |
|
|
26
40
|
|
|
27
41
|
## Preflight
|
|
28
42
|
|
|
29
|
-
|
|
30
|
-
[ ! -d ".flow" ] && { echo "✗ Not a CurdX-Flow project."; exit 1; }
|
|
31
|
-
|
|
32
|
-
SPEC_NAME=$(cat .flow/.active-spec 2>/dev/null)
|
|
33
|
-
[ -z "$SPEC_NAME" ] && { echo "✗ No active spec."; exit 1; }
|
|
43
|
+
Use `references/preflight.md` for:
|
|
34
44
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
exit 1;
|
|
40
|
-
}
|
|
41
|
-
done
|
|
42
|
-
|
|
43
|
-
FLAG_STAGE=$(echo "$ARGUMENTS" | grep -oP -- '--stage=\K[^\s]+' || echo "both")
|
|
44
|
-
FLAG_ADV=$(echo "$ARGUMENTS" | grep -q -- '--adversarial' && echo 1 || echo 0)
|
|
45
|
-
FLAG_EDGE=$(echo "$ARGUMENTS" | grep -q -- '--edge-case' && echo 1 || echo 0)
|
|
46
|
-
FLAG_DEVEX=$(echo "$ARGUMENTS" | grep -q -- '--devex' && echo 1 || echo 0)
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
## Stage 1 — Spec compliance
|
|
45
|
+
- `.flow/` and active-spec checks
|
|
46
|
+
- required artifact checks
|
|
47
|
+
- mode-aware `--stage`, `--adversarial`, `--edge-case`, and `--devex`
|
|
48
|
+
normalization
|
|
50
49
|
|
|
51
|
-
|
|
52
|
-
- Implementation actually addresses every US / AC / FR / NFR in `requirements.md`
|
|
53
|
-
- Code structure reflects AD-NN decisions from `design.md`
|
|
54
|
-
- Task checklist in `tasks.md` is genuinely complete (all tasks marked `[x]` have real code)
|
|
55
|
-
- Conventional-commit log (`git log`) matches the tasks declared completed
|
|
56
|
-
|
|
57
|
-
Output: Stage-1 section of the report with any compliance gaps.
|
|
58
|
-
|
|
59
|
-
## Stage 2 — Code quality
|
|
60
|
-
|
|
61
|
-
Dispatch `flow-reviewer` in Stage 2 mode. It checks:
|
|
62
|
-
- Naming, comments, structure
|
|
63
|
-
- Error handling completeness
|
|
64
|
-
- Test coverage and test quality
|
|
65
|
-
- Performance / resource usage concerns
|
|
66
|
-
- Security smells (not a full security audit — that's `security-audit` skill)
|
|
67
|
-
- Karpathy 4 principles applied
|
|
68
|
-
|
|
69
|
-
Output: Stage-2 section of the report.
|
|
70
|
-
|
|
71
|
-
## Optional: adversarial review
|
|
72
|
-
|
|
73
|
-
If `--adversarial`:
|
|
74
|
-
Dispatch `flow-adversary`. It scans the applicable categories (Architecture / Implementation / Testing / Security / Maintainability / UX — skip N/A with reason) using `sequential-thinking` proportional to the residual uncertainty, probing:
|
|
75
|
-
1. What's missing?
|
|
76
|
-
2. What's overengineered?
|
|
77
|
-
3. What would break first in production?
|
|
78
|
-
4. What's undocumented that a new maintainer would misunderstand?
|
|
79
|
-
5. What decision locks us out of a future option?
|
|
80
|
-
6. What would a skeptical reviewer reject?
|
|
81
|
-
|
|
82
|
-
**Zero findings requires proof-of-checking, not fabrication** — honest "clean" verdicts are fine if the agent lists what it examined. Per `@${CLAUDE_PLUGIN_ROOT}/gates/adversarial-review-gate.md`.
|
|
83
|
-
|
|
84
|
-
## Optional: edge-case hunting
|
|
85
|
-
|
|
86
|
-
If `--edge-case`:
|
|
87
|
-
Dispatch `flow-edge-hunter` across the applicable categories (skip N/A with one-line reason):
|
|
88
|
-
1. Boundary values (0, MAX, empty, one-over-limit)
|
|
89
|
-
2. Concurrency / race conditions
|
|
90
|
-
3. Network failure / partial failure
|
|
91
|
-
4. Malformed input
|
|
92
|
-
5. Permission / auth failure
|
|
93
|
-
6. Resource exhaustion
|
|
94
|
-
7. Time / locale / timezone
|
|
95
|
-
|
|
96
|
-
Output: test-gap checklist with suggested test cases.
|
|
97
|
-
|
|
98
|
-
## Optional: DevEx audit
|
|
99
|
-
|
|
100
|
-
If `--devex`:
|
|
101
|
-
Pass the DevEx gate at `@${CLAUDE_PLUGIN_ROOT}/gates/devex-gate.md` as
|
|
102
|
-
additional context to `flow-reviewer`. The gate adds these dimensions to
|
|
103
|
-
Stage 2:
|
|
104
|
-
|
|
105
|
-
1. **Naming** — identifier clarity, consistency across modules.
|
|
106
|
-
2. **Comments** — only non-obvious WHY; no redundant WHAT.
|
|
107
|
-
3. **Structure** — file and function sizes, colocation of related code.
|
|
108
|
-
4. **Error handling** — at system boundaries only; no defensive guards inside trusted paths.
|
|
109
|
-
5. **Setup** — `npm install && npm test` green on a fresh clone.
|
|
110
|
-
6. **Types** — strictness, no unexplained `any` / `unknown`.
|
|
111
|
-
7. **Tests** — failure messages, fixture clarity, no flake.
|
|
112
|
-
8. **Dev loop** — time from code-change to feedback.
|
|
113
|
-
|
|
114
|
-
`flow-reviewer` is NOT edited for `--devex` — the gate file is injected
|
|
115
|
-
into the reviewer dispatch prompt as reference context, so the agent
|
|
116
|
-
stays generic. Output: a "DevEx" section in the review report with
|
|
117
|
-
per-dimension verdicts.
|
|
118
|
-
|
|
119
|
-
## Report
|
|
120
|
-
|
|
121
|
-
**Landing check**: sub-agent responses can be truncated. After dispatching review agents, verify the report actually landed on disk:
|
|
122
|
-
|
|
123
|
-
```bash
|
|
124
|
-
REPORT=".flow/specs/$SPEC_NAME/review-report.md"
|
|
125
|
-
if [ ! -f "$REPORT" ] || [ "$(wc -c < "$REPORT" 2>/dev/null | tr -d ' ')" -lt 300 ]; then
|
|
126
|
-
echo "⚠ Report missing or truncated. Re-dispatching flow-reviewer with a terse 'Write the report now, no narration' prompt."
|
|
127
|
-
fi
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
Consolidated output: `.flow/specs/$SPEC_NAME/review-report.md`:
|
|
131
|
-
|
|
132
|
-
```markdown
|
|
133
|
-
# Review Report — <spec-name>
|
|
134
|
-
|
|
135
|
-
## Stage 1 — Spec Compliance
|
|
136
|
-
- ✓ FR-01: implemented in src/auth.ts
|
|
137
|
-
- ✗ FR-04: missing — add handler for token refresh
|
|
138
|
-
- ⚠ AC-2.1: no integration test asserting 403 on expired token
|
|
139
|
-
|
|
140
|
-
## Stage 2 — Code Quality
|
|
141
|
-
- Blocker: duplicated error-handling pattern in 3 files — extract helper
|
|
142
|
-
- Warning: function foo() in src/a.ts: 90 lines, split
|
|
143
|
-
- Nit: inconsistent naming (getUserId vs fetchUser)
|
|
144
|
-
|
|
145
|
-
## Adversarial (if run)
|
|
146
|
-
...
|
|
147
|
-
|
|
148
|
-
## Edge Cases (if run)
|
|
149
|
-
...
|
|
150
|
-
|
|
151
|
-
## DevEx (if run)
|
|
152
|
-
- Naming: <verdict>
|
|
153
|
-
- Structure: <verdict>
|
|
154
|
-
- Error handling: <verdict>
|
|
155
|
-
- Setup: <verdict>
|
|
156
|
-
- Types: <verdict>
|
|
157
|
-
- Tests: <verdict>
|
|
158
|
-
- Dev loop: <verdict>
|
|
159
|
-
|
|
160
|
-
## Verdict
|
|
161
|
-
- [ ] APPROVED
|
|
162
|
-
- [X] CHANGES REQUIRED — <n> blockers
|
|
163
|
-
- [ ] REJECTED
|
|
164
|
-
```
|
|
50
|
+
## Stage Execution
|
|
165
51
|
|
|
166
|
-
|
|
52
|
+
Stage responsibilities, reviewer prompts, and pass/fail expectations live in
|
|
53
|
+
`references/stage-execution.md`.
|
|
54
|
+
|
|
55
|
+
- Stage 1 -> `flow-reviewer` in spec-compliance mode
|
|
56
|
+
- Stage 2 -> `flow-reviewer` in code-quality mode
|
|
167
57
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
Stage 1 findings: <n>
|
|
171
|
-
Stage 2 findings: <n>
|
|
172
|
-
Adversarial findings: <n> (if --adversarial)
|
|
173
|
-
Edge-case gaps: <n> (if --edge-case)
|
|
174
|
-
DevEx findings: <n> (if --devex)
|
|
175
|
-
Verdict: CHANGES REQUIRED
|
|
58
|
+
Optional adversarial, edge-case, and DevEx extensions live in
|
|
59
|
+
`references/optional-passes.md`.
|
|
176
60
|
|
|
177
|
-
Report
|
|
61
|
+
## Report Contract
|
|
62
|
+
|
|
63
|
+
Landing checks, report shape, and final status output live in
|
|
64
|
+
`references/report-contract.md`.
|
|
65
|
+
|
|
66
|
+
The report lands at:
|
|
67
|
+
|
|
68
|
+
- `.flow/specs/$SPEC_NAME/review-report.md`
|
|
69
|
+
|
|
70
|
+
## Reporting
|
|
178
71
|
|
|
179
|
-
|
|
180
|
-
```
|
|
72
|
+
Use `references/reporting.md` for the final summary and rerun handoff.
|
|
181
73
|
|
|
182
74
|
## References
|
|
183
75
|
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Optional Passes — Adversarial, Edge Cases, DevEx
|
|
2
|
+
|
|
3
|
+
## Adversarial Review
|
|
4
|
+
|
|
5
|
+
If `FLAG_ADV=1` after preflight normalization, dispatch `flow-adversary`
|
|
6
|
+
across applicable categories:
|
|
7
|
+
|
|
8
|
+
1. What's missing?
|
|
9
|
+
2. What's overengineered?
|
|
10
|
+
3. What breaks first in production?
|
|
11
|
+
4. What would a new maintainer misunderstand?
|
|
12
|
+
5. What choice locks out a future option?
|
|
13
|
+
6. What would a skeptical reviewer reject?
|
|
14
|
+
|
|
15
|
+
Zero findings still requires proof-of-checking.
|
|
16
|
+
|
|
17
|
+
## Edge-Case Hunting
|
|
18
|
+
|
|
19
|
+
If `FLAG_EDGE=1` after preflight normalization, dispatch `flow-edge-hunter`
|
|
20
|
+
across:
|
|
21
|
+
|
|
22
|
+
1. boundary values
|
|
23
|
+
2. concurrency and races
|
|
24
|
+
3. network or partial failure
|
|
25
|
+
4. malformed input
|
|
26
|
+
5. auth and permission failure
|
|
27
|
+
6. resource exhaustion
|
|
28
|
+
7. time, locale, and timezone
|
|
29
|
+
|
|
30
|
+
Output: a test-gap checklist.
|
|
31
|
+
|
|
32
|
+
## DevEx Audit
|
|
33
|
+
|
|
34
|
+
If `FLAG_DEVEX=1` after preflight normalization, inject
|
|
35
|
+
`@${CLAUDE_PLUGIN_ROOT}/gates/devex-gate.md` into `flow-reviewer` so Stage 2
|
|
36
|
+
also evaluates:
|
|
37
|
+
|
|
38
|
+
1. naming
|
|
39
|
+
2. comments
|
|
40
|
+
3. structure
|
|
41
|
+
4. error handling
|
|
42
|
+
5. setup
|
|
43
|
+
6. types
|
|
44
|
+
7. tests
|
|
45
|
+
8. developer loop
|
|
46
|
+
|
|
47
|
+
Do not fork a separate custom reviewer for DevEx; keep `flow-reviewer` generic
|
|
48
|
+
and extend it with the gate file.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Review Preflight — Resolve Scope and Flags
|
|
2
|
+
|
|
3
|
+
Before dispatching any reviewer:
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
[ ! -d ".flow" ] && { echo "✗ Not a CurdX-Flow project."; exit 1; }
|
|
7
|
+
|
|
8
|
+
SPEC_NAME=$(cat .flow/.active-spec 2>/dev/null)
|
|
9
|
+
[ -z "$SPEC_NAME" ] && { echo "✗ No active spec."; exit 1; }
|
|
10
|
+
|
|
11
|
+
SPEC_STATE=".flow/specs/$SPEC_NAME/.state.json"
|
|
12
|
+
SPEC_MODE=$(grep -oP '"mode"\\s*:\\s*"\\K[^"]+' "$SPEC_STATE" 2>/dev/null || echo "standard")
|
|
13
|
+
|
|
14
|
+
for f in design.md; do
|
|
15
|
+
[ ! -f ".flow/specs/$SPEC_NAME/$f" ] && {
|
|
16
|
+
echo "✗ Missing $f. Run /curdx-flow:spec first.";
|
|
17
|
+
exit 1;
|
|
18
|
+
}
|
|
19
|
+
done
|
|
20
|
+
|
|
21
|
+
FLAG_STAGE=$(echo "$ARGUMENTS" | grep -oP -- '--stage=\K[^\s]+' || echo "both")
|
|
22
|
+
FLAG_ADV=$(echo "$ARGUMENTS" | grep -q -- '--adversarial' && echo 1 || echo 0)
|
|
23
|
+
FLAG_EDGE=$(echo "$ARGUMENTS" | grep -q -- '--edge-case' && echo 1 || echo 0)
|
|
24
|
+
FLAG_DEVEX=$(echo "$ARGUMENTS" | grep -q -- '--devex' && echo 1 || echo 0)
|
|
25
|
+
|
|
26
|
+
if [ "$SPEC_MODE" = "enterprise" ]; then
|
|
27
|
+
FLAG_ADV=1
|
|
28
|
+
FLAG_EDGE=1
|
|
29
|
+
FLAG_DEVEX=1
|
|
30
|
+
fi
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
The entrypoint should resolve flags once, then route all review passes from
|
|
34
|
+
that normalized configuration rather than reparsing later.
|
|
35
|
+
|
|
36
|
+
`enterprise` mode auto-enables adversarial, edge-case, and DevEx review even
|
|
37
|
+
when the user does not pass those flags explicitly. Manual flags still force
|
|
38
|
+
the same behavior in non-enterprise modes.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Report Contract — Landing, Shape, Verdict
|
|
2
|
+
|
|
3
|
+
## Landing Check
|
|
4
|
+
|
|
5
|
+
Sub-agent responses can truncate before the report is written. After dispatching
|
|
6
|
+
review agents, verify the report actually landed:
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
REPORT=".flow/specs/$SPEC_NAME/review-report.md"
|
|
10
|
+
if [ ! -f "$REPORT" ] || [ "$(wc -c < "$REPORT" 2>/dev/null | tr -d ' ')" -lt 300 ]; then
|
|
11
|
+
echo "⚠ Report missing or truncated. Re-dispatching flow-reviewer with a terse 'Write the report now, no narration' prompt."
|
|
12
|
+
fi
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Report Shape
|
|
16
|
+
|
|
17
|
+
```markdown
|
|
18
|
+
# Review Report — <spec-name>
|
|
19
|
+
|
|
20
|
+
## Stage 1 — Spec Compliance
|
|
21
|
+
...
|
|
22
|
+
|
|
23
|
+
## Stage 2 — Code Quality
|
|
24
|
+
...
|
|
25
|
+
|
|
26
|
+
## Adversarial (if run)
|
|
27
|
+
...
|
|
28
|
+
|
|
29
|
+
## Edge Cases (if run)
|
|
30
|
+
...
|
|
31
|
+
|
|
32
|
+
## DevEx (if run)
|
|
33
|
+
...
|
|
34
|
+
|
|
35
|
+
## Verdict
|
|
36
|
+
- [ ] APPROVED
|
|
37
|
+
- [X] CHANGES REQUIRED — <n> blockers
|
|
38
|
+
- [ ] REJECTED
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Final Output
|
|
42
|
+
|
|
43
|
+
Summarize:
|
|
44
|
+
|
|
45
|
+
- Stage 1 finding count
|
|
46
|
+
- Stage 2 finding count
|
|
47
|
+
- optional pass finding counts
|
|
48
|
+
- final verdict
|
|
49
|
+
- report path
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Review Reporting — Final Summary and Rerun Handoff
|
|
2
|
+
|
|
3
|
+
End with a compact review summary:
|
|
4
|
+
|
|
5
|
+
```text
|
|
6
|
+
✓ Review complete
|
|
7
|
+
Stage 1 findings: <n>
|
|
8
|
+
Stage 2 findings: <n>
|
|
9
|
+
Adversarial findings: <n> (if adversarial pass ran)
|
|
10
|
+
Edge-case gaps: <n> (if edge-case pass ran)
|
|
11
|
+
DevEx findings: <n> (if DevEx audit ran)
|
|
12
|
+
Verdict: CHANGES REQUIRED
|
|
13
|
+
|
|
14
|
+
Report: .flow/specs/<name>/review-report.md
|
|
15
|
+
|
|
16
|
+
Next: address blockers, then re-run /curdx-flow:review.
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Keep the response outcome-focused. The report file is the artifact; the closing
|
|
20
|
+
message only confirms counts, verdict, path, and next action.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Review Stages — Core Two-Pass Protocol
|
|
2
|
+
|
|
3
|
+
## Stage 1 — Spec Compliance
|
|
4
|
+
|
|
5
|
+
Dispatch `flow-reviewer` in Stage 1 mode. It verifies:
|
|
6
|
+
|
|
7
|
+
- every relevant `US`, `AC`, `FR`, and `NFR` in `requirements.md`
|
|
8
|
+
- architecture decisions in `design.md`
|
|
9
|
+
- `tasks.md` completion claims versus actual code
|
|
10
|
+
- conventional commits versus declared task completion
|
|
11
|
+
|
|
12
|
+
Output: the Stage 1 section of the review report with compliance gaps and
|
|
13
|
+
evidence.
|
|
14
|
+
|
|
15
|
+
## Stage 2 — Code Quality
|
|
16
|
+
|
|
17
|
+
Dispatch `flow-reviewer` in Stage 2 mode. It checks:
|
|
18
|
+
|
|
19
|
+
- naming, comments, and structure
|
|
20
|
+
- error handling completeness
|
|
21
|
+
- test quality and coverage
|
|
22
|
+
- performance and resource concerns
|
|
23
|
+
- security smells
|
|
24
|
+
- Karpathy 4 principles
|
|
25
|
+
|
|
26
|
+
Output: the Stage 2 section of the review report with prioritized findings.
|
|
27
|
+
|
|
28
|
+
## Sequencing
|
|
29
|
+
|
|
30
|
+
- `--stage=1` -> run only Stage 1
|
|
31
|
+
- `--stage=2` -> run only Stage 2
|
|
32
|
+
- `--stage=both` -> Stage 1 first, then Stage 2
|