@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.
- package/NOTICE +13 -0
- package/README.md +82 -0
- package/assets/commands/devflow-adversarial.toml +11 -0
- package/assets/commands/devflow-audit.toml +32 -0
- package/assets/commands/devflow-debt.toml +42 -0
- package/assets/commands/devflow-find-fault.toml +11 -0
- package/assets/commands/devflow-learn.toml +21 -0
- package/assets/commands/devflow-plan.toml +58 -0
- package/assets/commands/devflow-prove.toml +20 -0
- package/assets/commands/devflow-pua.toml +40 -0
- package/assets/commands/devflow-review.toml +36 -0
- package/assets/commands/devflow-spec.toml +49 -0
- package/assets/commands/devflow.toml +35 -0
- package/assets/presets/devflow-2/NOTICE +4 -0
- package/assets/presets/devflow-2/README.md +71 -0
- package/assets/presets/devflow-2/agent.cordis.yml +337 -0
- package/assets/presets/devflow-2/custom-bash.mjs +213 -0
- package/assets/presets/devflow-2/preset.yml +3 -0
- package/assets/presets/devflow-2/tool-bootstrap.mjs +496 -0
- package/assets/scripts/devflow-audit.js +275 -0
- package/assets/scripts/devflow-debt.js +196 -0
- package/assets/scripts/devflow-doctor.js +90 -0
- package/assets/scripts/devflow-plan.js +638 -0
- package/assets/scripts/devflow-review.js +93 -0
- package/assets/scripts/devflow-spec.js +238 -0
- package/assets/skills/devflow-adversarial/SKILL.md +71 -0
- package/assets/skills/devflow-audit/SKILL.md +78 -0
- package/assets/skills/devflow-brainstorm/SKILL.md +176 -0
- package/assets/skills/devflow-brainstorm/references/interview-discipline.md +184 -0
- package/assets/skills/devflow-build/SKILL.md +238 -0
- package/assets/skills/devflow-build/references/build-methods.md +40 -0
- package/assets/skills/devflow-core/SKILL.md +93 -0
- package/assets/skills/devflow-core/references/core-methods.md +131 -0
- package/assets/skills/devflow-core/references/reference-projects.md +133 -0
- package/assets/skills/devflow-core/references/skill-guide.md +63 -0
- package/assets/skills/devflow-cut/SKILL.md +208 -0
- package/assets/skills/devflow-cut/references/cut-methods.md +65 -0
- package/assets/skills/devflow-cut/references/native-capability-checklist.md +112 -0
- package/assets/skills/devflow-docs-followup/SKILL.md +132 -0
- package/assets/skills/devflow-docs-followup/agents/openai.yaml +4 -0
- package/assets/skills/devflow-find-fault/SKILL.md +109 -0
- package/assets/skills/devflow-learn/SKILL.md +176 -0
- package/assets/skills/devflow-plan/SKILL.md +142 -0
- package/assets/skills/devflow-plan/references/plan-methods.md +74 -0
- package/assets/skills/devflow-project-knowledge/SKILL.md +354 -0
- package/assets/skills/devflow-prove/SKILL.md +216 -0
- package/assets/skills/devflow-prove/references/code-review-checklist.md +202 -0
- package/assets/skills/devflow-prove/references/flow-self-test.md +775 -0
- package/assets/skills/devflow-prove/references/proof-recovery-methods.md +26 -0
- package/assets/skills/devflow-pua/SKILL.md +197 -0
- package/assets/skills/devflow-pua/references/flavor-display.md +49 -0
- package/assets/skills/devflow-pua/references/methodology-library.md +193 -0
- package/assets/skills/devflow-pua/references/methodology-router.md +78 -0
- package/assets/skills/devflow-spec/SKILL.md +92 -0
- package/assets/skills/devflow-spec/references/spec-plan-methods.md +15 -0
- package/cordis.patch.yml +11 -0
- package/lib/dsh-home.js +33 -0
- package/lib/index.js +79 -0
- package/lib/mount-once.js +34 -0
- package/lib/sync.js +168 -0
- package/package.json +32 -0
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
# DevFlow Core Methods
|
|
2
|
+
|
|
3
|
+
This is the shared method source loaded by `devflow-core` before route selection. It contains only the invariants needed by every route. Load the selected owner reference from the map below before applying lifecycle-specific rules.
|
|
4
|
+
|
|
5
|
+
## Method 0: Architect Mindset
|
|
6
|
+
|
|
7
|
+
Apply these principles to every route:
|
|
8
|
+
|
|
9
|
+
1. Read the affected system and blast radius before changing it.
|
|
10
|
+
2. Preserve contracts unless the accepted goal requires a contract change.
|
|
11
|
+
3. Prefer the smallest necessary coupling and mechanism.
|
|
12
|
+
4. Trace data and callers before diagnosing a bug.
|
|
13
|
+
5. Scale ceremony to reversibility and failure modes.
|
|
14
|
+
6. Treat complexity as a limited budget.
|
|
15
|
+
7. Use fresh evidence, not intuition, for completion claims.
|
|
16
|
+
8. Prefer the nearest established project convention before introducing a new pattern; a deliberate deviation states its reason, impact, and proof.
|
|
17
|
+
9. Give each type or module one dominant responsibility; split, merge, or abstract only when responsibilities, dependencies, lifecycle, or likely change reasons materially differ.
|
|
18
|
+
10. Evaluate caching, optimization, and concurrency against demonstrated workload or a concrete failure mode; add them only with measurable benefit plus clear ownership, invalidation, and consistency behavior.
|
|
19
|
+
11. Optimize for local understanding: a maintainer familiar with the project should be able to identify business intent, key rules, failure paths, and side effects from nearby names and structure.
|
|
20
|
+
12. Apply SOLID and platform best practices as decision lenses, not mandatory patterns. A simpler solution is preferred when it preserves correctness, readability, maintainability, contracts, and required performance.
|
|
21
|
+
|
|
22
|
+
## Capability Map
|
|
23
|
+
|
|
24
|
+
| Need | Runtime owner | Load when |
|
|
25
|
+
|---|---|---|
|
|
26
|
+
| Context, route choice, clarification, small-boundary, method lens, skill contract | this file | every `devflow-core` route |
|
|
27
|
+
| Reuse, root cause, native, overbuild, debt | `skills/devflow-cut/references/cut-methods.md` | user-selected A/B/C direct entry or Core exception selection |
|
|
28
|
+
| Spec or Plan | `skills/devflow-spec/references/spec-plan-methods.md` | A direct Spec / A/B direct Plan or Core exception selection |
|
|
29
|
+
| Build minimal change and implementation slices | `skills/devflow-build/references/build-methods.md` | C `CUT_PASS`, approved A/B Plan, or Core exception selection |
|
|
30
|
+
| Proof and recovery | `skills/devflow-prove/references/proof-recovery-methods.md` | completed Build direct Prove or Core exception selection |
|
|
31
|
+
| Learning-card lifecycle | `skills/devflow-learn/SKILL.md` | Prove PASS review or reusable correction |
|
|
32
|
+
|
|
33
|
+
## Method 1: Context Map
|
|
34
|
+
|
|
35
|
+
Read the narrowest useful facts:
|
|
36
|
+
|
|
37
|
+
1. Project rules and relevant source, tests, commands, and current docs.
|
|
38
|
+
2. `.copilot/LEARNING_INDEX.md`, then only cards whose Trigger and Scope match.
|
|
39
|
+
3. `docs/project-knowledge/AI-START-HERE.md` or `index.md`, then only navigation-selected documents.
|
|
40
|
+
4. `graphify-out/GRAPH_REPORT.md` when architecture impact is in scope.
|
|
41
|
+
5. Available environment skills; record a matching specialist skill without widening DevFlow scope. For a matched specialist, record the bounded-work contract:
|
|
42
|
+
|
|
43
|
+
```text
|
|
44
|
+
Owner: current DevFlow node
|
|
45
|
+
Role: bounded specialist work
|
|
46
|
+
Expected evidence: result needed by that node
|
|
47
|
+
Return: result / not-applicable / failure facts
|
|
48
|
+
|
|
49
|
+
The current owner evaluates the return using its existing gate.
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
A specialist result cannot alter depth, approval, direct-success, or Core-return rules; DevFlow remains the lifecycle meta-skill.
|
|
53
|
+
|
|
54
|
+
Missing indexes or references are non-blocking and must not create storage.
|
|
55
|
+
|
|
56
|
+
```text
|
|
57
|
+
Facts: read/confirmed <files or commands>
|
|
58
|
+
Methods: read/confirmed core-methods.md; selected owner references <paths or none>
|
|
59
|
+
Knowledge recall: none / learning index + matched card / project knowledge entry + matched docs
|
|
60
|
+
Skill Discovery: none / <skill-name> (matched: <why>)
|
|
61
|
+
Unknowns: <none or specific unknown>
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
On DeepSeek Harness (DSH), a long autonomous node — a multi-command Problem or Fast investigation, or Prove evidence gathering with no user gate — may persist its objective with the `create_goal` / `update_goal` tools so it survives context compaction. Never use a goal to span the gated creative lifecycle (Brainstorm clarification, Spec or Plan approval stops): those remain explicit user gates.
|
|
65
|
+
|
|
66
|
+
On DeepSeek Harness code mode (PTC, `run_code`), batch the independent Sense reads above into one program with `Promise.all` (read-only calls may overlap) and `print` only the needed fields instead of dumping full text, so the summary lands in the compaction head. Split into multiple calls when a later read depends on an earlier result. Wrap optional reads — missing indexes or matched cards — in `try/catch` around `ToolCallError` so a missing source stays non-blocking.
|
|
67
|
+
|
|
68
|
+
## Method 2: Brainstorm Clarification
|
|
69
|
+
|
|
70
|
+
Before any creative work — creating features, building components, adding functionality, modifying behavior, or defining an unapproved problem-directed change — select `devflow-brainstorm`. This applies even when the request appears clear or low risk. Pure Q&A, lookup, verification, investigation-only reports, and already approved changes remain outside this entry gate.
|
|
71
|
+
|
|
72
|
+
Read minimum facts, send a Semantic Echo-Back, resolve one real uncertainty at a time, and stop after this fixed artifact:
|
|
73
|
+
|
|
74
|
+
```text
|
|
75
|
+
Confirmed request:
|
|
76
|
+
- Goal: ...
|
|
77
|
+
- Scope: ...
|
|
78
|
+
- Out of scope: ...
|
|
79
|
+
- Constraints: ...
|
|
80
|
+
- Acceptance: ...
|
|
81
|
+
- Open questions: ...
|
|
82
|
+
- Status: clarified
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
After the fixed summary, Brainstorm presents A/B/C for an explicit user selection. A directly enters Spec; B and C directly enter Cut. Brainstorm never selects the depth itself. All non-success or non-unique artifacts return facts to Core for routing.
|
|
86
|
+
|
|
87
|
+
## Method 3: Small Request Boundary
|
|
88
|
+
|
|
89
|
+
Use Fast only when impact, risk, uncertainty, and proof are all small. Design-lite is for an existing feature with one plausible path after facts are read. Choose full Design when behavior, options, contracts, modules, compatibility, or rollback are unclear. Ask the user to choose when facts cannot distinguish the route.
|
|
90
|
+
|
|
91
|
+
## Method 4: Method Lens
|
|
92
|
+
|
|
93
|
+
Select one lens only when it changes execution judgment:
|
|
94
|
+
|
|
95
|
+
| Lens | Use when | Action |
|
|
96
|
+
|---|---|---|
|
|
97
|
+
| Root Cause | Bug or regression | Search callers and shared cause before proposing a fix. |
|
|
98
|
+
| Working Backwards | Product or workflow ambiguity | Start from a user-visible acceptance result. |
|
|
99
|
+
| First Principles Cut | Problem solving, bug fixing, architecture, scope, or abstraction pressure | Reduce to facts, constraints, invariants, and smallest mechanism. |
|
|
100
|
+
| Data/Proof | Metrics or verifier-sensitive work | Define evidence and owner before implementation. |
|
|
101
|
+
| Operational Owner | Cross-file or release work | Name responsible surface and rollback or follow-through evidence. |
|
|
102
|
+
|
|
103
|
+
## Method 15: Skill As Executable Contract
|
|
104
|
+
|
|
105
|
+
Every skill must state when it applies, concrete actions, artifact or output, stop or return boundary, and verification. Put trigger language in its description. Do not duplicate the full framework in every skill or entry file.
|
|
106
|
+
|
|
107
|
+
## Shared Output Contracts
|
|
108
|
+
|
|
109
|
+
Design:
|
|
110
|
+
|
|
111
|
+
```text
|
|
112
|
+
Goal: ...
|
|
113
|
+
Motivation: ...
|
|
114
|
+
Smallest useful plan: ...
|
|
115
|
+
Not doing: ...
|
|
116
|
+
Impact: ...
|
|
117
|
+
Verification: ...
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Completion:
|
|
121
|
+
|
|
122
|
+
```text
|
|
123
|
+
Command: ...
|
|
124
|
+
Result: ...
|
|
125
|
+
Adversarial review: ...
|
|
126
|
+
Judgment: PASS / FAIL / BLOCKED
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
## Script Path Resolution
|
|
130
|
+
|
|
131
|
+
Resolve DevFlow checker scripts in this order: `scripts/devflow-<name>.js` in the target project, `~/.codex/scripts/devflow-<name>.js`, then `~/.claude/scripts/devflow-<name>.js`. A missing checker is noted as unavailable; do not search `skills/scripts/`. On DeepSeek Harness (DSH), run the target-project checker through the DSH shell tool as `node scripts/devflow-<name>.js` and resolve a user-level checker at `~/.dsh/scripts/devflow-<name>.js`; DSH has no `~/.codex` or `~/.claude` home.
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
# Reference Project Extraction
|
|
2
|
+
|
|
3
|
+
This file records what the local reference projects actually provide and what DevFlow-Core absorbed as native capabilities. It is an implementation audit, not a dependency map.
|
|
4
|
+
|
|
5
|
+
## Ponytail
|
|
6
|
+
|
|
7
|
+
What it does:
|
|
8
|
+
|
|
9
|
+
- Enforces a smallest-working-solution ladder.
|
|
10
|
+
- Prioritizes existing code, standard library, native platform, installed dependencies, one-line/config, then minimum new code.
|
|
11
|
+
- Runs the ladder after reading and tracing the touched flow.
|
|
12
|
+
- For bug fixes, searches callers and prefers the shared root-cause fix when it is the smaller correct fix.
|
|
13
|
+
- Provides overengineering review and whole-repo audit tags: `delete`, `reuse`, `stdlib`, `native`, `yagni`, `shrink`.
|
|
14
|
+
- Tracks deliberate simplifications with debt markers.
|
|
15
|
+
- Provides `lite`, `full`, and `ultra` intensity modes.
|
|
16
|
+
- Ships multi-host adapters and command entries.
|
|
17
|
+
|
|
18
|
+
Absorbed into DevFlow-Core:
|
|
19
|
+
|
|
20
|
+
- `devflow-cut` now owns the Minimal Solution Ladder and overengineering review tags.
|
|
21
|
+
- `devflow-cut` now includes cut intensity levels and the bug-fix Root-Cause Check.
|
|
22
|
+
- `skills/devflow-cut/references/native-capability-checklist.md` provides platform and standard-library alternatives.
|
|
23
|
+
- `devflow-build` allows intentional simplification markers with explicit ceiling and revisit trigger.
|
|
24
|
+
- `commands/devflow-debt.toml` harvests `devflow:` markers into a shortcut ledger.
|
|
25
|
+
- `commands/devflow-review.toml` exposes a delete-list style review.
|
|
26
|
+
- `commands/devflow-audit.toml`, `skills/devflow-audit/SKILL.md`, and `scripts/devflow-audit.js` expose a repo-wide overengineering audit without applying fixes.
|
|
27
|
+
- `reuse` is a first-class overengineering tag for repeated helpers, utilities, types, or patterns that should use existing project code.
|
|
28
|
+
|
|
29
|
+
Not absorbed:
|
|
30
|
+
|
|
31
|
+
- Benchmark scoreboard and hook-based mode persistence. They are useful product features, but not required for the first practical DevFlow release.
|
|
32
|
+
|
|
33
|
+
## Agent Skills
|
|
34
|
+
|
|
35
|
+
What it does:
|
|
36
|
+
|
|
37
|
+
- Organizes development into lifecycle commands: define, plan, build, verify, review, ship.
|
|
38
|
+
- Defines a consistent skill anatomy: frontmatter, process, rationalizations, red flags, verification.
|
|
39
|
+
- Uses context engineering, source-driven development, incremental implementation, test-driven development, code simplification, and launch checklists.
|
|
40
|
+
- Provides commands and persona-style reviewers.
|
|
41
|
+
|
|
42
|
+
Absorbed into DevFlow-Core:
|
|
43
|
+
|
|
44
|
+
- `skills/devflow-core/references/skill-guide.md` and all `SKILL.md` files now require executable skill contracts, anti-rationalization checks, and verification.
|
|
45
|
+
- `devflow-core` maps work to route and next skill.
|
|
46
|
+
- `devflow-build` includes plan-pack, source-check, and slice execution.
|
|
47
|
+
- `devflow-prove` includes rules/skills/references validation.
|
|
48
|
+
- `commands/*.toml` expose practical lifecycle entry points.
|
|
49
|
+
|
|
50
|
+
Not absorbed:
|
|
51
|
+
|
|
52
|
+
- Full 24-skill lifecycle. DevFlow-Core keeps a small focused skill set to stay lightweight.
|
|
53
|
+
|
|
54
|
+
## Superpowers
|
|
55
|
+
|
|
56
|
+
What it does:
|
|
57
|
+
|
|
58
|
+
- Makes brainstorming mandatory before creative/build work.
|
|
59
|
+
- Writes design docs and implementation plans with hard handoffs.
|
|
60
|
+
- Executes plans through small tasks with verification.
|
|
61
|
+
- Uses subagent-driven development, code review gates, TDD, and verification-before-completion.
|
|
62
|
+
- Tests skills through real pressure scenarios.
|
|
63
|
+
|
|
64
|
+
Absorbed into DevFlow-Core:
|
|
65
|
+
|
|
66
|
+
- `Sense -> Brainstorm -> [STOP: Depth A/B/C] -> (A: devflow-spec -> /devflow-plan | B: /devflow-plan | C: direct) -> devflow-cut -> devflow-build -> devflow-prove` remains the default chain.
|
|
67
|
+
- `devflow-brainstorm` includes design approval shape, assumption challenges, and approach comparison.
|
|
68
|
+
- `devflow-spec`, `commands/devflow-spec.toml`, and `scripts/devflow-spec.js` add a saved requirements source for larger or explicitly spec-requested work.
|
|
69
|
+
- Generated specs default to `docs/specs/YYYY-MM-DD-<short-kebab-name>.md`; `docs/plans/` remains implementation planning.
|
|
70
|
+
- `devflow-plan` and Plan Pack now require `Source:` and `Spec coverage:` so tasks trace to a spec or approved design.
|
|
71
|
+
- `devflow-build` includes implementation slices and exact verification per slice.
|
|
72
|
+
- `skills/devflow-prove/references/flow-self-test.md` defines pressure scenarios for the framework itself.
|
|
73
|
+
|
|
74
|
+
Not absorbed:
|
|
75
|
+
|
|
76
|
+
- Mandatory worktree/subagent/full TDD or full design-doc approval for every task. DevFlow-Core uses saved specs only when they reduce ambiguity.
|
|
77
|
+
|
|
78
|
+
## PUA-Driven Spec Engineering
|
|
79
|
+
|
|
80
|
+
What it does:
|
|
81
|
+
|
|
82
|
+
- Adds Fast / Design / Escalate routing.
|
|
83
|
+
- Requires project fact checks, Graphify, project knowledge, learning index, and coding rules before conclusions.
|
|
84
|
+
- Enforces skill activation evidence and completion proof.
|
|
85
|
+
- Maintains cross-platform rule consistency.
|
|
86
|
+
- Defines Codex-compatible proof contracts where local verification is candidate evidence, not final external verifier status.
|
|
87
|
+
|
|
88
|
+
Absorbed into DevFlow-Core:
|
|
89
|
+
|
|
90
|
+
- `devflow-core` now includes Fast / Design / Recovery routing.
|
|
91
|
+
- `skills/devflow-core/references/core-methods.md` includes Method Lens so Design, Recovery, and high-risk proof can choose a task-specific working strategy.
|
|
92
|
+
- `devflow-pua` now owns a local pressure-recovery methodology stack under `skills/devflow-pua/references/`: router, method library, and flavor display protocol.
|
|
93
|
+
- `devflow-brainstorm` now requires Method Lens selection or an explicit "standard route is enough" decision before the design contract.
|
|
94
|
+
- `devflow-learn` preserves the learning/pitfall card loop with `.copilot/LEARNING_INDEX.md` and matched cards.
|
|
95
|
+
- `AGENTS.md`, `.github/copilot-instructions.md`, and CodeBuddy rules stay semantically aligned.
|
|
96
|
+
- `devflow-prove` requires command/result/judgment and separates `candidate_pass` from external final approval when relevant.
|
|
97
|
+
- `devflow-prove` includes a Skill Activation Chain Check after rule, command, prompt, entry, or skill changes.
|
|
98
|
+
- `skills/devflow-prove/references/flow-self-test.md` includes correction and learning scenarios.
|
|
99
|
+
|
|
100
|
+
Not absorbed:
|
|
101
|
+
|
|
102
|
+
- Heavy pressure rhetoric and full spec-heavy process default. DevFlow-Core keeps the recovery mechanics without making every task high-pressure.
|
|
103
|
+
|
|
104
|
+
## PUA
|
|
105
|
+
|
|
106
|
+
What it does:
|
|
107
|
+
|
|
108
|
+
- Packages one core behavior across many platforms.
|
|
109
|
+
- Provides explicit commands, submodes, multi-language entry points, verifier/policy/action/self-review roles, and high-agency recovery.
|
|
110
|
+
- Uses method routing and failure-pattern switching.
|
|
111
|
+
- Emphasizes proactive follow-through, evidence, and independent verification.
|
|
112
|
+
|
|
113
|
+
Absorbed into DevFlow-Core:
|
|
114
|
+
|
|
115
|
+
- `plugin.json`, `gemini-extension.json`, commands, Copilot, and CodeBuddy entries make the framework installable/adaptable.
|
|
116
|
+
- Method Lens absorbs PUA method routing as native DevFlow behavior for normal work: Root Cause, Working Backwards, First Principles Cut, Data/Proof, and Operational Owner are selectable lenses.
|
|
117
|
+
- `devflow-pua/references/methodology-router.md`, `methodology-library.md`, and `flavor-display.md` absorb the practical PUA flavor-method routing for pressure recovery, including the compact visible output `METHOD: {flavor} / {method}` plus a concise `SWITCH:` line when the method changes.
|
|
118
|
+
- `devflow-prove` forbids self-certifying completion without evidence.
|
|
119
|
+
- `devflow-core` includes Recovery route and 3-hypothesis approach switching.
|
|
120
|
+
|
|
121
|
+
Not absorbed:
|
|
122
|
+
|
|
123
|
+
- Full PUA persona theater, pressure rhetoric, leaderboard, network feedback, agent lifecycle accounting, hook automation, and default full spec-heavy process. DevFlow-Core only keeps the lightweight flavor-method display needed for pressure recovery.
|
|
124
|
+
|
|
125
|
+
## Resulting Product Shape
|
|
126
|
+
|
|
127
|
+
DevFlow-Core is intentionally smaller than the reference projects:
|
|
128
|
+
|
|
129
|
+
- A small focused skill set, not 20+ lifecycle skills.
|
|
130
|
+
- One native method reference, not multiple competing method systems.
|
|
131
|
+
- Commands and platform entry files are thin adapters.
|
|
132
|
+
- Verification is runnable with `npm test`.
|
|
133
|
+
- Heavy flows are optional escalation, not the default developer experience.
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# DevFlow Skill Guide
|
|
2
|
+
|
|
3
|
+
## Skill Chain
|
|
4
|
+
|
|
5
|
+
```text
|
|
6
|
+
devflow-core -> devflow-brainstorm -> user-selected A/B/C
|
|
7
|
+
-> A: devflow-spec -> devflow-cut -> devflow-plan -> devflow-build -> devflow-prove
|
|
8
|
+
-> B: devflow-cut -> devflow-plan -> devflow-build -> devflow-prove
|
|
9
|
+
-> C: devflow-cut -> devflow-build -> devflow-prove
|
|
10
|
+
-> non-unique artifact: return facts to devflow-core
|
|
11
|
+
-> devflow-pua (when user challenge/repeated miss appears)
|
|
12
|
+
-> devflow-learn (when correction/pitfall appears)
|
|
13
|
+
-> devflow-audit (when repo-wide overengineering audit is requested)
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Skill Responsibilities
|
|
17
|
+
|
|
18
|
+
| Skill | Responsibility |
|
|
19
|
+
|---|---|
|
|
20
|
+
| `devflow-core` | Route entry and any non-unique artifact, load shared methods, and maintain the compact flow map. |
|
|
21
|
+
| `devflow-brainstorm` | Clarify intent, then let the user select A/B/C and start its direct branch. |
|
|
22
|
+
| `devflow-spec` | Write and validate saved requirements specs under `docs/specs/` before implementation planning. |
|
|
23
|
+
| `devflow-plan` | Create a Plan Pack from a `CUT_PASS`-bounded spec or approved design. |
|
|
24
|
+
| `devflow-cut` | Prevent overengineering and force reuse checks. |
|
|
25
|
+
| `devflow-build` | Implement the approved smallest useful change. |
|
|
26
|
+
| `devflow-prove` | Verify and report evidence before completion. |
|
|
27
|
+
| `devflow-pua` | Stop wrong-path recovery, re-ask or infer the desired result, switch approach, and hand back to Prove/Learn. |
|
|
28
|
+
| `devflow-learn` | Capture reusable corrections and pitfalls into `.copilot` learning cards. |
|
|
29
|
+
| `devflow-audit` | Audit a repository or scope for overengineering candidates without editing files. |
|
|
30
|
+
|
|
31
|
+
## Authoring Rules
|
|
32
|
+
|
|
33
|
+
- Keep each skill short enough to load directly.
|
|
34
|
+
- Put trigger phrases in `description`.
|
|
35
|
+
- Prefer imperative steps over explanation.
|
|
36
|
+
- Do not duplicate all framework rules inside every skill.
|
|
37
|
+
- A skill directly follows only its named A/B/C success edge; every other artifact returns facts to Core or states an independent stop boundary.
|
|
38
|
+
- Each skill must be executable: trigger, action steps, anti-rationalization check, stop/handoff, proof.
|
|
39
|
+
- Put shared routing details in `skills/devflow-core/references/core-methods.md`; put detailed lifecycle methods in the selected owner's local reference.
|
|
40
|
+
- Keep runtime methods in `skills/*/references/*`. `docs/` is reserved for product and generated artifacts — `docs/specs/` for saved specs, `docs/plans/` for saved plans — never runtime framework methods.
|
|
41
|
+
|
|
42
|
+
## Minimum Skill Contract
|
|
43
|
+
|
|
44
|
+
Every `SKILL.md` must include:
|
|
45
|
+
|
|
46
|
+
1. YAML frontmatter with `name` matching the folder.
|
|
47
|
+
2. A `description` that says what the skill does and when to use it.
|
|
48
|
+
3. Concrete steps.
|
|
49
|
+
4. Required output or artifact.
|
|
50
|
+
5. Handoff target or stop condition.
|
|
51
|
+
6. Verification or Proof section.
|
|
52
|
+
|
|
53
|
+
## Command Mapping
|
|
54
|
+
|
|
55
|
+
| Command | Primary skill |
|
|
56
|
+
|---|---|
|
|
57
|
+
| `/devflow` | `devflow-core` |
|
|
58
|
+
| `/devflow-spec` | `devflow-spec` |
|
|
59
|
+
| `/devflow-plan` | Plan creation from spec or approved design |
|
|
60
|
+
| `/devflow-review` | `devflow-cut` |
|
|
61
|
+
| `/devflow-prove` | `devflow-prove` |
|
|
62
|
+
| `/devflow-pua` | `devflow-pua` |
|
|
63
|
+
| `/devflow-audit` | `devflow-audit` |
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: devflow-cut
|
|
3
|
+
description: "Use before adding code, dependencies, abstractions, configs, folders, framework layers, generic engines, reusable capabilities, or when checking YAGNI, Ponytail ladder reuse, root-cause fixes, platform-native options, scope creep, bloat, and simplification. Cuts unnecessary work before writing it. Also use when the user says 'review for over-engineering', 'is this over-engineered', 'simplify review', 'review this diff/PR for cuts', or '/devflow-cut'."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# DevFlow Cut
|
|
7
|
+
|
|
8
|
+
Cut unnecessary work before writing it.
|
|
9
|
+
|
|
10
|
+
**Violating the letter of the rules is violating the spirit of the rules.**
|
|
11
|
+
|
|
12
|
+
## Context
|
|
13
|
+
|
|
14
|
+
Receives a Core-selected approved design or an approved A-branch Spec. Cut decides the smallest implementation boundary before any construction plan; do not use a future plan as evidence for these gates.
|
|
15
|
+
|
|
16
|
+
Before applying the Minimal Solution Ladder or Required Gates, load `skills/devflow-cut/references/cut-methods.md`. That reference owns the detailed reuse, root-cause, native, overbuild, and debt rules.
|
|
17
|
+
|
|
18
|
+
- `CUT_PASS` produces a Cut Decision and directly enters Plan for A/B or Build for C.
|
|
19
|
+
- A user-approved Plan Pack receives only a lightweight Cut-consistency review. If it adds scope, dependencies, abstractions, or file responsibilities outside the Cut Decision, return the affected-gate facts to Core before any further lifecycle choice.
|
|
20
|
+
|
|
21
|
+
## Cut Intensity
|
|
22
|
+
|
|
23
|
+
Choose the lightest level that fits the risk:
|
|
24
|
+
|
|
25
|
+
| Level | Use when | Behavior |
|
|
26
|
+
|---|---|---|
|
|
27
|
+
| `lite` | User asks for a normal feature and the requested path is plausible. | Build the requested path, but name the smaller alternative in one line. |
|
|
28
|
+
| `full` | Default for coding, fixes, dependencies, abstractions, and framework work. | Enforce the ladder and block avoidable new structure. |
|
|
29
|
+
| `ultra` | User asks to simplify, remove bloat, avoid overengineering, or review a diff/repo for cuts. | Prefer deletion before addition and challenge the requirement when a smaller outcome covers it. |
|
|
30
|
+
|
|
31
|
+
## Minimal Solution Ladder
|
|
32
|
+
|
|
33
|
+
This is the canonical ladder; `cut-methods.md` does not redefine it. **Ponytail** names the reference project whose smallest-solution ladder this section absorbs natively — the `Ponytail Rung` field in the Required Gates reports the numbered rung where this ladder stops.
|
|
34
|
+
|
|
35
|
+
After reading the touched flow, stop at the first rung that works:
|
|
36
|
+
|
|
37
|
+
1. Does this need to exist?
|
|
38
|
+
2. Can the user goal be met by not changing code?
|
|
39
|
+
3. Does it already exist in this codebase?
|
|
40
|
+
4. Does an available skill in the environment handle this without writing new code? (e.g., `pdf` for reading a PDF, `understand` for codebase analysis. If a skill like `frontend-design` can perform bounded specialist work, load it alongside the devflow route — it complements, not replaces, the devflow chain. Produce `CUT_REUSE` only when the skill fully handles the task with no new code needed.)
|
|
41
|
+
5. Does the standard library do it?
|
|
42
|
+
6. Does the native platform do it?
|
|
43
|
+
7. Does an already-installed dependency do it?
|
|
44
|
+
8. Can it be one line or direct configuration?
|
|
45
|
+
9. Only then write the minimum new code.
|
|
46
|
+
|
|
47
|
+
If two rungs both work, take the earlier rung and move on. The ladder is not permission to skip reading; first trace the real flow the change touches.
|
|
48
|
+
|
|
49
|
+
External specialist skills complement the chain but never widen it. Under conflict the priority is: Cut Decision > Plan Pack > external skill guidance. When a matched skill (e.g., `frontend-design`) recommends structure outside the allowed scope, keep the Cut scope and return the broader recommendation as scope-drift facts to `devflow-core`.
|
|
50
|
+
|
|
51
|
+
## Root-Cause Fix Check
|
|
52
|
+
|
|
53
|
+
For bug fixes, do not patch only the reported symptom. Before editing a function, component, route, command, or rule:
|
|
54
|
+
|
|
55
|
+
1. Search callers/references of the touched unit.
|
|
56
|
+
2. Decide whether one shared guard/fix solves all callers with less code than per-caller patches.
|
|
57
|
+
3. If the shared fix would change unrelated behavior, name that risk and keep the narrower fix.
|
|
58
|
+
|
|
59
|
+
Output:
|
|
60
|
+
|
|
61
|
+
```text
|
|
62
|
+
Root-Cause Check: searched <callers/references>; fix location <shared/narrow>; reason <why>
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Native Capability Check
|
|
66
|
+
|
|
67
|
+
Before adding a dependency or wrapper, scan `skills/devflow-cut/references/native-capability-checklist.md` for the relevant layer.
|
|
68
|
+
|
|
69
|
+
Output:
|
|
70
|
+
|
|
71
|
+
```text
|
|
72
|
+
Native Check: checked <layer>; native option <used/not enough>; reason <why>
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
If the native option is not enough, name the current limitation and evidence.
|
|
76
|
+
|
|
77
|
+
## Required Gates
|
|
78
|
+
|
|
79
|
+
Missing answers block Build:
|
|
80
|
+
|
|
81
|
+
```text
|
|
82
|
+
Reuse Check: what existing capability was searched/confirmed? Include available environment skills that match the task.
|
|
83
|
+
Ponytail Rung: where did the ladder stop, and why were lower rungs insufficient?
|
|
84
|
+
Root-Cause Check: for bug fixes, were callers/shared entry points searched? shared or narrow fix, and why?
|
|
85
|
+
Native Check: is platform or standard-library capability enough?
|
|
86
|
+
Overbuild Check: any new dependency/abstraction/config/directory/framework layer/generic engine? why needed now?
|
|
87
|
+
Diff Check: how does each planned change trace to the goal?
|
|
88
|
+
Scope Check: what unrequested behavior was cut?
|
|
89
|
+
External Skills: <skill-name>; role: <bounded specialist work>; expected evidence: <result needed by this node>; return facts: <result / not-applicable / failure> / none — matched at Sense via Skill Discovery; inherited by the Plan Pack and loaded by Build.
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Overengineering Review Tags
|
|
93
|
+
|
|
94
|
+
When reviewing a diff or plan, output one line per finding:
|
|
95
|
+
|
|
96
|
+
```text
|
|
97
|
+
<file>:L<line>: <tag>: <what to cut>. <replacement>.
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Tags:
|
|
101
|
+
|
|
102
|
+
- `delete`: dead code, unused flexibility, speculative feature
|
|
103
|
+
- `reuse`: duplicate code or helper that should use an existing project helper, utility, type, or pattern
|
|
104
|
+
- `stdlib`: hand-rolled thing the standard library ships
|
|
105
|
+
- `native`: dependency or code doing what the platform already does
|
|
106
|
+
- `yagni`: abstraction/config/layer with no current need
|
|
107
|
+
- `shrink`: same behavior with fewer moving parts
|
|
108
|
+
|
|
109
|
+
End with:
|
|
110
|
+
|
|
111
|
+
```text
|
|
112
|
+
net: <N> lines/deps/steps possible
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
If nothing should be cut, say:
|
|
116
|
+
|
|
117
|
+
```text
|
|
118
|
+
Lean already. Ship.
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## Examples
|
|
122
|
+
|
|
123
|
+
✅ `src/validator.js:L12-38: stdlib: 27-line EmailValidator class. "@" in email, 1 line; real validation is the confirmation mail.`
|
|
124
|
+
|
|
125
|
+
✅ `utils/time.js:L4: native: moment.js imported for one format call. Intl.DateTimeFormat, 0 deps.`
|
|
126
|
+
|
|
127
|
+
✅ `repo.py:L88: yagni: AbstractRepository with one implementation. Inline it until a second one exists.`
|
|
128
|
+
|
|
129
|
+
✅ `api/retry.js:L52-71: delete: retry wrapper around an idempotent local call. Nothing replaces it.`
|
|
130
|
+
|
|
131
|
+
✅ `build.js:L30-44: shrink: manual loop builds dict. dict(zip(keys, values)), 1 line.`
|
|
132
|
+
|
|
133
|
+
✅ `helpers/format.js:L9: reuse: duplicate date formatter. Use utils/time.js:formatDate, already in project.`
|
|
134
|
+
|
|
135
|
+
❌ "This EmailValidator class might be more complex than necessary, have you considered whether all these validation rules are needed at this stage?" — 太软,无定位、无替换方案、无量化。
|
|
136
|
+
|
|
137
|
+
## Intentional Simplification Marker
|
|
138
|
+
|
|
139
|
+
If you intentionally choose a shortcut with a real ceiling, mark it in code or docs:
|
|
140
|
+
|
|
141
|
+
```text
|
|
142
|
+
devflow: <ceiling>, revisit when <trigger>
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Use the marker only for deliberate, accepted simplifications. The marker must name both the ceiling and the revisit trigger so `/devflow-debt` can harvest it later.
|
|
146
|
+
|
|
147
|
+
Never use a marker to excuse missing security, data safety, accessibility, or required validation.
|
|
148
|
+
|
|
149
|
+
## Do Not Cut
|
|
150
|
+
|
|
151
|
+
Do not remove:
|
|
152
|
+
|
|
153
|
+
- trust-boundary validation
|
|
154
|
+
- auth, permission, or data-loss protection
|
|
155
|
+
- security and accessibility
|
|
156
|
+
- explicitly requested behavior
|
|
157
|
+
- the smallest useful verification for non-trivial logic
|
|
158
|
+
|
|
159
|
+
## Cut Result
|
|
160
|
+
|
|
161
|
+
Output one of:
|
|
162
|
+
|
|
163
|
+
```text
|
|
164
|
+
CUT_PASS: smallest scope holds; A/B enter `devflow-plan`, C enters `devflow-build`
|
|
165
|
+
CUT_REDUCE: proposed scope is too heavy; reduce to <smaller option>
|
|
166
|
+
CUT_REUSE: existing capability can be reused; do not write new implementation
|
|
167
|
+
CUT_BLOCKED: missing facts or risk too high; return the blocking facts to `devflow-core`
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
When `CUT_REDUCE` or `CUT_REUSE` occurs, **STOP — present the reduction or reuse finding to the user**. Explain what was cut, what existing capability replaces it, and why the smaller option is sufficient. After confirmation, return the confirmed result to `devflow-core`.
|
|
171
|
+
|
|
172
|
+
When `CUT_BLOCKED` occurs, return the blocking facts to `devflow-core`. Core decides whether it must restart `devflow-brainstorm` to re-explore the goal and constraints.
|
|
173
|
+
|
|
174
|
+
## Anti-Rationalization
|
|
175
|
+
|
|
176
|
+
| Excuse | Reality |
|
|
177
|
+
|---|---|
|
|
178
|
+
| "This abstraction will help later." | Later can add it when there is a second real use. |
|
|
179
|
+
| "A dependency is cleaner." | Cleaner than platform/native only when a current limitation proves it. |
|
|
180
|
+
| "It's just a tiny wrapper." | Wrappers become owned API. Check if they add real value. |
|
|
181
|
+
| "Tests are bloat." | The smallest useful verification is not bloat. |
|
|
182
|
+
| "This is only the ticketed path." | For bugs, check callers first; the shared root cause may be the smaller fix. |
|
|
183
|
+
| "We can add the upgrade later." | If a shortcut has a known ceiling, record the trigger with `devflow:` now. |
|
|
184
|
+
|
|
185
|
+
## Red Flags — STOP
|
|
186
|
+
|
|
187
|
+
- About to write new code without running the ladder
|
|
188
|
+
- "This abstraction will help later" without a second real use today
|
|
189
|
+
- Adding a dependency when native/stdlib covers it
|
|
190
|
+
- Skipping Root-Cause Check for a bug fix
|
|
191
|
+
- Cutting trust-boundary validation, security, or data-loss protection
|
|
192
|
+
- Proceeding to Build with `CUT_REDUCE` or `CUT_REUSE` without user confirmation
|
|
193
|
+
|
|
194
|
+
**All of these mean: stop and run the gates.**
|
|
195
|
+
|
|
196
|
+
## Handoff
|
|
197
|
+
|
|
198
|
+
After `CUT_PASS`, record a Cut Decision containing the allowed scope, reuse conclusion, exclusions, required verification, `External Skills`, and `Depth`. A recorded specialist role performs bounded work only; Cut retains reuse and scope authority, and `CUT_PASS` is never delegated. A/B directly enter `devflow-plan`; C directly enters `devflow-build`. `CUT_REDUCE`, `CUT_REUSE`, and `CUT_BLOCKED` return facts to `devflow-core`; `CUT_REDUCE` and `CUT_REUSE` remain stopped until user confirmation. A Plan Pack that broadens scope returns affected-gate facts to Core before any later selection.
|
|
199
|
+
|
|
200
|
+
## Verification
|
|
201
|
+
|
|
202
|
+
Before leaving this skill, confirm:
|
|
203
|
+
|
|
204
|
+
- [ ] Reuse, Root-Cause when relevant, Native, Overbuild, Diff, and Scope checks were answered.
|
|
205
|
+
- [ ] Any new structure has a current need.
|
|
206
|
+
- [ ] Removed scope is explicitly named.
|
|
207
|
+
- [ ] Intentional simplifications have `devflow:` ceiling and revisit trigger markers.
|
|
208
|
+
- [ ] Cut result is one of the four allowed statuses.
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# DevFlow Cut Methods
|
|
2
|
+
|
|
3
|
+
Owner: `devflow-cut`. Load this reference after a user-selected A/B/C direct Cut entry or when Core selects Cut for a non-unique artifact.
|
|
4
|
+
|
|
5
|
+
## Method 5: Minimal Solution Ladder
|
|
6
|
+
|
|
7
|
+
The canonical Minimal Solution Ladder lives in `skills/devflow-cut/SKILL.md` (nine rungs, plus the `Ponytail` definition). Do not redefine the ladder here: read the SKILL.md ladder, stop at the first rung that meets the accepted goal, and record the selected rung.
|
|
8
|
+
|
|
9
|
+
Record:
|
|
10
|
+
|
|
11
|
+
```text
|
|
12
|
+
Reuse Check: searched <files/helpers/patterns/skills>; selected rung <N>; reason <why lower rungs failed>
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Do not cut explicit behavior, accessibility, security, data protection, or the smallest useful verification.
|
|
16
|
+
|
|
17
|
+
## Method 6: Root-Cause Fix Check
|
|
18
|
+
|
|
19
|
+
For bugs, search the likely function, route, command, helper, and callers before editing. Prefer a shared correction when it covers sibling callers without changing unrelated behavior; otherwise record why the narrow correction is safer.
|
|
20
|
+
|
|
21
|
+
```text
|
|
22
|
+
Root-Cause Check: searched <callers/references>; fix location <shared/narrow>; reason <why>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Method 7: Native Capability Check
|
|
26
|
+
|
|
27
|
+
Read `native-capability-checklist.md` before adding a dependency or wrapper. Name the current platform limitation when native capability is insufficient.
|
|
28
|
+
|
|
29
|
+
```text
|
|
30
|
+
Native Check: checked <layer>; platform option <used/not enough>; reason <why>
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Method 8: Anti-Overengineering Gate
|
|
34
|
+
|
|
35
|
+
Before adding a dependency, abstraction, configuration surface, directory, framework layer, or generic engine, answer why it is needed now. One caller favors direct code. Hypothetical reuse does not justify a new structure.
|
|
36
|
+
|
|
37
|
+
```text
|
|
38
|
+
Overbuild Check: what new structure is being added? Why is it needed now?
|
|
39
|
+
Reuse Check: what existing capability was checked first?
|
|
40
|
+
Trace Check: what accepted request does each key change trace to?
|
|
41
|
+
Scope Check: what tempting but unrequested feature was removed?
|
|
42
|
+
Diff Check: which user goal does each changed file serve?
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Method 8A: Contextual Design Quality Check
|
|
46
|
+
|
|
47
|
+
For changes that introduce or relocate code, alter module responsibilities, or add performance behavior, inspect the nearest comparable project code before selecting a shape. Record the decision without requiring a fixed layer, class count, interface, or cache:
|
|
48
|
+
|
|
49
|
+
```text
|
|
50
|
+
Convention Check: compared <nearby files/patterns>; followed <convention> / deviated because <current reason>; impact <none or specific>
|
|
51
|
+
Responsibility Check: <type/module> owns <dominant responsibility>; split/merge/abstraction <not needed or reason tied to dependencies/lifecycle/change reason>
|
|
52
|
+
Performance Check: workload/failure evidence <facts or none>; cache/optimization/concurrency <not needed or chosen>; benefit, ownership, invalidation, consistency <when chosen>
|
|
53
|
+
Readability Check: local names/structure expose <intent, key rules, failure paths, side effects>; remaining trade-off <none or specific>
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
A simpler solution may replace a nearby pattern when it improves correctness, readability, maintainability, or measured performance without breaking an accepted contract. Do not add a structure merely to satisfy a principle name.
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
When a safe, deliberate shortcut has a known ceiling, mark it near the choice:
|
|
60
|
+
|
|
61
|
+
```text
|
|
62
|
+
devflow: <ceiling>, revisit when <trigger>
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Never use a marker to excuse missing security, data safety, accessibility, or requested behavior.
|