/powertools:writing-design-documentsfrom powertools
Write technical design documents that bridge use cases and code — specifying use case implementations, data models, APIs, and architectural decisions.
Ships in powertools. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
A template for technical design documents that bridge use cases (what the system does) and code (how it's built). A design document specifies the internal structure — components, data models, APIs, and their interactions — needed to implement one or more use cases.
Use cases describe system behavior from the outside. The system is a black box: actors act, the system responds. Use cases answer what does the system do?
Design documents answer how does the system do it? They open the box and specify the components, data models, APIs, and interactions that deliver the behavior use cases define.
Every design document should trace back to one or more use cases. If no use case justifies a design element, that element is speculative.
Every design document contains these sections in order:
A Use Case Implementation is a sequence diagram showing how internal components collaborate to fulfill a use case. It is the central artifact of a design document — the bridge between a black-box Flow and the code that delivers it.
Each Use Case Implementation:
Use Case Implementations mirror the use case hierarchy:
| Use Case Level | Implementation Type | Purpose |
|---|---|---|
| Flow (F-XX) | End-to-end implementation | Shows the full interaction across all components for a complete actor goal |
| Operation (O-XX) | Focused implementation | Shows the internal mechanics of a single reusable operation |
An end-to-end implementation for a Flow may reference Operations inline (as labeled steps) or point to their separate focused implementations for detail.
Write a Use Case Implementation for every Flow. Write a separate focused implementation for an Operation when its internals involve multiple components or non-obvious interactions. Simple Operations — single service call, transform, return — need no diagram.
rect blocks to group logical phases. Add note annotations for side effects (storing tokens, logging events) that produce no response arrow.alt or opt block, or as a separate diagram if it would clutter the main one.Entities map the core domain concepts into a class diagram. They represent the business objects the system operates on — independent of any particular database schema or API shape.
Each entity corresponds to a meaningful concept from the use cases. If a use case actor reads, creates, updates, or reasons about something, that thing is likely an entity.
Do not model every use case in the diagram — model the domain. The diagram should be stable across use cases: a new use case should fit the existing entity model rather than force a restructure.
Use Mermaid classDiagram syntax:
Tables map the data model into the database. They persistent structures that support the use case implementations. This section covers new tables, changes to existing tables, and indices.
Define a new table when a Use Case Implementation reads from or writes to persistent storage that does not yet exist. Do not duplicate table definitions from another design document; reference them instead.
Use a standard column definition format:
| Column Name | Type | Constraints | Notes |
|---|---|---|---|
| id | int | pk | |
| name | string | not null | |
| foreign_id | int | not null, fk | References other_table |
Document constraints and relationships inline. Add a note below the table for compound constraints (unique pairs, check constraints) that do not fit in a single cell.
When a Use Case Implementation requires modifications to a table defined elsewhere, list only the new or changed columns. Reference the original design document so readers can find the full definition.
Define indices for each table when query patterns in the Use Case Implementations demand them. Document the index name, columns, and whether it is unique.
Modules show the internal code structure — the interfaces, their implementations, and how data flows between them. Where Use Case Implementations show what happens, Modules show how the code is organized to make it happen.
A module is any coherent unit of code with a defined interface: a service, repository, handler, client, queue consumer, or utility layer.
Use two diagrams:
<<interface>> stereotype for interface types.Focus on the interfaces that matter for this design document. Do not diagram every class in the codebase.
APIs define the HTTP contracts that Use Case Implementations depend on. Each API entry documents one endpoint — its purpose, request format, and every response the caller may receive.
Define an API when a Use Case Implementation shows an HTTP request between components. The implementation diagram shows that a call happens; the API section specifies exactly what that call looks like.
Each API entry follows this structure:
POST v1/otps)List responses in this order: success first, then client errors (4xx), then server errors (5xx). Name each response subsection descriptively (e.g., "Rate Limit Exceeded Response 429," not "429").
Testing is the most important section of a design document. A feature without a clear test strategy ships with unknown risk. This section answers three questions:
For each use case in this design document:
This section describes how to ship the feature safely. A deployment plan prevents production surprises and gives the team a clear rollback path.
Address each that applies:
This section describes how you will know the feature works after it ships. Without monitoring, you learn about failures from users, not dashboards.
Metrics and logs cost money to ingest. Every metric must tie to a specific Flow or Goal — it should measure the success or failure of that use case. Do not add metrics for internal implementation details, speculative debugging, or "nice to have" visibility. If a metric does not help you answer "is this Flow working?" remove it.
Address each that applies:
Decisions record significant technical choices made during design — choices where alternatives existed and the reasoning matters. They prevent future developers from relitigating settled questions or unknowingly reversing deliberate tradeoffs.
Record a decision when:
Do not record obvious choices or choices with only one viable option.
Use a structured framework to choose between alternatives. Pick the framework that fits the nature of the decision:
binstack skill.fermi-roi skill.If neither framework fits — the decision has a single dominant criterion or is too simple to warrant analysis — state the criterion and the choice directly.
Open questions track unresolved issues that block or could change the design. They make unknowns visible so reviewers can address them and so the team does not ship a design with hidden gaps.
Add a question when:
Each question is a row in a status table:
open, resolved, won't resolveReference open questions from other sections when they affect the design. For example, a Use Case Implementation might note "See Q-03" where behavior depends on an unanswered question.
---
tags: [project], tdd
summary: "[Feature] technical design document"
locked: false
---
# Reviews
| Reviewer | Status | Feedback |
|---|---|---|
| [Name] | Status (not_started,
in_progress, approved, changes_requested) | |
---
# Use Case Implementations
## [Implementation Name] — Implements [F-XX]: [Flow Name]
~~~mermaid
sequenceDiagram
participant A as [Component A]
participant B as [Component B]
participant C as [External Service]
rect rgb(240, 248, 255)
note over A,B: [Phase Name]
A->>B: [Request]
B-->>A: [Response]
end
rect rgb(255, 248, 240)
note over B,C: [Phase Name]
B->>C: [Request]
C-->>B: [Response]
note over B: [Side effect]
end
~~~
## [Operation Implementation Name] — Implements [O-XX]: [Operation Name]
~~~mermaid
sequenceDiagram
participant S as [Component]
participant E as [External Service]
participant L as [Another Service]
S->>E: [Request]
E-->>S: [Response]
S->>L: [Request]
L-->>S: [Response]
note over S: [Processing step]
~~~
---
# Entities
~~~mermaid
classDiagram
class EntityA {
+Type fieldName
+Type fieldName
}
class EntityB {
+Type fieldName
}
EntityA "1" --> "*" EntityB : relationshipName
~~~
---
# Tables
## [table_name]
| Column Name | Type | Constraints | Notes |
|---|---|---|---|
| id | int | pk | |
| [column] | [type] | [constraints] | [notes] |
---
# Modules
~~~mermaid
classDiagram
class InterfaceName {
<<interface>>
+methodName(ParamType) ReturnType
}
class ImplementationName {
+methodName(ParamType) ReturnType
}
InterfaceName <|.. ImplementationName
CallerInterface --> InterfaceName : depends on
~~~
~~~mermaid
flowchart LR
A[ModuleA] -->|DataType| B[ModuleB]
B -->|DataType| C[ModuleC]
~~~
---
# APIs
## [Endpoint Name] `[METHOD] [path]`
[One-line description.]
### Request
- Headers
- content-type: `application/json`
- authorization: `Bearer <jwt>`
- Body
- [resource]: object
- [field]: [type]
### Success Response `[status code]`
- Headers
- content-type: `application/json`
- Body
- [resource]: object
- [field]: [type]
### [Error Name] Response `[status code]`
- Headers
- content-type: `application/json`
- Body
- error: object
- code: int
- message: string
---
# Testing
## Test Coverage
| Use Case | Type | Unit | Integration | E2E |
|---|---|---|---|---|
| [F-XX]: [Name] | Flow | | x | |
| [O-XX]: [Name] | Op | x | | |
## Test Approach
### Unit Tests
[What functions or modules run in isolation. What you mock, what stays real.]
### Integration Tests
[Which component boundaries the tests cross. What infrastructure they need.]
### End-to-End Tests
[Which user-facing flows get full-stack coverage. What the test environment looks like.]
## Test Infrastructure
[Any factories, fixtures, helpers, stub servers, or seed scripts this feature requires. Omit if none.]
---
# Deployment
## Migrations
| Order | Type | Description | Backwards-Compatible |
|---|---|---|---|
| 1 | schema | [Description] | yes/no |
| 2 | data | [Description] | yes/no |
## Deploy Sequence
[Order of operations if multiple services must deploy in sequence. Omit if single deploy.]
## Rollback Plan
[What to do if the deploy fails. Whether code can roll back independently of migrations.]
---
# Monitoring
## Metrics
| Name | Type | Use Case | Description |
|---|---|---|---|
| [metric_name] | counter/histogram/gauge | [F-XX or G-XX] | [What it measures] |
## Alerts
| Condition | Threshold | Severity |
|---|---|---|
| [What triggers it] | [Value] | [page/warn] |
## Dashboards
[New dashboards or panels needed. What they show. Omit if none.]
## Logging
[New structured log fields. Log level and reason. Omit if none.]
---
# Decisions
## [Decision statement]
**Framework:** [Binstack / Fermi ROI / Direct criterion]
[Brief analysis summary. For Binstack: priority stack and materiality results. For Fermi ROI: impact metric, effort brackets, and ROI ranking. For direct criterion: the criterion and why it decided the matter.]
**Choice:** [Winner and why it won, stated in the framework's terms.]
### Alternatives Considered
- **[Alternative]:** [why rejected]
### Documentation
- [Relevant links]
---
# Open Questions
| ID | Question | Status | Resolution |
|---|---|---|---|
| Q-01 | [Specific question] | open | |
---
# Appendix A — Changelog
| Date | Author | Change |
|---|---|---|
| [YYYY-MM-DD] | [Name] | Initial draft |
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub jordangaston/claude-plugins --plugin powertools79 skills in this plugin
/ai-camera-movementsLibrary of 46 camera movement prompt blocks for AI video generation (Seedance, Kling, Veo, Runway, Higgsfield). Use this skill EVERY time the user needs a camera move for a video prompt, asks "what camera movement should I use", wants a dolly/pan/orbit/zoom/crane/drone/tracking/handheld/whip-pan/FPV/snorricam/tilt-shift/earth-zoom prompt, asks to add camera motion to a shot, wants to compare camera moves for a scene, or says "Run Camera" / "camera move for this shot". Also trigger when building shot lists or video prompts with other skills (ai-filmmaking, seedance-prompt-structure, genhq-seedance-2-prompt-builder) and a camera instruction is needed — this skill supplies the camera block./ai-image-promptsTurn a seed idea into a polished AI image-generation prompt using a 6-part structure: [medium], [subject], [action/pose], [environment], [style/vibe], [technical specs]. Use this skill whenever the user wants a prompt for generating an image with any model — Midjourney, DALL-E, Imagen, Nano Banana, Flux, Stable Diffusion, Freepik, or unnamed — or asks to 'write an image prompt,' 'make a prompt for this idea,' 'improve my image prompt,' or gives a rough visual idea ('a red panda barista,' 'cyberpunk samurai in the rain') and wants it image-ready. Also trigger when the user asks why their image prompts produce weak or inconsistent results. Covers any visual medium: photorealistic, digital painting, 3D render, anime, illustration, pixel art, watercolor, concept art, and more.Other plugins' skills for the same job