@curdx/flow 1.1.3 → 1.1.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.
Files changed (100) hide show
  1. package/.claude-plugin/marketplace.json +25 -0
  2. package/.claude-plugin/plugin.json +43 -0
  3. package/CHANGELOG.md +279 -0
  4. package/agent-preamble/preamble.md +214 -0
  5. package/agents/flow-adversary.md +216 -0
  6. package/agents/flow-architect.md +190 -0
  7. package/agents/flow-debugger.md +325 -0
  8. package/agents/flow-edge-hunter.md +273 -0
  9. package/agents/flow-executor.md +246 -0
  10. package/agents/flow-planner.md +204 -0
  11. package/agents/flow-product-designer.md +146 -0
  12. package/agents/flow-qa-engineer.md +276 -0
  13. package/agents/flow-researcher.md +155 -0
  14. package/agents/flow-reviewer.md +280 -0
  15. package/agents/flow-security-auditor.md +398 -0
  16. package/agents/flow-triage-analyst.md +290 -0
  17. package/agents/flow-ui-researcher.md +227 -0
  18. package/agents/flow-ux-designer.md +247 -0
  19. package/agents/flow-verifier.md +283 -0
  20. package/agents/persona-amelia.md +128 -0
  21. package/agents/persona-david.md +141 -0
  22. package/agents/persona-emma.md +179 -0
  23. package/agents/persona-john.md +105 -0
  24. package/agents/persona-mary.md +95 -0
  25. package/agents/persona-oliver.md +136 -0
  26. package/agents/persona-rachel.md +126 -0
  27. package/agents/persona-serena.md +175 -0
  28. package/agents/persona-winston.md +117 -0
  29. package/bin/curdx-flow.js +5 -2
  30. package/cli/init.js +18 -2
  31. package/cli/install.js +44 -5
  32. package/commands/audit.md +170 -0
  33. package/commands/autoplan.md +184 -0
  34. package/commands/debug.md +199 -0
  35. package/commands/design.md +155 -0
  36. package/commands/discuss.md +162 -0
  37. package/commands/doctor.md +124 -0
  38. package/commands/fast.md +128 -0
  39. package/commands/help.md +119 -0
  40. package/commands/implement.md +381 -0
  41. package/commands/index.md +261 -0
  42. package/commands/init.md +105 -0
  43. package/commands/install-deps.md +128 -0
  44. package/commands/party.md +241 -0
  45. package/commands/plan-ceo.md +117 -0
  46. package/commands/plan-design.md +107 -0
  47. package/commands/plan-dx.md +104 -0
  48. package/commands/plan-eng.md +108 -0
  49. package/commands/qa.md +118 -0
  50. package/commands/requirements.md +146 -0
  51. package/commands/research.md +141 -0
  52. package/commands/review.md +168 -0
  53. package/commands/security.md +109 -0
  54. package/commands/sketch.md +118 -0
  55. package/commands/spec.md +135 -0
  56. package/commands/spike.md +181 -0
  57. package/commands/start.md +189 -0
  58. package/commands/status.md +139 -0
  59. package/commands/switch.md +95 -0
  60. package/commands/tasks.md +189 -0
  61. package/commands/triage.md +160 -0
  62. package/commands/verify.md +124 -0
  63. package/gates/adversarial-review-gate.md +219 -0
  64. package/gates/coverage-audit-gate.md +184 -0
  65. package/gates/devex-gate.md +255 -0
  66. package/gates/edge-case-gate.md +194 -0
  67. package/gates/karpathy-gate.md +130 -0
  68. package/gates/security-gate.md +218 -0
  69. package/gates/tdd-gate.md +188 -0
  70. package/gates/verification-gate.md +183 -0
  71. package/hooks/hooks.json +56 -0
  72. package/hooks/scripts/fail-tracker.sh +31 -0
  73. package/hooks/scripts/inject-karpathy.sh +52 -0
  74. package/hooks/scripts/quick-mode-guard.sh +64 -0
  75. package/hooks/scripts/session-start.sh +76 -0
  76. package/hooks/scripts/stop-watcher.sh +166 -0
  77. package/knowledge/atomic-commits.md +262 -0
  78. package/knowledge/epic-decomposition.md +307 -0
  79. package/knowledge/execution-strategies.md +278 -0
  80. package/knowledge/karpathy-guidelines.md +219 -0
  81. package/knowledge/planning-reviews.md +211 -0
  82. package/knowledge/poc-first-workflow.md +227 -0
  83. package/knowledge/spec-driven-development.md +183 -0
  84. package/knowledge/systematic-debugging.md +384 -0
  85. package/knowledge/two-stage-review.md +233 -0
  86. package/knowledge/wave-execution.md +387 -0
  87. package/package.json +13 -2
  88. package/schemas/config.schema.json +100 -0
  89. package/schemas/spec-frontmatter.schema.json +42 -0
  90. package/schemas/spec-state.schema.json +117 -0
  91. package/templates/CONTEXT.md.tmpl +53 -0
  92. package/templates/PROJECT.md.tmpl +59 -0
  93. package/templates/ROADMAP.md.tmpl +50 -0
  94. package/templates/STATE.md.tmpl +49 -0
  95. package/templates/config.json.tmpl +48 -0
  96. package/templates/design.md.tmpl +163 -0
  97. package/templates/progress.md.tmpl +58 -0
  98. package/templates/requirements.md.tmpl +94 -0
  99. package/templates/research.md.tmpl +114 -0
  100. package/templates/tasks.md.tmpl +141 -0
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "curdx-flow-marketplace",
3
+ "owner": {
4
+ "name": "wdx",
5
+ "email": "bydongxin@gmail.com"
6
+ },
7
+ "metadata": {
8
+ "description": "CurDX-Flow marketplace — distributes the curdx-flow meta-framework plugin",
9
+ "version": "1.1.5"
10
+ },
11
+ "plugins": [
12
+ {
13
+ "name": "curdx-flow",
14
+ "source": "./",
15
+ "description": "AI engineering workflow meta-framework — spec-driven + autonomous execution + quality gates + multi-agent collaboration",
16
+ "keywords": [
17
+ "workflow",
18
+ "spec-driven",
19
+ "ai-engineering",
20
+ "orchestration"
21
+ ],
22
+ "category": "productivity"
23
+ }
24
+ ]
25
+ }
@@ -0,0 +1,43 @@
1
+ {
2
+ "name": "curdx-flow",
3
+ "version": "1.1.5",
4
+ "description": "AI engineering workflow meta-framework — spec-driven + autonomous execution + quality gates + multi-agent collaboration. Distills Karpathy + BMAD + GSD + Ralph + Superpowers + GStack and orchestrates context7 / sequential-thinking / chrome-devtools / frontend-design / claude-mem / pua dependencies.",
5
+ "author": {
6
+ "name": "wdx",
7
+ "email": "bydongxin@gmail.com"
8
+ },
9
+ "homepage": "https://github.com/wdx/curdx-flow",
10
+ "repository": "https://github.com/wdx/curdx-flow",
11
+ "license": "MIT",
12
+ "keywords": [
13
+ "workflow",
14
+ "spec-driven",
15
+ "ai-engineering",
16
+ "orchestration",
17
+ "karpathy",
18
+ "claude-code"
19
+ ],
20
+ "mcpServers": {
21
+ "context7": {
22
+ "command": "npx",
23
+ "args": [
24
+ "-y",
25
+ "@upstash/context7-mcp@latest"
26
+ ]
27
+ },
28
+ "sequential-thinking": {
29
+ "command": "npx",
30
+ "args": [
31
+ "-y",
32
+ "@modelcontextprotocol/server-sequential-thinking"
33
+ ]
34
+ },
35
+ "chrome-devtools": {
36
+ "command": "npx",
37
+ "args": [
38
+ "-y",
39
+ "chrome-devtools-mcp@latest"
40
+ ]
41
+ }
42
+ }
43
+ }
package/CHANGELOG.md ADDED
@@ -0,0 +1,279 @@
1
+ # Changelog
2
+
3
+ All notable changes to CurDX-Flow will be documented here.
4
+
5
+ ## [1.1.1] - 2026-04-20
6
+
7
+ ### Fixed
8
+ - **Plugin load failure** — removed the explicit `"hooks": "./hooks/hooks.json"` declaration from `plugin.json`.
9
+ Claude Code auto-loads the default path `hooks/hooks.json`; declaring it explicitly caused a duplicate-hook-file
10
+ error. Symptom: `claude plugin list` showed `Status: ✘ failed to load`.
11
+ - The local `claude --plugin-dir` mode does not trigger duplicate detection, so all 8 rounds of dev-time validation
12
+ passed; only a real marketplace install exposed this bug (lesson from the first publish).
13
+
14
+ ## [1.1.0] - 2026-04-20
15
+
16
+ ### Changed — **BREAKING**: command namespacing
17
+
18
+ All 31 commands moved from `/flow-<name>` to **`/curdx-flow:<name>`** (Claude Code's native plugin namespace).
19
+
20
+ **Migration map (old → new)**:
21
+ - `/flow-init` → `/curdx-flow:init`
22
+ - `/flow-start` → `/curdx-flow:start`
23
+ - `/flow-research` → `/curdx-flow:research`
24
+ - `/flow-requirements` → `/curdx-flow:requirements`
25
+ - `/flow-design` → `/curdx-flow:design`
26
+ - `/flow-tasks` → `/curdx-flow:tasks`
27
+ - `/flow-spec` → `/curdx-flow:spec`
28
+ - `/flow-implement` → `/curdx-flow:implement`
29
+ - `/flow-verify` → `/curdx-flow:verify`
30
+ - `/flow-review` → `/curdx-flow:review`
31
+ - `/flow-audit` → `/curdx-flow:audit`
32
+ - `/flow-debug` → `/curdx-flow:debug`
33
+ - `/flow-triage` → `/curdx-flow:triage`
34
+ - `/flow-discuss` → `/curdx-flow:discuss`
35
+ - `/flow-party` → `/curdx-flow:party`
36
+ - `/flow-qa` → `/curdx-flow:qa`
37
+ - `/flow-sketch` → `/curdx-flow:sketch`
38
+ - `/flow-security` → `/curdx-flow:security`
39
+ - `/flow-index` → `/curdx-flow:index`
40
+ - `/flow-doctor` → `/curdx-flow:doctor`
41
+ - `/flow-status` → `/curdx-flow:status`
42
+ - `/flow-switch` → `/curdx-flow:switch`
43
+ - `/flow-help` → `/curdx-flow:help`
44
+ - `/flow-install-deps` → `/curdx-flow:install-deps`
45
+ - `/flow-fast` → `/curdx-flow:fast`
46
+ - `/flow-spike` → `/curdx-flow:spike`
47
+ - `/flow-plan-ceo` → `/curdx-flow:plan-ceo`
48
+ - `/flow-plan-eng` → `/curdx-flow:plan-eng`
49
+ - `/flow-plan-design` → `/curdx-flow:plan-design`
50
+ - `/flow-plan-dx` → `/curdx-flow:plan-dx`
51
+ - `/flow-autoplan` → `/curdx-flow:autoplan`
52
+
53
+ ### Changed
54
+ - Renamed `commands/flow-*.md` to `commands/*.md` (history preserved via `git mv`)
55
+ - Each command's `name: flow:xxx` frontmatter changed to `name: xxx`
56
+ - 78 doc files updated for a total of 594 + 38 command references
57
+ - Template strings that dynamically generate command names (help/switch/start/spec) updated in lockstep
58
+ - `plugin.json` / `marketplace.json` version: 1.0.0 → 1.1.0
59
+
60
+ ### Unchanged (intentional)
61
+ - `agents/flow-*.md` file paths (agent internal namespace, not commands)
62
+ - `CHANGELOG.md` historical entries (history is not rewritten)
63
+ - References to future Phase 6+ commands (e.g. `/curdx-flow:ship`, marked "not implemented")
64
+
65
+ ### Why
66
+ Claude Code natively supports the `<plugin-name>:<command>` namespace, which avoids collisions with other plugins'
67
+ `/flow-*` commands and makes provenance clearer. When users see `/curdx-flow:start` they immediately know it
68
+ belongs to curdx-flow.
69
+
70
+ ### Migration
71
+ Old commands no longer work. If your scripts or docs reference the old names, do a global replace
72
+ `/flow-` → `/curdx-flow:` (note: agent file paths `agents/flow-*.md` stay unchanged).
73
+
74
+ ## [1.0.0] - 2026-04-20
75
+
76
+ ### Added — Phase 7: Polish & Release
77
+
78
+ - **7 complete user docs** (`docs/*.md`):
79
+ - `getting-started.md` — 5-minute on-ramp
80
+ - `command-reference.md` — all 31 commands grouped by family
81
+ - `agent-reference.md` — all 24 agents (15 functional + 9 personas)
82
+ - `workflows.md` — 5 typical workflows (greenfield/brownfield/epic/fast/ui-heavy)
83
+ - `architecture.md` — technical architecture (hook system / strategy router / gate composition / extension points)
84
+ - `ethos.md` — design philosophy (five pillars / credits / trade-offs / anti-patterns)
85
+ - `troubleshoot.md` — symptom-indexed troubleshooting
86
+ - **README upgrade** (English + Chinese) — added badges / overview list / Quick Start / credits / explicit "skipped" notes
87
+
88
+ ### Changed
89
+ - `plugin.json` version: 0.6.0 → **1.0.0** (Polish complete = official 1.0 release)
90
+
91
+ ### Design Decision
92
+ - v1.0 marks "feature-complete + publishable"
93
+ - Subsequent versioning is semantic:
94
+ - 1.0.x patch — doc fixes, hook fixes
95
+ - 1.x.0 minor — new commands / new agents / new gates
96
+ - 2.0.0 major — breaking changes (e.g. frontmatter schema change)
97
+ - **Phase 6 intentionally skipped** (ship/land/canary/retro) — low ROI for private repos
98
+
99
+ ## [0.6.0] - 2026-04-19
100
+
101
+ ### Added — Phase 5: Tools & UI
102
+
103
+ - **4 tool-class agents** (`agents/*.md`):
104
+ - `flow-qa-engineer` — runs real-browser QA via the chrome-devtools MCP, capturing bugs / performance / accessibility
105
+ - `flow-ux-designer` — invokes the frontend-design skill to generate HTML variants
106
+ - `flow-security-auditor` — OWASP Top 10 + STRIDE + npm audit
107
+ - `flow-ui-researcher` — UI pattern research; scans codebase + WebSearch + screenshots
108
+ - **2 new gates** (`gates/*.md`):
109
+ - `security-gate` — SR blocking red lines (hard-coded credentials, injection, sensitive logging) + SW warnings + SM mandatory items
110
+ - `devex-gate` — 8 dimensions (naming/comments/structure/error-handling/setup/types/tests/dev loop)
111
+ - **4 tool commands**:
112
+ - `/curdx-flow:qa [--url=...]` — dispatches Oliver for browser QA
113
+ - `/curdx-flow:sketch "<description>"` — dispatches Emma to generate UI variants
114
+ - `/curdx-flow:security` — dispatches Serena for security audit
115
+ - `/curdx-flow:index [--force]` — scans a brownfield codebase and generates an index
116
+ - **5 Planning Review commands** (inherited from gstack and extended):
117
+ - `/curdx-flow:plan-ceo` — strategic-layer review (scope / ROI / opportunity cost)
118
+ - `/curdx-flow:plan-eng` — engineering-layer review (architecture lock / risks)
119
+ - `/curdx-flow:plan-design` — UI/UX review (accessibility / design system)
120
+ - `/curdx-flow:plan-dx` — DevEx review (8-dimension scoring)
121
+ - `/curdx-flow:autoplan` — runs the 4 reviews above in parallel and aggregates findings
122
+ - **New knowledge doc** (`knowledge/planning-reviews.md`) — 4-dimension methodology + when to use + when to skip
123
+
124
+ ### Changed
125
+ - `plugin.json` version: 0.5.1 → 0.6.0
126
+
127
+ ## [0.5.1] - 2026-04-19
128
+
129
+ ### Added — Wave Execution complete (Phase 2 follow-up)
130
+
131
+ - **`knowledge/wave-execution.md`** — DAG analysis algorithm, parallel dispatch mechanism,
132
+ conflict detection (pre + post), failure strategy, configuration notes, 3 file-conflict scenarios
133
+ - **`commands/curdx-flow:implement.md`** wave section expanded from a 20-line concept sketch
134
+ to a complete 6-step execution flow: DAG analysis → pre-conflict check → single-message
135
+ parallel Task dispatch → result aggregation → failure handling → progress feedback
136
+
137
+ ### Changed
138
+ - `plugin.json` version: 0.5.0 → 0.5.1
139
+
140
+ ## [0.5.0] - 2026-04-19
141
+
142
+ ### Added — Phase 4: Advanced (Triage / Party / Debug / Personas)
143
+
144
+ - **2 new functional agents**:
145
+ - `flow-triage-analyst` — Epic vertical-slice decomposition, splitting by user value (not technical layer); produces a dependency graph + frozen shared interfaces
146
+ - `flow-debugger` — systematic 4-stage debugging (root cause → pattern → hypothesis → fix); ≥3 failures triggers an architecture challenge
147
+ - **9 persona agents** (`agents/persona-*.md`) — BMAD-style personalization:
148
+ - Mary (Senior Analyst → flow-researcher)
149
+ - John (Product Manager → flow-product-designer)
150
+ - Winston (Architect → flow-architect)
151
+ - Amelia (Developer → flow-executor)
152
+ - Rachel (Code Reviewer → flow-reviewer)
153
+ - David (Debugger → flow-debugger)
154
+ - Oliver (QA Engineer → flow-edge-hunter + Phase 5+ flow-qa-engineer)
155
+ - Serena (Security Auditor → Phase 5+ flow-security-auditor)
156
+ - Emma (UX Designer → Phase 5+ flow-ux-designer)
157
+ - **4 new commands**:
158
+ - `/curdx-flow:triage "<epic goal>"` — dispatches flow-triage-analyst to slice the Epic vertically
159
+ - `/curdx-flow:discuss` — captures key decisions (D-NN), writes to STATE.md + .progress.md
160
+ - `/curdx-flow:party <personas...> "<question>"` — multiple personas reason in parallel and independently (true multi-agent, not single-LLM role-play)
161
+ - `/curdx-flow:debug "<bug>"` — dispatches David / flow-debugger for systematic 4-stage debugging
162
+ - **2 new knowledge docs**:
163
+ - `knowledge/epic-decomposition.md` — vertical slice vs horizontal layer, dependency types, shared-interface freeze
164
+ - `knowledge/systematic-debugging.md` — full 4-stage methodology + forbidden anti-patterns
165
+
166
+ ### Changed
167
+ - `plugin.json` version: 0.4.0 → 0.5.0
168
+
169
+ ## [0.4.0] - 2026-04-19
170
+
171
+ ### Added — Phase 3: Gates & Review
172
+
173
+ - **6 core gates** (`gates/*.md`) — composable quality-gate definitions:
174
+ - `karpathy-gate` (always-on, blocking) — code-level checks for the 4 principles
175
+ - `verification-gate` (always-on, blocking) — completion claims require fresh evidence
176
+ - `tdd-gate` (standard, blocking) — RED → GREEN → YELLOW enforcement + exemption paths
177
+ - `coverage-audit-gate` (standard, blocking) — 4-source (FR/AD/Research/D-NN) coverage audit
178
+ - `adversarial-review-gate` (enterprise, warning) — zero-findings forbidden + minimum findings across 3 categories
179
+ - `edge-case-gate` (enterprise, warning) — 7 categories of edge cases + test-gap checklist
180
+ - **4 review agents** (`agents/*.md`):
181
+ - `flow-verifier` — goal-backward verification; detects stubs / fake completions
182
+ - `flow-reviewer` — Two-Stage Review (Stage 1 spec compliance + Stage 2 code quality)
183
+ - `flow-adversary` — adversarial review; 6 dimensions × 2 rounds of sequential-thinking
184
+ - `flow-edge-hunter` — hunts 7 categories of edge cases; generates a test-gap checklist
185
+ - **3 new commands** (`commands/*.md`):
186
+ - `/curdx-flow:verify` — goal-backward verification (dispatches flow-verifier)
187
+ - `/curdx-flow:review [--adversarial|--edge-case|--both]` — Two-Stage Review with optional adversarial / edge-case scan
188
+ - `/curdx-flow:audit` — multi-source coverage audit (tasks-vs-specs cross-check)
189
+ - **New knowledge doc** (`knowledge/two-stage-review.md`) — Stage 1/2 design principles + typical anti-patterns
190
+
191
+ ### Changed
192
+ - `plugin.json` version: 0.3.0 → 0.4.0
193
+
194
+ ## [0.3.0] - 2026-04-19
195
+
196
+ ### Added — Phase 2: Execution Engine
197
+
198
+ - **flow-executor agent** (`agents/flow-executor.md`) — core execution agent:
199
+ - Executes a single task with POC-First + TDD
200
+ - Verify must pass
201
+ - Atomic commits in conventional-commit format
202
+ - Emits `TASK_COMPLETE` / `TASK_FAILED` / `ALL_TASKS_COMPLETE` markers
203
+ - 5-round retry mechanism (pua-style pressure escalation)
204
+ - **2 new knowledge docs**:
205
+ - `knowledge/execution-strategies.md` — 4 execution strategies in detail (linear / subagent / stop-hook / wave / auto)
206
+ - `knowledge/atomic-commits.md` — atomic-commit rules + conventional-commit format
207
+ - **2 new hook scripts**:
208
+ - `hooks/scripts/stop-watcher.sh` — StopHookLoop implementation (detects `ALL_TASKS_COMPLETE`, tracks failure count, prevents infinite loops)
209
+ - `hooks/scripts/quick-mode-guard.sh` — Quick Mode blocks AskUserQuestion (so the autonomous loop does not stall)
210
+ - **`hooks.json`** registers the new hooks:
211
+ - `Stop` → stop-watcher.sh
212
+ - `PreToolUse(AskUserQuestion)` → quick-mode-guard.sh
213
+ - **3 new commands**:
214
+ - `/curdx-flow:implement` — main execute command, with Strategy Router (`--strategy=auto|linear|subagent|stop-hook|wave`, `--task=X.Y`, `--quick`)
215
+ - `/curdx-flow:fast` — skip the spec, implement directly (one-shot tasks)
216
+ - `/curdx-flow:spike` — feasibility experiment (2–5 small tests to validate a hypothesis)
217
+
218
+ ### Changed
219
+ - `plugin.json` version: 0.2.0 → 0.3.0
220
+
221
+ ## [0.2.0] - 2026-04-19
222
+
223
+ ### Added — Phase 1: Spec Engine
224
+
225
+ - **5 spec templates** (`templates/*.tmpl`):
226
+ - `research.md.tmpl` — research report structure
227
+ - `requirements.md.tmpl` — user stories + acceptance criteria + FR/NFR
228
+ - `design.md.tmpl` — architecture decisions + component boundaries + mermaid diagrams
229
+ - `tasks.md.tmpl` — POC-First 5 Phases + coverage audit
230
+ - `progress.md.tmpl` — progress log + learnings
231
+ - **3 JSON Schemas** (`schemas/*.schema.json`):
232
+ - `spec-state.schema.json` — cross-session state
233
+ - `config.schema.json` — project configuration
234
+ - `spec-frontmatter.schema.json` — spec file YAML frontmatter
235
+ - **2 knowledge docs** (`knowledge/*.md`):
236
+ - `spec-driven-development.md` — SDD methodology
237
+ - `poc-first-workflow.md` — POC-First 5 Phases
238
+ - **4 functional agents** (`agents/*.md`):
239
+ - `flow-researcher` — deep research (context7 + claude-mem + sequential-thinking ≥5 rounds + WebSearch)
240
+ - `flow-product-designer` — user stories + acceptance criteria + FR/NFR
241
+ - `flow-architect` — architecture design (sequential-thinking ≥8 rounds + context7 to validate technology choices)
242
+ - `flow-planner` — POC-First decomposition + multi-source coverage audit
243
+ - **7 new commands** (`commands/*.md`):
244
+ - `/curdx-flow:start` — intelligent entry (new spec / resume spec)
245
+ - `/curdx-flow:switch` — switch the active spec
246
+ - `/curdx-flow:research` — dispatches flow-researcher
247
+ - `/curdx-flow:requirements` — dispatches flow-product-designer
248
+ - `/curdx-flow:design` — dispatches flow-architect
249
+ - `/curdx-flow:tasks` — dispatches flow-planner
250
+ - `/curdx-flow:spec` — runs the 4 phases sequentially in one shot
251
+
252
+ ### Changed
253
+ - `plugin.json` version: 0.1.0 → 0.2.0
254
+
255
+ ## [0.1.0] - 2026-04-19
256
+
257
+ ### Added — Phase 0: Foundation
258
+
259
+ - Project skeleton for Claude Code plugin
260
+ - `plugin.json` with inline `mcpServers` declaring 3 auto-installed MCPs:
261
+ - `context7` — latest documentation fetcher
262
+ - `sequential-thinking` — structured reasoning
263
+ - `chrome-devtools` — browser automation
264
+ - `marketplace.json` for future plugin market publishing
265
+ - Hook system:
266
+ - `SessionStart` — dependency check + project state load
267
+ - `InstructionsLoaded` — inject Karpathy L1 baseline
268
+ - `PostToolUseFailure` — fail counter (pua integration prep)
269
+ - Shared agent preamble (`agent-preamble/preamble.md`) — enforces `context7` / `sequential-thinking` / `claude-mem` usage in all agents
270
+ - Core commands:
271
+ - `/curdx-flow:init` — initialize `.flow/` project structure
272
+ - `/curdx-flow:install-deps` — one-click install of recommended plugins (pua, claude-mem, frontend-design)
273
+ - `/curdx-flow:doctor` — dependency health check
274
+ - `/curdx-flow:status` — project & spec status
275
+ - `/curdx-flow:help` — smart help
276
+ - Document templates (`templates/*.tmpl`) for PROJECT/CONTEXT/STATE/ROADMAP/config
277
+ - Knowledge base (`knowledge/karpathy-guidelines.md`) for agents to `@`-reference
278
+ - CLAUDE.md with L1-L4 rules
279
+ - README (English + Chinese) + LICENSE (MIT)
@@ -0,0 +1,214 @@
1
+ # CurDX-Flow Agent Shared Preamble
2
+
3
+ > All `flow-*` agents and commands inherit this file via `@${CLAUDE_PLUGIN_ROOT}/agent-preamble/preamble.md`.
4
+ > This is a behavioral baseline, not a suggestion. Violation counts as agent failure.
5
+
6
+ ---
7
+
8
+ ## L1: Karpathy Mind Baseline (hard rules)
9
+
10
+ ### 1. Think Before Coding
11
+ - State your assumptions before starting
12
+ - When uncertain, use AskUserQuestion — do not silently assume
13
+ - Offer multiple interpretations and let the user choose
14
+ - Never skip "understanding" and jump straight to "implementation"
15
+
16
+ ### 2. Simplicity First
17
+ - YAGNI principle
18
+ - No features beyond what was requested
19
+ - No single-use abstractions
20
+ - If 200 lines suffice, do not write 1000
21
+
22
+ ### 3. Surgical Changes
23
+ - Modify only the lines that must change
24
+ - Match existing style (indentation, naming, quotes)
25
+ - Do not delete pre-existing dead code
26
+ - Only clean up orphan code that you yourself created
27
+
28
+ ### 4. Goal-Driven Execution
29
+ - Define a verifiable success criterion
30
+ - Do not say done/fixed/working without evidence
31
+ - Tests first, goals first
32
+
33
+ ---
34
+
35
+ ## L2: Mandatory Tool Rules (enforced)
36
+
37
+ ### Documentation lookup → context7 MCP
38
+
39
+ For any question involving a library / framework / SDK / CLI / API:
40
+
41
+ ```
42
+ 1. mcp__context7__resolve-library-id("react") → resolve library ID
43
+ 2. mcp__context7__query-docs(libraryId, query) → query latest docs
44
+ ```
45
+
46
+ **Forbidden**: writing library API calls from training memory. Training data may be stale.
47
+
48
+ **Fallback**: when context7 MCP is unavailable, use WebSearch with a version number, and annotate the output with
49
+ "⚠️ context7 unavailable — documentation may not be current".
50
+
51
+ ---
52
+
53
+ ### Structured thinking → sequential-thinking MCP
54
+
55
+ For the following scenarios, sequential-thinking is mandatory beforehand:
56
+
57
+ - Planning (≥5 thoughts)
58
+ - Architecture design (≥8 thoughts)
59
+ - Epic decomposition (≥10 thoughts)
60
+ - Adversarial review (≥6 thoughts)
61
+ - Complex bug root-cause analysis (≥5 thoughts)
62
+
63
+ ```
64
+ mcp__sequential-thinking__sequentialthinking({
65
+ thought: "...",
66
+ thoughtNumber: N,
67
+ totalThoughts: M,
68
+ nextThoughtNeeded: true/false
69
+ })
70
+ ```
71
+
72
+ **Fallback**: when seq-think is unavailable, simulate it inside `<thinking>...</thinking>` blocks
73
+ in the response, still listing numbered thoughts (at least 5).
74
+
75
+ ---
76
+
77
+ ### Historical context → claude-mem (if installed)
78
+
79
+ Before starting any task (**especially the planning phase**):
80
+
81
+ ```
82
+ mcp__claude_mem__search("<task keywords>")
83
+ → if relevant observations exist:
84
+ mcp__claude_mem__get_observations([ids])
85
+ → fold the relevant history into your decisions
86
+ ```
87
+
88
+ **Fallback**: when claude-mem is not installed, read the `decisions` array in `.flow/STATE.md`
89
+ and `.flow/specs/*/.progress.md` for project-level history.
90
+
91
+ ---
92
+
93
+ ### UI code generation → frontend-design skill (if installed)
94
+
95
+ All UI code generation must invoke the official Anthropic `frontend-design` skill.
96
+
97
+ **Fallback**: when the skill is unavailable, use Tailwind CSS + shadcn/ui defaults.
98
+
99
+ ---
100
+
101
+ ### Browser QA → chrome-devtools MCP
102
+
103
+ UI testing, performance traces, console inspection, network analysis:
104
+
105
+ ```
106
+ mcp__chrome_devtools__*
107
+ ```
108
+
109
+ **Fallback**: when the MCP is unavailable, produce a manual test checklist and explicitly tell the user.
110
+
111
+ ---
112
+
113
+ ## L3: Three Red Lines (inherited from pua, universal)
114
+
115
+ Self-check before every agent output:
116
+
117
+ ### 1. Closed loop
118
+ > Claiming "done / fixed / passed"? Provide evidence.
119
+
120
+ - ✗ "I fixed the bug"
121
+ - ✓ "I fixed the bug. `npm test` output: `✓ 42 tests passed` (log attached)"
122
+
123
+ ### 2. Fact-driven
124
+ > Verify before saying "maybe" or "probably".
125
+
126
+ - ✗ "This is probably a permission issue"
127
+ - ✓ "I ran `ls -la config.json` and saw permissions `-rw-------`, unreadable by user. Fix: `chmod 644`"
128
+
129
+ ### 3. Exhaust everything
130
+ > Before saying "I cannot", complete the systematic 4-stage debugging.
131
+
132
+ 1. **Root-cause investigation**: read the error → reproduce → check recent changes → trace the data flow
133
+ 2. **Pattern analysis**: find a working counter-example to compare against
134
+ 3. **Hypothesize and test**: form a single hypothesis → minimal test → verify
135
+ 4. **Implement the fix**: write a failing test → fix the root cause → verify
136
+
137
+ If ≥3 fix attempts fail, stop and challenge the architecture (rather than continuing to patch blindly).
138
+
139
+ ---
140
+
141
+ ## L4: State-Reading Conventions
142
+
143
+ ### Read before every task
144
+
145
+ 1. `.flow/PROJECT.md` — project vision
146
+ 2. `.flow/CONTEXT.md` — user preferences
147
+ 3. `.flow/STATE.md` — cross-session state + decisions
148
+ 4. `.flow/specs/<active>/.progress.md` — current spec progress
149
+ 5. `.flow/.active-spec` — name of the currently active spec
150
+
151
+ ### Update after every task
152
+
153
+ 1. Update `.progress.md` with what you learned (gotchas, patterns, decisions)
154
+ 2. Update `.state.json` to advance the state machine (phase, taskIndex, etc.)
155
+ 3. If a significant decision was made, append to the `decisions` array in `STATE.md` (D-NN format)
156
+
157
+ ---
158
+
159
+ ## L5: Atomic Commit Convention
160
+
161
+ One commit per logical unit:
162
+
163
+ ```
164
+ <type>(<scope>): <summary>
165
+
166
+ [body — explain why, not what]
167
+
168
+ Decisions: D-01, D-02 (when referencing user decisions)
169
+ ```
170
+
171
+ **Types**:
172
+ - `feat` — new feature
173
+ - `fix` — bug fix
174
+ - `refactor` — refactor (behavior unchanged)
175
+ - `test` — tests (TDD: red/green/yellow)
176
+ - `docs` — documentation
177
+ - `chore` — miscellaneous
178
+
179
+ **TDD stage markers**:
180
+ - `test(scope): red - add failing test for X`
181
+ - `feat(scope): green - implement X to pass test`
182
+ - `refactor(scope): yellow - clean up X`
183
+
184
+ ---
185
+
186
+ ## L6: Anti-Patterns (forbidden)
187
+
188
+ Patterns every agent must avoid:
189
+
190
+ - ✗ Starting work without reading `.flow/` state
191
+ - ✗ Claiming completion without running a verification command
192
+ - ✗ "should / probably / seems" as a conclusion (unless explicitly labeled as an assumption)
193
+ - ✗ Skipping context7 and writing library calls directly
194
+ - ✗ Skipping sequential-thinking and giving an architecture decision directly
195
+ - ✗ Refactoring while fixing a bug (violates the surgical-changes rule)
196
+ - ✗ Adding features beyond what was requested (violates YAGNI)
197
+ - ✗ Creating `*.md` documentation or README files unless the user explicitly asked for them
198
+
199
+ ---
200
+
201
+ ## L7: Delegation Convention (sub-agent dispatch)
202
+
203
+ When you need to delegate to a sub-agent:
204
+
205
+ 1. Give the sub-agent **complete task context** (it cannot read the conversation history)
206
+ 2. State the **input paths** and **output paths** explicitly
207
+ 3. State the **success criteria** explicitly (must be verifiable)
208
+ 4. State the **forbidden behaviors** explicitly (cf. L6)
209
+ 5. After the sub-agent finishes, the parent agent **reads the output** and reviews it
210
+
211
+ ---
212
+
213
+ **Remember**: this preamble exists because, without discipline, AI tends to slack off, hallucinate, and over-engineer.
214
+ These rules are not constraints — they are the tools that make you reliable.