scrumrun 1.5.2 → 2.0.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 (106) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/CORE.md +224 -311
  3. package/DECISIONS.md +95 -11
  4. package/LICENSE +21 -0
  5. package/MIGRATION-1-to-2.md +109 -0
  6. package/README.md +137 -78
  7. package/SPEC.md +248 -257
  8. package/bin/claude-install.js +18 -132
  9. package/bin/scrumrun.js +1259 -174
  10. package/docs/COMMANDS.md +69 -0
  11. package/docs/ENTITY-MODEL.md +38 -0
  12. package/docs/RELEASE.md +44 -0
  13. package/docs/SCHEMA.md +80 -0
  14. package/docs/SEMANTIC-MEMORY.md +68 -0
  15. package/docs/TROUBLESHOOTING.md +66 -0
  16. package/lib/code-intel/adapter.js +20 -0
  17. package/lib/code-intel/javascript.js +199 -0
  18. package/lib/code-intel/learning.js +66 -0
  19. package/lib/code-intel/scanner.js +126 -0
  20. package/lib/commands/manifest.js +109 -0
  21. package/lib/commands/render.js +75 -0
  22. package/lib/memory/index.js +600 -0
  23. package/lib/memory/markdown.js +51 -0
  24. package/lib/memory/service.js +300 -0
  25. package/lib/runtime/budgets.js +19 -0
  26. package/lib/runtime/context.js +141 -0
  27. package/lib/runtime/orchestrator.js +270 -0
  28. package/lib/runtime/request-engine.js +128 -0
  29. package/lib/security/secrets.js +23 -0
  30. package/lib/v2/artifacts.js +343 -0
  31. package/lib/v2/conformance.js +167 -0
  32. package/lib/v2/migration.js +1161 -0
  33. package/lib/v2/project-store.js +44 -0
  34. package/lib/v2/schema.js +128 -0
  35. package/package.json +16 -6
  36. package/scripts/generate-contract-docs.js +113 -0
  37. package/templates/project/.scrumrun/config.md +4 -7
  38. package/templates/project/.scrumrun/guardrails.md +23 -0
  39. package/templates/project/.scrumrun/map.md +4 -16
  40. package/templates/project/.scrumrun/memory/decisions/.gitkeep +1 -0
  41. package/templates/project/.scrumrun/memory/dossiers/.gitkeep +1 -0
  42. package/templates/project/.scrumrun/memory/insights/.gitkeep +1 -0
  43. package/templates/project/.scrumrun/memory/knowledge/.gitkeep +1 -0
  44. package/templates/project/.scrumrun/method.json +4 -0
  45. package/templates/project/.scrumrun/project.md +6 -12
  46. package/templates/project/.scrumrun/runs/.gitkeep +1 -0
  47. package/templates/project/.scrumrun/sprints/.gitkeep +1 -0
  48. package/templates/project/.scrumrun/state.md +21 -0
  49. package/templates/project/.scrumrun/tasks/.gitkeep +1 -0
  50. package/templates/project/AGENTS.md +16 -49
  51. package/templates/project-lean/AGENTS.md +18 -0
  52. package/templates/shared/skills/scrumrun/SKILL.md +201 -0
  53. package/templates/codex/prompts/sc-agent.md +0 -14
  54. package/templates/codex/prompts/sc-backlog.md +0 -13
  55. package/templates/codex/prompts/sc-challenge.md +0 -57
  56. package/templates/codex/prompts/sc-config.md +0 -18
  57. package/templates/codex/prompts/sc-context.md +0 -24
  58. package/templates/codex/prompts/sc-decisions.md +0 -8
  59. package/templates/codex/prompts/sc-feature.md +0 -16
  60. package/templates/codex/prompts/sc-fix.md +0 -21
  61. package/templates/codex/prompts/sc-goal.md +0 -14
  62. package/templates/codex/prompts/sc-golden.md +0 -14
  63. package/templates/codex/prompts/sc-help.md +0 -12
  64. package/templates/codex/prompts/sc-init.md +0 -14
  65. package/templates/codex/prompts/sc-intake.md +0 -22
  66. package/templates/codex/prompts/sc-know.md +0 -75
  67. package/templates/codex/prompts/sc-map.md +0 -13
  68. package/templates/codex/prompts/sc-review.md +0 -13
  69. package/templates/codex/prompts/sc-sprint.md +0 -28
  70. package/templates/codex/prompts/sc-study.md +0 -23
  71. package/templates/codex/prompts/sc-uninstall.md +0 -14
  72. package/templates/codex/prompts/sc-update.md +0 -8
  73. package/templates/codex/prompts/sc-vault.md +0 -27
  74. package/templates/codex/skills/scrumrun/SKILL.md +0 -412
  75. package/templates/opencode/commands/sc-agent.md +0 -14
  76. package/templates/opencode/commands/sc-backlog.md +0 -13
  77. package/templates/opencode/commands/sc-challenge.md +0 -57
  78. package/templates/opencode/commands/sc-config.md +0 -18
  79. package/templates/opencode/commands/sc-context.md +0 -24
  80. package/templates/opencode/commands/sc-decisions.md +0 -8
  81. package/templates/opencode/commands/sc-feature.md +0 -16
  82. package/templates/opencode/commands/sc-fix.md +0 -21
  83. package/templates/opencode/commands/sc-goal.md +0 -14
  84. package/templates/opencode/commands/sc-golden.md +0 -14
  85. package/templates/opencode/commands/sc-help.md +0 -12
  86. package/templates/opencode/commands/sc-init.md +0 -14
  87. package/templates/opencode/commands/sc-intake.md +0 -22
  88. package/templates/opencode/commands/sc-know.md +0 -75
  89. package/templates/opencode/commands/sc-map.md +0 -13
  90. package/templates/opencode/commands/sc-review.md +0 -13
  91. package/templates/opencode/commands/sc-sprint.md +0 -28
  92. package/templates/opencode/commands/sc-study.md +0 -23
  93. package/templates/opencode/commands/sc-uninstall.md +0 -14
  94. package/templates/opencode/commands/sc-update.md +0 -8
  95. package/templates/opencode/commands/sc-vault.md +0 -27
  96. package/templates/opencode/skills/scrumrun/SKILL.md +0 -412
  97. package/templates/project/.scrumrun/agents.md +0 -36
  98. package/templates/project/.scrumrun/backlog.md +0 -7
  99. package/templates/project/.scrumrun/context.md +0 -61
  100. package/templates/project/.scrumrun/goals/main/decisions.md +0 -9
  101. package/templates/project/.scrumrun/goals/main/history.md +0 -51
  102. package/templates/project/.scrumrun/goals/main/sprint.md +0 -54
  103. package/templates/project/.scrumrun/golden-rules.md +0 -9
  104. package/templates/project/.scrumrun/knowledge.md +0 -15
  105. package/templates/project/.scrumrun/runbook.md +0 -101
  106. package/templates/project/.scrumrun/token-policy.md +0 -43
package/CHANGELOG.md ADDED
@@ -0,0 +1,42 @@
1
+ # Changelog
2
+
3
+ All notable changes follow Semantic Versioning.
4
+
5
+ ## 2.0.0 - 2026-07-21
6
+
7
+ ### Breaking
8
+
9
+ - Replaced the v1 Sprint-as-work-item model with Feature → Task → Sprint → Run → Memory.
10
+ - Replaced twenty independent commands with `/sc <noun> <subject> <action>` and exactly five nouns.
11
+ - Made `guardrails.md` the sole canonical project-policy file; `golden-rules.md` is migration evidence only.
12
+ - Raised the runtime requirement to Node.js `>=22.13.0` for native SQLite.
13
+
14
+ ### Added
15
+
16
+ - Explicit, hashed, staged, idempotent, reversible v1→v2 migration.
17
+ - Read-only update migration preflight and explicit `update --migrate` integration for ongoing projects.
18
+ - Hybrid incomplete-v2 recovery that reuses existing Task/Sprint/Run links, archives legacy aggregates, and normalizes deterministic pre-release aliases without duplicating work.
19
+ - Content-hash verification for installed prompts/skills and `doctor --strict` project conformance checks.
20
+ - One frozen executable schema for artifact ids, directories, initial states, transitions, structural cardinalities, truth ownership, and authority boundaries, with generated drift-checked documentation.
21
+ - Atomic Task/Run approval and recoverable Run lifecycle/retries.
22
+ - Evidence-backed Knowledge, Decisions, Insights, and Dossiers with validity/review metadata.
23
+ - Disposable SQLite FTS/graph index and bounded semantic queries.
24
+ - Replaceable JS/TS code adapter with symbol identity, dependencies, consumers, protected tests, move remapping, orphan history, and derived invalidation.
25
+ - Non-blocking post-validation learning candidates.
26
+ - Twenty-invariant conformance audit, adversarial security suite, performance budgets, and Node 22/24/26 CI.
27
+
28
+ ### Security
29
+
30
+ - Reject traversal/symlink canonical paths, duplicate/mismatched frontmatter, unsafe overwrites, and malformed method state.
31
+ - Block secret-like content at intake, memory, migration, context, and indexing boundaries; vault values remain excluded.
32
+ - Serialize concurrent canonical memory mutations with disposable locks.
33
+ - Scan secret-like content in all supported text migration inputs, including files larger than 1 MiB.
34
+
35
+ ### Compatibility
36
+
37
+ - Fresh installs expose only `/sc` plus the shared skill.
38
+ - Upgrade installs may provide generated v1 adapters for one release cycle; adapters execute canonical routes and emit a deprecation note.
39
+
40
+ ## 1.5.2
41
+
42
+ - Last 1.x CLI line before the 2.0 domain and migration release.
package/CORE.md CHANGED
@@ -1,381 +1,294 @@
1
- # ScrumRun Core
1
+ # ScrumRun Core 2.0
2
2
 
3
- ScrumRun is a portable workflow for using AI agents on software projects without relying on a specific AI client.
3
+ ScrumRun is a portable, evidence-driven Agile runtime for AI agents. It makes intended work, execution attempts, decisions, and project learning explicit without turning the project into a ceremony engine.
4
4
 
5
- ScrumRun provides controlled autonomy: AI has room to investigate, reason, and recommend, while explicit operating rules prevent it from confusing confidence with permission. In short, autonomy to think, guardrails to act.
5
+ Method version: `2.0.0`
6
6
 
7
- Slash commands are optional shortcuts. If the current AI client does not support ScrumRun commands, read this file and execute the matching workflow manually.
7
+ ## One command
8
8
 
9
- After ScrumRun is initialized in a project, this file is mandatory project methodology. Any AI agent working in the project must follow it before planning, changing, auditing, or reviewing work.
9
+ The canonical command is:
10
10
 
11
- ## Operating Rule
12
-
13
- Before planning, changing, auditing, or reviewing work, read these files when they exist:
14
-
15
- 1. `.scrumrun/core.md`
16
- 2. `.scrumrun/golden-rules.md`
17
- 3. `.scrumrun/config.md`
18
- 4. `.scrumrun/token-policy.md`
19
- 5. `.scrumrun/context.md`
20
- 6. `.scrumrun/map.md`
21
- 7. `.scrumrun/project.md`
22
- 8. `.scrumrun/knowledge.md`
23
- 9. `.scrumrun/runbook.md`
24
- 10. `.scrumrun/backlog.md`
25
- 11. `.scrumrun/goals/main/sprint.md`
26
- 12. `.scrumrun/features/*/feature.md`
27
- 13. `.scrumrun/features/*/sprint.md`
28
- 14. `.scrumrun/agents.md`
29
- 15. `.scrumrun/goals/main/history.md`
30
- 16. `.scrumrun/goals/main/decisions.md`
31
- 17. `.scrumrun/features/*/history.md`
32
- 18. `.scrumrun/features/*/decisions.md`
33
-
34
- Golden rules have the highest priority. If a golden rule conflicts with any other instruction, the golden rule wins.
35
-
36
- Only approved knowledge is planning truth. Pending knowledge is unverified context. Rejected knowledge must not be used except to avoid repeating a known bad assumption.
37
-
38
- `context.md` is a token-saving snapshot, not canonical truth. Use it to decide what to read next, then verify against canonical ScrumRun files and source code before planning, editing, reviewing, or marking work done.
39
-
40
- If the current AI client does not support slash commands, do not invent a different workflow. Use the command equivalents in this file.
41
-
42
- If this file was loaded from `AGENTS.md`, treat it as the active project methodology.
43
-
44
- If the user asks for work without mentioning ScrumRun, still follow ScrumRun because the project was initialized with it.
11
+ ```text
12
+ /sc <noun> <subject> <action> [args]
13
+ ```
45
14
 
46
- ## Natural-Language Intake
15
+ The five nouns are:
47
16
 
48
- The owner does not need to choose a ScrumRun command. A request such as "I have a checkout bug" or "we need passkeys" automatically starts intake.
17
+ - `plan` Features, Tasks, Sprints, Runs, intake, and challenge;
18
+ - `knowledge` — facts, Decisions, Insights, dossiers, context, map, study, and vault;
19
+ - `rules` — guardrails and reviewers;
20
+ - `review` — code, artifact, migration, and release gates;
21
+ - `config` — project preferences, lifecycle, migration, doctor, and help.
49
22
 
50
- Intake must:
23
+ Incomplete syntax lists only valid next tokens. Unknown syntax never guesses or mutates.
51
24
 
52
- 1. understand the desired outcome rather than matching keywords alone;
53
- 2. inspect the minimum canonical context and relevant history needed for a reliable classification;
54
- 3. classify the request as a quick task, knowledge/discovery, main sprint, corrective fix, backlog candidate, isolated feature lane, or reject/defer;
55
- 4. explain the recommended route, important risks and unknowns, plus no more than two useful alternatives;
56
- 5. ask for approval according to `.scrumrun/config.md`;
57
- 6. invoke the chosen workflow only after approval.
25
+ The command manifest at `lib/commands/manifest.js` generates client prompts, compatibility adapters, help, and grammar tests. Fresh v2 integrations install only `/sc`. A v1 upgrade may install generated compatibility adapters for one release cycle.
58
26
 
59
- Intake is read-only until approval. It must not create planning records, modify application code, run a sprint, or treat an ambiguous acknowledgement as execution consent.
27
+ ## Entity model
60
28
 
61
- Default preferences are:
29
+ The exact machine contract is `lib/v2/schema.js`; `docs/SCHEMA.md` is its generated human-readable form. This guide explains how to operate that contract and must not redefine its status sets or cardinalities.
62
30
 
63
31
  ```text
64
- Interaction Mode: guided
65
- Execution Approval: always
66
- Quick Tasks: ask
32
+ FEAT-003
33
+ └── TASK-018
34
+ ├── executed_by → RUN-044
35
+ ├── included_in → SPRINT-012
36
+ ├── constrained_by → DEC-018
37
+ └── generated → INS-041
67
38
  ```
68
39
 
69
- `guided` presents a recommendation and useful alternatives. `concise` presents only the classification and recommendation. `autonomous-planning` may create planning records when the approval policy permits it, but still may not implement without explicit execution approval. `strict` requires explicit ScrumRun commands and disables automatic intake.
70
-
71
- `Execution Approval: always` requires approval before creating operational records and again before implementation when those are separate steps. `implementation-only` permits the recommended planning record after intake but still requires explicit approval before changing application code. There is intentionally no mode that silently authorizes implementation.
72
-
73
- `Quick Tasks: ask` asks before small low-risk changes. `allow` permits a clearly scoped low-risk quick task after classification, but never bypasses golden rules, security checks, or explicit user constraints. `backlog` parks quick tasks instead of executing them.
74
-
75
- ## Command Grammar
76
-
77
- Commands use one canonical verb for the same semantic action:
40
+ - Feature (`FEAT-NNN`) is the long-lived initiative: why the work matters.
41
+ - Task (`TASK-NNN`) is the atomic intended change: what must be done.
42
+ - Sprint (`SPRINT-NNN`) is a real timebox or delivery batch: when related Tasks are grouped.
43
+ - Run (`RUN-NNN`) is one concrete execution attempt: how a Task actually happened.
44
+ - Review (`REV-NNN`) records a scoped quality gate.
45
+ - Memory records what the project knows and why: Knowledge (`K-NNN`), Decision (`DEC-NNN`), Insight (`INS-NNN`), and Dossier (`DOS-NNN`).
78
46
 
79
- - `--add`: create or append a collection item, such as a sprint, feature, backlog item, rule, agent, fix, vault entry, or knowledge proposal;
80
- - `--set`: define or replace a singleton value, such as the main goal or language;
81
- - `--update`: change an existing resource without replacing its identity;
82
- - `--remove`: delete an existing resource;
83
- - `--list`: list multiple resources;
84
- - `--show`: display one resource or the current state;
85
- - `--run`: execute approved work;
86
- - `--audit`: verify completed or current work;
87
- - `--approve` / `--reject`: resolve a pending proposal.
47
+ A Task may exist without a Sprint. A retry creates a new Run and never overwrites the previous attempt. A fix is a Task with `type: fix`; backlog is a generated view of Tasks with `status: backlog`.
88
48
 
89
- Legacy forms such as `--new`, bare knowledge topics, and positional `approve`/`reject` remain accepted as compatibility aliases, but agents should recommend and generate only the canonical forms. Short aliases that historically conflict keep their legacy meaning; prefer long flags in generated instructions.
90
-
91
- ## Project Layout
49
+ ## Canonical project tree
92
50
 
93
51
  ```text
94
52
  AGENTS.md
95
53
  .scrumrun/
96
54
  core.md
55
+ guardrails.md
97
56
  config.md
98
- token-policy.md
99
- context.md
100
- golden-rules.md
101
- map.md
102
- agents.md
103
- runbook.md
104
57
  project.md
105
- backlog.md
106
- knowledge.md
107
- vault.local.md
108
- goals/
109
- main/
110
- sprint.md
111
- history.md
112
- decisions.md
58
+ state.md # generated, not authoritative
59
+ map.md # generated, not authoritative
60
+ method.json
61
+ tasks/
62
+ TASK-NNN.md
63
+ sprints/
64
+ SPRINT-NNN.md
113
65
  features/
114
- <feature>/
115
- feature.md
116
- sprint.md
117
- history.md
118
- decisions.md
66
+ FEAT-NNN.md
67
+ runs/
68
+ RUN-NNN.md
69
+ memory/
70
+ knowledge/
71
+ K-NNN.md
72
+ decisions/
73
+ DEC-NNN.md
74
+ insights/
75
+ INS-NNN.md
76
+ dossiers/
77
+ DOS-NNN.md
119
78
  reviews/
79
+ REV-NNN.md
80
+ .cache/ # ignored and disposable
81
+ semantic-index.sqlite
82
+ contexts/
120
83
  ```
121
84
 
122
- ## Safety Rules
123
-
124
- - Do not start implementation unless the owner explicitly asks for it.
125
- - Never modify read-only source paths.
126
- - Never commit real secrets.
127
- - Never print `.scrumrun/vault.local.md` values in normal summaries, history, knowledge, backlog, reviews, commits, or logs.
128
- - Runtime values must come from environment/config, not hardcoded strings.
129
- - Keep main goal history and feature lane history separate.
130
- - Before running a sprint, check the relevant history file.
131
- - If a sprint is completed, partial, or blocked, stop and ask whether to audit, resume, fix, rerun, or move on.
132
-
133
- ## Context Economy Protocol
134
-
135
- This protocol reduces token waste while preserving correctness.
136
-
137
- ```text
138
- AGENTS.md
139
- -> core.md
140
- -> golden-rules.md
141
- -> config.md
142
- -> token-policy.md
143
- -> context.md
144
- -> map.md
145
- -> project.md
146
- -> knowledge.md
147
- -> runbook.md
148
- -> current backlog / sprint / feature files
149
- -> agents.md
150
- -> relevant history + decisions
151
- -> targeted source files
152
- ```
153
-
154
- Rules:
155
-
156
- 1. Safety beats token economy.
157
- 2. Use `context.md` as a reading guide, never as proof.
158
- 3. Prefer targeted file/range/symbol reads over broad dumps.
159
- 4. Summarize large logs, generated files, old reviews, and old unrelated history.
160
- 5. If a skipped source could affect correctness or safety, read it.
161
- 6. Update `context.md` after study, challenge intake, sprint planning, sprint execution, review, or important knowledge/decision changes.
162
-
163
- ## Sprint Protocol
164
-
165
- Every sprint follows:
85
+ Canonical truth is Markdown. SQLite/cache data stores only rebuildable indexes, symbol projections, relations, and bounded context packages. Deleting `.cache/` must never delete authored truth.
166
86
 
167
- 1. Entenda
168
- 2. Avalie Impactos
169
- 3. Tire Duvidas
170
- 4. Execute
171
- 5. Teste
87
+ `vault.local.md`, migration backups, and caches are local-only. Their values never appear in logs, history, reviews, memory, reports, commits, or normal responses.
172
88
 
173
- Do not skip the first three steps. They are what prevent confident but unsafe execution.
89
+ ## Authority and read policy
174
90
 
175
- ## Command Equivalents
91
+ Apply project context in this order:
176
92
 
177
- Use these workflows even when slash commands are unavailable.
93
+ 1. owner/system instructions;
94
+ 2. universal method invariants in this guide and `SPEC.md`;
95
+ 3. `guardrails.md`;
96
+ 4. relevant confirmed Decisions and approved Knowledge;
97
+ 5. active Feature, Task, Sprint, and Run;
98
+ 6. relevant history and evidence;
99
+ 7. generated `state.md`, `map.md`, and cache projections.
178
100
 
179
- ### `/sc-intake`
101
+ Normal read path:
180
102
 
181
- Explicitly invoke the natural-language intake protocol. This is useful when an AI client does not automatically detect ScrumRun from `AGENTS.md`.
103
+ 1. `AGENTS.md`;
104
+ 2. `.scrumrun/guardrails.md`;
105
+ 3. `.scrumrun/state.md`;
106
+ 4. only the canonical ids and evidence relevant to current work;
107
+ 5. `.scrumrun/core.md` when method details or exceptional transitions are needed.
182
108
 
183
- Analyze the request, recommend a route, and ask for approval. Do not create records or execute work during intake.
109
+ Lean mode is this bounded read policy; it is not permission to omit canonical truth.
184
110
 
185
- ### `/sc-help`
111
+ `guardrails.md` is the sole canonical project-policy file. `golden-rules.md` is a v1 migration source/compatibility pointer, not a competing authority. `config.md` stores interaction preferences and cannot weaken guardrails.
186
112
 
187
- Explain ScrumRun commands and workflows. Read `.scrumrun/config.md` first to honor the response language. Do not modify files.
113
+ ## Request lifecycle
188
114
 
189
- ### `/sc-init`
115
+ Everything before approval is transient and read-only:
190
116
 
191
- Initialize ScrumRun. In CLI form, run:
192
-
193
- ```bash
194
- npx scrumrun@latest init
117
+ ```text
118
+ USER REQUEST
119
+
120
+ RECEIVED
121
+
122
+ CONTEXTUALIZING
123
+ ├── Project Scan
124
+ ├── History Engine
125
+ └── Decision Engine
126
+
127
+ CONTEXT PACKAGE
128
+
129
+ POLICY ENGINE
130
+
131
+ RISK ASSESSMENT
132
+
133
+ CLASSIFICATION
134
+
135
+ PLANNING
136
+
137
+ AWAITING APPROVAL
195
138
  ```
196
139
 
197
- Default init is local: it creates `AGENTS.md` and `.scrumrun/`, then adds them to `.git/info/exclude` when Git is present. This keeps ScrumRun out of commits unless the owner chooses `--shared`.
198
-
199
- ### `/sc-study`
200
-
201
- Perform a deep, read-only project study.
202
-
203
- Inspect:
204
-
205
- - product purpose and stack;
206
- - package managers, frameworks, runtime versions, and local commands;
207
- - architecture, entry points, routing, controllers, services, jobs, and modules;
208
- - auth, authorization, roles, permissions, policies, guards, and access boundaries;
209
- - data model, migrations, seeds, storage, queues, caches, and external state;
210
- - env/config, secret handling, integrations, webhooks, and provider boundaries;
211
- - deployment, infrastructure, CI, test strategy, and observability clues;
212
- - golden rules, approved knowledge, backlog, current sprint plan, history, and decisions;
213
- - security risks, performance hotspots, brittle areas, unknowns, and next backlog candidates.
214
-
215
- Return evidence with file references. If something cannot be verified, say it is unknown and explain what evidence is missing. Do not modify files. Recommend sprint candidates as backlog candidates unless the user explicitly asks to create or run a sprint.
216
-
217
- ### `/sc-know`
218
-
219
- Investigate a specific topic and write a pending knowledge proposal in `.scrumrun/knowledge.md` using the next `K-NNN` id.
220
-
221
- Each entry should include:
222
-
223
- - title;
224
- - user insight;
225
- - verified facts with file references;
226
- - assumptions and uncertainty;
227
- - risks if wrong;
228
- - affected modules;
229
- - suggested future use.
230
-
231
- With deep knowledge, also include key functions, symbols, entry points, call sites, and relevant types/storage.
232
-
233
- Do not treat new or edited knowledge as approved. Ask the owner to approve or reject it.
234
-
235
- ### `/sc-challenge`
236
-
237
- Analyze a user challenge after study and recommend the safest path.
238
-
239
- Read project files, approved knowledge, backlog, sprint plan, history, decisions, feature lanes, and relevant source code. History reading is mandatory when history exists.
240
-
241
- Return:
242
-
243
- - challenge understanding;
244
- - approved knowledge used;
245
- - evidence with file references;
246
- - history findings;
247
- - impact analysis;
248
- - risks and unknowns;
249
- - options;
250
- - recommendation;
251
- - suggested next command or manual workflow.
252
-
253
- Valid recommendations include creating a small sprint, adding to backlog, creating a feature lane, running discovery first, or rejecting/defering the request.
254
-
255
- Do not create backlog items, sprints, feature lanes, code changes, commits, tests, or history entries unless the user explicitly asks.
256
-
257
- ### `/sc-goal`
258
-
259
- Manage the main project goal in `.scrumrun/goals/main/`.
260
-
261
- When setting or changing the goal with `--set`, read project rules, map, approved knowledge, review agents, main history, and decisions. Detect the stack first, ask blocking architecture questions, then update `.scrumrun/project.md`, `.scrumrun/goals/main/sprint.md`, and `.scrumrun/goals/main/decisions.md`.
262
-
263
- Do not implement code.
264
-
265
- ### `/sc-feature`
266
-
267
- Create or manage isolated feature lanes under `.scrumrun/features/<slug>/`.
268
-
269
- Feature lanes must have separate `feature.md`, `sprint.md`, `history.md`, and `decisions.md`. They must respect project rules and approved knowledge but must not pollute main goal history.
270
-
271
- ### `/sc-sprint`
272
-
273
- Manage or run main-goal sprints.
274
-
275
- For a sprint added with `--add`, append it to `.scrumrun/goals/main/sprint.md` with goal, scope, acceptance criteria, dependencies, suggested verification, and review checkpoints.
276
-
277
- For sprint execution:
278
-
279
- 1. Read `AGENTS.md`, core, golden rules, config, map, project, knowledge, runbook, sprint or feature plan, agents, history, and decisions.
280
- 2. Use only approved knowledge.
281
- 3. Check whether the sprint is completed, partial, or blocked.
282
- 4. Follow Entenda -> Avalie Impactos -> Tire Duvidas -> Execute -> Teste.
283
- 5. Run configured review agents.
284
- 6. Fix findings before marking complete.
285
- 7. Update main history and decisions.
286
-
287
- If the owner asks to send a sprint to backlog, add it to `.scrumrun/backlog.md` and stop without executing.
288
-
289
- ### `/sc-backlog`
290
-
291
- Manage `.scrumrun/backlog.md`.
292
-
293
- Backlog items are candidates, not active work. Adding to backlog must not change sprint status, run tests, execute agents, or modify application code.
294
-
295
- ### `/sc-fix`
296
-
297
- Manage `.scrumrun/fixes.md`.
298
-
299
- Record what went wrong and what was done with `--add`. Browse the fix log with `--list` and `--show`. If patterns repeat, use `--insight` to create durable knowledge. `/sc-sprint --fix` auto-registers entries.
300
-
301
- ### `/sc-agent`
302
-
303
- Manage review agents in `.scrumrun/agents.md` or run them against a sprint. Agent findings should be recorded in the relevant history file.
304
-
305
- ### `/sc-review`
140
+ Intake must:
306
141
 
307
- Run a code review. Findings must be ordered by severity and include file/line references. Do not modify code unless explicitly asked.
142
+ 1. understand outcome, urgency, scope, risk, uncertainty, and current-work relationship;
143
+ 2. retrieve only relevant project/code/history/decision evidence;
144
+ 3. apply guardrails before making a recommendation;
145
+ 4. classify as standalone Task, Sprint batch, Feature, discovery, fix Task, backlog Task, quick Task, or reject/defer;
146
+ 5. recommend one route and, in guided mode, at most two useful alternatives;
147
+ 6. ask one explicit approval question before execution; config may change presentation, never remove the gate.
308
148
 
309
- ### `/sc-config`
149
+ Before approval, do not create canonical files, update status, edit application code, or retain request content outside ignored disposable context cache. Ambiguous acknowledgement is not approval.
310
150
 
311
- Manage `.scrumrun/config.md`, including response language and sprint automation preferences.
151
+ ## Execution lifecycle
312
152
 
313
- ### `/sc-golden`
153
+ Explicit approval creates or updates the Task and creates a Run:
314
154
 
315
- Manage `.scrumrun/golden-rules.md`. Golden rules are absolute and must be checked before every planning or execution workflow.
155
+ ```text
156
+ executing
157
+ → validating
158
+ → learning
159
+ → completed
160
+ ↘ failed
161
+ ↘ blocked
162
+ ```
316
163
 
317
- ### `/sc-map`
164
+ Rules:
318
165
 
319
- Build or view `.scrumrun/map.md`. The map is a navigation aid, not source of truth. Verify files before editing.
166
+ - one Run belongs to one Task;
167
+ - one Task may have multiple immutable attempts;
168
+ - every state transition writes exactly one append-only history event;
169
+ - validation must match the risk and acceptance criteria;
170
+ - configured reviews run before completion;
171
+ - learning proposes memory candidates after validation and never auto-confirms AI inference;
172
+ - complete a Sprint only when all its included Tasks meet the Sprint exit gate;
173
+ - do not mark work complete merely because time or token budget ended.
320
174
 
321
- ### `/sc-context`
175
+ Canonical mutations are schema-validated, lossless, and atomic. Preserve unknown fields, prose, and unrelated owner edits. A failed mutation must leave canonical state unchanged or recoverable.
322
176
 
323
- Manage `.scrumrun/context.md`, the token-safe project snapshot, and `.scrumrun/token-policy.md`, the context economy rules.
177
+ ## Semantic memory
324
178
 
325
- Actions:
179
+ ### Knowledge
326
180
 
327
- - `/sc-context --build` (`-b`): create or fully refresh the snapshot from canonical ScrumRun files and targeted source inspection.
328
- - `/sc-context --update` (`-u`) `[reason]`: update only changed sections after study, challenge, planning, execution, review, or knowledge changes.
329
- - `/sc-context --show` (`-s`): show the current snapshot without modifying files.
330
- - `/sc-context --clear` (`-c`): reset the snapshot to a stale placeholder so future agents know it must be rebuilt.
331
- - `/sc-context --policy` (`-p`): show token economy rules and explain how they apply to the current task.
181
+ Verified descriptive facts about the project. Only `approved` Knowledge may guide execution as truth.
332
182
 
333
- Never let `context.md` override golden rules, approved knowledge, history, decisions, or source code.
183
+ ### Decision
334
184
 
335
- ### `/sc-decisions`
185
+ Normative constraints such as “pricing calculations must remain on the backend.” Decisions carry status, scope, evidence/source, validity conditions, and review triggers.
336
186
 
337
- Resolve open decisions one at a time in the relevant decisions/history file.
187
+ ### Insight
338
188
 
339
- ### `/sc-vault`
189
+ Explanatory context such as placement rationale, tradeoff, business rule, failure history, performance reason, security reason, usage warning, or testing note. Insights are not automatically Decisions.
340
190
 
341
- Manage `.scrumrun/vault.local.md`, a plaintext local development vault.
191
+ AI extraction creates `candidate` Insights. Confirmation requires explicit human approval or trusted evidence. Supported states are `candidate`, `confirmed`, `stale`, `deprecated`, and `invalidated`.
342
192
 
343
- This file is for development-only credentials and local test values. It is not encrypted and is not a production secret manager. Values must never be committed or copied into normal ScrumRun records.
193
+ ### Dossier
344
194
 
345
- ## Manual Usage Without Installation
195
+ A durable evidence bundle about a topic/module, with last-verified source/commit and staleness information.
346
196
 
347
- If commands are unavailable, ask the agent to do this:
197
+ Useful graph relations include:
348
198
 
349
199
  ```text
350
- Read .scrumrun/core.md and follow ScrumRun.
351
- I want the equivalent of /sc-study.
352
- Do not modify files.
200
+ defined_in
201
+ depends_on
202
+ used_by
203
+ constrained_by
204
+ introduced_by
205
+ modified_by
206
+ has_insight
207
+ protected_by
353
208
  ```
354
209
 
355
- Or:
210
+ Context retrieval must explain why a record matched and label stale evidence. Invalidated/rejected memory is preserved for audit but never injected as active truth.
356
211
 
357
- ```text
358
- Read .scrumrun/core.md and follow ScrumRun.
359
- I want the equivalent of /sc-challenge:
360
- <challenge>
361
- Show options and recommendation only. Do not execute.
362
- ```
212
+ ## Migration contract
363
213
 
364
- Or:
214
+ Migration is explicit:
365
215
 
366
216
  ```text
367
- Read .scrumrun/core.md and follow ScrumRun.
368
- Run the equivalent of /sc-sprint --run Sprint 01.
369
- Follow the sprint protocol and update history when done.
217
+ scrumrun migrate --to 2 --dry-run
218
+ scrumrun migrate --to 2 --apply
219
+ scrumrun migrate --to 2 --rollback
370
220
  ```
371
221
 
372
- ## Bootstrap Prompt
373
-
374
- For AI clients that do not reliably read project instructions automatically, paste this at the start of the session:
375
-
376
- ```text
377
- Read AGENTS.md and .scrumrun/core.md before doing anything else.
378
- Follow ScrumRun exactly.
379
- If slash commands are unavailable, execute the equivalent workflow from .scrumrun/core.md manually.
380
- Do not plan, edit, run, or review work until you have applied the ScrumRun safety rules, project files, approved knowledge, sprint history, and decision history.
381
- ```
222
+ - ordinary install/update never applies a migration; update performs a read-only v1 preflight, and only explicit `update --migrate` applies its verified plan;
223
+ - dry-run writes no project data;
224
+ - apply inventories source hashes, creates a byte-exact local backup, transforms in staging, validates, and activates by atomic directory swap;
225
+ - incomplete hybrid v1/v2 trees reuse existing evidenced canonical relations instead of creating duplicate Tasks/Runs;
226
+ - legacy-only aggregates leave the active v2 tree after apply and remain byte-exact in the ignored backup;
227
+ - the mapping report relates every inferred v1 block to its v2 destination while every original file remains covered by the backup inventory;
228
+ - replay is idempotent;
229
+ - ambiguous mappings are preserved and warned, never guessed;
230
+ - vault contents remain unchanged and are never rendered;
231
+ - rollback verifies the backup and refuses if it would erase post-migration work.
232
+
233
+ Legacy sprint plan entries normally become Tasks. History attempts become Runs when a Task link is evidenced. A v2 Sprint is created only with actual timebox/batch evidence. Feature lanes become Features; backlog entries become backlog Tasks; fixes become fix Tasks; Knowledge states are preserved; extracted Insights remain candidates; golden rules become stable-id Guardrails.
234
+
235
+ ## Command reference
236
+
237
+ ### `/sc plan`
238
+
239
+ - `task --add|--list|--show|--run|--audit|--cancel|--retry`
240
+ - `sprint --add|--list|--show|--start|--complete|--block`
241
+ - `feature --add|--list|--show|--activate|--complete`
242
+ - `run --list|--show|--validate|--learn|--complete|--resume|--fail|--block`
243
+ - `intake <request>`
244
+ - `challenge <question>`
245
+
246
+ ### `/sc knowledge`
247
+
248
+ - `fact --add|--list|--show|--approve|--reject|--deprecate|--invalidate`
249
+ - `decision --add|--list|--show|--resolve|--deprecate|--invalidate`
250
+ - `insight --propose|--list|--show|--confirm|--stale|--reject|--deprecate|--invalidate`
251
+ - `dossier --add|--list|--show|--refresh|--stale|--deprecate|--archive`
252
+ - `context --build|--update|--show|--clear`
253
+ - `map --build|--show`
254
+ - `study <focus>`
255
+ - `vault --add|--list|--show|--remove|--path`
256
+
257
+ ### `/sc rules`
258
+
259
+ - `guardrail --add|--list|--show|--retire`
260
+ - `reviewer --add|--list|--show|--run`
261
+
262
+ ### `/sc review`
263
+
264
+ - `code --run`
265
+ - `artifact --run`
266
+ - `migration --run`
267
+ - `release --run`
268
+
269
+ Review is read-only unless fixes are separately authorized. Report findings by severity with evidence.
270
+
271
+ ### `/sc config`
272
+
273
+ - `project --show|--language|--interaction|--approval|--quick-tasks`
274
+ - `init --local|--shared|--force`
275
+ - `update all|codex|opencode|claude [--migrate]`
276
+ - `migrate --to 2 --dry-run|--apply|--rollback`
277
+ - `doctor all|codex|opencode|claude [--strict]`
278
+ - `uninstall --force`
279
+ - `help <topic>`
280
+
281
+ ## Stable invariants
282
+
283
+ - Intake is read-only.
284
+ - No execution without explicit valid approval.
285
+ - Guardrails cannot be bypassed; they may only be superseded/retired with history.
286
+ - Task is atomic; Sprint is grouping; Run is an attempt.
287
+ - Retries preserve prior Runs.
288
+ - History is append-only.
289
+ - Only approved/confirmed, non-stale memory guides work as truth.
290
+ - AI proposals never self-confirm.
291
+ - Generated views/caches never override canonical Markdown.
292
+ - Vault values never leave the local vault boundary.
293
+ - Migration never guesses or runs implicitly; `update --migrate` is explicit migration approval.
294
+ - Review does not imply authorization to fix.