Generate technical design documents with proper structure, diagrams, and implementation details. Default language is English unless user requests Chinese.
| Level | Scope | Sections Required | |-------|-------|-------------------| | Small | Single component, <100 LOC | TL;DR, Design, Implementation | | Medium | Cross-component, API changes | + Background, Solution Analysis | | Large | System-level, new service | Full template |
Before writing, explore the codebase:
Follow the template structure below, scaled to complexity level.
# [Feature/System Name] Technical Design
## TL;DR
- 3-5 bullets: problem, solution, key decisions, expected outcome
## Background (Medium/Large)
### Current State
- Existing behavior and limitations
### Problem Statement
- What breaks if we do nothing?
- Who is affected and how?
### Goals / Non-Goals
- Goals: what this design achieves
- Non-Goals: explicitly out of scope
## Solution Analysis (Medium/Large)
### Option 1: [Name]
Pros: ...
Cons: ...
### Option 2: [Name]
Pros: ...
Cons: ...
### Comparison
| Criteria | Option 1 | Option 2 |
|----------|----------|----------|
| Performance | ... | ... |
| Complexity | ... | ... |
### Recommendation
Selected: Option X
Rationale: [why]
## Detailed Design
### Architecture
[Mermaid diagram - see examples below]
### Component Design
- Responsibilities
- Interfaces
- Dependencies
### Data Model (if applicable)
[Schema or structure]
### API Design (if applicable)
[Endpoints, request/response]
## Implementation Plan
### Phase 1: [Name]
- [ ] Task 1
- [ ] Task 2
### Migration Strategy (if applicable)
## Risk Assessment
| Risk | Probability | Impact | Mitigation |
|------|-------------|--------|------------|
| ... | High/Med/Low | High/Med/Low | ... |
## References
- Related docs, external resources
Architecture (flowchart):
flowchart TD
A[Client] --> B[API Gateway]
B --> C[Service]
C --> D[(Database)]
Sequence:
sequenceDiagram
Client->>Server: Request
Server->>DB: Query
DB-->>Server: Result
Server-->>Client: Response
State:
stateDiagram-v2
[*] --> Pending
Pending --> Processing: start
Processing --> Done: complete
Processing --> Failed: error
When user requests changes:
docs/, ai_docs/, or design/ directorydesign-[feature-name].mdSearch for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer