In the first response of this skill, start with this line, only once:
sdd-build v1.0.0 · out/2026 · versão atual: https://github.com/robertodiasduarte/sdd-starter/releases/latest
Execute real implementation. Do not treat Build as the generation of an isolated document.
Summary flow
- Receive Brainstorm, Define, and Design.
- Confirm writable access to the project/code.
- Extract requirements, Verify Gate,
LLM Promptsand File Manifest. - Validate consistency between the three artifacts and the actual state of the project.
- Create a task plan ordered by dependencies.
- Recommend an execution mode and ask for the user's decision before the first change.
- Ask about pre-build external review when the case justifies it and the capability exists.
- Execute each task surgically, with incremental verification.
- Apply drift detection and the LLM prompt gate when necessary.
- Use the retry ladder on failures.
- Run the DEFINE Verify Gate as a blocking gate.
- Run complementary checks configured in the project.
- Ask about post-build external review when the case justifies it and the capability exists.
- Generate the BUILD_REPORT using assets/BUILD_REPORT_TEMPLATE.md.
- Validate the report with
python scripts/validate_build_report.py <BUILD_REPORT.md>. - Close a complete build only with
Execute o **SDD Handoff by RDD**.
Read references/build-protocol.md at the start of execution. Read references/execution-modes.md when selecting the mode. Use assets/PROGRESS_TEMPLATE.md if the user chooses Ralph. Use assets/WORKER_BRIEF_TEMPLATE.md if the user chooses Briefs. Read references/verify-gate.md before the final gate. Read references/llm-prompt-gate.md only when there is a sign of LLM/prompt runtime. Read references/retry-and-advisor.md when there is repeated failure or formal external review.
Required inputs
Require:
BRAINSTORM_{FEATURE}.md;DEFINE_{FEATURE}.md;DESIGN_{FEATURE}.md;- writable project/code corresponding to the feature.
Read the three documents in full before editing code.
If the project is not accessible, ask the user to provide/connect it. Do not fake a complete Build only from the specification files.
Optional inputs:
UX_REVIEW_{FEATURE}.md;- project guidance (
README, guidance, conventions, config); sdd.config.yaml;- real lint/test/typecheck/build commands;
- agent/subagent tools;
- external review tool;
- human receipt from
manual-ux.
Authority hierarchy
For behavior and acceptance:
- most recent explicit user response;
- DEFINE;
- DESIGN;
- Brainstorm.
For technical implementation:
- DESIGN;
- real project code and patterns;
- DEFINE;
- Brainstorm.
Use Brainstorm as protection against intent drift and against reintroduction of items cut by YAGNI.
Never silently change a requirement, architecture, or contract to “make it pass.” If the implementation requires a specification change, stop the affected task and ask the user.
1. Load and cross-reference context
Extract from Brainstorm:
- original intent;
- chosen approach;
- rejected alternatives;
- YAGNI;
- limitations and dependencies.
Extract from DEFINE:
- MUST/SHOULD/COULD;
- Success Criteria;
- Acceptance Tests;
- Out of Scope;
- Constraints;
- Verify Gate;
LLM Prompts: true|false.
Extract from DESIGN:
- architecture;
- components;
- Key Decisions;
- File Manifest;
- Code Patterns;
- LLM Prompt Inventory when applicable;
- Data Flow;
- Integration Points;
- Testing Strategy;
- Error Handling;
- Configuration;
- Security;
- Observability;
- Requirements Traceability.
If LLM Prompts: true in DEFINE and DESIGN does not have ## LLM Prompts, stop and request a Design correction.
If LLM Prompts: false and DESIGN has a prompt inventory, stop and resolve the divergence.
If the File Manifest is absent/incomplete, stop and correct the Design before implementing.
2. Inspect the project
Before any writing:
- locate the project root;
- read relevant guidance/conventions;
- check version control status when available;
- identify the current branch when Git exists;
- read the files that will be modified;
- locate direct dependencies cited in the manifest;
- identify existing real validation commands;
- confirm that the DESIGN paths still correspond to the project.
If Git is available:
- do not work directly on the deployment/default branch when a feature branch policy exists;
- create or use an appropriate branch before editing;
- do not invent commits/SHAs.
If Git is not available:
- continue only if the project can be edited safely;
- record in the report that branch/commit attribution was not available.
3. Compile the Build plan
Convert the File Manifest into tasks.
For each task, record internally:
- manifest id;
- path;
- action;
- purpose;
- dependencies;
- relevant acceptance criteria;
- incremental verification command;
- security surface?;
- LLM prompt item?;
- owner/executor.
Sort by dependencies. Do not start a task with an incomplete dependency.
If there is a path collision between tasks, run them sequentially.
4. Select mode with the user
Read references/execution-modes.md.
Before the first change:
- measure the case signals;
- recommend a mode;
- present the recommendation first and justify it with concrete signals;
- ask the user to choose.
Modes:
default: sequential loop in the current context;ralph: a clean context per task, if the environment supports re-execution/subagents;briefs: experimental, stateless workers per wave, if the environment supports parallelism.
Never offer a mode that the active platform cannot execute.
If ralph/briefs are not available, explain this in the question and recommend default.
Record in BUILD_REPORT:
- signals;
- recommendation;
- user decision;
- platform unavailabilities, if any.
5. Decide pre-build review
A formal external review is optional and depends on the available tool/capability.
Recommend yes when:
- new architecture with 3+ files;
- security surface;
- public/cached route;
- critical contract change.
Recommend no for a trivial adjustment of 1–2 files without a contract change.
The decision belongs to the user.
If the external capability does not exist, do not fake a review; record Not available.
If a formal review occurs, apply references/retry-and-advisor.md and record every note as APPLIED or REBUTTED.
6. Execute each task
Follow five invariants:
- Assumption becomes a question: material ambiguity → ask.
- Simplicity: nothing beyond what the manifest requires.
- Surgical change: do not refactor adjacent code without need.
- Criterion before code: know how to verify before writing.
- Evidence: do not declare success without running the verification.
For each item:
- re-read the minimum necessary context;
- run drift detection;
- run prompt gate if applicable;
- create/modify/delete only the planned path;
- preserve existing style and abstractions;
- run incremental verification;
- capture command, exit code and relevant output;
- mark task complete only with evidence.
Do not leave TODO/FIXME as a substitute for a requirement.
7. Drift detection
Run before each item.
Ask:
- does the path or content introduce an uninventoried runtime prompt/LLM?
- does the implementation require an unforeseen file?
- does the necessary code change an architectural decision?
- does a requirement outside of scope appear?
- is an item removed by YAGNI being reintroduced?
- does a real project contract contradict the DESIGN?
If there is drift:
- stop the affected task;
- explain the divergence;
- offer options to the user;
- update the specification first when the change is material;
- record the event in BUILD_REPORT.
Never silently "accommodate" drift in the code.
8. LLM prompt gate
Read references/llm-prompt-gate.md when:
LLM Prompts: true; or- drift detection finds runtime prompt/LLM.
Do not invent provider, model, final prompt, or output schema that the Design should have already settled.
If the DESIGN requires a prompt engineering skill or loop-specification and it is not available:
- do not improvise the prompt;
- ask/record the dependency;
- block only the affected LLM items.
9. Retry ladder
On verification failure of a task, use references/retry-and-advisor.md:
- first failure: fix in the same context if it is a local/trivial error;
- second failure: rerun as a fresh task, without carrying over the previous hypothesis, using only the criterion that failed + error + necessary inputs;
- third failure: stop and record a blocker; do not work around the criterion.
If the platform does not support fresh rerun:
- simulate the FIX brief with minimal context;
- declare the limitation;
- do not pretend that a new context was created.
10. Verify incrementally
Use the real command most specific to the task, for example:
- corresponding unit test;
- module typecheck;
- file lint;
- import/compile check;
- local smoke.
Do not invent a command. If no command exists, derive an observable method only when supported by the project/Design; otherwise ask.
Record the result per task.
11. Run blocking Verify Gate
Read references/verify-gate.md.
The DEFINE Verify Gate is the authority.
Prefer the project runner (scripts/verify-gate.sh <DEFINE>) when it exists and matches the protocol.
Otherwise, run the cmd of the gate only if it is a real, safe, and available command.
Interpret:
0: green → proceed;2: red → Build cannot be completed; fix the code and repeat;3: inconclusive → resolve tool/infra; do not mark green;4: manual-ux → show checklist and wait for human receipt;5: pending clarification → return to the user/spec; do not treat as a bug;64: missing/malformed gate → invalid DEFINE.
Never declare success with 2, 3, 5 or 64.
With 4, require in the report: who validated, date and result.
12. Complementary checks
After the gate, run when configured:
- lint;
- typecheck;
- relevant test suite;
- build/compile;
- smoke not covered by the gate.
These checks complement; they do not replace the Verify Gate.
If a complementary check fails, the Build remains incomplete until resolution or an explicit blocker.
13. Post-build review
When an external tool is available, recommend a post-build review if:
- security was changed;
- a public/cached route was changed;
- cross-file logic is subtle;
- ralph/briefs mode was used.
Do not recommend for a trivial fix.
If there are findings:
- verify HIGH/MED in the code before accepting;
- record each note as APPLIED/REBUTTED;
- after a HIGH is applied, repeat the Verify Gate.
14. Generate BUILD_REPORT
Use assets/BUILD_REPORT_TEMPLATE.md as the sole structural source of the report.
The report must be based on executed evidence, not estimates presented as facts.
Include:
- metadata and sources;
- Mode Selection;
- summary;
- task execution;
- files created/modified/deleted;
- prompts generated/refactored when applicable;
- drift;
- Verification Results;
- Verify Gate receipt;
- Acceptance Test Verification;
- Advisor Ledger when there was a review;
- issues/deviations/blockers;
- Final Status.
If the Build is blocked:
- use
Status: Blocked; - do not insert the Release handoff as if it were complete;
- indicate the action needed to unblock.
If complete:
- use
Status: Complete; - Final Status
COMPLETE; - insert the standard final section.
15. Validate BUILD_REPORT
Run:
python scripts/validate_build_report.py <caminho-do-BUILD_REPORT.md>
The script validates the report's structure and basic consistency.
Fix failures before delivering.
16. Save outputs
Code:
- in the File Manifest paths.
Report:
Where to save. Write to sdd/ at the project root — a visible folder, the same in any agent. If the project already has .claude/sdd/, continue in it. The documents from the five phases sit side by side, without subfolders.
- save as
sdd/BUILD_REPORT_{FEATURE}.md; - when the project already uses
.claude/sdd/(including withreports/), follow the existing structure.
Do not overwrite a historical artifact without informing the user.
Completion quality gate
Before declaring Build complete:
- Brainstorm read.
- DEFINE read.
- DESIGN read.
- Real project accessible and changed.
- Mode chosen by the user and recorded.
- All File Manifest items handled.
- No changes outside the manifest without an explicit decision.
- Drift recorded.
- Incremental verification executed with evidence.
- Retry ladder respected.
-
LLM Prompts=truehas a receipt for each inventory item. - Security items were not delegated to a cheap worker.
- Verify Gate is in
0, or4with human receipt. - Applicable complementary checks pass.
- Acceptance Tests have evidence.
- Advisor findings, when they exist, have APPLIED/REBUTTED.
- There is no TODO/FIXME used as a pending implementation.
- BUILD_REPORT was generated by the asset.
-
validate_build_report.pypasses. - Complete Next Step contains only
Execute o **SDD Handoff by RDD**.
Complete Build handoff
The last section of the complete BUILD_REPORT must be exactly:
## Next Step
Execute o **SDD Handoff by RDD**.
Do not add a slash command, path, upload instruction, mention of GPT/Skill, or parallel task after this text.
Part of SDD Open by RDD — https://github.com/robertodiasduarte/sdd-open