sdd-flow 1.3.3 → 2.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 (70) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/CONTRIBUTING.md +25 -0
  3. package/LICENSE +21 -21
  4. package/README.md +402 -168
  5. package/README.pt-BR.md +387 -0
  6. package/bin/cli.js +162 -424
  7. package/docs/architecture.md +91 -0
  8. package/docs/distribution.md +64 -0
  9. package/docs/formats.md +215 -0
  10. package/docs/local-testing.pt-BR.md +196 -0
  11. package/docs/methodology.pt-BR.md +139 -0
  12. package/docs/migration.md +76 -0
  13. package/docs/quality-gates.pt-BR.md +160 -0
  14. package/docs/quality.md +56 -0
  15. package/docs/releases.pt-BR.md +105 -0
  16. package/docs/setup-documents.pt-BR.md +120 -0
  17. package/docs/usage.pt-BR.md +310 -0
  18. package/docs/validation.md +101 -0
  19. package/lib/adapters.js +115 -0
  20. package/lib/check.js +221 -0
  21. package/lib/context.js +117 -0
  22. package/lib/documents.js +71 -0
  23. package/lib/handoff.js +81 -0
  24. package/lib/history.js +16 -0
  25. package/lib/install.js +181 -0
  26. package/lib/io.js +119 -0
  27. package/lib/legacy-hashes.json +31 -0
  28. package/lib/markdown.js +71 -0
  29. package/lib/project.js +200 -0
  30. package/lib/quality.js +24 -0
  31. package/lib/revisions.js +79 -0
  32. package/lib/verification.js +267 -0
  33. package/package.json +55 -32
  34. package/templates/AGENTS.md +12 -50
  35. package/templates/QUICKSTART.md +16 -70
  36. package/templates/agents/AGENTS.md +58 -92
  37. package/templates/agents/DECISIONS.md +5 -21
  38. package/templates/agents/POLICIES.md +14 -0
  39. package/templates/agents/PROJECT.md +35 -145
  40. package/templates/agents/QUALITY.md +19 -0
  41. package/templates/agents/RULES.md +24 -132
  42. package/templates/agents/SETUP.md +38 -224
  43. package/templates/agents/config.yaml +13 -0
  44. package/templates/agents/current/_template.md +19 -0
  45. package/templates/agents/decisions/_template.md +22 -0
  46. package/templates/agents/prompts/conventional-commit.md +11 -51
  47. package/templates/agents/prompts/intake.md +23 -0
  48. package/templates/agents/prompts/pr-template.md +12 -21
  49. package/templates/agents/prompts/quality.md +57 -0
  50. package/templates/agents/prompts/rpi-close.md +23 -0
  51. package/templates/agents/prompts/rpi-implement.md +35 -68
  52. package/templates/agents/prompts/rpi-plan.md +87 -117
  53. package/templates/agents/prompts/rpi-research.md +21 -67
  54. package/templates/agents/prompts/rpi-validate.md +40 -103
  55. package/templates/agents/prompts/skill-call.md +11 -29
  56. package/templates/agents/prompts/task-create.md +13 -42
  57. package/templates/agents/skills/_template/SKILL.md +11 -37
  58. package/templates/agents/harness/claude-code/.hooks/guard-delete.sh +0 -22
  59. package/templates/agents/harness/claude-code/.hooks/guard-deps.sh +0 -25
  60. package/templates/agents/harness/claude-code/.hooks/guard-git.sh +0 -24
  61. package/templates/agents/harness/claude-code/commands/sdd-implement.md +0 -3
  62. package/templates/agents/harness/claude-code/commands/sdd-plan.md +0 -3
  63. package/templates/agents/harness/claude-code/commands/sdd-research.md +0 -3
  64. package/templates/agents/harness/claude-code/commands/sdd-validate.md +0 -3
  65. package/templates/agents/harness/claude-code/settings.json +0 -34
  66. package/templates/agents/harness/opencode/commands/sdd-implement.md +0 -3
  67. package/templates/agents/harness/opencode/commands/sdd-plan.md +0 -3
  68. package/templates/agents/harness/opencode/commands/sdd-research.md +0 -3
  69. package/templates/agents/harness/opencode/commands/sdd-validate.md +0 -3
  70. package/templates/agents/harness/opencode/opencode.json +0 -18
package/README.md CHANGED
@@ -1,168 +1,402 @@
1
- # sdd-flow
2
-
3
- > A spec-driven workflow for AI-assisted development — installed in seconds, works with any agent.
4
-
5
- ```bash
6
- npm install -g sdd-flow
7
- sdd init
8
- ```
9
-
10
- ---
11
-
12
- ## Why sdd-flow exists
13
-
14
- AI agents drift. A session that starts well ends with the agent ignoring the spec, inventing APIs, and refactoring things you didn't ask it to touch. The usual fix — better prompts, more context — doesn't scale.
15
-
16
- **sdd-flow takes a different approach: phase isolation.**
17
-
18
- Every feature goes through four phases. Each phase runs in its own agent session and receives only the artifact from the previous phase — not the full conversation history. Context stays lean. The agent reads the spec fresh every session and can't drift from what it hasn't accumulated.
19
-
20
- This is a workflow for developers who want to stay in control of what gets built and why.
21
-
22
- ---
23
-
24
- ## The RPIV Cycle
25
-
26
- ```
27
- Requirements
28
- │
29
- ▼
30
- ┌────────────┐ new session ┌────────────┐ new session ┌─────────────┐ new session ┌────────────┐
31
- │ RESEARCH │ ────────────▶ │ PLAN │ ────────────▶ │ IMPLEMENT │ ────────────▶ │ VALIDATE │
32
- │ │ │ │ │ │ │ │
33
- │ RESEARCH │ │ SPEC.md │ │ Code │ │ Verified │
34
- │ .md │ │ TASK.md │ │ TASK.md ✓ │ │ PROGRESS │
35
- │ │ │ TEST.md │ │ (one task, │ │ .md │
36
- │ │ │ PROGRESS │ │ then stop) │ │ │
37
- └────────────┘ └────────────┘ └─────────────┘ └────────────┘
38
- ```
39
-
40
- Each arrow is a phase boundary. The agent starts fresh. Only the artifact passes through.
41
-
42
- | Phase | Input | Output |
43
- |-------|-------|--------|
44
- | 🔍 **Research** | Your requirements | `RESEARCH.md` |
45
- | 📐 **Plan** | `RESEARCH.md` | `SPEC.md` + `TASK.md` + `TEST.md` |
46
- | 🔨 **Implement** | `SPEC.md` + `TASK.md` | Code + updated `TASK.md` |
47
- | ✅ **Validate** | `TEST.md` + codebase | `VALIDATION.md` |
48
-
49
- > The agent stops after each task in the Implement phase and waits for your review. One task, one diff, one decision at a time.
50
-
51
- ---
52
-
53
- ## Quick Start
54
-
55
- ```bash
56
- # Install
57
- npm install -g sdd-flow
58
-
59
- # Set up in your project
60
- cd your-project
61
- sdd init
62
-
63
- # Create your first feature spec
64
- sdd new user-auth # creates agents/specs/001-user-auth/
65
- ```
66
-
67
- Open a new agent session and say:
68
-
69
- ```
70
- Read and follow agents/SETUP.md
71
- ```
72
-
73
- The agent scans your project (or reads your PRD) and generates `PROJECT.md`, `DECISIONS.md`, and a `skills/` directory tailored to your stack. Review the files, then delete `agents/SETUP.md`. You're ready.
74
-
75
- ---
76
-
77
- ## Running a Feature
78
-
79
- ### Without harness — any editor
80
-
81
- ```
82
- # Session 1 — Research
83
- "Read and follow agents/prompts/rpi-research.md"
84
-
85
- # Session 2 — Plan
86
- "Read and follow agents/prompts/rpi-plan.md. Spec at agents/specs/001-user-auth/"
87
-
88
- # Session 3 — Implement
89
- "Read and follow agents/prompts/rpi-implement.md. Spec at agents/specs/001-user-auth/"
90
-
91
- # Session 4 — Validate
92
- "Read and follow agents/prompts/rpi-validate.md. Spec at agents/specs/001-user-auth/"
93
- ```
94
-
95
- ### With harness — Claude Code / OpenCode
96
-
97
- ```bash
98
- sdd harness # installs slash commands
99
- ```
100
-
101
- ```
102
- /sdd-research 001-user-auth
103
- /sdd-plan 001-user-auth
104
- /sdd-implement 001-user-auth
105
- /sdd-validate 001-user-auth
106
- ```
107
-
108
- ---
109
-
110
- ## Commands
111
-
112
- ```bash
113
- sdd init # install the workflow into the current project
114
- sdd new <name> # create a numbered spec folder (001-, 002-, ...)
115
- sdd harness # install, switch, or remove slash commands
116
- sdd update # update prompts and rules — never touches your specs or decisions
117
- sdd --version
118
- ```
119
-
120
- ---
121
-
122
- ## What gets installed
123
-
124
- ```
125
- agents/
126
- ├── AGENTS.md ← agent role and SDD rules (read every session)
127
- ├── RULES.md ← behavioral constraints (no rogue git, no scope creep)
128
- ├── PROJECT.md ← your stack and conventions (auto-generated on setup)
129
- ├── DECISIONS.md ← append-only architectural decisions log
130
- ├── SETUP.md ← first-run only (delete after setup)
131
- ├── prompts/ ← one file per phase + utility prompts
132
- ├── skills/ ← capability files auto-generated for your stack
133
- └── specs/
134
- └── 001-user-auth/
135
- ├── RESEARCH.md
136
- ├── SPEC.md
137
- ├── TASK.md
138
- ├── PROGRESS.md
139
- └── TEST.md
140
- ```
141
-
142
- > `sdd update` only touches `AGENTS.md`, `RULES.md`, and `prompts/`.
143
- > Your specs, decisions, and skills are never modified.
144
-
145
- ---
146
-
147
- ## Works with any stack
148
-
149
- sdd-flow operates at the spec level, not the code level. JavaScript, TypeScript, Python, Java, Go, PHP — the agent adapts to your stack during setup. No framework assumptions, no extra API keys, no additional costs beyond what you already use.
150
-
151
- ---
152
-
153
- ## Compatible editors
154
-
155
- Claude Code · OpenCode · Cursor · Windsurf · Codex CLI · any IDE with filesystem access
156
-
157
- ---
158
-
159
- ## Workflow template
160
-
161
- The prompts and rules installed by `sdd-flow` are maintained at:
162
- [github.com/moisesuailab/spec-driven-workflow](https://github.com/moisesuailab/spec-driven-workflow)
163
-
164
- ---
165
-
166
- ## License
167
-
168
- MIT
1
+ <div align="center">
2
+
3
+ # sdd-flow
4
+
5
+ ### A clear workflow for developing with AI.
6
+
7
+ Relevant context for the agent.<br>
8
+ Well-defined changes for you.<br>
9
+ A traceable history for the project.
10
+
11
+ ![Node.js 22 or newer](https://img.shields.io/badge/Node.js-%E2%89%A5%2022-417E38)
12
+ ![MIT license](https://img.shields.io/badge/license-MIT-2563EB)
13
+ ![Portable methodology](https://img.shields.io/badge/methodology-stack%20independent-475569)
14
+
15
+ [Português brasileiro](README.pt-BR.md) · [Get started](#get-started-in-3-steps) · [Workflow](#how-it-works) · [Context](#how-context-stays-focused) · [Documentation](#documentation)
16
+
17
+ </div>
18
+
19
+ ---
20
+
21
+ **sdd-flow organizes AI-assisted development into cohesive changes that you can understand, implement and verify.**
22
+
23
+ Describe what you need. The agent consults relevant sources, prepares a spec, implements the authorized scope and records the results. Project knowledge and progress remain in the repository for the next session.
24
+
25
+ | Organization | Context | Traceability |
26
+ |---|---|---|
27
+ | One spec per cohesive change | Sources selected for the phase and task | Connected requirements, tasks, decisions and verification |
28
+
29
+ **Your daily focus stays on the spec.** The agent and CLI maintain supporting records. Configuration, skills and general documents are consulted when relevant.
30
+
31
+ ## How it works
32
+
33
+ ```mermaid
34
+ flowchart TD
35
+ A["Describe the change"] --> B["Agent researches and plans"]
36
+ B --> C["Review the scope"]
37
+ C --> D["Agent implements and verifies"]
38
+ D --> E{"Result"}
39
+ E -->|"Needs adjustment"| D
40
+ E -->|"Ready to close"| F["Consolidate and record the outcome"]
41
+ D -. "Requirement changed" .-> B
42
+ ```
43
+
44
+ **Research → plan → implement → validate → close.** These are responsibilities, not mandatory separate conversations.
45
+
46
+ - **Before:** clarify the goal, define acceptance and consider affected consumers.
47
+ - **During:** execute cohesive tasks and check regressions.
48
+ - **After:** record observations and consolidate current knowledge.
49
+
50
+ Use the method for **new projects** or **existing applications**, with any application stack. Node.js 22+ is required for the CLI.
51
+
52
+ ## Get started in 3 steps
53
+
54
+ > **This README describes 2.x**, a breaking evolution from 1.x (see [migration](docs/migration.md)). Confirm your CLI with `sdd --version`.
55
+
56
+ ### 1. Install the CLI
57
+
58
+ With Node.js 22+:
59
+
60
+ ```sh
61
+ npm install -g sdd-flow
62
+ sdd --version
63
+ ```
64
+
65
+ <details>
66
+ <summary>Other options: run without installing, or from source</summary>
67
+
68
+ Run without a global install:
69
+
70
+ ```sh
71
+ npx sdd-flow@latest --help
72
+ ```
73
+
74
+ From the **sdd-flow source checkout** (for contributors):
75
+
76
+ ```sh
77
+ npm ci
78
+ npm link
79
+ sdd --version
80
+ ```
81
+
82
+ Installing the package provides the CLI. Project files are installed by running `sdd init` inside each application.
83
+
84
+ </details>
85
+
86
+ ### 2. Initialize your project
87
+
88
+ ```sh
89
+ cd /path/to/your-project
90
+ sdd init
91
+ ```
92
+
93
+ Optional native entry points:
94
+
95
+ ```sh
96
+ sdd harness claude-code
97
+ # Alternative: sdd harness opencode
98
+ ```
99
+
100
+ For other environments, direct the agent to the project's `AGENTS.md`. The core uses files and commands; a native adapter is optional.
101
+
102
+ ### 3. Keep using short prompts
103
+
104
+ For initial setup:
105
+
106
+ ```text
107
+ Read and follow agents/SETUP.md to configure the workflow.
108
+ ```
109
+
110
+ Then describe the change and select the phase:
111
+
112
+ | Phase | Prompt |
113
+ |---|---|
114
+ | Research | Read and follow agents/prompts/rpi-research.md. |
115
+ | Plan | Read and follow agents/prompts/rpi-plan.md. |
116
+ | Implement | Read and follow agents/prompts/rpi-implement.md. |
117
+ | Validate | Read and follow agents/prompts/rpi-validate.md. |
118
+ | Close | Read and follow agents/prompts/rpi-close.md. |
119
+
120
+ The procedures contain the workflow instructions. You do not need to repeat them in chat.
121
+ The request and active spec must be identifiable. If several changes exist or a new session lacks context,
122
+ provide the spec ID or let the agent clarify which one to use.
123
+
124
+ Setup is initial adoption, not a repeated step for every spec. Once complete, `SETUP.md` may be removed.
125
+ Project language and conventions belong in configuration and policies.
126
+
127
+ **Follow the spec, tasks and verification outcome.** The agent uses the CLI and maintains supporting records.
128
+ Phases may run in the same conversation.
129
+
130
+ For an existing application, setup records an observed baseline without refactoring the application
131
+ or inventing historical specs.
132
+
133
+ ## What is added to your repository
134
+
135
+ | Files | Purpose |
136
+ |---|---|
137
+ | `AGENTS.md` and `QUICKSTART.md` | Entry point and getting started |
138
+ | `agents/PROJECT.md` | Short application map and source references |
139
+ | `agents/POLICIES.md` and `agents/QUALITY.md` | Project constraints and quality criteria |
140
+ | `agents/config.yaml` | Language, autonomy, rigor and actual check commands |
141
+ | `agents/RULES.md`, `agents/AGENTS.md` and `agents/prompts/` | Method and phase procedures |
142
+ | `agents/specs/` | Active changes |
143
+ | `agents/current/` and active decisions | Current knowledge |
144
+ | `agents/archive/` | Closed changes |
145
+ | `agents/skills/` | Reusable project procedures |
146
+
147
+ Installation includes templates and maintenance metadata. **It does not generate features or fictional specs.**
148
+
149
+ Each change uses only the applicable artifacts:
150
+
151
+ | Artifact | Role |
152
+ |---|---|
153
+ | `change.yaml` | Identity, references, dependencies and lifecycle |
154
+ | `SPEC.md` | Requirements and acceptance |
155
+ | `TASK.md` | Plan and canonical task state, when applicable |
156
+ | `RESEARCH.md` | Research when useful or required by the mode |
157
+ | Evidence and run records | What was checked, for which inputs, with which result |
158
+
159
+ The agent maintains these as work progresses. Research, evidence and history are not all created by `sdd new`.
160
+
161
+ ## How context stays focused
162
+
163
+ **The repository stores knowledge. The agent receives a relevant selection for the current task.**
164
+
165
+ ```mermaid
166
+ flowchart TD
167
+ A["Active spec and task"] --> D["Select context"]
168
+ B["Contracts, decisions and skills"] --> D
169
+ C["Relevant docs/ references"] --> D
170
+ D --> E{"Within budget?"}
171
+ E -->|"Yes"| F["Provide context to the agent"]
172
+ E -->|"No"| G["Review sources, sections and scope"]
173
+ G --> D
174
+ ```
175
+
176
+ - A short entry point maps the project.
177
+ - Phase and task guide selection.
178
+ - Skills are discovered by name and description; selected bodies are loaded.
179
+ - Large references can be selected by heading.
180
+ - Full historical logs are not loaded automatically.
181
+ - `TASK.md` holds task state; `STATE.md` is an optional short resumption note.
182
+
183
+ ```sh
184
+ sdd context 001-my-change --phase implement --task T01 --inspect
185
+ ```
186
+
187
+ Inspection reports sizes without emitting document bodies. The default budget is **48,000 UTF-8 bytes**,
188
+ configurable. It is not a token count or the complete chat context window.
189
+
190
+ Generating an oversized packet reports the problem **without silently truncating content**.
191
+ The agent can select sections, review references or split independent deliverables.
192
+
193
+ Selection depends on maintained references. The CLI cannot infer every semantic dependency or control chat history.
194
+
195
+ ## Keep references organized in docs/
196
+
197
+ PRDs, business rules, system design, ADRs, design systems, contracts and external materials can stay
198
+ in `docs/`, with or without subdirectories.
199
+
200
+ **Centralize sources; select what to read.** The agent consults relevant documents and preserves their origin.
201
+
202
+ Example in `change.yaml`:
203
+
204
+ ```yaml
205
+ sources:
206
+ - path: docs/product/prd.md
207
+ section: Data export
208
+ context:
209
+ - path: docs/design/design-system.md
210
+ section: States and interactions
211
+ ```
212
+
213
+ There is no mandatory document bundle. A clear description can be enough to start.
214
+
215
+ Optional reference drafts:
216
+
217
+ ```sh
218
+ sdd docs --types prd,sd,ds,adr,roadmap --dry-run
219
+ sdd docs --types prd,sd,ds,adr,roadmap
220
+ ```
221
+
222
+ Existing files are preserved. New files are drafts for review.
223
+ See [setup and reference documents (Português)](docs/setup-documents.pt-BR.md).
224
+
225
+ ## Choose proportional rigor
226
+
227
+ | Mode | Typical use |
228
+ |---|---|
229
+ | `light` | Small change; tasks and research may be omitted |
230
+ | `standard` | Bounded feature with verifiable tasks |
231
+ | `rigorous` | Sensitive or uncertain work with research and explicit approval |
232
+
233
+ New installations default to **step**: implement and verify one task, then stop for review.
234
+ Authorize named tasks or all tasks to continue as a bounded batch without repeated confirmations.
235
+ Plan approval alone does not override step. **Batch** can also be the project's standing preference;
236
+ updates preserve an existing choice. Each task is still checked and dependencies respected.
237
+
238
+ ## Verify honestly, including unavailable environments
239
+
240
+ The CLI runs configured checks and records commands, results and inputs.
241
+ Approval binds to scope; verification binds to the inputs examined.
242
+
243
+ | Result | Meaning |
244
+ |---|---|
245
+ | `passed` | Full verification passed for current inputs |
246
+ | `limited` | Implementation complete with explicit external limitations and pending verification |
247
+ | `partial` | Conditions for final closure are not yet met |
248
+ | `failed` | Required failure observed or inputs changed during execution |
249
+
250
+ **Unavailable staging or production access need not block completed implementation.**
251
+ A reviewed handoff records limitations and can generate safe steps in `USER_TESTS.md`.
252
+
253
+ `limited` does not claim external tests passed or authorize deployment.
254
+ Omitting evidence cannot erase a known failure for the same inputs.
255
+
256
+ Required failures block passing verification; advisory issues remain warnings.
257
+ Use TDD, BDD examples and metrics as appropriate, without a mandatory tool or universal percentage.
258
+
259
+ See [quality gates and missing environments (Português)](docs/quality-gates.pt-BR.md).
260
+
261
+ ## Portability and scope
262
+
263
+ | sdd-flow organizes | The harness provides |
264
+ |---|---|
265
+ | Method, specs, context and traceability | Models, tools and permissions |
266
+ | Sources and evidence | MCPs and service access |
267
+ | Knowledge entry points and exports | Compaction and optional delegation |
268
+
269
+ Use one conversation, separate sessions or native delegation. **No built-in orchestrator or multiagent requirement.**
270
+
271
+ Claude Code and OpenCode adapters provide commands and a workflow skill.
272
+ Exports prepare knowledge for distribution; they do not publish to marketplaces.
273
+ See [adapters and distribution](docs/distribution.md).
274
+
275
+ ## For AI agents
276
+
277
+ 1. Start with `AGENTS.md` and the project map.
278
+ 2. Follow `SETUP.md` for initial adoption, then the current phase procedure.
279
+ 3. Consult relevant sources instead of bulk-loading `docs/`.
280
+ 4. Preserve IDs, current rules, observed architecture and existing work.
281
+ 5. Review consumers and regressions before changing shared behavior.
282
+ 6. Record actual authorization, observations and limitations.
283
+ 7. Maintain canonical state and consolidate current knowledge before closure.
284
+
285
+ Metadata uses YAML rather than fixed line excerpts. Source documents are project data;
286
+ they do not replace user authorization.
287
+
288
+ <details>
289
+ <summary>Essential change commands</summary>
290
+
291
+ Use the actual ID and complete the plan between commands:
292
+
293
+ ```sh
294
+ sdd new my-change --mode standard
295
+ sdd context 001-my-change --phase plan
296
+ # Define requirements, acceptance, tasks and references.
297
+ sdd check 001-my-change
298
+
299
+ # Record only authorization actually given:
300
+ sdd approve 001-my-change --by "Reviewer"
301
+
302
+ sdd context 001-my-change --phase implement --task T01
303
+ # Implement, check and update tasks.
304
+ # Consolidate current contracts before final verification.
305
+ sdd verify 001-my-change
306
+ sdd close 001-my-change --by "Reviewer" --archive
307
+ ```
308
+
309
+ Closure requires consolidation of selected capabilities, or `--note` explaining why no lasting update is needed.
310
+ Manual evidence and external limitations use the corresponding verification arguments.
311
+
312
+ `sdd check` validates structure. `sdd verify` executes configured checks.
313
+
314
+ </details>
315
+
316
+ ## Reinstall or upgrade without starting over
317
+
318
+ The 2.x installer distinguishes project-owned files from managed workflow files.
319
+
320
+ | Situation | Expected behavior |
321
+ |---|---|
322
+ | Repeat `init` on the same version | Preserve configuration and work; missing files may be restored |
323
+ | Customized core files | Report conflicts rather than silently overwrite |
324
+ | Install a newer CLI | Existing application files are not updated automatically |
325
+ | Run `update` with recognized, conflict-free core files | Refresh managed files and preserve project-owned files |
326
+ | Adopt from 1.x | Review core/artifact migration; old evidence does not become fresh approval |
327
+
328
+ Existing `PROJECT.md`, `POLICIES.md`, `QUALITY.md`, `config.yaml` and `DECISIONS.md` are preserved.
329
+ The installer does not delete project specs, custom skills, `docs/` sources or history.
330
+ Normal maintenance does not recreate a completed, removed setup guide.
331
+
332
+ Preserve your current work in a commit or backup. Install the desired CLI version from the local package
333
+ during testing, or npm after publication. Inside the application:
334
+
335
+ ```sh
336
+ sdd --version
337
+ sdd update --dry-run
338
+ # Review the plan and resolve conflicts before applying.
339
+ sdd update
340
+ sdd doctor
341
+ ```
342
+
343
+ Refresh native entry points with `sdd harness claude-code` or `sdd harness opencode` when used.
344
+ Native settings are not overwritten; old permissions/hooks require their own review.
345
+
346
+ <details>
347
+ <summary>Migrating from 1.x or handling a conflict</summary>
348
+
349
+ The updater recognizes unchanged templates from the original 1.3.3 baseline.
350
+ Customized versions, including third-party adaptations, may need manual review.
351
+
352
+ For a legacy spec that you will resume or normalize:
353
+
354
+ ```sh
355
+ sdd migrate 001-my-change --dry-run
356
+ sdd migrate 001-my-change
357
+ ```
358
+
359
+ Use the real ID. Migration preserves old bodies and creates structures for review.
360
+ Review requirements, acceptance, tasks and references before normalization.
361
+ You do not need to convert all closed historical work just to adopt the flow for new changes.
362
+
363
+ Customized core files cause a conflict before planned core writes are applied.
364
+ Move project-specific rules into policies, contracts or skills before deciding to replace core files.
365
+ `--replace-managed` is explicit and should follow review; replaced content is backed up.
366
+
367
+ These protections describe the 2.x installer. Do not use a 1.x installer to downgrade
368
+ or assume automatic compatibility with future versions.
369
+ Read the [migration guide](docs/migration.md).
370
+
371
+ </details>
372
+
373
+ ## Documentation
374
+
375
+ | Goal | Guide |
376
+ |---|---|
377
+ | Use the workflow end to end | [Usage (Português)](docs/usage.pt-BR.md) |
378
+ | Understand setup and documents | [Setup (Português)](docs/setup-documents.pt-BR.md) |
379
+ | Understand the method and changes | [Methodology (Português)](docs/methodology.pt-BR.md) |
380
+ | Configure quality and external tests | [Quality gates (Português)](docs/quality-gates.pt-BR.md) |
381
+ | Understand artifact formats | [Formats and examples](docs/formats.md) |
382
+ | Test locally | [Local testing (Português)](docs/local-testing.pt-BR.md) |
383
+ | Upgrade legacy projects | [Migration](docs/migration.md) |
384
+ | Prepare plugins and skills | [Distribution](docs/distribution.md) |
385
+ | Review observed validation and limits | [Implementation validation](docs/validation.md) |
386
+ | Publish a version | [GitHub and npm (Português)](docs/releases.pt-BR.md) |
387
+ | Contribute | [Contributing](CONTRIBUTING.md) · [Changelog](CHANGELOG.md) |
388
+
389
+ ## Important limits
390
+
391
+ The CLI validates declared relationships and records runs. Passing tests do not prove semantic coverage.
392
+ Approval is a recorded assertion, not identity authentication.
393
+
394
+ Configured commands run with current account permissions; the CLI is not a sandbox.
395
+ Review settings, use native harness controls and choose safe environments.
396
+
397
+ Context selection avoids unnecessary reading; no universal cost or generated-code improvement is claimed.
398
+ Interactive adapter compatibility must be checked against the actual tool versions in use.
399
+
400
+ ## License
401
+
402
+ [MIT](LICENSE).