Install
openclaw skills install @afonsoft/write-specsUse when the user needs to create or refine a feature SPEC SDD before implementation.
openclaw skills install @afonsoft/write-specsInterview the user relentlessly in Portuguese (pt-BR) until a shared understanding is reached, then write a complete SPEC SDD (Spec-Driven Development document) in .specs/SPEC-{YYYYMMDD}-{feature}.md. The SPEC becomes the single source of truth before any implementation.
All questions directed at the user must be in Portuguese. This skill itself and internal reasoning are written in English.
The user asks for a new feature, change, bugfix, or refactor.
A request is ambiguous, underspecified, or needs clarification.
Before any implementation begins.
The existing SPEC is outdated and needs refinement.
User asks or mentions this skill in English (e.g., "use /write-specs", "run write-specs").
O usuário pede ou menciona esta skill em português (ex.: "use /write-specs", "execute write-specs").
/execute-specs, etc.).[A DEFINIR] in the SPEC.Map the request as a design tree: every decision branches into the decisions that depend on it.
Work the tree in rounds. Ask the whole frontier in one round, then wait for the user's answers before the next round. A question whose answer depends on another still-open question belongs to a later round. The session is done when the frontier is empty.
Every round is addressed to the user and must be in Portuguese:
❓ **Q1** - **<titulo da pergunta em pt-BR>**: <corpo da pergunta em pt-BR>
➡️ <sua resposta recomendada em pt-BR>
---
❓ **Q2** - **<titulo da pergunta em pt-BR>**: <corpo da pergunta em pt-BR>
➡️ <sua resposta recomendada em pt-BR>
Always include a recommended answer. This accelerates convergence and tests whether the user agrees.
Ask at least one round covering each category. You do not need to ask every question — only the ones relevant to the frontier.
Feature | Bugfix | Refactor | API | Infra | Frontend | Docs?Vamos consolidar o escopo antes de seguir. Aqui estao as perguntas que preciso que voce confirme:
❓ **Q1** - **Nome da funcionalidade**: Qual nome curto voce quer usar para essa feature? (ex: `notificacao-push`, `relatorio-mensal`)
➡️ Meu palpite: `notificacao-push`
---
❓ **Q2** - **Tipo de entrega**: Isso e uma Feature nova, Refactor, Bugfix, API ou Infra?
➡️ Meu palpite: `Feature`
---
❓ **Q3** - **Stack afetada**: Qual linguagem/framework principal sera alterado? (ex: .NET 8, Next.js 14, Python 3.12)
➡️ Meu palpite: `Next.js 14`
---
❓ **Q4** - **Fora de escopo**: O que NAO devemos incluir nessa entrega? Liste 2-3 itens explicitamente.
➡️ Meu palpite: painel administrativo, configuracao de templates, mobile nativo
Finding facts is the agent's job, never the user's. When a frontier question needs a fact from the environment (file system, tools, docs, code), dispatch a sub-agent to find it. Do not ask the user for anything you could look up yourself. Do not block: a running exploration is an unsettled prerequisite, so only the questions downstream of it wait for the sub-agent to report; ask the rest of the frontier now.
Once the design tree is settled, create .specs/SPEC-{YYYYMMDD}-{feature}.md by filling the template in references/spec-sdd-template.md. The parent agent must read the SPEC and wait for user approval before implementation.
The SPEC must include all sections 0-9:
Use [A DEFINIR] only when the user explicitly declines to answer. The goal is no more than three [A DEFINIR] items; if there are more, the design tree is not done.
Status: Draft.Status: Approved.Status = Approved may implementation begin. Do not write implementation code.Whenever a GitHub Issue is linked to the SPEC — already existing (via the Ticket field or a title search) or created through create-issues — keep its labels in sync with the SPEC state, per the Label Contract in create-issues:
Draft: ensure the Issue carries its kind label plus the backlog status label.
Type: Bugfix → bug; Feature, Frontend, API, Infra, Refactor, Docs → feature; an Issue that tracks an Epic → epic.Draft, create it with kind label + backlog.Status: Approved): swap the status label backlog → todo on the existing Issue, or create the Issue directly with kind label + todo.Status labels are mutually exclusive — always remove the previous status label when applying the next:
gh issue edit <number> --remove-label backlog --add-label todo
If gh is unavailable or unauthenticated, report it and continue without label sync — never block the SPEC on label management.
After the SPEC is approved, always ask the user — in Portuguese — whether to open a GitHub Issue for it using the create-issues skill. The recommended answer is yes (default):
❓ **Q-final** - **Issue no GitHub**: Deseja que eu abra uma Issue no GitHub para esta SPEC usando a skill `create-issues`?
➡️ Meu palpite: `Sim`
create-issues to create the Issue from the approved .specs/SPEC-*.md — it is created with its kind label plus todo (the SPEC is already Approved). Capture the returned issue number/URL and update the Ticket field in section 0 of the SPEC with the issue reference (e.g., #123 plus the issue link). Then report the created Issue number and link back to the user.Draft phase: do not create a duplicate — just swap backlog → todo and ensure Ticket points to it.Ticket as is and finish.gh not authenticated or no remote), report it and finish without creating the Issue — do not mark the SPEC as tracked..specs/SPEC-{YYYYMMDD}-{feature}.md.Ticket in section 0 was updated with the issue number/link.Draft, it carries its kind label + backlog.backlog → todo (or the Issue was created with todo).| Mistake | Fix |
|---|---|
| Asking questions in English | Always address the user in Portuguese. |
| Implementing before approval | Stop at the SPEC. Implementation is a separate step. |
| Filling gaps with guesses | Use [A DEFINIR] or ask the user. |
| Skipping the design tree | Build the tree in rounds to avoid hidden assumptions. |
| Writing a SPEC without user confirmation | The user must explicitly approve. |
| Ending without asking about the GitHub Issue | Always ask after approval, with yes as the recommended answer. |
Creating the Issue but leaving Ticket empty | Update section 0 with the issue number/link right after gh issue create returns. |
Leaving backlog on an approved SPEC's Issue | Swap backlog → todo the moment Status becomes Approved. |
Stacking backlog and todo | Status labels are exclusive — remove the old one when adding the next. |
references/spec-sdd-template.md — full SDD templatecreate-issues — invoked at the end of the flow (with user consent) to open a GitHub Issue from the approved SPECorchestrator — for the full agentic workflow