@devflow-core/dsh-devflow 0.4.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16,13 +16,14 @@ Turn an A/B `CUT_PASS`-bounded approved design or confirmed Spec into one review
16
16
  ## Authoring Process
17
17
 
18
18
  1. Read only source material, code, tests, and conventions relevant to the approved scope. Load `skills/devflow-spec/references/spec-plan-methods.md` and `skills/devflow-plan/references/plan-methods.md` before applying Plan Pack mechanics.
19
- 2. Map exact affected file responsibilities once in `## File Structure` before writing tasks. Reuse existing modules and name the intended file operation.
20
- 3. Perform bounded real investigation and record it as task-level `Prewalk`: actual `Execution Trace`, Current Handoff Facts, and only the unfinished `Remaining Structured Worklist`.
21
- 4. Split independent deliverables into small, reviewable tasks. Each task should be understandable without referring to another task, and it carries its own complete execution spec(执行规范)— `Files`, `Change mechanics`, `Steps`, and `Verify` so the executor edits directly from the task without re-reading the plan or the code for a pre-edit view(零 view).
22
- 5. Write the plan using the required header and task contract below.
23
- 6. Self-review Cut Decision fidelity, source coverage, File Structure, Prewalk evidence, file-operation classifications, interface consistency, concrete steps, acceptance proof, and scope exclusions.
19
+ 2. Map the intended touch set once: list the files and the responsibility each one carries. Reuse existing modules and name the intended file operation.
20
+ 3. Do the bounded investigation needed to write correct tasks. Keep that evidence in the conversation or in a learning card; it is not a plan field.
21
+ 4. Split independent deliverables into small, reviewable tasks. Each task carries `Files`, `Change`, `Acceptance`, `Verify`, and `Not doing` so an executor can act on it without reading another task.
22
+ 5. Write the plan using the required header, task contract, and `## Progress` table below.
23
+ 6. Self-review Cut fidelity, touch-set coverage, acceptance proof, scope exclusions, and Progress row count against the task count.
24
24
  7. Run `node scripts/devflow-plan.js <plan-file>` when the project-level checker exists. Otherwise resolve the user-level checker according to `core-methods.md` Script Path Resolution.
25
25
  8. **STOP — request user review.** On DSH, request review with the structured `ask_user_question` tool (single-select: approve / request changes). Revise and revalidate when requested. On approval, ask execution mode (single-select: `sequential` — the Build agent runs tasks in dependency order / `single-subagent` — the main agent only schedules: one subagent runs tasks one per round in dependency order / `fan-out` — independent tasks run as parallel subagents) and record it as the plan's optional `Execution mode` header. Then perform only a lightweight Cut-consistency review. An approved A/B Plan directly enters `devflow-build`; scope-drift facts return to `devflow-core`.
26
+ 9. On approval, advance the requirement row in `docs/requirements.md` to `planned` and fill the plan path in its artifact column.
26
27
 
27
28
  Default landing is `docs/plans/YYYY-MM-DD-<short-kebab-name>.md`, resolved from the target project root. Do not place implementation plans in `docs/features/` or `docs/specs/`.
28
29
 
@@ -33,88 +34,64 @@ Structural headers remain English so the checker can parse them; content uses th
33
34
  ```text
34
35
  # <Plan title>
35
36
 
37
+ Status: draft | approved | in-progress | done | abandoned
36
38
  Goal: <outcome>
37
- Architecture: <smallest design and boundaries>
38
- Tech Stack: <relevant existing stack>
39
- Source: <approved design or docs/specs/YYYY-MM-DD-<short-kebab-name>.md>
40
- Spec coverage: <requirements mapped to tasks, or design-only>
41
- Cut Decision: <CUT_PASS allowed scope, reuse conclusion, exclusions, verification constraints>
42
- External Skills: <skill-name>; role: <bounded specialist work>; expected evidence: <result needed by that node>; return facts: <result / not-applicable / failure> / none
39
+ Not doing: <scope excluded>
40
+ Cut: 做 <included> | 不做 <excluded> | 复用 <reused capability> | 验证 <verification> | Rejected: <at least one cut candidate, or none plus evidence why nothing could be cut>
41
+ Source: <approved design or docs/specs/YYYY-MM-DD-<short-kebab-name>.md> (optional)
43
42
  Execution mode: sequential | single-subagent | fan-out (optional; ask and record at approval)
43
+ Landed: <date and fresh evidence> (completion only)
44
44
 
45
- ## Global Constraints
46
- - <applicable boundary>
45
+ ## Tasks
47
46
 
48
- ## File Structure
47
+ Task: <short, independently understandable title>
48
+ Files:
49
+ - Create: <path> | new file | <responsibility>
50
+ - Modify: <path> | <symbol or stable anchor> | <responsibility>
51
+ - Test: <path> | <symbol or stable anchor> | <behavior proved> # only when applicable
52
+ Change: <what changes and its boundary; add the smallest mechanics only when the change crosses a module contract, is irreversible, or touches security or data boundaries>
53
+ Acceptance: <specific observable condition>
54
+ Verify: <exact command or manual scenario, trigger/input, and expected result>
55
+ Not doing: <scope excluded by this task>
56
+
57
+ ## Progress
49
58
 
50
- | File / symbol | Operation | Responsibility | Why here | Not responsible for |
51
- |---|---|---|---|---|
52
- | <path and stable anchor> | Create / Modify / Test | <one responsibility> | <placement rationale> | <explicit boundary> |
59
+ | # | Task | Status | Evidence |
60
+ |---|---|---|---|
61
+ | 1 | <task title> | todo | - |
53
62
  ```
54
63
 
64
+ The v2 header is deliberately slim: the Plan owns ordering and acceptance, while Cut owns the subtraction and Build owns how the change is implemented. `Cut` is one line and must carry a non-empty `Rejected` (or `none` plus evidence), so a plan without a real subtraction is visible instead of silently passing. `## Progress` is the resume and landing record: Build flips one row to `doing` or `done` and fills its evidence, and Prove writes `Landed` on `PASS`. A plan without `## Progress` and with a `Prewalk` block is a legacy plan; `scripts/devflow-plan.js` keeps validating it with the old rules, so existing plans never need migration.
65
+
55
66
  Inherit `External Skills` from the Cut Decision unchanged; the Plan Pack carries the specialist role, expected evidence, and return facts into Build and Prove. When a specialist skill is declared, merge its core quality checks into the affected tasks' `Acceptance` and `Verify` fields — the Plan Pack is the only channel that carries external-skill quality requirements into Build and Prove. A declared skill never widens the Cut scope; if its recommendation exceeds the Cut Decision, return the scope-drift facts to `devflow-core`.
56
67
 
57
68
  `Execution mode` is not part of Cut scope and does not change the checker. It is asked at approval and recorded so Build knows how to run tasks: sequentially as the Build agent itself, through one delegated subagent while the main agent only schedules, or fan out independent tasks to parallel subagents.
58
69
 
59
- Each task's `Files`, `Change mechanics`, `Steps`, and `Verify` form the only execution basis(执行规范)handed to the executor: dispatch sends just these fields, and the executor edits directly from them without a pre-edit view of the plan document, the code, or the anchors. `Read-basis` / `Live anchors` remain the plan author's evidence record, not executor re-read instructions.
70
+ Each task's `Files`, `Change`, `Acceptance`, `Verify`, and `Not doing` form the execution basis(执行规范)handed to the executor. Build may read the current task's named anchors and a directly changed neighbor to choose the smallest implementation; it must not broadly rediscover the repository, redesign outside the task boundary, silently repair the plan, or expand the touch set. A real anchor mismatch or verification failure returns `BUILD_BLOCKED` facts to `devflow-core` instead of a guessed edit.
60
71
 
61
72
  ## Required Task Contract
62
73
 
63
74
  ```text
64
75
  Task: <short, independently understandable title>
65
- Task type: Code change | Documentation-only
66
76
  Files:
67
77
  - Create: <path> | new file | <responsibility>
68
78
  - Modify: <path> | <symbol or stable anchor> | <responsibility>
69
- - Test: <path> | <test symbol or stable anchor> | <behavior proved> # only when applicable
70
- Interfaces:
71
- - Consumes: <exact symbol/API input and type/shape, or documentation-only exception>
72
- - Produces: <exact symbol/API output and type/shape, or documentation-only exception>
73
- Current behavior: <observable current state> # Code change only
74
- Target behavior: <observable outcome> # Code change only
75
- Change mechanics: <minimal code snippet, pseudocode, or exact replacement rule> # Code change only
76
- Call impact: <known callers/downstream effect, or no runtime impact> # Code change only
77
- Steps:
78
- - [ ] <one file + symbol/anchor + executable action; include the relevant snippet, pseudocode, or exact replacement for code logic>
79
- - [ ] <one verification action with trigger/input, expected result, and command or manual scenario>
79
+ - Test: <path> | <symbol or stable anchor> | <behavior proved> # only when applicable
80
+ Change: <what changes and its boundary; exact mechanics only when the change crosses a module contract, is irreversible, or touches security or data boundaries>
80
81
  Acceptance: <specific observable condition>
81
82
  Verify: <exact command or manual scenario, trigger/input, and expected result>
82
- Comments: <locations and reasons required by Code Documentation, project convention, or non-obvious boundaries; or "none — trivial change">
83
- Not doing: <scope excluded>
84
-
85
- Prewalk:
86
-
87
- Execution Trace:
88
- - Read: <actual file/symbol/range> → <observed fact relevant to this task>.
89
- - Traced: <actual caller, entry point, collaborator, contract, or test> → <observed path or constraint>.
90
- - Ran: <actual command or scenario> → <relevant result, including a failure when applicable>.
91
- - Edited: <actual file/symbol and change> → <reason; or "none yet">.
92
- - Verified: <actual check> → <observed result; or "none yet">.
93
-
94
- Current Handoff Facts:
95
- - Target anchors: <current file, symbol, or range the plan author verified (evidence record, not executor re-read instruction)>.
96
- - Nearby convention: <comparable inspected code and observed convention; or "no comparable code found">.
97
- - Direct path: <traced callers, collaborators, boundaries, affected tests; or "none">.
98
- - Current constraints: <observed contract, ordering, errors, compatibility; or "none">.
99
- - Planned touch set: <remaining expected files/symbols and reason>.
100
- - Risks / stop conditions: <facts requiring Core replan; or "none beyond ordinary Plan drift">.
101
-
102
- Remaining Structured Worklist:
103
- - [ ] <one independently completable remaining action with file/symbol and expected outcome>.
104
- Anchors: <minimum current anchors>.
105
- Verify: <command, test, call-path check, or observable result>.
106
- Done when: <fact proving this action is complete>.
83
+ Not doing: <scope excluded by this task>
107
84
  ```
108
85
 
109
- `File Structure` is one responsibility map, not a fixed architecture rule. For every non-trivial Code change, every task must carry a `Prewalk`. Each trace row records an action actually performed and its observed result; it cannot describe planned work. `Remaining Structured Worklist` contains only unfinished actions. Each item needs `Anchors`, `Verify`, and `Done when`; cap one task at 12 items. The executor reads the current task's execution spec (`Files`, `Change mechanics`, `Steps`, `Verify`), edits directly, runs `Verify`, appends actual evidence, and returns the observed difference as facts to `devflow-core` only when an edit or verification actually fails there is no pre-edit plan or code view. Documentation-only tasks retain their existing exception.
86
+ Use only `Create`, `Modify`, and `Test` file-operation labels. `Create` rows use `new file`; every other row names a symbol or stable anchor. `Change` states the executable intent and its boundary in one or two lines; it does not restate current behavior, target behavior, call impact, or interfaces unless the task changes a cross-module contract. The Plan no longer classifies tasks by `Task type`: a task whose files are all documentation paths is documentation-only, and the checker treats it that way.
110
87
 
111
- Use only `Create`, `Modify`, and `Test` file-operation labels. For a `Code change`, every existing-file row must name a symbol or stable anchor; `Create` rows use `new file`. `Current behavior`, `Target behavior`, `Change mechanics`, and `Call impact` are mandatory. `Change mechanics` must contain the smallest code snippet, pseudocode, or exact replacement rule that removes implementation inference. Interfaces name exact symbols and input/output shape. The verification step and `Verify` field name the trigger/input, expected result, and runnable command or manual scenario.
88
+ Six fields per task is the whole contract: ordering, the touch set, the intent, the acceptance condition, the proof command, and the exclusion. Investigation traces, handoff facts, per-task worklists, architecture, tech stack, spec coverage, and comment locations are owned by other nodes or stay in the conversation. `Prewalk`, `File Structure`, `Interfaces`, `Current behavior`, `Target behavior`, `Change mechanics`, `Call impact`, and `Comments` are not part of the v2 contract; a plan that still carries them is treated as legacy.
112
89
 
113
- `Documentation-only` is allowed only when no runtime code changes. Its `Consumes` and `Produces` entries explicitly say `documentation-only`; it cannot label a task that changes a code file. A task does not need a test file unless a test is needed for its stated behavior. Avoid vague work such as generic test additions, unnamed edge cases, cleanup, or cross-task shorthand.
90
+ Keep one task understandable on its own. Do not use cross-task shorthand, generic test additions, unnamed edge cases, or cleanup entries. Name a test file only when the stated behavior needs one.
114
91
 
115
92
  ## Boundaries
116
93
 
117
- Plan generation does not repeat Cut, perform Build or Prove, prescribe independent review, test-first workflow, version-control task steps, or execute automatically. It converts `CUT_PASS` into a static construction checklist. The checker validates static structure; it does not judge architecture or lifecycle state. Plan generation writes the execution spec(执行规范); the zero-view(零 view)execution discipline belongs to `plan-methods.md` and `devflow-build` a Plan Pack must not include execution-phase re-read or pre-edit review instructions.
94
+ Plan generation does not repeat Cut, perform Build or Prove, prescribe independent review, test-first workflow, version-control task steps, or execute automatically. It converts `CUT_PASS` into a slim construction checklist plus a Progress record. The checker validates static structure; it does not judge architecture or lifecycle state. The v2 contract applies to new plans only; legacy plans keep the old validation rules and are never migrated or rewritten.
118
95
 
119
96
  ## Anti-Rationalization
120
97
 
@@ -131,14 +108,13 @@ Plan generation does not repeat Cut, perform Build or Prove, prescribe independe
131
108
 
132
109
  Before leaving this skill, confirm:
133
110
 
134
- - [ ] `CUT_PASS` is cited with allowed scope, reuse conclusion, exclusions, and verification constraints.
111
+ - [ ] `Cut` is one line with / 不做 / 复用 / 验证 and a non-empty `Rejected`.
135
112
  - [ ] `External Skills` is inherited from the Cut Decision; declared skills' quality checks are merged into task `Acceptance`/`Verify`.
136
113
  - [ ] Execution mode was asked at approval and recorded as the optional `Execution mode` header.
137
- - [ ] Approved design or saved spec is cited as `Source`.
138
- - [ ] `Spec coverage` maps the source to plan tasks.
139
- - [ ] Header, constraints, File Structure, interfaces, concrete steps, acceptance, verification, context-specific comments, exclusions, and task-level Prewalk records are present.
140
- - [ ] Each trace entry is an observed past action/result; each remaining worklist item is bounded, verified, and fact-complete.
141
- - [ ] Every task is independently understandable, requires no pre-edit read, and has no unresolved or vague placeholder.
114
+ - [ ] Approved design or saved spec is cited as optional `Source`.
115
+ - [ ] Header, tasks, and `## Progress` match the v2 contract; each task has six fields and no legacy field.
116
+ - [ ] Every task is independently understandable and has no unresolved or vague placeholder.
117
+ - [ ] Progress row count equals task count; every `done` row carries evidence.
142
118
  - [ ] The checker passed when available.
143
119
  - [ ] The user reviewed the written plan.
144
120
  - [ ] An approved A/B Plan entered `devflow-build`; any scope-drift facts returned to `devflow-core`.
@@ -2,73 +2,51 @@
2
2
 
3
3
  Use this reference after `skills/devflow-spec/references/spec-plan-methods.md` and before writing a Plan Pack. It defines the smallest handoff that lets another executor continue approved work without repeating broad repository discovery.
4
4
 
5
- ## File Structure
5
+ ## Touch Set
6
6
 
7
- Write one `## File Structure` table before tasks:
7
+ State the intended touch set once, before tasks: the files and the responsibility each one carries. Reuse the nearest owner when it already has the responsibility. If no target can hold the responsibility without a materially different concern, return the fact to Core instead of inventing a generic abstraction.
8
8
 
9
- ```text
10
- | File / symbol | Operation | Responsibility | Why here | Not responsible for |
11
- |---|---|---|---|---|
12
- | [path and stable anchor] | Create / Modify / Test | [one responsibility] | [placement rationale] | [explicit boundary] |
13
- ```
9
+ The v2 Plan Pack has no `File Structure` table. The per-task `Files` rows are the touch set; a global table would only restate them.
14
10
 
15
- The table states where approved responsibility belongs. It does not mandate a class count, layer, pattern, or automatic file split. Reuse the nearest owner when it already has the responsibility. If no target can hold the responsibility without a materially different concern, return the fact to Core rather than inventing a generic abstraction.
11
+ ## Task Rows
16
12
 
17
- ## Prewalk
18
-
19
- Every non-trivial Code change task ends with `Prewalk`. It is an append-only handoff with three parts:
13
+ Each task carries exactly six fields:
20
14
 
21
15
  ```text
22
- Prewalk:
23
-
24
- Execution Trace:
25
- - Read: [actual file/symbol/range] → [observed fact].
26
- - Traced: [actual caller, entry point, collaborator, contract, or test] → [observed path or constraint].
27
- - Ran: [actual command or scenario] → [relevant result].
28
- - Edited: [actual file/symbol and change] → [reason; or "none yet"].
29
- - Verified: [actual check] → [observed result; or "none yet"].
30
-
31
- Current Handoff Facts:
32
- - Target anchors: [current file/symbol/range the plan author verified; evidence record, not executor re-read instruction].
33
- - Nearby convention: [inspected comparable code and observed convention; or "no comparable code found"].
34
- - Direct path: [traced callers, collaborators, boundaries, affected tests; or "none"].
35
- - Current constraints: [observed contract, ordering, error behavior, compatibility; or "none"].
36
- - Planned touch set: [remaining expected files/symbols and reason].
37
- - Risks / stop conditions: [facts that require Core replan; or "none beyond ordinary Plan drift"].
38
- - Read-basis: [已读文件清单——计划作者的证据簿记,执行者不重读].
39
- - Live anchors: [计划作者已确认的锚点——执行者不重读,仅作失败回报时的定位].
40
-
41
- Remaining Structured Worklist:
42
- - [ ] [one independently completable remaining action with file/symbol and expected outcome].
43
- Anchors: [minimum current anchors].
44
- Verify: [command, test, call-path check, or observable result].
45
- Done when: [fact proving completion].
16
+ Task: <short, independently understandable title>
17
+ Files: <Create / Modify / Test rows with path and symbol or stable anchor>
18
+ Change: <what changes and its boundary>
19
+ Acceptance: <specific observable condition>
20
+ Verify: <command or manual scenario with trigger, input, and expected result>
21
+ Not doing: <scope excluded by this task>
46
22
  ```
47
23
 
48
- ### Trace Rules
24
+ `Change` states the executable intent. Add exact mechanics only when the change crosses a module contract, is irreversible, or touches security or data boundaries. Otherwise the executor chooses the smallest implementation inside the task boundary. This is the deliberate trade: the plan stops pre-deciding every edit, and Build regains bounded implementation authority. That trade is the fix for the bloated-plan problem, not a relaxation of proof.
25
+
26
+ Investigation evidence does not belong in the plan. Keep it in the conversation, or in a `.copilot/cards/` learning card when it is reusable across tasks.
49
27
 
50
- - Record only work actually performed and what it observed. Do not write future-tense discovery instructions as trace evidence.
51
- - `Read`, `Traced`, `Ran`, `Edited`, and `Verified` may say `none yet` only where that action truly has not happened. At least one actual read or trace result is required for a Code change handoff.
52
- - A failed command is valid evidence when its relevant failure is recorded. Do not rewrite it as success.
53
- - The executor appends real evidence after completing each remaining work item; it does not erase prior trace facts.
28
+ ## Progress Table
54
29
 
55
- ### Worklist Rules
30
+ Close the plan with one row per task:
31
+
32
+ ```text
33
+ | # | Task | Status | Evidence |
34
+ |---|---|---|---|
35
+ | 1 | <task title> | todo | - |
36
+ ```
56
37
 
57
- - Include only unfinished work. Completed work belongs in `Execution Trace`.
58
- - Order work by dependency. Keep every item independently verifiable.
59
- - Require `Anchors`, `Verify`, and `Done when` for each item. Generic phrases such as “check the code” do not prove completion.
60
- - Limit one task to 12 remaining items. Group mechanical substeps under one verified result or return a scope-splitting fact to Core.
38
+ Status values are `todo`, `doing`, and `done`. Build flips the row it is working on and fills the evidence with the command and key result. Prove writes `Status: done` and `Landed:` on `PASS`. A `done` row without evidence fails the checker, and a plan whose header `Status` is `done` requires every row to be `done`. The table is why an interrupted session can resume: the next reader sees exactly what landed and what did not.
61
39
 
62
- ## Delegated Execution
40
+ ## Execution Handoff
63
41
 
64
- A delegated executor — the main agent itself, one delegated subagent, or one fan-out subagent — never re-reads the plan document, the latest trace, the anchors, the goal, or the code for a pre-edit view. It receives only the current task's execution spec (`Files`, exact replacement rules, `Steps`, `Verify`), edits those files directly, runs the task's `Verify` command, and returns actual evidence or failure facts to the orchestrating Build agent. `Read-basis` and `Live anchors` stay in the plan as the plan author's evidence record (the checker requires them); they are not executor re-read instructions.
42
+ An executor — the main agent itself, one delegated subagent, or one fan-out subagent — receives the current task's six fields. It may read the task's named anchors and one directly changed neighbor to choose the smallest implementation; it must not broadly rediscover the repository, redesign outside the task boundary, silently repair the plan, or expand the touch set.
65
43
 
66
- When an edit cannot be applied or a `Verify` fails, the executor returns the observed difference — affected file/anchor, actual behavior, blocked verification, and smallest replan decision — as facts to `devflow-core`; it does not pre-check anchors and does not guess past a failed edit. A stale line reference may be corrected without returning only when the symbol, contract, responsibility, and intended outcome are unchanged.
44
+ When an edit cannot be applied, a `Verify` fails, or a bounded read finds changed contract behavior, the executor returns the observed difference — affected file/anchor, actual behavior, blocked verification, and the smallest replan decision — as facts to `devflow-core`. It never guesses past a mismatch.
67
45
 
68
46
  ### Fan-out
69
47
 
70
- When the plan's `Execution mode` is `fan-out`, one Build orchestrator partitions tasks into parallel groups and dispatches each task to a subagent. Every subagent receives only its own task's execution spec, edits its task's `Files` directly, runs its task's `Verify`, and returns evidence or failure facts; it does not re-read the plan, the trace, the anchors, or the code. Two tasks may run in parallel only when their `Files` touch disjoint file/symbol sets and neither `Interfaces` consumes a symbol the other `Produces`; tasks sharing a file/symbol or with a consume/produce dependency run in sequence. The orchestrator merges returned results, reconciles cross-task overlap, and enters Prove once with merged evidence.
48
+ When the plan's `Execution mode` is `fan-out`, one Build orchestrator partitions tasks into parallel groups and dispatches each task to a subagent. Every subagent receives only its own task's six fields, reads its anchors, edits its task's `Files`, runs its task's `Verify`, flips its Progress row, and returns evidence or failure facts. Two tasks may run in parallel only when their `Files` touch disjoint file/symbol sets and neither task's `Change` consumes what the other produces; tasks sharing a file/symbol or with a dependency run in sequence. The orchestrator merges returned results, reconciles cross-task overlap, and enters Prove once with merged evidence.
71
49
 
72
50
  ### Single-subagent
73
51
 
74
- When the plan's `Execution mode` is `single-subagent`, the main agent only schedules: it dispatches one task's execution spec at a time to one executor subagent, waits for the return, then merges the returned evidence and enters Prove once. The main agent dispatches one task at a time — only that task's execution spec, not the whole plan. The subagent edits that task's `Files` directly, runs its `Verify`, appends actual evidence, and returns the task results and evidence or `BUILD_BLOCKED` facts; the next task continues the same subagent conversation through `send_message`. On DeepSeek Harness (DSH), subagent turns are time-bounded, so one task per round is the norm; a timeout or truncated return retries that one task once with a narrower instruction. The subagent never re-reads the plan, the trace, the anchors, or the code for a pre-edit view. Nothing runs in parallel; prefer this mode for small to medium plans or plans whose tasks are strongly dependent, and keep `fan-out` for large parallel plans.
52
+ When the plan's `Execution mode` is `single-subagent`, the main agent only schedules: it dispatches one task's six fields at a time to one executor subagent, waits for the return, then merges the returned evidence and enters Prove once. The subagent reads its anchors, edits, verifies, flips its Progress row, and returns the task result and evidence or `BUILD_BLOCKED` facts. The next task continues the same subagent conversation through `send_message`. On DeepSeek Harness (DSH), subagent turns are time-bounded, so one task per round is the norm; a timeout or truncated return retries that one task once with a narrower instruction. Nothing runs in parallel; prefer this mode for small to medium plans or plans whose tasks are strongly dependent, and keep `fan-out` for large parallel plans.
@@ -11,17 +11,20 @@ No proof, no completion.
11
11
 
12
12
  ## Methodology Assets
13
13
 
14
- When this skill activates, read these local references before choosing or running proof scenarios:
14
+ Context loading is conditional and selected by changed surface.
15
15
 
16
- - `skills/devflow-prove/references/flow-self-test.md` end-to-end scenario tests and pressure scenarios for the framework itself.
17
- - `skills/devflow-prove/references/code-review-checklist.md` — language-specific code quality criteria for adversarial code review.
16
+ When this skill activates, read only the references required by the changed surface:
17
+
18
+ - Always read `skills/devflow-prove/references/proof-recovery-methods.md` — shared proof and recovery method.
19
+ - Read `skills/devflow-prove/references/flow-self-test.md` only when the change touches DevFlow runtime rules, skills, commands, host adapters, hooks, validators, scenarios, installers, or harness behavior.
20
+ - For code, read `skills/devflow-prove/references/code-review-checklist.md` and apply only the matching language section: `.js/.jsx/.ts/.tsx` -> TypeScript / JavaScript plus React/Vue when present; `.py` -> Python; `.go` -> Go; `.java` -> Java; `.cs` -> C# / .NET; `.sql` -> SQL. Always apply General Engineering Review. Unlisted extensions use General Engineering Review and record the missing language checklist.
18
21
 
19
22
  ## Process
20
23
 
21
24
  Load `skills/devflow-prove/references/proof-recovery-methods.md` before selecting proof. It owns the shared proof and recovery method details used by Prove and PUA.
22
25
 
23
26
  1. Identify the command, test, build, lint, diff check, validation script, or manual scenario that proves the claim.
24
- 2. Confirm the exact changed files, approved File Structure/Plan boundary, latest Prewalk Execution Trace and Current Handoff Facts. Read the task's remaining-work completion evidence plus the nearest comparable code.
27
+ 2. Confirm the exact changed files, approved File Structure/Plan boundary, latest Prewalk Execution Trace and Current Handoff Facts. Read task-local completion evidence plus only the nearest directly relevant code or contract.
25
28
  3. Run the narrowest sufficient check now, then independently inspect the actual implementation diff before interpreting test results.
26
29
  4. Run adversarial review (对抗式审查) against the approved responsibility boundary, Prewalk facts, direct contracts, nearby convention, and likely regressions.
27
30
  5. For code changes: run the **Code Quality Review** (General Engineering Review + Language-Specific Checklist from `code-review-checklist.md`), then generate a **Code Review Report** (see format below). Classify each evidence-backed finding as Blocker, Warning, or Recommendation. An unresolved Blocker or Warning returns `FAIL` facts to Core; recommendations do not block an otherwise proven result.
@@ -89,6 +92,8 @@ Coverage: <what was verified>
89
92
  Not covered: <none or explicit gap>
90
93
  ```
91
94
 
95
+ On `PASS` with a plan file, write back before reporting: header `Status: done` plus `Landed: <date> · <evidence>`; every `## Progress` row must already be `done` with evidence. `PASS` also requires the `docs/requirements.md` row to be terminal — write `landed` with the evidence, or return the missing-row facts to Core. On `FAIL` or `BLOCKED`, leave `Status` unchanged and report facts to Core.
96
+
92
97
  ## Code Review Report
93
98
 
94
99
  For code changes, after running the Code Quality Review (General Engineering Review + Language-Specific Checklist), generate this report before claiming PASS or FAIL. Review the actual diff before relying on test results. A Blocker or unresolved Warning returns `FAIL` facts to Core; Recommendations remain visible but do not independently prevent PASS.
@@ -96,8 +101,8 @@ For code changes, after running the Code Quality Review (General Engineering Rev
96
101
  ```text
97
102
  Code Review Report:
98
103
  - Diff reviewed: [actual changed files/ranges].
99
- - Plan boundary: [approved File Structure row(s) and verdict].
100
- - Prewalk evidence: [Execution Trace, Handoff Facts, remaining-work completion evidence].
104
+ - Plan boundary: [approved task `Files` rows and verdict; legacy plans may cite `File Structure` rows].
105
+ - Progress evidence: [Progress rows with their Status and recorded command/result; legacy plans may cite Prewalk evidence].
101
106
  - Comparable code: [nearest inspected file/symbol and observed convention].
102
107
  - Blockers: [count].
103
108
  1. [Blocker] [file:line] — [changed-code evidence and concrete risk] → [smallest correction].
@@ -2,7 +2,7 @@
2
2
 
3
3
  Use these scenarios to verify the framework from request to landing. A scenario passes only when the expected skill behavior, output contract, and proof are visible.
4
4
 
5
- ## Scenario 1: Vague Feature Request
5
+ ## Scenario 1: Vague Or Material-Risk Feature Request
6
6
 
7
7
  Input:
8
8
 
@@ -14,6 +14,7 @@ Expected behavior:
14
14
 
15
15
  - Route: Design.
16
16
  - Skill path: `devflow-core -> devflow-brainstorm -> Confirmed request -> user-selected A/B/C direct branch`.
17
+ - Core must classify the request as ambiguous/material-risk before entering Brainstorm and pass a suitable depth hint.
17
18
  - Brainstorm must read current project context before clarifying.
18
19
  - Brainstorm must send a Semantic Echo-Back, apply the Understanding Revision Rule when a correction changes the request, then ask or infer only goal, scope, exclusions, constraints, acceptance, and open questions.
19
20
  - Brainstorm must output the fixed `Confirmed request` summary with `Status: clarified`, present A/B/C, and wait for explicit user selection.
@@ -190,7 +191,7 @@ Expected behavior:
190
191
  - Route: Fast verification
191
192
  - Skill path: `devflow-core -> devflow-prove`
192
193
  - Must check `AGENTS.md`, `CLAUDE.md`, Copilot instructions, VS Code instruction/prompt, CodeBuddy rule, plugin metadata, and Gemini metadata.
193
- - Must confirm platform adapters preserve `Sense -> Brainstorm clarification -> user-selected A/B/C -> direct success edges -> devflow-prove`, with Core routing non-unique exceptions.
194
+ - Must confirm platform adapters preserve the risk gate: skip-Brainstorm Design-lite is Cut -> Build -> Prove; ambiguous or material-risk work is Sense -> Brainstorm clarification -> user-selected A/B/C -> direct success edges -> devflow-prove, with Core routing non-unique exceptions. Unapproved edits never use Fast.
194
195
  - Must confirm plugin metadata includes all shipped skills and commands.
195
196
  - Must not rewrite adapter rules unless drift is proven.
196
197
 
@@ -281,8 +282,10 @@ In README, rename "Proof Gate" to "Proof Before Done".
281
282
 
282
283
  Expected behavior:
283
284
 
284
- - Route: Build because implementation is requested and scope is clear.
285
- - Still run a lightweight Sense and Cut.
285
+ - Route: Design-lite because implementation is requested and the low-risk gate passes.
286
+ - This is a clear low-risk existing behavior change; Core records `Brainstorm required: no` and `Depth hint: skip`, then select `devflow-cut` directly with a Design-lite contract and Depth C.
287
+ - Core may bypass Brainstorm only after the low-risk gate passes.
288
+ - `CUT_PASS` enters Build, then Prove. Cut and Prove remain mandatory. Unapproved edits never use Fast.
286
289
  - Touch only the requested file.
287
290
  - Verify with text search.
288
291
 
@@ -380,7 +383,7 @@ Expected behavior:
380
383
  - Cut compares nearest order-history patterns and records convention, responsibility, performance, and readability checks.
381
384
  - It must not require a Service split, interface, cache, or fixed function length without current evidence.
382
385
  - Build makes business intent, key rules, failure paths, and side effects locally understandable, then records a Readability Check.
383
- - Prove reviews the actual diff against File Structure, Prewalk evidence, project-convention alignment, local understandability, responsibility boundaries, and any cache benefit/invalidation/consistency claim.
386
+ - Prove reviews the actual diff against the plan task boundary, Progress evidence, project-convention alignment, local understandability, responsibility boundaries, and any cache benefit/invalidation/consistency claim.
384
387
  - A coherent orchestration change passes when its responsibility, side effects, and direct contracts remain evidenced in the diff.
385
388
  - A changed responsibility or unrecorded side effect is a Blocker or Warning only when the diff shows concrete risk; a justified local convention deviation remains non-blocking.
386
389
 
@@ -410,20 +413,22 @@ Expected behavior:
410
413
  - Brainstorm presents A/B/C after the confirmed request. User-selected A starts Spec directly; Core routes only missing-depth, changed-intent, or non-success facts.
411
414
  - Spec must compare real no-change/reuse, direct, and relevant existing-pattern options; it writes the design contract/saved spec, waits for user approval, then an approved A Spec directly enters Cut.
412
415
  - A/B `CUT_PASS` directly enters Plan; only `CUT_REDUCE`, `CUT_REUSE`, `CUT_BLOCKED`, or other non-success facts return to Core.
413
- - A Code change Plan Pack requires a concrete `File Structure` row per target and task-level `Prewalk`: actual `Execution Trace`, `Current Handoff Facts`, and bounded `Remaining Structured Worklist`.
414
- - A delegated Build agent reads the latest trace, then re-reads only the current work item's anchors and directly changed neighbor. It does not restart broad discovery or re-decide responsibility by default.
416
+ - A v2 Plan Pack carries a slim header, one six-field task per deliverable, a mandatory `Cut` line with a non-empty `Rejected`, and a `## Progress` table.
417
+ - Build may read the current task's anchors and one directly changed neighbor to choose the smallest implementation, flips the task's Progress row, and records the command and result as evidence.
418
+ - Prove writes `Status: done` and `Landed:` on `PASS`; a `done` Progress row without evidence is not `PASS`.
419
+ - A legacy plan that still carries `File Structure` and `Prewalk` remains valid under the legacy rules.
415
420
  - A user-approved Plan Pack receives a lightweight Cut-consistency review; an approved A/B Plan directly enters Build, while scope-drift facts return to Core.
416
421
  - Saved plan files default to `docs/plans/YYYY-MM-DD-<short-kebab-name>.md`.
417
422
  - Must not save implementation plans under `docs/features/`; that directory is for feature ledgers.
418
423
  - Must run `node scripts/devflow-plan.js <plan-file>` when the plan is saved to a file. If not found at `scripts/devflow-plan.js` (project-level), try `~/.codex/scripts/devflow-plan.js` or `~/.claude/scripts/devflow-plan.js` (user-level). Do NOT look under `skills/scripts/`.
419
- - Must fail or revise a plan missing a responsibility map, actual trace evidence, current handoff facts, bounded work items, or concrete verification. The checker does not approve an architecture pattern.
424
+ - Must fail or revise a v2 plan missing `Rejected`, a six-field task, a Progress row matching the task count, evidence on a `done` row, or a runnable `Verify`. The checker does not approve an architecture pattern.
420
425
 
421
426
  Pass check:
422
427
 
423
428
  ```text
424
- CUT_PASS: allowed scope / reuse conclusion / exclusions / verification constraints
429
+ CUT_PASS: / 不做 / 复用 / 验证 plus Rejected
425
430
  Command: node scripts/devflow-plan.js docs/plans/YYYY-MM-DD-<short-kebab-name>.md
426
- Result: DevFlow plan pack report; File Structure: ok; trace and remaining worklist: ok; Judgment: PASS
431
+ Result: DevFlow plan pack report; Format: v2; Cut Rejected: ok; Progress rows match tasks; Judgment: PASS
427
432
  Next: lightweight Cut-consistency review -> confirmed Plan and scope-drift facts -> devflow-core
428
433
  Judgment: PASS / FAIL / BLOCKED
429
434
  ```
@@ -439,8 +444,8 @@ The approved export plan is implemented. Verify it and mark it ready.
439
444
  Expected behavior:
440
445
 
441
446
  - Route: Prove.
442
- - Prove reads the actual diff before interpreting test output, and compares it with the approved `File Structure`, current `Execution Trace`, `Current Handoff Facts`, remaining-work completion evidence, and nearest comparable code.
443
- - The Code Review Report names the reviewed diff, plan boundary, Prewalk evidence, comparable code, Blockers, Warnings, Recommendations, and boundary verdict.
447
+ - Prove reads the actual diff before interpreting test output, and compares it with the approved task boundary, Progress evidence, and nearest comparable code.
448
+ - The Code Review Report names the reviewed diff, plan boundary, Progress evidence, comparable code, Blockers, Warnings, Recommendations, and boundary verdict.
444
449
  - An unresolved evidence-backed Blocker or Warning returns `FAIL` facts to Core; Recommendations alone do not prevent PASS.
445
450
  - A function size, class name, dependency count, cache preference, or fixed architecture shape without changed-code evidence and concrete risk is not a blocking finding.
446
451
 
@@ -448,8 +453,8 @@ Pass check:
448
453
 
449
454
  ```text
450
455
  Diff reviewed: actual changed files/ranges
451
- Plan boundary: File Structure row(s) and verdict
452
- Prewalk evidence: Trace / Handoff Facts / completion evidence
456
+ Plan boundary: approved task Files rows and verdict
457
+ Progress evidence: row Status plus recorded command/result
453
458
  Blockers: 0
454
459
  Warnings: 0
455
460
  Recommendations: 0 or documented
@@ -683,7 +688,7 @@ Judgment: FAIL
683
688
  Input:
684
689
 
685
690
  ```text
686
- A Build subagent receives an approved Plan whose latest Prewalk trace records `OrderHistoryQuery`, its API handler, and current authorization behavior. The first remaining work item anchors the query and handler. A minimal anchor reread discovers a new authorization policy that changes denial behavior and the requested rule's placement.
691
+ A Build subagent receives an approved legacy Plan whose latest Prewalk trace records `OrderHistoryQuery`, its API handler, and current authorization behavior. The first remaining work item anchors the query and handler. A minimal anchor reread discovers a new authorization policy that changes denial behavior and the requested rule's placement.
687
692
  ```
688
693
 
689
694
  Expected behavior:
@@ -2,6 +2,10 @@
2
2
 
3
3
  Owners: `devflow-prove` and `devflow-pua`. Load this reference after completed Build directly enters Prove or when Core selects Proof or Recovery for a non-unique artifact.
4
4
 
5
+ ## Proof Context Selection
6
+
7
+ Keep proof context proportional to the change. Always load this reference. Load `flow-self-test.md` only for DevFlow runtime, skill, command, host, hook, validator, scenario, installer, or harness changes; ordinary application changes use the changed file, its direct contract, and the relevant proof command. Load `code-review-checklist.md` for code and apply General Engineering Review plus only language sections matching changed extensions. Narrow context does not weaken diff review, adversarial review, or fresh proof.
8
+
5
9
  ## Method 13: Proof Before Done
6
10
 
7
11
  Run fresh, narrow evidence before a completion claim. Rules and skills need file, trigger, load, and downstream evidence. Code needs a focused test, build, lint, typecheck, or reproducible scenario. A bug fix needs symptom or regression proof.
@@ -52,6 +52,7 @@ Do not force a spec for Design-lite work where a short design contract and quick
52
52
  - Design: the comparison names the real alternatives and the selected approach has an explicit trade-off.
53
53
  6. Run `node scripts/devflow-spec.js <spec-file>` when the script exists. If not found at `scripts/devflow-spec.js` (project-level), try `~/.codex/scripts/devflow-spec.js` or `~/.claude/scripts/devflow-spec.js` (user-level). Do NOT look under `skills/scripts/`. See `core-methods.md` Script Path Resolution.
54
54
  7. **STOP — Wait for user approval of the design contract and spec.** On DSH, request approval with the structured `ask_user_question` tool (single-select: approve / request changes). Tell the user the spec path and review result. If they request changes, revise the comparison/design contract and re-run self-review. An approved A-branch Spec directly enters `devflow-cut`; any non-success state returns facts to `devflow-core`.
55
+ 8. On approval, advance the requirement row in `docs/requirements.md` to `designed` and fill the spec path in its artifact column.
55
56
 
56
57
  ## Output
57
58
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devflow-core/dsh-devflow",
3
- "version": "0.4.0",
3
+ "version": "0.6.0",
4
4
  "description": "DevFlow for DeepSeek Harness: devflow-2 agent preset + skills + commands + verification scripts, synced into ~/.dsh on host startup.",
5
5
  "type": "module",
6
6
  "engines": {