From PWDEV Code — Spec-Driven Development
Write and refine high-quality user stories — INVEST criteria, "As a X, I want Y, so that Z" format, Gherkin acceptance criteria when applicable, definition of ready, anti-patterns, and a review checklist. Use when creating or reviewing user stories, PRD section 6, backlog items, or acceptance criteria. Do NOT use for technical specs, architecture decisions, or task decomposition.
How this skill is triggered — by the user, by Claude, or both
Slash command
/pwdev-code:skill-user-stories**/PRD.md**/prd.md.planning/product/stories/**The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Standard of quality for every user story produced by the PWDEV-CODE framework
Standard of quality for every user story produced by the PWDEV-CODE framework
(/pwdev-code:product prd §6, /pwdev-code:product stories) and for
reviewing stories brought by the human.
PT-BR: Como {persona}, quero {ação}, para {valor/resultado}.
EN: As a {persona}, I want {action}, so that {value/outcome}.
| Letter | Question | Fails when... |
|---|---|---|
| Independent | Can it ship without waiting on another story? | hidden dependency on an unwritten story |
| Negotiable | Is it an intent, not a frozen spec? | prescribes UI pixel/implementation detail |
| Valuable | Does the persona gain something? | value only for developers ("refactor X") |
| Estimable | Can the team size it? | too vague or research-shaped |
| Small | Fits in one iteration? | it's an epic wearing a story costume |
| Testable | Can each AC be verified objectively? | "should be fast/easy/intuitive" |
A story that fails 2+ letters must be rewritten or split before entering
.planning/product/stories/.
Use Gherkin when behavior has state + trigger + observable result:
# PT-BR # EN
Dado que estou logado como cliente Given I am logged in as a customer
Quando adiciono um item esgotado When I add an out-of-stock item
Então vejo a mensagem "indisponível" Then I see the "unavailable" message
E o item não entra no carrinho And the item is not added to the cart
Use a simple checklist for cross-cutting or static criteria (e.g. "- [ ] lista pagina de 20 em 20", "- [ ] AA contrast on all states").
Rules: every AC is objectively verifiable; cover the happy path AND at least one error/edge path; 3-8 ACs per story (more → split the story).
A story is status: ready only when:
| Never write | Why | Instead |
|---|---|---|
| "Como sistema, quero..." | systems don't want things | name the persona who benefits |
| Technical story disguised ("Como dev, quero migrar o banco") | no user value stated | attach it to the user outcome, or make it a task in a plan |
| AC "deve ser rápido/fácil/intuitivo" | not testable | number it ("responde em <500ms", "máx 2 cliques") |
| Story-epic ("Como cliente, quero gerenciar meu pedido") | not Small | split per capability (ver, cancelar, alterar) |
| Hidden dependency ("...igual à tela de admin") | not Independent | declare the dependency or inline the requirement |
| UI prescription ("quero um dropdown azul...") | not Negotiable | state the need; design decides the control |
lang (terms técnicos em inglês)?US-03 — Cancelar pedido não enviado Como cliente, quero cancelar um pedido que ainda não foi enviado, para não pagar por algo que não quero mais. ACs: Dado pedido "processando" / Quando clico Cancelar e confirmo / Então status vira "cancelado" E estorno é criado E recebo e-mail. + Dado pedido "enviado" / Quando abro o pedido / Então Cancelar não é exibido.
US-07 — Export report as CSV As an operations analyst, I want to export the monthly report as CSV, so that I can cross it with the ERP spreadsheet. ACs: Given a report with data / When I click Export / Then a CSV downloads with the visible columns and filters applied. Given an empty report / Then Export is disabled with a tooltip.
"Como usuário, quero uma tela de pedidos melhor."— persona genérica, não testável, não estimável. → "Como cliente recorrente, quero filtrar meus pedidos por status e período, para encontrar uma compra antiga sem rolar a lista inteira."
"As a system, I want to validate tokens."— system persona, technical. → "As a logged-in user, I want my session to stay valid while I work, so that I don't lose a form to a silent logout." (token validation becomes a task under this story's plan)
/pwdev-code:product prd §6 (User Stories with ACs) MUST follow this skill./pwdev-code:product stories uses this skill as the quality bar and
persists stories to .planning/product/stories/US-{NN}-{slug}.md.discover/design consult existing stories as requirement sources.id, epic (roadmap ref, if any),
priority (MoSCoW), status: draft|ready.npx claudepluginhub pwdev-solucoes/pwdev-claude-marketplace --plugin pwdev-codeCreates structured, bite-sized implementation plans from specs or requirements before writing code. Useful for breaking down multi-step tasks into testable steps with file structure and task boundaries.