scrumrun 1.5.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 (67) hide show
  1. package/CORE.md +381 -0
  2. package/DECISIONS.md +212 -0
  3. package/README.md +123 -0
  4. package/SPEC.md +324 -0
  5. package/bin/claude-install.js +147 -0
  6. package/bin/scrumrun.js +1194 -0
  7. package/package.json +48 -0
  8. package/templates/codex/prompts/sc-agent.md +14 -0
  9. package/templates/codex/prompts/sc-backlog.md +13 -0
  10. package/templates/codex/prompts/sc-challenge.md +57 -0
  11. package/templates/codex/prompts/sc-config.md +18 -0
  12. package/templates/codex/prompts/sc-context.md +24 -0
  13. package/templates/codex/prompts/sc-decisions.md +8 -0
  14. package/templates/codex/prompts/sc-feature.md +16 -0
  15. package/templates/codex/prompts/sc-fix.md +21 -0
  16. package/templates/codex/prompts/sc-goal.md +14 -0
  17. package/templates/codex/prompts/sc-golden.md +14 -0
  18. package/templates/codex/prompts/sc-help.md +12 -0
  19. package/templates/codex/prompts/sc-init.md +14 -0
  20. package/templates/codex/prompts/sc-intake.md +22 -0
  21. package/templates/codex/prompts/sc-know.md +75 -0
  22. package/templates/codex/prompts/sc-map.md +13 -0
  23. package/templates/codex/prompts/sc-review.md +13 -0
  24. package/templates/codex/prompts/sc-sprint.md +28 -0
  25. package/templates/codex/prompts/sc-study.md +23 -0
  26. package/templates/codex/prompts/sc-uninstall.md +14 -0
  27. package/templates/codex/prompts/sc-update.md +6 -0
  28. package/templates/codex/prompts/sc-vault.md +27 -0
  29. package/templates/codex/skills/scrumrun/SKILL.md +412 -0
  30. package/templates/opencode/commands/sc-agent.md +14 -0
  31. package/templates/opencode/commands/sc-backlog.md +13 -0
  32. package/templates/opencode/commands/sc-challenge.md +57 -0
  33. package/templates/opencode/commands/sc-config.md +18 -0
  34. package/templates/opencode/commands/sc-context.md +24 -0
  35. package/templates/opencode/commands/sc-decisions.md +8 -0
  36. package/templates/opencode/commands/sc-feature.md +16 -0
  37. package/templates/opencode/commands/sc-fix.md +21 -0
  38. package/templates/opencode/commands/sc-goal.md +14 -0
  39. package/templates/opencode/commands/sc-golden.md +14 -0
  40. package/templates/opencode/commands/sc-help.md +12 -0
  41. package/templates/opencode/commands/sc-init.md +14 -0
  42. package/templates/opencode/commands/sc-intake.md +22 -0
  43. package/templates/opencode/commands/sc-know.md +75 -0
  44. package/templates/opencode/commands/sc-map.md +13 -0
  45. package/templates/opencode/commands/sc-review.md +13 -0
  46. package/templates/opencode/commands/sc-sprint.md +28 -0
  47. package/templates/opencode/commands/sc-study.md +23 -0
  48. package/templates/opencode/commands/sc-uninstall.md +14 -0
  49. package/templates/opencode/commands/sc-update.md +6 -0
  50. package/templates/opencode/commands/sc-vault.md +27 -0
  51. package/templates/opencode/skills/scrumrun/SKILL.md +412 -0
  52. package/templates/project/.scrumrun/agents.md +36 -0
  53. package/templates/project/.scrumrun/backlog.md +7 -0
  54. package/templates/project/.scrumrun/config.md +13 -0
  55. package/templates/project/.scrumrun/context.md +61 -0
  56. package/templates/project/.scrumrun/features/.gitkeep +1 -0
  57. package/templates/project/.scrumrun/goals/main/decisions.md +9 -0
  58. package/templates/project/.scrumrun/goals/main/history.md +51 -0
  59. package/templates/project/.scrumrun/goals/main/sprint.md +54 -0
  60. package/templates/project/.scrumrun/golden-rules.md +9 -0
  61. package/templates/project/.scrumrun/knowledge.md +15 -0
  62. package/templates/project/.scrumrun/map.md +20 -0
  63. package/templates/project/.scrumrun/project.md +26 -0
  64. package/templates/project/.scrumrun/reviews/.gitkeep +1 -0
  65. package/templates/project/.scrumrun/runbook.md +101 -0
  66. package/templates/project/.scrumrun/token-policy.md +43 -0
  67. package/templates/project/AGENTS.md +59 -0
package/README.md ADDED
@@ -0,0 +1,123 @@
1
+ # ScrumRun
2
+
3
+ > A protocol for AI-assisted software development.
4
+ > Sprints, decisions, invariants, history — auditable and portable across agents.
5
+
6
+ **Method:** `1.0` (draft) · **CLI/Skill:** `1.5.0` · **License:** MIT
7
+
8
+ ScrumRun gives AI coding agents a stable memory, an explicit approval model, and a state machine for the work they do. The method is documented so any markdown-capable agent can follow it. Client-specific integrations (Claude Code, Codex, OpenCode) are optimizations, not requirements.
9
+
10
+ ---
11
+
12
+ ## Install
13
+
14
+ ```bash
15
+ npx scrumrun@latest init
16
+ ```
17
+
18
+ Local by default: creates `AGENTS.md` and `.scrumrun/`, adds them to `.git/info/exclude`. Use `--shared` to commit them.
19
+
20
+ ---
21
+
22
+ ## Usage
23
+
24
+ Once initialized, talk to your agent in natural language:
25
+
26
+ ```
27
+ crie um botão salvar no formulário de perfil
28
+ o checkout cobra em dobro após refresh
29
+ estude o módulo de pagamentos
30
+ rode a próxima sprint
31
+ ```
32
+
33
+ The agent runs intake (read-only), classifies the request, proposes a route, and asks for approval before touching artifacts or code. No configuration silently grants blanket implementation permission.
34
+
35
+ If you prefer explicit commands, they exist. The canonical grammar uses long flags (`--add`, `--run`, `--audit`, `--approve`). See `CORE.md` for the full reference.
36
+
37
+ ---
38
+
39
+ ## How it works
40
+
41
+ Three surfaces, physically separated:
42
+
43
+ - **Project rules** — golden rules and configuration that every agent honors.
44
+ - **Main goal** — the primary plan, its sprints, decisions, and history.
45
+ - **Feature lanes** — isolated planning that does not pollute the main goal.
46
+
47
+ Every artifact is a `.md` file under `.scrumrun/` with mandatory frontmatter. State transitions are explicit and recorded in `history.md` (append-only). `context.md` is a token-safe snapshot used as a reading guide — never as authoritative truth.
48
+
49
+ Fifteen numbered invariants (`I-01`…`I-15`) define behavior that cannot be silently overridden. Golden rules have highest precedence. Intake is strictly read-only. Approval is synchronous and explicit.
50
+
51
+ ---
52
+
53
+ ## Documentation
54
+
55
+ | File | Purpose |
56
+ |---|---|
57
+ | [`CORE.md`](./CORE.md) | Operational guide agents follow at runtime. |
58
+ | [`SPEC.md`](./SPEC.md) | Formal method specification — state machines, invariants, composition rules. |
59
+ | [`DECISIONS.md`](./DECISIONS.md) | ADRs explaining why the method is the way it is. |
60
+ | `.scrumrun/config.md` | Owner preferences (language, approval policy, quick-task policy). |
61
+ | `.scrumrun/golden-rules.md` | Absolute constraints for the project. |
62
+
63
+ For AI clients that do not auto-read project instructions, paste this at the start of a session:
64
+
65
+ ```
66
+ Read AGENTS.md and .scrumrun/core.md before doing anything else.
67
+ Follow ScrumRun exactly.
68
+ ```
69
+
70
+ ---
71
+
72
+ ## Portability
73
+
74
+ ScrumRun is designed to outlive specific AI clients. Any agent that reads markdown and follows instructions can implement it by reading `CORE.md`. Slash commands and skills are conveniences, not dependencies.
75
+
76
+ Compatibility matrix (planned, `method 1.0`):
77
+
78
+ | Agent | Slash commands | Skill | Manual (CORE.md) |
79
+ |---|---|---|---|
80
+ | Claude Code | ✓ | ✓ | ✓ |
81
+ | Codex | ✓ | — | ✓ |
82
+ | OpenCode | ✓ | — | ✓ |
83
+ | Any markdown-capable agent | — | — | ✓ |
84
+
85
+ A conformance test suite is planned under `tests/conformance/` for verifying implementations against the invariants in `SPEC.md`.
86
+
87
+ ---
88
+
89
+ ## Versioning
90
+
91
+ Three independent version numbers:
92
+
93
+ - **`method`** — the protocol itself. Major bumps only on breaking spec changes.
94
+ - **`cli`** — the installer and command surface.
95
+ - **`skill`** — the agent-facing instructions.
96
+
97
+ Tooling can iterate freely. Adopters pin the method version and update tooling with confidence. Every method change ships with a migration guide.
98
+
99
+ ---
100
+
101
+ ## Status
102
+
103
+ - ✅ Portable `CORE.md` for cross-agent execution
104
+ - ✅ Natural-language intake with approval gates
105
+ - ✅ Sprint, feature lane, fix, backlog, decision, knowledge artifacts
106
+ - ✅ Golden rules with unbypassable precedence
107
+ - ✅ Formal `SPEC.md` and `DECISIONS.md` (method 1.0 draft)
108
+ - 🚧 Command grammar consolidation (20 commands → 6, see ADR-013)
109
+ - 🚧 Method versioning separated from CLI
110
+ - 🚧 Portability matrix + conformance test suite
111
+ - 🚧 Landing page at [`scrumrun.dev`](https://scrumrun.dev)
112
+
113
+ ---
114
+
115
+ ## Contributing
116
+
117
+ The method is public and versioned. Proposals that change spec, invariants, or state machines require an ADR entry in `DECISIONS.md`. Tooling changes follow standard PR flow.
118
+
119
+ ---
120
+
121
+ ## License
122
+
123
+ MIT © Leander Costa
package/SPEC.md ADDED
@@ -0,0 +1,324 @@
1
+ # ScrumRun Method Specification
2
+
3
+ Version: `method 1.0` · Status: draft for review
4
+
5
+ This document is the formal specification of the ScrumRun method. `CORE.md` is the operational guide agents follow at runtime. `SPEC.md` is the source of truth for state machines, invariants, and composition rules.
6
+
7
+ If a conflict exists between `CORE.md` and `SPEC.md`, `SPEC.md` wins and `CORE.md` must be updated.
8
+
9
+ ---
10
+
11
+ ## 1. Terminology
12
+
13
+ | Term | Definition |
14
+ |---|---|
15
+ | **Method** | The ScrumRun protocol itself, versioned separately from tooling. |
16
+ | **Artifact** | A `.md` file under `.scrumrun/` that represents state or intent. |
17
+ | **Goal** | The primary long-lived outcome of the project. Exactly one main goal per project. |
18
+ | **Sprint** | A bounded unit of work under the main goal. |
19
+ | **Feature lane** | An isolated planning surface for work that should not pollute the main goal. |
20
+ | **Fix** | A corrective action for a defect or regression. Lighter than a sprint. |
21
+ | **Backlog item** | A candidate for future work. Not active, not committed. |
22
+ | **Decision** | A pending question that blocks or shapes execution. |
23
+ | **Golden rule** | An absolute constraint. Cannot be silently overridden. |
24
+ | **Knowledge fact** | A short, approved statement about the project used during planning. |
25
+ | **Dossier** | A deep, topic-focused study persisted as a durable document. |
26
+ | **Review agent** | A reusable review persona with defined scope and prompt. |
27
+ | **Intake** | The natural-language classifier that routes requests to workflows. |
28
+ | **Approval gate** | A synchronous checkpoint requiring explicit owner consent. |
29
+
30
+ ---
31
+
32
+ ## 2. Artifact Catalog
33
+
34
+ Every artifact lives at a canonical path and carries mandatory frontmatter. Files without valid frontmatter are treated as untrusted context.
35
+
36
+ ### 2.1 Frontmatter schema (universal)
37
+
38
+ ```yaml
39
+ ---
40
+ id: <artifact-id> # e.g. SPR-042, FIX-007, KNOW-K-013
41
+ kind: sprint|fix|feature|goal|backlog|decision|golden|knowledge|dossier|agent|review
42
+ status: <see state machine per kind>
43
+ created: YYYY-MM-DD
44
+ updated: YYYY-MM-DD
45
+ method: 1.0 # method version at time of creation
46
+ ---
47
+ ```
48
+
49
+ ### 2.2 Path map
50
+
51
+ | Kind | Path |
52
+ |---|---|
53
+ | goal (main) | `.scrumrun/goals/main/sprint.md` |
54
+ | goal history | `.scrumrun/goals/main/history.md` |
55
+ | goal decisions | `.scrumrun/goals/main/decisions.md` |
56
+ | feature | `.scrumrun/features/<slug>/feature.md` |
57
+ | feature sprint | `.scrumrun/features/<slug>/sprint.md` |
58
+ | feature history | `.scrumrun/features/<slug>/history.md` |
59
+ | feature decisions | `.scrumrun/features/<slug>/decisions.md` |
60
+ | fix | `.scrumrun/fixes.md` (append-only) |
61
+ | backlog | `.scrumrun/backlog.md` |
62
+ | golden rules | `.scrumrun/golden-rules.md` |
63
+ | knowledge facts | `.scrumrun/knowledge.md` |
64
+ | dossier | `.scrumrun/knowledge/dossiers/<slug>.md` |
65
+ | map | `.scrumrun/map.md` |
66
+ | context | `.scrumrun/context.md` |
67
+ | config | `.scrumrun/config.md` |
68
+ | agents | `.scrumrun/agents.md` |
69
+ | reviews | `.scrumrun/reviews/<id>.md` |
70
+ | vault (local) | `.scrumrun/vault.local.md` |
71
+
72
+ ---
73
+
74
+ ## 3. State Machines
75
+
76
+ ### 3.1 Sprint
77
+
78
+ ```
79
+ proposed ──approve──▶ approved ──run──▶ running ──complete──▶ done
80
+ │ │ │
81
+ │ └──backlog──▶ shelved
82
+ │ │
83
+ └──reject──▶ rejected └──abort──▶ aborted
84
+
85
+ running ──block──▶ blocked ──unblock──▶ running
86
+ ```
87
+
88
+ **Transitions:**
89
+ - `proposed → approved`: owner approval required.
90
+ - `approved → running`: explicit `--run` or intake execution consent.
91
+ - `running → done`: all acceptance criteria met AND review agents passed.
92
+ - `running → blocked`: unresolved decision, missing dependency, or golden rule fire.
93
+ - `running → aborted`: owner-initiated cancellation. Requires reason in history.
94
+ - `approved → shelved`: sent to backlog before execution.
95
+
96
+ **Invariant references:** I-01, I-02, I-05, I-07.
97
+
98
+ ### 3.2 Fix
99
+
100
+ ```
101
+ proposed ──approve──▶ approved ──run──▶ running ──complete──▶ done
102
+
103
+ └──escalate──▶ (becomes sprint)
104
+ ```
105
+
106
+ Fix is lighter than sprint: no formal review agents required unless the affected area has agents configured. If scope grows during execution, `escalate` promotes to sprint with the same id lineage recorded in history.
107
+
108
+ ### 3.3 Feature lane
109
+
110
+ ```
111
+ proposed ──approve──▶ active ──archive──▶ archived
112
+
113
+ └──merge-to-main──▶ merged
114
+ ```
115
+
116
+ A feature lane is a container for sprints. Its sprints follow the sprint state machine independently. `merge-to-main` folds accepted sprints into main goal history.
117
+
118
+ ### 3.4 Backlog item
119
+
120
+ ```
121
+ added ──promote──▶ (becomes sprint|fix|feature)
122
+
123
+ └──drop──▶ dropped
124
+ ```
125
+
126
+ Backlog items have no execution state. Promotion creates a new artifact.
127
+
128
+ ### 3.5 Decision
129
+
130
+ ```
131
+ open ──resolve──▶ resolved
132
+
133
+ └──defer──▶ deferred
134
+ ```
135
+
136
+ An open decision that blocks a running sprint moves the sprint to `blocked` (see 3.1).
137
+
138
+ ### 3.6 Knowledge fact
139
+
140
+ ```
141
+ proposed ──approve──▶ approved ──deprecate──▶ deprecated
142
+
143
+ └──reject──▶ rejected (kept for anti-repetition)
144
+ ```
145
+
146
+ Only `approved` facts are planning truth. `rejected` facts are preserved to prevent re-proposing the same bad assumption.
147
+
148
+ ### 3.7 Dossier
149
+
150
+ ```
151
+ drafted ──approve──▶ current ──update──▶ current ──deprecate──▶ deprecated
152
+ ```
153
+
154
+ Every `update` records the previous `commit` hash. A dossier older than the current HEAD by more than N commits (configurable) is marked stale in `context.md`.
155
+
156
+ ### 3.8 Golden rule
157
+
158
+ ```
159
+ proposed ──approve──▶ active ──retire──▶ retired
160
+ ```
161
+
162
+ Active golden rules cannot be silently bypassed (see I-08). Retirement requires explicit owner action and is logged.
163
+
164
+ ---
165
+
166
+ ## 4. Composition Rules
167
+
168
+ Which artifact can generate which:
169
+
170
+ | From ↓ / Generates → | Sprint | Fix | Feature | Backlog | Decision | Knowledge | Dossier |
171
+ |---|---|---|---|---|---|---|---|
172
+ | Intake | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
173
+ | Goal (`--set`) | ✓ | — | — | ✓ | ✓ | — | — |
174
+ | Sprint (running) | — | ✓ | — | ✓ | ✓ | ✓ | — |
175
+ | Fix (running) | ✓ (escalate) | — | — | — | ✓ | ✓ | — |
176
+ | Feature (active) | ✓ | ✓ | — | ✓ | ✓ | ✓ | — |
177
+ | Study | — | — | — | ✓ | — | ✓ | ✓ |
178
+ | Review | — | ✓ | — | ✓ | ✓ | ✓ | — |
179
+
180
+ Blocking relationships:
181
+
182
+ - An `open` decision **linked** to a sprint blocks that sprint.
183
+ - A `proposed` golden rule does not block anything.
184
+ - An `active` golden rule blocks any transition that would violate it.
185
+ - A `stale` dossier does not block, but must be surfaced in intake responses.
186
+
187
+ ---
188
+
189
+ ## 5. Precedence
190
+
191
+ When guidance conflicts, apply in this strict order:
192
+
193
+ ```
194
+ 1. Golden rules (active)
195
+ 2. Open decisions linked to current work
196
+ 3. Approved knowledge facts
197
+ 4. Current sprint / feature plan
198
+ 5. Backlog priority
199
+ 6. Dossiers and map
200
+ 7. context.md (never authoritative)
201
+ ```
202
+
203
+ Higher precedence always wins. Lower precedence never silently overrides.
204
+
205
+ ---
206
+
207
+ ## 6. Invariants
208
+
209
+ Numbered for stable reference. Every implementation must uphold all of these.
210
+
211
+ - **I-01** — No sprint may transition from `proposed` to `running` without explicit owner approval.
212
+ - **I-02** — No code changes may occur outside a `running` sprint, a `running` fix, or an explicitly authorized quick task.
213
+ - **I-03** — An active golden rule cannot be bypassed by any command, flag, or config. Retirement is the only path.
214
+ - **I-04** — Intake is read-only. Intake cannot create, modify, or delete artifacts. Intake cannot modify code.
215
+ - **I-05** — Main goal history and feature lane history are physically separate files and never merge automatically.
216
+ - **I-06** — Approval is synchronous and explicit. Ambiguous acknowledgements (e.g., "ok", "sure") do not constitute approval unless the owner has enabled `Quick Tasks: allow` for that class of action.
217
+ - **I-07** — Every state transition writes exactly one entry to the relevant history file. History is append-only.
218
+ - **I-08** — Golden rules are checked before every planning or execution workflow. A rule fire during a running sprint moves that sprint to `blocked`.
219
+ - **I-09** — `context.md` is never authoritative. All planning must verify against canonical artifacts and source.
220
+ - **I-10** — Only `approved` knowledge facts inform planning. `pending` and `rejected` facts are context, not truth.
221
+ - **I-11** — Secrets from `vault.local.md` must never appear in history, knowledge, backlog, reviews, commits, or logs.
222
+ - **I-12** — Every artifact carries `id`, `kind`, `status`, `created`, `updated`, and `method` frontmatter fields.
223
+ - **I-13** — A dossier update must record the source commit hash for drift detection.
224
+ - **I-14** — Quick tasks may be executed with `Quick Tasks: allow`, but never bypass golden rules, security checks, or explicit user constraints.
225
+ - **I-15** — Rejecting a knowledge fact preserves it in `rejected` state to prevent re-proposing the same assumption.
226
+
227
+ ---
228
+
229
+ ## 7. Intake Protocol (Formal)
230
+
231
+ Intake is the single natural-language entry point. Formal steps:
232
+
233
+ 1. **Load minimum context:** `core.md`, `golden-rules.md`, `config.md`, `context.md`, and the header of `map.md`.
234
+ 2. **Interpret intent** using the desired outcome, not keyword matching.
235
+ 3. **Determine risk class:** trivial / bounded / cross-cutting / sensitive.
236
+ 4. **Load conditional context** based on risk class:
237
+ - trivial: current sprint header only.
238
+ - bounded: current sprint + relevant dossier + relevant knowledge facts.
239
+ - cross-cutting: full sprint plan + all decisions + map.
240
+ - sensitive: everything in cross-cutting + full history relevant to affected modules.
241
+ 5. **Classify** into one of: `quick-task`, `discovery`, `sprint`, `fix`, `feature`, `backlog`, `reject`, `clarify`.
242
+ 6. **Compose response:**
243
+ - Recommendation with rationale.
244
+ - Up to two alternatives with tradeoffs.
245
+ - Risks and unknowns.
246
+ - Explicit approval request.
247
+ 7. **Wait for approval.** No side effects until owner responds.
248
+
249
+ Response format is machine-parseable enough to be logged verbatim in `history.md` if the request is approved.
250
+
251
+ ---
252
+
253
+ ## 8. Approval Semantics
254
+
255
+ Approval is a first-class concept and comes in three kinds:
256
+
257
+ | Kind | What it permits |
258
+ |---|---|
259
+ | **Planning approval** | Create planning records (sprint plan, fix plan, backlog item, dossier draft). |
260
+ | **Execution approval** | Change application code, run tests, execute review agents. |
261
+ | **Structural approval** | Modify golden rules, retire rules, change config, delete artifacts. |
262
+
263
+ Config policy `Execution Approval: always` requires both planning AND execution approvals separately. `implementation-only` collapses them for the recommended path but still requires an explicit yes before code changes.
264
+
265
+ There is intentionally no mode that grants blanket implementation permission.
266
+
267
+ ---
268
+
269
+ ## 9. History Semantics
270
+
271
+ `history.md` files are append-only. Every entry has:
272
+
273
+ ```
274
+ ## <YYYY-MM-DD HH:MM> · <id> · <transition>
275
+ - Owner: <name or "agent-approved">
276
+ - Reason: <one line>
277
+ - Files touched: <optional list>
278
+ - Commit: <optional hash>
279
+ ```
280
+
281
+ History is the audit substrate. It answers "what happened, when, and why" without requiring `git log`.
282
+
283
+ ---
284
+
285
+ ## 10. Method Versioning
286
+
287
+ `method` version is separate from `cli` and `skill` versions.
288
+
289
+ - **Patch** (`1.0.x`): clarifications, non-normative additions.
290
+ - **Minor** (`1.x.0`): additive changes (new artifact kind, new state, new invariant).
291
+ - **Major** (`x.0.0`): breaking changes (removed states, changed invariants, changed frontmatter schema, changed path map).
292
+
293
+ Every method-version change ships with `MIGRATION-<from>-to-<to>.md`.
294
+
295
+ Tooling versions may change freely. `skill 1.4.2` and `cli 1.4.2` can implement `method 1.0`. A future `skill 2.0.0` can still implement `method 1.0`.
296
+
297
+ ---
298
+
299
+ ## 11. Conformance
300
+
301
+ An implementation is ScrumRun-compatible if it:
302
+
303
+ 1. Honors every invariant in §6.
304
+ 2. Implements the state machines in §3 for every artifact it exposes.
305
+ 3. Enforces precedence in §5.
306
+ 4. Provides intake per §7 or refuses to accept natural-language requests entirely.
307
+ 5. Writes history per §9.
308
+ 6. Declares the `method` version it targets.
309
+
310
+ A conformance test suite lives at `tests/conformance/` and MUST pass for any release claiming compatibility.
311
+
312
+ ---
313
+
314
+ ## 12. Open Questions
315
+
316
+ Items to resolve before `method 1.0` freezes. Tracked as `⚠️ revisitar` per plan discipline.
317
+
318
+ - ⚠️ Should `blocked` be a real state or a decoration on `running`?
319
+ - ⚠️ How is a dossier "stale threshold" measured — commits since capture, or file-level touch?
320
+ - ⚠️ Should quick tasks generate a lightweight artifact (e.g., `tasks.md` line) or only a history entry?
321
+ - ⚠️ Precedence between two active golden rules that conflict — defined explicit order, or rejection at rule creation?
322
+ - ⚠️ Do feature lane sprints inherit main goal golden rules automatically, or opt-in?
323
+
324
+ Resolution goes to `DECISIONS.md` as an ADR when closed.
@@ -0,0 +1,147 @@
1
+ #!/usr/bin/env node
2
+
3
+ const fs = require("fs");
4
+ const path = require("path");
5
+ const os = require("os");
6
+
7
+ const root = path.resolve(__dirname, "..");
8
+ const templates = path.join(root, "templates");
9
+
10
+ const COMMANDS = [
11
+ "sc-help",
12
+ "sc-study",
13
+ "sc-init",
14
+ "sc-uninstall",
15
+ "sc-update",
16
+ "sc-vault",
17
+ "sc-know",
18
+ "sc-config",
19
+ "sc-golden",
20
+ "sc-map",
21
+ "sc-challenge",
22
+ "sc-goal",
23
+ "sc-backlog",
24
+ "sc-feature",
25
+ "sc-sprint",
26
+ "sc-fix",
27
+ "sc-agent",
28
+ "sc-review",
29
+ "sc-decisions"
30
+ ];
31
+
32
+ function usage() {
33
+ console.log(`ScrumRun for Claude Code
34
+
35
+ Usage:
36
+ sr-claude install [--force]
37
+ sr-claude update
38
+ sr-claude doctor
39
+
40
+ Examples:
41
+ npx --package=scrumrun@latest sr-claude install
42
+ npx --package=scrumrun@latest sr-claude update
43
+ npx --package=scrumrun@latest sr-claude doctor
44
+ `);
45
+ }
46
+
47
+ function ensureDir(dir) {
48
+ fs.mkdirSync(dir, { recursive: true });
49
+ }
50
+
51
+ function copyFile(src, dest, { force = true, vars = {} } = {}) {
52
+ if (fs.existsSync(dest) && !force) {
53
+ return { status: "skipped", dest };
54
+ }
55
+ ensureDir(path.dirname(dest));
56
+ let content = fs.readFileSync(src, "utf8");
57
+ for (const [key, value] of Object.entries(vars)) {
58
+ content = content.split(`{{${key}}}`).join(value);
59
+ }
60
+ fs.writeFileSync(dest, content);
61
+ return { status: "written", dest };
62
+ }
63
+
64
+ function copyDir(srcDir, destDir, options = {}) {
65
+ const results = [];
66
+ for (const entry of fs.readdirSync(srcDir, { withFileTypes: true })) {
67
+ const src = path.join(srcDir, entry.name);
68
+ const dest = path.join(destDir, entry.name);
69
+ if (entry.isDirectory()) {
70
+ results.push(...copyDir(src, dest, options));
71
+ } else {
72
+ results.push(copyFile(src, dest, options));
73
+ }
74
+ }
75
+ return results;
76
+ }
77
+
78
+ function printResults(title, results) {
79
+ console.log(`\n${title}`);
80
+ for (const result of results) {
81
+ const prefix = result.status === "skipped" ? "skip" : "write";
82
+ console.log(` ${prefix} ${result.dest}`);
83
+ }
84
+ }
85
+
86
+ function cleanupLegacy(commandsDir, skillsDir) {
87
+ if (fs.existsSync(commandsDir)) {
88
+ for (const entry of fs.readdirSync(commandsDir, { withFileTypes: true })) {
89
+ if (!entry.isFile()) continue;
90
+ const name = entry.name;
91
+ const legacyPrefix = name.startsWith("srun-") || name.startsWith("asm-") || name.startsWith("sr-") || name.startsWith("scr-") || name.startsWith("src-") || name.startsWith("run-");
92
+ const oldConsolidated = /^scr-[a-z]+-[a-z]+\.md$/.test(name);
93
+ if (legacyPrefix || oldConsolidated) {
94
+ fs.rmSync(path.join(commandsDir, name), { force: true });
95
+ console.log(` rm legacy ${path.join(commandsDir, name)}`);
96
+ }
97
+ }
98
+ }
99
+ const oldSkill = path.join(skillsDir, "ai-scrum");
100
+ if (fs.existsSync(oldSkill)) {
101
+ fs.rmSync(oldSkill, { recursive: true, force: true });
102
+ console.log(` rm legacy ${oldSkill}`);
103
+ }
104
+ }
105
+
106
+ function install(force) {
107
+ const home = os.homedir();
108
+ const commandsDir = path.join(home, ".claude", "commands");
109
+ cleanupLegacy(commandsDir, path.join(home, ".claude", "skills"));
110
+ const results = [
111
+ ...copyDir(path.join(templates, "codex", "prompts"), commandsDir, { force }),
112
+ ...copyDir(path.join(templates, "codex", "skills"), path.join(home, ".claude", "skills"), { force })
113
+ ];
114
+ printResults("Claude ScrumRun installed", results);
115
+ }
116
+
117
+ function doctor() {
118
+ const home = os.homedir();
119
+ const checks = COMMANDS.map((command) => [
120
+ command,
121
+ path.join(home, ".claude", "commands", `${command}.md`)
122
+ ]);
123
+ checks.push(["scrumrun skill", path.join(home, ".claude", "skills", "scrumrun", "SKILL.md")]);
124
+
125
+ let ok = true;
126
+ for (const [label, file] of checks) {
127
+ const exists = fs.existsSync(file);
128
+ ok = ok && exists;
129
+ console.log(`${exists ? "ok " : "miss"} ${label}`);
130
+ }
131
+ process.exitCode = ok ? 0 : 1;
132
+ }
133
+
134
+ const args = process.argv.slice(2);
135
+ const command = args[0];
136
+
137
+ if (!command || command === "--help" || command === "-h") {
138
+ usage();
139
+ } else if (command === "install" || command === "update") {
140
+ install(true);
141
+ } else if (command === "doctor") {
142
+ doctor();
143
+ } else {
144
+ console.error(`Unknown command: ${command}`);
145
+ usage();
146
+ process.exitCode = 1;
147
+ }