Loading...
Loading...
Generate a design document (design proposal) from a PRD, following the style of Go's official design proposals — structured with Abstract / Background / Design / Rationale / Compatibility / Implementation sections, with a strong focus on the 'why' behind decisions and tradeoffs. Trigger keywords: to-design, prd-to-design, PRD to design document, generate design document, write design document, design doc, design proposal, design proposal, technical design document.
npx skill4agent add smallnest/goal-workflow to-designprd-to-specThe design philosophy is derived from the analysis of 5 official Go proposals (generics / error wrapping / loopvar / slog / try). Core belief: The value of a document does not depend on whether the proposal is accepted, but on whether it enables discussions to be grounded in the same set of facts and tradeoffs.
/prd-to-specto-designprd-to-specProvide the PRD (or idea) to design from:
A. File path (e.g., tasks/prd-priority-system.md)
B. GitHub Issue URL
C. Paste content directly
D. Just describe the idea — I'll design from the conversationDesign decisions to settle before I write the doc:
1. Where does this logic live?
A. Extend the existing X
B. New standalone component Y
C. Let me recommend based on the codebase
2. Is this a breaking change for existing callers?
A. Yes — needs a migration path
B. No — purely additive
C. Unsure — I'll analyze and flag it
3. What's the one promise this design must keep? (e.g. backward compatibility,
latency budget, no new dependencies)Title: <A one-sentence statement of "what to do" — the title is a conclusion, not a noun phrase>
Author(s): <Author(s)>
Last updated: <YYYY-MM-DD>
Discussion at <issue / PR / document link> # Keep the document connected, always attach an entry for discussions
Status: Draft | Under review | Accepted | Rejected
## Abstract / Abstract
A single paragraph summarizing the entire document: what to do, how to do it roughly, and **the most critical promise** (e.g., "backward compatibility", "no new dependencies").
Readers should grasp the full picture after this paragraph. Embed implicit core constraints here.
## Background / Background & Motivation
Use **specific, tangible examples** to explain "where the pain lies" instead of abstractly stating "the current state is bad".
- Paste a snippet of real buggy code / awkward usage if possible. First make readers "feel the pain".
- Quantify pain points (frequency of occurrence, number of pitfalls, losses) instead of using vague adjectives.
- Qualify the problem in one sentence.
## Design / Proposal / Design
The main body of the document. Follow three rules:
- **Progressive teaching from simple to complex**: Start with the smallest example, leave complex scenarios until readers have an intuition.
- **Triad of declaration + example + boundary**: For each API/interface, first provide the declaration, then a usage snippet, then clarify the applicable boundaries.
- **Before vs after transformation comparison**: Display side-by-side to show benefits whenever possible.
Never use a paragraph of text when a runnable code snippet can explain it clearly.
## Rationale / Rationale & Tradeoffs
> Rationale = The argument for "why this solution, not others". This is the key section that distinguishes good documents from mediocre ones.
- Explain the motivation behind key decisions.
- **Proactively list rejected alternatives + reasons for rejection** ("We did not choose X because Y"). This is more credible than unilaterally justifying your chosen solution, and prevents repeated discussions by future teams.
- Address foreseeable objections.
## Compatibility / Compatibility
For any breaking changes, you must respond directly.
- Is this a breaking change? **State it clearly upfront**.
- What are the costs (performance, behavior changes, migration costs)? **List them honestly**, no hiding.
- Gradual migration paths (opt-in by module/file, canary releases, feature flags).
- It's better to have precedents ("A similar change was made in a certain system with unremarkable results").
## Implementation / Transition / Implementation & Transition
- How to implement it, in what steps, and supporting tools.
- **Use data and tools to support "feasibility"**: Measured failure rates, canary release results, automated migration tools are more convincing than any "we believe risks are controllable".
- Transition plans to maintain compatibility with old versions (e.g., independently released compatibility libraries).
## Appendix / Appendix (Optional)
Move details that would interrupt the main narrative to the end: complete APIs, end-to-end examples, FAQs.
FAQs specifically address high-frequency questions ("Why this name?", "Why not use the approach of a certain language?", "How is this different from X?").Legacy code is unaffected, compilation results are identical to beforeCompatibilityThe design document has been generated. Please focus on these sections:
- Rationale: Are the rejected alternatives and their reasons valid? Are there any missing alternatives?
- Compatibility: Are the breaking changes and costs stated honestly? Is the migration path feasible?
- Background: Are pain points explained with specific examples instead of adjectives?
- Writing style: Are the titles conclusions rather than noun phrases? Is there any subject-less passive voice?
Reply "OK" to save, or provide revision suggestions.Where to save the design document?
A. tasks/design-[feature-name].md (Next to the PRD, recommended)
B. docs/design/[feature-name].md
C. Custom path: [Specify]| PRD Section | Design Doc Section | Transformation Method |
|---|---|---|
| Problem / Background | Background | Find real pain point code/scenarios and quantify them |
| Goals / Objectives | Abstract + Background | Refine into the "most critical promise" and embed it in the abstract |
| User Stories / Requirements | Design | Convert into progressive design examples |
| Technical Considerations | Design + Rationale | Constraints → Design decisions + tradeoff arguments |
| Non-Goals | Rationale | Write as "We did not do X because Y" |
| Risks / Risks | Compatibility + Implementation | Risks → Compatibility costs + migration/canary release plans |
| Implicit Alternatives | Rationale | Explicitly list and explain why they were rejected |
| Scenario | Handling |
|---|---|
| Vague or incomplete PRD | Ask more questions in Step 3, and record missing items in Open Questions / Assumptions |
| No real pain point code to reference | Replace with the smallest credible sample code and note that it is constructed |
| No alternatives to write | Force yourself to think "What is the most naive approach and why is it insufficient?" — there is always a rejected baseline |
| Non-breaking change | Compatibility section can simply state "Purely additive, no breaking changes" without unnecessary elaboration |
| Proposal is ultimately rejected | Still write the document well — recording "why this path didn't work" is a high-value product in itself; mark Status as Rejected |
| Feature is too large | Split into multiple design docs (by boundaries) and link them to each other |
| User only needs implementation contract | Prompt to use |
/prd → /to-design → /prd-to-spec → /goal → /review-it → /ship-it
│ │ │ │
│ Requirements(what) │ Decisions & Tradeoffs │ Implementation Contract(how) │ Coding
│ │ (why/which) │The ultimate goal of writing a design document is not "to convince others to agree with you", but "to enable everyone to make decisions based on the same set of facts and tradeoffs."