@curdx/flow 2.0.21 → 2.2.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.
Files changed (57) hide show
  1. package/.claude-plugin/marketplace.json +25 -2
  2. package/.claude-plugin/plugin.json +10 -1
  3. package/CHANGELOG.md +106 -3
  4. package/README.md +3 -0
  5. package/README.zh.md +14 -5
  6. package/agent-preamble/preamble.md +3 -6
  7. package/agents/flow-qa-engineer.md +16 -15
  8. package/agents/flow-ui-researcher.md +2 -2
  9. package/agents/flow-verifier.md +3 -3
  10. package/bin/curdx-flow +5 -0
  11. package/cli/README.md +10 -9
  12. package/cli/install-bundled-mcps.js +37 -0
  13. package/cli/install-companions.js +19 -252
  14. package/cli/install-context7-config.js +97 -0
  15. package/cli/install-recommended-plugins.js +104 -0
  16. package/cli/install-required-plugins.js +57 -0
  17. package/cli/install-self-update.js +2 -91
  18. package/cli/install.js +12 -1
  19. package/cli/lib/claude.js +42 -11
  20. package/cli/lib/doctor-report.js +47 -8
  21. package/cli/lib/semver.js +95 -0
  22. package/cli/protocols-body.md +3 -2
  23. package/cli/utils.js +1 -0
  24. package/hooks/scripts/quick-mode-guard.sh +6 -7
  25. package/hooks/scripts/session-start.sh +6 -3
  26. package/knowledge/execution-strategies.md +5 -5
  27. package/knowledge/planning-reviews.md +2 -2
  28. package/knowledge/wave-execution.md +17 -17
  29. package/package.json +3 -3
  30. package/schemas/agent-frontmatter.schema.json +66 -0
  31. package/schemas/config.schema.json +24 -4
  32. package/schemas/gate-frontmatter.schema.json +30 -0
  33. package/schemas/hooks.schema.json +83 -0
  34. package/schemas/plugin-manifest.schema.json +66 -0
  35. package/schemas/skill-frontmatter.schema.json +72 -0
  36. package/schemas/spec-state.schema.json +7 -2
  37. package/skills/brownfield-index/SKILL.md +2 -1
  38. package/skills/browser-qa/SKILL.md +5 -4
  39. package/skills/debug/SKILL.md +105 -0
  40. package/skills/epic/SKILL.md +2 -1
  41. package/{commands/fast.md → skills/fast/SKILL.md} +2 -1
  42. package/{commands/help.md → skills/help/SKILL.md} +15 -5
  43. package/{commands/implement.md → skills/implement/SKILL.md} +14 -154
  44. package/skills/implement/references/wave-execution.md +162 -0
  45. package/{commands/init.md → skills/init/SKILL.md} +1 -0
  46. package/{commands/review.md → skills/review/SKILL.md} +38 -3
  47. package/skills/security-audit/SKILL.md +2 -1
  48. package/{commands/spec.md → skills/spec/SKILL.md} +4 -3
  49. package/{commands/start.md → skills/start/SKILL.md} +2 -1
  50. package/skills/ui-sketch/SKILL.md +2 -1
  51. package/skills/verify/SKILL.md +99 -0
  52. package/templates/CONTEXT.md.tmpl +1 -1
  53. package/templates/PROJECT.md.tmpl +1 -1
  54. package/templates/config.json.tmpl +6 -6
  55. package/templates/progress.md.tmpl +2 -2
  56. package/commands/debug.md +0 -199
  57. package/commands/verify.md +0 -142
@@ -0,0 +1,30 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://curdx-flow.dev/schemas/gate-frontmatter.schema.json",
4
+ "title": "CurdX-Flow Gate Frontmatter",
5
+ "description": "Supported YAML frontmatter fields for gates/*.md quality gate definitions.",
6
+ "type": "object",
7
+ "required": ["gate", "category", "severity", "depends_on"],
8
+ "additionalProperties": false,
9
+ "properties": {
10
+ "gate": {
11
+ "type": "string",
12
+ "pattern": "^[a-z0-9][a-z0-9-]{0,63}$"
13
+ },
14
+ "category": {
15
+ "type": "string",
16
+ "enum": ["always-on", "standard-mode", "enterprise-mode"]
17
+ },
18
+ "severity": {
19
+ "type": "string",
20
+ "enum": ["blocking", "warning"]
21
+ },
22
+ "depends_on": {
23
+ "type": "array",
24
+ "items": {
25
+ "type": "string",
26
+ "pattern": "^[a-z0-9][a-z0-9-]{0,63}$"
27
+ }
28
+ }
29
+ }
30
+ }
@@ -0,0 +1,83 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://curdx-flow.dev/schemas/hooks.schema.json",
4
+ "title": "CurdX-Flow Hook Configuration",
5
+ "description": "Supported event names and handler shape for hooks/hooks.json.",
6
+ "type": "object",
7
+ "required": ["hooks"],
8
+ "additionalProperties": false,
9
+ "properties": {
10
+ "hooks": {
11
+ "type": "object",
12
+ "propertyNames": {
13
+ "enum": [
14
+ "SessionStart",
15
+ "InstructionsLoaded",
16
+ "UserPromptSubmit",
17
+ "UserPromptExpansion",
18
+ "PreToolUse",
19
+ "PermissionRequest",
20
+ "PostToolUse",
21
+ "PostToolUseFailure",
22
+ "PostToolBatch",
23
+ "PermissionDenied",
24
+ "Notification",
25
+ "SubagentStart",
26
+ "SubagentStop",
27
+ "TaskCreated",
28
+ "TaskCompleted",
29
+ "Stop",
30
+ "StopFailure",
31
+ "TeammateIdle",
32
+ "ConfigChange",
33
+ "CwdChanged",
34
+ "FileChanged",
35
+ "WorktreeCreate",
36
+ "WorktreeRemove",
37
+ "PreCompact",
38
+ "PostCompact",
39
+ "Elicitation",
40
+ "ElicitationResult",
41
+ "SessionEnd"
42
+ ]
43
+ },
44
+ "additionalProperties": {
45
+ "type": "array",
46
+ "items": { "$ref": "#/definitions/matcherGroup" }
47
+ }
48
+ }
49
+ },
50
+ "definitions": {
51
+ "matcherGroup": {
52
+ "type": "object",
53
+ "required": ["hooks"],
54
+ "additionalProperties": false,
55
+ "properties": {
56
+ "matcher": { "type": "string" },
57
+ "hooks": {
58
+ "type": "array",
59
+ "items": { "$ref": "#/definitions/hookHandler" }
60
+ }
61
+ }
62
+ },
63
+ "hookHandler": {
64
+ "type": "object",
65
+ "required": ["type"],
66
+ "additionalProperties": true,
67
+ "properties": {
68
+ "type": {
69
+ "type": "string",
70
+ "enum": ["command", "http", "mcp_tool", "prompt", "agent"]
71
+ },
72
+ "if": { "type": "string" },
73
+ "timeout": { "type": "integer", "minimum": 1 },
74
+ "statusMessage": { "type": "string" },
75
+ "once": { "type": "boolean" },
76
+ "command": { "type": "string" },
77
+ "url": { "type": "string" },
78
+ "prompt": { "type": "string" },
79
+ "model": { "type": "string" }
80
+ }
81
+ }
82
+ }
83
+ }
@@ -0,0 +1,66 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://curdx-flow.dev/schemas/plugin-manifest.schema.json",
4
+ "title": "CurdX-Flow Claude Code Plugin Manifest",
5
+ "description": "Project-local schema for .claude-plugin/plugin.json.",
6
+ "type": "object",
7
+ "required": ["name", "version", "description"],
8
+ "additionalProperties": true,
9
+ "properties": {
10
+ "name": {
11
+ "type": "string",
12
+ "pattern": "^[a-z0-9][a-z0-9-]*$"
13
+ },
14
+ "version": {
15
+ "type": "string",
16
+ "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+(?:[-+][0-9A-Za-z.-]+)?$"
17
+ },
18
+ "description": { "type": "string" },
19
+ "author": { "type": "object" },
20
+ "homepage": { "type": "string" },
21
+ "repository": { "type": "string" },
22
+ "license": { "type": "string" },
23
+ "keywords": { "type": "array", "items": { "type": "string" } },
24
+ "skills": {
25
+ "oneOf": [
26
+ { "type": "string" },
27
+ { "type": "array", "items": { "type": "string" } }
28
+ ]
29
+ },
30
+ "agents": {
31
+ "oneOf": [
32
+ { "type": "string" },
33
+ { "type": "array", "items": { "type": "string" } }
34
+ ]
35
+ },
36
+ "hooks": {
37
+ "oneOf": [
38
+ { "type": "string" },
39
+ { "type": "object" }
40
+ ]
41
+ },
42
+ "mcpServers": {
43
+ "oneOf": [
44
+ { "type": "string" },
45
+ { "type": "object" }
46
+ ]
47
+ },
48
+ "dependencies": {
49
+ "type": "array",
50
+ "items": {
51
+ "oneOf": [
52
+ { "type": "string" },
53
+ {
54
+ "type": "object",
55
+ "required": ["name"],
56
+ "properties": {
57
+ "name": { "type": "string" },
58
+ "version": { "type": "string" },
59
+ "marketplace": { "type": "string" }
60
+ }
61
+ }
62
+ ]
63
+ }
64
+ }
65
+ }
66
+ }
@@ -0,0 +1,72 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://curdx-flow.dev/schemas/skill-frontmatter.schema.json",
4
+ "title": "CurdX-Flow Skill Frontmatter",
5
+ "description": "Supported YAML frontmatter fields for skills/<name>/SKILL.md.",
6
+ "type": "object",
7
+ "required": ["name", "description"],
8
+ "additionalProperties": false,
9
+ "properties": {
10
+ "name": {
11
+ "type": "string",
12
+ "pattern": "^[a-z0-9][a-z0-9-]{0,63}$"
13
+ },
14
+ "description": {
15
+ "type": "string",
16
+ "minLength": 1,
17
+ "description": "Concise trigger summary. Keep detailed trigger phrases in when_to_use."
18
+ },
19
+ "when_to_use": {
20
+ "type": "string",
21
+ "description": "Additional trigger phrases appended to description in the skill listing."
22
+ },
23
+ "argument-hint": {
24
+ "type": "string"
25
+ },
26
+ "arguments": {
27
+ "oneOf": [
28
+ { "type": "string" },
29
+ { "type": "array", "items": { "type": "string" } }
30
+ ]
31
+ },
32
+ "disable-model-invocation": {
33
+ "type": "boolean"
34
+ },
35
+ "user-invocable": {
36
+ "type": "boolean"
37
+ },
38
+ "allowed-tools": {
39
+ "oneOf": [
40
+ { "type": "string" },
41
+ { "type": "array", "items": { "type": "string" } }
42
+ ]
43
+ },
44
+ "model": {
45
+ "type": "string"
46
+ },
47
+ "effort": {
48
+ "type": "string",
49
+ "enum": ["low", "medium", "high", "xhigh", "max"]
50
+ },
51
+ "context": {
52
+ "type": "string",
53
+ "enum": ["fork"]
54
+ },
55
+ "agent": {
56
+ "type": "string"
57
+ },
58
+ "hooks": {
59
+ "type": "object"
60
+ },
61
+ "paths": {
62
+ "oneOf": [
63
+ { "type": "string" },
64
+ { "type": "array", "items": { "type": "string" } }
65
+ ]
66
+ },
67
+ "shell": {
68
+ "type": "string",
69
+ "enum": ["bash", "powershell"]
70
+ }
71
+ }
72
+ }
@@ -17,11 +17,11 @@
17
17
  },
18
18
  "goal": {
19
19
  "type": "string",
20
- "description": "One-sentence goal from /flow-start"
20
+ "description": "One-sentence goal from /curdx-flow:start"
21
21
  },
22
22
  "mode": {
23
23
  "type": "string",
24
- "enum": ["sketch", "fast", "standard", "enterprise", "autonomous"],
24
+ "enum": ["fast", "standard", "enterprise"],
25
25
  "default": "standard"
26
26
  },
27
27
  "strategy": {
@@ -29,6 +29,11 @@
29
29
  "enum": ["auto", "subagent", "stop-hook", "wave", "linear"],
30
30
  "default": "auto"
31
31
  },
32
+ "quickMode": {
33
+ "type": "boolean",
34
+ "default": false,
35
+ "description": "When true, execution hooks block AskUserQuestion and agents must record assumptions instead of asking."
36
+ },
32
37
  "phase": {
33
38
  "type": "string",
34
39
  "enum": [
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: brownfield-index
3
- description: Invoke when the user is new to an unfamiliar / legacy / brownfield codebase and wants a structural understanding module map, component inventory, API surface, data flow. Triggers on "legacy code", "brownfield", "unfamiliar", "new to this code", "new to this project", "just joined", "inherited codebase", "explore codebase", "understand structure", "index code", "map modules", "tour", "onboard", "what is this project".
3
+ description: Use when the user needs structural understanding of an unfamiliar, inherited, legacy, or brownfield codebase.
4
+ when_to_use: Triggers on "legacy code", "brownfield", "unfamiliar", "new to this code", "new to this project", "just joined", "inherited codebase", "explore codebase", "understand structure", "index code", "map modules", "tour", "onboard", "what is this project".
4
5
  allowed-tools: [Read, Grep, Glob, Bash]
5
6
  ---
6
7
 
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: browser-qa
3
- description: Invoke when the user wants to test a UI/frontend in a real browser accessibility, performance, console errors, network traffic, visual regression. Triggers on "browser test", "test in browser", "UI test", "e2e test", "frontend test", "accessibility", "a11y", "WCAG", "lighthouse", "performance audit", "console error", "network request", "cross-browser", "responsive", "mobile test", "visual regression", "screenshot".
3
+ description: Use when the user needs real-browser QA for a UI or frontend flow.
4
+ when_to_use: Triggers on "browser test", "test in browser", "UI test", "e2e test", "frontend test", "accessibility", "a11y", "WCAG", "lighthouse", "performance audit", "console error", "network request", "cross-browser", "responsive", "mobile test", "visual regression", "screenshot".
4
5
  allowed-tools: [Read, Write, Bash, Grep, Glob, WebFetch]
5
6
  ---
6
7
 
@@ -10,7 +11,7 @@ You are invoked when the user wants real-browser QA of a UI flow.
10
11
 
11
12
  ## Preconditions
12
13
 
13
- 1. `chrome-devtools` MCP is available (`mcp__chrome-devtools__*`). If missing, fall back to a manual checklist.
14
+ 1. `chrome-devtools` MCP is available (`mcp__chrome_devtools__*`). If missing, fall back to a manual checklist.
14
15
  2. A URL (dev server or deployed) is available. Prompt for it if not provided.
15
16
 
16
17
  ## Workflow
@@ -25,8 +26,8 @@ Confirm with the user:
25
26
  ### Step 2: Dispatch `flow-qa-engineer`
26
27
 
27
28
  Delegate to the `flow-qa-engineer` agent. It will:
28
- 1. Open the target URL via `mcp__chrome-devtools__new_page`
29
- 2. Drive the flow with `mcp__chrome-devtools__click` / `fill` / `navigate`
29
+ 1. Open the target URL via `mcp__chrome_devtools__new_page`
30
+ 2. Drive the flow with `mcp__chrome_devtools__click` / `fill` / `navigate_page`
30
31
  3. Capture `list_console_messages`, `list_network_requests`, `take_screenshot`, optionally `lighthouse_audit`
31
32
  4. Compare against expected behavior
32
33
 
@@ -0,0 +1,105 @@
1
+ ---
2
+ name: debug
3
+ description: Systematic debugging — 4-phase methodology (root cause → pattern → hypothesis → fix); three failures trigger architectural questioning. Routes to flow-debugger.
4
+ argument-hint: "\"<bug description>\""
5
+ disable-model-invocation: true
6
+ context: fork
7
+ agent: flow-debugger
8
+ ---
9
+
10
+ # Systematic Debug
11
+
12
+ Debug the bug described below using the 4-phase methodology in
13
+ `@${CLAUDE_PLUGIN_ROOT}/knowledge/systematic-debugging.md`. This is NOT
14
+ "retry until green" — each phase has a stop condition.
15
+
16
+ **Bug description**: `$ARGUMENTS`
17
+
18
+ If `$ARGUMENTS` is empty, print `Usage: /curdx-flow:debug "<bug description>"` and stop.
19
+
20
+ ## Context to gather before diagnosing
21
+
22
+ - Recent commits: `git log --oneline -20`
23
+ - Uncommitted changes: `git status --short`, `git diff --stat`
24
+ - Active spec (if any): read `.flow/.active-spec`; if set, read
25
+ `.flow/specs/<active>/.progress.md` for related history.
26
+
27
+ ## Phase 1 — Root-cause investigation
28
+
29
+ - Read the error carefully (stack trace + message + location).
30
+ - Build a minimal reproduction.
31
+ - Check recent changes that could have introduced the bug.
32
+ - Trace the data flow from cause to symptom.
33
+ - **Exit condition**: state the root cause in **one sentence**.
34
+ "maybe it's..." is not allowed.
35
+
36
+ ## Phase 2 — Pattern analysis
37
+
38
+ - Find a working counter-example in the codebase (same path, different
39
+ input or neighboring module that behaves correctly).
40
+ - Pinpoint the difference from the failing case.
41
+ - Classify: **isolated case** (one location) vs. **systemic pattern**
42
+ (multiple siblings). If systemic, Phase 4 must sweep for siblings.
43
+
44
+ ## Phase 3 — Hypothesis and test
45
+
46
+ - State ONE hypothesis.
47
+ - Write the smallest test that distinguishes confirm vs. disprove.
48
+ - Run the test in-memory (do not commit yet).
49
+ - If disproved, return to Phase 1 with the new signal.
50
+
51
+ ## Phase 4 — Implement the fix
52
+
53
+ 1. Write a failing test; confirm it fails. Commit `test(<scope>): red - ...`.
54
+ 2. Fix the root cause (not the symptom). Confirm the failing test now
55
+ passes. Commit `fix(<scope>): green - ...`.
56
+ 3. Run the full regression suite; no regressions allowed.
57
+ 4. If Phase 2 classified as systemic, sweep for sibling occurrences and
58
+ fix them in the same stage. Optional third commit
59
+ `fix(<scope>): sweep - N similar cases`.
60
+
61
+ ## Three-failure guard (hard stop)
62
+
63
+ If Phase 4 has tried 3 genuinely different approaches and all failed,
64
+ **stop**. Do not try a 4th. Output the structured failure report:
65
+
66
+ ```
67
+ ⚠ Systematic debug halted after 3 attempts
68
+
69
+ Attempts:
70
+ 1. <approach 1>: <why it failed>
71
+ 2. <approach 2>: <why it failed>
72
+ 3. <approach 3>: <why it failed>
73
+
74
+ Root-issue hypothesis: architecture | dependency | data | unknown
75
+ Recommended next step: <user action — review architecture, ship a
76
+ STATE.md D-NN deferral with @ts-expect-error,
77
+ or request pairing>
78
+ ```
79
+
80
+ ## Forbidden
81
+
82
+ - Prayer-driven programming (retry without a new hypothesis each round)
83
+ - "Maybe it's ..." as a Phase 1 conclusion
84
+ - A fix commit without a corresponding failing-test commit
85
+ - Masking the root cause with null checks / try-catch
86
+ - Fixing multiple unrelated things in one commit (one task = one commit)
87
+
88
+ ## Output to user (on success, ≤ 15 lines)
89
+
90
+ ```
91
+ ✓ Debug complete
92
+
93
+ Root cause: <Phase 1 — one sentence>
94
+ Pattern: <Phase 2 — isolated or systemic>
95
+
96
+ Fix commits:
97
+ - <sha>: test(<scope>): red - failing test
98
+ - <sha>: fix(<scope>): green - root-cause fix
99
+ - <sha>: fix(<scope>): sweep - N sibling cases (if systemic)
100
+
101
+ Verification: failing test now PASS ✓; full suite green ✓
102
+
103
+ Learnings (candidate for .progress.md):
104
+ - <lesson>
105
+ ```
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: epic
3
- description: Invoke when user wants to break a large feature into multiple smaller specs with a dependency graph. Triggers on "epic", "big feature", "too big", "decompose", "break down", "break into", "split into", "multi-spec", "multiple features", "sub-features", "vertical slice", "parent feature", "large scope", "won't fit in one sprint", "needs splitting".
3
+ description: Use when the user needs to decompose a large feature into smaller vertical-slice specs with dependencies.
4
+ when_to_use: Triggers on "epic", "big feature", "too big", "decompose", "break down", "break into", "split into", "multi-spec", "multiple features", "sub-features", "vertical slice", "parent feature", "large scope", "won't fit in one sprint", "needs splitting".
4
5
  allowed-tools: [Read, Write, Grep, Glob, Bash]
5
6
  ---
6
7
 
@@ -2,7 +2,8 @@
2
2
  name: fast
3
3
  description: Ultra-fast execution — skip all spec phases and implement directly per the description. Suited for one-shot small tasks.
4
4
  argument-hint: "\"<task description>\""
5
- allowed-tools: [Read, Write, Edit, Bash, Grep, Glob, Task]
5
+ disable-model-invocation: true
6
+ allowed-tools: [Read, Write, Edit, Bash, Grep, Glob, Agent]
6
7
  ---
7
8
 
8
9
  # Flow Fast — Ultra-Fast Execution
@@ -2,6 +2,7 @@
2
2
  name: help
3
3
  description: Show CurdX-Flow command list, workflow overview, or troubleshooting guide. With a command name, show that command's detail.
4
4
  argument-hint: "[<command-name> | workflow | troubleshoot]"
5
+ disable-model-invocation: true
5
6
  allowed-tools: [Read, Bash]
6
7
  ---
7
8
 
@@ -48,15 +49,24 @@ Show the 9 core slash commands + 5 auto-invoked skills. Keep the table compact,
48
49
 
49
50
  ## `<command-name>` — command detail
50
51
 
51
- When the argument matches one of the 9 commands, read the corresponding `commands/<name>.md` from the plugin cache and present it cleanly:
52
+ When the argument matches a slash name — one of the 9 primary workflows or one of the 5 auto-invoked skills — read the corresponding body and present it cleanly. The lookup tries the `skills/` layout first and falls back to the legacy `commands/` layout, which keeps help correct throughout the Phase 3 migration window:
52
53
 
53
54
  ```bash
54
- PLUGIN=$(ls -dt "$HOME/.claude/plugins/cache/curdx-flow-marketplace/curdx-flow/"*/ 2>/dev/null | head -1)
55
- CMD="$1"
56
- cat "$PLUGIN/commands/$CMD.md"
55
+ CMD="$ARGUMENTS"
56
+ [ -z "$CMD" ] && { echo "Usage: /curdx-flow:help <name>"; exit 1; }
57
+ if [ -f "${CLAUDE_PLUGIN_ROOT}/skills/${CMD}/SKILL.md" ]; then
58
+ cat "${CLAUDE_PLUGIN_ROOT}/skills/${CMD}/SKILL.md"
59
+ elif [ -f "${CLAUDE_PLUGIN_ROOT}/commands/${CMD}.md" ]; then
60
+ cat "${CLAUDE_PLUGIN_ROOT}/commands/${CMD}.md"
61
+ else
62
+ echo "Unknown: ${CMD}"
63
+ echo "Workflows: init start spec implement verify review fast debug help"
64
+ echo "Skills: epic browser-qa ui-sketch security-audit brownfield-index"
65
+ exit 1
66
+ fi
57
67
  ```
58
68
 
59
- If the argument isn't a known command, list the 9 candidates and the 5 skill names.
69
+ If the argument isn't a known slash name, the block above prints the 14 candidates.
60
70
 
61
71
  ## `workflow` — standard workflow
62
72