name: technical-spec-writer
description: >
Writes technical specifications that bridge requirements and implementation: screen designs,
API designs, database designs, and sequence and state transition diagrams in Mermaid, as
specifications that follow IEEE 830 and ISO/IEC/IEEE 29148, with IDs traced back to the
requirements. Use when creating functional specifications, API design documents, database
design documents, screen design specifications, or sequence or state diagrams from
business requirements or user stories.
Technical Spec Writer
Overview
This skill bridges the gap between requirements definition (BRD/User Stories) and implementation by producing structured, standards-compliant technical specification documents. It generates screen designs, API specifications, database designs, sequence diagrams, and state transition diagrams using Mermaid notation, following IEEE 830 and ISO/IEC/IEEE 29148 standards.
When to Use
- Write a technical specification from a requirements definition (BRD)
- Write a screen design specification
- Write an API design specification
- Write a database design specification
- Draw sequence diagrams or state transition diagrams
- Review or improve an existing specification
- Build a traceability matrix from the requirements
Workflows
Workflow 1: Requirements Intake
Purpose: Gather and structure input requirements to determine document scope.
- Receive input — Accept BRD, user stories, verbal requirements, or existing partial specs
- Determine document scope — Classify the requested output:
- Full functional specification
- Screen design specification
- API design specification
- Database design specification
- Individual diagram
- Create document outline — Establish the ID numbering scheme:
- SCR-xxx for screens
- API-xxx for endpoints
- TBL-xxx for tables
- SEQ-xxx for sequence diagrams
- STS-xxx for state diagrams
- Establish traceability — Build a REQ-xxx to SCR/API/TBL mapping table to ensure every requirement is addressed
- Confirm scope with user — Present the outline and confirm before proceeding
- Load
references/spec_writing_standards.md for ID conventions and quality criteria
Workflow 2: Screen Design Specification
Purpose: Produce detailed screen design documents with UI elements, events, and transitions.
Assign SCR-IDs — Number each screen sequentially (SCR-001, SCR-002, ...)
Define UI elements table for each screen:
| Element ID |
Type |
Label |
Validation Rules |
Default Value |
Notes |
| SCR-001-E01 |
text |
User Name |
Required, max 50 chars |
— |
— |
Define event table for each screen:
| Event ID |
Trigger Element |
Event Type |
Action |
Target |
| SCR-001-EV01 |
btn_submit |
click |
POST /api/v1/users |
SCR-002 |
Create screen transition diagram — Use Mermaid stateDiagram-v2 to visualize navigation flow
Add responsive breakpoint notes — Document layout changes at standard breakpoints (mobile 375px, tablet 768px, desktop 1024px+)
Reference references/mermaid_diagram_patterns.md for diagram syntax
Output using assets/functional_spec_template_en.md
Workflow 3: API Design Specification
Purpose: Produce REST API specifications with endpoints, schemas, and sequence diagrams.
- Assign API-IDs — Number each endpoint sequentially (API-001, API-002, ...)
- Define each endpoint:
- HTTP Method and Path
- Description and authentication requirements
- Request parameters, headers, and body (JSON schema)
- Response body (success and error)
- Error codes with business error code mapping
- Provide request/response JSON examples — Include realistic sample data
- Standardize error codes — Use the error envelope pattern from
references/api_design_guide.md
- Create sequence diagrams — For multi-service or complex flows, produce Mermaid
sequenceDiagram
- Load
references/api_design_guide.md for REST conventions
- Output using
assets/api_spec_template.md for per-endpoint detail
Workflow 4: Database Design Specification
Purpose: Produce database design documents with table definitions, ER diagrams, and indexes.
Assign TBL-IDs — Number each table sequentially (TBL-001, TBL-002, ...)
Define column definition table for each table:
| Column Name |
Data Type |
Nullable |
Default |
Description |
Constraints |
| id |
BIGINT |
NO |
AUTO_INCREMENT |
Primary key |
PK |
Create ER diagram — Use Mermaid erDiagram to visualize relationships
Define index table — Document all indexes with type, columns, and purpose
Include audit columns — Ensure every table has: created_at, updated_at, created_by, updated_by
Add soft delete support where appropriate — deleted_at column
Load references/db_design_guide.md for naming conventions and normalization guidance
Output using assets/db_design_template.md for per-table detail
Workflow 5: Sequence Diagram Creation
Purpose: Produce Mermaid sequence diagrams for system interaction flows.
- Identify participants — Categorize actors:
- Actor (user)
- Frontend (browser/app)
- Backend (API server)
- Database
- External API / Third-party services
- Map message flow — Document request/response patterns for the target scenario
- Add conditional branches — Use
alt, opt, loop fragments as needed
- Add notes and activations — Clarify processing steps and active lifelines
- Output Mermaid
sequenceDiagram code block
- Reference
references/mermaid_diagram_patterns.md for syntax patterns
Workflow 6: State Transition Diagram Creation
Purpose: Produce state machines for entities with lifecycle behavior.
Build state inventory table:
| State ID |
Name |
Description |
Entry Condition |
Exit Condition |
| STS-001 |
Draft |
Initial state |
Record created |
Submit action |
Build transition table:
| From State |
Event/Trigger |
Guard Condition |
Action |
To State |
| Draft |
Submit |
All required fields filled |
Validate & save |
Pending Review |
Create state transition matrix — States as rows, events as columns, target state in cells
Output Mermaid stateDiagram-v2 code block
Reference references/mermaid_diagram_patterns.md for state diagram syntax
Workflow 7: Document Assembly
Purpose: Assemble individual sections into a complete specification document.
- Generate table of contents — Auto-generate from section headers
- Cross-reference validation — Verify all IDs are referenced correctly:
- Every REQ-xxx maps to at least one SCR/API/TBL
- Every SCR-xxx event references a valid API-xxx or screen target
- Every API-xxx references valid TBL-xxx tables
- Quality checklist — Verify the document meets IEEE 830 criteria:
- Select output template — Use the appropriate template from
assets/:
- Full spec:
functional_spec_template_en.md
- API only:
api_spec_template.md
- DB only:
db_design_template.md
- Fill template placeholders — Replace all
{PLACEHOLDER} values with actual content
Resources
| File |
Purpose |
When to Load |
references/spec_writing_standards.md |
IEEE 830/ISO 29148 standards, ID conventions, quality criteria |
Workflow 1 (Requirements Intake), Workflow 7 (Document Assembly) |
references/mermaid_diagram_patterns.md |
Mermaid syntax patterns for all diagram types |
Workflow 2, 5, 6 (any diagram creation) |
references/api_design_guide.md |
REST design principles, error formats, pagination |
Workflow 3 (API Design) |
references/db_design_guide.md |
Naming conventions, normalization, index strategy |
Workflow 4 (DB Design) |
assets/functional_spec_template_en.md |
Full functional spec template |
Workflow 2, 7 for full-spec output |
assets/api_spec_template.md |
Per-endpoint API specification template |
Workflow 3, 7 for API-focused output |
assets/db_design_template.md |
Per-table database design template |
Workflow 4, 7 for DB-focused output |
Best Practices
Do's
- Give every design element an ID and keep it traceable to the requirements
- Avoid vague terms ("appropriate", "as needed", "etc.") and write with SHALL/SHOULD/MAY
- Check the cross-references between screens, APIs and the database before output
- Keep Mermaid diagram direction and naming conventions consistent
- Replace every template placeholder
Don'ts
- Don't leave a requirement uncovered (check the traceability matrix)
- Don't mix several concerns in one screen design
- Don't document only an API's success paths and leave out the error cases
- Don't write table definitions without an index strategy
Examples
Example 1: Technical specification for an e-commerce product management screen
User: Please write a technical specification for the product management screens.
Requirements: product CRUD, category management, image upload, inventory management
Claude:
1. [Workflow 1] Requirements intake → assign SCR-001 to SCR-003, API-001 to API-008, TBL-001 to TBL-004
2. [Workflow 2] Screen design → product list (SCR-001), product create/edit (SCR-002), category management (SCR-003)
3. [Workflow 3] API design → GET/POST/PUT/DELETE /api/v1/products, POST /api/v1/images
4. [Workflow 4] DB design → products, categories, product_images and inventory tables, plus an ER diagram
5. [Workflow 7] Assembly → output with functional_spec_template_en.md
Example 2: API design document only
User: Just write the design document for the authentication API. It uses JWT.
Claude:
1. [Workflow 1] Scope: API design only → API-001 to API-003 (login, refresh, logout)
2. [Workflow 3] Detailed design of each endpoint (request, response, errors)
3. [Workflow 5] Sequence diagram of the authentication flow (Client → API → DB → JWT issued)
4. [Workflow 7] Output with api_spec_template.md
1---2name: technical-spec-writer3description: "Writes technical specifications that bridge requirements and implementation: screen designs, API designs, database designs, and sequence and state transition di"4---5---6name: technical-spec-writer7description: >8 Writes technical specifications that bridge requirements and implementation: screen designs,9 API designs, database designs, and sequence and state transition diagrams in Mermaid, as10 specifications that follow IEEE 830 and ISO/IEC/IEEE 29148, with IDs traced back to the11 requirements. Use when creating functional specifications, API design documents, database12 design documents, screen design specifications, or sequence or state diagrams from13 business requirements or user stories.14---1516# Technical Spec Writer1718## Overview1920This skill bridges the gap between requirements definition (BRD/User Stories) and implementation by producing structured, standards-compliant technical specification documents. It generates screen designs, API specifications, database designs, sequence diagrams, and state transition diagrams using Mermaid notation, following IEEE 830 and ISO/IEC/IEEE 29148 standards.2122## When to Use2324- Write a technical specification from a requirements definition (BRD)25- Write a screen design specification26- Write an API design specification27- Write a database design specification28- Draw sequence diagrams or state transition diagrams29- Review or improve an existing specification30- Build a traceability matrix from the requirements3132## Workflows3334### Workflow 1: Requirements Intake3536**Purpose**: Gather and structure input requirements to determine document scope.37381. **Receive input** — Accept BRD, user stories, verbal requirements, or existing partial specs392. **Determine document scope** — Classify the requested output:40 - Full functional specification41 - Screen design specification42 - API design specification43 - Database design specification44 - Individual diagram453. **Create document outline** — Establish the ID numbering scheme:46 - SCR-xxx for screens47 - API-xxx for endpoints48 - TBL-xxx for tables49 - SEQ-xxx for sequence diagrams50 - STS-xxx for state diagrams514. **Establish traceability** — Build a REQ-xxx to SCR/API/TBL mapping table to ensure every requirement is addressed525. **Confirm scope with user** — Present the outline and confirm before proceeding536. **Load** `references/spec_writing_standards.md` for ID conventions and quality criteria5455### Workflow 2: Screen Design Specification5657**Purpose**: Produce detailed screen design documents with UI elements, events, and transitions.58591. **Assign SCR-IDs** — Number each screen sequentially (SCR-001, SCR-002, ...)602. **Define UI elements table** for each screen:6162 | Element ID | Type | Label | Validation Rules | Default Value | Notes |63 |-----------|------|-------|-----------------|--------------|-------|64 | SCR-001-E01 | text | User Name | Required, max 50 chars | — | — |65663. **Define event table** for each screen:6768 | Event ID | Trigger Element | Event Type | Action | Target |69 |----------|----------------|------------|--------|--------|70 | SCR-001-EV01 | btn_submit | click | POST /api/v1/users | SCR-002 |71724. **Create screen transition diagram** — Use Mermaid `stateDiagram-v2` to visualize navigation flow735. **Add responsive breakpoint notes** — Document layout changes at standard breakpoints (mobile 375px, tablet 768px, desktop 1024px+)746. **Reference** `references/mermaid_diagram_patterns.md` for diagram syntax757. **Output** using `assets/functional_spec_template_en.md`7677### Workflow 3: API Design Specification7879**Purpose**: Produce REST API specifications with endpoints, schemas, and sequence diagrams.80811. **Assign API-IDs** — Number each endpoint sequentially (API-001, API-002, ...)822. **Define each endpoint**:83 - HTTP Method and Path84 - Description and authentication requirements85 - Request parameters, headers, and body (JSON schema)86 - Response body (success and error)87 - Error codes with business error code mapping883. **Provide request/response JSON examples** — Include realistic sample data894. **Standardize error codes** — Use the error envelope pattern from `references/api_design_guide.md`905. **Create sequence diagrams** — For multi-service or complex flows, produce Mermaid `sequenceDiagram`916. **Load** `references/api_design_guide.md` for REST conventions927. **Output** using `assets/api_spec_template.md` for per-endpoint detail9394### Workflow 4: Database Design Specification9596**Purpose**: Produce database design documents with table definitions, ER diagrams, and indexes.97981. **Assign TBL-IDs** — Number each table sequentially (TBL-001, TBL-002, ...)992. **Define column definition table** for each table:100101 | Column Name | Data Type | Nullable | Default | Description | Constraints |102 |------------|-----------|----------|---------|-------------|-------------|103 | id | BIGINT | NO | AUTO_INCREMENT | Primary key | PK |1041053. **Create ER diagram** — Use Mermaid `erDiagram` to visualize relationships1064. **Define index table** — Document all indexes with type, columns, and purpose1075. **Include audit columns** — Ensure every table has: `created_at`, `updated_at`, `created_by`, `updated_by`1086. **Add soft delete support** where appropriate — `deleted_at` column1097. **Load** `references/db_design_guide.md` for naming conventions and normalization guidance1108. **Output** using `assets/db_design_template.md` for per-table detail111112### Workflow 5: Sequence Diagram Creation113114**Purpose**: Produce Mermaid sequence diagrams for system interaction flows.1151161. **Identify participants** — Categorize actors:117 - Actor (user)118 - Frontend (browser/app)119 - Backend (API server)120 - Database121 - External API / Third-party services1222. **Map message flow** — Document request/response patterns for the target scenario1233. **Add conditional branches** — Use `alt`, `opt`, `loop` fragments as needed1244. **Add notes and activations** — Clarify processing steps and active lifelines1255. **Output** Mermaid `sequenceDiagram` code block1266. **Reference** `references/mermaid_diagram_patterns.md` for syntax patterns127128### Workflow 6: State Transition Diagram Creation129130**Purpose**: Produce state machines for entities with lifecycle behavior.1311321. **Build state inventory table**:133134 | State ID | Name | Description | Entry Condition | Exit Condition |135 |----------|------|-------------|----------------|----------------|136 | STS-001 | Draft | Initial state | Record created | Submit action |1371382. **Build transition table**:139140 | From State | Event/Trigger | Guard Condition | Action | To State |141 |-----------|--------------|----------------|--------|----------|142 | Draft | Submit | All required fields filled | Validate & save | Pending Review |1431443. **Create state transition matrix** — States as rows, events as columns, target state in cells1454. **Output** Mermaid `stateDiagram-v2` code block1465. **Reference** `references/mermaid_diagram_patterns.md` for state diagram syntax147148### Workflow 7: Document Assembly149150**Purpose**: Assemble individual sections into a complete specification document.1511521. **Generate table of contents** — Auto-generate from section headers1532. **Cross-reference validation** — Verify all IDs are referenced correctly:154 - Every REQ-xxx maps to at least one SCR/API/TBL155 - Every SCR-xxx event references a valid API-xxx or screen target156 - Every API-xxx references valid TBL-xxx tables1573. **Quality checklist** — Verify the document meets IEEE 830 criteria:158 - [ ] Completeness — All requirements addressed159 - [ ] Consistency — No contradictions between sections160 - [ ] Traceability — Bidirectional mapping maintained161 - [ ] Unambiguity — No vague language ("appropriate", "etc.", "as needed")162 - [ ] Verifiability — Each requirement can be tested163 - [ ] Modifiability — Modular structure with clear cross-references1644. **Select output template** — Use the appropriate template from `assets/`:165 - Full spec: `functional_spec_template_en.md`166 - API only: `api_spec_template.md`167 - DB only: `db_design_template.md`1685. **Fill template placeholders** — Replace all `{PLACEHOLDER}` values with actual content169170## Resources171172| File | Purpose | When to Load |173|------|---------|-------------|174| `references/spec_writing_standards.md` | IEEE 830/ISO 29148 standards, ID conventions, quality criteria | Workflow 1 (Requirements Intake), Workflow 7 (Document Assembly) |175| `references/mermaid_diagram_patterns.md` | Mermaid syntax patterns for all diagram types | Workflow 2, 5, 6 (any diagram creation) |176| `references/api_design_guide.md` | REST design principles, error formats, pagination | Workflow 3 (API Design) |177| `references/db_design_guide.md` | Naming conventions, normalization, index strategy | Workflow 4 (DB Design) |178| `assets/functional_spec_template_en.md` | Full functional spec template | Workflow 2, 7 for full-spec output |179| `assets/api_spec_template.md` | Per-endpoint API specification template | Workflow 3, 7 for API-focused output |180| `assets/db_design_template.md` | Per-table database design template | Workflow 4, 7 for DB-focused output |181182---183184## Best Practices185186### Do's187- Give every design element an ID and keep it traceable to the requirements188- Avoid vague terms ("appropriate", "as needed", "etc.") and write with SHALL/SHOULD/MAY189- Check the cross-references between screens, APIs and the database before output190- Keep Mermaid diagram direction and naming conventions consistent191- Replace every template placeholder192193### Don'ts194- Don't leave a requirement uncovered (check the traceability matrix)195- Don't mix several concerns in one screen design196- Don't document only an API's success paths and leave out the error cases197- Don't write table definitions without an index strategy198199---200201## Examples202203### Example 1: Technical specification for an e-commerce product management screen204205```206User: Please write a technical specification for the product management screens.207 Requirements: product CRUD, category management, image upload, inventory management208209Claude:2101. [Workflow 1] Requirements intake → assign SCR-001 to SCR-003, API-001 to API-008, TBL-001 to TBL-0042112. [Workflow 2] Screen design → product list (SCR-001), product create/edit (SCR-002), category management (SCR-003)2123. [Workflow 3] API design → GET/POST/PUT/DELETE /api/v1/products, POST /api/v1/images2134. [Workflow 4] DB design → products, categories, product_images and inventory tables, plus an ER diagram2145. [Workflow 7] Assembly → output with functional_spec_template_en.md215```216217### Example 2: API design document only218219```220User: Just write the design document for the authentication API. It uses JWT.221222Claude:2231. [Workflow 1] Scope: API design only → API-001 to API-003 (login, refresh, logout)2242. [Workflow 3] Detailed design of each endpoint (request, response, errors)2253. [Workflow 5] Sequence diagram of the authentication flow (Client → API → DB → JWT issued)2264. [Workflow 7] Output with api_spec_template.md227```