Changes: - Rename skill.md to SKILL.md (uppercase required) - Add YAML frontmatter with name and description - Reorganize templates/ and examples/ into references/ - Remove extra documentation files (README.md, QUICK_REF.md) - Follow progressive disclosure pattern: keep SKILL.md lean The skill now complies with the official Claude Code skill format. Co-Authored-By: Claude <noreply@anthropic.com>
3.0 KiB
3.0 KiB
Design Proposal Template
Template Variables
{feature_requirement}: Feature requirement description{analysis_result}: Results from requirement analysis{current_architecture}: Current system architecture{tech_stack}: Current technology stack
Prompt Template
请作为系统架构师,设计以下功能的详细实现方案:
## 功能需求
{feature_requirement}
## 需求分析结果
{analysis_result}
## 当前架构
{current_architecture}
## 技术栈
{tech_stack}
## 设计要求
请提供以下内容:
### 1. 整体设计
- 系统架构图(文字描述)
- 模块划分和职责
- 模块间的交互关系
- 数据流设计
### 2. 接口设计
- API接口定义
- 请求/响应格式
- 错误码定义
- 接口调用流程
### 3. 数据模型设计
- 数据库表结构
- 字段定义和类型
- 索引设计
- 数据关系
### 4. 核心逻辑设计
- 关键算法或逻辑流程
- 状态机设计(如适用)
- 并发控制
- 异常处理策略
### 5. 技术选型
- 使用的技术和框架
- 第三方库选择
- 技术选择的理由
- 潜在的替代方案
### 6. 安全设计
- 认证和授权
- 数据加密
- 输入验证
- 防护措施
### 7. 性能考虑
- 性能目标
- 优化策略
- 缓存设计
- 扩展性考虑
### 8. 实施计划
- 开发阶段划分
- 每个阶段的交付物
- 依赖关系
- 里程碑
### 9. 测试策略
- 单元测试策略
- 集成测试策略
- 性能测试策略
- 测试数据准备
### 10. 部署和运维
- 部署方案
- 配置管理
- 监控指标
- 回滚方案
## 输出要求
请提供:
1. **设计摘要**(高层概览,200字以内)
2. **详细设计**(按上述10个维度)
3. **实施检查清单**(按优先级排序)
4. **风险和缓解措施**
## 代码原型要求
如需提供代码原型:
- 仅提供 unified diff patch 格式
- 不要实际修改代码
- 代码需要包含完整的类型注解
- 关键逻辑需要添加注释说明
Usage Example
# After requirement analysis is complete
feature_requirement = """
实现一个基于WebSocket的实时消息推送系统
"""
analysis_result = """
从需求分析中得出的关键发现:
- 需要支持10万+并发连接
- 消息延迟需控制在100ms以内
- 需要支持消息持久化
- 需要支持离线消息
"""
current_architecture = """
微服务架构,使用:
- API Gateway
- 用户服务
- 消息服务
- 推送服务(待实现)
"""
tech_stack = """
- 后端:Python 3.11 + FastAPI
- 数据库:PostgreSQL 15
- 缓存:Redis 7
- 消息队列:RabbitMQ
- 容器:Docker + Kubernetes
"""
# Call Codex for design
codex(
PROMPT=f"<design template with variables>",
cd="/project",
SESSION_ID=analysis_session, # Continue from analysis
sandbox="read-only"
)
Follow-up Actions
After receiving design proposal:
- Review the design critically
- Ask questions about unclear parts
- Discuss alternative approaches
- Iterate on the design
- Once approved, proceed to implementation