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
- 要件定義(BRD)から技術仕様書を作成する
- 画面設計書を作成する
- API設計書を作成する
- DB設計書を作成する
- シーケンス図や状態遷移図を作成する
- 既存仕様書のレビューや改善を行う
- 要件からトレーサビリティマトリクスを作成する
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設計書(API design specification)
- DB設計書(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_ja.md or assets/functional_spec_template_en.md
Workflow 3: API Design Specification(API設計)
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(DB設計)
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_ja.md or 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_ja.md |
Full functional spec template (Japanese) |
Workflow 7 when output language is Japanese |
assets/functional_spec_template_en.md |
Full functional spec template (English) |
Workflow 7 when output language is English |
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
- 各設計要素にIDを採番し、要件とのトレーサビリティを維持する
- 曖昧な用語(「適切な」「必要に応じて」「等」)を避け、SHALL/SHOULD/MAYで記述する
- 画面・API・DBの相互参照を検証してから出力する
- Mermaidダイアグラムは方向・命名規則を統一する
- テンプレートのプレースホルダーを一つ残らず置換する
Don'ts
- 要件の取りこぼしを放置しない(トレーサビリティマトリクスで確認)
- 1つの画面設計に複数の関心事を混在させない
- APIの正常系だけ記述してエラー系を省略しない
- インデックス戦略なしにテーブル定義だけ書かない
Examples
例1: ECサイト商品管理画面の技術仕様書
User: 商品管理画面の技術仕様書を作成してください。
要件: 商品CRUD、カテゴリ管理、画像アップロード、在庫管理
Claude:
1. [Workflow 1] 要件取り込み → SCR-001〜003、API-001〜008、TBL-001〜004 を採番
2. [Workflow 2] 画面設計 → 商品一覧(SCR-001)、商品登録/編集(SCR-002)、カテゴリ管理(SCR-003)
3. [Workflow 3] API設計 → GET/POST/PUT/DELETE /api/v1/products、POST /api/v1/images
4. [Workflow 4] DB設計 → products、categories、product_images、inventory テーブル + ER図
5. [Workflow 7] 組み立て → functional_spec_template_ja.md で出力
例2: API設計書のみ作成
User: 認証APIの設計書だけ作ってください。JWT認証です。
Claude:
1. [Workflow 1] スコープ: API設計のみ → API-001〜003(login, refresh, logout)
2. [Workflow 3] 各エンドポイントの詳細設計(リクエスト/レスポンス/エラー)
3. [Workflow 5] 認証フローのシーケンス図(Client → API → DB → JWT発行)
4. [Workflow 7] api_spec_template.md で出力
1---2name: technical-spec-writer3description: 要件定義と実装の間を埋める技術仕様書を体系的に作成するスキル。 画面設計、API設計、DB設計、シーケンス図、状態遷移図をMermaid形式で生成し、 IEEE 830/ISO 29148準拠の仕様書を出力する。Use when creating functional specifications, API design documents, database design documents, screen design specifications, or sequence/state diagrams from requirements. Triggers: "technical specification", "functional spec", "API design", "database design", "screen design", "画面設計書", "API設計書", "DB設計書", "技術仕様書", "シーケンス図", "状態遷移図"4---56# Technical Spec Writer(技術仕様書作成)78## Overview910This 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.1112## When to Use1314- 要件定義(BRD)から技術仕様書を作成する15- 画面設計書を作成する16- API設計書を作成する17- DB設計書を作成する18- シーケンス図や状態遷移図を作成する19- 既存仕様書のレビューや改善を行う20- 要件からトレーサビリティマトリクスを作成する2122## Workflows2324### Workflow 1: Requirements Intake(要件取り込み)2526**Purpose**: Gather and structure input requirements to determine document scope.27281. **Receive input** — Accept BRD, user stories, verbal requirements, or existing partial specs292. **Determine document scope** — Classify the requested output:30 - 全体仕様書(Full functional specification)31 - 画面設計書(Screen design specification)32 - API設計書(API design specification)33 - DB設計書(Database design specification)34 - 個別ダイアグラム(Individual diagram)353. **Create document outline** — Establish the ID numbering scheme:36 - SCR-xxx for screens37 - API-xxx for endpoints38 - TBL-xxx for tables39 - SEQ-xxx for sequence diagrams40 - STS-xxx for state diagrams414. **Establish traceability** — Build a REQ-xxx to SCR/API/TBL mapping table to ensure every requirement is addressed425. **Confirm scope with user** — Present the outline and confirm before proceeding436. **Load** `references/spec_writing_standards.md` for ID conventions and quality criteria4445### Workflow 2: Screen Design Specification(画面設計)4647**Purpose**: Produce detailed screen design documents with UI elements, events, and transitions.48491. **Assign SCR-IDs** — Number each screen sequentially (SCR-001, SCR-002, ...)502. **Define UI elements table** for each screen:5152 | Element ID | Type | Label | Validation Rules | Default Value | Notes |53 |-----------|------|-------|-----------------|--------------|-------|54 | SCR-001-E01 | text | User Name | Required, max 50 chars | — | — |55563. **Define event table** for each screen:5758 | Event ID | Trigger Element | Event Type | Action | Target |59 |----------|----------------|------------|--------|--------|60 | SCR-001-EV01 | btn_submit | click | POST /api/v1/users | SCR-002 |61624. **Create screen transition diagram** — Use Mermaid `stateDiagram-v2` to visualize navigation flow635. **Add responsive breakpoint notes** — Document layout changes at standard breakpoints (mobile 375px, tablet 768px, desktop 1024px+)646. **Reference** `references/mermaid_diagram_patterns.md` for diagram syntax657. **Output** using `assets/functional_spec_template_ja.md` or `assets/functional_spec_template_en.md`6667### Workflow 3: API Design Specification(API設計)6869**Purpose**: Produce REST API specifications with endpoints, schemas, and sequence diagrams.70711. **Assign API-IDs** — Number each endpoint sequentially (API-001, API-002, ...)722. **Define each endpoint**:73 - HTTP Method and Path74 - Description and authentication requirements75 - Request parameters, headers, and body (JSON schema)76 - Response body (success and error)77 - Error codes with business error code mapping783. **Provide request/response JSON examples** — Include realistic sample data794. **Standardize error codes** — Use the error envelope pattern from `references/api_design_guide.md`805. **Create sequence diagrams** — For multi-service or complex flows, produce Mermaid `sequenceDiagram`816. **Load** `references/api_design_guide.md` for REST conventions827. **Output** using `assets/api_spec_template.md` for per-endpoint detail8384### Workflow 4: Database Design Specification(DB設計)8586**Purpose**: Produce database design documents with table definitions, ER diagrams, and indexes.87881. **Assign TBL-IDs** — Number each table sequentially (TBL-001, TBL-002, ...)892. **Define column definition table** for each table:9091 | Column Name | Data Type | Nullable | Default | Description | Constraints |92 |------------|-----------|----------|---------|-------------|-------------|93 | id | BIGINT | NO | AUTO_INCREMENT | Primary key | PK |94953. **Create ER diagram** — Use Mermaid `erDiagram` to visualize relationships964. **Define index table** — Document all indexes with type, columns, and purpose975. **Include audit columns** — Ensure every table has: `created_at`, `updated_at`, `created_by`, `updated_by`986. **Add soft delete support** where appropriate — `deleted_at` column997. **Load** `references/db_design_guide.md` for naming conventions and normalization guidance1008. **Output** using `assets/db_design_template.md` for per-table detail101102### Workflow 5: Sequence Diagram Creation(シーケンス図)103104**Purpose**: Produce Mermaid sequence diagrams for system interaction flows.1051061. **Identify participants** — Categorize actors:107 - Actor (user)108 - Frontend (browser/app)109 - Backend (API server)110 - Database111 - External API / Third-party services1122. **Map message flow** — Document request/response patterns for the target scenario1133. **Add conditional branches** — Use `alt`, `opt`, `loop` fragments as needed1144. **Add notes and activations** — Clarify processing steps and active lifelines1155. **Output** Mermaid `sequenceDiagram` code block1166. **Reference** `references/mermaid_diagram_patterns.md` for syntax patterns117118### Workflow 6: State Transition Diagram Creation(状態遷移図)119120**Purpose**: Produce state machines for entities with lifecycle behavior.1211221. **Build state inventory table**:123124 | State ID | Name | Description | Entry Condition | Exit Condition |125 |----------|------|-------------|----------------|----------------|126 | STS-001 | Draft | Initial state | Record created | Submit action |1271282. **Build transition table**:129130 | From State | Event/Trigger | Guard Condition | Action | To State |131 |-----------|--------------|----------------|--------|----------|132 | Draft | Submit | All required fields filled | Validate & save | Pending Review |1331343. **Create state transition matrix** — States as rows, events as columns, target state in cells1354. **Output** Mermaid `stateDiagram-v2` code block1365. **Reference** `references/mermaid_diagram_patterns.md` for state diagram syntax137138### Workflow 7: Document Assembly(ドキュメント組み立て)139140**Purpose**: Assemble individual sections into a complete specification document.1411421. **Generate table of contents** — Auto-generate from section headers1432. **Cross-reference validation** — Verify all IDs are referenced correctly:144 - Every REQ-xxx maps to at least one SCR/API/TBL145 - Every SCR-xxx event references a valid API-xxx or screen target146 - Every API-xxx references valid TBL-xxx tables1473. **Quality checklist** — Verify the document meets IEEE 830 criteria:148 - [ ] Completeness — All requirements addressed149 - [ ] Consistency — No contradictions between sections150 - [ ] Traceability — Bidirectional mapping maintained151 - [ ] Unambiguity — No vague language ("appropriate", "etc.", "as needed")152 - [ ] Verifiability — Each requirement can be tested153 - [ ] Modifiability — Modular structure with clear cross-references1544. **Select output template** — Use the appropriate template from `assets/`:155 - Full spec: `functional_spec_template_ja.md` or `functional_spec_template_en.md`156 - API only: `api_spec_template.md`157 - DB only: `db_design_template.md`1585. **Fill template placeholders** — Replace all `{PLACEHOLDER}` values with actual content159160## Resources161162| File | Purpose | When to Load |163|------|---------|-------------|164| `references/spec_writing_standards.md` | IEEE 830/ISO 29148 standards, ID conventions, quality criteria | Workflow 1 (Requirements Intake), Workflow 7 (Document Assembly) |165| `references/mermaid_diagram_patterns.md` | Mermaid syntax patterns for all diagram types | Workflow 2, 5, 6 (any diagram creation) |166| `references/api_design_guide.md` | REST design principles, error formats, pagination | Workflow 3 (API Design) |167| `references/db_design_guide.md` | Naming conventions, normalization, index strategy | Workflow 4 (DB Design) |168| `assets/functional_spec_template_ja.md` | Full functional spec template (Japanese) | Workflow 7 when output language is Japanese |169| `assets/functional_spec_template_en.md` | Full functional spec template (English) | Workflow 7 when output language is English |170| `assets/api_spec_template.md` | Per-endpoint API specification template | Workflow 3, 7 for API-focused output |171| `assets/db_design_template.md` | Per-table database design template | Workflow 4, 7 for DB-focused output |172173---174175## Best Practices176177### Do's178- 各設計要素にIDを採番し、要件とのトレーサビリティを維持する179- 曖昧な用語(「適切な」「必要に応じて」「等」)を避け、SHALL/SHOULD/MAYで記述する180- 画面・API・DBの相互参照を検証してから出力する181- Mermaidダイアグラムは方向・命名規則を統一する182- テンプレートのプレースホルダーを一つ残らず置換する183184### Don'ts185- 要件の取りこぼしを放置しない(トレーサビリティマトリクスで確認)186- 1つの画面設計に複数の関心事を混在させない187- APIの正常系だけ記述してエラー系を省略しない188- インデックス戦略なしにテーブル定義だけ書かない189190---191192## Examples193194### 例1: ECサイト商品管理画面の技術仕様書195196```197User: 商品管理画面の技術仕様書を作成してください。198 要件: 商品CRUD、カテゴリ管理、画像アップロード、在庫管理199200Claude:2011. [Workflow 1] 要件取り込み → SCR-001〜003、API-001〜008、TBL-001〜004 を採番2022. [Workflow 2] 画面設計 → 商品一覧(SCR-001)、商品登録/編集(SCR-002)、カテゴリ管理(SCR-003)2033. [Workflow 3] API設計 → GET/POST/PUT/DELETE /api/v1/products、POST /api/v1/images2044. [Workflow 4] DB設計 → products、categories、product_images、inventory テーブル + ER図2055. [Workflow 7] 組み立て → functional_spec_template_ja.md で出力206```207208### 例2: API設計書のみ作成209210```211User: 認証APIの設計書だけ作ってください。JWT認証です。212213Claude:2141. [Workflow 1] スコープ: API設計のみ → API-001〜003(login, refresh, logout)2152. [Workflow 3] 各エンドポイントの詳細設計(リクエスト/レスポンス/エラー)2163. [Workflow 5] 認証フローのシーケンス図(Client → API → DB → JWT発行)2174. [Workflow 7] api_spec_template.md で出力218```