# Technical Spec Writer

> Writes technical specifications that bridge requirements and implementation: screen designs, API designs, database designs, and sequence and state transition di

- Skill: `dini-2000/technical-spec-writer-2` (Agent Skill, multi-file: 8 files)
- Install (CLI): `npx get-skill add dini-2000/technical-spec-writer-2`
- Raw SKILL.md: https://api.skillmd.com/api/skills/dini-2000/technical-spec-writer-2/raw
- Safety review: pending
- Works with: any agent that reads SKILL.md (Claude Code, Claude.ai, Cursor, Codex, Windsurf, 60+ more)
- Category: Coding & Dev Tools
- Author: dini-2000 (https://skillmd.com/u/dini-2000)
- Updated: 2026-12-01
- Page: https://skillmd.com/skills/dini-2000/technical-spec-writer-2

---

---
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.
disable-model-invocation: true
---
# 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.

1. **Receive input** — Accept BRD, user stories, verbal requirements, or existing partial specs
2. **Determine document scope** — Classify the requested output:
   - Full functional specification
   - Screen design specification
   - API design specification
   - Database design specification
   - Individual diagram
3. **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
4. **Establish traceability** — Build a REQ-xxx to SCR/API/TBL mapping table to ensure every requirement is addressed
5. **Confirm scope with user** — Present the outline and confirm before proceeding
6. **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.

1. **Assign SCR-IDs** — Number each screen sequentially (SCR-001, SCR-002, ...)
2. **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 | — | — |

3. **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 |

4. **Create screen transition diagram** — Use Mermaid `stateDiagram-v2` to visualize navigation flow
5. **Add responsive breakpoint notes** — Document layout changes at standard breakpoints (mobile 375px, tablet 768px, desktop 1024px+)
6. **Reference** `references/mermaid_diagram_patterns.md` for diagram syntax
7. **Output** using `assets/functional_spec_template_en.md`

### Workflow 3: API Design Specification

**Purpose**: Produce REST API specifications with endpoints, schemas, and sequence diagrams.

1. **Assign API-IDs** — Number each endpoint sequentially (API-001, API-002, ...)
2. **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
3. **Provide request/response JSON examples** — Include realistic sample data
4. **Standardize error codes** — Use the error envelope pattern from `references/api_design_guide.md`
5. **Create sequence diagrams** — For multi-service or complex flows, produce Mermaid `sequenceDiagram`
6. **Load** `references/api_design_guide.md` for REST conventions
7. **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.

1. **Assign TBL-IDs** — Number each table sequentially (TBL-001, TBL-002, ...)
2. **Define column definition table** for each table:

   | Column Name | Data Type | Nullable | Default | Description | Constraints |
   |------------|-----------|----------|---------|-------------|-------------|
   | id | BIGINT | NO | AUTO_INCREMENT | Primary key | PK |

3. **Create ER diagram** — Use Mermaid `erDiagram` to visualize relationships
4. **Define index table** — Document all indexes with type, columns, and purpose
5. **Include audit columns** — Ensure every table has: `created_at`, `updated_at`, `created_by`, `updated_by`
6. **Add soft delete support** where appropriate — `deleted_at` column
7. **Load** `references/db_design_guide.md` for naming conventions and normalization guidance
8. **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.

1. **Identify participants** — Categorize actors:
   - Actor (user)
   - Frontend (browser/app)
   - Backend (API server)
   - Database
   - External API / Third-party services
2. **Map message flow** — Document request/response patterns for the target scenario
3. **Add conditional branches** — Use `alt`, `opt`, `loop` fragments as needed
4. **Add notes and activations** — Clarify processing steps and active lifelines
5. **Output** Mermaid `sequenceDiagram` code block
6. **Reference** `references/mermaid_diagram_patterns.md` for syntax patterns

### Workflow 6: State Transition Diagram Creation

**Purpose**: Produce state machines for entities with lifecycle behavior.

1. **Build state inventory table**:

   | State ID | Name | Description | Entry Condition | Exit Condition |
   |----------|------|-------------|----------------|----------------|
   | STS-001 | Draft | Initial state | Record created | Submit action |

2. **Build transition table**:

   | From State | Event/Trigger | Guard Condition | Action | To State |
   |-----------|--------------|----------------|--------|----------|
   | Draft | Submit | All required fields filled | Validate & save | Pending Review |

3. **Create state transition matrix** — States as rows, events as columns, target state in cells
4. **Output** Mermaid `stateDiagram-v2` code block
5. **Reference** `references/mermaid_diagram_patterns.md` for state diagram syntax

### Workflow 7: Document Assembly

**Purpose**: Assemble individual sections into a complete specification document.

1. **Generate table of contents** — Auto-generate from section headers
2. **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
3. **Quality checklist** — Verify the document meets IEEE 830 criteria:
   - [ ] Completeness — All requirements addressed
   - [ ] Consistency — No contradictions between sections
   - [ ] Traceability — Bidirectional mapping maintained
   - [ ] Unambiguity — No vague language ("appropriate", "etc.", "as needed")
   - [ ] Verifiability — Each requirement can be tested
   - [ ] Modifiability — Modular structure with clear cross-references
4. **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`
5. **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
```

