@devflow-core/dsh-devflow 0.1.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.
Files changed (61) hide show
  1. package/NOTICE +13 -0
  2. package/README.md +82 -0
  3. package/assets/commands/devflow-adversarial.toml +11 -0
  4. package/assets/commands/devflow-audit.toml +32 -0
  5. package/assets/commands/devflow-debt.toml +42 -0
  6. package/assets/commands/devflow-find-fault.toml +11 -0
  7. package/assets/commands/devflow-learn.toml +21 -0
  8. package/assets/commands/devflow-plan.toml +58 -0
  9. package/assets/commands/devflow-prove.toml +20 -0
  10. package/assets/commands/devflow-pua.toml +40 -0
  11. package/assets/commands/devflow-review.toml +36 -0
  12. package/assets/commands/devflow-spec.toml +49 -0
  13. package/assets/commands/devflow.toml +35 -0
  14. package/assets/presets/devflow-2/NOTICE +4 -0
  15. package/assets/presets/devflow-2/README.md +71 -0
  16. package/assets/presets/devflow-2/agent.cordis.yml +337 -0
  17. package/assets/presets/devflow-2/custom-bash.mjs +213 -0
  18. package/assets/presets/devflow-2/preset.yml +3 -0
  19. package/assets/presets/devflow-2/tool-bootstrap.mjs +496 -0
  20. package/assets/scripts/devflow-audit.js +275 -0
  21. package/assets/scripts/devflow-debt.js +196 -0
  22. package/assets/scripts/devflow-doctor.js +90 -0
  23. package/assets/scripts/devflow-plan.js +638 -0
  24. package/assets/scripts/devflow-review.js +93 -0
  25. package/assets/scripts/devflow-spec.js +238 -0
  26. package/assets/skills/devflow-adversarial/SKILL.md +71 -0
  27. package/assets/skills/devflow-audit/SKILL.md +78 -0
  28. package/assets/skills/devflow-brainstorm/SKILL.md +176 -0
  29. package/assets/skills/devflow-brainstorm/references/interview-discipline.md +184 -0
  30. package/assets/skills/devflow-build/SKILL.md +238 -0
  31. package/assets/skills/devflow-build/references/build-methods.md +40 -0
  32. package/assets/skills/devflow-core/SKILL.md +93 -0
  33. package/assets/skills/devflow-core/references/core-methods.md +131 -0
  34. package/assets/skills/devflow-core/references/reference-projects.md +133 -0
  35. package/assets/skills/devflow-core/references/skill-guide.md +63 -0
  36. package/assets/skills/devflow-cut/SKILL.md +208 -0
  37. package/assets/skills/devflow-cut/references/cut-methods.md +65 -0
  38. package/assets/skills/devflow-cut/references/native-capability-checklist.md +112 -0
  39. package/assets/skills/devflow-docs-followup/SKILL.md +132 -0
  40. package/assets/skills/devflow-docs-followup/agents/openai.yaml +4 -0
  41. package/assets/skills/devflow-find-fault/SKILL.md +109 -0
  42. package/assets/skills/devflow-learn/SKILL.md +176 -0
  43. package/assets/skills/devflow-plan/SKILL.md +142 -0
  44. package/assets/skills/devflow-plan/references/plan-methods.md +74 -0
  45. package/assets/skills/devflow-project-knowledge/SKILL.md +354 -0
  46. package/assets/skills/devflow-prove/SKILL.md +216 -0
  47. package/assets/skills/devflow-prove/references/code-review-checklist.md +202 -0
  48. package/assets/skills/devflow-prove/references/flow-self-test.md +775 -0
  49. package/assets/skills/devflow-prove/references/proof-recovery-methods.md +26 -0
  50. package/assets/skills/devflow-pua/SKILL.md +197 -0
  51. package/assets/skills/devflow-pua/references/flavor-display.md +49 -0
  52. package/assets/skills/devflow-pua/references/methodology-library.md +193 -0
  53. package/assets/skills/devflow-pua/references/methodology-router.md +78 -0
  54. package/assets/skills/devflow-spec/SKILL.md +92 -0
  55. package/assets/skills/devflow-spec/references/spec-plan-methods.md +15 -0
  56. package/cordis.patch.yml +11 -0
  57. package/lib/dsh-home.js +33 -0
  58. package/lib/index.js +79 -0
  59. package/lib/mount-once.js +34 -0
  60. package/lib/sync.js +168 -0
  61. package/package.json +32 -0
@@ -0,0 +1,775 @@
1
+ # DevFlow Self-Test Scenarios
2
+
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
+
5
+ ## Scenario 1: Vague Feature Request
6
+
7
+ Input:
8
+
9
+ ```text
10
+ Add search to the dashboard.
11
+ ```
12
+
13
+ Expected behavior:
14
+
15
+ - Route: Design.
16
+ - Skill path: `devflow-core -> devflow-brainstorm -> Confirmed request -> user-selected A/B/C direct branch`.
17
+ - Brainstorm must read current project context before clarifying.
18
+ - 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
+ - Brainstorm must output the fixed `Confirmed request` summary with `Status: clarified`, present A/B/C, and wait for explicit user selection.
20
+ - Brainstorm must not choose an approach, route, depth, design contract, or handoff; it starts only the user-selected direct branch.
21
+ - A directly follows Brainstorm -> Spec -> Cut -> Plan -> Build -> Prove; B directly follows Brainstorm -> Cut -> Plan -> Build -> Prove; C directly follows Brainstorm -> Cut -> Build -> Prove.
22
+ - An approved A-branch Spec directly enters Cut, A/B `CUT_PASS` directly enters Plan, C `CUT_PASS` directly enters Build, and an approved A/B Plan directly enters Build.
23
+ - `devflow-core` alone selects after non-unique facts: missing or changed depth, `CUT_REDUCE`, `CUT_REUSE`, `CUT_BLOCKED`, scope drift, `BUILD_BLOCKED`, Proof `FAIL`/`BLOCKED`, changed intent, or PUA recovery.
24
+ - PUA returns recovery facts to Core before lifecycle selection.
25
+
26
+ Pass check:
27
+
28
+ ```text
29
+ Confirmed request:
30
+ - Goal:
31
+ - Scope:
32
+ - Out of scope:
33
+ - Constraints:
34
+ - Acceptance:
35
+ - Open questions:
36
+ - Status: clarified
37
+ ```
38
+
39
+ ## Scenario 1A: Problem Investigation
40
+
41
+ Input:
42
+
43
+ ```text
44
+ Problem report: the login flow looks wrong. Check what is wrong, do not fix yet.
45
+ ```
46
+
47
+ Expected behavior:
48
+
49
+ - Route: Problem
50
+ - Skill path: `devflow-core -> devflow-prove`
51
+ - Must read relevant project facts before naming the problem.
52
+ - Must prove the symptom, absence of evidence, or unknowns before editing.
53
+ - Must not silently implement a fix.
54
+ - If a change is needed, re-route to Design or Build with a clear target.
55
+
56
+ Pass check:
57
+
58
+ ```text
59
+ Route: Problem
60
+ Facts: read/confirmed ...
61
+ Command/scenario: <actual investigation command or scenario>
62
+ Result: <symptom / no evidence / unknowns>
63
+ Judgment: PASS / FAIL / BLOCKED
64
+ Next step: no change needed / re-route Design / re-route Build
65
+ ```
66
+
67
+ ## Scenario 1B: Requirement To Implementation
68
+
69
+ Input:
70
+
71
+ ```text
72
+ Requirement: implement CSV export for orders.
73
+ ```
74
+
75
+ Expected behavior:
76
+
77
+ - Route: Build because implementation is requested.
78
+ - Skill path: `devflow-core -> devflow-brainstorm -> Confirmed request -> user selects C -> devflow-cut -> CUT_PASS -> devflow-build -> devflow-prove`.
79
+ - Brainstorm confirms the request at `Status: clarified`, then presents A/B/C and starts Cut only after the user selects C.
80
+ - Cut checks existing export helpers, standard library/platform CSV support, dependency need, scope drift, and smallest useful path.
81
+ - Build uses slices if the change spans API/UI/tests.
82
+ - Prove runs the targeted test/build/manual scenario.
83
+
84
+ Pass check:
85
+
86
+ ```text
87
+ Confirmed request: ...
88
+ Core route: ...
89
+ Reuse Check: ...
90
+ Ponytail Rung: ...
91
+ Implementation Slices: ...
92
+ Command: <actual verification>
93
+ Result: <key output>
94
+ Judgment: PASS / FAIL / BLOCKED
95
+ ```
96
+
97
+ ## Scenario 1C: Bug Report
98
+
99
+ Input:
100
+
101
+ ```text
102
+ Bug report: order totals sometimes render as NaN. Fix the bug.
103
+ ```
104
+
105
+ Expected behavior:
106
+
107
+ - Route: Build
108
+ - Skill path: `devflow-core -> devflow-brainstorm -> Confirmed request -> devflow-core -> devflow-cut -> Cut Decision -> devflow-core -> devflow-build -> devflow-prove`
109
+ - Brainstorm confirms only the request and stops at `Status: clarified`.
110
+ - Core chooses the lifecycle path after reading the confirmed request; when no reviewable design contract is needed, it can proceed to Cut.
111
+ - Must identify likely touched formatter/calculation flow from facts.
112
+ - `devflow-cut` must run Root-Cause Check before editing.
113
+ - Must search callers/references and choose shared vs narrow fix intentionally.
114
+ - Must prove the original symptom or a regression check.
115
+
116
+ Pass check:
117
+
118
+ ```text
119
+ Root-Cause Check: searched <callers/references>; fix location <shared/narrow>; reason <why>
120
+ Diff Check: ...
121
+ Command: <regression test or reproduction command>
122
+ Result: <NaN reproduced then fixed, or BLOCKED with missing repro>
123
+ Judgment: PASS / FAIL / BLOCKED
124
+ ```
125
+
126
+ ## Scenario 1C-A: First Principles Cut
127
+
128
+ Input:
129
+
130
+ ```text
131
+ The service layer is too complicated. Redesign the architecture and fix the timeout issue.
132
+ ```
133
+
134
+ Expected behavior:
135
+
136
+ - `devflow-core` selects First Principles Cut because inherited abstractions may hide the real constraint.
137
+ - `devflow-brainstorm` confirms the requested outcome, scope, constraints, acceptance, and open questions without proposing an architecture.
138
+ - After `Confirmed request`, Core separates verified facts, constraints, invariants, and assumptions before selecting the smallest necessary mechanism.
139
+ - `devflow-cut` still runs Reuse, Native, Overbuild, Diff, and Scope gates before implementation.
140
+
141
+ Pass check:
142
+
143
+ ```text
144
+ Method Lens: primary First Principles Cut; secondary <lens/none>; why <hidden constraint>
145
+ Facts: ...
146
+ Constraints: ...
147
+ Invariants: ...
148
+ Assumptions removed: ...
149
+ Smallest necessary mechanism: ...
150
+ Not doing: ...
151
+ ```
152
+
153
+ ## Scenario 1D: Codex Trigger Surface
154
+
155
+ Input:
156
+
157
+ ```text
158
+ Codex sees only AGENTS.md, skill descriptions, and command prompts.
159
+ ```
160
+
161
+ Expected behavior:
162
+
163
+ - `AGENTS.md` contains trigger words for problem reports, requirements, bug reports, user challenge recovery, and completion claims.
164
+ - `devflow-core` description includes investigating issues, requirements, bugs, and user challenge recovery.
165
+ - `devflow-brainstorm` description includes requirement/feature/behavior/architecture triggers.
166
+ - `devflow-pua` description includes changed-wrong and quality complaint triggers.
167
+ - `devflow-prove` description includes done/fixed/complete/ready/passed triggers.
168
+ - Command prompts repeat Problem, Root-Cause, Pressure Recovery, and proof routing for hosts that use slash commands instead of skill bodies.
169
+
170
+ Pass check:
171
+
172
+ ```text
173
+ Codex Trigger Contract
174
+ problem report / requirement / bug report / changed wrong / done
175
+ Issue Triage
176
+ Pressure Recovery Gate
177
+ Root-Cause Check
178
+ ```
179
+
180
+ ## Scenario 1E: Host Adapter Contract Drift
181
+
182
+ Input:
183
+
184
+ ```text
185
+ Check whether the host adapter files still point to the same DevFlow contract.
186
+ ```
187
+
188
+ Expected behavior:
189
+
190
+ - Route: Fast verification
191
+ - Skill path: `devflow-core -> devflow-prove`
192
+ - 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 plugin metadata includes all shipped skills and commands.
195
+ - Must not rewrite adapter rules unless drift is proven.
196
+
197
+ Pass check:
198
+
199
+ ```text
200
+ Host Adapter Verification Report
201
+ AGENTS / CLAUDE / Copilot / VS Code / CodeBuddy / plugin manifest / Gemini metadata
202
+ Command: npm run host:verify
203
+ Judgment: PASS / FAIL / BLOCKED
204
+ ```
205
+
206
+ ## Scenario 1F: Independent Manual Adversarial Review
207
+
208
+ Input:
209
+
210
+ ```text
211
+ Run an upgraded adversarial review of this current change without using completion status.
212
+ ```
213
+
214
+ Expected behavior:
215
+
216
+ - Route: Independent manual.
217
+ - Skill path: explicit user request -> `devflow-adversarial`.
218
+ - Must run only because the user explicitly requested it; it may inspect materials from any task stage.
219
+ - Must begin after the explicit review request without a separate confirmation prompt. Must not add a second confirmation gate after the explicit review request.
220
+ - Must ask one smallest question only when the review target is unclear.
221
+ - Must cover all five fixed dimensions: requirement coverage, reachability, boundaries and regressions, evidence strength, and user-visible outcome.
222
+ - Findings must use `Critical`, `Important`, or `Observation` and include evidence, confidence, and context limitations.
223
+ - Must not read, require, modify, or hand off to `devflow-prove`, PUA, Build, Learn, or any completion state.
224
+ - Must not edit code, create a task, invoke another skill, or declare global task status.
225
+
226
+ Pass check:
227
+
228
+ ```text
229
+ Review confirmation: explicit request received
230
+ Adversarial review target: ...
231
+ Findings: Critical / Important / Observation
232
+ Five-angle coverage: requirement coverage / reachability / boundaries and regressions / evidence strength / user-visible outcome
233
+ Context limitations: ...
234
+ Suggested next action: manual only
235
+ ```
236
+
237
+ ## Scenario 1G: Independent Manual Find-Fault Review
238
+
239
+ Input:
240
+
241
+ ```text
242
+ Find faults in this change: what is the biggest omission, what have we not recognized, and what is least certain?
243
+ ```
244
+
245
+ Expected behavior:
246
+
247
+ - Route: Independent manual.
248
+ - Skill path: explicit user request -> `devflow-find-fault`.
249
+ - Must run only because the user explicitly requested it; it may inspect materials from any task stage.
250
+ - Must answer biggest omission, unrecognized blind spot, and least certain point, plus every explicit user follow-up question.
251
+ - When target material contains implemented work, a diff, or a completion-ready result, must also run the post-implementation unease check: find materially unconfirmed business decisions, show the encoded assumption and alternatives, then classify high/medium/low risk with rationale, a user confirmation question, and temporary recommendation.
252
+ - High-risk unease decisions must prevent a claim that the feature fully meets requirements; medium-risk decisions must be marked `pending confirmation`.
253
+ - Each answer must separate facts, inference, and unknowns, then state confidence and a next step; findings must use `Critical`, `Important`, or `Observation` with evidence and context limitations.
254
+ - Must not read, require, modify, or hand off to `devflow-prove`, PUA, Build, Learn, or any completion state.
255
+ - Must not edit code, create a task, invoke another skill, or declare global task status.
256
+
257
+ Pass check:
258
+
259
+ ```text
260
+ Find-fault target: ...
261
+ Questions and answers: biggest omission / unrecognized blind spot / least certain point / user questions
262
+ Facts / inference / unknowns / confidence / next step
263
+ Unease check: run / not applicable — <why>
264
+ Decision: current implementation / assumption / alternative interpretations / risk / evidence / confirmation needed / temporary recommendation
265
+ Findings: Critical / Important / Observation
266
+ Context limitations: ...
267
+ Suggested next action: manual only
268
+ ```
269
+
270
+ ## Scenario 2: Small Clear Change
271
+
272
+ Input:
273
+
274
+ ```text
275
+ In README, rename "Proof Gate" to "Proof Before Done".
276
+ ```
277
+
278
+ Expected behavior:
279
+
280
+ - Route: Build because implementation is requested and scope is clear.
281
+ - Still run a lightweight Sense and Cut.
282
+ - Touch only the requested file.
283
+ - Verify with text search.
284
+
285
+ Pass check:
286
+
287
+ ```text
288
+ Reuse Check: ...
289
+ Diff Check: README only
290
+ Command: <search command>
291
+ Result: old phrase absent/new phrase present
292
+ Judgment: PASS
293
+ ```
294
+
295
+ ## Scenario 3: Dependency Proposal
296
+
297
+ Input:
298
+
299
+ ```text
300
+ Install a date picker package for a basic birthday field.
301
+ ```
302
+
303
+ Expected behavior:
304
+
305
+ - `devflow-cut` blocks the new dependency unless a current limitation is proven.
306
+ - Native Check considers `<input type="date">`.
307
+ - Output says what was cut.
308
+
309
+ Pass check:
310
+
311
+ ```text
312
+ Native Check: checked Browser And HTML; native option used
313
+ Overbuild Check: new dependency rejected
314
+ CUT_REDUCE or CUT_REUSE
315
+ ```
316
+
317
+ ## Scenario 4: Existing Capability
318
+
319
+ Input:
320
+
321
+ ```text
322
+ Add a UUID helper.
323
+ ```
324
+
325
+ Expected behavior:
326
+
327
+ - Search existing helpers.
328
+ - Check runtime standard library.
329
+ - Prefer `crypto.randomUUID()` where available.
330
+ - Do not create a helper unless a current compatibility reason exists.
331
+
332
+ Pass check:
333
+
334
+ ```text
335
+ Ponytail Rung: stdlib/native
336
+ Not doing: new helper wrapper
337
+ ```
338
+
339
+ ## Scenario 5: Multi-File Feature
340
+
341
+ Input:
342
+
343
+ ```text
344
+ Implement the approved notification preference feature.
345
+ ```
346
+
347
+ Expected behavior:
348
+
349
+ - Route: Build
350
+ - `devflow-build` creates Implementation Slices.
351
+ - Each slice has files, change, and verification.
352
+ - `devflow-prove` runs final verification.
353
+
354
+ Pass check:
355
+
356
+ ```text
357
+ Implementation Slices:
358
+ - Slice 1: files / change / per-slice verification
359
+ - Slice 2: files / change / per-slice verification
360
+ Command: ...
361
+ Result: ...
362
+ Judgment: PASS / FAIL / BLOCKED
363
+ ```
364
+
365
+ ## Scenario 5B: Contextual Engineering Quality
366
+
367
+ Input:
368
+
369
+ ```text
370
+ Implement an approved order-history change. Match project conventions, keep the code readable, and add caching only if it is justified.
371
+ ```
372
+
373
+ Expected behavior:
374
+
375
+ - Route: Build through Cut and Prove.
376
+ - Cut compares nearest order-history patterns and records convention, responsibility, performance, and readability checks.
377
+ - It must not require a Service split, interface, cache, or fixed function length without current evidence.
378
+ - Build makes business intent, key rules, failure paths, and side effects locally understandable, then records a Readability Check.
379
+ - Prove reviews the actual diff against File Structure, Prewalk evidence, project-convention alignment, local understandability, responsibility boundaries, and any cache benefit/invalidation/consistency claim.
380
+ - A coherent orchestration change passes when its responsibility, side effects, and direct contracts remain evidenced in the diff.
381
+ - 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.
382
+
383
+ Pass check:
384
+
385
+ ```text
386
+ Convention Check: compared ...
387
+ Responsibility Check: ...
388
+ Performance Check: workload/failure evidence ...; cache/optimization/concurrency ...
389
+ Readability Check: intent / rules / failure paths / side effects / convention / trade-off
390
+ Code Review Report: ...
391
+ Judgment: PASS / FAIL / BLOCKED
392
+ ```
393
+
394
+ ## Scenario 5A: Plan Pack Check
395
+
396
+ Input:
397
+
398
+ ```text
399
+ Create implementation slices from this approved design and check the plan before coding.
400
+ ```
401
+
402
+ Expected behavior:
403
+
404
+ - Route: Build planning before implementation.
405
+ - Skill path: `devflow-core -> devflow-brainstorm -> Confirmed request -> user selects A -> devflow-spec -> approved Spec -> devflow-cut -> CUT_PASS -> /devflow-plan -> approved Plan -> devflow-build -> devflow-prove`.
406
+ - 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.
407
+ - 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.
408
+ - A/B `CUT_PASS` directly enters Plan; only `CUT_REDUCE`, `CUT_REUSE`, `CUT_BLOCKED`, or other non-success facts return to Core.
409
+ - 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`.
410
+ - 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.
411
+ - 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.
412
+ - Saved plan files default to `docs/plans/YYYY-MM-DD-<short-kebab-name>.md`.
413
+ - Must not save implementation plans under `docs/features/`; that directory is for feature ledgers.
414
+ - 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/`.
415
+ - 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.
416
+
417
+ Pass check:
418
+
419
+ ```text
420
+ CUT_PASS: allowed scope / reuse conclusion / exclusions / verification constraints
421
+ Command: node scripts/devflow-plan.js docs/plans/YYYY-MM-DD-<short-kebab-name>.md
422
+ Result: DevFlow plan pack report; File Structure: ok; trace and remaining worklist: ok; Judgment: PASS
423
+ Next: lightweight Cut-consistency review -> confirmed Plan and scope-drift facts -> devflow-core
424
+ Judgment: PASS / FAIL / BLOCKED
425
+ ```
426
+
427
+ ## Scenario 5C: Diff-First Prove Quality Gate
428
+
429
+ Input:
430
+
431
+ ```text
432
+ The approved export plan is implemented. Verify it and mark it ready.
433
+ ```
434
+
435
+ Expected behavior:
436
+
437
+ - Route: Prove.
438
+ - 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.
439
+ - The Code Review Report names the reviewed diff, plan boundary, Prewalk evidence, comparable code, Blockers, Warnings, Recommendations, and boundary verdict.
440
+ - An unresolved evidence-backed Blocker or Warning returns `FAIL` facts to Core; Recommendations alone do not prevent PASS.
441
+ - 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.
442
+
443
+ Pass check:
444
+
445
+ ```text
446
+ Diff reviewed: actual changed files/ranges
447
+ Plan boundary: File Structure row(s) and verdict
448
+ Prewalk evidence: Trace / Handoff Facts / completion evidence
449
+ Blockers: 0
450
+ Warnings: 0
451
+ Recommendations: 0 or documented
452
+ Boundary verdict: within approved responsibility/touch set
453
+ Judgment: PASS / FAIL / BLOCKED
454
+ ```
455
+
456
+ ## Scenario 6: Repeated Same-Function Problem
457
+
458
+ Input:
459
+
460
+ ```text
461
+ The CSV export is still wrong. I already pointed out that the same export behavior is missing the required columns.
462
+ ```
463
+
464
+ Expected behavior:
465
+
466
+ - Route: Recovery.
467
+ - Trigger because the user repeatedly identifies the same function (`CSV export`) as wrong or incomplete in one task lifecycle.
468
+ - Re-read facts.
469
+ - List 3 hypotheses.
470
+ - Pick a different approach.
471
+ - Load `devflow-learn` when the correction or pitfall is reusable.
472
+
473
+ Pass check:
474
+
475
+ ```text
476
+ Failure/correction: repeated report about the same function/result/capability
477
+ Repeated target evidence: CSV export + prior feedback or correction attempt
478
+ Facts reread: ...
479
+ Hypotheses: 1 / 2 / 3
480
+ Changed approach: ...
481
+ Learning closure: ...
482
+ ```
483
+
484
+ ## Scenario 6A: Repeated Correction Learning Closure
485
+
486
+ Input:
487
+
488
+ ```text
489
+ Not again: AGENTS.md is a runtime prompt. You put README-style explanation in the wrong place.
490
+ ```
491
+
492
+ Expected behavior:
493
+
494
+ - Route: Recovery
495
+ - Load `devflow-learn` because this is a repeated correction and misplaced content signal.
496
+ - Read `.copilot/LEARNING_INDEX.md`.
497
+ - Read only the matched card, such as `agents-runtime-prompt-boundary.md`.
498
+ - Create or update one focused card when the correction is not already covered.
499
+ - Update `.copilot/LEARNING_INDEX.md` when trigger words change.
500
+ - Report learning closure before claiming completion.
501
+
502
+ Pass check:
503
+
504
+ ```text
505
+ Repeat Correction Gate
506
+ wrong place / misplaced content / repeated correction
507
+ .copilot/LEARNING_INDEX.md
508
+ Read `.copilot/LEARNING_INDEX.md`
509
+ Read only the matched card
510
+ Report learning closure before claiming completion
511
+ Next action: Next time editing AGENTS.md ...
512
+ ```
513
+
514
+ ## Scenario 6B: New Reusable Pitfall Card
515
+
516
+ Input:
517
+
518
+ ```text
519
+ Remember this: when a validation script only checks file presence, next time make it check executable behavior too.
520
+ ```
521
+
522
+ Expected behavior:
523
+
524
+ - Route: Recovery or Fast learning capture, depending on whether the request follows a failure.
525
+ - Skill path: `devflow-core -> devflow-prove -> devflow-learn`
526
+ - Read `.copilot/LEARNING_INDEX.md`.
527
+ - Read only matched cards; do not load all cards.
528
+ - If no matched card already covers the lesson, create one focused card with Trigger, Lesson, Next action, Scope, and Related.
529
+ - Update `.copilot/LEARNING_INDEX.md` with the new card and trigger words.
530
+ - Report learning closure before claiming completion.
531
+ - Use `npm run learn:verify` as no-mutation proof that the learning-loop contract still works.
532
+
533
+ Pass check:
534
+
535
+ ```text
536
+ devflow-learn
537
+ LEARNING_INDEX
538
+ matched card
539
+ Next action
540
+ learning closure
541
+ Command: npm run learn:verify
542
+ Judgment: PASS / FAIL / BLOCKED
543
+ ```
544
+
545
+ ## Scenario 6D: Progressive Knowledge Recall
546
+
547
+ Input:
548
+
549
+ ```text
550
+ Implement an order export change using existing project conventions.
551
+ ```
552
+
553
+ Expected behavior:
554
+
555
+ - At Sense, probe `.copilot/LEARNING_INDEX.md` and `docs/project-knowledge/` without creating either location.
556
+ - Read the learning index before matching and reading only relevant cards.
557
+ - Read `AI-START-HERE.md`, falling back to `index.md`, then use `registry.json` to select only relevant business knowledge documents.
558
+ - Do not bulk-load cards or project knowledge. Missing locations, indexes, or registries are non-blocking facts.
559
+ - A reusable execution lesson may lazily create `.copilot/` records. Only a user-confirmed, code-backed business candidate may reach `devflow-project-knowledge` to lazily maintain `docs/project-knowledge/`.
560
+
561
+ Pass check:
562
+
563
+ ```text
564
+ Knowledge recall: none / learning index + matched card / project knowledge entry + matched docs
565
+ Read `.copilot/LEARNING_INDEX.md`
566
+ Read only the matched card
567
+ AI-START-HERE.md / index.md / registry.json
568
+ Missing knowledge: recorded, non-blocking, no storage created
569
+ devflow-learn -> user confirmation -> devflow-project-knowledge
570
+ ```
571
+
572
+ ## Scenario 6C: User Challenge Pressure Recovery
573
+
574
+ Input:
575
+
576
+ ```text
577
+ CSV 导出还是不对;我上次已经指出同一个导出缺少必填列。
578
+ ```
579
+
580
+ Expected behavior:
581
+
582
+ - Route: Recovery.
583
+ - Skill path: `devflow-core -> devflow-pua -> recovery facts -> devflow-core -> devflow-brainstorm when selected -> Confirmed request -> devflow-core -> devflow-prove -> devflow-learn`.
584
+ - Trigger only because the user repeatedly identifies the same function (`CSV export`) as wrong or incomplete in one task lifecycle.
585
+ - `devflow-pua` owns the recovery diagnosis, method switch, hypotheses, and new success contract; it returns recovery facts to Core, which alone decides whether Brainstorm re-confirms the request and which lifecycle work follows.
586
+ - Must mark `Restart Brainstorm: re-confirmation required; Core selects whether to invoke it` when the repeated same-target trigger applies.
587
+ - Must not infer pressure recovery from an isolated keyword or message count alone.
588
+ - Must discard the prior wrong assumption/path/proof claim and keep only verified facts.
589
+ - Must classify `User-view miss` and `Satisfaction gap` before choosing the next fix.
590
+ - Must display the selected recovery method as `METHOD: {flavor} / {method}`.
591
+ - Must switch guiding method when the previously used method still failed.
592
+ - Must switch to a different/opposite method and restart checks from facts when the first recovery method still misses.
593
+ - Must return the Brainstorm re-confirmation need to Core before changing files again.
594
+ - Must re-read facts from the repeated same-target feedback, prior edits, proof output, and relevant project files.
595
+ - Must ask where it is wrong, what result is wanted, what must stay unchanged, and how to verify when those answers cannot be inferred.
596
+ - Must list 3 hypotheses, including that the prior approach solved the wrong problem.
597
+ - Must blue-team attack the new plan from the user's point of view.
598
+ - Must define a `New success contract` instead of continuing the old context.
599
+ - Must choose a materially different approach.
600
+ - Must prove with command/result/judgment.
601
+ - Must hand off to `devflow-learn` when the repeated miss is reusable.
602
+
603
+ Pass check:
604
+
605
+ ```text
606
+ Pressure check: repeated report about the same function/result/capability
607
+ Repeated target evidence: CSV export + prior feedback or correction attempt
608
+ Restart Brainstorm: re-confirmation required; Core selects whether to invoke it
609
+ Discarded context: ...
610
+ Keep only verified facts: ...
611
+ User-view miss: ...
612
+ Satisfaction gap: ...
613
+ METHOD: {flavor} / {method}
614
+ SWITCH: none / old flavor/method -> new flavor/method: reason
615
+ User goal restated: ...
616
+ Desired result: ...
617
+ Blocking questions: none / inferred / 2-4 pointed questions
618
+ Hypotheses: 1 / 2 / 3
619
+ Blue-team attack: ...
620
+ New success contract: ...
621
+ Changed approach: ...
622
+ Command: <actual proof>
623
+ Result: <key output>
624
+ Judgment: PASS / FAIL / BLOCKED
625
+ Learning closure: ...
626
+ ```
627
+
628
+ ## Scenario 7: Completion Claim
629
+
630
+ Input:
631
+
632
+ ```text
633
+ Are we done?
634
+ ```
635
+
636
+ Expected behavior:
637
+
638
+ - `devflow-prove` runs or cites a fresh verification command.
639
+ - For development work, `devflow-prove` runs adversarial review against acceptance criteria, touched files, likely regressions, activation path, and proof coverage.
640
+ - The strongest plausible challenge and its disposition are visible before judgment.
641
+ - If adversarial review finds a real gap, judgment is `FAIL` or the flow continues before any completion claim.
642
+ - If no proof can run, report `BLOCKED`.
643
+ - Do not say "done" before command/result/judgment.
644
+
645
+ Pass check:
646
+
647
+ ```text
648
+ Command: <actual command>
649
+ Result: <real output summary>
650
+ Adversarial review: <strongest challenge and disposition>
651
+ Judgment: PASS / FAIL / BLOCKED
652
+ ```
653
+
654
+ ## Scenario 7A: Adversarial Review Rejects Completion
655
+
656
+ Input:
657
+
658
+ ```text
659
+ The unit test passes. Mark the API change complete.
660
+ ```
661
+
662
+ Expected behavior:
663
+
664
+ - `devflow-prove` checks whether the API entry point, callers, integration behavior, and acceptance criteria were actually covered.
665
+ - A passing unit test alone does not override a discovered activation-path or regression gap.
666
+ - When the strongest plausible challenge remains unresolved, report `FAIL` and name the missing proof.
667
+
668
+ Pass check:
669
+
670
+ ```text
671
+ Command: <unit test command>
672
+ Result: <passing unit test output>
673
+ Adversarial review: API activation path or integration behavior remains unverified.
674
+ Judgment: FAIL
675
+ ```
676
+
677
+ ## Scenario 7B: Delegated Continuation and Scope Drift
678
+
679
+ Input:
680
+
681
+ ```text
682
+ 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.
683
+ ```
684
+
685
+ Expected behavior:
686
+
687
+ - Build reads the latest Execution Trace, re-reads only the current anchors and directly changed neighbor, and does not restart a broad repository review.
688
+ - Build stops instead of silently applying the rule to the easiest existing file or expanding the touch set.
689
+ - It returns observed policy, affected anchor, invalidated trace/handoff fact, blocked work-item verification, and the smallest replan decision to Core.
690
+ - After Core corrects Plan/Prewalk, Build resumes from updated anchors and appends actual verification evidence for every completed remaining item.
691
+
692
+ Pass check:
693
+
694
+ ```text
695
+ Command: minimal anchor reread plus required verification
696
+ Result: mismatch and affected anchor recorded; no silent scope expansion or broad rediscovery
697
+ Adversarial review: new authorization behavior invalidates planned placement
698
+ Judgment: FAIL facts -> devflow-core replan -> resumed Build only after corrected handoff
699
+ ```
700
+
701
+ ## Scenario 8: Skill Pack Validation
702
+
703
+ Input:
704
+
705
+ ```text
706
+ Validate DevFlow-Core itself.
707
+ ```
708
+
709
+ Expected behavior:
710
+
711
+ - Run `npm test`.
712
+ - Validate required files, frontmatter, commands, output contracts, and required method terms.
713
+
714
+ Pass check:
715
+
716
+ ```text
717
+ Command: npm test
718
+ Result: DevFlow validation passed
719
+ Judgment: PASS
720
+ ```
721
+
722
+ ## Scenario 9: Target Project Install Check
723
+
724
+ Input:
725
+
726
+ ```text
727
+ Install DevFlow into a target project and verify the installed runtime did not drift.
728
+ ```
729
+
730
+ Expected behavior:
731
+
732
+ - Route: Fast verification after the install target is known.
733
+ - Skill path: `devflow-core -> devflow-prove`
734
+ - Must run the dry-run before write mode when demonstrating a first install.
735
+ - Must use `npm run install:target -- <target> --write` to copy runtime files.
736
+ - Must use `npm run install:target -- <target> --check` after install.
737
+ - Must report `ok`, `missing`, or `changed` file state from check mode.
738
+ - Must not copy product docs, source-only reference docs, or validation harness files into the target project.
739
+ - If check mode fails, report `FAIL` and name whether the target has missing or changed runtime files.
740
+
741
+ Pass check:
742
+
743
+ ```text
744
+ Command: npm run install:target -- <target> --check
745
+ Result: Check passed: installed runtime matches this package.
746
+ Judgment: PASS
747
+ ```
748
+
749
+ ## Scenario 10: Lifecycle Status Line
750
+
751
+ Input:
752
+
753
+ ```text
754
+ Requirement: implement CSV export for orders. Do it.
755
+ ```
756
+
757
+ Expected behavior:
758
+
759
+ - While any lifecycle node is active — Brainstorm clarification, user-selected Cut, Build, Prove — every user-facing message ends with one status line: `[DevFlow: <node> -> <next> | awaiting approval / in progress]`.
760
+ - The status line follows the handoff without reloading the owner skill: `[DevFlow: Brainstorm -> Cut | awaiting approval]` becomes `[DevFlow: Cut -> Build | in progress]` after the user selects a depth.
761
+ - The status line marks gates explicitly: `awaiting approval` at Brainstorm confirmation, Spec or Plan approval, and `CUT_REDUCE`/`CUT_REUSE` confirmation; `in progress` during execution.
762
+ - The status line is one line; it does not replace the node's required output contract (Confirmed request, Cut Decision, Implementation Slices, Completion report).
763
+ - The persistent todo list stays current: one `todo_write` item per active work unit (lifecycle node, background job, subagent), marked `completed` the moment it settles; a long-running session objective lives in `create_goal`.
764
+
765
+ Pass check:
766
+
767
+ ```text
768
+ Status: [DevFlow: Brainstorm -> Cut | awaiting approval]
769
+ Status: [DevFlow: Cut -> Build | in progress]
770
+ Status: [DevFlow: Build -> Prove | in progress]
771
+ Todo: [node items in_progress] -> completed on settle
772
+ Command: <actual verification>
773
+ Result: <key output>
774
+ Judgment: PASS
775
+ ```