/technical-spec
Technical specification and design document expert. Use when writing design docs, RFCs, ADRs, or evaluating technology choices. Covers C4 model, system design, and architecture documentation.
$ npx -y skills add majiayu000/spellbook --skill technical-spec --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/technical-spec
Context preview
The summary Claude sees to decide when to auto-load this skill.
Technical specification and design document expert. Use when writing design docs, RFCs, ADRs, or evaluating technology choices. Covers C4 model, system design, and architecture documentation.
SKILL.md
technical-spec.SKILL.mdname: technical-spec
description: Technical specification and design document expert. Use when writing design docs, RFCs, ADRs, or evaluating technology choices. Covers C4 model, system design, and architecture documentation.
Technical Specification & Design Documents
> Expert guidance for writing effective technical design documents, RFCs, Architecture Decision Records, and technology evaluation frameworks.
Core Philosophy
- **Write before code** — Design documents prevent costly rework and align teams
- **Living documents** — Keep docs updated as the system evolves
- **Clarity over completeness** — Simple, direct language reduces cognitive load
- **Diagrams as code** — Version-controlled, maintainable architecture diagrams
- **Decisions over descriptions** — Document why, not just what
---
Hard Rules (Must Follow)
> These rules are mandatory. Violating them means the skill is not working correctly.
Alternatives Required
**Every design document must include at least 2 alternative solutions.**
❌ FORBIDDEN:
## Solution
We will use PostgreSQL for the database.
(No alternatives considered)
✅ REQUIRED:
## Proposed Solution
PostgreSQL for primary database.
## Alternatives Considered
### Option A: PostgreSQL (Recommended)
**Pros**: ACID compliance, JSON support, mature ecosystem
**Cons**: Vertical scaling limits
**Decision**: Chosen for reliability and team expertise
### Option B: MongoDB
**Pros**: Horizontal scaling, flexible schema
**Cons**: Eventual consistency, less familiar to team
**Decision**: Rejected due to consistency requirements
### Option C: DynamoDB
**Pros**: Serverless, auto-scaling
**Cons**: Vendor lock-in, complex query patterns
**Decision**: Rejected due to query flexibility needs
Diagrams Required
**System designs must include architecture diagrams. No text-only descriptions.**
❌ FORBIDDEN:
"The user sends a request to the API, which talks to the database
and returns a response."
✅ REQUIRED:
Include at least one of:
- C4 Context/Container diagram
- Sequence diagram for key flows
- Data flow diagram
Example (Mermaid):
```mermaid
sequenceDiagram
Client->>API: POST /orders
API->>Auth: Validate token
Auth-->>API: User context
API->>DB: Create order
DB-->>API: Order ID
API-->>Client: 201 Created
### Success Metrics Defined
**Every design must include measurable success criteria.**
```markdown
❌ FORBIDDEN:
## Goals
- Make the system faster
- Improve reliability
- Better user experience
✅ REQUIRED:
## Success Metrics
| Metric | Current | Target | Measurement |
|--------|---------|--------|-------------|
| API Latency (P95) | 500ms | <200ms | Prometheus histogram |
| Availability | 99.5% | 99.9% | Uptime monitoring |
| Error Rate | 2% | <0.1% | Error tracking |
| Throughput | 1K req/s | 10K req/s | Load testing |
Risks and Mitigations
**All designs must identify risks and their mitigations.**
❌ FORBIDDEN:
(No risk section, assuming everything will work)
✅ REQUIRED:
## Risks & Mitigations
| Risk | Severity | Likelihood | Mitigation |
|------|----------|------------|------------|
| Database migration fails | High | Medium | Backup + rollback plan, test in staging |
| Third-party API unavailable | Medium | Low | Circuit breaker, fallback cache |
| Team lacks expertise | Medium | Medium | Pair programming, external review |
| Scope creep | High | High | Fixed scope document, change control |
---
When to Use This Skill
| Scenario | Document Type | Complexity | |----------|--------------|------------| | New feature design | Technical Design Doc | Medium-High | | System architecture | C4 Model Diagrams | Medium | | Major technical decision | Architecture Decision Record (ADR) | Low-Medium | | Cross-team proposal | RFC (Request for Comments) | Medium-High | | Technology evaluation | Tech Selection Matrix | Medium | | API contract | OpenAPI/AsyncAPI Spec | Low-Medium |
---
Document Types Overview
Technical Design Document (TDD)
**Purpose**: Blueprint for implementing a feature or system **Audience**: Engineers, technical leads **When**: Before implementing significant features **Sections**: Problem, solution, alternatives, risks, timeline
RFC (Request for Comments)
**Purpose**: Proposal for discussion and feedback **Audience**: Cross-functional teams **When**: Need consensus on technical direction **Sections**: Problem statement, proposal, trade-offs, open questions
Architecture Decision Record (ADR)
**Purpose**: Document a single architectural decision **Audience**: Current and future engineers **When**: Any architecturally significant choice **Sections**: Context, decision, consequences, status
C4 Model Diagrams
**Purpose**: Visualize system architecture at multiple zoom levels **Audience**: Technical and non-technical stakeholders **When**: Communicating system structure **Levels**: Context, Container, Component, Code
---
Essential Document Sections
1. Front Matter
# Title: User Authentication System
**Author**: Jane Doe
**Status**: Proposed | In Review | Approved | Implemented
**Created**: 2025-12-18
**Last Updated**: 2025-12-18
**Reviewers**: @tech-lead, @security-team
2. Problem Statement (The "Why")
## Problem
**Current State**: Users authenticate via legacy session cookies, no MFA support.
**Impact**: 23% of security incidents related to compromised credentials.
**Constraint**: Must support 10K concurrent users, <200ms login latency.
**Goal**: Implement secure, scalable authentication with MFA and OAuth support.
3. Proposed Solution (The "What")
## Solution
Implement JWT-based authentication with:
- Access tokens (15min TTL) + Refresh tokens (7 day TTL)
- TOTP-based MFA (Google Authenticator compatible)
- OAuth 2.0 providers (Google, GitHub)
- Redis for token blacklist and session management
### High-Level Design
[Include C4 Container diagram here]
Read more
name: technical-spec description: Technical specification and design document expert. Use when writing design docs, RFCs, ADRs, or evaluating technology choices. Covers C4 model, system design, and architecture documentation.
Technical Specification & Design Documents
> Expert guidance for writing effective technical design documents, RFCs, Architecture Decision Records, and technology evaluation frameworks.
Core Philosophy
- **Write before code** — Design documents prevent costly rework and align teams
- **Living documents** — Keep docs updated as the system evolves
- **Clarity over completeness** — Simple, direct language reduces cognitive load
- **Diagrams as code** — Version-controlled, maintainable architecture diagrams
- **Decisions over descriptions** — Document why, not just what
---
Hard Rules (Must Follow)
> These rules are mandatory. Violating them means the skill is not working correctly.
Alternatives Required
**Every design document must include at least 2 alternative solutions.**
❌ FORBIDDEN: ## Solution We will use PostgreSQL for the database. (No alternatives considered) ✅ REQUIRED: ## Proposed Solution PostgreSQL for primary database. ## Alternatives Considered ### Option A: PostgreSQL (Recommended) **Pros**: ACID compliance, JSON support, mature ecosystem **Cons**: Vertical scaling limits **Decision**: Chosen for reliability and team expertise ### Option B: MongoDB **Pros**: Horizontal scaling, flexible schema **Cons**: Eventual consistency, less familiar to team **Decision**: Rejected due to consistency requirements ### Option C: DynamoDB **Pros**: Serverless, auto-scaling **Cons**: Vendor lock-in, complex query patterns **Decision**: Rejected due to query flexibility needs
Diagrams Required
**System designs must include architecture diagrams. No text-only descriptions.**
❌ FORBIDDEN:
"The user sends a request to the API, which talks to the database
and returns a response."
✅ REQUIRED:
Include at least one of:
- C4 Context/Container diagram
- Sequence diagram for key flows
- Data flow diagram
Example (Mermaid):
```mermaid
sequenceDiagram
Client->>API: POST /orders
API->>Auth: Validate token
Auth-->>API: User context
API->>DB: Create order
DB-->>API: Order ID
API-->>Client: 201 Created### Success Metrics Defined **Every design must include measurable success criteria.** ```markdown ❌ FORBIDDEN: ## Goals - Make the system faster - Improve reliability - Better user experience ✅ REQUIRED: ## Success Metrics | Metric | Current | Target | Measurement | |--------|---------|--------|-------------| | API Latency (P95) | 500ms | <200ms | Prometheus histogram | | Availability | 99.5% | 99.9% | Uptime monitoring | | Error Rate | 2% | <0.1% | Error tracking | | Throughput | 1K req/s | 10K req/s | Load testing |
Risks and Mitigations
**All designs must identify risks and their mitigations.**
❌ FORBIDDEN: (No risk section, assuming everything will work) ✅ REQUIRED: ## Risks & Mitigations | Risk | Severity | Likelihood | Mitigation | |------|----------|------------|------------| | Database migration fails | High | Medium | Backup + rollback plan, test in staging | | Third-party API unavailable | Medium | Low | Circuit breaker, fallback cache | | Team lacks expertise | Medium | Medium | Pair programming, external review | | Scope creep | High | High | Fixed scope document, change control |
---
When to Use This Skill
| Scenario | Document Type | Complexity | |----------|--------------|------------| | New feature design | Technical Design Doc | Medium-High | | System architecture | C4 Model Diagrams | Medium | | Major technical decision | Architecture Decision Record (ADR) | Low-Medium | | Cross-team proposal | RFC (Request for Comments) | Medium-High | | Technology evaluation | Tech Selection Matrix | Medium | | API contract | OpenAPI/AsyncAPI Spec | Low-Medium |
---
Document Types Overview
Technical Design Document (TDD)
**Purpose**: Blueprint for implementing a feature or system **Audience**: Engineers, technical leads **When**: Before implementing significant features **Sections**: Problem, solution, alternatives, risks, timeline
RFC (Request for Comments)
**Purpose**: Proposal for discussion and feedback **Audience**: Cross-functional teams **When**: Need consensus on technical direction **Sections**: Problem statement, proposal, trade-offs, open questions
Architecture Decision Record (ADR)
**Purpose**: Document a single architectural decision **Audience**: Current and future engineers **When**: Any architecturally significant choice **Sections**: Context, decision, consequences, status
C4 Model Diagrams
**Purpose**: Visualize system architecture at multiple zoom levels **Audience**: Technical and non-technical stakeholders **When**: Communicating system structure **Levels**: Context, Container, Component, Code
---
Essential Document Sections
1. Front Matter
# Title: User Authentication System **Author**: Jane Doe **Status**: Proposed | In Review | Approved | Implemented **Created**: 2025-12-18 **Last Updated**: 2025-12-18 **Reviewers**: @tech-lead, @security-team
2. Problem Statement (The "Why")
## Problem **Current State**: Users authenticate via legacy session cookies, no MFA support. **Impact**: 23% of security incidents related to compromised credentials. **Constraint**: Must support 10K concurrent users, <200ms login latency. **Goal**: Implement secure, scalable authentication with MFA and OAuth support.
3. Proposed Solution (The "What")
## Solution Implement JWT-based authentication with: - Access tokens (15min TTL) + Refresh tokens (7 day TTL) - TOTP-based MFA (Google Authenticator compatible) - OAuth 2.0 providers (Google, GitHub) - Redis for token blacklist and session management ### High-Level Design [Include C4 Container diagram here]
Cross-runtime skills for Claude Code, Codex, and multi-agent workflows.
Repo: majiayu000/spellbook
Other skills on spellbook.
- /agentsmd-optimize
Audit AND optimize a CLAUDE.md / AGENTS.md instruction file — score it against the five high-leverage patterns, flag anti-patterns, then apply approved fixes in place. Use when the user says 优化 CLAUDE.md / 优化 AGENTS.md / optimize my agent doc / 帮我改 claudemd, or after an audit
Open skill - /agentsmd-scaffold
Generate or update repository-specific AGENTS.md instruction files from real repo evidence. Use when asked to create, design, scaffold, split, or improve root or scoped AGENTS.md files for Codex/Claude/agent workflows, especially when a repo needs directory-specific rules,
Open skill - /api-design
REST/GraphQL/gRPC API design best practices. Use when designing APIs, defining contracts, handling versioning. Covers OpenAPI 3.2, GraphQL Federation, gRPC streaming.
Open skill - /app-ui-design
Mobile app UI design expert for iOS and Android. Use when designing app interfaces, creating design systems, ensuring accessibility, or following platform guidelines. Covers Material Design 3, Human Interface Guidelines, color theory, typography, and 2025 trends.
Open skill - /app-user-story-qa
End-to-end app feature inventory and user-story testing workflow with a canonical tracker. Use when the user asks to audit every feature, derive expected behavior from code, test user journeys, or explicitly fix and retest documented UX or logistical defects.
Open skill - /architecture-foundation
Design architecture foundations before implementation. Use when asked to design or refactor architecture, choose Rust/Go crate, package, module, runtime, workflow, or service boundaries, compare mature project architecture, prevent stacked one-off PRs, audit migration debt in
Open skill

