start
Use when starting curdx-flow, creating a spec, resuming work, or routing intent.
- License 许可
- MIT
- 最近更新
- 2026-08-19
- Stars
- ★ 4
- Forks
- 0
01 前言 Front Matter
- name
- start
- description
- Use when starting curdx-flow, creating a spec, resuming work, or routing intent.
- allowed-tools
- Read Write Edit Bash Agent Skill AskUserQuestion
- argument-hint
- [name] [goal] [--fresh] [--quick] [--mode auto|fast|deep] [--task-granularity auto|coarse|standard|fine] [--review minimal|standard|strict] [--commit-spec] [--no-commit-spec] [--specs-dir <path>]
- disable-model-invocation
- true
03 SKILL.md 正文
Smart Start
Act as the curdx-flow router. Decide the next action from facts first; ask the user only when a fact is missing or the action is destructive.
Dev Context
Before routing, assume the current project may be frontend-only, backend-only, full-stack monorepo, split frontend/backend repos, a CLI/library, or a Claude Code plugin. The deterministic router reads project CLAUDE.md Dev sections, .claude/curdx-flow.local.md, and cheap manifests to infer code roots.
Users do not need to know --add-dir. If routing returns a missing code root, show the exact nextAction from the router and stop.
Route First
- Parse
$ARGUMENTSinto optional spec name, goal text, and flags. - Run the deterministic router:
For routes that are notcurdx-flow route \ --name "$name" \ --goal "$goal" \ --flags "$ARGUMENTS"direct-changeorblocked-ask-user, compile the execution contract before planning:curdx-flow route --compile --record \ --name "$name" \ --goal "$goal" \ --flags "$ARGUMENTS" - Run the last-mile autopilot:
Treatcurdx-flow last-mile \ --name "$name" \ --goal "$goal"phase,problemTypes,capabilityPlan,evidenceRequired, andcoordinatorInstructionas the automatic execution policy. Do not ask the user which skill to run when the autopilot already identifies the needed capability. - Treat the returned
routeandintentas the source of truth. Do not invent a different workflow unless the router saysblocked-ask-userand the user's answer changes the facts. - Always read these adaptive facts before acting:
topology.workspaceState:empty,scaffolded,existing, orsplit-repointent.intentKind:scaffold,product,prototype,import-spec,feature,fix,refactor,release, orunknownintent.clarity,intent.stackSpecified,intent.artifactProvided,intent.deliveryExpectation, andintent.missingFacts
- If the router returns
recommendedCapabilities, treat them as phase-specific hints, not mandatory steps.availabilityStateis the operational signal:availablemeans visible now,expectedmeans the environment should provide it, andmissingmeans skip or fix setup before relying on it.availability: plugin-dependencymeans a Claude Code plugin dependency;availability: external-expectedmeans an MCP provided by the user's external setup such ascontext7orsequential-thinking. curdx-flow recommends existing wheels (context7,claude-mem,ui-ux-pro-max,chrome-devtools-mcp,sequential-thinking,pua) and must not reimplement or bundle duplicate MCP config for them. Workflow/policy hints such asdocs-query,tdd-cycle,security-review,stack-specific-verification, andcontext-budgetneed no installation. - For last-mile phase/capability/evidence interpretation, use
${CLAUDE_PLUGIN_ROOT}/references/last-mile-autopilot.md. - For stack profile, quality gates, suggested verifier, and context-budget interpretation, use
${CLAUDE_PLUGIN_ROOT}/references/intelligent-routing.mdonly when the compact router output is insufficient. - For execution brief fields, completion contract, and
.curdx/brain.jsonlinterpretation, use${CLAUDE_PLUGIN_ROOT}/references/execution-brief.mdonly when the compact brief output is insufficient.
Route Actions
| Route | Action |
|---|---|
resume-current |
Resume the active spec at nextAction. Do not create a new spec. |
direct-change |
Handle the change directly in the current turn. Do not create a spec or tasks.md. |
lite-spec |
Create a lightweight spec, then generate 1-3 value-slice tasks. |
full-spec |
Run the normal research -> requirements -> design -> tasks -> implement workflow. |
epic-split |
Invoke /curdx-flow:triage with the same goal. Do not force the work into one spec. |
scaffold |
Select the best scaffold source, create only the explicitly requested skeleton, write assumptions, then run baseline verification. |
product-inception |
Create product context before application code: mission, constraints, roadmap, tech-stack assumptions, and constitution. |
greenfield-spec |
Create a greenfield spec with product context, technical plan, walking skeleton, and vertical-slice tasks. |
prototype |
Create a bounded prototype spec with an explicit success criterion and minimal verification loop. |
import-spec |
Import the provided PRD/spec/design/API artifact into curdx-flow phase artifacts, then plan implementation. |
blocked-ask-user |
Ask one focused question, then rerun the router with the new fact. |
If blocked-ask-user includes topology.missingRoots, do not ask an open-ended question. Print the router's Next line exactly, such as /add-dir ../frontend, and tell the user to rerun /curdx-flow:start after adding the directory.
Pre-Question Discovery (Greenfield / Inception / Blocked)
<mandatory>
For product-inception, greenfield-spec, prototype, import-spec, or blocked-ask-user routes with non-empty intent.missingFacts, you MUST fan out a Discovery subagent batch BEFORE asking the user any clarifying question and BEFORE writing any product-context artifact.
This is the Discovery domain of ${CLAUDE_PLUGIN_ROOT}/references/bounded-parallel-dispatch.md. The independence rules and anti-patterns in that doc apply here.
</mandatory>
Why
Asking the user before fanning out is an anti-pattern (#14 in bounded-parallel-dispatch). It serializes work that should be parallel, surfaces low-leverage questions whose answers are already in the codebase or memory, and produces interview options without [Recommended] grounded in facts. Anthropic's canonical guidance frames subagents as the primary tool for investigation precisely because main-context exploration "fills with file contents you won't reference again."
When this section fires
All of the following must hold:
- Route ∈ {
product-inception,greenfield-spec,prototype,import-spec,blocked-ask-user} intent.missingFactsis non-empty (parse fromcurdx-flow routeoutput)- At least one
missingFactis answerable from: prior memory, this repo's files, or current external docs
If route is blocked-ask-user AND topology.missingRoots is the only missing fact, skip this section and follow the /add-dir instruction above. Missing-roots is a deterministic user action, not a discoverable fact.
Fan-out composition (minimum 3 agents in ONE message)
For empty workspaces and product-inception, dispatch ALL of these in a single message:
1. general-purpose agent invoking mcp__plugin_claude-mem_mcp-search__smart_search
→ Search user's claude-mem for prior decisions, failed attempts, similar projects
→ Output cap: 250 words, concrete corpus/observation references
2. Explore agent rooted at .planning/, docs/, CLAUDE.md, .gitignore, package.json
→ Surface existing conventions, prior planning notes, declared stack
→ Output cap: 200 words, file:line references
3. N research-analyst agents — ONE per candidate stack OR prior-art topic in missingFacts
→ Each agent owns ONE topic; never combine
→ Output cap: 300 words per agent, cite sources
→ If a candidate stack is named (e.g., "node-pty", "xterm.js"), prefer Context7 MCP via the agent's tool surface before generic web search
For non-empty workspaces or blocked-ask-user with codebase-resolvable facts, drop the research-analyst agents if missingFacts are all repo-internal.
Synthesis contract
After all agents return, the coordinator MUST:
- Cross-validate memory hits against current repo state — claude-mem snapshots can be stale. A
function foo()referenced in memory may have been renamed; treat memory as "what was true when written", not "what is true now". Verify with grep/Read before recommending. - Map every
missingFactto evidence: which agent answered it, with what citation. Unanswered facts become the user-decision interview questions. - Re-derive interview options with
[Recommended]grounded in the synthesis. No fabricated options; every option must trace to a finding or an explicit assumption marker. - Persist findings to
.planning/discovery/<route>-<timestamp>.mdif.planning/exists, so re-runs and other sessions can reuse them.
What this section is NOT
- Not a license to write product-context artifacts directly. Artifact writing still goes through the normal phase agents (research-analyst / product-manager / etc.) once a spec is created.
- Not a replacement for the interview. It produces grounded interview options; the user still confirms the irreducible decisions.
- Not for
direct-change,scaffold(with clear stack),lite-spec,full-spec,epic-split, orresume-currentroutes. Those have their own dispatch patterns elsewhere.
Hard Rules
- Use behavior route names exactly as returned:
direct-change,lite-spec,full-spec,epic-split,scaffold,product-inception,greenfield-spec,prototype,import-spec,resume-current,blocked-ask-user. - Top-level tasks are value slices. Never split a slice into separate "write test", "write implementation", "run test", or "commit" tasks.
- If the route says
direct-change, skip branch prompts, spec creation, phase documents, task planning, and subagents unless the user explicitly asks for them. - If the route says
scaffold, do only what the user explicitly asked to scaffold. Prefer official or ecosystem-maintained generators for the named stack when current docs show one exists; self-author the skeleton only when that is safer, smaller, or no trustworthy generator exists. Record assumptions inCLAUDE.mdor.curdx/assumptions.mdwhen no project convention exists, then run the best detected baseline command throughcurdx-flow dev verifyor the project equivalent. - If the route says
product-inception, do not write application source yet. Produce compact product context artifacts and ask at most the missing high-leverage questions fromintent.missingFacts. - If the route says
greenfield-spec, bootstrap curdx-flow artifacts before app code: product context, constitution, requirements, design, tasks, then implementation. - If the route says
prototype, constrain scope to a success criterion; do not silently expand it into a production product. - If the route says
import-spec, preserve source artifact traceability in research/requirements/design/tasks rather than re-interviewing from scratch. - If
recommendedCapabilitiesincludes tool, workflow, or policy hints, use the recommendation only at its listed phase and only when it materially reduces uncertainty, improves context efficiency, or verifies real behavior. If a future recommendation is markedcheck-if-installed, skip silently when that capability is absent. - If the route says
epic-split, stop single-spec creation and run triage. - If a spec state is created, store
autoPolicyfor compatibility and setmaxGlobalIterationsfrom policy, defaulting to 30 if the helper fails.
Empty Workspace Rules
An empty folder is not a small feature request. When
topology.workspaceState == "empty", route by intent:
scaffold: the user named a stack or starter and expects files now.product-inception: the user has a product idea but missing domain, user, MVP, or acceptance facts.greenfield-spec: the product and stack are clear enough to plan a usable app.prototype: the user wants a demo/POC/spike.import-spec: the user supplied or referenced a PRD, design, OpenAPI, or other source artifact.
For greenfield work, create or preserve these context artifacts before coding:
docs/mission.md # product/user/problem
docs/roadmap.md # first usable slice and later slices
docs/tech-stack.md # chosen stack and assumptions
docs/constitution.md # quality, testing, security, UX, deployment rules
If the user already has equivalent files, reuse them. Do not create a separate methodology folder when the repository has a better convention.
The first implementation task in a greenfield app must be a walking skeleton: selected runtime roots, contract, dev environment, and verification command run together. For example, a full-stack app should prove a real UI route can call a real service health/status endpoint before business features begin.
Use ${CLAUDE_PLUGIN_ROOT}/references/greenfield-delivery.md as the detailed
contract for these artifacts and tasks.
Scaffold Source Selection
For scaffold, choose the source before writing files:
- Identify the requested target shape: frontend app, backend service, full-stack workspace, CLI, library, plugin, data tool, or another explicit shape from the user.
- When the user named a stack or framework, check the latest official docs or trusted ecosystem docs for the current scaffold command/API before running it. Treat package-manager create flows, documented remote initializer APIs, framework CLIs, templates, and project-local generators as candidates. Do not make any single stack special in the route logic.
- Prefer non-global, repeatable commands (
npm create,pnpm create,npx, package-managerdlx,curlto a documented initializer API, or a project-local generator). Avoid installing global CLIs. - If the generator is interactive and missing choices materially affect the result, ask one focused question. Otherwise choose conservative defaults from the user's request and record them.
- Self-author the scaffold only when no trustworthy generator exists, the generator cannot satisfy the requested constraints, the requested skeleton is intentionally smaller than the generator output, or a custom skeleton is clearly easier to verify. Record the reason.
- After generation, normalize scripts and run baseline verification. Do not claim the scaffold works without evidence.
New Spec Creation
For lite-spec, full-spec, greenfield-spec, prototype, and import-spec:
- Ensure the current branch is appropriate using
${CLAUDE_PLUGIN_ROOT}/references/branch-management.md. - Validate or ask for a kebab-case spec name only if missing.
- Validate or ask for the goal only if missing.
- Resolve the spec directory from
--specs-diror the default specs dir. - Create the spec directory, update
$defaultDir/.current-spec, and ensure.gitignorecovers$defaultDir/.current-spec,$defaultDir/.current-epic, and**/.progress.md.- If writing the marker under the default specs dir, write only the bare spec name, e.g.
greet-helper. - If writing a non-default spec root, write the relative path, e.g.
packages/api/specs/auth-flow. - Do not write
specs/<name>for default-root specs; that can be interpreted as a path by newer runtime resolvers. - Do not write a project-root
.current-spec; runtime state lives under the configured specs root. - Preferred write pattern:
mkdir -p "$defaultDir" if [ "$basePath" = "$defaultDir/$name" ]; then printf '%s\n' "$name" > "$defaultDir/.current-spec" else printf '%s\n' "$basePath" > "$defaultDir/.current-spec" fi
- If writing the marker under the default specs dir, write only the bare spec name, e.g.
- Compute compatibility policy:
ROUTE_JSON=$(curdx-flow route --name "$name" --goal "$goal" --flags "$ARGUMENTS") POLICY_JSON=$(printf '%s' "$ROUTE_JSON" | node -e 'let s="";process.stdin.on("data",c=>s+=c);process.stdin.on("end",()=>process.stdout.write(JSON.stringify(JSON.parse(s).policy)))') - Initialize the spec state file. The file lives at
$basePath/.curdx-state.json— never at the project root or anywhere else. Create the parent directory first if needed, then write the following shape:
All later mutations to this file (verification blocks, completion markers, task index updates) must go through{ "version": 2, "source": "spec", "name": "$name", "basePath": "$basePath", "identity": { "name": "$name", "basePath": "$basePath", "goal": "$goal" }, "phase": "research", "taskIndex": 0, "totalTasks": 0, "taskIteration": 1, "maxTaskIterations": "<POLICY_JSON.maxTaskIterations or 5>", "globalIteration": 1, "maxGlobalIterations": "<POLICY_JSON.maxGlobalIterations or 30>", "commitSpec": true, "quickMode": false, "executionDriver": "goal", "autoPolicy": "<POLICY_JSON object>", "route": "<ROUTE_JSON compact object>", "intent": "<ROUTE_JSON.intent object>", "completed": false }curdx-flow verify runorcurdx-flow state merge "$basePath/.curdx-state.json" '<patch>'. Do not hand-edit.curdx-state.jsonwith Write/Edit after creation — the CLI maintains schema invariants such asverificationBlocks.execution.srcMtime(epoch ms) that hand-written JSON routinely omits. - Create
.progress.mdwith the original goal and the selected behavior route.
If policy computation fails, use this fallback cap:
{ "maxGlobalIterations": 30 }
For lite-spec, keep interviews minimal and generate only 1-3 value-slice tasks.
For full-spec, continue with research and the normal phase flow.
For greenfield-spec, include product context and constitution before design,
then require a walking-skeleton task before feature slices.
For prototype, keep tasks bounded to the success criterion.
For import-spec, keep traceability to the imported source artifact in every
phase artifact.
When a spec state is created and router output includes topology, intent, or recommendedCapabilities, store compact copies in .curdx-state.json as projectTopology, intent, and recommendedCapabilities. If last-mile output is available, store a compact lastMile object with phase, problemType, problemTypes, capabilityPlan, evidenceRequired, and lastDecisionAt.
Quick Artifact Contract
When --quick causes this skill to generate phase artifacts inline instead of delegating through each phase command:
<mandatory>
The quick path does not lift the runtime-CLI contract for .curdx-state.json. Even in --quick --mode fast, do not Write/Edit the state file beyond the initial schema in "New Spec Creation" step 7. Verification blocks must be produced by curdx-flow verify run, and completion/iteration mutations must use curdx-flow state merge "$basePath/.curdx-state.json" '<patch>'. Hand-written verificationBlocks invariably miss srcMtime and break check-verification-blocks / verify-blocks invariants.
</mandatory>
tasks.mdmust still use the task-planner format contract.- Start
tasks.mdwith## Source Coverage Audit. - Every executable top-level task must be a checkbox list item, not a heading:
- [ ] 1.1 Implement greet helper
- **Do**:
1. Edit `src/greet.js`
2. Run `npm test`
- **Files**: `src/greet.js`, `test/greet.test.js`
- **Done when**: `greet(" Ada ")` and empty-name fallback pass
- **Verify**: `npm test`
- **Commit**: `feat(greet): implement greeting helper`
- _Requirements: FR-1, AC-1_
- Do not create heading-only task sections such as
## T1; runtime task parsing ignores them and/curdx-flow:statuswill reportempty-tasks. - If implementation is completed in the same quick run, run the final task's exact Verify command through the runtime recorder before marking completion:
This command actually executes the verification, recordscurdx-flow verify run --phase execution --command "<exact Verify command>" --spec "$name".curdx-state.json::verificationBlocks.executionwith the command, exit code, timestamp, and source mtime, and returns the verification exit code. If the verification fails, do not setcompleted: true; fix the issue and rerun the recorder. - If the goal, requirements, or acceptance criteria require browser evidence, Playwright, or Chrome DevTools MCP,
--check/file-existence commands are not sufficient completion evidence. The quick run must first perform the real browser interaction, then record the shell verifier with--descriptioncontaining the concrete browser proof: tool used, URL, action sequence, final DOM assertion, and console-error result. Do not mark completion when that proof is absent. - After recorded verification passes, mark the checkbox
[x], setcompleted: true, and leavetaskIndexequal to the number of top-level checkbox tasks.
Skill Discovery
Only scan and invoke additional skills when the route is lite-spec, full-spec, greenfield-spec, prototype, or import-spec. Match skills by semantic relevance to the goal. Skip discovery for direct-change and scaffold unless the user explicitly asks to use a skill.
Output
Always start with a short routing summary:
Route: <route>
Reason: <reason>
Next: <nextAction>
Then perform the next action. If the route is blocked-ask-user, ask exactly one focused question.
04 同仓库更多 Skills
help
Fixture help skill
verification-before-completion
Use when checking fixes, phase exits, completion evidence, or mock-heavy tests before claiming success.
triage
Use when a large feature should be decomposed into dependency-aware specs.
tasks
Use when a spec has design.md and needs implementation tasks.
switch
Use when changing the active spec by name or path.
status
Use when inspecting curdx-flow specs, active state, progress, or index status.