@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,26 @@
1
+ # DevFlow Proof And Recovery Methods
2
+
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
+
5
+ ## Method 13: Proof Before Done
6
+
7
+ 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.
8
+
9
+ ```text
10
+ Command: <actual command>
11
+ Result: <key output>
12
+ Adversarial review: <acceptance, regressions, activation, proof coverage>
13
+ Judgment: PASS / FAIL / BLOCKED
14
+ ```
15
+
16
+ `PASS` is Prove's terminal success after Learn review. Proof `FAIL`, `BLOCKED`, a real adversarial gap, unresolved Code Review Blocker/Warning, or incomplete PUA recovery evidence returns its facts to `devflow-core`; Core selects the repair, recovery, or re-clarification path. Prove never infers that next owner.
17
+
18
+ ### Quality-Finding Recovery
19
+
20
+ A Code Review Blocker or Warning requires a Build correction selected by Core. After that correction, Prove reviews the new actual diff against the same File Structure boundary, Prewalk evidence, direct contracts, and nearby convention. It explicitly records every prior finding as closed with fresh evidence or still open; stale test output, stale review output, or an implementer claim cannot close it. Ordinary quality repair remains separate from PUA unless the failure also has a user challenge, repeated miss, or changed-wrong signal.
21
+
22
+ ## Method 14: Recovery By Changing Approach
23
+
24
+ On an unexpected verification failure or repeated user challenge, re-read facts, restate the desired result, list three hypotheses, choose a materially different approach, and rerun proof. PUA additionally loads its methodology router, library, and display protocol before a recovery patch.
25
+
26
+ Do not retry the same move with superficial wording changes. Reusable lessons go to `devflow-learn` after proof.
@@ -0,0 +1,197 @@
1
+ ---
2
+ name: devflow-pua
3
+ description: "Use when the user repeatedly points out that the same function or result has a problem in one task lifecycle, repeatedly identifies missing coverage for the same function, or Recovery needs pressure to stop the current approach and realign before more edits."
4
+ ---
5
+
6
+ # DevFlow PUA
7
+
8
+ Apply pressure as accountability: stop the wrong path, quarantine the wrong working context, diagnose why the user thinks the result is wrong, load the local methodology router, display the active flavor/method, return recovery facts to `devflow-core`, switch method when the current one failed, and let Core decide whether request re-confirmation or any later lifecycle work is needed. PUA never selects the replacement execution skill. Do not use persona theater or insults.
9
+
10
+ ## Repeated Same-Function Trigger
11
+
12
+ Trigger this skill only when the user repeatedly points out that the **same function, result, or requested capability** has a problem in one task lifecycle. Evidence may be repeated “不对/有问题/还是不对/还有缺漏” feedback about that same target, including after an attempted correction.
13
+
14
+ Do not infer pressure recovery from an isolated phrase alone. The decisive fact is repeated dissatisfaction with the same target, not whether a message is labeled as a first correction.
15
+
16
+ The direct `/devflow-pua` command remains an explicit opt-in and may activate this skill immediately.
17
+
18
+ ## Methodology Assets
19
+
20
+ When this skill activates, read these local references before choosing or switching method:
21
+
22
+ - `skills/devflow-pua/references/methodology-router.md`
23
+ - `skills/devflow-pua/references/methodology-library.md`
24
+ - `skills/devflow-pua/references/flavor-display.md`
25
+
26
+ These files are the runtime method source. Do not link out to the original PUA project at runtime.
27
+
28
+ ## Process
29
+
30
+ Load `skills/devflow-prove/references/proof-recovery-methods.md` before applying recovery proof rules. Keep the PUA methodology router, library, and flavor-display assets as the owner of method selection and output display.
31
+
32
+ 1. **Stop the current path**: do not keep editing with the same assumption when the user repeatedly reports that the same function, result, or requested capability remains wrong, incomplete, or missing.
33
+ 2. **Name the pressure signal**: repeated same-target dissatisfaction in one task lifecycle, including after an attempted correction; record the function/result/capability that the user keeps identifying as problematic.
34
+ 3. **Quarantine wrong context**: keep only verified facts and user-stated constraints; discard the previous solution hypothesis, implementation path, and "almost fixed" assumptions.
35
+ 4. **Load methodology**: read `references/methodology-router.md`, `references/methodology-library.md`, and `references/flavor-display.md`.
36
+ 5. **Route flavor/method**: choose the starting or switched flavor from the pressure signal and failure pattern.
37
+ 6. **Display method**: output one compact visible line: `METHOD: {flavor} / {method}`. If the method changed, add one `SWITCH:` line.
38
+ 7. **Diagnose the user-view miss**: classify why the user would still feel unsatisfied before proposing another patch.
39
+ 8. **Request re-confirmation facts**: when the repeated same-target trigger applies, do not continue editing; include the need for fresh request confirmation in the recovery facts.
40
+ 9. **Ask what is wrong and what result is wanted**: ask the smallest concrete set when the answer is not already explicit.
41
+ 10. **Restate the goal**: say what you now believe the user wants and what result they should see.
42
+ 11. **List 3 hypotheses**: include at least one hypothesis that the previous approach was solving the wrong problem.
43
+ 12. **Switch method if needed**: if the last guiding method still missed, mark it failed, choose a different or opposite method lens, and restart checks from facts before editing again.
44
+ 13. **Change approach**: name the old approach being abandoned and the materially different path now chosen.
45
+ 14. **Prepare the handoff**: include only recovery facts, including any request re-confirmation need, in the required output for Core selection.
46
+ 15. **Close learning**: if the miss is reusable, load `devflow-learn` before claiming completion.
47
+
48
+ ## Guiding Principles
49
+
50
+ - **Customer Backwards**: start from the result the user expected to see, not from why the old patch seemed reasonable.
51
+ - **Miss Taxonomy**: identify the satisfaction gap before choosing the next fix.
52
+ - **Owner/RCA Discipline**: own the outcome, inspect facts, find the root cause, and do not push discoverable work back to the user.
53
+ - **Blue-Team + Evidence Loop**: attack the new plan from the user's point of view, then prove the corrected result with evidence.
54
+
55
+ The user wants a corrected outcome, not an explanation that the previous attempt was "almost right". Every recovery must produce a new success contract: expected result, not-doing boundary, changed approach, and proof.
56
+
57
+ ## Why User Thinks It Is Wrong
58
+
59
+ Classify the miss before changing files:
60
+
61
+ | Miss | Meaning | Recovery bias |
62
+ |---|---|---|
63
+ | Goal mismatch | The agent solved a different problem than the user cared about. | Customer Backwards; re-ask or infer the desired result. |
64
+ | Artifact mismatch | The agent changed the wrong file, page, skill, command, docs location, or install scope. | Trace the artifact owner and target surface before editing. |
65
+ | Behavior gap | The visible behavior did not change, or only wording changed. | Reproduce behavior and pick a behavior-changing path. |
66
+ | Missing coverage | The agent fixed one part but missed entrypoints, commands, validation, docs, user-level sync, or sibling flows. | Coverage Map; enumerate required surfaces before Build. |
67
+ | Proof gap | Verification was absent or did not cover the user's scenario. | Evidence Loop; define proof from the user's acceptance scenario. |
68
+ | UX/result gap | The result works technically but is unclear, hard to distinguish, incomplete, or not satisfying. | Customer Backwards + Blue-Team user review. |
69
+
70
+ Treat repeated "少了/少个/缺少/缺漏/遗漏/漏了/still missing/incomplete" as a pressure signal. It usually means Missing coverage or UX/result gap, not a normal feature add.
71
+
72
+ ## Method Switch Rule
73
+
74
+ If one guiding method was already used and the user still says the result is wrong, incomplete, or missing pieces, do not repeat that method unchanged. The next recovery must automatically switch to a different or opposite method and restart checking from facts.
75
+
76
+ Switch by failure pattern:
77
+
78
+ - Goal, artifact, or UX miss -> **Customer Backwards**.
79
+ - Missing pieces, missing sync, missing command/entry/validation coverage -> **Coverage Map**.
80
+ - Bug, proof failure, or behavior still unchanged -> **Owner/RCA Discipline**.
81
+ - Repeated tweaks, same hypothesis, or "almost fixed" thinking -> **Blue-Team Opposite Hypothesis**.
82
+
83
+ Opposite method switching:
84
+
85
+ | Failed method | Switch to | Why |
86
+ |---|---|---|
87
+ | Customer Backwards still misses details | Coverage Map | The desired result may be right, but the surfaces were incomplete. |
88
+ | Coverage Map still misses the result | Customer Backwards | The list may be complete but aimed at the wrong user-visible outcome. |
89
+ | Owner/RCA still leaves behavior unchanged | Blue-Team Opposite Hypothesis | The root cause hypothesis may be wrong. Attack it directly. |
90
+ | Blue-Team still produces no fix | Owner/RCA Discipline | Stop debating the plan and trace facts, callers, and proof. |
91
+
92
+ Before visible output, decide whether the prior method is still valid or must switch to Customer Backwards, Coverage Map, Owner-RCA, or Blue-Team Opposite Hypothesis. Do not expose that decision as extra output fields unless the user asks for full diagnostics. When the method changes, use only this visible line:
93
+
94
+ ```text
95
+ SWITCH: <old flavor>/<old method> -> <new flavor>/<new method>: <reason>
96
+ ```
97
+
98
+ If the switched method also fails once, stop editing and ask the user to confirm the new success contract before another patch. If it fails twice, record the reusable miss through `devflow-learn`.
99
+
100
+ On DeepSeek Harness (DSH), fresh-agent iteration via the `ralph` tool (each round a fresh agent, workspace as durable memory) is an available form of the materially-different-approach switch, but only when the user explicitly requests fresh-agent iteration; otherwise keep the normal re-read-facts-and-switch-method flow above.
101
+
102
+ ## Hard Restart Rule
103
+
104
+ Trigger this rule when, in one task lifecycle, the user repeatedly points out that the same function, result, or requested capability remains wrong, incomplete, or missing, including after an attempted correction.
105
+
106
+ The trigger is repeated dissatisfaction with the same target; do not infer it from an isolated keyword or from message count alone.
107
+
108
+ ## Pointed Questions
109
+
110
+ Use the smallest blocking set. Prefer these shapes:
111
+
112
+ ```text
113
+ 1. Where exactly is the current result wrong?
114
+ 2. What exact result should the user see after this is fixed?
115
+ 3. What must stay unchanged?
116
+ 4. What proof would make you say this is corrected?
117
+ ```
118
+
119
+ If code, backend behavior, existing UI, docs, or prior messages answer the question, state the inference with evidence instead of asking.
120
+
121
+ ## Required Output
122
+
123
+ ```text
124
+ Pressure check: <signal and why normal Recovery is not enough>
125
+ Restart Brainstorm: <re-confirmation required / not required; Core selects whether to invoke it>
126
+ Discarded context: <old assumption/path not reused>
127
+ Keep only verified facts: <facts retained from prior work>
128
+ METHOD: {flavor} / {method}
129
+ SWITCH: <none or old flavor/method -> new flavor/method: reason>
130
+ User-view miss: <Goal mismatch / Artifact mismatch / Behavior gap / Missing coverage / Proof gap / UX-result gap>
131
+ Satisfaction gap: <why the user would still say this is not enough>
132
+ User goal restated: <current understanding>
133
+ Desired result: <visible/file/behavior outcome>
134
+ Blocking questions: <none, inferred from facts, or 2-4 pointed questions>
135
+ Hypotheses: 1 / 2 / 3
136
+ Blue-team attack: <how the new plan could still fail from the user's point of view>
137
+ New success contract: <expected result + affected surfaces + verification + not-doing>
138
+ Changed approach: <old path abandoned; new path>
139
+ Verification: <command or scenario to prove the new path>
140
+ Learning closure: <none or devflow-learn handoff>
141
+ ```
142
+
143
+ ## Escalation Rules
144
+
145
+ - After two corrected, challenged, or failed attempts in one task lifecycle, stop editing and return re-confirmation facts to `devflow-core`; ask the pointed questions unless the answers are directly inferable from facts.
146
+ - When the user repeatedly reports that the same function, result, or requested capability remains wrong, incomplete, or missing in one task lifecycle, return the Brainstorm re-confirmation need to Core.
147
+ - If the user repeatedly adds missing details for the same target, run Missing coverage diagnosis and Coverage Map before Build.
148
+ - If the selected guiding method still fails once, switch to a different or opposite method and restart the checks from facts; if it fails twice, stop and ask the user to confirm the new success contract before editing.
149
+ - If the same proof fails twice, do not rerun it unchanged; change the hypothesis or implementation path first.
150
+ - If the previous approach only changed wording, parameters, or nearby files, that is not a materially different approach.
151
+ - Do not use previous erroneous context as the basis for the next patch. Use it only to identify what failed.
152
+ - If the user explicitly tells you the goal and safe next action, use it and continue; do not stall with ritual questions.
153
+
154
+ ## Anti-Rationalization
155
+
156
+ | Excuse | Reality |
157
+ |---|---|
158
+ | "I'll just tweak it once more." | Repeated tweaks are the failure pattern. Stop and re-align. |
159
+ | "The user is unhappy, so I should rush." | Pressure means more facts and sharper questions, not faster guessing. |
160
+ | "I changed something, so the approach changed." | A new approach changes the hypothesis, target, or proof path. |
161
+ | "The old context is probably close." | The old context produced the wrong result. Quarantine it and return re-confirmation facts to Core. |
162
+ | "The user is just adding scope." | Repeated "missing" feedback is a satisfaction gap until coverage and goal are rechecked. |
163
+ | "The same method should work if I try harder." | If the method already failed, switch method or prove why it still fits. |
164
+ | "Learning can wait." | Reusable misses must become a next-time intercept before completion. |
165
+
166
+ ## Handoff Gate
167
+
168
+ After pressure recovery, return only the clarified request or recovery facts to Core:
169
+
170
+ ```text
171
+ Next skill: devflow-core
172
+ Reason: Brainstorm re-confirmed the request or recovery facts require Core lifecycle routing
173
+ ```
174
+
175
+ This is PUA's sole handoff: return recovery facts to `devflow-core`, which alone selects any later lifecycle work.
176
+
177
+ ## Verification
178
+
179
+ Before leaving this skill, confirm:
180
+
181
+ - [ ] The previous path was stopped or explicitly kept with evidence.
182
+ - [ ] Repeated dissatisfaction with the same function, result, or requested capability returned a Brainstorm re-confirmation need to `devflow-core`.
183
+ - [ ] Previous erroneous context was quarantined and not reused as the next solution basis.
184
+ - [ ] Local methodology references were read before selecting method.
185
+ - [ ] The compact methodology line `METHOD: {flavor} / {method}` was output.
186
+ - [ ] A concise `SWITCH:` line was output when the method changed.
187
+ - [ ] User-view miss and satisfaction gap were classified.
188
+ - [ ] A guiding method was selected, or switched if the prior method failed.
189
+ - [ ] Missing-piece feedback triggered coverage mapping.
190
+ - [ ] The new plan was blue-team attacked from the user's point of view.
191
+ - [ ] New success contract is explicit.
192
+ - [ ] Goal and desired result were restated.
193
+ - [ ] Blocking questions were asked only when facts could not answer them.
194
+ - [ ] Three hypotheses were listed.
195
+ - [ ] The changed approach is materially different.
196
+ - [ ] A proof command or scenario is named.
197
+ - [ ] Learning handoff is made when the miss is reusable.
@@ -0,0 +1,49 @@
1
+ # DevFlow PUA Flavor Display
2
+
3
+ Use this display protocol when `devflow-pua` activates or switches method. Keep the user-visible methodology contract short; put routing detail into the reasoning/work notes only when needed.
4
+
5
+ ## Required Lines
6
+
7
+ Every pressure recovery must show one compact visible line:
8
+
9
+ ```text
10
+ METHOD: {flavor} / {method}
11
+ ```
12
+
13
+ If the method changed after a failed recovery, add one concise switch line:
14
+
15
+ ```text
16
+ SWITCH: <old flavor>/<old method> -> <new flavor>/<new method>: <reason>
17
+ ```
18
+
19
+ ## Compact Display
20
+
21
+ ```text
22
+ METHOD: Huawei / RCA + Blue-Team
23
+ ```
24
+
25
+ ## Switch Display
26
+
27
+ ```text
28
+ METHOD: Alibaba / Closure + Coverage Map
29
+ SWITCH: Amazon/Customer Backwards -> Alibaba/Coverage Map: goal is understood, but entrypoints, commands, sync, and proof coverage are incomplete.
30
+ ```
31
+
32
+ ## Flavor Voice Map
33
+
34
+ | Flavor | Visible name |
35
+ |---|---|
36
+ | Alibaba | Alibaba |
37
+ | Huawei | Huawei |
38
+ | Amazon | Amazon |
39
+ | Musk | Musk |
40
+ | Jobs | Jobs |
41
+ | Baidu | Baidu |
42
+ | ByteDance | ByteDance |
43
+ | Microsoft | Microsoft |
44
+ | Pinduoduo | Pinduoduo |
45
+ | JD | JD |
46
+
47
+ ## Anti-Theater Rule
48
+
49
+ The compact line is a user-facing contract, not decoration. It is invalid unless the selected method is also backed by method steps, a changed approach, and proof in the recovery work.
@@ -0,0 +1,193 @@
1
+ # DevFlow PUA Methodology Library
2
+
3
+ This is the local method library used by `devflow-pua`. It extracts the practical execution parts of the original PUA methodology files into DevFlow-Core runtime form.
4
+
5
+ Read this after `methodology-router.md` chooses a flavor.
6
+
7
+ ## Alibaba: Closure Method
8
+
9
+ Use when feedback says the work is incomplete, missing surfaces, or not closed.
10
+
11
+ Steps:
12
+
13
+ 1. Define the exact goal and visible result.
14
+ 2. Build a Coverage Map: files, commands, skills, docs, install sync, UI/backend behavior, validation.
15
+ 3. Track each surface to proof.
16
+ 4. Deliver result evidence.
17
+ 5. Retrospect and capture learning if repeatable.
18
+
19
+ Evidence:
20
+
21
+ ```text
22
+ Coverage Map: <surface -> status -> proof>
23
+ Closure proof: <command/scenario>
24
+ ```
25
+
26
+ ## Huawei: RCA + Blue-Team
27
+
28
+ Use when behavior is still wrong, bug/proof failed, or a root cause is unclear.
29
+
30
+ Steps:
31
+
32
+ 1. State the symptom in the user's words.
33
+ 2. Run 5-Why or equivalent root-cause tracing.
34
+ 3. Search callers/references and sibling entrypoints.
35
+ 4. Blue-team attack the proposed fix before editing.
36
+ 5. Prove the original symptom no longer reproduces.
37
+
38
+ Evidence:
39
+
40
+ ```text
41
+ RCA: symptom -> cause chain -> selected fix point
42
+ Blue-team attack: <how this could still fail>
43
+ Proof: <original symptom command/scenario>
44
+ ```
45
+
46
+ ## Amazon: Customer Backwards
47
+
48
+ Use when user-visible result, UX, API, workflow, or acceptance is mismatched.
49
+
50
+ Steps:
51
+
52
+ 1. Write the customer-visible success result first.
53
+ 2. Define what the user should see, do, or distinguish.
54
+ 3. Identify internal surfaces needed to create that result.
55
+ 4. Dive deep into facts instead of explaining old work.
56
+ 5. Prove with the user's acceptance scenario.
57
+
58
+ Evidence:
59
+
60
+ ```text
61
+ Customer result: <visible outcome>
62
+ Acceptance proof: <scenario>
63
+ ```
64
+
65
+ ## Musk: The Algorithm
66
+
67
+ Use when the previous work may be solving the wrong requirement or overbuilding.
68
+
69
+ Steps:
70
+
71
+ 1. Question whether the requirement or artifact is correct.
72
+ 2. Delete unnecessary scope.
73
+ 3. Simplify the remaining path.
74
+ 4. Accelerate implementation only after simplification.
75
+ 5. Automate only when the manual path is proven.
76
+
77
+ Evidence:
78
+
79
+ ```text
80
+ Deleted scope: <what was cut>
81
+ Simplified path: <why this is smaller>
82
+ ```
83
+
84
+ ## Jobs: Subtraction + Highest Standard
85
+
86
+ Use when the result technically works but is unclear, ugly, hard to distinguish, or unsatisfying.
87
+
88
+ Steps:
89
+
90
+ 1. Define the visible quality bar.
91
+ 2. Remove confusing or unnecessary elements.
92
+ 3. Make the primary result unmistakable.
93
+ 4. Keep one DRI-owned path.
94
+ 5. Inspect the final artifact from the user's eye level.
95
+
96
+ Evidence:
97
+
98
+ ```text
99
+ Quality bar: <what must be visibly true>
100
+ User-eye review: <what changed>
101
+ ```
102
+
103
+ ## Baidu: Search First
104
+
105
+ Use when the agent guessed from memory, missed docs, or facts may be stale.
106
+
107
+ Steps:
108
+
109
+ 1. Search local source/docs before deciding.
110
+ 2. Prefer primary/local source over explanation.
111
+ 3. Record what was found and what is still unknown.
112
+ 4. Choose the simplest reliable option.
113
+
114
+ Evidence:
115
+
116
+ ```text
117
+ Source facts: <files/docs/commands checked>
118
+ Unknowns: <none or remaining>
119
+ ```
120
+
121
+ ## ByteDance: Data/Proof
122
+
123
+ Use when verification is weak, metrics matter, or confidence is replacing evidence.
124
+
125
+ Steps:
126
+
127
+ 1. Define the proof metric or scenario before editing.
128
+ 2. Run the smallest meaningful check.
129
+ 3. Compare output to acceptance.
130
+ 4. Report PASS/FAIL/BLOCKED without hiding gaps.
131
+
132
+ Evidence:
133
+
134
+ ```text
135
+ Proof metric: <what proves it>
136
+ Result: <actual output>
137
+ ```
138
+
139
+ ## Microsoft: Learning Loop
140
+
141
+ Use when the same hypothesis keeps repeating or the agent did not change action after failure.
142
+
143
+ Steps:
144
+
145
+ 1. Name the failed assumption.
146
+ 2. Gather new evidence.
147
+ 3. State the changed action.
148
+ 4. Verify impact.
149
+ 5. Capture next-time intercept if reusable.
150
+
151
+ Evidence:
152
+
153
+ ```text
154
+ Failed assumption: <old belief>
155
+ Changed action: <new behavior>
156
+ Verified impact: <proof>
157
+ ```
158
+
159
+ ## Pinduoduo: Cut Middle Layers
160
+
161
+ Use when process, abstraction, or intermediate artifacts are blocking result.
162
+
163
+ Steps:
164
+
165
+ 1. List the current chain of steps.
166
+ 2. Remove every middle layer not required for the user-visible result.
167
+ 3. Keep the shortest decision chain.
168
+ 4. Deliver the result path, not methodology theater.
169
+
170
+ Evidence:
171
+
172
+ ```text
173
+ Removed middle layers: <items>
174
+ Shortest path: <remaining path>
175
+ ```
176
+
177
+ ## JD: Frontline Result
178
+
179
+ Use when remote guessing, install/runtime mismatch, or real user environment is the risk.
180
+
181
+ Steps:
182
+
183
+ 1. Inspect the actual runtime/install surface.
184
+ 2. Verify where the user will experience the result.
185
+ 3. Push decision to frontline evidence.
186
+ 4. Report only what real environment proof supports.
187
+
188
+ Evidence:
189
+
190
+ ```text
191
+ Frontline surface: <runtime/project/user-level surface>
192
+ Environment proof: <command/scenario>
193
+ ```
@@ -0,0 +1,78 @@
1
+ # DevFlow PUA Methodology Router
2
+
3
+ This is the local runtime source for pressure-recovery methodology. It is adapted into DevFlow-Core from the PUA methodology-router idea so agents do not need to link to or read another project at runtime.
4
+
5
+ Use this file whenever `devflow-pua` activates.
6
+
7
+ ## Rule
8
+
9
+ A flavor is not decoration. It is the active problem-solving method plus a short visible voice. Switching flavor means switching behavior.
10
+
11
+ Always display the selected method with this compact user-facing line:
12
+
13
+ ```text
14
+ METHOD: {flavor} / {method}
15
+ ```
16
+
17
+ If switching away from a failed method, add:
18
+
19
+ ```text
20
+ SWITCH: <old flavor>/<old method> -> <new flavor>/<new method>: <reason>
21
+ ```
22
+
23
+ The route, switch reason, and evidence still matter, but they are internal selection checks unless the user asks for full diagnostics.
24
+
25
+ ## Starting Route
26
+
27
+ | Signal | Flavor | Method | Required behavior |
28
+ |---|---|---|---|
29
+ | Bug, error, regression, behavior unchanged | Huawei | RCA + Blue-Team | Trace root cause, search callers, attack the fix before editing. |
30
+ | User-visible UX/product/result mismatch | Amazon | Customer Backwards | Start from the user-visible result and acceptance proof. |
31
+ | Repeated missing pieces, missed sync, incomplete entrypoints | Alibaba | Closure + Coverage Map | Enumerate every required surface and prove each one. |
32
+ | New feature, scope pressure, overbuilding risk | Musk | The Algorithm | Question need, delete, simplify, then build the minimum. |
33
+ | Quality complaint, hard-to-distinguish result, polish gap | Jobs | Subtraction + Highest Standard | Remove noise and define the visible quality bar. |
34
+ | Guessing without evidence, docs/API uncertainty | Baidu | Search First | Retrieve facts before deciding. |
35
+ | Proof gap, metrics, validation uncertainty | ByteDance | Data/Proof | Define measurable evidence before claiming result. |
36
+ | Repeated same hypothesis, no changed action | Microsoft | Learning Loop | Failed assumption -> new evidence -> changed action -> proof. |
37
+ | Too many middle steps, ceremony, or unnecessary layers | Pinduoduo | Cut Middle Layers | Remove process and ship the shortest result path. |
38
+
39
+ Default when no signal is clear: Alibaba Closure, because recovery needs goal, process, result, and retrospective.
40
+
41
+ ## Failure Switch
42
+
43
+ When the current method fails, switch by failure pattern. Do not repeat a failed method unchanged.
44
+
45
+ | Failure pattern | Switch chain | Why |
46
+ |---|---|---|
47
+ | Same approach loop | Musk -> Pinduoduo -> Huawei | Reset assumptions, cut noise, then attack root cause. |
48
+ | Missing this / missing that | Alibaba -> Amazon -> Huawei | Map surfaces, re-check desired result, then trace root cause. |
49
+ | User says result is not what they wanted | Amazon -> Jobs -> Alibaba | Rebuild from user outcome, tighten visible quality, then close coverage. |
50
+ | Behavior still unchanged | Huawei -> Microsoft -> Baidu | Root cause failed, inspect learning loop, then retrieve new facts. |
51
+ | Proof absent or weak | ByteDance -> JD -> Alibaba | Evidence first, result ownership, closure. |
52
+ | Guessing or stale memory | Baidu -> Amazon -> Huawei | Find facts, work backwards, then root-cause. |
53
+ | Overbuilt or wrong artifact | Musk -> Jobs -> Alibaba | Delete wrong structure, focus target surface, close coverage. |
54
+
55
+ ## Pre-Switch Check
56
+
57
+ Before switching, answer:
58
+
59
+ 1. Did the current method's core steps actually run?
60
+ 2. Is failure due to the method being wrong, or execution being incomplete?
61
+ 3. Does the next method directly address the failure pattern?
62
+
63
+ If the current method was not executed, run it properly before switching. If it was executed and still missed, switch immediately and restart checks from facts.
64
+
65
+ ## Method Summaries
66
+
67
+ | Flavor | Method summary |
68
+ |---|---|
69
+ | Alibaba | Define goal, track process, get result, retrospective. Recovery uses Coverage Map and closure proof. |
70
+ | Huawei | RCA 5-Why, caller/reference search, Blue-Team attack, evidence-based delivery. |
71
+ | Amazon | Customer Obsession, Working Backwards, Dive Deep, Single-Threaded Owner. |
72
+ | Musk | Question requirement, delete, simplify, accelerate, automate only after proof. |
73
+ | Jobs | Subtraction before addition, visible quality bar, DRI responsibility. |
74
+ | Baidu | Search and source retrieval before judgment; simple and reliable output. |
75
+ | ByteDance | Data before intuition; verification path before completion claim. |
76
+ | Microsoft | Learning loop: failed assumption, new evidence, changed action, verified impact. |
77
+ | Pinduoduo | Cut all middle layers; results only; shortest decision chain. |
78
+ | JD | Customer result and frontline reality; no remote guessing. |
@@ -0,0 +1,92 @@
1
+ ---
2
+ name: devflow-spec
3
+ description: "Use after devflow-core selects a saved spec for a confirmed request that needs approach comparison, a reviewable design contract, and a requirements document before implementation."
4
+ ---
5
+
6
+ # DevFlow Spec
7
+
8
+ Write the smallest useful spec document before implementation when the request needs more than a short design contract.
9
+
10
+ This is Superpowers-style spec discipline adapted to DevFlow: write specs only when they reduce ambiguity, review them before planning, and keep plans traceable to specs or approved designs.
11
+
12
+ ## When To Write A Spec
13
+
14
+ Use a saved spec when any of these are true:
15
+
16
+ - The user asks for a spec, specs doc, design doc, or requirements document.
17
+ - The work crosses modules, roles, persistence, APIs, release flow, or user-visible workflows.
18
+ - Several requirements must stay aligned across implementation tasks.
19
+ - The plan would be hard to review without a written source of truth.
20
+
21
+ Do not force a spec for Design-lite work where a short design contract and quick proof are enough.
22
+
23
+ ## Process
24
+
25
+ 1. Consume the `Confirmed request` that `devflow-core` selected for Spec work, then read the relevant project facts. Do not re-confirm settled request fields or route the lifecycle.
26
+ 2. Load `skills/devflow-spec/references/spec-plan-methods.md`, then compare the smallest real options before writing: no change/reuse when it can meet the request, direct implementation, and any existing project pattern that materially changes the decision. State trade-offs and why the selected approach is the smallest useful one.
27
+ 3. Write the design contract and saved spec under `docs/specs/YYYY-MM-DD-<short-kebab-name>.md`, resolved from the current target project's root, unless that project already documents another specs path.
28
+ 4. Include the required sections with English headers:
29
+ - Goal
30
+ - Context
31
+ - Requirements
32
+ - Non-goals
33
+ - Approach
34
+ - Impact
35
+ - Acceptance
36
+ - Verification
37
+ - Code Documentation
38
+ - Open Questions
39
+
40
+ In `Approach`, record the compared options, trade-offs, chosen design, boundaries, and why rejected options do not meet the current request. Section content should be written in the user's language, but section headers must remain in English so `scripts/devflow-spec.js` can validate them.
41
+
42
+ The **Code Documentation** section records the documentation requirements this feature actually creates:
43
+ - Which modules/files or public interfaces need an explanation, and why
44
+ - Which functions/classes need a comment because their contract, failure behavior, or decision is not evident from code
45
+ - Which non-obvious, business, security, or compatibility boundaries need inline WHY comments
46
+ - Reference to existing project comment conventions when they apply
47
+ - For trivial changes or self-explanatory code with no triggered requirement, state "none — trivial change" explicitly
48
+ 5. Run the design/spec self-review:
49
+ - Unresolved-marker scan: no draft markers, unresolved question marks, or unresolved angle values.
50
+ - Consistency: requirements, chosen approach, impact, acceptance, and verification do not contradict.
51
+ - Scope: if multiple independent subsystems appear, split into separate specs.
52
+ - Design: the comparison names the real alternatives and the selected approach has an explicit trade-off.
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
+ 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
+
56
+ ## Output
57
+
58
+ ```text
59
+ Spec: docs/specs/YYYY-MM-DD-<short-kebab-name>.md
60
+ Source: <Confirmed request selected by devflow-core>
61
+ Design: options compared <pass/fail>; selected approach and trade-off <pass/fail>
62
+ Review: unresolved-marker scan <pass/fail>; consistency <pass/fail>; scope <pass/fail>; design <pass/fail>
63
+ Next: approved A-branch Spec -> `devflow-cut`; non-success facts -> `devflow-core`
64
+ ```
65
+
66
+ ## Anti-Rationalization
67
+
68
+ | Excuse | Reality |
69
+ |---|---|
70
+ | "A plan is enough." | If requirements can drift across tasks, write the spec first. |
71
+ | "The spec can be vague; the plan will decide." | Vague specs create wrong plans. Resolve or mark the question before planning. |
72
+ | "Brainstorm already chose the approach." | Brainstorm confirms what the user wants; Spec compares how to satisfy it and records the design contract. |
73
+ | "The user approved the spec, so Core must route it." | An approved A-branch Spec has one successor and directly enters Cut; exceptions still return Core facts. |
74
+ | "This belongs in docs/features." | `docs/features/` is product ledger memory, not a generated implementation spec. |
75
+ | "The user said implement, so skip approval." | Implementation requests still need the lightest useful design/spec source before Build. |
76
+ | "Code Documentation is unnecessary, the code is self-explanatory." | Record the actual decision: `none — trivial change` is valid only when no project convention, public boundary, or non-obvious WHY needs preservation. |
77
+ | "Comments will get stale." | Keep required documentation accurate; stale wording is not a reason to omit a needed contract or decision record. |
78
+ | "I'll add comments later." | Name required documentation in the Spec so Plan and Build can verify it with the implementation. |
79
+
80
+ ## Verification
81
+
82
+ Before leaving this skill, confirm:
83
+
84
+ - [ ] Spec scope was named.
85
+ - [ ] Real options, trade-offs, and the chosen approach are recorded in the design contract.
86
+ - [ ] Required sections exist, including Code Documentation.
87
+ - [ ] Spec landed under the current project's `docs/specs/YYYY-MM-DD-<short-kebab-name>.md` path or a documented target-project specs path.
88
+ - [ ] Unresolved-marker, consistency, scope, and design checks ran.
89
+ - [ ] Code Documentation section names triggered documentation requirements and locations (or explicitly states "none — trivial change").
90
+ - [ ] `scripts/devflow-spec.js` ran when available.
91
+ - [ ] User reviewed and approved the design contract and written spec.
92
+ - [ ] An approved A-branch Spec entered `devflow-cut`; any non-success facts returned to `devflow-core`.
@@ -0,0 +1,15 @@
1
+ # DevFlow Spec And Plan Methods
2
+
3
+ Owner: `devflow-spec` and `devflow-plan`. Load this reference only after Core selects Spec or Plan.
4
+
5
+ ## Method 10: Spec Document And Plan Pack
6
+
7
+ `devflow-spec` consumes an A-branch Confirmed request, compares real no-change/reuse/direct options, writes a reviewable design contract under `docs/specs/`, and waits for user approval. An approved A-branch Spec directly enters Cut; non-success facts return to Core.
8
+
9
+ `devflow-plan` consumes A/B `CUT_PASS` plus an approved design or confirmed Spec. It creates one implementation plan under `docs/plans/`, then waits for user review. An approved A/B Plan directly enters Build; scope-drift facts return to Core.
10
+
11
+ A Spec contains Goal, Context, Requirements, Non-goals, Approach, Impact, Acceptance, Verification, Code Documentation, and Open Questions. A Plan states Source, Spec coverage, Cut Decision, External Skills, exact files or anchors, interfaces, current and target behavior, mechanics, call impact, verification, comments, and exclusions.
12
+
13
+ ## Plan Contract
14
+
15
+ The static plan checker validates structure, not architecture. A Plan must not expand the Cut Decision; any added dependency, abstraction, file responsibility, or feature returns scope-drift facts to Core.
@@ -0,0 +1,11 @@
1
+ # @devflow-core/dsh-devflow bundle patch: inserts the host plugin row into the
2
+ # web profile roster. Applied as a profile bundle layer (the `dsh.bundle.patch`
3
+ # manifest field) over dsh-base; activate with
4
+ # `dsh plugin --profile web add @devflow-core/dsh-devflow`.
5
+ #
6
+ # The row is a bare plugin by package name: the node half (exports ".") runs
7
+ # in the host process and syncs the bundled DevFlow assets (preset devflow-2,
8
+ # skills, commands, scripts) into ~/.dsh on startup. No browser half.
9
+ - insert:
10
+ - id: devflow
11
+ name: '@devflow-core/dsh-devflow'