@curdx/flow 1.1.11 → 2.0.0-beta.10
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 -3
- package/.claude-plugin/plugin.json +4 -11
- package/CHANGELOG.md +99 -0
- package/README.md +74 -102
- package/README.zh.md +2 -2
- package/agent-preamble/preamble.md +81 -11
- package/agents/flow-adversary.md +41 -56
- package/agents/flow-architect.md +24 -11
- package/agents/flow-debugger.md +2 -2
- package/agents/flow-edge-hunter.md +20 -6
- package/agents/flow-executor.md +3 -3
- package/agents/flow-planner.md +51 -48
- package/agents/flow-product-designer.md +15 -2
- package/agents/flow-qa-engineer.md +4 -4
- package/agents/flow-researcher.md +18 -3
- package/agents/flow-reviewer.md +5 -1
- package/agents/flow-security-auditor.md +2 -2
- package/agents/flow-triage-analyst.md +4 -4
- package/agents/flow-ui-researcher.md +7 -7
- package/agents/flow-ux-designer.md +3 -3
- package/agents/flow-verifier.md +47 -14
- package/bin/curdx-flow.js +13 -1
- package/cli/doctor.js +28 -13
- package/cli/install.js +62 -36
- package/cli/protocols.js +63 -10
- package/cli/registry.js +73 -0
- package/cli/uninstall.js +9 -11
- package/cli/upgrade.js +6 -10
- package/cli/utils.js +104 -56
- package/commands/debug.md +10 -10
- package/commands/fast.md +1 -1
- package/commands/help.md +109 -87
- package/commands/implement.md +7 -7
- package/commands/init.md +18 -7
- package/commands/review.md +114 -130
- package/commands/spec.md +131 -89
- package/commands/start.md +130 -153
- package/commands/verify.md +110 -92
- package/gates/adversarial-review-gate.md +20 -20
- package/gates/coverage-audit-gate.md +1 -1
- package/gates/devex-gate.md +5 -6
- package/gates/edge-case-gate.md +2 -2
- package/gates/security-gate.md +3 -3
- package/hooks/hooks.json +0 -11
- package/hooks/scripts/quick-mode-guard.sh +12 -9
- package/hooks/scripts/session-start.sh +2 -2
- package/hooks/scripts/stop-watcher.sh +25 -15
- package/knowledge/epic-decomposition.md +2 -2
- package/knowledge/execution-strategies.md +10 -9
- package/knowledge/planning-reviews.md +6 -6
- package/knowledge/spec-driven-development.md +11 -10
- package/knowledge/two-stage-review.md +6 -5
- package/knowledge/wave-execution.md +5 -5
- package/package.json +4 -2
- package/skills/brownfield-index/SKILL.md +62 -0
- package/skills/browser-qa/SKILL.md +50 -0
- package/skills/epic/SKILL.md +68 -0
- package/skills/security-audit/SKILL.md +50 -0
- package/skills/ui-sketch/SKILL.md +49 -0
- package/templates/config.json.tmpl +1 -1
- package/templates/design.md.tmpl +32 -112
- package/templates/requirements.md.tmpl +25 -43
- package/templates/research.md.tmpl +37 -68
- package/templates/tasks.md.tmpl +27 -84
- package/agents/persona-amelia.md +0 -128
- package/agents/persona-david.md +0 -141
- package/agents/persona-emma.md +0 -179
- package/agents/persona-john.md +0 -105
- package/agents/persona-mary.md +0 -95
- package/agents/persona-oliver.md +0 -136
- package/agents/persona-rachel.md +0 -126
- package/agents/persona-serena.md +0 -175
- package/agents/persona-winston.md +0 -117
- package/commands/audit.md +0 -170
- package/commands/autoplan.md +0 -184
- package/commands/design.md +0 -155
- package/commands/discuss.md +0 -162
- package/commands/doctor.md +0 -124
- package/commands/index.md +0 -261
- package/commands/install-deps.md +0 -128
- package/commands/party.md +0 -241
- package/commands/plan-ceo.md +0 -117
- package/commands/plan-design.md +0 -107
- package/commands/plan-dx.md +0 -104
- package/commands/plan-eng.md +0 -108
- package/commands/qa.md +0 -118
- package/commands/requirements.md +0 -146
- package/commands/research.md +0 -141
- package/commands/security.md +0 -109
- package/commands/sketch.md +0 -118
- package/commands/spike.md +0 -181
- package/commands/status.md +0 -139
- package/commands/switch.md +0 -95
- package/commands/tasks.md +0 -189
- package/commands/triage.md +0 -160
- package/hooks/scripts/fail-tracker.sh +0 -31
package/commands/discuss.md
DELETED
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: discuss
|
|
3
|
-
description: Pre-implementation discussion — capture the user's key decisions (D-NN) for the spec, written to .progress.md and STATE.md. Stop the AI from "silently assuming".
|
|
4
|
-
argument-hint: "[spec-name]"
|
|
5
|
-
allowed-tools: [Read, Write, Edit, AskUserQuestion, Bash]
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# Flow Discuss — Decision Locking
|
|
9
|
-
|
|
10
|
-
Before implementation, align with the user on **key decisions** (D-NN format) so the downstream implementer does not have to guess user preferences.
|
|
11
|
-
|
|
12
|
-
## When to use
|
|
13
|
-
|
|
14
|
-
- design is done but before tasks (freeze decisions into tasks)
|
|
15
|
-
- before implementation (give executor explicit guidance)
|
|
16
|
-
- user wants to adjust direction halfway through a spec (add decisions)
|
|
17
|
-
|
|
18
|
-
## Step 1: Prerequisites
|
|
19
|
-
|
|
20
|
-
```bash
|
|
21
|
-
SPEC_NAME="${ARGUMENTS:-$(cat .flow/.active-spec 2>/dev/null)}"
|
|
22
|
-
[ -z "$SPEC_NAME" ] && { echo "❌ No active spec"; exit 1; }
|
|
23
|
-
|
|
24
|
-
DIR=".flow/specs/$SPEC_NAME"
|
|
25
|
-
[ ! -f "$DIR/design.md" ] && { echo "❌ Missing design.md. Run /curdx-flow:design first"; exit 1; }
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
## Step 2: Identify open decisions
|
|
29
|
-
|
|
30
|
-
Read the open questions in design.md + requirements.md:
|
|
31
|
-
|
|
32
|
-
```bash
|
|
33
|
-
# Find open-questions sections in design / requirements
|
|
34
|
-
sed -n '/## Open Questions/,/^##/p' "$DIR/design.md" 2>/dev/null
|
|
35
|
-
sed -n '/## Open Questions/,/^##/p' "$DIR/requirements.md" 2>/dev/null
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
Also scan unresolved TODO / FIXME:
|
|
39
|
-
|
|
40
|
-
```bash
|
|
41
|
-
grep -i "TBD\|TODO\|pending\|FIXME" "$DIR/"*.md
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
## Step 3: Interactive questioning (key)
|
|
45
|
-
|
|
46
|
-
For each open decision, capture the user's choice via AskUserQuestion:
|
|
47
|
-
|
|
48
|
-
```
|
|
49
|
-
AskUserQuestion:
|
|
50
|
-
Question: "How to store user data"
|
|
51
|
-
Options:
|
|
52
|
-
- A: PostgreSQL (relational, already used in the project)
|
|
53
|
-
- B: MongoDB (flexible schema, needs a new dependency)
|
|
54
|
-
- C: Do not decide yet (defer to actual implementation)
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
**Forbidden**:
|
|
58
|
-
- The agent guesses the answer itself
|
|
59
|
-
- Merging multiple open questions into one ask (user can't answer all)
|
|
60
|
-
|
|
61
|
-
**Supported**:
|
|
62
|
-
- User picks "C: do not decide yet" → record as `D-NN: deferred, decide at implementation time`
|
|
63
|
-
- User wants to add rationale → append to the D-NN rationale
|
|
64
|
-
- User proposes a new direction (not in the options) → record and tag "user-originated"
|
|
65
|
-
|
|
66
|
-
## Step 4: Assign D-NN
|
|
67
|
-
|
|
68
|
-
Read existing STATE.md to get the largest D number:
|
|
69
|
-
|
|
70
|
-
```python
|
|
71
|
-
import re
|
|
72
|
-
content = open('.flow/STATE.md').read()
|
|
73
|
-
existing = re.findall(r'D-(\d+)', content)
|
|
74
|
-
next_n = max([int(x) for x in existing] + [0]) + 1
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
For each new decision:
|
|
78
|
-
- Project-level impact (e.g., "the whole project uses PostgreSQL") → D-NN (append to STATE.md)
|
|
79
|
-
- Spec-level impact (e.g., "this spec uses bcrypt cost 12") → append to the spec's .progress.md
|
|
80
|
-
|
|
81
|
-
## Step 5: Append to STATE.md
|
|
82
|
-
|
|
83
|
-
```markdown
|
|
84
|
-
## New decisions (append to the Decisions section of .flow/STATE.md)
|
|
85
|
-
|
|
86
|
-
- **D-07** | 2026-04-19 | auth-system spec decides to use JWT + Redis blocklist | supports cross-domain SPA; token revocation via Redis
|
|
87
|
-
- **D-08** | 2026-04-19 | All user data uses PostgreSQL | already used in the project; avoid introducing a new dependency
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
**Append only, never modify existing D-NN.** (Once a decision is locked, do not change it.)
|
|
91
|
-
|
|
92
|
-
## Step 6: Append to .progress.md
|
|
93
|
-
|
|
94
|
-
```markdown
|
|
95
|
-
# .flow/specs/$SPEC_NAME/.progress.md
|
|
96
|
-
|
|
97
|
-
## Decisions Made Here (from /curdx-flow:discuss YYYY-MM-DD)
|
|
98
|
-
|
|
99
|
-
- **D-07**: JWT + Redis blocklist
|
|
100
|
-
- Project-level → synced to STATE.md
|
|
101
|
-
- **D-08**: PostgreSQL for user data
|
|
102
|
-
- Project-level → synced to STATE.md
|
|
103
|
-
- **D-local-01**: bcrypt cost factor 12 (spec-level)
|
|
104
|
-
- Rationale: balance performance (100ms) and security
|
|
105
|
-
- No need to sync to STATE.md
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
Project-level use the global D-NN numbering; spec-level use `D-local-NN` without taking a global number.
|
|
109
|
-
|
|
110
|
-
## Step 7: Update tasks.md references (if already generated)
|
|
111
|
-
|
|
112
|
-
If tasks.md already exists, append `_Decisions: D-NN` reference to each task (so the executor knows which decision the task must follow).
|
|
113
|
-
|
|
114
|
-
If tasks.md has not been generated, a later `/curdx-flow:tasks` will generate based on these decisions.
|
|
115
|
-
|
|
116
|
-
## Step 8: Output to user
|
|
117
|
-
|
|
118
|
-
```
|
|
119
|
-
✓ Discuss complete: $SPEC_NAME
|
|
120
|
-
|
|
121
|
-
Captured decisions:
|
|
122
|
-
Project-level (D-NN):
|
|
123
|
-
• D-07: JWT + Redis blocklist
|
|
124
|
-
• D-08: PostgreSQL for user data
|
|
125
|
-
|
|
126
|
-
Spec-level (D-local-NN):
|
|
127
|
-
• D-local-01: bcrypt cost factor 12
|
|
128
|
-
|
|
129
|
-
Written to:
|
|
130
|
-
• .flow/STATE.md (D-07, D-08)
|
|
131
|
-
• .flow/specs/$SPEC_NAME/.progress.md (all)
|
|
132
|
-
|
|
133
|
-
These decisions will be honored by flow-executor during subsequent execution without re-asking.
|
|
134
|
-
|
|
135
|
-
Next steps:
|
|
136
|
-
- If tasks.md is already generated → /curdx-flow:implement
|
|
137
|
-
- If not → /curdx-flow:tasks (will automatically reference these decisions)
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
## Forbidden
|
|
141
|
-
|
|
142
|
-
- ✗ Agent guessing the user's choice
|
|
143
|
-
- ✗ Asking open questions in bulk (must use AskUserQuestion one by one)
|
|
144
|
-
- ✗ Modifying existing D-NN (append only)
|
|
145
|
-
- ✗ Putting spec-level decisions in STATE.md (only project-level)
|
|
146
|
-
|
|
147
|
-
## Principles
|
|
148
|
-
|
|
149
|
-
### Discuss ≠ clarifying requirements
|
|
150
|
-
|
|
151
|
-
- **Discuss**: design exists; now decide execution details (e.g., "which DB")
|
|
152
|
-
- **Clarifying requirements**: should be done in the requirements phase
|
|
153
|
-
|
|
154
|
-
If discuss reveals that the requirements themselves are unclear → return to /curdx-flow:requirements.
|
|
155
|
-
|
|
156
|
-
### A decision is a contract
|
|
157
|
-
|
|
158
|
-
Once a D-NN is written to STATE.md, all subsequent related code must reference the D-NN. To violate it, explicit challenge is required:
|
|
159
|
-
|
|
160
|
-
```
|
|
161
|
-
Comment or PR description: "Challenge D-07: using session rather than JWT here because X"
|
|
162
|
-
```
|
package/commands/doctor.md
DELETED
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: doctor
|
|
3
|
-
description: Check the dependency health and project configuration of CurDX-Flow
|
|
4
|
-
argument-hint: "[--verbose]"
|
|
5
|
-
allowed-tools: [Bash, Read]
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# CurDX-Flow Health Check
|
|
9
|
-
|
|
10
|
-
Quickly confirm: **Are all the MCPs up? Are the recommended plugins installed? Is the project config valid?**
|
|
11
|
-
|
|
12
|
-
## Steps
|
|
13
|
-
|
|
14
|
-
### Step 1: MCP status
|
|
15
|
-
|
|
16
|
-
```bash
|
|
17
|
-
claude mcp list 2>/dev/null
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
Expected (auto-injected by CurDX-Flow's plugin.json):
|
|
21
|
-
|
|
22
|
-
- ✓ `context7` — documentation queries
|
|
23
|
-
- ✓ `sequential-thinking` — structured thinking
|
|
24
|
-
- ✓ `chrome-devtools` — browser QA
|
|
25
|
-
|
|
26
|
-
If missing, output:
|
|
27
|
-
- `❌ <name> not started. Possible causes: npx connection failed, Node.js < 18, or corrupted npm cache.`
|
|
28
|
-
- Hint: `claude mcp list` to view details, or restart Claude Code.
|
|
29
|
-
|
|
30
|
-
### Step 2: Plugin status
|
|
31
|
-
|
|
32
|
-
```bash
|
|
33
|
-
claude plugin list 2>/dev/null
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
**Required**:
|
|
37
|
-
- `curdx-flow` — this plugin
|
|
38
|
-
|
|
39
|
-
**Recommended**:
|
|
40
|
-
- `pua` (tanweai/pua) — anti-giving-up
|
|
41
|
-
- `claude-mem` (thedotmack/claude-mem) — auto memory
|
|
42
|
-
- `frontend-design` — UI design
|
|
43
|
-
|
|
44
|
-
If a recommended plugin is missing, output:
|
|
45
|
-
```
|
|
46
|
-
⚠ <name> is not installed. Run /curdx-flow:install-deps to install, or run in degraded mode.
|
|
47
|
-
Degradation impact:
|
|
48
|
-
- pua missing → no pressure escalation; rely on the three red lines in the preamble
|
|
49
|
-
- claude-mem missing → no auto memory; only explicit state in .flow/STATE.md
|
|
50
|
-
- frontend-design missing → UI falls back to default Tailwind + shadcn
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
### Step 3: Project status
|
|
54
|
-
|
|
55
|
-
Check whether `.flow/` exists:
|
|
56
|
-
|
|
57
|
-
```bash
|
|
58
|
-
if [ -d ".flow" ]; then
|
|
59
|
-
echo "✓ .flow/ directory exists"
|
|
60
|
-
else
|
|
61
|
-
echo "⚠ .flow/ directory does not exist. Run /curdx-flow:init to initialize."
|
|
62
|
-
fi
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
If present, check:
|
|
66
|
-
- `.flow/config.json` — valid JSON?
|
|
67
|
-
- `.flow/PROJECT.md` — has content (not template placeholder)?
|
|
68
|
-
- `.flow/STATE.md` — readable?
|
|
69
|
-
- `.flow/.active-spec` — does the corresponding specs/<name>/ exist?
|
|
70
|
-
|
|
71
|
-
### Step 4: CLAUDE.md check
|
|
72
|
-
|
|
73
|
-
```bash
|
|
74
|
-
if [ -f "CLAUDE.md" ]; then
|
|
75
|
-
echo "✓ Project-level CLAUDE.md exists"
|
|
76
|
-
else
|
|
77
|
-
echo "ℹ Project has no CLAUDE.md. The Karpathy baseline is still injected via the InstructionsLoaded hook."
|
|
78
|
-
fi
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
### Step 5: Write diagnostic report (optional --verbose)
|
|
82
|
-
|
|
83
|
-
In verbose mode, output a full diagnosis, including:
|
|
84
|
-
- Node.js version (`node --version`)
|
|
85
|
-
- Claude Code version (`claude --version`)
|
|
86
|
-
- Plugin data directory: `${CLAUDE_PLUGIN_DATA}`
|
|
87
|
-
- Last dependency check date: `${CLAUDE_PLUGIN_DATA}/.deps-checked`
|
|
88
|
-
|
|
89
|
-
## Output format
|
|
90
|
-
|
|
91
|
-
```
|
|
92
|
-
🏥 CurDX-Flow Health Check
|
|
93
|
-
═══════════════════════════════════════
|
|
94
|
-
|
|
95
|
-
MCP Servers:
|
|
96
|
-
✓ context7 (auto-installed)
|
|
97
|
-
✓ sequential-thinking (auto-installed)
|
|
98
|
-
✓ chrome-devtools (auto-installed)
|
|
99
|
-
|
|
100
|
-
Plugins:
|
|
101
|
-
✓ curdx-flow v0.1.0
|
|
102
|
-
✓ pua v3.2.1
|
|
103
|
-
⚠ claude-mem not installed → /curdx-flow:install-deps
|
|
104
|
-
✓ frontend-design v1.x
|
|
105
|
-
|
|
106
|
-
Project:
|
|
107
|
-
✓ .flow/ initialized
|
|
108
|
-
✓ config.json valid (mode: standard)
|
|
109
|
-
⚠ PROJECT.md still the template (please fill in the project vision)
|
|
110
|
-
ℹ No active spec run /curdx-flow:start to launch the first one
|
|
111
|
-
|
|
112
|
-
═══════════════════════════════════════
|
|
113
|
-
Summary: 1 warning, 0 errors. Run /curdx-flow:install-deps to clear the warning.
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
## Exit status
|
|
117
|
-
|
|
118
|
-
- 0 errors → fully healthy
|
|
119
|
-
- Warnings only → usable, but recommended to address
|
|
120
|
-
- Errors present → must be fixed before continuing
|
|
121
|
-
|
|
122
|
-
## Error recovery
|
|
123
|
-
|
|
124
|
-
For each issue found, provide a concrete recovery command rather than just "check the config".
|
package/commands/index.md
DELETED
|
@@ -1,261 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: index
|
|
3
|
-
description: Codebase index — scan brownfield projects and generate a module/component/API index. Provides the foundation for subsequent /curdx-flow:research.
|
|
4
|
-
argument-hint: "[--force]"
|
|
5
|
-
allowed-tools: [Read, Write, Bash, Grep, Glob]
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# Flow Index — Codebase Scan and Index
|
|
9
|
-
|
|
10
|
-
Generate an index for **brownfield projects** (existing code) so that flow-researcher and flow-architect can quickly acquire project-structure information.
|
|
11
|
-
|
|
12
|
-
## Applicable Scenarios
|
|
13
|
-
|
|
14
|
-
- Taking over an existing project — run `/curdx-flow:index` first to build understanding
|
|
15
|
-
- Large monorepo requiring indexes of subpackages
|
|
16
|
-
- Want to add a new feature to the current project — index before researching
|
|
17
|
-
|
|
18
|
-
## Not Applicable
|
|
19
|
-
|
|
20
|
-
- Greenfield projects (empty codebase)
|
|
21
|
-
- Micro projects (< 20 files)
|
|
22
|
-
|
|
23
|
-
## Step 1: Preflight
|
|
24
|
-
|
|
25
|
-
```bash
|
|
26
|
-
[ ! -d ".flow" ] && { echo "❌ Not a CurDX-Flow project. Run /curdx-flow:init first"; exit 1; }
|
|
27
|
-
|
|
28
|
-
INDEX_FILE=".flow/codebase-index.md"
|
|
29
|
-
|
|
30
|
-
# If one exists and --force is not set, ask
|
|
31
|
-
if [ -f "$INDEX_FILE" ] && [ "$ARGUMENTS" != "--force" ]; then
|
|
32
|
-
echo "ℹ Index already exists: $INDEX_FILE"
|
|
33
|
-
# AskUserQuestion: overwrite / incremental / cancel
|
|
34
|
-
fi
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
## Step 2: Detect Project Type
|
|
38
|
-
|
|
39
|
-
```bash
|
|
40
|
-
# Identify project language + build tool
|
|
41
|
-
if [ -f "package.json" ]; then
|
|
42
|
-
PROJECT_TYPE="node"
|
|
43
|
-
FRAMEWORK=$(grep -E "(react|vue|next|nuxt|svelte)" package.json | head -3)
|
|
44
|
-
elif [ -f "requirements.txt" ] || [ -f "pyproject.toml" ]; then
|
|
45
|
-
PROJECT_TYPE="python"
|
|
46
|
-
elif [ -f "Cargo.toml" ]; then
|
|
47
|
-
PROJECT_TYPE="rust"
|
|
48
|
-
elif [ -f "go.mod" ]; then
|
|
49
|
-
PROJECT_TYPE="go"
|
|
50
|
-
fi
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
## Step 3: Scan Directory Structure
|
|
54
|
-
|
|
55
|
-
```bash
|
|
56
|
-
# Top-level directories
|
|
57
|
-
DIRS=$(ls -d */ 2>/dev/null | grep -vE "(node_modules|dist|build|\.git|\.next)")
|
|
58
|
-
|
|
59
|
-
# File statistics
|
|
60
|
-
TOTAL_FILES=$(find . -type f -not -path "*/node_modules/*" -not -path "*/.git/*" | wc -l)
|
|
61
|
-
SRC_FILES=$(find src/ -type f 2>/dev/null | wc -l)
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
## Step 4: Identify Modules
|
|
65
|
-
|
|
66
|
-
Use Grep + Glob to find module boundaries:
|
|
67
|
-
|
|
68
|
-
```bash
|
|
69
|
-
# TypeScript / JavaScript: find export default + public API
|
|
70
|
-
# Python: find __init__.py
|
|
71
|
-
# Rust: find mod.rs / lib.rs
|
|
72
|
-
# Go: find package declaration
|
|
73
|
-
|
|
74
|
-
# Typical pattern (Node project):
|
|
75
|
-
Glob: src/**/index.{ts,tsx,js}
|
|
76
|
-
Grep: "^export (default|const|function|class)" in index files
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
## Step 5: Identify Components / Services / APIs
|
|
80
|
-
|
|
81
|
-
```bash
|
|
82
|
-
# UI components
|
|
83
|
-
Glob: src/**/*.{tsx,jsx,vue,svelte}
|
|
84
|
-
|
|
85
|
-
# API endpoints
|
|
86
|
-
Grep: "router\.\(get\|post\|put\|delete\)" or "app\.(get|post)" or "@app.route"
|
|
87
|
-
|
|
88
|
-
# DB models
|
|
89
|
-
Grep: "@Entity\|Schema\|Model\|prisma\."
|
|
90
|
-
|
|
91
|
-
# Services
|
|
92
|
-
Glob: src/**/*Service.{ts,js}
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
## Step 6: Build the Index Markdown
|
|
96
|
-
|
|
97
|
-
```markdown
|
|
98
|
-
# Codebase Index: <project name>
|
|
99
|
-
|
|
100
|
-
Generated: YYYY-MM-DD
|
|
101
|
-
Project type: Node (TypeScript + React)
|
|
102
|
-
Total files: 234 (189 under src/)
|
|
103
|
-
|
|
104
|
-
## Directory Structure
|
|
105
|
-
|
|
106
|
-
```
|
|
107
|
-
src/
|
|
108
|
-
├── auth/ ← authentication module
|
|
109
|
-
├── user/ ← user management
|
|
110
|
-
├── orders/ ← orders
|
|
111
|
-
├── ui/ ← shared UI components
|
|
112
|
-
├── api/ ← API routes
|
|
113
|
-
├── db/ ← DB layer
|
|
114
|
-
└── utils/ ← utility functions
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
## Module List
|
|
118
|
-
|
|
119
|
-
### Module: auth
|
|
120
|
-
- Path: src/auth/
|
|
121
|
-
- Entry: src/auth/index.ts
|
|
122
|
-
- Exports:
|
|
123
|
-
- `login(email, password)` - log in
|
|
124
|
-
- `logout(token)` - log out
|
|
125
|
-
- `refreshToken(token)` - refresh
|
|
126
|
-
- Dependencies: bcrypt, jsonwebtoken
|
|
127
|
-
- Tests: src/auth/*.test.ts (15 tests)
|
|
128
|
-
|
|
129
|
-
### Module: user
|
|
130
|
-
- Path: src/user/
|
|
131
|
-
- Entry: src/user/index.ts
|
|
132
|
-
- Exports:
|
|
133
|
-
- `getUser(id)` - fetch user
|
|
134
|
-
- `updateProfile(id, data)` - update profile
|
|
135
|
-
- Dependencies: prisma
|
|
136
|
-
- Tests: src/user/*.test.ts (8 tests)
|
|
137
|
-
|
|
138
|
-
### Module: orders
|
|
139
|
-
...
|
|
140
|
-
|
|
141
|
-
## UI Component List
|
|
142
|
-
|
|
143
|
-
### Shared components (src/ui/)
|
|
144
|
-
|
|
145
|
-
- `<Button>` - src/ui/Button.tsx
|
|
146
|
-
- `<Input>` - src/ui/Input.tsx
|
|
147
|
-
- `<Card>` - src/ui/Card.tsx
|
|
148
|
-
- ...
|
|
149
|
-
|
|
150
|
-
### Page components (src/pages/)
|
|
151
|
-
|
|
152
|
-
- `LoginPage` - src/pages/Login.tsx
|
|
153
|
-
- `DashboardPage` - src/pages/Dashboard.tsx
|
|
154
|
-
- ...
|
|
155
|
-
|
|
156
|
-
## API Endpoints
|
|
157
|
-
|
|
158
|
-
### /auth
|
|
159
|
-
- POST /auth/login → src/api/auth.ts:login
|
|
160
|
-
- POST /auth/logout → src/api/auth.ts:logout
|
|
161
|
-
- POST /auth/refresh → src/api/auth.ts:refresh
|
|
162
|
-
|
|
163
|
-
### /users
|
|
164
|
-
- GET /users/me → src/api/users.ts:getCurrent
|
|
165
|
-
- PUT /users/me → src/api/users.ts:update
|
|
166
|
-
- ...
|
|
167
|
-
|
|
168
|
-
## DB Models
|
|
169
|
-
|
|
170
|
-
- `User` - src/db/models/User.ts
|
|
171
|
-
- `Order` - src/db/models/Order.ts
|
|
172
|
-
- ...
|
|
173
|
-
|
|
174
|
-
## Tech Stack
|
|
175
|
-
|
|
176
|
-
- **Runtime**: Node 20 + TypeScript 5
|
|
177
|
-
- **Framework**: Next.js 14 (App Router)
|
|
178
|
-
- **UI**: React 18 + Tailwind + shadcn/ui
|
|
179
|
-
- **DB**: PostgreSQL + Prisma
|
|
180
|
-
- **Auth**: JWT + bcrypt
|
|
181
|
-
- **Testing**: Vitest + Playwright
|
|
182
|
-
|
|
183
|
-
## Commands
|
|
184
|
-
|
|
185
|
-
From package.json:
|
|
186
|
-
- `npm run dev` - dev server (localhost:3000)
|
|
187
|
-
- `npm test` - tests
|
|
188
|
-
- `npm run build` - production build
|
|
189
|
-
- `npm run lint` - ESLint
|
|
190
|
-
|
|
191
|
-
## Conventions
|
|
192
|
-
|
|
193
|
-
- File naming: PascalCase for components, camelCase for utilities
|
|
194
|
-
- Tests: `*.test.ts` adjacent to source file
|
|
195
|
-
- Types: standalone `types.ts` or inline interface
|
|
196
|
-
- Exports: each module's `index.ts` as the public API
|
|
197
|
-
|
|
198
|
-
## Hot Files (most modified recently)
|
|
199
|
-
|
|
200
|
-
- src/auth/login.ts (12 commits in the past 30 days)
|
|
201
|
-
- src/ui/Button.tsx (8 commits)
|
|
202
|
-
- ...
|
|
203
|
-
|
|
204
|
-
## Tech Debt / TODO
|
|
205
|
-
|
|
206
|
-
Scan for `// TODO:` / `// FIXME:`:
|
|
207
|
-
- src/auth/refresh.ts:28 - "TODO: add rate limiting"
|
|
208
|
-
- src/api/orders.ts:45 - "FIXME: handle concurrent updates"
|
|
209
|
-
- ...
|
|
210
|
-
```
|
|
211
|
-
|
|
212
|
-
## Step 7: Save + Update .state
|
|
213
|
-
|
|
214
|
-
```bash
|
|
215
|
-
# Write
|
|
216
|
-
echo "$INDEX_CONTENT" > "$INDEX_FILE"
|
|
217
|
-
|
|
218
|
-
# If .flow/config.json exists, record the index time
|
|
219
|
-
python3 -c "
|
|
220
|
-
import json
|
|
221
|
-
c = json.load(open('.flow/config.json'))
|
|
222
|
-
c.setdefault('codebase_index', {})['last_updated'] = '$(date +%Y-%m-%d)'
|
|
223
|
-
json.dump(c, open('.flow/config.json','w'), indent=2, ensure_ascii=False)
|
|
224
|
-
"
|
|
225
|
-
```
|
|
226
|
-
|
|
227
|
-
## Step 8: Output
|
|
228
|
-
|
|
229
|
-
```
|
|
230
|
-
✓ Codebase index complete
|
|
231
|
-
|
|
232
|
-
File: .flow/codebase-index.md (~N lines)
|
|
233
|
-
|
|
234
|
-
Statistics:
|
|
235
|
-
Modules: M
|
|
236
|
-
UI components: K
|
|
237
|
-
API endpoints: L
|
|
238
|
-
DB models: J
|
|
239
|
-
|
|
240
|
-
You can now:
|
|
241
|
-
- Agents will read this index as context during /curdx-flow:research
|
|
242
|
-
- When running /curdx-flow:start for a new feature, reference this index first to find reusable modules
|
|
243
|
-
- View it manually to understand the project structure
|
|
244
|
-
|
|
245
|
-
Suggestion:
|
|
246
|
-
- Rerun after major code changes: /curdx-flow:index --force
|
|
247
|
-
- No need to run on every change (30-day stability is OK)
|
|
248
|
-
```
|
|
249
|
-
|
|
250
|
-
## Notes
|
|
251
|
-
|
|
252
|
-
- The index is **not full documentation**, it is a **quick guide**. Details still live in the source code.
|
|
253
|
-
- Large project scans may take 1-2 minutes
|
|
254
|
-
- Does not scan node_modules / dist / build / .git
|
|
255
|
-
- Exclusion list configurable (future enhancement)
|
|
256
|
-
|
|
257
|
-
## Error Recovery
|
|
258
|
-
|
|
259
|
-
- Project too large (10K+ files) → index by module
|
|
260
|
-
- Project type cannot be identified → provide a template for the user to fill in manually
|
|
261
|
-
- Some paths have permission issues → skip and continue with the rest
|
package/commands/install-deps.md
DELETED
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: install-deps
|
|
3
|
-
description: Interactively install CurDX-Flow's recommended plugin dependencies (pua / claude-mem / frontend-design)
|
|
4
|
-
argument-hint: "[--all | --skip-prompt]"
|
|
5
|
-
allowed-tools: [Bash, AskUserQuestion]
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# One-Shot Install of Recommended Plugins
|
|
9
|
-
|
|
10
|
-
CurDX-Flow auto-installs 3 MCPs via `plugin.json.mcpServers`:
|
|
11
|
-
- ✓ context7 — docs lookup
|
|
12
|
-
- ✓ sequential-thinking — structured thinking
|
|
13
|
-
- ✓ chrome-devtools — browser QA
|
|
14
|
-
|
|
15
|
-
This command interactively installs 3 recommended **plugins** (they are not MCPs and must be installed separately):
|
|
16
|
-
|
|
17
|
-
| Plugin | Purpose | Official/Community |
|
|
18
|
-
|--------|---------|--------------------|
|
|
19
|
-
| **pua** (tanweai/pua) | Prevent AI from giving up; enforces the three red lines | Community |
|
|
20
|
-
| **claude-mem** (thedotmack/claude-mem) | Automatic cross-session memory | Community |
|
|
21
|
-
| **frontend-design** | UI design skill | Anthropic official |
|
|
22
|
-
|
|
23
|
-
## Execution Steps
|
|
24
|
-
|
|
25
|
-
### Step 1: Network Check
|
|
26
|
-
|
|
27
|
-
```bash
|
|
28
|
-
if ! ping -c 1 -W 2 github.com >/dev/null 2>&1; then
|
|
29
|
-
echo "⚠️ Network unreachable, cannot install plugins from the marketplace."
|
|
30
|
-
echo "CurDX-Flow will run in degraded mode (MCPs remain available)."
|
|
31
|
-
exit 0
|
|
32
|
-
fi
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
### Step 2: Detect Current Installation Status
|
|
36
|
-
|
|
37
|
-
```bash
|
|
38
|
-
INSTALLED=$(claude plugin list 2>/dev/null || echo "")
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
Parse out which are installed and which are not.
|
|
42
|
-
|
|
43
|
-
### Step 3: Ask the User
|
|
44
|
-
|
|
45
|
-
If the `--all` argument is present, skip asking and install everything. Otherwise use AskUserQuestion:
|
|
46
|
-
|
|
47
|
-
**Question**: Which recommended plugins to install?
|
|
48
|
-
|
|
49
|
-
**Options** (list only those not installed):
|
|
50
|
-
- **all** — Install all (recommended)
|
|
51
|
-
- **recommended** — Install pua + claude-mem + frontend-design
|
|
52
|
-
- **custom** — Pick manually (follow up with a multi-select question)
|
|
53
|
-
- **skip** — Skip (the core MCPs are already enough)
|
|
54
|
-
|
|
55
|
-
If the user picks `custom`, use a second AskUserQuestion to let them multi-select which to install.
|
|
56
|
-
|
|
57
|
-
### Step 4: Run Installation
|
|
58
|
-
|
|
59
|
-
Based on the selection (install only those not yet installed):
|
|
60
|
-
|
|
61
|
-
#### pua
|
|
62
|
-
|
|
63
|
-
```bash
|
|
64
|
-
claude plugin marketplace add tanweai/pua
|
|
65
|
-
claude plugin install pua@pua-skills --scope user
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
#### claude-mem
|
|
69
|
-
|
|
70
|
-
```bash
|
|
71
|
-
claude plugin marketplace add thedotmack/claude-mem
|
|
72
|
-
claude plugin install claude-mem --scope user
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
#### frontend-design
|
|
76
|
-
|
|
77
|
-
Anthropic's official plugin is typically in the default marketplace:
|
|
78
|
-
|
|
79
|
-
```bash
|
|
80
|
-
# If the default marketplace is enabled
|
|
81
|
-
claude plugin install frontend-design --scope user
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
On failure, tell the user:
|
|
85
|
-
> frontend-design must be installed from the official marketplace. Inside Claude Code run:
|
|
86
|
-
> `/plugin`, then search for "frontend-design" in the Discover panel.
|
|
87
|
-
|
|
88
|
-
### Step 5: Update Marker
|
|
89
|
-
|
|
90
|
-
```bash
|
|
91
|
-
DATA_DIR="${CLAUDE_PLUGIN_DATA:-$HOME/.claude/plugins/data/curdx-flow}"
|
|
92
|
-
mkdir -p "$DATA_DIR"
|
|
93
|
-
echo "$(date +%Y-%m-%d)" > "$DATA_DIR/.deps-checked"
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
Prevents the SessionStart hook from continuing to remind.
|
|
97
|
-
|
|
98
|
-
### Step 6: Verify and Report
|
|
99
|
-
|
|
100
|
-
```bash
|
|
101
|
-
claude plugin list 2>/dev/null | grep -E "pua|claude-mem|frontend-design"
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
Print the installation summary:
|
|
105
|
-
|
|
106
|
-
```
|
|
107
|
-
Install report:
|
|
108
|
-
✓ pua (v3.2.1)
|
|
109
|
-
✓ claude-mem (v12.3.0)
|
|
110
|
-
⚠ frontend-design (requires manual install via /plugin)
|
|
111
|
-
|
|
112
|
-
Next steps:
|
|
113
|
-
/curdx-flow:doctor — full health check
|
|
114
|
-
/curdx-flow:init — initialize project (if not yet initialized)
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
## Error Handling
|
|
118
|
-
|
|
119
|
-
- `claude plugin marketplace add` failure → report the specific error (usually network/permissions)
|
|
120
|
-
- `claude plugin install` failure → ask the user to run the command manually
|
|
121
|
-
- User interruption → keep what is already installed, resume on the next run
|
|
122
|
-
- Installed but needs updating → suggest `claude plugin update <name>`
|
|
123
|
-
|
|
124
|
-
## Notes
|
|
125
|
-
|
|
126
|
-
- This command only **installs**, it does not **configure**. See each plugin's own docs for configuration.
|
|
127
|
-
- Installation is **global** (scope=user), shared across all projects.
|
|
128
|
-
- Uninstall: `claude plugin uninstall <name>`
|