@acrasie/dev-flow 0.0.0-stage → 1.0.1

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 (58) hide show
  1. package/.codex-plugin/plugin.json +20 -0
  2. package/LICENSE +21 -0
  3. package/README.md +181 -2
  4. package/dist/codex-dev-flow.mjs +3 -0
  5. package/dist/dev-flow.mjs +241 -0
  6. package/docs/adr/0001-hybrid-portable-workflow.md +23 -0
  7. package/docs/adr/0002-share-an-invalidable-context-capsule.md +55 -0
  8. package/docs/adr/0004-scale-assurance-lanes-by-applicable-risk.md +36 -0
  9. package/docs/adr/0006-make-intake-adaptive-user-authoritative-and-token-efficient.md +76 -0
  10. package/docs/adr/0007-collect-opt-in-local-benchmark-feedback.md +82 -0
  11. package/docs/adr/0008-automate-maintainer-releases-with-an-interactive-bun-workflow.md +121 -0
  12. package/docs/adr/0009-separate-intake-decisions-from-shape-discovery.md +200 -0
  13. package/docs/adr/0010-choose-quick-or-plan-after-discovery.md +161 -0
  14. package/docs/adr/0011-separate-fast-local-and-authoritative-ci-quality-gates.md +49 -0
  15. package/docs/adr/0012-use-bun-test-and-require-node-24.md +41 -0
  16. package/docs/adr/0013-layer-source-distribution-and-runtime-tests.md +42 -0
  17. package/docs/adr/0014-ratchet-source-coverage-with-bun.md +51 -0
  18. package/docs/adr/0015-split-fast-and-type-aware-linting.md +41 -0
  19. package/docs/adr/0016-use-husky-with-a-tested-bun-staged-file-adapter.md +45 -0
  20. package/docs/adr/0017-format-conservatively-with-oxfmt.md +45 -0
  21. package/docs/adr/0018-use-a-high-signal-oxlint-policy.md +53 -0
  22. package/docs/adr/0019-gate-deterministic-size-and-observe-timing.md +44 -0
  23. package/docs/adr/0020-support-linux-and-macos-with-targeted-ci.md +41 -0
  24. package/docs/adr/0021-randomize-tests-without-retries.md +35 -0
  25. package/docs/adr/0022-use-one-root-bun-workspace.md +41 -0
  26. package/docs/adr/0024-make-gate-a-minimal-plan-approval.md +74 -0
  27. package/docs/adr/0025-end-the-lifecycle-after-assure.md +55 -0
  28. package/docs/adr/0026-keep-intake-product-stable-and-interview-shape-by-dependency.md +151 -0
  29. package/docs/adr/0027-add-agentic-project-init-and-versioned-engineering-profiles.md +147 -0
  30. package/docs/adr/0028-make-public-documentation-user-first-and-current.md +65 -0
  31. package/docs/adr/0029-make-build-a-native-execution-boundary.md +51 -0
  32. package/docs/adr/0030-unify-product-domain-and-technical-design-interviews.md +240 -0
  33. package/docs/adr/0031-make-assure-the-success-boundary.md +205 -0
  34. package/docs/artifacts.md +47 -0
  35. package/docs/baselines/2026-07-18-p0-lifecycle.json +142 -0
  36. package/docs/design.md +101 -0
  37. package/docs/getting-started.md +204 -0
  38. package/docs/glossary/dev-flow.md +527 -0
  39. package/docs/lifecycle-contract.md +189 -0
  40. package/docs/lifecycle-contract.projection.json +931 -0
  41. package/docs/metrics-protocol.md +113 -0
  42. package/docs/project-profile-contract.md +157 -0
  43. package/docs/runbooks/maintainer-release.md +291 -0
  44. package/docs/target-intake-shape-contract.md +416 -0
  45. package/package.json +68 -4
  46. package/schemas/config.schema.json +104 -0
  47. package/schemas/policy.schema.json +17 -0
  48. package/schemas/project-init-state.schema.json +159 -0
  49. package/schemas/project-profile-local.schema.json +53 -0
  50. package/schemas/project-profile.schema.json +285 -0
  51. package/schemas/state.schema.json +826 -0
  52. package/skills/debug-root-cause/SKILL.md +16 -0
  53. package/skills/design-decisions/SKILL.md +24 -0
  54. package/skills/dev-flow/SKILL.md +306 -0
  55. package/skills/dev-flow/agents/openai.yaml +6 -0
  56. package/skills/discover-change/SKILL.md +31 -0
  57. package/skills/plan-change/SKILL.md +29 -0
  58. package/skills/review-change/SKILL.md +21 -0
package/docs/design.md ADDED
@@ -0,0 +1,101 @@
1
+ # Dev Flow Design
2
+
3
+ ## Goal
4
+
5
+ Portable five-phase workflow with high correctness and low token waste. Deterministic
6
+ code owns state, validation, routing, fingerprints, dependency closure, projections, and
7
+ guards. Skills own scoped reasoning. Each phase uses native Codex capabilities unless its
8
+ contract requires a narrower read-only role.
9
+
10
+ ## Public surface
11
+
12
+ ```text
13
+ $dev-flow <objective>
14
+ $dev-flow --benchmark <objective>
15
+ $dev-flow resume <task-id>
16
+ $dev-flow status [task-id]
17
+ ```
18
+
19
+ No invocation mode exists. Entire run text is objective. State V6 rejects V1–V5 without
20
+ migration.
21
+
22
+ ## Lifecycle
23
+
24
+ ```text
25
+ INTAKE -> SHAPE -> GATE -> BUILD -> ASSURE ✓
26
+ ```
27
+
28
+ Canonical Shape path:
29
+
30
+ ```text
31
+ new -> intaking -> discovering -> awaiting_profile_choice -> planning -> awaiting_approval
32
+ | |
33
+ +-> awaiting_intake_decision <-----+
34
+ ```
35
+
36
+ `awaiting_intake_decision` is INTAKE. It presents linked product question, then resumes
37
+ Discovery or Planning. No technical rediscovery is repeated.
38
+
39
+ ## INTAKE/SHAPE boundary
40
+
41
+ INTAKE owns objective, success signal, determining constraints, scope product decisions,
42
+ and risk. It does not choose preparation profile or perform deep repository discovery.
43
+ Every complete Intake enters Discovery.
44
+
45
+ Discovery is repository-reading role. It resolves bounded targets, records technical
46
+ facts with provenance and source fingerprints, and creates new targets only for material
47
+ impact. `discovery_sufficient` requires semantic sufficiency plus deterministic
48
+ freshness, dependency, and unresolved-target checks.
49
+
50
+ After sufficient Discovery, user chooses:
51
+
52
+ - **Quick:** compact canonical contract; no Markdown projection.
53
+ - **Plan:** detailed canonical contract and one deterministic Proposed Markdown.
54
+
55
+ Planning is repository-blind. Missing evidence produces targeted Discovery Target.
56
+ Quick and Plan share one contract schema and same correctness minimum.
57
+
58
+ ## GATE and completion
59
+
60
+ GATE performs one pure deterministic preflight, renders one five-line card, and requires
61
+ explicit user approve/change/reject intent. Approval covers complete local canonical
62
+ contract and exact digest. Contract change invalidates receipt. It never authorizes an
63
+ external action.
64
+
65
+ BUILD verifies only current approval and exact digest, then native Codex implements the
66
+ complete approved plan without a Dev Flow execution skill, checkpoint, progress tracker,
67
+ validation loop, or persisted BUILD output. Local technical corrections stay native;
68
+ material contract changes return to SHAPE then GATE. ASSURE derives current worktree diff,
69
+ records fresh criterion-linked evidence, and atomically derives `success` inside final
70
+ ASSURE phase. Git, GitHub, registry, and release delivery remains outside lifecycle
71
+ state.
72
+
73
+ ## Selective invalidation
74
+
75
+ `ShapeState` persists Discovery targets, evidence, source fingerprints, Decision
76
+ Escalations, profile choice, contract, projection, dependency DAG, invalidations, budget,
77
+ semantic retries, and receipts. Changed input invalidates only transitive dependency
78
+ closure. No full Shape reset API exists.
79
+
80
+ Supported source identities: Git blob, content digest, command plus input/result digest,
81
+ and external source with observation/TTL. Resume reuses fresh evidence without model
82
+ call and creates refresh work only for stale live evidence.
83
+
84
+ ## Safety and cost
85
+
86
+ Risk/policy controls worktree, threat, rollback, approvals, and assurance. Preparation
87
+ profile controls contract depth/durable projection only.
88
+
89
+ Nominal SHAPE uses one Discovery reasoning session and one Planning session. Extra calls
90
+ require new material or invalidated target. Soft limit checkpoint preserves all work and
91
+ requires explicit continue, reduce-scope, or cancel decision.
92
+
93
+ ## Artifacts
94
+
95
+ Canonical state owns logical contract. Plan Markdown is deterministic projection, not
96
+ second owner. Manual edit triggers integrate-or-regenerate reconciliation; material
97
+ integration changes digest and invalidates Approval.
98
+
99
+ See [lifecycle-contract.md](lifecycle-contract.md), [artifacts.md](artifacts.md),
100
+ [ADR 0009](adr/0009-separate-intake-decisions-from-shape-discovery.md), and
101
+ [ADR 0010](adr/0010-choose-quick-or-plan-after-discovery.md).
@@ -0,0 +1,204 @@
1
+ # Getting Started with Dev Flow
2
+
3
+ This guide installs Dev Flow, creates durable project engineering conventions,
4
+ runs a first task, and explains how to resume safely. Normative behavior remains in the
5
+ [Lifecycle contract](lifecycle-contract.md) and
6
+ [Project Engineering Profile contract](project-profile-contract.md).
7
+
8
+ ## 1. Check requirements
9
+
10
+ Plugin users need:
11
+
12
+ - Codex with plugin support;
13
+ - Node.js 24 or newer;
14
+ - Git; and
15
+ - Linux or macOS.
16
+
17
+ Check the runtime before installation:
18
+
19
+ ```bash
20
+ node --version
21
+ ```
22
+
23
+ Bun is not required to use the published plugin. It is a contributor dependency only.
24
+
25
+ ## 2. Install the plugin
26
+
27
+ ```bash
28
+ codex plugin marketplace add Acrazie/codex-dev-flow
29
+ codex plugin add dev-flow@acrazie
30
+ ```
31
+
32
+ The same installation is available interactively through `/plugins`: select
33
+ **Acrazie**, install **Dev Flow**, then start a new Codex session.
34
+
35
+ ## 3. Run Project INIT
36
+
37
+ Open Codex from the project repository and invoke:
38
+
39
+ ```text
40
+ $dev-flow init
41
+ ```
42
+
43
+ Project INIT is an agentic repository discovery and interview workflow:
44
+
45
+ ```mermaid
46
+ flowchart TD
47
+ E[Repository evidence] --> D[Discover stack, topology, and conventions]
48
+ D --> Q{Missing, stale, contradictory, or material decision?}
49
+ Q -- yes --> I[Ask one question with recommendation]
50
+ I --> D
51
+ Q -- no --> V[Validate candidate profile]
52
+ V --> A{Explicit Profile Approval?}
53
+ A -- approve --> P[Atomically publish profile and projections]
54
+ A -- reject --> U[Leave shared profile unchanged]
55
+ ```
56
+
57
+ It inspects available guidance, manifests, configuration, architecture sources, tests,
58
+ contracts, and representative code before asking. Questions cover only unresolved or
59
+ material decisions and appear one at a time. There is no fixed question count.
60
+
61
+ An abbreviated interaction can look like this:
62
+
63
+ ```text
64
+ You: $dev-flow init
65
+ Dev Flow: Discovery found a Node.js API with HTTP handlers and no explicit error envelope.
66
+ Recommended: one stable JSON error shape at the transport boundary.
67
+ A. Stable JSON envelope (Recommended)
68
+ B. Handler-specific payloads
69
+ You: A
70
+ Dev Flow: Profile candidate validated. Review summary ...
71
+ Approve publication of this exact profile digest?
72
+ You: Approve
73
+ ```
74
+
75
+ The wording and decisions adapt to repository evidence. The final explicit approval—not
76
+ the sample answer—authorizes profile publication.
77
+
78
+ ### Project INIT outputs
79
+
80
+ | File | Content | Git policy |
81
+ | --------------------------------------- | ----------------------------------------------------------- | ------------------------------- |
82
+ | `.codex/dev-flow.project.yaml` | Portable shared architecture, topology, stack, and rules. | Review and commit when desired. |
83
+ | `.codex/dev-flow.project.local.yaml` | Absolute service paths and personal non-contractual prefs. | Gitignored. |
84
+ | `.codex/project-init/state.yaml` | Compact resumable interview state; no transcript/reasoning. | Gitignored and temporary. |
85
+ | `.codex/dev-flow/diagrams/*.mermaid.md` | Optional canonical-profile projection. | Commit with shared profile. |
86
+
87
+ Secrets, secret-like values, and absolute machine paths are rejected from the shared
88
+ profile. A local preference cannot weaken repository policy or an approved shared
89
+ convention. Project INIT creates neither application code nor Dev Flow task state.
90
+
91
+ ## 4. Run the first task
92
+
93
+ Invoke a concrete software objective:
94
+
95
+ ```text
96
+ $dev-flow Add rate limiting to the public authentication endpoints
97
+ ```
98
+
99
+ The normal task path is:
100
+
101
+ ```text
102
+ INTAKE -> SHAPE -> GATE -> BUILD -> ASSURE ✓
103
+ ```
104
+
105
+ 1. **INTAKE** establishes product objective, observable success, constraints, and risk.
106
+ 2. **SHAPE** reads repository evidence, resolves technical uncertainty, and prepares a
107
+ Quick or Plan implementation contract.
108
+ 3. **GATE** displays a compact validation card and requires explicit approval of the
109
+ exact contract.
110
+ 4. **BUILD** lets native Codex implement the complete approved plan. Dev Flow only
111
+ checks the current approval/digest boundary and returns material changes to SHAPE.
112
+ 5. **ASSURE** reviews the result and runs fresh criterion-linked verification.
113
+
114
+ GATE approval covers local implementation only. It never authorizes commit, push, pull
115
+ request, registry publication, or release.
116
+
117
+ ## 5. Optional Configuration wizard
118
+
119
+ Project INIT owns project engineering knowledge. The separate deterministic
120
+ Configuration wizard owns plugin operating preferences:
121
+
122
+ ```bash
123
+ npx @acrasie/dev-flow init
124
+ ```
125
+
126
+ The npm package is named `@acrasie/dev-flow` because npm rejects the unscoped
127
+ `dev-flow` name as too similar to an existing package. The installed `codex-dev-flow` command
128
+ remains an alias of the same executable; it does not require a separate package.
129
+ Existing installations of the old npm package are not automatically migrated.
130
+ Upgrade the Acrazie marketplace and install `dev-flow@acrazie` to use the renamed
131
+ plugin; existing `.codex/` project configuration and state remain unchanged.
132
+ Replace the old plugin installation rather than installing both plugin identities
133
+ side by side.
134
+
135
+ Use it to customize worktree behavior, subscription/quota hints, or allowlisted
136
+ integrations. Defaults already exist, so the wizard is optional. Inspect or validate the
137
+ resolved configuration from Codex:
138
+
139
+ ```text
140
+ $dev-flow config show --explain
141
+ $dev-flow config validate --json
142
+ ```
143
+
144
+ Configuration precedence is:
145
+
146
+ ```text
147
+ internal defaults
148
+ < ~/.codex/dev-flow.yaml
149
+ < .codex/dev-flow.yaml
150
+ < .codex/dev-flow.local.yaml
151
+ < invocation flags
152
+ < non-weakenable repository policy
153
+ ```
154
+
155
+ ## Resume and troubleshoot
156
+
157
+ ### Project INIT was interrupted
158
+
159
+ Run `$dev-flow init` again in the same repository. Dev Flow reads the compact local
160
+ session and resumes the exact active question unless its dependency evidence changed.
161
+
162
+ ### Project evidence changed
163
+
164
+ Run `$dev-flow init` again. Fingerprints identify stale decisions and reconcile only
165
+ their dependent closure. Repository facts are rediscovered; user-owned conventions are
166
+ re-interviewed. Rejected changes leave the shared profile byte-for-byte unchanged.
167
+
168
+ ### Profile validation or approval failed
169
+
170
+ No shared publication occurs. Review the reported schema, privacy, authority, revision,
171
+ or digest error, correct the candidate through Project INIT, validate again, then approve
172
+ the new exact digest. Never edit around validation with a direct profile write.
173
+
174
+ ### Shared and local profiles conflict
175
+
176
+ The shared profile has higher authority. Remove the conflicting local preference, or run
177
+ Project INIT to propose a separately validated shared-profile update. Absolute service
178
+ paths belong only in the local overlay.
179
+
180
+ ### A task was interrupted
181
+
182
+ Inspect or resume it from Codex:
183
+
184
+ ```text
185
+ $dev-flow status [task-id]
186
+ $dev-flow resume <task-id>
187
+ ```
188
+
189
+ Resume reconciles durable state before continuing. It does not infer approval from a
190
+ previously displayed but changed implementation contract.
191
+
192
+ ### Node.js is rejected
193
+
194
+ Run `node --version` and install Node.js 24 or newer. Node.js 22 and older are outside the
195
+ supported runtime contract.
196
+
197
+ ## Next references
198
+
199
+ - [Plugin README](../README.md)
200
+ - [Lifecycle contract](lifecycle-contract.md)
201
+ - [Project Engineering Profile contract](project-profile-contract.md)
202
+ - [Configuration schema](../schemas/config.schema.json)
203
+ - [Project profile schema](../schemas/project-profile.schema.json)
204
+ - [Glossary](glossary/dev-flow.md)