@curdx/flow 2.1.0 → 2.2.3
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 +25 -2
- package/.claude-plugin/plugin.json +27 -1
- package/CHANGELOG.md +32 -0
- package/README.md +18 -8
- package/README.zh.md +8 -3
- package/agent-preamble/preamble.md +35 -2
- package/agents/flow-adversary.md +1 -1
- package/agents/flow-architect.md +2 -1
- package/agents/flow-brownfield-analyst.md +153 -0
- package/agents/flow-debugger.md +6 -11
- package/agents/flow-edge-hunter.md +1 -1
- package/agents/flow-executor.md +30 -8
- package/agents/flow-planner.md +38 -5
- package/agents/flow-product-designer.md +2 -1
- package/agents/flow-qa-engineer.md +25 -20
- package/agents/flow-researcher.md +2 -1
- package/agents/flow-reviewer.md +23 -5
- package/agents/flow-security-auditor.md +5 -3
- package/agents/flow-triage-analyst.md +5 -24
- package/agents/flow-ui-researcher.md +6 -5
- package/agents/flow-ux-designer.md +12 -39
- package/agents/flow-verifier.md +38 -6
- package/bin/curdx-flow +5 -0
- package/cli/README.md +13 -10
- package/cli/doctor-workflow.js +1074 -2
- package/cli/doctor.js +8 -0
- package/cli/help.js +2 -0
- package/cli/install-companions.js +4 -1
- package/cli/install-required-plugins.js +18 -5
- package/cli/install-self-update.js +2 -91
- package/cli/install.js +12 -1
- package/cli/lib/claude.js +42 -11
- package/cli/lib/doctor-report.js +303 -9
- package/cli/lib/frontmatter.js +44 -0
- package/cli/lib/json-schema.js +57 -0
- package/cli/lib/runtime.js +20 -2
- package/cli/lib/semver.js +95 -0
- package/cli/utils.js +7 -1
- package/gates/adversarial-review-gate.md +1 -1
- package/gates/security-gate.md +2 -2
- package/gates/test-quality-gate.md +59 -0
- package/hooks/hooks.json +16 -2
- package/hooks/scripts/common.sh +4 -0
- package/hooks/scripts/quick-mode-guard.sh +6 -7
- package/hooks/scripts/session-start.sh +17 -2
- package/hooks/scripts/stop-watcher.sh +69 -18
- package/hooks/scripts/subagent-artifact-guard.sh +159 -0
- package/hooks/scripts/subagent-statusline.sh +105 -0
- package/knowledge/atomic-commits.md +1 -1
- package/knowledge/claude-code-runtime-contracts.md +203 -0
- package/knowledge/epic-decomposition.md +1 -1
- package/knowledge/execution-strategies.md +28 -6
- package/knowledge/planning-reviews.md +4 -4
- package/knowledge/poc-first-workflow.md +8 -8
- package/knowledge/review-feedback-intake.md +57 -0
- package/knowledge/two-stage-review.md +19 -6
- package/knowledge/wave-execution.md +33 -18
- package/output-styles/curdx-evidence-first.md +34 -0
- package/package.json +9 -2
- package/schemas/agent-frontmatter.schema.json +59 -0
- package/schemas/config.schema.json +37 -3
- package/schemas/gate-frontmatter.schema.json +30 -0
- package/schemas/hooks.schema.json +115 -0
- package/schemas/output-style-frontmatter.schema.json +22 -0
- package/schemas/plugin-manifest.schema.json +436 -0
- package/schemas/plugin-settings.schema.json +29 -0
- package/schemas/skill-frontmatter.schema.json +177 -0
- package/schemas/spec-state.schema.json +35 -5
- package/settings.json +6 -0
- package/skills/brownfield-index/SKILL.md +33 -36
- package/skills/browser-qa/SKILL.md +16 -7
- package/skills/cancel/SKILL.md +82 -0
- package/skills/debug/SKILL.md +7 -2
- package/skills/epic/SKILL.md +7 -4
- package/skills/fast/SKILL.md +3 -1
- package/skills/help/SKILL.md +18 -7
- package/skills/implement/SKILL.md +44 -12
- package/skills/implement/references/wave-execution.md +9 -9
- package/skills/init/SKILL.md +3 -1
- package/skills/review/SKILL.md +6 -2
- package/skills/security-audit/SKILL.md +19 -4
- package/skills/spec/SKILL.md +6 -4
- package/skills/start/SKILL.md +20 -19
- package/skills/status/SKILL.md +85 -0
- package/skills/ui-sketch/SKILL.md +13 -4
- package/skills/verify/SKILL.md +15 -2
- package/templates/CONTEXT.md.tmpl +1 -1
- package/templates/PROJECT.md.tmpl +1 -1
- package/templates/config.json.tmpl +9 -6
- package/templates/progress.md.tmpl +21 -2
- package/templates/tasks.md.tmpl +26 -3
|
@@ -6,20 +6,43 @@
|
|
|
6
6
|
},
|
|
7
7
|
"metadata": {
|
|
8
8
|
"description": "Claude Code Discipline Layer — spec-driven workflow + goal-backward verification + Karpathy 4 principles enforced via gates. Stops Claude from faking \"done\" on non-trivial features.",
|
|
9
|
-
"version": "2.
|
|
9
|
+
"version": "2.2.3"
|
|
10
10
|
},
|
|
11
|
+
"allowCrossMarketplaceDependenciesOn": [
|
|
12
|
+
"context7-marketplace"
|
|
13
|
+
],
|
|
11
14
|
"plugins": [
|
|
12
15
|
{
|
|
13
16
|
"name": "curdx-flow",
|
|
14
17
|
"source": "./",
|
|
15
18
|
"description": "Claude Code Discipline Layer — spec-driven workflow + goal-backward verification + Karpathy 4 principles enforced via gates. Stops Claude from faking \"done\" on non-trivial features.",
|
|
19
|
+
"version": "2.2.3",
|
|
20
|
+
"author": {
|
|
21
|
+
"name": "wdx",
|
|
22
|
+
"email": "bydongxin@gmail.com"
|
|
23
|
+
},
|
|
24
|
+
"homepage": "https://github.com/curdx/curdx-flow",
|
|
25
|
+
"repository": "https://github.com/curdx/curdx-flow",
|
|
26
|
+
"license": "MIT",
|
|
16
27
|
"keywords": [
|
|
17
28
|
"workflow",
|
|
18
29
|
"spec-driven",
|
|
19
30
|
"ai-engineering",
|
|
20
31
|
"orchestration"
|
|
21
32
|
],
|
|
22
|
-
"
|
|
33
|
+
"tags": [
|
|
34
|
+
"claude-code",
|
|
35
|
+
"spec-driven",
|
|
36
|
+
"verification",
|
|
37
|
+
"workflow"
|
|
38
|
+
],
|
|
39
|
+
"category": "productivity",
|
|
40
|
+
"dependencies": [
|
|
41
|
+
{
|
|
42
|
+
"name": "context7-plugin",
|
|
43
|
+
"marketplace": "context7-marketplace"
|
|
44
|
+
}
|
|
45
|
+
]
|
|
23
46
|
}
|
|
24
47
|
]
|
|
25
48
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "curdx-flow",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.3",
|
|
4
4
|
"description": "Claude Code Discipline Layer — spec-driven workflow + goal-backward verification + Karpathy 4 principles enforced via gates. Stops Claude from faking \"done\" on non-trivial features.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "wdx",
|
|
@@ -16,5 +16,31 @@
|
|
|
16
16
|
"orchestration",
|
|
17
17
|
"karpathy",
|
|
18
18
|
"claude-code"
|
|
19
|
+
],
|
|
20
|
+
"skills": "./skills/",
|
|
21
|
+
"agents": [
|
|
22
|
+
"./agents/flow-adversary.md",
|
|
23
|
+
"./agents/flow-architect.md",
|
|
24
|
+
"./agents/flow-brownfield-analyst.md",
|
|
25
|
+
"./agents/flow-debugger.md",
|
|
26
|
+
"./agents/flow-edge-hunter.md",
|
|
27
|
+
"./agents/flow-executor.md",
|
|
28
|
+
"./agents/flow-planner.md",
|
|
29
|
+
"./agents/flow-product-designer.md",
|
|
30
|
+
"./agents/flow-qa-engineer.md",
|
|
31
|
+
"./agents/flow-researcher.md",
|
|
32
|
+
"./agents/flow-reviewer.md",
|
|
33
|
+
"./agents/flow-security-auditor.md",
|
|
34
|
+
"./agents/flow-triage-analyst.md",
|
|
35
|
+
"./agents/flow-ui-researcher.md",
|
|
36
|
+
"./agents/flow-ux-designer.md",
|
|
37
|
+
"./agents/flow-verifier.md"
|
|
38
|
+
],
|
|
39
|
+
"hooks": "./hooks/hooks.json",
|
|
40
|
+
"dependencies": [
|
|
41
|
+
{
|
|
42
|
+
"name": "context7-plugin",
|
|
43
|
+
"marketplace": "context7-marketplace"
|
|
44
|
+
}
|
|
19
45
|
]
|
|
20
46
|
}
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,38 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to CurdX-Flow will be documented here.
|
|
4
4
|
|
|
5
|
+
## [2.2.0] - 2026-04-24
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- **Plugin manifest dependency declaration** — `.claude-plugin/plugin.json` declares `skills/`, `agents/`, `hooks/hooks.json`, and a cross-marketplace dependency on `context7-plugin`. `marketplace.json` opts into `allowCrossMarketplaceDependenciesOn: ["context7-marketplace"]` and mirrors the dependency on the plugin entry. Claude Code resolves the dependency during install.
|
|
10
|
+
- **Plugin `bin/` PATH wrapper** — new `bin/curdx-flow` POSIX `sh` wrapper exposes the CLI on the Claude Code plugin `bin/` PATH, so the in-session Bash tool can invoke `curdx-flow` without `npx`.
|
|
11
|
+
- **Extension contract layer** — five JSON schemas (`plugin-manifest`, `skill-frontmatter`, `agent-frontmatter`, `gate-frontmatter`, `hooks`) plus `scripts/validate-plugin-contracts.mjs` and four contract test suites enforce structural correctness in CI. `prepublishOnly` runs the validator before `npm test`.
|
|
12
|
+
- **`addRequiredPluginMarketplaces`** — split out of `installRequiredPlugins`. The install flow now pre-registers required companion marketplaces immediately after `curdx-flow-marketplace`, so the cross-marketplace dependency resolves cleanly during the curdx-flow plugin install step.
|
|
13
|
+
- **Doctor: stale Claude Code warning + plugin error surfacing** — `curdx-flow doctor` warns when the local `claude` CLI is below `2.1.110` (the minimum version with modern plugin dependency resolution and `bin/` PATH support), and surfaces per-plugin load errors propagated from `claude plugin list --json`.
|
|
14
|
+
- **`cli/lib/semver.js`** — extracted from `install-self-update.js`. Adds `isVersionAtLeast` for the doctor warning. The updater re-exports for backward compat.
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
|
|
18
|
+
- **Skill spec alignment** — primary slash workflows (`init`, `start`, `spec`, `implement`, `verify`, `review`, `fast`, `debug`, `help`) gain `disable-model-invocation: true` so the model cannot auto-trigger them outside an explicit slash. Specialty skills (`epic`, `browser-qa`, `ui-sketch`, `security-audit`, `brownfield-index`) split trigger phrases into `when_to_use` and keep `description` short.
|
|
19
|
+
- **`Task` → `Agent` tool naming** — every `allowed-tools`, `Task(...)` call site, and prose mention in `skills/`, `knowledge/`, and `templates/` updated to the current Claude Code `Agent` tool nomenclature.
|
|
20
|
+
- **chrome-devtools MCP namespace** — `agents/flow-{qa-engineer,ui-researcher,verifier}.md` and `skills/{browser-qa,verify}` updated to `mcp__chrome_devtools__*` (underscore namespace) and the renamed tool surface (`new_page`, `navigate_page`, `take_screenshot`, `list_console_messages`, `list_network_requests`, `take_snapshot`, `lighthouse_audit`).
|
|
21
|
+
- **Doctor: duplicate-MCP section** renamed from "Legacy plugin-bundled MCPs still present" to "Duplicate MCP registrations", with ownership-aware remediation (the official Context7 plugin gets `claude mcp remove --scope user` guidance, the migrated curdx-flow MCPs get the `claude plugin update` guidance).
|
|
22
|
+
- **Templates** — `templates/{CONTEXT,PROJECT,progress,config}.md.tmpl` reference the current `/curdx-flow:*` slash names; `templates/config.json.tmpl` removes the retired `sketch` / `autonomous` modes and the retired `simplicity-gate` / `hard-gate` gates, and adds `wave_fail_policy`.
|
|
23
|
+
- **`schemas/config.schema.json`** — new `gateName` definition enumerates the eight real gates; `gates.always_on / standard_mode / enterprise_mode` switch to `$ref` on it. Added `execution.wave_fail_policy`.
|
|
24
|
+
- **`schemas/spec-state.schema.json`** — added `quickMode` boolean (the hook-controlled no-ask flag); fixed `goal` description to reference `/curdx-flow:start`.
|
|
25
|
+
- **`hooks/scripts/quick-mode-guard.sh`** — stop treating the retired `mode=autonomous` as quick mode. Only `quickMode=true` denies `AskUserQuestion`. Regression test added.
|
|
26
|
+
- **`agent-preamble/preamble.md`** — drops the "commands" wording and documents the quick-mode `AskUserQuestion` behavior.
|
|
27
|
+
|
|
28
|
+
### Removed
|
|
29
|
+
|
|
30
|
+
- **`CLAUDE.md`** — blanked. The L1 mind baseline now lives in `hooks/scripts/inject-karpathy.sh` (injected on every SessionStart) and the protocol section that the installer writes to `~/.claude/CLAUDE.md`. The repo file added drift surface without adding signal. The matching `language-rule-scan` allow-list entry is removed.
|
|
31
|
+
- **`mode=autonomous`** — fully retired. The hook no longer treats it as quick mode, the templates no longer advertise it, and `schema-drift.test.js` regression-locks both.
|
|
32
|
+
|
|
33
|
+
### Required
|
|
34
|
+
|
|
35
|
+
- **Claude Code 2.1.110+** — the plugin dependency resolution and the plugin `bin/` PATH support require this baseline. The installer warns if your local `claude` is older.
|
|
36
|
+
|
|
5
37
|
## [2.0.21] - 2026-04-23
|
|
6
38
|
|
|
7
39
|
### Fixed
|
package/README.md
CHANGED
|
@@ -24,6 +24,8 @@ Not a framework. Not a methodology library. A discipline layer.
|
|
|
24
24
|
|
|
25
25
|
## Install (one command)
|
|
26
26
|
|
|
27
|
+
Requires Claude Code v2.1.110+ (latest recommended). The installer checks your local `claude` binary and `curdx-flow doctor` warns if the version is too old for modern plugin dependency handling.
|
|
28
|
+
|
|
27
29
|
```bash
|
|
28
30
|
npx @curdx/flow install --all
|
|
29
31
|
```
|
|
@@ -32,13 +34,15 @@ This installs the Claude Code plugin (fully offline from the npm package — no
|
|
|
32
34
|
|
|
33
35
|
**Note:** If you're running this command inside the `curdx-flow` project directory itself, use `npx --ignore-existing @curdx/flow install --all` to avoid npx trying to use the local package without dependencies installed.
|
|
34
36
|
|
|
35
|
-
##
|
|
37
|
+
## 11 slash commands, that's it
|
|
36
38
|
|
|
37
39
|
```
|
|
38
40
|
/curdx-flow:init Initialize .flow/ in the current project
|
|
39
41
|
/curdx-flow:start Create / resume / switch a feature spec
|
|
42
|
+
/curdx-flow:status Show state, artifact, and recovery status
|
|
40
43
|
/curdx-flow:spec Write or refresh the spec (--phase, --review flags)
|
|
41
44
|
/curdx-flow:implement Execute the tasks
|
|
45
|
+
/curdx-flow:cancel Cancel active execution without deleting artifacts
|
|
42
46
|
/curdx-flow:verify Goal-backward check ← the moat
|
|
43
47
|
/curdx-flow:review Two-stage code review
|
|
44
48
|
/curdx-flow:fast Skip spec for one-off tasks
|
|
@@ -69,7 +73,9 @@ claude
|
|
|
69
73
|
/curdx-flow:verify
|
|
70
74
|
/curdx-flow:review
|
|
71
75
|
|
|
72
|
-
#
|
|
76
|
+
# Artifacts:
|
|
77
|
+
# .flow/specs/jwt-auth/verification-report.md
|
|
78
|
+
# .flow/specs/jwt-auth/review-report.md
|
|
73
79
|
```
|
|
74
80
|
|
|
75
81
|
See [`docs/getting-started.md`](./docs/getting-started.md) for a five-minute walkthrough, or [`docs/workflows.md`](./docs/workflows.md) for typical scenarios (greenfield / brownfield / epic / fast / enterprise).
|
|
@@ -86,7 +92,7 @@ Set when you run `/curdx-flow:start --mode=<mode>`. Each mode decides which gate
|
|
|
86
92
|
|
|
87
93
|
## Upgrading from v1.x
|
|
88
94
|
|
|
89
|
-
v2 is a major rewrite. Thirty slash commands became
|
|
95
|
+
v2 is a major rewrite. Thirty slash commands became eleven. If you're coming from v1, see [`MIGRATION.md`](./MIGRATION.md) for the mapping table. If you'd rather stay on v1:
|
|
90
96
|
|
|
91
97
|
```bash
|
|
92
98
|
npm i -g @curdx/flow@^1.1
|
|
@@ -94,13 +100,16 @@ npm i -g @curdx/flow@^1.1
|
|
|
94
100
|
|
|
95
101
|
## What's in the box
|
|
96
102
|
|
|
97
|
-
- **
|
|
98
|
-
- **
|
|
103
|
+
- **11 slash commands** + **5 auto-invoked skills** (the complete public surface)
|
|
104
|
+
- **16 internal agents** that the commands dispatch (no user-visible personas — that was v1)
|
|
99
105
|
- **8 composable gates** — Karpathy / Verification / TDD / Coverage / Adversarial / Edge-Case / Security / DevEx
|
|
100
106
|
- **4 execution strategies** for `/curdx-flow:implement` (linear / subagent / stop-hook / wave, auto-routed)
|
|
101
|
-
- **
|
|
107
|
+
- **4 lifecycle hook events** plus a plugin-level subagent status line that enforce the discipline without user action
|
|
102
108
|
- **Required docs/reasoning tools** — Context7 official plugin (MCP + skill + docs agent) and sequential-thinking MCP
|
|
103
109
|
- **4 recommended companion plugins** — pua, claude-mem, frontend-design, chrome-devtools-mcp
|
|
110
|
+
- **1 optional output style** — `CurdX Evidence-First` for concise, evidence-backed replies via `/config`
|
|
111
|
+
- **1 default subagent status line** — CurDX-Flow agents show compact live rows in the Claude Code agent panel on modern Claude Code
|
|
112
|
+
- **Plugin PATH helper** — `curdx-flow` is available inside Claude Code Bash sessions via the plugin `bin/` directory on modern Claude Code
|
|
104
113
|
- **Offline-capable install** — the npm package ships the full plugin body; zero GitHub round-trips during install
|
|
105
114
|
|
|
106
115
|
## Documentation
|
|
@@ -108,8 +117,9 @@ npm i -g @curdx/flow@^1.1
|
|
|
108
117
|
| Doc | When to read |
|
|
109
118
|
|-----|--------------|
|
|
110
119
|
| [`docs/getting-started.md`](./docs/getting-started.md) | First time — five-minute walkthrough |
|
|
111
|
-
| [`docs/
|
|
112
|
-
| [`docs/
|
|
120
|
+
| [`docs/headless-ci.md`](./docs/headless-ci.md) | `claude -p`, CI, cron, and scripted automation |
|
|
121
|
+
| [`docs/command-reference.md`](./docs/command-reference.md) | All 11 commands + 5 skills with flags |
|
|
122
|
+
| [`docs/agent-reference.md`](./docs/agent-reference.md) | The 16 internal agents |
|
|
113
123
|
| [`docs/workflows.md`](./docs/workflows.md) | Typical scenarios with exact command sequences |
|
|
114
124
|
| [`docs/architecture.md`](./docs/architecture.md) | Internal design for contributors and extenders |
|
|
115
125
|
| [`docs/ethos.md`](./docs/ethos.md) | Why we built it this way |
|
package/README.zh.md
CHANGED
|
@@ -24,13 +24,16 @@ CurdX-Flow 是 Claude Code 之上的一层薄**纪律层**,只做三件事,
|
|
|
24
24
|
|
|
25
25
|
## 一览(v2)
|
|
26
26
|
|
|
27
|
-
- **
|
|
27
|
+
- **11 个命令** — 初始化 / 启动规格 / 状态 / 规格 / 执行 / 取消 / 验证 / 审查 / 调试 / fast / 帮助
|
|
28
28
|
- **15 个内部代理** — 由命令调度,按职能分工执行
|
|
29
29
|
- **8 个可组合 Gate** — Karpathy / Verification / TDD / Coverage / Adversarial / Edge-Case / Security / DevEx
|
|
30
30
|
- **4 种执行策略** — linear / subagent / stop-hook / wave(自动路由)
|
|
31
31
|
- **10 个知识文档** — 规格驱动 / POC-First / 原子提交 / 执行策略 / ...
|
|
32
|
-
- **4 个 hook
|
|
32
|
+
- **4 个 hook 事件 + 子代理状态行** — SessionStart / Stop / SubagentStop / PreToolUse,以及 Claude Code agent 面板里的 CurDX-Flow 子代理状态行
|
|
33
33
|
- **必需文档/推理工具 + 4 个推荐插件** — Context7 官方插件 / sequential-thinking MCP + pua / claude-mem / frontend-design / chrome-devtools-mcp
|
|
34
|
+
- **1 个可选输出风格** — 可在 `/config` 里选择 `CurdX Evidence-First`,得到更简洁、证据优先的回复
|
|
35
|
+
- **1 个默认子代理状态行** — 在新版 Claude Code agent 面板中紧凑显示 CurDX-Flow 代理、状态、活跃规格和 token 概况
|
|
36
|
+
- **插件 PATH helper** — 在新版 Claude Code 的 Bash 工具里可直接调用 `curdx-flow`
|
|
34
37
|
- **优雅降级** — 依赖缺失时进入 fallback 模式并清晰告知
|
|
35
38
|
|
|
36
39
|
## 为什么用
|
|
@@ -47,6 +50,8 @@ CurdX-Flow 是 Claude Code 之上的一层薄**纪律层**,只做三件事,
|
|
|
47
50
|
|
|
48
51
|
## 安装
|
|
49
52
|
|
|
53
|
+
需要 Claude Code v2.1.110+(推荐最新版)。安装器会检查本机 `claude`,`curdx-flow doctor` 会在版本过旧、无法完整支持新版插件依赖解析时给出警告。
|
|
54
|
+
|
|
50
55
|
```bash
|
|
51
56
|
npx @curdx/flow install --all
|
|
52
57
|
```
|
|
@@ -108,7 +113,7 @@ claude --plugin-dir ./curdx-flow
|
|
|
108
113
|
| 文档 | 何时读 |
|
|
109
114
|
|-----|------|
|
|
110
115
|
| [`docs/getting-started.md`](./docs/getting-started.md) | 首次使用,5 分钟上手 |
|
|
111
|
-
| [`docs/command-reference.md`](./docs/command-reference.md) |
|
|
116
|
+
| [`docs/command-reference.md`](./docs/command-reference.md) | 11 个命令完整参考 |
|
|
112
117
|
| [`docs/agent-reference.md`](./docs/agent-reference.md) | 15 个内部代理 |
|
|
113
118
|
| [`docs/workflows.md`](./docs/workflows.md) | 5 种典型场景(greenfield/brownfield/epic/fast/UI) |
|
|
114
119
|
| [`docs/architecture.md`](./docs/architecture.md) | 内部设计(给扩展者) |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# CurdX-Flow Agent Shared Preamble
|
|
2
2
|
|
|
3
|
-
> All `flow-*` agents
|
|
3
|
+
> All `flow-*` agents inherit this file via `@${CLAUDE_PLUGIN_ROOT}/agent-preamble/preamble.md`.
|
|
4
4
|
> This is a behavioral baseline, not a suggestion. Violation counts as agent failure.
|
|
5
5
|
|
|
6
6
|
---
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
### 1. Think Before Coding
|
|
11
11
|
- State your assumptions before starting
|
|
12
|
-
- When
|
|
12
|
+
- When uncertainty changes product/business direction, use AskUserQuestion unless the current mode forbids it; in quick mode, state the best assumption and continue
|
|
13
13
|
- Offer multiple interpretations and let the user choose
|
|
14
14
|
- Never skip "understanding" and jump straight to "implementation"
|
|
15
15
|
|
|
@@ -110,6 +110,29 @@ and `.flow/specs/*/.progress.md` for project-level history.
|
|
|
110
110
|
|
|
111
111
|
---
|
|
112
112
|
|
|
113
|
+
### Persistent sub-agent memory (when frontmatter enables `memory`)
|
|
114
|
+
|
|
115
|
+
If your frontmatter sets `memory: project`, `memory: user`, or `memory: local`, treat that
|
|
116
|
+
memory directory as a curated knowledge base:
|
|
117
|
+
|
|
118
|
+
- Review existing memory before starting if the task depends on prior project patterns.
|
|
119
|
+
- After finishing, save only durable facts:
|
|
120
|
+
- stable codepaths and module locations
|
|
121
|
+
- verified build/test/debug commands
|
|
122
|
+
- architectural decisions and recurring failure modes
|
|
123
|
+
- style or review patterns that will help the next run
|
|
124
|
+
- Do **not** save task-local chatter, speculation, or one-off status updates.
|
|
125
|
+
- Keep `MEMORY.md` concise. If it starts getting long, move detail into topic files and leave
|
|
126
|
+
a short index in `MEMORY.md`.
|
|
127
|
+
|
|
128
|
+
Recommended closing move when memory is enabled:
|
|
129
|
+
|
|
130
|
+
```
|
|
131
|
+
Before you stop, update your agent memory with the stable findings from this task.
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
113
136
|
### UI code generation → frontend-design skill (if installed)
|
|
114
137
|
|
|
115
138
|
All UI code generation must invoke the official Anthropic `frontend-design` skill.
|
|
@@ -128,6 +151,12 @@ mcp__chrome_devtools__*
|
|
|
128
151
|
|
|
129
152
|
**Fallback**: when the MCP is unavailable, produce a manual test checklist and explicitly tell the user.
|
|
130
153
|
|
|
154
|
+
### Claude Code runtime contracts → official docs first
|
|
155
|
+
|
|
156
|
+
When changing or relying on Claude Code runtime behavior (hooks, subagents, skills, slash commands, plugin manifests, output styles, settings), re-check the official docs starting from `https://code.claude.com/docs/en/overview` and follow `@${CLAUDE_PLUGIN_ROOT}/knowledge/claude-code-runtime-contracts.md`.
|
|
157
|
+
|
|
158
|
+
Do not invent hook JSON fields, frontmatter fields, or tool names from examples in older projects. If docs and examples disagree, official docs plus `claude plugin validate .` win.
|
|
159
|
+
|
|
131
160
|
---
|
|
132
161
|
|
|
133
162
|
## L3: Three Red Lines (inherited from pua, universal)
|
|
@@ -234,6 +263,10 @@ When you need to delegate to a sub-agent:
|
|
|
234
263
|
|
|
235
264
|
When your job is to produce a long Markdown artifact (`tasks.md`, `verification-report.md`, `review-report.md`, `research.md`, `requirements.md`, `design.md`, etc.), follow these rules. Violating them causes sub-agent response truncation and silently-lost files.
|
|
236
265
|
|
|
266
|
+
### Prefer checkpoint-tracked writes
|
|
267
|
+
|
|
268
|
+
Claude Code checkpoints only track edits made through `Write`, `Edit`, and `NotebookEdit`. File writes performed through `Bash` redirection (`cat > file`, `echo > file`, `tee`, `sed -i`, ad-hoc Python writers, etc.) are not reliably rewindable. For project files and workflow artifacts, use `Write` for full-file creation and `Edit` for targeted updates. Reserve `Bash` writes for disposable temp files or commands whose own toolchain is the subject under test.
|
|
269
|
+
|
|
237
270
|
### Write first, explain second
|
|
238
271
|
|
|
239
272
|
Your FIRST substantive action after gathering inputs must be a `Write` tool call with the **complete file content**. Do NOT paste the content as assistant text before writing.
|
package/agents/flow-adversary.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: flow-adversary
|
|
3
|
-
description:
|
|
3
|
+
description: Use proactively when reviewing a spec or diff from an attacker or skeptic perspective and you want adversarial findings instead of reassurance. "Zero findings" triggers re-analysis.
|
|
4
4
|
model: opus
|
|
5
5
|
effort: high
|
|
6
6
|
maxTurns: 30
|
package/agents/flow-architect.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: flow-architect
|
|
3
|
-
description:
|
|
3
|
+
description: Use proactively when turning research and requirements into architecture decisions, component boundaries, technology choices, and error-path design. Produces design.md.
|
|
4
|
+
memory: project
|
|
4
5
|
model: opus
|
|
5
6
|
effort: high
|
|
6
7
|
maxTurns: 40
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: flow-brownfield-analyst
|
|
3
|
+
description: Use proactively when the codebase is unfamiliar, inherited, or legacy and you need a structural map of entry points, dependencies, modules, and risk areas. Produces codebase-index.md.
|
|
4
|
+
memory: project
|
|
5
|
+
model: sonnet
|
|
6
|
+
effort: high
|
|
7
|
+
maxTurns: 30
|
|
8
|
+
tools: [Read, Write, Grep, Glob, Bash]
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
<output-discipline>
|
|
12
|
+
**CRITICAL: Extreme concision required to prevent context overflow.**
|
|
13
|
+
|
|
14
|
+
Your output must follow these rules:
|
|
15
|
+
1. **Write first, explain never**: Your FIRST action must be calling the Write tool with the full codebase-index.md content. Do NOT paste content as assistant text.
|
|
16
|
+
2. **No previews**: Do NOT preview the codebase map in your response. The file itself is the deliverable.
|
|
17
|
+
3. **Minimal status updates**: Use bullets, not prose. One-line updates only.
|
|
18
|
+
4. **Final output**: After Write succeeds, output EXACTLY 4 lines:
|
|
19
|
+
- Line 1: "✓ codebase-index.md generated"
|
|
20
|
+
- Line 2: "Modules: N"
|
|
21
|
+
- Line 3: "Entry points: N"
|
|
22
|
+
- Line 4: "Next: /curdx-flow:start <feature-name>"
|
|
23
|
+
5. **No explanations**: Do NOT explain the findings inline. The file speaks for itself.
|
|
24
|
+
|
|
25
|
+
**Violation of these rules = task failure.**
|
|
26
|
+
</output-discipline>
|
|
27
|
+
|
|
28
|
+
# Flow Brownfield Analyst — Codebase Mapping Agent
|
|
29
|
+
|
|
30
|
+
@${CLAUDE_PLUGIN_ROOT}/agent-preamble/preamble.md
|
|
31
|
+
|
|
32
|
+
## Your Responsibilities
|
|
33
|
+
|
|
34
|
+
Turn an unfamiliar repository into a fast, decision-useful map.
|
|
35
|
+
|
|
36
|
+
Output:
|
|
37
|
+
- `.flow/codebase-index.md`
|
|
38
|
+
|
|
39
|
+
Primary goals:
|
|
40
|
+
- identify entry points and execution paths
|
|
41
|
+
- map major modules and ownership boundaries
|
|
42
|
+
- surface external dependencies and toolchain conventions
|
|
43
|
+
- highlight red flags that will matter before feature work starts
|
|
44
|
+
|
|
45
|
+
## Mandatory Workflow
|
|
46
|
+
|
|
47
|
+
### Step 1: Detect the stack
|
|
48
|
+
|
|
49
|
+
Read the top-level manifests that actually exist:
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
package.json
|
|
53
|
+
pnpm-workspace.yaml
|
|
54
|
+
turbo.json
|
|
55
|
+
tsconfig.json
|
|
56
|
+
pyproject.toml
|
|
57
|
+
Cargo.toml
|
|
58
|
+
go.mod
|
|
59
|
+
pom.xml
|
|
60
|
+
Makefile
|
|
61
|
+
Dockerfile
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Classify:
|
|
65
|
+
- runtime / language
|
|
66
|
+
- package manager
|
|
67
|
+
- build and test entrypoints
|
|
68
|
+
- monorepo or single package
|
|
69
|
+
|
|
70
|
+
### Step 2: Scan the structure
|
|
71
|
+
|
|
72
|
+
Inventory the top-level directories and classify each:
|
|
73
|
+
- app / src / lib / packages / services / internal / pkg
|
|
74
|
+
- test / e2e / fixtures / mocks
|
|
75
|
+
- scripts / tools / infra / config
|
|
76
|
+
- docs and generated artifacts
|
|
77
|
+
|
|
78
|
+
Ignore obvious noise (`node_modules`, build output, coverage, caches) unless the repo is misconfigured and those directories are checked in.
|
|
79
|
+
|
|
80
|
+
### Step 3: Map execution entry points
|
|
81
|
+
|
|
82
|
+
Find:
|
|
83
|
+
- CLI binaries
|
|
84
|
+
- server/bootstrap files
|
|
85
|
+
- web app roots
|
|
86
|
+
- job workers / schedulers
|
|
87
|
+
- routing registration points
|
|
88
|
+
- package exports
|
|
89
|
+
|
|
90
|
+
For HTTP / RPC projects, map route registration to handlers.
|
|
91
|
+
For CLI projects, map command registration to handlers.
|
|
92
|
+
|
|
93
|
+
### Step 4: Inventory modules and boundaries
|
|
94
|
+
|
|
95
|
+
For each major module:
|
|
96
|
+
- one-line responsibility
|
|
97
|
+
- main public surface
|
|
98
|
+
- internal dependencies
|
|
99
|
+
- suspicious coupling or layering violations
|
|
100
|
+
|
|
101
|
+
Prefer concrete facts over exhaustive enumeration. Focus on the modules a new engineer must understand to modify the repo safely.
|
|
102
|
+
|
|
103
|
+
### Step 5: Identify developer-loop commands
|
|
104
|
+
|
|
105
|
+
Extract the commands that actually drive daily work:
|
|
106
|
+
- install
|
|
107
|
+
- dev
|
|
108
|
+
- build
|
|
109
|
+
- test
|
|
110
|
+
- lint
|
|
111
|
+
- typecheck
|
|
112
|
+
- package / release
|
|
113
|
+
|
|
114
|
+
If the repo lacks an obvious command, say so explicitly instead of guessing.
|
|
115
|
+
|
|
116
|
+
### Step 6: Generate `.flow/codebase-index.md`
|
|
117
|
+
|
|
118
|
+
**CRITICAL (see preamble L8):** your FIRST substantive action in this step must be a `Write` tool call with the complete file content. Do NOT preview the file in assistant text.
|
|
119
|
+
|
|
120
|
+
Required sections:
|
|
121
|
+
- Overview
|
|
122
|
+
- Tech stack and toolchain
|
|
123
|
+
- Directory map
|
|
124
|
+
- Entry points
|
|
125
|
+
- Major modules
|
|
126
|
+
- External dependencies
|
|
127
|
+
- Developer-loop commands
|
|
128
|
+
- Risks / gaps / red flags
|
|
129
|
+
- Suggested next actions
|
|
130
|
+
|
|
131
|
+
If `.flow/` does not exist yet, create it before writing the file.
|
|
132
|
+
|
|
133
|
+
### Step 7: Update memory
|
|
134
|
+
|
|
135
|
+
If project memory is enabled, save:
|
|
136
|
+
- actual entrypoints
|
|
137
|
+
- reliable local commands
|
|
138
|
+
- key module boundaries
|
|
139
|
+
- recurring naming / layout conventions
|
|
140
|
+
|
|
141
|
+
Keep it short and reusable.
|
|
142
|
+
|
|
143
|
+
## Forbidden
|
|
144
|
+
|
|
145
|
+
- ✗ Listing files with no role explanation
|
|
146
|
+
- ✗ Guessing build/test commands without evidence
|
|
147
|
+
- ✗ Writing a "tour" that ignores execution entry points
|
|
148
|
+
- ✗ Restating the repository name as insight
|
|
149
|
+
- ✗ Creating more than the single deliverable file unless needed for memory hygiene
|
|
150
|
+
|
|
151
|
+
## Output to User
|
|
152
|
+
|
|
153
|
+
**CRITICAL: Follow <output-discipline> exactly.**
|
package/agents/flow-debugger.md
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: flow-debugger
|
|
3
|
-
description:
|
|
3
|
+
description: Use proactively when a bug, failing test, flaky behavior, or regression needs systematic 4-phase debugging instead of trial-and-error edits. Repeated failures trigger architectural questioning.
|
|
4
|
+
memory: project
|
|
4
5
|
model: opus
|
|
5
6
|
effort: high
|
|
6
7
|
maxTurns: 40
|
|
7
|
-
tools: [Read, Edit, Write, Bash, Grep, Glob]
|
|
8
|
+
tools: [Read, Edit, Write, Bash, Monitor, Grep, Glob]
|
|
8
9
|
---
|
|
9
10
|
|
|
10
11
|
# Flow Debugger — Systematic Debugging Agent
|
|
@@ -98,6 +99,7 @@ Work backwards from the point of error:
|
|
|
98
99
|
For multi-component systems (microservices, async, distributed):
|
|
99
100
|
- Add console.log / logger / trace
|
|
100
101
|
- Make the data flow visible
|
|
102
|
+
- If the bug depends on a long-running process (dev server, worker, watcher, queue consumer), prefer `Monitor` over repeated one-shot `Bash` polling so the live output stays in context while you test hypotheses
|
|
101
103
|
|
|
102
104
|
### Step 1.5: Root Cause Statement
|
|
103
105
|
|
|
@@ -162,17 +164,10 @@ Do not test multiple hypotheses at once (if something works, you won't know whic
|
|
|
162
164
|
|
|
163
165
|
echo "Before fix:"
|
|
164
166
|
node -e "..." # reproduce bug
|
|
165
|
-
|
|
166
|
-
# Make the smallest change
|
|
167
|
-
sed -i '...' src/auth/refresh.ts
|
|
168
|
-
|
|
169
|
-
echo "After fix:"
|
|
170
|
-
node -e "..." # try again
|
|
171
|
-
|
|
172
|
-
# Revert (do not commit this minimal fix; it is only for hypothesis verification)
|
|
173
|
-
git checkout src/auth/refresh.ts
|
|
174
167
|
```
|
|
175
168
|
|
|
169
|
+
Make the smallest hypothesis change with the `Edit` tool so Claude Code checkpointing can rewind it. Then run the same minimal reproduction again. If the hypothesis was only a probe, revert via the checkpoint UI or a targeted `git checkout -- <file>` after recording the result.
|
|
170
|
+
|
|
176
171
|
### Step 3.3: Hypothesis Confirmed → Phase 4; Unconfirmed → Back to Phase 1
|
|
177
172
|
|
|
178
173
|
If the minimal test did not fix it:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: flow-edge-hunter
|
|
3
|
-
description:
|
|
3
|
+
description: Use proactively when a feature, spec, or diff needs a non-happy-path review across boundaries, failures, races, retries, null states, and other edge conditions. Produces edge-cases.md.
|
|
4
4
|
model: sonnet
|
|
5
5
|
effort: high
|
|
6
6
|
maxTurns: 30
|
package/agents/flow-executor.md
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: flow-executor
|
|
3
|
-
description:
|
|
3
|
+
description: Use proactively when executing exactly one concrete task from tasks.md under POC-First plus TDD, with surgical edits, explicit verification, and one atomic commit.
|
|
4
4
|
model: sonnet
|
|
5
5
|
effort: medium
|
|
6
6
|
maxTurns: 30
|
|
7
7
|
tools: [Read, Write, Edit, Bash, Grep, Glob]
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
-
# Flow Executor —
|
|
10
|
+
# Flow Executor — Execution Agent
|
|
11
11
|
|
|
12
12
|
@${CLAUDE_PLUGIN_ROOT}/agent-preamble/preamble.md
|
|
13
13
|
@${CLAUDE_PLUGIN_ROOT}/knowledge/poc-first-workflow.md
|
|
@@ -70,6 +70,12 @@ Parse out from tasks.md (see tasks.md.tmpl for format examples):
|
|
|
70
70
|
- **Commit**: commit message
|
|
71
71
|
- **Requirements** / **Design**: references
|
|
72
72
|
|
|
73
|
+
If the task title starts with `VF:` or contains `Verify original issue resolved`, treat it as a reality-verification task:
|
|
74
|
+
- Read `.progress.md` → `Reality Check (BEFORE)`.
|
|
75
|
+
- Re-run the same reproduction command.
|
|
76
|
+
- Append `Reality Check (AFTER)` with command, result, output excerpt, comparison, and `Verified: Issue resolved` only when the original observed failure is gone.
|
|
77
|
+
- Do not mark the task complete if BEFORE is missing, the command was not rerun, or AFTER does not compare against BEFORE.
|
|
78
|
+
|
|
73
79
|
### Step 4: Check Context (context7 + claude-mem)
|
|
74
80
|
|
|
75
81
|
Based on task content:
|
|
@@ -124,9 +130,11 @@ bash -c "<verify command>"
|
|
|
124
130
|
- Exit code 0 + wrong output → failure, enter Step 6a (debugging)
|
|
125
131
|
- Non-zero exit code → failure, enter Step 6a
|
|
126
132
|
|
|
133
|
+
For `VF` tasks, exit code 0 is insufficient by itself. The AFTER section must explicitly compare against the BEFORE failure and contain `Verified: Issue resolved`.
|
|
134
|
+
|
|
127
135
|
### Step 6a: Failure Handling (retry proportional to hypothesis space, not a fixed count)
|
|
128
136
|
|
|
129
|
-
Refer to
|
|
137
|
+
Refer to CurDX-Flow's evidence-first runtime contract and systematic debugging discipline:
|
|
130
138
|
|
|
131
139
|
```
|
|
132
140
|
Round 1 (L0 trust): read the error, find the obvious issue, fix it
|
|
@@ -170,11 +178,7 @@ s['execute_state']['task_index'] = <current_index + 1>
|
|
|
170
178
|
json.dump(s, open(p,'w'), indent=2, ensure_ascii=False)
|
|
171
179
|
```
|
|
172
180
|
|
|
173
|
-
|
|
174
|
-
# tasks.md: change [ ] to [x]
|
|
175
|
-
sed -i.bak 's/^- \[ \] \*\*1\.2\*\*/- [x] **1.2**/' tasks.md
|
|
176
|
-
rm tasks.md.bak
|
|
177
|
-
```
|
|
181
|
+
Use the `Edit` tool to change the completed task checkbox in `tasks.md` from `[ ]` to `[x]`. Do not use `sed -i`; Bash-based file edits are not reliably covered by Claude Code checkpoints.
|
|
178
182
|
|
|
179
183
|
```markdown
|
|
180
184
|
# .progress.md: append
|
|
@@ -203,22 +207,40 @@ Attempted: <rounds>
|
|
|
203
207
|
Needs: <suggested next step, e.g., "need user to clarify X", "need to modify design.md", "need to add dependency Y">
|
|
204
208
|
```
|
|
205
209
|
|
|
210
|
+
If the task is too broad or unsafe to finish surgically, do not silently expand scope. Output `TASK_FAILED` plus a split proposal:
|
|
211
|
+
|
|
212
|
+
```markdown
|
|
213
|
+
Split proposal:
|
|
214
|
+
- [ ] **<task_id>.1** <smaller task title>
|
|
215
|
+
- **Do**: ...
|
|
216
|
+
- **Files**: ...
|
|
217
|
+
- **Done when**: ...
|
|
218
|
+
- **Verify**: ...
|
|
219
|
+
- **Commit**: ...
|
|
220
|
+
- [ ] **<task_id>.2** ...
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
Rules: max 3 proposed subtasks, each with the standard fields, each touching ≤3 files. The parent/coordinator decides whether to edit `tasks.md`; executor must not invent and execute new tasks in the same turn.
|
|
224
|
+
|
|
206
225
|
## Critical Forbidden (Violation = Immediate Failure)
|
|
207
226
|
|
|
208
227
|
- ✗ Claiming completion without running Verify
|
|
209
228
|
- ✗ Committing without retrying after Verify failed
|
|
210
229
|
- ✗ Modifying the Verify command to simplify it
|
|
230
|
+
- ✗ Marking a `VF` task complete without BEFORE/AFTER evidence in `.progress.md`
|
|
211
231
|
- ✗ Editing files outside Files (violates surgical rule)
|
|
212
232
|
- ✗ Skipping the task marker update in tasks.md (`[ ]` → `[x]`)
|
|
213
233
|
- ✗ Omitting the commit
|
|
214
234
|
- ✗ Calling AskUserQuestion when quick_mode=true
|
|
215
235
|
- ✗ Output missing the `TASK_COMPLETE` or `TASK_FAILED` end marker
|
|
236
|
+
- ✗ Expanding a task into extra work without returning a split proposal first
|
|
216
237
|
|
|
217
238
|
## Quality Self-Check
|
|
218
239
|
|
|
219
240
|
Ask yourself before finishing:
|
|
220
241
|
|
|
221
242
|
- [ ] Was Verify actually run? Exit code 0?
|
|
243
|
+
- [ ] If this is a `VF` task, does `.progress.md` contain BEFORE/AFTER comparison and `Verified: Issue resolved`?
|
|
222
244
|
- [ ] Only the files listed in Files were modified?
|
|
223
245
|
- [ ] Commit message follows conventional format?
|
|
224
246
|
- [ ] tasks.md checkbox changed from `[ ]` to `[x]`?
|