Best for
- Use when writing design docs, RFCs, ADRs, or evaluating technology choices.
majiayu000/spellbook/skills/technical-spec/SKILL.md
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.
Decision brief
Expert guidance for writing effective technical design documents, RFCs, Architecture Decision Records, and technology evaluation frameworks.
Compatibility matrix
| Platform | Status | Evidence | What to check |
|---|---|---|---|
| Codex | Not declared | No explicit evidence | Portability before use |
| Claude Code | Not declared | No explicit evidence | Portability before use |
| Cursor | Not declared | No explicit evidence | Portability before use |
| Gemini CLI | Not declared | No explicit evidence | Portability before use |
Installation
The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.
npx skills add https://github.com/majiayu000/spellbook --skill "skills/technical-spec"Inspect the Agent Skill "technical-spec" from https://github.com/majiayu000/spellbook/blob/9e96aa5f52e8504cbbf9d359def29f9abcde57ce/skills/technical-spec/SKILL.md at commit 9e96aa5f52e8504cbbf9d359def29f9abcde57ce. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.
Workflow
Review the “5. Risk Assessment” section in the pinned source before continuing.
Review the “6. Implementation Plan” section in the pinned source before continuing.
[ ] JWT generation/validation service
[ ] TOTP secret generation
[ ] Google OAuth integration
Permission review
The documentation includes network, browsing, or remote request actions.
"The user sends a request to the API, which talks to the databaseThe documentation includes network, browsing, or remote request actions.
!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Container.pumlEvidence record
| Signal | Value | Evidence type | Meaning |
|---|---|---|---|
| Quality score | 93/100 | Computed | Documentation, specificity, maintenance, and trust rules |
| Repository stars | 262 | Source | Repository attention, not individual Skill quality |
| Compatibility | 0 platforms | Source | Declared in the catalog source record |
| Usage guide | automated source guide | Editorial | Generated or reviewed according to the visible evidence level |
Pinned source
Expert guidance for writing effective technical design documents, RFCs, Architecture Decision Records, and technology evaluation frameworks.
These rules are mandatory. Violating them means the skill is not working correctly.
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
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 |
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 |
| 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 |
Purpose: Blueprint for implementing a feature or system Audience: Engineers, technical leads When: Before implementing significant features Sections: Problem, solution, alternatives, risks, timeline
Purpose: Proposal for discussion and feedback Audience: Cross-functional teams When: Need consensus on technical direction Sections: Problem statement, proposal, trade-offs, open questions
Purpose: Document a single architectural decision Audience: Current and future engineers When: Any architecturally significant choice Sections: Context, decision, consequences, status
Purpose: Visualize system architecture at multiple zoom levels Audience: Technical and non-technical stakeholders When: Communicating system structure Levels: Context, Container, Component, Code
# 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
## 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.
## 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]
### Data Flow
1. User submits credentials → Auth Service validates
2. Auth Service generates JWT pair, stores refresh token in Redis
3. Client includes access token in Authorization header
4. API Gateway validates token, extracts user context
5. On expiry, client exchanges refresh token for new access token
## Alternatives
### Option A: Session-based authentication
**Pros**: Simpler implementation, server-side revocation
**Cons**: Doesn't scale horizontally, higher latency
**Decision**: Rejected - doesn't meet scalability requirements
### Option B: Auth0 (3rd party)
**Pros**: Battle-tested, feature-complete
**Cons**: $500/month cost, vendor lock-in
**Decision**: Deferred - revisit if team velocity insufficient
## Risks & Mitigations
| Risk | Severity | Likelihood | Mitigation |
|------|----------|------------|------------|
| JWT secret leak | Critical | Low | Rotate secrets quarterly, use HSM |
| Token theft (XSS) | High | Medium | HttpOnly cookies, CSP headers |
| Redis downtime | High | Low | Fallback to stateless validation |
| Clock skew issues | Medium | Medium | Use `nbf` claim, allow 5min tolerance |
## Work Breakdown
### Phase 1: Core Authentication (Week 1-2)
- [ ] JWT generation/validation service
- [ ] Password hashing (bcrypt)
- [ ] User repository interface
- [ ] Unit tests + integration tests
### Phase 2: MFA (Week 3)
- [ ] TOTP secret generation
- [ ] QR code generation
- [ ] Verification endpoint
- [ ] Backup codes
### Phase 3: OAuth (Week 4)
- [ ] Google OAuth integration
- [ ] GitHub OAuth integration
- [ ] Account linking flow
### Success Metrics
- 100% test coverage for auth logic
- <100ms token validation latency
- Zero security vulnerabilities in audit
## Open Questions
1. **Token storage**: Should refresh tokens be in httpOnly cookie or localStorage?
- **Recommendation**: Cookie (XSS protection), need CSRF mitigation
2. **MFA enforcement**: Opt-in or mandatory for all users?
- **Requires**: Product team decision
3. **Session limits**: Should we limit concurrent sessions per user?
- **Impact**: Redis storage requirements, UX complexity
✅ DO:
- Use simple, direct language
- Define acronyms on first use
- Include diagrams for complex flows
- Use tables for comparisons
- Provide concrete examples
❌ DON'T:
- Use jargon without explanation
- Write walls of text
- Assume prior knowledge
- Skip the "why" behind decisions
- Create docs that become stale
Mermaid (Simple flows)
sequenceDiagram
Client->>API: POST /login
API->>DB: Validate credentials
DB-->>API: User data
API->>Redis: Store session
API-->>Client: JWT token
PlantUML with C4 (Architecture)
@startuml
!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Container.puml
System_Boundary(c1, "Auth System") {
Container(api, "API Gateway", "Node.js", "Routes requests")
Container(auth, "Auth Service", "Go", "Handles authentication")
ContainerDb(redis, "Redis", "Cache", "Sessions & tokens")
}
Person(user, "User")
user -> api : Login request
api -> auth : Validate
auth -> redis : Store token
@enduml
Use consistent templates across your organization:
templates/design-doc-template.mdtemplates/adr-template.mdreference/tech-selection.md# Store docs with code
docs/
├── architecture/
│ ├── ADRs/
│ │ ├── 001-database-selection.md
│ │ └── 002-api-authentication.md
│ └── diagrams/
│ └── c4-system-context.puml
├── design/
│ └── auth-system-design.md
└── rfcs/
└── 2025-01-user-authentication.md
## Requirements Traceability
| Requirement | Design Element | Implementation | Tests |
|-------------|---------------|----------------|-------|
| REQ-001: MFA support | Auth Service TOTP module | `auth/totp.go` | `auth/totp_test.go` |
| REQ-002: OAuth login | OAuth provider adapter | `auth/oauth.go` | `auth/oauth_test.go` |
| REQ-003: <100ms latency | Redis token cache | `middleware/jwt.go` | `benchmark/auth_bench.go` |
## Document Status
- **Proposed**: Initial draft, seeking feedback
- **In Review**: Under review by stakeholders
- **Approved**: Accepted, ready for implementation
- **Implemented**: Fully implemented
- **Deprecated**: No longer valid, superseded by ADR-XXX
Before implementation:
After implementation:
❌ Design as justification
- Don't write docs after implementation to justify decisions
- Write BEFORE to think through design
❌ Too much detail
- Don't document every function and variable
- Focus on system-level design, not line-by-line code
❌ Spec-first waterfall
- Don't spend months on perfect design
- Write enough to start, iterate as you learn
❌ Stale documentation
- Don't let docs drift from reality
- Update or delete outdated docs
❌ No alternatives analysis
- Don't present only one solution
- Show you considered trade-offs
❌ Missing success criteria
- Don't forget to define "done"
- Include measurable success metrics
Detailed material starting at ## Quick Reference Card has been moved to reference/extended.md to keep this skill concise. Load that reference when the task requires the moved examples, command catalogs, checklists, platform details, or implementation templates.
Frequently asked questions
Expert guidance for writing effective technical design documents, RFCs, Architecture Decision Records, and technology evaluation frameworks.
The source record exposes this install command: npx skills add https://github.com/majiayu000/spellbook --skill "skills/technical-spec". Inspect the command and pinned source before running it.
Static rules flagged network in the source; the page lists the matching lines and excerpts.
Alternatives
oaustegard/claude-skills
Generate hierarchical _FEATURES.md files that describe what a codebase DOES from a user/consumer perspective, anchored to source symbols via tree-sitting. Supports large complex codebases through feature-driven decomposition into sub-feature files. Uses a multi-pass synthesis: orientation → detail → overview rewrite. Use when someone says "what does this do", "document features", "feature inventory", "_FEATURES.md", or needs to understand a codebase's purpose before modifying it. Complements tre
NintendaDev/unikit-ai
Generate and maintain the project's TECHNICAL documentation from its codebase — scans the project structure, tech stack, and module boundaries, then writes a lean README landing page plus detailed topic pages (architecture, modules, setup, build, APIs), only the docs that are relevant. Use whenever the user wants to create, update, or validate documentation of the CODE or the project itself, e.g. "generate documentation", "create docs", "write the README", "update the project docs", "document th
alirezarezvani/claude-skills
ISO 13485 Quality Management System implementation and maintenance for medical device organizations. Provides QMS design, documentation control, internal auditing, CAPA management, and certification support. Use when working with medical device quality systems, preparing for ISO 13485 audits, managing regulatory compliance documentation, setting up corrective actions, or building audit preparation programs. Useful for quality management, audit preparation, regulatory compliance, medical device d
compozy/compozy
Build terminal user interfaces with Go and Bubbletea framework. Use when creating TUI apps with the Elm architecture, dual-pane layouts, accordion modes, mouse/keyboard handling, Lipgloss styling, and reusable components. Includes production-ready templates, effects library, and battle-tested layout patterns from real projects. Don't use for plain-text CLI scripts without an interactive UI, web/desktop GUIs, or non-Go terminal frameworks (Ink, Textual, Ratatui).