mirror of
https://github.com/cexll/myclaude.git
synced 2026-02-05 02:30:26 +08:00
Compare commits
51 Commits
v3.1
...
swe-agent/
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
916b970665 | ||
|
|
10070a9bef | ||
|
|
b18439f268 | ||
|
|
4230479ff4 | ||
|
|
18c26a252a | ||
|
|
f6fc9a338f | ||
|
|
6223d59042 | ||
|
|
e6b229645a | ||
|
|
9dc3e8f43d | ||
|
|
e9faa0bc2d | ||
|
|
70caa8d7fc | ||
|
|
4f74d5afa1 | ||
|
|
7f61437eea | ||
|
|
ed604f6db7 | ||
|
|
fb66b52b68 | ||
|
|
05e32203ee | ||
|
|
1bf7dd9a83 | ||
|
|
19aa237d47 | ||
|
|
5cd1103b85 | ||
|
|
e2f80508b5 | ||
|
|
86cb8f6611 | ||
|
|
04cffd2d21 | ||
|
|
74b47a6f5a | ||
|
|
32514920da | ||
|
|
a36b37c66d | ||
|
|
b4a80f833a | ||
|
|
cc1d22167a | ||
|
|
c080eea98c | ||
|
|
95b43c68fe | ||
|
|
6b06403014 | ||
|
|
4d3789d0dc | ||
|
|
4110ee4600 | ||
|
|
9d16cb4406 | ||
|
|
daa50177f3 | ||
|
|
9c2c91bb1a | ||
|
|
34f1557f83 | ||
|
|
41d776c09e | ||
|
|
9dea5d37ef | ||
|
|
656bdd27c5 | ||
|
|
5b1190f8a3 | ||
|
|
32f2e4c2cb | ||
|
|
394013fb2e | ||
|
|
c344a2f544 | ||
|
|
5532652383 | ||
|
|
44b96c0498 | ||
|
|
9304573cc6 | ||
|
|
8a84a05fa0 | ||
|
|
894952decd | ||
|
|
5745849d7c | ||
|
|
6b3c27ee00 | ||
|
|
e6a1c2c23e |
231
.claude-plugin/marketplace.json
Normal file
231
.claude-plugin/marketplace.json
Normal file
@@ -0,0 +1,231 @@
|
||||
{
|
||||
"name": "claude-code-dev-workflows",
|
||||
"owner": {
|
||||
"name": "Claude Code Dev Workflows",
|
||||
"email": "contact@example.com",
|
||||
"url": "https://github.com/cexll/myclaude"
|
||||
},
|
||||
"metadata": {
|
||||
"description": "Professional multi-agent development workflows with Requirements-Driven and BMAD methodologies, featuring 16+ specialized agents and 12+ commands",
|
||||
"version": "1.0.0"
|
||||
},
|
||||
"plugins": [
|
||||
{
|
||||
"name": "requirements-driven-development",
|
||||
"source": "./requirements-driven-workflow/",
|
||||
"description": "Streamlined requirements-driven development workflow with 90% quality gates for practical feature implementation",
|
||||
"version": "1.0.0",
|
||||
"author": {
|
||||
"name": "Claude Code Dev Workflows",
|
||||
"url": "https://github.com/cexll/myclaude"
|
||||
},
|
||||
"homepage": "https://github.com/cexll/myclaude",
|
||||
"repository": "https://github.com/cexll/myclaude",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
"requirements",
|
||||
"workflow",
|
||||
"automation",
|
||||
"quality-gates",
|
||||
"feature-development",
|
||||
"agile",
|
||||
"specifications"
|
||||
],
|
||||
"category": "workflows",
|
||||
"strict": false,
|
||||
"commands": [
|
||||
"./commands/requirements-pilot.md"
|
||||
],
|
||||
"agents": [
|
||||
"./agents/requirements-generate.md",
|
||||
"./agents/requirements-code.md",
|
||||
"./agents/requirements-testing.md",
|
||||
"./agents/requirements-review.md"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "bmad-agile-workflow",
|
||||
"source": "./bmad-agile-workflow/",
|
||||
"description": "Full BMAD agile workflow with role-based agents (PO, Architect, SM, Dev, QA) and interactive approval gates",
|
||||
"version": "1.0.0",
|
||||
"author": {
|
||||
"name": "Claude Code Dev Workflows",
|
||||
"url": "https://github.com/cexll/myclaude"
|
||||
},
|
||||
"homepage": "https://github.com/cexll/myclaude",
|
||||
"repository": "https://github.com/cexll/myclaude",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
"bmad",
|
||||
"agile",
|
||||
"scrum",
|
||||
"product-owner",
|
||||
"architect",
|
||||
"developer",
|
||||
"qa",
|
||||
"workflow-orchestration"
|
||||
],
|
||||
"category": "workflows",
|
||||
"strict": false,
|
||||
"commands": [
|
||||
"./commands/bmad-pilot.md"
|
||||
],
|
||||
"agents": [
|
||||
"./agents/bmad-po.md",
|
||||
"./agents/bmad-architect.md",
|
||||
"./agents/bmad-sm.md",
|
||||
"./agents/bmad-dev.md",
|
||||
"./agents/bmad-qa.md",
|
||||
"./agents/bmad-orchestrator.md",
|
||||
"./agents/bmad-review.md"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "development-essentials",
|
||||
"source": "./development-essentials/",
|
||||
"description": "Essential development commands for coding, debugging, testing, optimization, and documentation",
|
||||
"version": "1.0.0",
|
||||
"author": {
|
||||
"name": "Claude Code Dev Workflows",
|
||||
"url": "https://github.com/cexll/myclaude"
|
||||
},
|
||||
"homepage": "https://github.com/cexll/myclaude",
|
||||
"repository": "https://github.com/cexll/myclaude",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
"code",
|
||||
"debug",
|
||||
"test",
|
||||
"optimize",
|
||||
"review",
|
||||
"bugfix",
|
||||
"refactor",
|
||||
"documentation"
|
||||
],
|
||||
"category": "essentials",
|
||||
"strict": false,
|
||||
"commands": [
|
||||
"./commands/code.md",
|
||||
"./commands/debug.md",
|
||||
"./commands/test.md",
|
||||
"./commands/optimize.md",
|
||||
"./commands/review.md",
|
||||
"./commands/bugfix.md",
|
||||
"./commands/refactor.md",
|
||||
"./commands/docs.md",
|
||||
"./commands/ask.md",
|
||||
"./commands/think.md"
|
||||
],
|
||||
"agents": [
|
||||
"./agents/code.md",
|
||||
"./agents/bugfix.md",
|
||||
"./agents/bugfix-verify.md",
|
||||
"./agents/optimize.md",
|
||||
"./agents/debug.md"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "advanced-ai-agents",
|
||||
"source": "./advanced-ai-agents/",
|
||||
"description": "Advanced AI agent for complex problem solving and deep analysis with GPT-5 integration",
|
||||
"version": "1.0.0",
|
||||
"author": {
|
||||
"name": "Claude Code Dev Workflows",
|
||||
"url": "https://github.com/cexll/myclaude"
|
||||
},
|
||||
"homepage": "https://github.com/cexll/myclaude",
|
||||
"repository": "https://github.com/cexll/myclaude",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
"gpt5",
|
||||
"ai",
|
||||
"analysis",
|
||||
"problem-solving",
|
||||
"deep-research"
|
||||
],
|
||||
"category": "advanced",
|
||||
"strict": false,
|
||||
"commands": [],
|
||||
"agents": [
|
||||
"./agents/gpt5.md"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "requirements-clarity",
|
||||
"source": "./requirements-clarity/",
|
||||
"description": "Transforms vague requirements into actionable PRDs through systematic clarification with 100-point scoring system",
|
||||
"version": "1.0.0",
|
||||
"author": {
|
||||
"name": "Claude Code Dev Workflows",
|
||||
"url": "https://github.com/cexll/myclaude"
|
||||
},
|
||||
"homepage": "https://github.com/cexll/myclaude",
|
||||
"repository": "https://github.com/cexll/myclaude",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
"requirements",
|
||||
"clarification",
|
||||
"prd",
|
||||
"specifications",
|
||||
"quality-gates",
|
||||
"requirements-engineering"
|
||||
],
|
||||
"category": "essentials",
|
||||
"strict": false,
|
||||
"skills": [
|
||||
"./skills/SKILL.md"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "codex-cli",
|
||||
"source": "./skills/codex/",
|
||||
"description": "Execute Codex CLI for code analysis, refactoring, and automated code changes with file references (@syntax) and structured output",
|
||||
"version": "1.0.0",
|
||||
"author": {
|
||||
"name": "Claude Code Dev Workflows",
|
||||
"url": "https://github.com/cexll/myclaude"
|
||||
},
|
||||
"homepage": "https://github.com/cexll/myclaude",
|
||||
"repository": "https://github.com/cexll/myclaude",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
"codex",
|
||||
"code-analysis",
|
||||
"refactoring",
|
||||
"automation",
|
||||
"gpt-5",
|
||||
"ai-coding"
|
||||
],
|
||||
"category": "essentials",
|
||||
"strict": false,
|
||||
"skills": [
|
||||
"./SKILL.md"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "gemini-cli",
|
||||
"source": "./skills/gemini/",
|
||||
"description": "Execute Gemini CLI for AI-powered code analysis and generation with Google's latest Gemini models",
|
||||
"version": "1.0.0",
|
||||
"author": {
|
||||
"name": "Claude Code Dev Workflows",
|
||||
"url": "https://github.com/cexll/myclaude"
|
||||
},
|
||||
"homepage": "https://github.com/cexll/myclaude",
|
||||
"repository": "https://github.com/cexll/myclaude",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
"gemini",
|
||||
"google-ai",
|
||||
"code-analysis",
|
||||
"code-generation",
|
||||
"ai-reasoning"
|
||||
],
|
||||
"category": "essentials",
|
||||
"strict": false,
|
||||
"skills": [
|
||||
"./SKILL.md"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,3 +1,3 @@
|
||||
CLAUDE.md
|
||||
|
||||
.claude/
|
||||
.claude-trace
|
||||
|
||||
@@ -1,163 +0,0 @@
|
||||
# BMAD Pilot 使用指南
|
||||
|
||||
本指南介绍如何使用 BMAD Pilot 工作流,编排一组协作 AI 角色(PO/Architect/SM/Dev/QA)在仓库上下文中完成:01 产品需求文档、02 系统设计规范、03 冲刺计划,并自动进入开发与测试,整个过程包含多次用户确认门与质量评分。
|
||||
|
||||
参考阅读:BMAD-README.md(BMAD 方法概览)、BMAD-INTEGRATION-GUIDE.md(进阶集成)。
|
||||
|
||||
---
|
||||
|
||||
## 命令总览
|
||||
|
||||
- 命令:`/bmad-pilot <PROJECT_DESCRIPTION> [OPTIONS]`
|
||||
- 作用:在仓库上下文中,按阶段编排 `bmad-po → bmad-architect → bmad-sm → bmad-dev → bmad-qa`。
|
||||
- Orchestrator:由工作流统一编排(使用 bmad-orchestrator 进行仓库扫描)。
|
||||
|
||||
### Options
|
||||
- `--skip-tests`:跳过 QA 阶段
|
||||
- `--direct-dev`:跳过 SM 冲刺计划,架构后直接进入开发
|
||||
- `--skip-scan`:跳过初始仓库扫描(不推荐)
|
||||
|
||||
### 输出目录
|
||||
- 所有产出归档在:`./.claude/specs/{feature_name}/`
|
||||
- `00-repo-scan.md` — 仓库扫描摘要(自动生成)
|
||||
- `01-product-requirements.md` — 产品需求文档(确认后保存)
|
||||
- `02-system-architecture.md` — 系统设计规范(确认后保存)
|
||||
- `03-sprint-plan.md` — 冲刺计划(确认后保存;`--direct-dev` 时跳过)
|
||||
|
||||
`{feature_name}` 由 `<PROJECT_DESCRIPTION>` 生成(kebab-case:小写,空格/标点转 `-`,连续合并,首尾去除)。
|
||||
|
||||
---
|
||||
|
||||
## 快速开始
|
||||
|
||||
1) 执行 Pilot:
|
||||
```
|
||||
/bmad-pilot 为现有项目新增看板模块,支持多用户权限与移动端适配
|
||||
```
|
||||
2) 与 PO 交互澄清,直至 PRD ≥ 90 分 → 确认保存。
|
||||
3) 与 Architect 讨论技术决策,直至架构 ≥ 90 分 → 确认保存。
|
||||
4) 审阅并确认 SM 的冲刺计划(或使用 `--direct-dev` 跳过该阶段)。
|
||||
5) Dev 基于文档实现;QA 基于文档与实现测试(除非 `--skip-tests`)。
|
||||
6) 查看产出目录:`./.claude/specs/{feature_name}/`。
|
||||
|
||||
---
|
||||
|
||||
## 工作流阶段
|
||||
|
||||
- Phase 0:仓库扫描(自动,除非 `--skip-scan`)
|
||||
- Agent:`bmad-orchestrator`
|
||||
- 结果:扫描摘要返回并写入 `00-repo-scan.md`
|
||||
- 内容:项目类型、技术栈、代码组织、惯例、集成点、约束与注意事项
|
||||
|
||||
- Phase 1:产品需求(交互)
|
||||
- Agent:`bmad-po`
|
||||
- 循环:澄清问题 → 更新 PRD → 评分(目标 ≥ 90)
|
||||
- 确认门:PRD ≥ 90 分后,需要用户明确确认再继续
|
||||
- 保存:`01-product-requirements.md`
|
||||
|
||||
- Phase 2:系统架构(交互)
|
||||
- Agent:`bmad-architect`
|
||||
- 循环:技术选型与设计澄清 → 更新架构 → 评分(目标 ≥ 90)
|
||||
- 确认门:架构 ≥ 90 分后,需要用户明确确认再继续
|
||||
- 保存:`02-system-architecture.md`
|
||||
|
||||
- Phase 3:冲刺计划(交互,除非 `--direct-dev`)
|
||||
- Agent:`bmad-sm`
|
||||
- 循环:计划要点与问题澄清 → 更新计划 → 确认保存
|
||||
- 保存:`03-sprint-plan.md`
|
||||
|
||||
- Phase 4:开发实现(自动)
|
||||
- Agent:`bmad-dev`
|
||||
- 输入:PRD、架构、冲刺计划、`00-repo-scan.md`
|
||||
|
||||
- Phase 5:质量保障(自动,除非 `--skip-tests`)
|
||||
- Agent:`bmad-qa`
|
||||
- 输入:PRD、架构、冲刺计划、实现、`00-repo-scan.md`
|
||||
|
||||
---
|
||||
|
||||
## 交互与质量门
|
||||
|
||||
- 质控阈值:PRD 与架构质量评分需达到 ≥ 90 分。
|
||||
- 强制确认门:每个关键阶段完成后,Orchestrator 会停下等待你的“继续/确认”。
|
||||
- 迭代澄清:PO/Architect/SM 会提出 2-5 个精准问题,Orchestrator 转述并汇总你的回答以供下一轮完善。
|
||||
|
||||
---
|
||||
|
||||
## 仓库上下文
|
||||
|
||||
- 首次扫描:由工作流触发的 orchestrator 扫描(`bmad-orchestrator`)自动分析当前仓库(`--skip-scan` 可跳过)。
|
||||
- 缓存路径:`./.claude/specs/{feature_name}/00-repo-scan.md`(供所有后续 Agent 引用)。
|
||||
- 作用:提供技术栈识别、约定、测试模式、集成点,避免上下文丢失并保持一致性。
|
||||
|
||||
---
|
||||
|
||||
## 角色职责
|
||||
|
||||
- `bmad-po`:需求澄清与 PRD 产出,评分与问题驱动迭代。
|
||||
- `bmad-architect`:技术架构与关键决策,评分与问题驱动迭代。
|
||||
- `bmad-sm`:冲刺计划、任务拆分、依赖/风险/节奏规划。
|
||||
- `bmad-dev`:按文档实现、测试、日志/安全/性能与同构风格。
|
||||
- `bmad-qa`:基于需求与实现的全维度测试(单测/集成/E2E/性能/安全)。
|
||||
|
||||
---
|
||||
|
||||
## 示例
|
||||
|
||||
- 基础运行:
|
||||
```
|
||||
/bmad-pilot 在线商城结算流程升级,支持优惠券与发票
|
||||
```
|
||||
|
||||
- 跳过测试:
|
||||
```
|
||||
/bmad-pilot H5 活动页生成器 --skip-tests
|
||||
```
|
||||
|
||||
- 直接从架构进入开发(跳过 SM):
|
||||
```
|
||||
/bmad-pilot 小程序客服模块重构 --direct-dev
|
||||
```
|
||||
|
||||
- 跳过扫描(不推荐):
|
||||
```
|
||||
/bmad-pilot 部署流水线可视化 --skip-scan
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 目录结构
|
||||
|
||||
```
|
||||
.claude/
|
||||
specs/
|
||||
{feature_name}/
|
||||
00-repo-scan.md
|
||||
01-product-requirements.md
|
||||
02-system-architecture.md
|
||||
03-sprint-plan.md
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Tips & 常见问题
|
||||
|
||||
- 分数上不去:优先补齐评分分项的缺口(业务指标、关键流程、性能/安全约束等)。
|
||||
- 上下文不一致:检查并引用 `00-repo-scan.md` 的关键约定与模式,保证 PRD/架构/计划一致。
|
||||
- 依赖/网络受限:Dev/QA 的实际执行受环境影响;请在项目内准备依赖与测试环境,或先提交伪实现/测试策略。
|
||||
- 文档路径:确保在项目根目录执行,Pilot 会将文件写入 `./.claude/specs/{feature_name}/`。
|
||||
|
||||
---
|
||||
|
||||
## 最佳实践
|
||||
|
||||
- 小步快跑:每轮补充最关键信息,快速达成 ≥ 90 分文档。
|
||||
- 统一术语:在 PRD 固定术语词表;架构与代码沿用同名。
|
||||
- 用例先行:PRD 的验收标准应转化为 QA 的关键测试用例。
|
||||
- 复用模式:尽量沿用扫描识别的现有代码/测试模式,减少偏差。
|
||||
|
||||
---
|
||||
|
||||
## 版本记录
|
||||
|
||||
- 2025-08-11:新增仓库扫描摘要缓存 `00-repo-scan.md`,统一路径与跨阶段引用;明确确认门与目录预创建说明。
|
||||
339
BMAD-README.md
339
BMAD-README.md
@@ -1,339 +0,0 @@
|
||||
# BMAD方法论 Claude Code 使用指南
|
||||
|
||||
[](https://github.com/bmadcode/BMAD-METHOD)
|
||||
[](https://claude.ai/code)
|
||||
|
||||
> 从产品理念到代码实现的完整AI驱动敏捷开发工作流
|
||||
|
||||
## 🎯 什么是BMAD方法论?
|
||||
|
||||
BMAD (Business, Market, Architecture, Development) 是一个AI驱动的敏捷开发方法论,通过专业化代理团队实现从商业需求到技术实现的完整工作流程。
|
||||
|
||||
### 核心理念
|
||||
- **智能体规划**: 专门代理协作创建详细、一致的PRD和架构文档
|
||||
- **上下文工程开发**: 将详细计划转换为超详细的开发故事
|
||||
- **角色专业化**: 每个代理专注特定领域,避免角色切换导致的质量下降
|
||||
|
||||
## 🏗️ BMAD代理体系
|
||||
|
||||
### 代理角色说明
|
||||
- **PO (Product Owner)** - 产品负责人Sarah:需求分析、用户故事、验收标准
|
||||
- **Analyst** - 业务分析师Mary:市场研究、竞争分析、商业案例
|
||||
- **Architect** - 系统架构师Winston:技术架构、系统设计、技术选择
|
||||
- **SM (Scrum Master)** - 敏捷教练:任务分解、冲刺规划、流程协调
|
||||
- **Dev (Developer)** - 开发工程师:代码实现、技术文档
|
||||
- **QA (Quality Assurance)** - 质量保证:测试策略、质量验证
|
||||
- **UX Expert** - 用户体验专家:交互设计、可用性测试
|
||||
|
||||
## 🚀 快速开始
|
||||
|
||||
### 安装配置
|
||||
BMAD方法论已集成到您的Claude Code系统中,无需额外安装。
|
||||
|
||||
### 基本使用方法
|
||||
|
||||
#### 1. 完整BMAD工作流
|
||||
```bash
|
||||
# 一键执行完整开发流程
|
||||
/bmad-pilot "实现企业级用户管理系统,支持RBAC权限控制和LDAP集成"
|
||||
|
||||
# 执行流程:PO → Architect → SM → Dev → QA
|
||||
```
|
||||
|
||||
#### 2. 常用选项
|
||||
```bash
|
||||
# 跳过测试(PO → Architect → SM → Dev)
|
||||
/bmad-pilot "实现支付网关API" --skip-tests
|
||||
|
||||
# 直接从架构进入开发(跳过 SM 规划)
|
||||
/bmad-pilot "设计微服务电商平台" --direct-dev
|
||||
|
||||
# 跳过仓库扫描(不推荐)
|
||||
/bmad-pilot "用户界面优化" --skip-scan
|
||||
```
|
||||
|
||||
#### 3. 直接开发与部分流程
|
||||
```bash
|
||||
# 技术焦点(架构后直接进入开发与测试)
|
||||
/bmad-pilot "API网关实现" --direct-dev
|
||||
|
||||
# 完整设计流程(需求→架构→规划→开发→测试)
|
||||
/bmad-pilot "系统重构规划"
|
||||
|
||||
# 仅业务相关分析 → 请使用下方“独立代理使用”中的 /bmad-po 与 /bmad-analyst
|
||||
```
|
||||
|
||||
#### 4. 独立代理使用
|
||||
```bash
|
||||
# 产品需求分析
|
||||
/bmad-po "企业CRM系统功能需求定义"
|
||||
|
||||
# 市场调研分析
|
||||
/bmad-analyst "SaaS市场竞争格局和机会分析"
|
||||
|
||||
# 系统架构设计
|
||||
/bmad-architect "高并发分布式系统架构设计"
|
||||
|
||||
# 主协调器(可转换为任意代理)
|
||||
/bmad-orchestrator "协调多代理完成复杂项目"
|
||||
```
|
||||
|
||||
## 📋 详细命令说明
|
||||
|
||||
### `/bmad-pilot` - 完整工作流执行
|
||||
**用法**: `/bmad-pilot <项目描述> [选项]`
|
||||
|
||||
**选项**:
|
||||
- `--skip-tests`: 跳过 QA 阶段
|
||||
- `--direct-dev`: 跳过 SM 冲刺计划,架构后直接进入开发
|
||||
- `--skip-scan`: 跳过初始仓库扫描(不推荐)
|
||||
|
||||
**示例**:
|
||||
```bash
|
||||
/bmad-pilot "构建在线教育平台,支持直播、录播、作业系统"
|
||||
/bmad-pilot "API网关设计" --direct-dev
|
||||
/bmad-pilot "支付模块" --skip-tests
|
||||
```
|
||||
|
||||
### `/bmad-po` - 产品负责人
|
||||
**角色**: Sarah - 技术产品负责人 & 流程管家
|
||||
**专长**: 需求分析、用户故事、验收标准、冲刺规划
|
||||
|
||||
**用法**: `/bmad-po <需求描述>`
|
||||
|
||||
**工作流程**:
|
||||
1. 需求分解和功能点识别
|
||||
2. 用户故事创建(As a... I want... So that...)
|
||||
3. 验收标准定义和优先级排序
|
||||
4. 利益相关者验证和签署
|
||||
|
||||
**示例**:
|
||||
```bash
|
||||
/bmad-po "设计企业级权限管理系统,支持多租户和细粒度权限控制"
|
||||
/bmad-po "移动端电商APP功能需求分析"
|
||||
```
|
||||
|
||||
### `/bmad-analyst` - 业务分析师
|
||||
**角色**: Mary - 洞察分析师 & 战略合作伙伴
|
||||
**专长**: 市场研究、竞争分析、商业案例开发、利益相关者分析
|
||||
|
||||
**用法**: `/bmad-analyst <分析主题>`
|
||||
|
||||
**工作流程**:
|
||||
1. 市场格局和竞争对手分析
|
||||
2. 商业案例开发和ROI分析
|
||||
3. 利益相关者分析和需求收集
|
||||
4. 项目简报和战略建议
|
||||
|
||||
**示例**:
|
||||
```bash
|
||||
/bmad-analyst "企业级认证市场分析,JWT vs OAuth2.0 vs SAML"
|
||||
/bmad-analyst "云原生架构迁移的商业价值和风险评估"
|
||||
```
|
||||
|
||||
### `/bmad-architect` - 系统架构师
|
||||
**角色**: Winston - 全栈系统架构师 & 技术领导者
|
||||
**专长**: 系统设计、技术选择、API设计、基础架构规划
|
||||
|
||||
**用法**: `/bmad-architect <系统设计需求>`
|
||||
|
||||
**工作流程**:
|
||||
1. 系统需求和约束分析
|
||||
2. 技术栈和架构模式选择
|
||||
3. 组件设计和系统架构图
|
||||
4. 实施策略和开发指导
|
||||
|
||||
**示例**:
|
||||
```bash
|
||||
/bmad-architect "微服务架构设计,支持事件驱动和最终一致性"
|
||||
/bmad-architect "高可用API网关架构,支持限流、熔断、监控"
|
||||
```
|
||||
|
||||
### `/bmad-orchestrator` - 主协调器
|
||||
**角色**: BMAD主协调器
|
||||
**专长**: 工作流协调、代理转换、多代理任务管理
|
||||
|
||||
**用法**: `/bmad-orchestrator [命令] [参数]`
|
||||
|
||||
**功能**:
|
||||
- 动态转换为任意专门代理
|
||||
- 协调复杂多代理工作流
|
||||
- 管理代理间的上下文传递
|
||||
- 提供工作流指导和建议
|
||||
|
||||
## 🔄 与现有系统集成
|
||||
|
||||
### 现有系统 vs BMAD方法论
|
||||
|
||||
| 特性 | Requirements-Pilot | BMAD方法论 |
|
||||
|------|-------------------|-----------|
|
||||
| **执行时间** | 30分钟 | 1-2小时 |
|
||||
| **适用场景** | 快速功能开发 | 企业级项目 |
|
||||
| **覆盖范围** | 技术实现 | 商业+技术全流程 |
|
||||
| **质量门控** | 90%技术质量 | 多维度质量验证 |
|
||||
| **代理数量** | 4个技术代理 | 7个全角色代理 |
|
||||
|
||||
### 使用场景建议
|
||||
|
||||
#### 🚅 快速开发(推荐现有系统)
|
||||
```bash
|
||||
# 简单功能快速实现
|
||||
/requirements-pilot "添加用户登录功能"
|
||||
/requirements-pilot "实现数据导出API"
|
||||
```
|
||||
|
||||
#### 🏢 企业级项目(推荐BMAD)
|
||||
```bash
|
||||
# 复杂系统完整流程
|
||||
/bmad-pilot "构建企业级ERP系统,集成财务、人事、项目管理模块"
|
||||
/bmad-pilot "设计多租户SaaS平台,支持自定义配置和第三方集成"
|
||||
```
|
||||
|
||||
#### 🔄 混合模式(规划+实现)
|
||||
```bash
|
||||
# 先用BMAD做规划(在 PRD/架构确认门停留)
|
||||
/bmad-pilot "电商平台架构设计"
|
||||
|
||||
# 再用现有系统快速实现
|
||||
/requirements-pilot "基于架构规格实现用户服务模块"
|
||||
/requirements-pilot "基于架构规格实现订单服务模块"
|
||||
```
|
||||
|
||||
## 🎯 典型工作流示例
|
||||
|
||||
### 示例1: 企业级认证系统
|
||||
```bash
|
||||
# 完整BMAD流程
|
||||
/bmad-pilot "企业级JWT认证系统,支持RBAC权限控制、LDAP集成、审计日志、高可用部署"
|
||||
|
||||
# 预期输出:
|
||||
# 1. PO: 详细用户故事和验收标准
|
||||
# 2. Architect: 完整系统架构和技术选择
|
||||
# 3. SM: 开发任务分解和冲刺计划
|
||||
# 4. Dev: 生产就绪代码实现
|
||||
# 5. QA: 测试策略与用例并执行(可选)
|
||||
```
|
||||
|
||||
### 示例2: API网关开发
|
||||
```bash
|
||||
# 技术焦点流程(跳过SM,架构后直接进入开发)
|
||||
/bmad-pilot "高性能API网关,支持限流、熔断、监控、服务发现" --direct-dev
|
||||
|
||||
# 执行流程:
|
||||
# 1. Architect: 系统架构设计
|
||||
# 2. Dev: 代码实现
|
||||
# 3. QA: 性能测试和质量验证
|
||||
```
|
||||
|
||||
### 示例3: 产品市场分析
|
||||
```bash
|
||||
# 业务分析流程(使用独立代理)
|
||||
/bmad-po "云原生数据库市场机会分析的产品需求假设与范围界定"
|
||||
/bmad-analyst "云原生数据库市场机会分析"
|
||||
|
||||
# 执行流程:
|
||||
# 1. PO: 产品需求定义
|
||||
# 2. Analyst: 市场研究和竞争分析
|
||||
```
|
||||
|
||||
## 📊 质量保证体系
|
||||
|
||||
### BMAD质量标准
|
||||
- **需求完整性**: 90+ 分需求清晰度评分
|
||||
- **商业对齐**: 明确的价值主张和市场定位
|
||||
- **架构完善**: 全面的系统设计和技术选择
|
||||
- **实现就绪**: 可执行的开发规格和质量标准
|
||||
|
||||
### 集成现有质量门控
|
||||
- 保持90%技术质量阈值
|
||||
- 增加商业价值验证维度
|
||||
- 多代理交叉验证机制
|
||||
- 自动化质量反馈循环
|
||||
|
||||
## 🔧 高级用法和最佳实践
|
||||
|
||||
### 1. 渐进式复杂度管理
|
||||
```bash
|
||||
# MVP阶段
|
||||
/bmad-workflow "用户管理系统MVP版本" --phase=development
|
||||
|
||||
# 功能增强阶段
|
||||
/bmad-analyst "用户反馈分析和功能增强建议"
|
||||
/requirements-pilot "基于反馈实现增强功能"
|
||||
|
||||
# 企业级增强
|
||||
/bmad-workflow "企业级安全增强和合规支持" --agents=architect,dev,qa
|
||||
```
|
||||
|
||||
### 2. 跨项目知识管理
|
||||
```bash
|
||||
# 项目文档化
|
||||
/bmad-orchestrator "将当前项目架构文档化,便于后续项目参考"
|
||||
|
||||
# 最佳实践提取
|
||||
/bmad-architect "基于项目经验总结微服务架构最佳实践"
|
||||
```
|
||||
|
||||
### 3. 团队协作优化
|
||||
```bash
|
||||
# 团队能力评估
|
||||
/bmad-analyst "评估团队技术栈和能力匹配度"
|
||||
|
||||
# 开发计划调整
|
||||
/bmad-po "根据团队能力调整功能优先级和实现计划"
|
||||
```
|
||||
|
||||
## 🚦 故障排除
|
||||
|
||||
### 常见问题
|
||||
|
||||
**Q: BMAD工作流执行时间较长,如何优化?**
|
||||
A:
|
||||
- 简单功能使用 `/requirements-pilot`
|
||||
- 复杂项目使用分阶段执行 `--phase=planning`
|
||||
- 使用自定义代理序列减少不必要的步骤
|
||||
|
||||
**Q: 如何在BMAD和现有系统间选择?**
|
||||
A:
|
||||
- 项目复杂度 < 中等:使用 `/requirements-pilot`
|
||||
- 项目复杂度 ≥ 高:使用 `/bmad-workflow`
|
||||
- 需要商业分析:必须使用BMAD
|
||||
- 纯技术实现:可选择任一系统
|
||||
|
||||
**Q: 代理输出质量不符合预期怎么办?**
|
||||
A:
|
||||
- 提供更详细的项目描述
|
||||
- 使用分阶段执行,逐步细化
|
||||
- 结合独立代理使用进行专项优化
|
||||
|
||||
## 🎉 开始你的BMAD之旅
|
||||
|
||||
### 第一次使用
|
||||
```bash
|
||||
# 体验完整BMAD工作流
|
||||
/bmad-workflow "构建一个简单的博客系统,支持文章发布、评论、用户管理"
|
||||
```
|
||||
|
||||
### 学习不同代理角色
|
||||
```bash
|
||||
# 产品思维
|
||||
/bmad-po "分析博客系统的用户需求和使用场景"
|
||||
|
||||
# 商业思维
|
||||
/bmad-analyst "个人博客vs企业CMS市场定位分析"
|
||||
|
||||
# 技术思维
|
||||
/bmad-architect "可扩展博客系统架构设计"
|
||||
```
|
||||
|
||||
## 📚 进阶学习资源
|
||||
|
||||
- [BMAD-METHOD原理](https://github.com/bmadcode/BMAD-METHOD)
|
||||
- [Claude Code文档](https://docs.anthropic.com/en/docs/claude-code)
|
||||
- [敏捷开发最佳实践](https://agilemanifesto.org/)
|
||||
|
||||
---
|
||||
|
||||
**BMAD方法论 + Claude Code = 从理念到代码的完整AI开发工作流** 🚀
|
||||
|
||||
开始使用BMAD方法论,体验专业化AI代理团队带来的开发效率和质量提升!
|
||||
143
Makefile
Normal file
143
Makefile
Normal file
@@ -0,0 +1,143 @@
|
||||
# Claude Code Multi-Agent Workflow System Makefile
|
||||
# Quick deployment for BMAD and Requirements workflows
|
||||
|
||||
.PHONY: help install deploy-bmad deploy-requirements deploy-essentials deploy-advanced deploy-all deploy-commands deploy-agents clean test
|
||||
|
||||
# Default target
|
||||
help:
|
||||
@echo "Claude Code Multi-Agent Workflow - Quick Deployment"
|
||||
@echo ""
|
||||
@echo "Usage: make [target]"
|
||||
@echo ""
|
||||
@echo "Targets:"
|
||||
@echo " install - Install all configurations to Claude Code"
|
||||
@echo " deploy-bmad - Deploy BMAD workflow (bmad-pilot)"
|
||||
@echo " deploy-requirements - Deploy Requirements workflow (requirements-pilot)"
|
||||
@echo " deploy-essentials - Deploy Development Essentials workflow"
|
||||
@echo " deploy-advanced - Deploy Advanced AI Agents"
|
||||
@echo " deploy-commands - Deploy all slash commands"
|
||||
@echo " deploy-agents - Deploy all agent configurations"
|
||||
@echo " deploy-all - Deploy everything (commands + agents)"
|
||||
@echo " test-bmad - Test BMAD workflow with sample"
|
||||
@echo " test-requirements - Test Requirements workflow with sample"
|
||||
@echo " clean - Clean generated artifacts"
|
||||
@echo " help - Show this help message"
|
||||
|
||||
# Configuration paths
|
||||
CLAUDE_CONFIG_DIR = ~/.claude
|
||||
SPECS_DIR = .claude/specs
|
||||
|
||||
# Workflow directories
|
||||
BMAD_DIR = bmad-agile-workflow
|
||||
REQUIREMENTS_DIR = requirements-driven-workflow
|
||||
ESSENTIALS_DIR = development-essentials
|
||||
ADVANCED_DIR = advanced-ai-agents
|
||||
OUTPUT_STYLES_DIR = output-styles
|
||||
|
||||
# Install all configurations
|
||||
install: deploy-all
|
||||
@echo "✅ Installation complete!"
|
||||
|
||||
# Deploy BMAD workflow
|
||||
deploy-bmad:
|
||||
@echo "🚀 Deploying BMAD workflow..."
|
||||
@mkdir -p $(CLAUDE_CONFIG_DIR)/commands
|
||||
@mkdir -p $(CLAUDE_CONFIG_DIR)/agents
|
||||
@mkdir -p $(CLAUDE_CONFIG_DIR)/output-styles
|
||||
@cp $(BMAD_DIR)/commands/bmad-pilot.md $(CLAUDE_CONFIG_DIR)/commands/
|
||||
@cp $(BMAD_DIR)/agents/*.md $(CLAUDE_CONFIG_DIR)/agents/
|
||||
@cp $(OUTPUT_STYLES_DIR)/bmad.md $(CLAUDE_CONFIG_DIR)/output-styles/ 2>/dev/null || true
|
||||
@echo "✅ BMAD workflow deployed successfully!"
|
||||
@echo " Usage: /bmad-pilot \"your feature description\""
|
||||
|
||||
# Deploy Requirements workflow
|
||||
deploy-requirements:
|
||||
@echo "🚀 Deploying Requirements workflow..."
|
||||
@mkdir -p $(CLAUDE_CONFIG_DIR)/commands
|
||||
@mkdir -p $(CLAUDE_CONFIG_DIR)/agents
|
||||
@cp $(REQUIREMENTS_DIR)/commands/requirements-pilot.md $(CLAUDE_CONFIG_DIR)/commands/
|
||||
@cp $(REQUIREMENTS_DIR)/agents/*.md $(CLAUDE_CONFIG_DIR)/agents/
|
||||
@echo "✅ Requirements workflow deployed successfully!"
|
||||
@echo " Usage: /requirements-pilot \"your feature description\""
|
||||
|
||||
# Deploy Development Essentials workflow
|
||||
deploy-essentials:
|
||||
@echo "🚀 Deploying Development Essentials workflow..."
|
||||
@mkdir -p $(CLAUDE_CONFIG_DIR)/commands
|
||||
@mkdir -p $(CLAUDE_CONFIG_DIR)/agents
|
||||
@cp $(ESSENTIALS_DIR)/commands/*.md $(CLAUDE_CONFIG_DIR)/commands/
|
||||
@cp $(ESSENTIALS_DIR)/agents/*.md $(CLAUDE_CONFIG_DIR)/agents/
|
||||
@echo "✅ Development Essentials deployed successfully!"
|
||||
@echo " Available commands: /ask, /code, /debug, /test, /review, /optimize, /bugfix, /refactor, /docs, /think"
|
||||
|
||||
# Deploy Advanced AI Agents
|
||||
deploy-advanced:
|
||||
@echo "🚀 Deploying Advanced AI Agents..."
|
||||
@mkdir -p $(CLAUDE_CONFIG_DIR)/agents
|
||||
@cp $(ADVANCED_DIR)/agents/*.md $(CLAUDE_CONFIG_DIR)/agents/
|
||||
@echo "✅ Advanced AI Agents deployed successfully!"
|
||||
|
||||
# Deploy all commands
|
||||
deploy-commands:
|
||||
@echo "📦 Deploying all slash commands..."
|
||||
@mkdir -p $(CLAUDE_CONFIG_DIR)/commands
|
||||
@cp $(BMAD_DIR)/commands/*.md $(CLAUDE_CONFIG_DIR)/commands/
|
||||
@cp $(REQUIREMENTS_DIR)/commands/*.md $(CLAUDE_CONFIG_DIR)/commands/
|
||||
@cp $(ESSENTIALS_DIR)/commands/*.md $(CLAUDE_CONFIG_DIR)/commands/
|
||||
@echo "✅ All commands deployed!"
|
||||
@echo " Available commands:"
|
||||
@echo " - /bmad-pilot (Full agile workflow)"
|
||||
@echo " - /requirements-pilot (Requirements-driven)"
|
||||
@echo " - /ask, /code, /debug, /test, /review"
|
||||
@echo " - /optimize, /bugfix, /refactor, /docs, /think"
|
||||
|
||||
# Deploy all agents
|
||||
deploy-agents:
|
||||
@echo "🤖 Deploying all agents..."
|
||||
@mkdir -p $(CLAUDE_CONFIG_DIR)/agents
|
||||
@cp $(BMAD_DIR)/agents/*.md $(CLAUDE_CONFIG_DIR)/agents/
|
||||
@cp $(REQUIREMENTS_DIR)/agents/*.md $(CLAUDE_CONFIG_DIR)/agents/
|
||||
@cp $(ESSENTIALS_DIR)/agents/*.md $(CLAUDE_CONFIG_DIR)/agents/
|
||||
@cp $(ADVANCED_DIR)/agents/*.md $(CLAUDE_CONFIG_DIR)/agents/
|
||||
@echo "✅ All agents deployed!"
|
||||
|
||||
# Deploy everything
|
||||
deploy-all: deploy-commands deploy-agents
|
||||
@mkdir -p $(CLAUDE_CONFIG_DIR)/output-styles
|
||||
@cp $(OUTPUT_STYLES_DIR)/*.md $(CLAUDE_CONFIG_DIR)/output-styles/ 2>/dev/null || true
|
||||
@echo "✨ Full deployment complete!"
|
||||
@echo ""
|
||||
@echo "Quick Start:"
|
||||
@echo " BMAD: /bmad-pilot \"build user authentication\""
|
||||
@echo " Requirements: /requirements-pilot \"implement JWT auth\""
|
||||
@echo " Manual: /ask → /code → /test → /review"
|
||||
|
||||
# Test BMAD workflow
|
||||
test-bmad:
|
||||
@echo "🧪 Testing BMAD workflow..."
|
||||
@echo "Run in Claude Code:"
|
||||
@echo '/bmad-pilot "Simple todo list with add/delete functions"'
|
||||
|
||||
# Test Requirements workflow
|
||||
test-requirements:
|
||||
@echo "🧪 Testing Requirements workflow..."
|
||||
@echo "Run in Claude Code:"
|
||||
@echo '/requirements-pilot "Basic CRUD API for products"'
|
||||
|
||||
# Clean generated artifacts
|
||||
clean:
|
||||
@echo "🧹 Cleaning artifacts..."
|
||||
@rm -rf $(SPECS_DIR)
|
||||
@echo "✅ Cleaned!"
|
||||
|
||||
# Quick deployment shortcuts
|
||||
bmad: deploy-bmad
|
||||
requirements: deploy-requirements
|
||||
essentials: deploy-essentials
|
||||
advanced: deploy-advanced
|
||||
all: deploy-all
|
||||
|
||||
# Version info
|
||||
version:
|
||||
@echo "Claude Code Multi-Agent Workflow System v3.1"
|
||||
@echo "BMAD + Requirements-Driven Development"
|
||||
95
PLUGIN_README.md
Normal file
95
PLUGIN_README.md
Normal file
@@ -0,0 +1,95 @@
|
||||
# Claude Code Plugin System
|
||||
|
||||
本项目已支持Claude Code插件系统,可以将命令和代理打包成可安装的插件包。
|
||||
|
||||
## 插件配置
|
||||
|
||||
插件配置文件位于 `.claude-plugin/marketplace.json`,定义了所有可用的插件包。
|
||||
|
||||
## 可用插件
|
||||
|
||||
### 1. Requirements-Driven Development
|
||||
- **描述**: 需求驱动的开发工作流,包含90%质量门控
|
||||
- **命令**: `/requirements-pilot`
|
||||
- **代理**: requirements-generate, requirements-code, requirements-testing, requirements-review
|
||||
|
||||
### 2. BMAD Agile Workflow
|
||||
- **描述**: 完整的BMAD敏捷工作流(产品负责人→架构师→SM→开发→QA)
|
||||
- **命令**: `/bmad-pilot`
|
||||
- **代理**: bmad-po, bmad-architect, bmad-sm, bmad-dev, bmad-qa, bmad-orchestrator
|
||||
|
||||
### 3. Development Essentials
|
||||
- **描述**: 核心开发命令套件
|
||||
- **命令**: `/code`, `/debug`, `/test`, `/optimize`, `/review`, `/bugfix`, `/refactor`, `/docs`, `/ask`, `/think`
|
||||
- **代理**: code, bugfix, bugfix-verify, code-optimize, debug, develop
|
||||
|
||||
### 4. Advanced AI Agents
|
||||
- **描述**: 高级AI代理,集成GPT-5进行深度分析
|
||||
- **代理**: gpt5
|
||||
|
||||
## 使用插件命令
|
||||
|
||||
### 列出所有可用插件
|
||||
```bash
|
||||
/plugin list
|
||||
```
|
||||
|
||||
### 查看插件详情
|
||||
```bash
|
||||
/plugin info <plugin-name>
|
||||
```
|
||||
例如:`/plugin info requirements-driven-development`
|
||||
|
||||
### 安装插件
|
||||
```bash
|
||||
/plugin install <plugin-name>
|
||||
```
|
||||
例如:`/plugin install bmad-agile-workflow`
|
||||
|
||||
### 移除插件
|
||||
```bash
|
||||
/plugin remove <plugin-name>
|
||||
```
|
||||
|
||||
## 创建自定义插件
|
||||
|
||||
要创建自己的插件:
|
||||
|
||||
1. 在 `.claude-plugin/marketplace.json` 中添加新的插件定义
|
||||
2. 指定插件包含的命令和代理文件路径
|
||||
3. 设置适当的元数据(版本、作者、关键词等)
|
||||
|
||||
示例插件结构:
|
||||
```json
|
||||
{
|
||||
"name": "my-custom-plugin",
|
||||
"source": "./",
|
||||
"description": "自定义插件描述",
|
||||
"version": "1.0.0",
|
||||
"commands": [
|
||||
"./commands/my-command.md"
|
||||
],
|
||||
"agents": [
|
||||
"./agents/my-agent.md"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## 分享插件
|
||||
|
||||
要分享插件给其他项目:
|
||||
1. 复制整个 `.claude-plugin` 目录到目标项目
|
||||
2. 确保相关的命令和代理文件存在
|
||||
3. 在新项目中使用 `/plugin` 命令管理插件
|
||||
|
||||
## 注意事项
|
||||
|
||||
- 插件系统遵循Claude Code的插件规范
|
||||
- 所有命令和代理文件必须是有效的Markdown格式
|
||||
- 插件配置支持版本管理和依赖关系
|
||||
- 插件可以包含多个命令、代理和输出样式
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [Claude Code插件文档](https://docs.claude.com/en/docs/claude-code/plugins)
|
||||
- [示例插件仓库](https://github.com/wshobson/agents)
|
||||
498
README-zh.md
498
README-zh.md
@@ -1,498 +0,0 @@
|
||||
# Claude Code 多智能体工作流系统
|
||||
|
||||
[](https://opensource.org/licenses/MIT)
|
||||
[](https://claude.ai/code)
|
||||
|
||||
> 将开发流程从手动命令链升级为自动化专家团队,95%质量保证。
|
||||
|
||||
## 🚀 从手工作坊到自动化工厂
|
||||
|
||||
**传统方式**: 手动命令链,需要持续监督
|
||||
```bash
|
||||
/ask → /code → /test → /review → /optimize
|
||||
# 1-2小时手动操作,上下文污染,质量不确定
|
||||
```
|
||||
|
||||
**现在**: 一键自动化专家工作流
|
||||
```bash
|
||||
/requirements-pilot "实现JWT用户认证系统"
|
||||
# 30分钟自动执行,90%质量门控,零人工干预
|
||||
```
|
||||
|
||||
## 🎯 核心价值主张
|
||||
|
||||
本仓库提供了一个**Claude Code元框架**,实现:
|
||||
|
||||
- **🤖 多智能体协调**: 专业AI团队并行工作
|
||||
- **⚡ 质量门控自动化**: 95%阈值自动优化循环
|
||||
- **🔄 工作流自动化**: 从需求到生产就绪代码
|
||||
- **📊 上下文隔离**: 每个智能体保持专注专业性,无污染
|
||||
|
||||
## 📋 两种主要使用模式
|
||||
|
||||
### 1. 🏭 Requirements-Driven 工作流(自动化专家团队)
|
||||
|
||||
**架构**: 需求导向工作流与质量门控
|
||||
```
|
||||
requirements-generate → requirements-code → requirements-review → (≥90%?) → requirements-testing
|
||||
↑ ↓ (<90%)
|
||||
←←←←←← 自动优化循环 ←←←←←←
|
||||
```
|
||||
|
||||
**使用方法**:
|
||||
```bash
|
||||
# 一条命令完成完整开发工作流
|
||||
/requirements-pilot "构建用户管理系统,支持RBAC权限控制"
|
||||
|
||||
# 高级多阶段工作流
|
||||
先使用 requirements-generate,然后 requirements-code,再用 requirements-review,
|
||||
如果评分 ≥90% 则使用 requirements-testing
|
||||
```
|
||||
|
||||
**质量评分体系** (总分100%):
|
||||
- 功能性 (40%)
|
||||
- 集成性 (25%)
|
||||
- 代码质量 (20%)
|
||||
- 性能 (15%)
|
||||
|
||||
### 2. 🎛️ 自定义命令(手动编排)
|
||||
|
||||
**架构**: 针对性专业技能的独立斜杠命令
|
||||
```bash
|
||||
/ask # 技术咨询和架构指导
|
||||
/code # 功能实现,带约束条件
|
||||
/debug # 使用UltraThink方法论的系统化问题分析
|
||||
/test # 全面测试策略
|
||||
/review # 多维度代码验证
|
||||
/optimize # 性能优化协调
|
||||
/bugfix # 错误解决工作流
|
||||
/refactor # 代码重构协调
|
||||
/docs # 文档生成
|
||||
/think # 高级思考和分析
|
||||
```
|
||||
|
||||
**渐进式示例**:
|
||||
```bash
|
||||
# 逐步开发,手动控制每个环节
|
||||
/ask "帮我理解微服务架构需求"
|
||||
/code "实现带限流功能的网关"
|
||||
/test "创建负载测试套件"
|
||||
/review "验证安全性和性能"
|
||||
/optimize "为生产环境优化性能"
|
||||
```
|
||||
|
||||
## 🚀 快速开始
|
||||
|
||||
### 1. 配置设置
|
||||
|
||||
克隆或复制配置结构:
|
||||
```bash
|
||||
# 你的项目目录
|
||||
├── commands/ # 11个专业斜杠命令
|
||||
├── agents/ # 9个专家智能体配置
|
||||
└── CLAUDE.md # 项目特定指导原则
|
||||
```
|
||||
|
||||
### 2. 基本使用
|
||||
|
||||
**完整功能开发**:
|
||||
```bash
|
||||
/requirements-pilot "实现OAuth2认证,支持刷新令牌"
|
||||
```
|
||||
|
||||
**BMAD Pilot(产品→架构→冲刺→开发→测试,含确认门)**:
|
||||
```bash
|
||||
/bmad-pilot "新增看板模块,支持角色权限与移动端"
|
||||
# 选项:--skip-tests | --direct-dev | --skip-scan
|
||||
```
|
||||
|
||||
**手动开发流程**:
|
||||
```bash
|
||||
/ask "可扩展微服务的设计原则"
|
||||
/code "实现OAuth2,遵循安全最佳实践"
|
||||
/test "创建全面测试套件"
|
||||
/review "验证实现质量"
|
||||
```
|
||||
|
||||
### 3. 预期输出
|
||||
|
||||
**自动化工作流结果**:
|
||||
- ✅ 需求确认,90+质量评分
|
||||
- ✅ 实现就绪技术规格
|
||||
- ✅ 生产就绪代码,遵循最佳实践
|
||||
- ✅ 全面测试套件 (单元 + 集成 + 功能测试)
|
||||
- ✅ 90%+ 质量验证评分
|
||||
|
||||
## 🏗️ 架构概览
|
||||
|
||||
### 核心组件
|
||||
|
||||
#### **Commands 目录** (`/commands/`)
|
||||
- **咨询服务**: `/ask` - 架构指导(不修改代码)
|
||||
- **实现工具**: `/code` - 带约束的功能开发
|
||||
- **质量保证**: `/test`, `/review`, `/debug`
|
||||
- **优化工具**: `/optimize`, `/refactor`
|
||||
- **错误解决**: `/bugfix` - 系统化错误修复工作流
|
||||
- **文档工具**: `/docs` - 文档生成
|
||||
- **分析工具**: `/think` - 高级思考和分析
|
||||
- **需求工具**: `/requirements-pilot` - 完整需求驱动工作流
|
||||
- **BMAD Pilot**: `/bmad-pilot` - 多智能体质控工作流(PO → Architect → SM → Dev → QA)
|
||||
|
||||
#### **Agents 目录** (`/agents/`)
|
||||
- **requirements-generate**: 为代码生成优化的技术规格生成
|
||||
- **requirements-code**: 最小架构开销的直接实现智能体
|
||||
- **requirements-review**: 专注功能性和可维护性的实用代码审查
|
||||
- **requirements-testing**: 专注功能验证的实用测试智能体
|
||||
- **bugfix**: 分析和修复软件缺陷的错误解决专家
|
||||
- **bugfix-verify**: 客观评估的修复验证专家
|
||||
- **code**: 直接实现的开发协调器
|
||||
- **debug**: UltraThink系统化问题分析
|
||||
- **optimize**: 性能优化协调
|
||||
|
||||
### 多智能体协调系统
|
||||
|
||||
**4个核心专家**:
|
||||
1. **需求生成专家** - 实现就绪的技术规格
|
||||
2. **代码实现专家** - 直接、实用的代码实现
|
||||
3. **质量审查专家** - 实用质量审查与评分
|
||||
4. **测试协调专家** - 功能验证和测试
|
||||
|
||||
**关键特性**:
|
||||
- **独立上下文**: 专家间无上下文污染
|
||||
- **质量门控**: 90%阈值自动进展判断
|
||||
- **迭代改进**: 自动优化循环
|
||||
- **可追溯性**: 完整规格 → 代码 → 测试追溯链
|
||||
|
||||
## 📚 工作流示例
|
||||
|
||||
### 企业用户认证系统
|
||||
|
||||
**输入**:
|
||||
```bash
|
||||
/requirements-pilot "企业JWT认证系统,支持RBAC,500并发用户,集成现有LDAP"
|
||||
```
|
||||
|
||||
**自动化执行过程**:
|
||||
1. **需求确认** (质量: 92/100) - 交互式澄清
|
||||
- 功能清晰度、技术特定性、实现完整性
|
||||
- **决策**: ≥90%,进入实现阶段
|
||||
|
||||
2. **第1轮** (质量: 83/100) - 基础实现
|
||||
- 问题: 错误处理不完整,集成问题
|
||||
- **决策**: <90%,重新开始并改进
|
||||
|
||||
3. **第2轮** (质量: 93/100) - 生产就绪
|
||||
- **决策**: ≥90%,进入功能测试
|
||||
|
||||
**最终交付物**:
|
||||
- 质量评估的需求确认
|
||||
- 实现就绪技术规格
|
||||
- 带RBAC的实用JWT实现
|
||||
- 带正确错误处理的LDAP集成
|
||||
- 专注关键路径的功能测试套件
|
||||
|
||||
### API网关开发
|
||||
|
||||
**输入**:
|
||||
```bash
|
||||
/ask "高性能API网关的设计考虑"
|
||||
# (交互式咨询阶段)
|
||||
|
||||
/code "实现微服务API网关,支持限流和熔断器"
|
||||
# (实现阶段)
|
||||
|
||||
/test "为网关创建全面测试套件"
|
||||
# (测试阶段)
|
||||
```
|
||||
|
||||
**结果**:
|
||||
- 性能模式的架构咨询
|
||||
- 带负载均衡策略的详细规格
|
||||
- 带监控的生产就绪实现
|
||||
|
||||
## 🔧 高级使用模式
|
||||
|
||||
### 自定义工作流组合
|
||||
|
||||
```bash
|
||||
# 调试 → 修复 → 验证工作流
|
||||
先使用 debug 分析 [性能问题],
|
||||
然后用 code 实现修复,
|
||||
再用 review 确保质量
|
||||
|
||||
# 完整开发 + 优化流水线
|
||||
先使用 requirements-pilot 处理 [功能开发],
|
||||
然后用 review 进行质量验证,
|
||||
如果评分 ≥95% 则使用 test 进行全面测试,
|
||||
最后用 optimize 确保生产就绪
|
||||
```
|
||||
|
||||
### 质量驱动开发
|
||||
|
||||
```bash
|
||||
# 迭代质量改进
|
||||
先使用 review 评估 [现有代码],
|
||||
如果评分 <95% 则用 code 基于反馈改进,
|
||||
重复直到达到质量阈值
|
||||
```
|
||||
|
||||
## 🎯 效益与影响
|
||||
|
||||
| 维度 | 手动命令 | Requirements-Driven工作流 |
|
||||
|------|-------------|------------------|
|
||||
| **复杂度** | 手动触发每个步骤 | 一键启动完整流水线 |
|
||||
| **质量** | 主观评估 | 90%客观评分 |
|
||||
| **上下文** | 污染,需要/clear | 隔离,无污染 |
|
||||
| **专业性** | AI角色切换 | 专注的专家 |
|
||||
| **错误处理** | 手动发现/修复 | 自动优化 |
|
||||
| **时间投入** | 1-2小时手动工作 | 30分钟自动化 |
|
||||
|
||||
## 🔮 关键创新
|
||||
|
||||
### 1. **专家深度 > 通才广度**
|
||||
每个智能体在独立上下文中专注各自领域专业知识,避免角色切换导致的质量下降。
|
||||
|
||||
### 2. **智能质量门控**
|
||||
90%客观评分,自动决策工作流进展或优化循环。
|
||||
|
||||
### 3. **完全自动化**
|
||||
一条命令触发端到端开发工作流,最少人工干预。
|
||||
|
||||
### 4. **持续改进**
|
||||
质量反馈驱动自动规格优化,创建智能改进循环。
|
||||
|
||||
## 🛠️ 配置说明
|
||||
|
||||
### 设置Sub-Agents
|
||||
|
||||
1. **创建智能体配置**: 将智能体文件复制到Claude Code配置中
|
||||
2. **配置命令**: 设置工作流触发命令
|
||||
3. **自定义质量门控**: 根据需要调整评分阈值
|
||||
|
||||
### 工作流定制
|
||||
|
||||
```bash
|
||||
# 带特定质量要求的自定义工作流
|
||||
先使用 requirements-pilot 处理 [严格安全要求和性能约束],
|
||||
然后用 review 验证并设置 [90%最低阈值],
|
||||
继续优化直到达到阈值
|
||||
```
|
||||
|
||||
## 📖 命令参考
|
||||
|
||||
### Requirements 工作流
|
||||
- `/requirements-pilot` - 完整的需求驱动开发工作流
|
||||
- 交互式需求确认 → 技术规格 → 实现 → 测试
|
||||
|
||||
### 开发命令
|
||||
- `/ask` - 架构咨询(不修改代码)
|
||||
- `/code` - 带约束的功能实现
|
||||
- `/debug` - 系统化问题分析
|
||||
- `/test` - 全面测试策略
|
||||
- `/review` - 多维度代码验证
|
||||
|
||||
### 优化命令
|
||||
- `/optimize` - 性能优化协调
|
||||
- `/refactor` - 带质量门控的代码重构
|
||||
|
||||
### 其他命令
|
||||
- `/bugfix` - 错误解决工作流
|
||||
- `/docs` - 文档生成
|
||||
- `/think` - 高级思考和分析
|
||||
|
||||
## 🤝 贡献
|
||||
|
||||
这是一个Claude Code配置框架。欢迎贡献:
|
||||
|
||||
1. **新智能体配置**: 特定领域的专业专家
|
||||
2. **工作流模式**: 新的自动化序列
|
||||
3. **质量指标**: 增强的评分维度
|
||||
4. **命令扩展**: 额外的开发阶段覆盖
|
||||
|
||||
## 📄 许可证
|
||||
|
||||
MIT许可证 - 详见[LICENSE](LICENSE)文件。
|
||||
|
||||
## 🙋 支持
|
||||
|
||||
- **文档**: 查看`/commands/`和`/agents/`获取详细规格
|
||||
- **问题**: 使用GitHub issues报告bug和功能请求
|
||||
- **讨论**: 分享工作流模式和定制化方案
|
||||
|
||||
---
|
||||
|
||||
## 🎉 开始使用
|
||||
|
||||
准备好转换你的开发工作流了吗?从这里开始:
|
||||
|
||||
```bash
|
||||
/requirements-pilot "在这里描述你的第一个功能"
|
||||
```
|
||||
|
||||
看着你的一行请求变成完整、经过测试、生产就绪的实现,90%质量保证。
|
||||
|
||||
**记住**: 专业软件来自专业流程。需求驱动工作流为您提供一个永不疲倦、始终专业的虚拟开发团队。
|
||||
|
||||
*让专业的AI做专业的事 - 开发从此变得优雅而高效。*
|
||||
|
||||
---
|
||||
|
||||
## 🌟 实战案例
|
||||
|
||||
### 用户管理系统开发
|
||||
|
||||
**需求**: 构建企业内部用户管理系统,500人规模,RBAC权限控制,集成OA系统
|
||||
|
||||
**传统方式** (1-2小时):
|
||||
```bash
|
||||
1. /ask 用户认证需求 → 手动澄清需求
|
||||
2. /code 实现认证逻辑 → 手动编写代码
|
||||
3. /test 生成测试用例 → 手动测试
|
||||
4. /review 代码审查 → 手动修复问题
|
||||
5. /optimize 性能优化 → 手动优化
|
||||
```
|
||||
|
||||
**Requirements-Driven方式** (30分钟自动):
|
||||
```bash
|
||||
/requirements-pilot "企业用户管理系统,500人规模,RBAC权限,OA系统集成"
|
||||
```
|
||||
|
||||
**自动化执行结果**:
|
||||
- 📋 **完整规格文档**: 需求分析、架构设计、实现计划
|
||||
- 💻 **生产级代码**: JWT最佳实践、完善异常处理、性能优化
|
||||
- 🧪 **全面测试覆盖**: 单元测试、集成测试、安全测试
|
||||
- ✅ **质量保证**: 97/100评分,所有维度均达标
|
||||
|
||||
### 微服务API网关
|
||||
|
||||
**场景**: 高并发微服务架构,需要API网关进行流量管理
|
||||
|
||||
**Step 1 - 需求理解**:
|
||||
```bash
|
||||
/ask "设计高性能微服务API网关,需要考虑哪些方面?"
|
||||
```
|
||||
|
||||
AI会深入询问:
|
||||
- 预期QPS和并发量
|
||||
- 路由策略和负载均衡
|
||||
- 限流和熔断机制
|
||||
- 监控和日志需求
|
||||
|
||||
**Step 2 - 需求驱动开发**:
|
||||
```bash
|
||||
/requirements-pilot "基于讨论,实现API网关完整功能"
|
||||
```
|
||||
|
||||
自动化执行:
|
||||
- **需求确认** - 交互式澄清和质量评估
|
||||
- **技术规格** - 考虑高并发的架构设计
|
||||
- **代码实现** - 详细的功能实现
|
||||
- **质量验证** - 多维度质量评估
|
||||
- **测试套件** - 功能和性能测试
|
||||
|
||||
## 💡 最佳实践
|
||||
|
||||
### 1. 需求澄清优先
|
||||
|
||||
**不要急于实现,先用/ask充分交流**
|
||||
|
||||
```bash
|
||||
# 错误做法:直接开始
|
||||
/requirements-pilot "用户管理系统"
|
||||
|
||||
# 正确做法:先理解需求
|
||||
/ask "企业用户管理系统需要考虑哪些方面?"
|
||||
# 经过3-5轮对话澄清需求后
|
||||
/requirements-pilot "基于讨论,实现企业用户管理系统"
|
||||
```
|
||||
|
||||
### 2. 渐进式复杂度
|
||||
|
||||
从简单功能开始,逐步增加复杂性:
|
||||
|
||||
```bash
|
||||
# 第一阶段:基础功能
|
||||
/requirements-pilot "用户注册登录基础功能"
|
||||
|
||||
# 第二阶段:权限管理
|
||||
/requirements-pilot "在现有基础上添加RBAC权限系统"
|
||||
|
||||
# 第三阶段:系统集成
|
||||
/requirements-pilot "集成LDAP和SSO单点登录"
|
||||
```
|
||||
|
||||
### 3. 质量优先策略
|
||||
|
||||
利用质量门控确保每个阶段的代码质量:
|
||||
|
||||
```bash
|
||||
# 设置更高质量要求
|
||||
先使用 requirements-pilot 实现功能,
|
||||
然后用 review 验证质量,
|
||||
如果评分 <98% 则继续优化,
|
||||
达标后用 test 和 optimize 完善
|
||||
```
|
||||
|
||||
## 🔍 深度解析:为什么这样更有效?
|
||||
|
||||
### 传统问题分析
|
||||
|
||||
**上下文污染**: 单一AI在不同角色间切换,质量逐步下降
|
||||
```
|
||||
AI扮演产品经理 → 架构师 → 开发者 → 测试工程师 → 优化专家
|
||||
随着对话长度增加,AI的专业度和准确性下降
|
||||
```
|
||||
|
||||
**手动管理开销**: 每个环节都需要人工判断和干预
|
||||
```
|
||||
是否需求已完整? → 设计是否合理? → 代码是否正确? → 测试是否充分?
|
||||
每个决策点都可能中断,需要重新组织思路
|
||||
```
|
||||
|
||||
### Requirements-Driven解决方案
|
||||
|
||||
**专业化隔离**: 每个专家在独立上下文中工作
|
||||
```
|
||||
规格专家(独立) + 实现专家(独立) + 质量专家(独立) + 测试专家(独立)
|
||||
专业深度最大化,角色混淆最小化
|
||||
```
|
||||
|
||||
**自动化决策**: 基于客观指标的自动流程控制
|
||||
```
|
||||
质量评分 ≥90% → 自动进入下一阶段
|
||||
质量评分 <90% → 自动返回优化,无需人工判断
|
||||
```
|
||||
|
||||
## 🚀 开始你的AI工厂
|
||||
|
||||
从手工作坊升级到自动化工厂,只需要:
|
||||
|
||||
1. **配置一次**: 设置Requirements-Driven智能体和自定义命令
|
||||
2. **使用一生**: 每个项目都能享受专业AI团队服务
|
||||
3. **持续改进**: 工作流模式不断优化,开发效率持续提升
|
||||
|
||||
**记住**: 在AI时代,Requirements-Driven工作流让你拥有了一个永不疲倦、始终专业的虚拟开发团队。
|
||||
|
||||
*让专业的AI做专业的事,开发从此变得优雅而高效。*
|
||||
### BMAD Pilot:产品 → 架构 → 冲刺 → 开发 → 测试
|
||||
|
||||
**输入**:
|
||||
```bash
|
||||
/bmad-pilot "企业级用户管理,支持RBAC与审计日志"
|
||||
```
|
||||
|
||||
**阶段**:
|
||||
- PO:交互式 PRD(≥90 分并确认)
|
||||
- Architect:技术架构(≥90 分并确认)
|
||||
- SM:冲刺计划(或用 --direct-dev 跳过)
|
||||
- Dev:按文档实现
|
||||
- QA:按文档与实现测试(--skip-tests 跳过)
|
||||
|
||||
**产出目录**(按 feature 保存):
|
||||
```
|
||||
.claude/specs/{feature_name}/
|
||||
00-repo-scan.md
|
||||
01-product-requirements.md
|
||||
02-system-architecture.md
|
||||
03-sprint-plan.md
|
||||
```
|
||||
403
README.md
403
README.md
@@ -2,357 +2,120 @@
|
||||
|
||||
[](https://opensource.org/licenses/MIT)
|
||||
[](https://claude.ai/code)
|
||||
[](https://github.com/cexll/myclaude)
|
||||
[](https://docs.claude.com/en/docs/claude-code/plugins)
|
||||
|
||||
> Transform your development workflow from manual command chains to automated expert teams with 95% quality assurance.
|
||||
> Enterprise-grade agile development automation with AI-powered multi-agent orchestration
|
||||
|
||||
## 🚀 From Manual Commands to Automated Workflows
|
||||
|
||||
**Before**: Manual command chains requiring constant oversight
|
||||
```bash
|
||||
/ask → /code → /test → /review → /optimize
|
||||
# 1-2 hours of manual orchestration, context pollution, quality uncertainty
|
||||
```
|
||||
|
||||
**After**: One-command automated expert workflows
|
||||
```bash
|
||||
/requirements-pilot "Implement JWT user authentication system"
|
||||
# 30 minutes of automated execution, 90% quality gates, zero manual intervention
|
||||
```
|
||||
|
||||
## 🎯 Core Value Proposition
|
||||
|
||||
This repository provides a **meta-framework for Claude Code** that implements:
|
||||
|
||||
- **🤖 Multi-Agent Orchestration**: Specialized AI teams working in parallel
|
||||
- **⚡ Quality Gate Automation**: 95% threshold with automatic optimization loops
|
||||
- **🔄 Workflow Automation**: From requirements to production-ready code
|
||||
- **📊 Context Isolation**: Each agent maintains focused expertise without pollution
|
||||
|
||||
## 📋 Two Primary Usage Patterns
|
||||
|
||||
### 1. 🏭 Requirements-Driven Workflow (Automated Expert Teams)
|
||||
|
||||
**Architecture**: Requirements-focused workflow with quality gates
|
||||
```
|
||||
requirements-generate → requirements-code → requirements-review → (≥90%?) → requirements-testing
|
||||
↑ ↓ (<90%)
|
||||
←←←←←← Automatic optimization loop ←←←←←←
|
||||
```
|
||||
|
||||
**Usage**:
|
||||
```bash
|
||||
# Complete development workflow in one command
|
||||
/requirements-pilot "Build user management system with RBAC"
|
||||
|
||||
# Advanced multi-stage workflow
|
||||
First use requirements-generate, then requirements-code, then requirements-review,
|
||||
then if score ≥90% use requirements-testing
|
||||
```
|
||||
|
||||
**Quality Scoring** (Total 100%):
|
||||
- Functionality (40%)
|
||||
- Integration (25%)
|
||||
- Code Quality (20%)
|
||||
- Performance (15%)
|
||||
|
||||
### 2. 🎛️ Custom Commands (Manual Orchestration)
|
||||
|
||||
**Architecture**: Individual slash commands for targeted expertise
|
||||
```bash
|
||||
/ask # Technical consultation and architecture guidance
|
||||
/code # Feature implementation with constraints
|
||||
/debug # Systematic problem analysis using UltraThink
|
||||
/test # Comprehensive testing strategy
|
||||
/review # Multi-dimensional code validation
|
||||
/optimize # Performance optimization coordination
|
||||
/bugfix # Bug resolution workflows
|
||||
/refactor # Code refactoring coordination
|
||||
/docs # Documentation generation
|
||||
/think # Advanced thinking and analysis
|
||||
```
|
||||
|
||||
**Progression Example**:
|
||||
```bash
|
||||
# Step-by-step development with manual control
|
||||
/ask "Help me understand microservices architecture requirements"
|
||||
/code "Implement gateway with rate limiting"
|
||||
/test "Create load testing suite"
|
||||
/review "Validate security and performance"
|
||||
/optimize "Enhance performance for production"
|
||||
```
|
||||
[中文文档](README_CN.md) | [Documentation](docs/)
|
||||
|
||||
## 🚀 Quick Start
|
||||
|
||||
### 1. Setup Configuration
|
||||
### Installation
|
||||
|
||||
Clone or copy the configuration structure:
|
||||
**Plugin System (Recommended)**
|
||||
```bash
|
||||
# Your project directory
|
||||
├── commands/ # 11 specialized slash commands
|
||||
├── agents/ # 9 expert agent configurations
|
||||
└── CLAUDE.md # Project-specific guidelines
|
||||
/plugin github.com/cexll/myclaude
|
||||
```
|
||||
|
||||
### 2. Basic Usage
|
||||
|
||||
**Complete Feature Development**:
|
||||
**Traditional Installation**
|
||||
```bash
|
||||
/requirements-pilot "Implement OAuth2 authentication with refresh tokens"
|
||||
git clone https://github.com/cexll/myclaude.git
|
||||
cd myclaude
|
||||
make install
|
||||
```
|
||||
|
||||
**BMAD Pilot (product → architecture → sprint → dev → QA with approval gates)**:
|
||||
```bash
|
||||
/bmad-pilot "Add Kanban module with role-based permissions and mobile support"
|
||||
# Options: --skip-tests | --direct-dev | --skip-scan
|
||||
```
|
||||
|
||||
**Manual Development Flow**:
|
||||
```bash
|
||||
/ask "Design principles for scalable microservices"
|
||||
/code "Implement OAuth2 with security best practices"
|
||||
/test "Create comprehensive test suite"
|
||||
/review "Validate implementation quality"
|
||||
```
|
||||
|
||||
### 3. Expected Outputs
|
||||
|
||||
**Automated Workflow Results**:
|
||||
- ✅ Requirements confirmation with 90+ quality score
|
||||
- ✅ Implementation-ready technical specifications
|
||||
- ✅ Production-ready code with best practices
|
||||
- ✅ Comprehensive test suite (unit + integration + functional)
|
||||
- ✅ 90%+ quality validation score
|
||||
|
||||
## 🏗️ Architecture Overview
|
||||
|
||||
### Core Components
|
||||
|
||||
#### **Commands Directory** (`/commands/`)
|
||||
- **Consultation**: `/ask` - Architecture guidance (no code changes)
|
||||
- **Implementation**: `/code` - Feature development with constraints
|
||||
- **Quality Assurance**: `/test`, `/review`, `/debug`
|
||||
- **Optimization**: `/optimize`, `/refactor`
|
||||
- **Bug Resolution**: `/bugfix` - Systematic bug fixing workflows
|
||||
- **Documentation**: `/docs` - Documentation generation
|
||||
- **Analysis**: `/think` - Advanced thinking and analysis
|
||||
- **Requirements**: `/requirements-pilot` - Complete requirements-driven workflow
|
||||
- **BMAD Pilot**: `/bmad-pilot` - Multi-agent, quality-gated workflow (PO → Architect → SM → Dev → QA)
|
||||
|
||||
#### **Agents Directory** (`/agents/`)
|
||||
- **requirements-generate**: Technical specification generation optimized for code generation
|
||||
- **requirements-code**: Direct implementation agent with minimal architectural overhead
|
||||
- **requirements-review**: Pragmatic code review focused on functionality and maintainability
|
||||
- **requirements-testing**: Practical testing agent focused on functional validation
|
||||
- **bugfix**: Bug resolution specialist for analyzing and fixing software defects
|
||||
- **bugfix-verify**: Fix validation specialist for objective assessment
|
||||
- **code**: Development coordinator for direct implementation
|
||||
- **debug**: UltraThink systematic problem analysis
|
||||
- **optimize**: Performance optimization coordination
|
||||
|
||||
### Multi-Agent Coordination System
|
||||
|
||||
**4 Core Specialists**:
|
||||
1. **Requirements Generator** - Implementation-ready technical specifications
|
||||
2. **Code Implementer** - Direct, pragmatic code implementation
|
||||
3. **Quality Reviewer** - Practical quality review with scoring
|
||||
4. **Test Coordinator** - Functional validation and testing
|
||||
|
||||
**Key Features**:
|
||||
- **Implementation-First Approach**: Direct technical specs for code generation
|
||||
- **Quality Gates**: 90% threshold for automatic progression
|
||||
- **Iterative Improvement**: Automatic optimization loops
|
||||
- **Practical Focus**: Working solutions over architectural perfection
|
||||
|
||||
## 📚 Workflow Examples
|
||||
|
||||
### Enterprise User Authentication System
|
||||
|
||||
**Input**:
|
||||
```bash
|
||||
/requirements-pilot "Enterprise JWT authentication with RBAC, supporting 500 concurrent users, integrated with existing LDAP"
|
||||
```
|
||||
|
||||
**Automated Process**:
|
||||
1. **Requirements Confirmation** (Quality: 92/100) - Interactive clarification
|
||||
- Functional clarity, technical specificity, implementation completeness
|
||||
- **Decision**: ≥90%, proceed with implementation
|
||||
|
||||
2. **Round 1** (Quality: 83/100) - Basic implementation
|
||||
- Issues: Error handling incomplete, integration concerns
|
||||
- **Decision**: <90%, restart with improvements
|
||||
|
||||
3. **Round 2** (Quality: 93/100) - Production ready
|
||||
- **Decision**: ≥90%, proceed to functional testing
|
||||
|
||||
**Final Deliverables**:
|
||||
- Requirements confirmation with quality assessment
|
||||
- Implementation-ready technical specifications
|
||||
- Pragmatic JWT implementation with RBAC
|
||||
- LDAP integration with proper error handling
|
||||
- Functional test suite focusing on critical paths
|
||||
|
||||
### API Gateway Development
|
||||
|
||||
**Input**:
|
||||
```bash
|
||||
/ask "Design considerations for high-performance API gateway"
|
||||
# (Interactive consultation phase)
|
||||
|
||||
/code "Implement microservices API gateway with rate limiting and circuit breakers"
|
||||
# (Implementation phase)
|
||||
|
||||
/test "Create comprehensive test suite for gateway"
|
||||
# (Testing phase)
|
||||
```
|
||||
|
||||
**Results**:
|
||||
- Architectural consultation on performance patterns
|
||||
- Detailed specifications with load balancing strategy
|
||||
- Production-ready implementation with monitoring
|
||||
|
||||
## 🔧 Advanced Usage Patterns
|
||||
|
||||
### Custom Workflow Composition
|
||||
### Basic Usage
|
||||
|
||||
```bash
|
||||
# Debug → Fix → Validate workflow
|
||||
First use debug to analyze [performance issue],
|
||||
then use code to implement fixes,
|
||||
then use review to ensure quality
|
||||
# Full agile workflow
|
||||
/bmad-pilot "Build user authentication with OAuth2 and MFA"
|
||||
|
||||
# Complete development + optimization pipeline
|
||||
First use requirements-pilot for [feature development],
|
||||
then use review for quality validation,
|
||||
then if score ≥95% use test for comprehensive testing,
|
||||
finally use optimize for production readiness
|
||||
# Lightweight development
|
||||
/requirements-pilot "Implement JWT token refresh"
|
||||
|
||||
# Direct development commands
|
||||
/code "Add API rate limiting"
|
||||
```
|
||||
|
||||
### Quality-Driven Development
|
||||
## 📦 Plugin Modules
|
||||
|
||||
| Plugin | Description | Key Commands |
|
||||
|--------|-------------|--------------|
|
||||
| **[bmad-agile-workflow](docs/BMAD-WORKFLOW.md)** | Complete BMAD methodology with 6 specialized agents | `/bmad-pilot` |
|
||||
| **[requirements-driven-workflow](docs/REQUIREMENTS-WORKFLOW.md)** | Streamlined requirements-to-code workflow | `/requirements-pilot` |
|
||||
| **[development-essentials](docs/DEVELOPMENT-COMMANDS.md)** | Core development slash commands | `/code` `/debug` `/test` `/optimize` |
|
||||
| **[advanced-ai-agents](docs/ADVANCED-AGENTS.md)** | GPT-5 deep reasoning integration | Agent: `gpt5` |
|
||||
| **[requirements-clarity](docs/REQUIREMENTS-CLARITY.md)** | Automated requirements clarification with 100-point scoring | Auto-activated skill |
|
||||
|
||||
## 💡 Use Cases
|
||||
|
||||
**BMAD Workflow** - Full agile process automation
|
||||
- Product requirements → Architecture design → Sprint planning → Development → Code review → QA testing
|
||||
- Quality gates with 90% thresholds
|
||||
- Automated document generation
|
||||
|
||||
**Requirements Workflow** - Fast prototyping
|
||||
- Requirements generation → Implementation → Review → Testing
|
||||
- Lightweight and practical
|
||||
|
||||
**Development Commands** - Daily coding
|
||||
- Direct implementation, debugging, testing, optimization
|
||||
- No workflow overhead
|
||||
|
||||
**Requirements Clarity** - Automated requirements engineering
|
||||
- Auto-detects vague requirements and initiates clarification
|
||||
- 100-point quality scoring system
|
||||
- Generates complete PRD documents
|
||||
|
||||
## 🎯 Key Features
|
||||
|
||||
- **🤖 Role-Based Agents**: Specialized AI agents for each development phase
|
||||
- **📊 Quality Gates**: Automatic quality scoring with iterative refinement
|
||||
- **✅ Approval Points**: User confirmation at critical workflow stages
|
||||
- **📁 Persistent Artifacts**: All specs saved to `.claude/specs/`
|
||||
- **🔌 Plugin System**: Native Claude Code plugin support
|
||||
- **🔄 Flexible Workflows**: Choose full agile or lightweight development
|
||||
- **🎯 Requirements Clarity**: Automated requirements clarification with quality scoring
|
||||
|
||||
## 📚 Documentation
|
||||
|
||||
- **[BMAD Workflow Guide](docs/BMAD-WORKFLOW.md)** - Complete methodology and agent roles
|
||||
- **[Requirements Workflow](docs/REQUIREMENTS-WORKFLOW.md)** - Lightweight development process
|
||||
- **[Development Commands](docs/DEVELOPMENT-COMMANDS.md)** - Slash command reference
|
||||
- **[Plugin System](docs/PLUGIN-SYSTEM.md)** - Installation and configuration
|
||||
- **[Quick Start Guide](docs/QUICK-START.md)** - Get started in 5 minutes
|
||||
|
||||
## 🛠️ Installation Methods
|
||||
|
||||
**Method 1: Plugin Install** (One command)
|
||||
```bash
|
||||
# Iterative quality improvement
|
||||
First use review to score [existing code],
|
||||
then if score <95% use code to improve based on feedback,
|
||||
repeat until quality threshold achieved
|
||||
/plugin install bmad-agile-workflow
|
||||
```
|
||||
|
||||
## 🎯 Benefits & Impact
|
||||
|
||||
| Dimension | Manual Commands | Sub-Agent Workflows |
|
||||
|-----------|----------------|-------------------|
|
||||
| **Complexity** | Manual trigger for each step | One-command full pipeline |
|
||||
| **Quality** | Subjective assessment | 90% objective scoring |
|
||||
| **Context** | Pollution, requires /clear | Isolated, no pollution |
|
||||
| **Expertise** | AI role switching | Focused specialists |
|
||||
| **Error Handling** | Manual discovery/fix | Automatic optimization |
|
||||
| **Time Investment** | 1-2 hours manual work | 30 minutes automated |
|
||||
|
||||
## 🔮 Key Innovations
|
||||
|
||||
### 1. **Specialist Depth Over Generalist Breadth**
|
||||
Each agent focuses on their domain expertise in independent contexts, avoiding the quality degradation of role-switching.
|
||||
|
||||
### 2. **Intelligent Quality Gates**
|
||||
90% objective scoring with automatic decision-making for workflow progression or optimization loops.
|
||||
|
||||
### 3. **Complete Automation**
|
||||
One command triggers end-to-end development workflow with minimal human intervention.
|
||||
|
||||
### 4. **Continuous Improvement**
|
||||
Quality feedback drives automatic specification refinement, creating intelligent improvement cycles.
|
||||
|
||||
## 🛠️ Configuration
|
||||
|
||||
### Setting Up Sub-Agents
|
||||
|
||||
1. **Create Agent Configurations**: Copy agent files to your Claude Code configuration
|
||||
2. **Configure Commands**: Set up workflow trigger commands
|
||||
3. **Customize Quality Gates**: Adjust scoring thresholds if needed
|
||||
|
||||
### Workflow Customization
|
||||
|
||||
**Method 2: Make Commands** (Selective installation)
|
||||
```bash
|
||||
# Custom workflow with specific quality requirements
|
||||
First use requirements-pilot with [strict security requirements and performance constraints],
|
||||
then use review to validate with [90% minimum threshold],
|
||||
continue optimization until threshold met
|
||||
make deploy-bmad # BMAD workflow only
|
||||
make deploy-requirements # Requirements workflow only
|
||||
make deploy-all # Everything
|
||||
```
|
||||
|
||||
## 📖 Command Reference
|
||||
**Method 3: Manual Setup**
|
||||
- Copy `/commands/*.md` to `~/.config/claude/commands/`
|
||||
- Copy `/agents/*.md` to `~/.config/claude/agents/`
|
||||
|
||||
### Requirements Workflow
|
||||
- `/requirements-pilot` - Complete requirements-driven development workflow
|
||||
- Interactive requirements confirmation → technical specifications → implementation → testing
|
||||
|
||||
### Development Commands
|
||||
- `/ask` - Architecture consultation (no code changes)
|
||||
- `/code` - Feature implementation with constraints
|
||||
- `/debug` - Systematic problem analysis
|
||||
- `/test` - Comprehensive testing strategy
|
||||
- `/review` - Multi-dimensional code validation
|
||||
|
||||
### Optimization Commands
|
||||
- `/optimize` - Performance optimization coordination
|
||||
- `/refactor` - Code refactoring with quality gates
|
||||
|
||||
### Additional Commands
|
||||
- `/bugfix` - Bug resolution workflows
|
||||
- `/docs` - Documentation generation
|
||||
- `/think` - Advanced thinking and analysis
|
||||
|
||||
## 🤝 Contributing
|
||||
|
||||
This is a Claude Code configuration framework. Contributions welcome:
|
||||
|
||||
1. **New Agent Configurations**: Specialized experts for specific domains
|
||||
2. **Workflow Patterns**: New automation sequences
|
||||
3. **Quality Metrics**: Enhanced scoring dimensions
|
||||
4. **Command Extensions**: Additional development phase coverage
|
||||
Run `make help` for all options.
|
||||
|
||||
## 📄 License
|
||||
|
||||
MIT License - see [LICENSE](LICENSE) file for details.
|
||||
MIT License - see [LICENSE](LICENSE)
|
||||
|
||||
## 🙋 Support
|
||||
|
||||
- **Documentation**: Check `/commands/` and `/agents/` for detailed specifications
|
||||
- **Issues**: Use GitHub issues for bug reports and feature requests
|
||||
- **Discussions**: Share workflow patterns and customizations
|
||||
- **Issues**: [GitHub Issues](https://github.com/cexll/myclaude/issues)
|
||||
- **Documentation**: [docs/](docs/)
|
||||
- **Plugin Guide**: [PLUGIN_README.md](PLUGIN_README.md)
|
||||
|
||||
---
|
||||
|
||||
## 🎉 Getting Started
|
||||
|
||||
Ready to transform your development workflow? Start with:
|
||||
|
||||
```bash
|
||||
/requirements-pilot "Your first feature description here"
|
||||
```
|
||||
|
||||
Watch as your one-line request becomes a complete, tested, production-ready implementation with 90% quality assurance.
|
||||
|
||||
**Remember**: Professional software comes from professional processes. Requirements-driven workflows give you a tireless, always-expert virtual development team.
|
||||
|
||||
*Let specialized AI do specialized work - development becomes elegant and efficient.*
|
||||
### BMAD Pilot: Product → Architecture → Sprint → Dev → QA
|
||||
|
||||
**Input**:
|
||||
```bash
|
||||
/bmad-pilot "Enterprise-grade user management with RBAC and audit logs"
|
||||
```
|
||||
|
||||
**Phases**:
|
||||
- PO: Interactive PRD with ≥90 score and approval
|
||||
- Architect: Technical design with ≥90 score and approval
|
||||
- SM: Sprint plan (or skip with --direct-dev)
|
||||
- Dev: Implementation based on documents
|
||||
- QA: Tests based on documents and implementation (skip with --skip-tests)
|
||||
|
||||
**Artifacts** (saved per feature):
|
||||
```
|
||||
.claude/specs/{feature_name}/
|
||||
00-repo-scan.md
|
||||
01-product-requirements.md
|
||||
02-system-architecture.md
|
||||
03-sprint-plan.md
|
||||
```
|
||||
**Transform your development with AI-powered automation** - One command, complete workflow, quality assured.
|
||||
|
||||
121
README_CN.md
Normal file
121
README_CN.md
Normal file
@@ -0,0 +1,121 @@
|
||||
# Claude Code 多智能体工作流系统
|
||||
|
||||
[](https://opensource.org/licenses/MIT)
|
||||
[](https://claude.ai/code)
|
||||
[](https://github.com/cexll/myclaude)
|
||||
[](https://docs.claude.com/en/docs/claude-code/plugins)
|
||||
|
||||
> 企业级敏捷开发自动化与 AI 驱动的多智能体编排
|
||||
|
||||
[English](README.md) | [文档](docs/)
|
||||
|
||||
## 🚀 快速开始
|
||||
|
||||
### 安装
|
||||
|
||||
**插件系统(推荐)**
|
||||
```bash
|
||||
/plugin github.com/cexll/myclaude
|
||||
```
|
||||
|
||||
**传统安装**
|
||||
```bash
|
||||
git clone https://github.com/cexll/myclaude.git
|
||||
cd myclaude
|
||||
make install
|
||||
```
|
||||
|
||||
### 基本使用
|
||||
|
||||
```bash
|
||||
# 完整敏捷工作流
|
||||
/bmad-pilot "构建用户认证系统,支持 OAuth2 和多因素认证"
|
||||
|
||||
# 轻量级开发
|
||||
/requirements-pilot "实现 JWT 令牌刷新"
|
||||
|
||||
# 直接开发命令
|
||||
/code "添加 API 限流功能"
|
||||
```
|
||||
|
||||
## 📦 插件模块
|
||||
|
||||
| 插件 | 描述 | 主要命令 |
|
||||
|------|------|---------|
|
||||
| **[bmad-agile-workflow](docs/BMAD-WORKFLOW.md)** | 完整 BMAD 方法论,包含6个专业智能体 | `/bmad-pilot` |
|
||||
| **[requirements-driven-workflow](docs/REQUIREMENTS-WORKFLOW.md)** | 精简的需求到代码工作流 | `/requirements-pilot` |
|
||||
| **[development-essentials](docs/DEVELOPMENT-COMMANDS.md)** | 核心开发斜杠命令 | `/code` `/debug` `/test` `/optimize` |
|
||||
| **[advanced-ai-agents](docs/ADVANCED-AGENTS.md)** | GPT-5 深度推理集成 | 智能体: `gpt5` |
|
||||
| **[requirements-clarity](docs/REQUIREMENTS-CLARITY.md)** | 自动需求澄清,100分制质量评分 | 自动激活技能 |
|
||||
|
||||
## 💡 使用场景
|
||||
|
||||
**BMAD 工作流** - 完整敏捷流程自动化
|
||||
- 产品需求 → 架构设计 → 冲刺规划 → 开发实现 → 代码审查 → 质量测试
|
||||
- 90% 阈值质量门控
|
||||
- 自动生成文档
|
||||
|
||||
**Requirements 工作流** - 快速原型开发
|
||||
- 需求生成 → 实现 → 审查 → 测试
|
||||
- 轻量级实用主义
|
||||
|
||||
**开发命令** - 日常编码
|
||||
- 直接实现、调试、测试、优化
|
||||
- 无工作流开销
|
||||
|
||||
**需求澄清** - 自动化需求工程
|
||||
- 自动检测模糊需求并启动澄清流程
|
||||
- 100分制质量评分系统
|
||||
- 生成完整的产品需求文档
|
||||
|
||||
## 🎯 核心特性
|
||||
|
||||
- **🤖 角色化智能体**: 每个开发阶段的专业 AI 智能体
|
||||
- **📊 质量门控**: 自动质量评分,迭代优化
|
||||
- **✅ 确认节点**: 关键工作流阶段的用户确认
|
||||
- **📁 持久化产物**: 所有规格保存至 `.claude/specs/`
|
||||
- **🔌 插件系统**: 原生 Claude Code 插件支持
|
||||
- **🔄 灵活工作流**: 选择完整敏捷或轻量开发
|
||||
- **🎯 需求澄清**: 自动化需求澄清与质量评分
|
||||
|
||||
## 📚 文档
|
||||
|
||||
- **[BMAD 工作流指南](docs/BMAD-WORKFLOW.md)** - 完整方法论和智能体角色
|
||||
- **[Requirements 工作流](docs/REQUIREMENTS-WORKFLOW.md)** - 轻量级开发流程
|
||||
- **[开发命令参考](docs/DEVELOPMENT-COMMANDS.md)** - 斜杠命令说明
|
||||
- **[插件系统](docs/PLUGIN-SYSTEM.md)** - 安装与配置
|
||||
- **[快速上手](docs/QUICK-START.md)** - 5分钟入门
|
||||
|
||||
## 🛠️ 安装方式
|
||||
|
||||
**方式1: 插件安装**(一条命令)
|
||||
```bash
|
||||
/plugin install bmad-agile-workflow
|
||||
```
|
||||
|
||||
**方式2: Make 命令**(选择性安装)
|
||||
```bash
|
||||
make deploy-bmad # 仅 BMAD 工作流
|
||||
make deploy-requirements # 仅 Requirements 工作流
|
||||
make deploy-all # 全部安装
|
||||
```
|
||||
|
||||
**方式3: 手动安装**
|
||||
- 复制 `/commands/*.md` 到 `~/.config/claude/commands/`
|
||||
- 复制 `/agents/*.md` 到 `~/.config/claude/agents/`
|
||||
|
||||
运行 `make help` 查看所有选项。
|
||||
|
||||
## 📄 许可证
|
||||
|
||||
MIT 许可证 - 查看 [LICENSE](LICENSE)
|
||||
|
||||
## 🙋 支持
|
||||
|
||||
- **问题反馈**: [GitHub Issues](https://github.com/cexll/myclaude/issues)
|
||||
- **文档**: [docs/](docs/)
|
||||
- **插件指南**: [PLUGIN_README.md](PLUGIN_README.md)
|
||||
|
||||
---
|
||||
|
||||
**使用 AI 驱动的自动化转型您的开发流程** - 一条命令,完整工作流,质量保证。
|
||||
26
advanced-ai-agents/.claude-plugin/marketplace.json
Normal file
26
advanced-ai-agents/.claude-plugin/marketplace.json
Normal file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"name": "advanced-ai-agents",
|
||||
"source": "./",
|
||||
"description": "Advanced AI agent for complex problem solving and deep analysis with GPT-5 integration",
|
||||
"version": "1.0.0",
|
||||
"author": {
|
||||
"name": "Claude Code Dev Workflows",
|
||||
"url": "https://github.com/cexll/myclaude"
|
||||
},
|
||||
"homepage": "https://github.com/cexll/myclaude",
|
||||
"repository": "https://github.com/cexll/myclaude",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
"gpt5",
|
||||
"ai",
|
||||
"analysis",
|
||||
"problem-solving",
|
||||
"deep-research"
|
||||
],
|
||||
"category": "advanced",
|
||||
"strict": false,
|
||||
"commands": [],
|
||||
"agents": [
|
||||
"./agents/gpt5.md"
|
||||
]
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
---
|
||||
name: bmad-review
|
||||
description: Independent code review agent
|
||||
---
|
||||
|
||||
# BMAD Review Agent
|
||||
|
||||
You are an independent code review agent responsible for conducting reviews between Dev and QA phases.
|
||||
|
||||
## Your Task
|
||||
|
||||
1. **Load Context**
|
||||
- Read PRD from `./.claude/specs/{feature_name}/01-product-requirements.md`
|
||||
- Read Architecture from `./.claude/specs/{feature_name}/02-system-architecture.md`
|
||||
- Read Sprint Plan from `./.claude/specs/{feature_name}/03-sprint-plan.md`
|
||||
- Analyze the code changes and implementation
|
||||
|
||||
2. **Execute Review**
|
||||
Use Bash to call codex with an optimized prompt:
|
||||
```bash
|
||||
codex exec --skip-git-repo-check -m gpt-5 "[Your optimized review prompt here]"
|
||||
```
|
||||
|
||||
When constructing the prompt, follow these principles:
|
||||
- Use structured XML tags for organization
|
||||
- Include clear role definition
|
||||
- Add thinking sections for analysis
|
||||
- Specify detailed output format
|
||||
- Include QA testing guidance
|
||||
|
||||
3. **Generate Report**
|
||||
Write the review results to `./.claude/specs/{feature_name}/04-dev-reviewed.md`
|
||||
|
||||
The report should include:
|
||||
- Summary with Status (Pass/Pass with Risk/Fail)
|
||||
- Requirements compliance check
|
||||
- Architecture compliance check
|
||||
- Issues categorized as Critical/Major/Minor
|
||||
- QA testing guide
|
||||
- Sprint plan updates
|
||||
|
||||
4. **Update Status**
|
||||
Based on the review status:
|
||||
- If Pass or Pass with Risk: Mark review as completed in sprint plan
|
||||
- If Fail: Keep as pending and indicate Dev needs to address issues
|
||||
|
||||
## Key Principles
|
||||
- Maintain independence from Dev context
|
||||
- Focus on actionable findings
|
||||
- Provide specific QA guidance
|
||||
- Use clear, parseable output format
|
||||
37
bmad-agile-workflow/.claude-plugin/marketplace.json
Normal file
37
bmad-agile-workflow/.claude-plugin/marketplace.json
Normal file
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"name": "bmad-agile-workflow",
|
||||
"source": "./",
|
||||
"description": "Full BMAD agile workflow with role-based agents (PO, Architect, SM, Dev, QA) and interactive approval gates",
|
||||
"version": "1.0.0",
|
||||
"author": {
|
||||
"name": "Claude Code Dev Workflows",
|
||||
"url": "https://github.com/cexll/myclaude"
|
||||
},
|
||||
"homepage": "https://github.com/cexll/myclaude",
|
||||
"repository": "https://github.com/cexll/myclaude",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
"bmad",
|
||||
"agile",
|
||||
"scrum",
|
||||
"product-owner",
|
||||
"architect",
|
||||
"developer",
|
||||
"qa",
|
||||
"workflow-orchestration"
|
||||
],
|
||||
"category": "workflows",
|
||||
"strict": false,
|
||||
"commands": [
|
||||
"./commands/bmad-pilot.md"
|
||||
],
|
||||
"agents": [
|
||||
"./agents/bmad-po.md",
|
||||
"./agents/bmad-architect.md",
|
||||
"./agents/bmad-sm.md",
|
||||
"./agents/bmad-dev.md",
|
||||
"./agents/bmad-qa.md",
|
||||
"./agents/bmad-orchestrator.md",
|
||||
"./agents/bmad-review.md"
|
||||
]
|
||||
}
|
||||
163
dev-workflow/README.md
Normal file
163
dev-workflow/README.md
Normal file
@@ -0,0 +1,163 @@
|
||||
# /dev - 极简开发工作流
|
||||
|
||||
## 概述
|
||||
|
||||
全新设计的轻量级开发工作流,无历史包袱,专注快速交付高质量代码。
|
||||
|
||||
## 工作流程
|
||||
|
||||
```
|
||||
/dev 触发
|
||||
↓
|
||||
AskUserQuestion(需求澄清)
|
||||
↓
|
||||
Codex 分析(提取要点和任务)
|
||||
↓
|
||||
develop-doc-generator(生成开发文档)
|
||||
↓
|
||||
Codex 并发开发(2-5个任务)
|
||||
↓
|
||||
Codex 测试验证(≥90%覆盖率)
|
||||
↓
|
||||
完成(生成总结)
|
||||
```
|
||||
|
||||
## 6个步骤
|
||||
|
||||
### 1. 需求澄清
|
||||
- 使用 **AskUserQuestion** 直接问用户
|
||||
- 无评分系统,无复杂逻辑
|
||||
- 2-3 轮问答直到需求明确
|
||||
|
||||
### 2. Codex 分析
|
||||
- 调用 codex 分析需求
|
||||
- 提取:核心功能、技术要点、任务列表(2-5个)
|
||||
- 输出结构化分析结果
|
||||
|
||||
### 3. 生成开发文档
|
||||
- 调用 **develop-doc-generator** agent
|
||||
- 生成 `dev-plan.md`(单一开发文档)
|
||||
- 包含:任务分解、文件范围、依赖关系、测试命令
|
||||
|
||||
### 4. 并发开发
|
||||
- 基于 dev-plan.md 的任务列表
|
||||
- 无依赖任务 → 并发执行
|
||||
- 有冲突任务 → 串行执行
|
||||
|
||||
### 5. 测试验证
|
||||
- 每个 codex 任务自己:
|
||||
- 实现功能
|
||||
- 编写测试
|
||||
- 运行覆盖率
|
||||
- 报告结果(≥90%)
|
||||
|
||||
### 6. 完成
|
||||
- 汇总任务状态
|
||||
- 记录覆盖率
|
||||
|
||||
## 使用方法
|
||||
|
||||
```bash
|
||||
/dev "实现用户登录功能,支持邮箱和密码验证"
|
||||
```
|
||||
|
||||
**无选项**,流程固定,开箱即用。
|
||||
|
||||
## 输出结构
|
||||
|
||||
```
|
||||
.claude/specs/{feature_name}/
|
||||
├── dev-plan.md # 开发文档(agent生成)
|
||||
```
|
||||
|
||||
仅 2 个文件,极简清晰。
|
||||
|
||||
## 核心组件
|
||||
|
||||
### 工具
|
||||
- **AskUserQuestion**:交互式需求澄清
|
||||
- **codex**:分析、开发、测试
|
||||
- **develop-doc-generator**:生成开发文档(subagent,节省上下文)
|
||||
|
||||
## 核心特性
|
||||
|
||||
### ✅ 全新设计
|
||||
- 无历史项目残留
|
||||
- 无复杂评分逻辑
|
||||
- 无多余抽象层
|
||||
|
||||
### ✅ 极简编排
|
||||
- orchestrator 直接控制流程
|
||||
- 只用 3 个工具/组件
|
||||
- 步骤清晰易懂
|
||||
|
||||
### ✅ 并发能力
|
||||
- 2-5 个任务并行
|
||||
- 自动检测依赖和冲突
|
||||
- codex 独立执行
|
||||
|
||||
### ✅ 质量保证
|
||||
- 强制 90% 覆盖率
|
||||
- codex 自己测试和验证
|
||||
- 失败自动重试
|
||||
|
||||
## 示例
|
||||
|
||||
```bash
|
||||
# 触发
|
||||
/dev "添加用户登录功能"
|
||||
|
||||
# 步骤 1: 需求澄清
|
||||
Q: 支持哪些登录方式?
|
||||
A: 邮箱 + 密码
|
||||
Q: 需要记住登录状态吗?
|
||||
A: 是,使用 JWT token
|
||||
|
||||
# 步骤 2: Codex 分析
|
||||
输出:
|
||||
- 核心功能:邮箱密码登录 + JWT认证
|
||||
- 任务 1:后端 API
|
||||
- 任务 2:密码加密
|
||||
- 任务 3:前端表单
|
||||
|
||||
# 步骤 3: 生成文档
|
||||
dev-plan.md 已生成 ✓
|
||||
|
||||
# 步骤 4-5: 并发开发
|
||||
[task-1] 后端API → 测试 → 92% ✓
|
||||
[task-2] 密码加密 → 测试 → 95% ✓
|
||||
[task-3] 前端表单 → 测试 → 91% ✓
|
||||
```
|
||||
|
||||
## 目录结构
|
||||
|
||||
```
|
||||
dev-workflow/
|
||||
├── README.md # 本文档
|
||||
├── commands/
|
||||
│ └── dev.md # 工作流定义
|
||||
└── agents/
|
||||
└── develop-doc-generator.md # 文档生成器
|
||||
```
|
||||
|
||||
极简结构,只有 3 个文件。
|
||||
|
||||
## 适用场景
|
||||
|
||||
✅ **适合**:
|
||||
- 任何规模的功能开发
|
||||
- 需要快速迭代
|
||||
- 需要高测试覆盖率
|
||||
- 希望并发提速
|
||||
|
||||
## 设计原则
|
||||
|
||||
1. **KISS**:保持简单愚蠢
|
||||
2. **即用即抛**:无持久化配置
|
||||
3. **质量优先**:强制 90% 覆盖率
|
||||
4. **并发优先**:充分利用 codex 能力
|
||||
5. **无历史包袱**:全新设计,不受其他项目影响
|
||||
|
||||
---
|
||||
|
||||
**哲学**:像 Linus 一样对复杂度零容忍,交付能立刻用的最小方案。
|
||||
114
dev-workflow/agents/dev-plan-generator.md
Normal file
114
dev-workflow/agents/dev-plan-generator.md
Normal file
@@ -0,0 +1,114 @@
|
||||
---
|
||||
name: dev-plan-generator
|
||||
description: Use this agent when you need to generate a structured development plan document (`dev-plan.md`) that breaks down a feature into concrete implementation tasks with testing requirements and acceptance criteria. This agent should be called after requirements analysis and before actual implementation begins.\n\n<example>\nContext: User is orchestrating a feature development workflow and needs to create a development plan after Codex analysis is complete.\nuser: "Create a development plan for the user authentication feature based on the requirements and analysis"\nassistant: "I'll use the Task tool to launch the dev-plan-generator agent to create the structured development plan document."\n<commentary>\nThe user needs a dev-plan.md document generated from requirements and analysis. Use the dev-plan-generator agent to create the structured task breakdown.\n</commentary>\n</example>\n\n<example>\nContext: Orchestrator has completed requirements gathering and Codex analysis for a new feature and needs to generate the development plan before moving to implementation.\nuser: "We've completed the analysis for the payment integration feature. Generate the development plan."\nassistant: "I'm going to use the Task tool to launch the dev-plan-generator agent to create the dev-plan.md document with task breakdown and testing requirements."\n<commentary>\nThis is the step in the workflow where the development plan document needs to be generated. Use the dev-plan-generator agent to create the structured plan.\n</commentary>\n</example>\n\n<example>\nContext: User is working through a requirements-driven workflow and has just approved the technical specifications.\nuser: "The specs look good. Let's move forward with creating the implementation plan."\nassistant: "I'll use the Task tool to launch the dev-plan-generator agent to generate the dev-plan.md document with the task breakdown."\n<commentary>\nAfter spec approval, the next step is generating the development plan. Use the dev-plan-generator agent to create the structured document.\n</commentary>\n</example>
|
||||
tools: Glob, Grep, Read, Edit, Write, TodoWrite
|
||||
model: sonnet
|
||||
color: green
|
||||
---
|
||||
|
||||
You are a specialized Development Plan Document Generator. Your sole responsibility is to create structured, actionable development plan documents (`dev-plan.md`) that break down features into concrete implementation tasks.
|
||||
|
||||
## Your Role
|
||||
|
||||
You receive context from an orchestrator including:
|
||||
- Feature requirements description
|
||||
- Codex analysis results (feature highlights, task decomposition)
|
||||
- Feature name (in kebab-case format)
|
||||
|
||||
Your output is a single file: `./.claude/specs/{feature_name}/dev-plan.md`
|
||||
|
||||
## Document Structure You Must Follow
|
||||
|
||||
```markdown
|
||||
# {Feature Name} - 开发计划
|
||||
|
||||
## 功能概述
|
||||
[一句话描述核心功能]
|
||||
|
||||
## 任务分解
|
||||
|
||||
### 任务 1: [任务名称]
|
||||
- **ID**: task-1
|
||||
- **描述**: [具体要做什么]
|
||||
- **文件范围**: [涉及的目录或文件,如 src/auth/**, tests/auth/]
|
||||
- **依赖**: [无 或 依赖 task-x]
|
||||
- **测试命令**: [如 pytest tests/auth --cov=src/auth --cov-report=term]
|
||||
- **测试重点**: [需要覆盖的场景]
|
||||
|
||||
### 任务 2: [任务名称]
|
||||
...
|
||||
|
||||
(2-5个任务)
|
||||
|
||||
## 验收标准
|
||||
- [ ] 功能点 1
|
||||
- [ ] 功能点 2
|
||||
- [ ] 所有单元测试通过
|
||||
- [ ] 代码覆盖率 ≥90%
|
||||
|
||||
## 技术要点
|
||||
- [关键技术决策]
|
||||
- [需要注意的约束]
|
||||
```
|
||||
|
||||
## Generation Rules You Must Enforce
|
||||
|
||||
1. **Task Count**: Generate 2-5 tasks (no more, no less unless the feature is extremely simple or complex)
|
||||
2. **Task Requirements**: Each task MUST include:
|
||||
- Clear ID (task-1, task-2, etc.)
|
||||
- Specific description of what needs to be done
|
||||
- Explicit file scope (directories or files affected)
|
||||
- Dependency declaration ("无" or "依赖 task-x")
|
||||
- Complete test command with coverage parameters
|
||||
- Testing focus points (scenarios to cover)
|
||||
3. **Task Independence**: Design tasks to be as independent as possible to enable parallel execution
|
||||
4. **Test Commands**: Must include coverage parameters (e.g., `--cov=module --cov-report=term` for pytest, `--coverage` for npm)
|
||||
5. **Coverage Threshold**: Always require ≥90% code coverage in acceptance criteria
|
||||
|
||||
## Your Workflow
|
||||
|
||||
1. **Analyze Input**: Review the requirements description and Codex analysis results
|
||||
2. **Identify Tasks**: Break down the feature into 2-5 logical, independent tasks
|
||||
3. **Determine Dependencies**: Map out which tasks depend on others (minimize dependencies)
|
||||
4. **Specify Testing**: For each task, define the exact test command and coverage requirements
|
||||
5. **Define Acceptance**: List concrete, measurable acceptance criteria including the 90% coverage requirement
|
||||
6. **Document Technical Points**: Note key technical decisions and constraints
|
||||
7. **Write File**: Use the Write tool to create `./.claude/specs/{feature_name}/dev-plan.md`
|
||||
|
||||
## Quality Checks Before Writing
|
||||
|
||||
- [ ] Task count is between 2-5
|
||||
- [ ] Every task has all 6 required fields (ID, 描述, 文件范围, 依赖, 测试命令, 测试重点)
|
||||
- [ ] Test commands include coverage parameters
|
||||
- [ ] Dependencies are explicitly stated
|
||||
- [ ] Acceptance criteria includes 90% coverage requirement
|
||||
- [ ] File scope is specific (not vague like "all files")
|
||||
- [ ] Testing focus is concrete (not generic like "test everything")
|
||||
|
||||
## Critical Constraints
|
||||
|
||||
- **Document Only**: You generate documentation. You do NOT execute code, run tests, or modify source files.
|
||||
- **Single Output**: You produce exactly one file: `dev-plan.md` in the correct location
|
||||
- **Path Accuracy**: The path must be `./.claude/specs/{feature_name}/dev-plan.md` where {feature_name} matches the input
|
||||
- **Chinese Language**: The document must be in Chinese (as shown in the structure)
|
||||
- **Structured Format**: Follow the exact markdown structure provided
|
||||
|
||||
## Example Output Quality
|
||||
|
||||
Refer to the user login example in your instructions as the quality benchmark. Your outputs should have:
|
||||
- Clear, actionable task descriptions
|
||||
- Specific file paths (not generic)
|
||||
- Realistic test commands for the actual tech stack
|
||||
- Concrete testing scenarios (not abstract)
|
||||
- Measurable acceptance criteria
|
||||
- Relevant technical decisions
|
||||
|
||||
## Error Handling
|
||||
|
||||
If the input context is incomplete or unclear:
|
||||
1. Request the missing information explicitly
|
||||
2. Do NOT proceed with generating a low-quality document
|
||||
3. Do NOT make up requirements or technical details
|
||||
4. Ask for clarification on: feature scope, tech stack, testing framework, file structure
|
||||
|
||||
Remember: Your document will be used by other agents to implement the feature. Precision and completeness are critical. Every field must be filled with specific, actionable information.
|
||||
105
dev-workflow/commands/dev.md
Normal file
105
dev-workflow/commands/dev.md
Normal file
@@ -0,0 +1,105 @@
|
||||
---
|
||||
description: Extreme lightweight end-to-end development workflow with requirements clarification, parallel codex execution, and mandatory 90% test coverage
|
||||
---
|
||||
|
||||
|
||||
You are the /dev Workflow Orchestrator, an expert development workflow manager specializing in orchestrating minimal, efficient end-to-end development processes with parallel task execution and rigorous test coverage validation.
|
||||
|
||||
**Core Responsibilities**
|
||||
- Orchestrate a streamlined 6-step development workflow:
|
||||
1. Requirement clarification through targeted questioning
|
||||
2. Technical analysis using Codex
|
||||
3. Development documentation generation
|
||||
4. Parallel development execution
|
||||
5. Coverage validation (≥90% requirement)
|
||||
6. Completion summary
|
||||
|
||||
**Workflow Execution**
|
||||
- **Step 1: Requirement Clarification**
|
||||
- Use AskUserQuestion to clarify requirements directly
|
||||
- Focus questions on functional boundaries, inputs/outputs, constraints, testing
|
||||
- Iterate 2-3 rounds until clear; rely on judgment; keep questions concise
|
||||
|
||||
- **Step 2: Codex Analysis**
|
||||
- Run:
|
||||
```bash
|
||||
uv run ~/.claude/skills/codex/scripts/codex.py "分析以下需求并提取开发要点:
|
||||
|
||||
需求描述:
|
||||
[用户需求 + 澄清后的细节]
|
||||
|
||||
请输出:
|
||||
1. 核心功能(一句话)
|
||||
2. 关键技术点
|
||||
3. 可并发的任务分解(2-5个):
|
||||
- 任务ID
|
||||
- 任务描述
|
||||
- 涉及文件/目录
|
||||
- 是否依赖其他任务
|
||||
- 测试重点
|
||||
" "gpt-5.1-codex"
|
||||
```
|
||||
- Extract core functionality, technical key points, and 2-5 parallelizable tasks with full metadata
|
||||
|
||||
- **Step 3: Generate Development Documentation**
|
||||
- Use Task tool to invoke develop-doc-generator:
|
||||
```
|
||||
基于以下分析结果生成开发文档:
|
||||
|
||||
[Codex 分析输出]
|
||||
|
||||
输出文件:./.claude/specs/{feature_name}/dev-plan.md
|
||||
|
||||
包含:
|
||||
1. 功能概述
|
||||
2. 任务列表(2-5个并发任务)
|
||||
- 每个任务:ID、描述、文件范围、依赖、测试命令
|
||||
3. 验收标准
|
||||
4. 覆盖率要求:≥90%
|
||||
```
|
||||
|
||||
- **Step 4: Parallel Development Execution**
|
||||
- For each task in `dev-plan.md` run:
|
||||
```bash
|
||||
uv run ~/.claude/skills/codex/scripts/codex.py "实现任务:[任务ID]
|
||||
|
||||
参考文档:@.claude/specs/{feature_name}/dev-plan.md
|
||||
|
||||
你的职责:
|
||||
1. 实现功能代码
|
||||
2. 编写单元测试
|
||||
3. 运行测试 + 覆盖率
|
||||
4. 报告覆盖率结果
|
||||
|
||||
文件范围:[任务的文件范围]
|
||||
测试命令:[任务指定的测试命令]
|
||||
覆盖率目标:≥90%
|
||||
" "gpt-5.1-codex"
|
||||
```
|
||||
- Execute independent tasks concurrently; serialize conflicting ones; track coverage reports
|
||||
|
||||
- **Step 5: Coverage Validation**
|
||||
- Validate each task’s coverage:
|
||||
- All ≥90% → pass
|
||||
- Any <90% → request more tests (max 2 rounds)
|
||||
|
||||
- **Step 6: Completion Summary**
|
||||
- Provide completed task list, coverage per task, key file changes
|
||||
|
||||
**Error Handling**
|
||||
- Codex failure: retry once, then log and continue
|
||||
- Insufficient coverage: request more tests (max 2 rounds)
|
||||
- Dependency conflicts: serialize automatically
|
||||
|
||||
**Quality Standards**
|
||||
- Code coverage ≥90%
|
||||
- 2-5 genuinely parallelizable tasks
|
||||
- Documentation must be minimal yet actionable
|
||||
- No verbose implementations; only essential code
|
||||
|
||||
**Communication Style**
|
||||
- Be direct and concise
|
||||
- Report progress at each workflow step
|
||||
- Highlight blockers immediately
|
||||
- Provide actionable next steps when coverage fails
|
||||
- Prioritize speed via parallelization while enforcing coverage validation
|
||||
44
development-essentials/.claude-plugin/marketplace.json
Normal file
44
development-essentials/.claude-plugin/marketplace.json
Normal file
@@ -0,0 +1,44 @@
|
||||
{
|
||||
"name": "development-essentials",
|
||||
"source": "./",
|
||||
"description": "Essential development commands for coding, debugging, testing, optimization, and documentation",
|
||||
"version": "1.0.0",
|
||||
"author": {
|
||||
"name": "Claude Code Dev Workflows",
|
||||
"url": "https://github.com/cexll/myclaude"
|
||||
},
|
||||
"homepage": "https://github.com/cexll/myclaude",
|
||||
"repository": "https://github.com/cexll/myclaude",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
"code",
|
||||
"debug",
|
||||
"test",
|
||||
"optimize",
|
||||
"review",
|
||||
"bugfix",
|
||||
"refactor",
|
||||
"documentation"
|
||||
],
|
||||
"category": "essentials",
|
||||
"strict": false,
|
||||
"commands": [
|
||||
"./commands/code.md",
|
||||
"./commands/debug.md",
|
||||
"./commands/test.md",
|
||||
"./commands/optimize.md",
|
||||
"./commands/review.md",
|
||||
"./commands/bugfix.md",
|
||||
"./commands/refactor.md",
|
||||
"./commands/docs.md",
|
||||
"./commands/ask.md",
|
||||
"./commands/think.md"
|
||||
],
|
||||
"agents": [
|
||||
"./agents/code.md",
|
||||
"./agents/bugfix.md",
|
||||
"./agents/bugfix-verify.md",
|
||||
"./agents/optimize.md",
|
||||
"./agents/debug.md"
|
||||
]
|
||||
}
|
||||
253
development-essentials/README.md
Normal file
253
development-essentials/README.md
Normal file
@@ -0,0 +1,253 @@
|
||||
# Development Essentials - Core Development Commands
|
||||
|
||||
核心开发命令套件,提供日常开发所需的所有基础命令。无需工作流开销,直接执行开发任务。
|
||||
|
||||
## 📋 命令列表
|
||||
|
||||
### 1. `/ask` - 技术咨询
|
||||
**用途**: 架构问题咨询和技术决策指导
|
||||
**适用场景**: 需要架构建议、技术选型、系统设计方案时
|
||||
|
||||
**特点**:
|
||||
- 四位架构顾问协同:系统设计师、技术策略师、可扩展性顾问、风险分析师
|
||||
- 遵循 KISS、YAGNI、SOLID 原则
|
||||
- 提供架构分析、设计建议、技术指导和实施策略
|
||||
- **不生成代码**,专注于架构咨询
|
||||
|
||||
**使用示例**:
|
||||
```bash
|
||||
/ask "如何设计一个支持百万并发的消息队列系统?"
|
||||
/ask "微服务架构中应该如何处理分布式事务?"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### 2. `/code` - 功能实现
|
||||
**用途**: 直接实现新功能或特性
|
||||
**适用场景**: 需要快速开发新功能时
|
||||
|
||||
**特点**:
|
||||
- 四位开发专家协同:架构师、实现工程师、集成专家、代码审查员
|
||||
- 渐进式开发,每步验证
|
||||
- 包含完整的实现计划、代码实现、集成指南和测试策略
|
||||
- 生成可运行的高质量代码
|
||||
|
||||
**使用示例**:
|
||||
```bash
|
||||
/code "实现JWT认证中间件"
|
||||
/code "添加用户头像上传功能"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### 3. `/debug` - 系统调试
|
||||
**用途**: 使用 UltraThink 方法系统性调试问题
|
||||
**适用场景**: 遇到复杂bug或系统性问题时
|
||||
|
||||
**特点**:
|
||||
- 四位专家协同:架构师、研究员、编码员、测试员
|
||||
- UltraThink 反思阶段:综合所有洞察形成解决方案
|
||||
- 生成5-7个假设,逐步缩减到1-2个最可能的原因
|
||||
- 在实施修复前要求用户确认诊断结果
|
||||
- 证据驱动的系统性问题分析
|
||||
|
||||
**使用示例**:
|
||||
```bash
|
||||
/debug "API响应时间突然增加10倍"
|
||||
/debug "生产环境内存泄漏问题"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### 4. `/test` - 测试策略
|
||||
**用途**: 设计和实现全面的测试策略
|
||||
**适用场景**: 需要为组件或功能编写测试时
|
||||
|
||||
**特点**:
|
||||
- 四位测试专家:测试架构师、单元测试专家、集成测试工程师、质量验证员
|
||||
- 测试金字塔策略(单元/集成/端到端比例)
|
||||
- 提供测试覆盖率分析和优先级建议
|
||||
- 包含 CI/CD 集成计划
|
||||
|
||||
**使用示例**:
|
||||
```bash
|
||||
/test "用户认证模块"
|
||||
/test "支付处理流程"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### 5. `/optimize` - 性能优化
|
||||
**用途**: 识别和优化性能瓶颈
|
||||
**适用场景**: 系统存在性能问题或需要提升性能时
|
||||
|
||||
**特点**:
|
||||
- 四位优化专家:性能分析师、算法工程师、资源管理员、可扩展性架构师
|
||||
- 建立性能基线和量化指标
|
||||
- 优化算法复杂度、内存使用、I/O操作
|
||||
- 设计水平扩展和并发处理方案
|
||||
|
||||
**使用示例**:
|
||||
```bash
|
||||
/optimize "数据库查询性能"
|
||||
/optimize "API响应时间优化到200ms以内"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### 6. `/review` - 代码审查
|
||||
**用途**: 全方位代码质量审查
|
||||
**适用场景**: 需要审查代码质量、安全性和架构设计时
|
||||
|
||||
**特点**:
|
||||
- 四位审查专家:质量审计员、安全分析师、性能审查员、架构评估员
|
||||
- 多维度审查:可读性、安全性、性能、架构设计
|
||||
- 提供优先级分类的改进建议
|
||||
- 包含具体代码示例和重构建议
|
||||
|
||||
**使用示例**:
|
||||
```bash
|
||||
/review "src/auth/middleware.ts"
|
||||
/review "支付模块代码"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### 7. `/bugfix` - Bug修复
|
||||
**用途**: 快速定位和修复Bug
|
||||
**适用场景**: 需要修复已知Bug时
|
||||
|
||||
**特点**:
|
||||
- 专注于快速修复
|
||||
- 包含验证流程
|
||||
- 确保修复不引入新问题
|
||||
|
||||
**使用示例**:
|
||||
```bash
|
||||
/bugfix "登录失败后session未清理"
|
||||
/bugfix "订单状态更新不及时"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### 8. `/refactor` - 代码重构
|
||||
**用途**: 改进代码结构和可维护性
|
||||
**适用场景**: 代码质量下降或需要优化代码结构时
|
||||
|
||||
**特点**:
|
||||
- 保持功能不变
|
||||
- 提升代码质量和可维护性
|
||||
- 遵循设计模式和最佳实践
|
||||
|
||||
**使用示例**:
|
||||
```bash
|
||||
/refactor "将用户管理模块拆分为独立服务"
|
||||
/refactor "优化支付流程代码结构"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### 9. `/docs` - 文档生成
|
||||
**用途**: 生成项目文档和API文档
|
||||
**适用场景**: 需要为代码或API生成文档时
|
||||
|
||||
**特点**:
|
||||
- 自动分析代码结构
|
||||
- 生成清晰的文档
|
||||
- 包含使用示例
|
||||
|
||||
**使用示例**:
|
||||
```bash
|
||||
/docs "API接口文档"
|
||||
/docs "为认证模块生成开发者文档"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### 10. `/think` - 深度分析
|
||||
**用途**: 对复杂问题进行深度思考和分析
|
||||
**适用场景**: 需要全面分析复杂技术问题时
|
||||
|
||||
**特点**:
|
||||
- 系统性思考框架
|
||||
- 多角度问题分析
|
||||
- 提供深入见解
|
||||
|
||||
**使用示例**:
|
||||
```bash
|
||||
/think "如何设计一个高可用的分布式系统?"
|
||||
/think "微服务拆分的最佳实践是什么?"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### 11. `/enhance-prompt` - 提示词增强 🆕
|
||||
**用途**: 优化和增强用户提供的指令
|
||||
**适用场景**: 需要改进模糊或不清晰的指令时
|
||||
|
||||
**特点**:
|
||||
- 自动分析指令上下文
|
||||
- 消除歧义,提高清晰度
|
||||
- 修正错误并提高具体性
|
||||
- 立即返回增强后的提示词
|
||||
- 保留代码块等特殊格式
|
||||
|
||||
**输出格式**:
|
||||
```
|
||||
### Here is an enhanced version of the original instruction that is more specific and clear:
|
||||
<enhanced-prompt>增强后的提示词</enhanced-prompt>
|
||||
```
|
||||
|
||||
**使用示例**:
|
||||
```bash
|
||||
/enhance-prompt "帮我做一个登录功能"
|
||||
/enhance-prompt "优化一下这个API"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🎯 命令选择指南
|
||||
|
||||
| 需求场景 | 推荐命令 | 说明 |
|
||||
|---------|---------|------|
|
||||
| 需要架构建议 | `/ask` | 不生成代码,专注咨询 |
|
||||
| 实现新功能 | `/code` | 完整的功能实现流程 |
|
||||
| 调试复杂问题 | `/debug` | UltraThink系统性调试 |
|
||||
| 编写测试 | `/test` | 全面的测试策略 |
|
||||
| 性能优化 | `/optimize` | 性能瓶颈分析和优化 |
|
||||
| 代码审查 | `/review` | 多维度质量审查 |
|
||||
| 修复Bug | `/bugfix` | 快速定位和修复 |
|
||||
| 重构代码 | `/refactor` | 提升代码质量 |
|
||||
| 生成文档 | `/docs` | API和开发者文档 |
|
||||
| 深度思考 | `/think` | 复杂问题分析 |
|
||||
| 优化指令 | `/enhance-prompt` | 提示词增强 |
|
||||
|
||||
## 🔧 代理列表
|
||||
|
||||
Development Essentials 模块包含以下专用代理:
|
||||
|
||||
- `code` - 代码实现代理
|
||||
- `bugfix` - Bug修复代理
|
||||
- `bugfix-verify` - Bug验证代理
|
||||
- `code-optimize` - 代码优化代理
|
||||
- `debug` - 调试分析代理
|
||||
- `develop` - 通用开发代理
|
||||
|
||||
## 📖 使用原则
|
||||
|
||||
1. **直接执行**: 无需工作流开销,直接运行命令
|
||||
2. **专注单一任务**: 每个命令聚焦特定开发任务
|
||||
3. **质量优先**: 所有命令都包含质量验证环节
|
||||
4. **实用主义**: KISS/YAGNI/DRY 原则贯穿始终
|
||||
5. **上下文感知**: 自动理解项目结构和编码规范
|
||||
|
||||
## 🔗 相关文档
|
||||
|
||||
- [主文档](../README.md) - 项目总览
|
||||
- [BMAD工作流](../docs/BMAD-WORKFLOW.md) - 完整敏捷流程
|
||||
- [Requirements工作流](../docs/REQUIREMENTS-WORKFLOW.md) - 轻量级开发流程
|
||||
- [插件系统](../PLUGIN_README.md) - 插件安装和管理
|
||||
|
||||
---
|
||||
|
||||
**提示**: 这些命令可以单独使用,也可以组合使用。例如:`/code` → `/test` → `/review` → `/optimize` 构成一个完整的开发周期。
|
||||
9
development-essentials/commands/enhance-prompt.md
Normal file
9
development-essentials/commands/enhance-prompt.md
Normal file
@@ -0,0 +1,9 @@
|
||||
`/enhance-prompt <task info>`
|
||||
|
||||
Here is an instruction that I'd like to give you, but it needs to be improved. Rewrite and enhance this instruction to make it clearer, more specific, less ambiguous, and correct any mistakes. Do not use any tools: reply immediately with your answer, even if you're not sure. Consider the context of our conversation history when enhancing the prompt. If there is code in triple backticks (```) consider whether it is a code sample and should remain unchanged.Reply with the following format:
|
||||
|
||||
### BEGIN RESPONSE
|
||||
|
||||
<enhanced-prompt>enhanced prompt goes here</enhanced-prompt>
|
||||
|
||||
### END RESPONSE
|
||||
315
docs/ADVANCED-AGENTS.md
Normal file
315
docs/ADVANCED-AGENTS.md
Normal file
@@ -0,0 +1,315 @@
|
||||
# Advanced AI Agents Guide
|
||||
|
||||
> GPT-5 deep reasoning integration for complex analysis and architectural decisions
|
||||
|
||||
## 🎯 Overview
|
||||
|
||||
The Advanced AI Agents plugin provides access to GPT-5's deep reasoning capabilities through the `gpt5` agent, designed for complex problem-solving that requires multi-step thinking and comprehensive analysis.
|
||||
|
||||
## 🤖 GPT-5 Agent
|
||||
|
||||
### Capabilities
|
||||
|
||||
The `gpt5` agent excels at:
|
||||
|
||||
- **Architectural Analysis**: Evaluating system designs and scalability concerns
|
||||
- **Strategic Planning**: Breaking down complex initiatives into actionable plans
|
||||
- **Trade-off Analysis**: Comparing multiple approaches with detailed pros/cons
|
||||
- **Problem Decomposition**: Breaking complex problems into manageable components
|
||||
- **Deep Reasoning**: Multi-step logical analysis for non-obvious solutions
|
||||
- **Technology Evaluation**: Assessing technologies, frameworks, and tools
|
||||
|
||||
### When to Use
|
||||
|
||||
**Use GPT-5 agent** when:
|
||||
- Problem requires deep, multi-step reasoning
|
||||
- Multiple solution approaches need evaluation
|
||||
- Architectural decisions have long-term impact
|
||||
- Trade-offs are complex and multifaceted
|
||||
- Standard agents provide insufficient depth
|
||||
|
||||
**Use standard agents** when:
|
||||
- Task is straightforward implementation
|
||||
- Requirements are clear and well-defined
|
||||
- Quick turnaround is priority
|
||||
- Problem is domain-specific (code, tests, etc.)
|
||||
|
||||
## 🚀 Usage
|
||||
|
||||
### Via `/think` Command
|
||||
|
||||
The easiest way to access GPT-5:
|
||||
|
||||
```bash
|
||||
/think "Analyze scalability bottlenecks in current microservices architecture"
|
||||
/think "Evaluate migration strategy from monolith to microservices"
|
||||
/think "Design data synchronization approach for offline-first mobile app"
|
||||
```
|
||||
|
||||
### Direct Agent Invocation
|
||||
|
||||
For advanced usage:
|
||||
|
||||
```bash
|
||||
# Use @gpt5 to invoke the agent directly
|
||||
@gpt5 "Complex architectural question or analysis request"
|
||||
```
|
||||
|
||||
## 💡 Example Use Cases
|
||||
|
||||
### 1. Architecture Evaluation
|
||||
|
||||
```bash
|
||||
/think "Current system uses REST API with polling for real-time updates.
|
||||
Evaluate whether to migrate to WebSocket, Server-Sent Events, or GraphQL
|
||||
subscriptions. Consider: team experience, existing infrastructure, client
|
||||
support, scalability, and implementation effort."
|
||||
```
|
||||
|
||||
**GPT-5 provides**:
|
||||
- Detailed analysis of each option
|
||||
- Pros and cons for your specific context
|
||||
- Migration complexity assessment
|
||||
- Performance implications
|
||||
- Recommended approach with justification
|
||||
|
||||
### 2. Migration Strategy
|
||||
|
||||
```bash
|
||||
/think "Plan migration from PostgreSQL to multi-region distributed database.
|
||||
System has 50M users, 200M rows, 1000 req/sec. Must maintain 99.9% uptime.
|
||||
What's the safest migration path?"
|
||||
```
|
||||
|
||||
**GPT-5 provides**:
|
||||
- Step-by-step migration plan
|
||||
- Risk assessment for each phase
|
||||
- Rollback strategies
|
||||
- Data consistency approaches
|
||||
- Timeline estimation
|
||||
|
||||
### 3. Problem Decomposition
|
||||
|
||||
```bash
|
||||
/think "Design a recommendation engine that learns user preferences, handles
|
||||
cold start, provides explainable results, and scales to 10M users. Break this
|
||||
down into implementation phases with clear milestones."
|
||||
```
|
||||
|
||||
**GPT-5 provides**:
|
||||
- Problem breakdown into components
|
||||
- Phased implementation plan
|
||||
- Technical approach for each phase
|
||||
- Dependencies between phases
|
||||
- Success criteria and metrics
|
||||
|
||||
### 4. Technology Selection
|
||||
|
||||
```bash
|
||||
/think "Choosing between Redis, Memcached, and Hazelcast for distributed
|
||||
caching. System needs: persistence, pub/sub, clustering, and complex data
|
||||
structures. Existing stack: Java, Kubernetes, AWS."
|
||||
```
|
||||
|
||||
**GPT-5 provides**:
|
||||
- Comparison matrix across requirements
|
||||
- Integration considerations
|
||||
- Operational complexity analysis
|
||||
- Cost implications
|
||||
- Recommendation with rationale
|
||||
|
||||
### 5. Performance Optimization
|
||||
|
||||
```bash
|
||||
/think "API response time increased from 100ms to 800ms after scaling from
|
||||
100 to 10,000 users. Database queries look optimized. What are the likely
|
||||
bottlenecks and systematic approach to identify them?"
|
||||
```
|
||||
|
||||
**GPT-5 provides**:
|
||||
- Hypothesis generation (N+1 queries, connection pooling, etc.)
|
||||
- Systematic debugging approach
|
||||
- Profiling strategy
|
||||
- Likely root causes ranked by probability
|
||||
- Optimization recommendations
|
||||
|
||||
## 🎨 Integration with BMAD
|
||||
|
||||
### Enhanced Code Review
|
||||
|
||||
BMAD's `bmad-review` agent can optionally use GPT-5 for deeper analysis:
|
||||
|
||||
**Configuration**:
|
||||
```bash
|
||||
# Enable enhanced review mode (via environment or BMAD config)
|
||||
BMAD_REVIEW_MODE=enhanced /bmad-pilot "feature description"
|
||||
```
|
||||
|
||||
**What changes**:
|
||||
- Standard review: Fast, focuses on code quality and obvious issues
|
||||
- Enhanced review: Deep analysis including:
|
||||
- Architectural impact
|
||||
- Security implications
|
||||
- Performance considerations
|
||||
- Scalability concerns
|
||||
- Design pattern appropriateness
|
||||
|
||||
### Architecture Phase Support
|
||||
|
||||
Use `/think` during BMAD architecture phase:
|
||||
|
||||
```bash
|
||||
# Start BMAD workflow
|
||||
/bmad-pilot "E-commerce platform with real-time inventory"
|
||||
|
||||
# During Architecture phase, get deep analysis
|
||||
/think "Evaluate architecture approaches for real-time inventory
|
||||
synchronization across warehouses, online store, and mobile apps"
|
||||
|
||||
# Continue with BMAD using insights
|
||||
```
|
||||
|
||||
## 📋 Best Practices
|
||||
|
||||
### 1. Provide Complete Context
|
||||
|
||||
**❌ Insufficient**:
|
||||
```bash
|
||||
/think "Should we use microservices?"
|
||||
```
|
||||
|
||||
**✅ Complete**:
|
||||
```bash
|
||||
/think "Current monolith: 100K LOC, 8 developers, 50K users, 200ms avg
|
||||
response time. Pain points: slow deployments (1hr), difficult to scale
|
||||
components independently. Should we migrate to microservices? What's the
|
||||
ROI and risk?"
|
||||
```
|
||||
|
||||
### 2. Ask Specific Questions
|
||||
|
||||
**❌ Too broad**:
|
||||
```bash
|
||||
/think "How to build a scalable system?"
|
||||
```
|
||||
|
||||
**✅ Specific**:
|
||||
```bash
|
||||
/think "Current system handles 1K req/sec. Need to scale to 10K. Bottleneck
|
||||
is database writes. Evaluate: sharding, read replicas, CQRS, or caching.
|
||||
Database: PostgreSQL, stack: Node.js, deployment: Kubernetes."
|
||||
```
|
||||
|
||||
### 3. Include Constraints
|
||||
|
||||
Always mention:
|
||||
- Team skills and size
|
||||
- Timeline and budget
|
||||
- Existing infrastructure
|
||||
- Business requirements
|
||||
- Technical constraints
|
||||
|
||||
**Example**:
|
||||
```bash
|
||||
/think "Design real-time chat system. Constraints: team of 3 backend
|
||||
developers (Node.js), 6-month timeline, AWS deployment, must integrate
|
||||
with existing REST API, budget for managed services OK."
|
||||
```
|
||||
|
||||
### 4. Request Specific Outputs
|
||||
|
||||
Tell GPT-5 what format you need:
|
||||
|
||||
```bash
|
||||
/think "Compare Kafka vs RabbitMQ for event streaming.
|
||||
Provide: comparison table, recommendation, migration complexity from current
|
||||
RabbitMQ setup, and estimated effort in developer-weeks."
|
||||
```
|
||||
|
||||
### 5. Iterate and Refine
|
||||
|
||||
Follow up for deeper analysis:
|
||||
|
||||
```bash
|
||||
# Initial question
|
||||
/think "Evaluate caching strategies for user profile API"
|
||||
|
||||
# Follow-up based on response
|
||||
/think "You recommended Redis with write-through caching. How to handle
|
||||
cache invalidation when user updates profile from mobile app?"
|
||||
```
|
||||
|
||||
## 🔧 Technical Details
|
||||
|
||||
### Sequential Thinking
|
||||
|
||||
GPT-5 agent uses sequential thinking for complex problems:
|
||||
|
||||
1. **Problem Understanding**: Clarify requirements and constraints
|
||||
2. **Hypothesis Generation**: Identify possible solutions
|
||||
3. **Analysis**: Evaluate each option systematically
|
||||
4. **Trade-off Assessment**: Compare pros/cons
|
||||
5. **Recommendation**: Provide justified conclusion
|
||||
|
||||
### Reasoning Transparency
|
||||
|
||||
GPT-5 shows its thinking process:
|
||||
- Assumptions made
|
||||
- Factors considered
|
||||
- Why certain options were eliminated
|
||||
- Confidence level in recommendations
|
||||
|
||||
## 🎯 Comparison: GPT-5 vs Standard Agents
|
||||
|
||||
| Aspect | GPT-5 Agent | Standard Agents |
|
||||
|--------|-------------|-----------------|
|
||||
| **Depth** | Deep, multi-step reasoning | Focused, domain-specific |
|
||||
| **Speed** | Slower (comprehensive analysis) | Faster (direct implementation) |
|
||||
| **Use Case** | Strategic decisions, architecture | Implementation, coding, testing |
|
||||
| **Output** | Analysis, recommendations, plans | Code, tests, documentation |
|
||||
| **Best For** | Complex problems, trade-offs | Clear tasks, defined scope |
|
||||
| **Invocation** | `/think` or `@gpt5` | `/code`, `/test`, etc. |
|
||||
|
||||
## 📚 Related Documentation
|
||||
|
||||
- **[BMAD Workflow](BMAD-WORKFLOW.md)** - Integration with full agile workflow
|
||||
- **[Development Commands](DEVELOPMENT-COMMANDS.md)** - Standard command reference
|
||||
- **[Quick Start Guide](QUICK-START.md)** - Get started quickly
|
||||
|
||||
## 💡 Advanced Patterns
|
||||
|
||||
### Pre-Implementation Analysis
|
||||
|
||||
```bash
|
||||
# 1. Deep analysis with GPT-5
|
||||
/think "Design approach for X with constraints Y and Z"
|
||||
|
||||
# 2. Use analysis in BMAD workflow
|
||||
/bmad-pilot "Implement X based on approach from analysis"
|
||||
```
|
||||
|
||||
### Architecture Validation
|
||||
|
||||
```bash
|
||||
# 1. Get initial architecture from BMAD
|
||||
/bmad-pilot "Feature X" # Generates 02-system-architecture.md
|
||||
|
||||
# 2. Validate with GPT-5
|
||||
/think "Review architecture in .claude/specs/feature-x/02-system-architecture.md
|
||||
Evaluate for scalability, security, and maintainability"
|
||||
|
||||
# 3. Refine architecture based on feedback
|
||||
```
|
||||
|
||||
### Decision Documentation
|
||||
|
||||
```bash
|
||||
# Use GPT-5 to document architectural decisions
|
||||
/think "Document decision to use Event Sourcing for order management.
|
||||
Include: context, options considered, decision rationale, consequences,
|
||||
and format as Architecture Decision Record (ADR)"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
**Advanced AI Agents** - Deep reasoning for complex problems that require comprehensive analysis.
|
||||
258
docs/BMAD-WORKFLOW.md
Normal file
258
docs/BMAD-WORKFLOW.md
Normal file
@@ -0,0 +1,258 @@
|
||||
# BMAD Workflow Complete Guide
|
||||
|
||||
> **BMAD (Business-Minded Agile Development)** - AI-driven agile development automation with role-based agents
|
||||
|
||||
## 🎯 What is BMAD?
|
||||
|
||||
BMAD is an enterprise-grade agile development methodology that transforms your development process into a fully automated workflow with 6 specialized AI agents and quality gates.
|
||||
|
||||
### Core Principles
|
||||
|
||||
- **Agent Planning**: Specialized agents collaborate to create detailed, consistent PRDs and architecture documents
|
||||
- **Context-Driven Development**: Transform detailed plans into ultra-detailed development stories
|
||||
- **Role Specialization**: Each agent focuses on specific domains, avoiding quality degradation from role switching
|
||||
|
||||
## 🤖 BMAD Agent System
|
||||
|
||||
### Agent Roles
|
||||
|
||||
| Agent | Role | Quality Gate | Artifacts |
|
||||
|-------|------|--------------|-----------|
|
||||
| **bmad-po** (Sarah) | Product Owner - requirements gathering, user stories | PRD ≥ 90/100 | `01-product-requirements.md` |
|
||||
| **bmad-architect** (Winston) | System Architect - technical design, system architecture | Design ≥ 90/100 | `02-system-architecture.md` |
|
||||
| **bmad-sm** (Mike) | Scrum Master - task breakdown, sprint planning | User approval | `03-sprint-plan.md` |
|
||||
| **bmad-dev** (Alex) | Developer - code implementation, technical docs | Code completion | Implementation files |
|
||||
| **bmad-review** | Code Reviewer - independent review between Dev and QA | Pass/Risk/Fail | `04-dev-reviewed.md` |
|
||||
| **bmad-qa** (Emma) | QA Engineer - testing strategy, quality assurance | Test execution | `05-qa-report.md` |
|
||||
|
||||
## 🚀 Quick Start
|
||||
|
||||
### Command Overview
|
||||
|
||||
```bash
|
||||
# Full BMAD workflow
|
||||
/bmad-pilot "Build e-commerce checkout system with payment integration"
|
||||
|
||||
# Workflow: PO → Architect → SM → Dev → Review → QA
|
||||
```
|
||||
|
||||
### Command Options
|
||||
|
||||
```bash
|
||||
# Skip testing phase
|
||||
/bmad-pilot "Admin dashboard" --skip-tests
|
||||
|
||||
# Skip sprint planning (architecture → dev directly)
|
||||
/bmad-pilot "API gateway implementation" --direct-dev
|
||||
|
||||
# Skip repository scan (not recommended)
|
||||
/bmad-pilot "Add feature" --skip-scan
|
||||
```
|
||||
|
||||
### Individual Agent Usage
|
||||
|
||||
```bash
|
||||
# Product requirements analysis only
|
||||
/bmad-po "Enterprise CRM system requirements"
|
||||
|
||||
# Technical architecture design only
|
||||
/bmad-architect "High-concurrency distributed system design"
|
||||
|
||||
# Orchestrator (can transform into any agent)
|
||||
/bmad-orchestrator "Coordinate multi-agent complex project"
|
||||
```
|
||||
|
||||
## 📋 Workflow Phases
|
||||
|
||||
### Phase 0: Repository Scan (Automatic)
|
||||
- **Agent**: `bmad-orchestrator`
|
||||
- **Output**: `00-repository-context.md`
|
||||
- **Content**: Project type, tech stack, code organization, conventions, integration points
|
||||
|
||||
### Phase 1: Product Requirements (PO)
|
||||
- **Agent**: `bmad-po` (Sarah - Product Owner)
|
||||
- **Quality Gate**: PRD score ≥ 90/100
|
||||
- **Output**: `01-product-requirements.md`
|
||||
- **Process**:
|
||||
1. PO generates initial PRD
|
||||
2. System calculates quality score (100-point scale)
|
||||
3. If < 90: User provides feedback → PO revises → Recalculate
|
||||
4. If ≥ 90: User confirms → Save artifact → Next phase
|
||||
|
||||
### Phase 2: System Architecture (Architect)
|
||||
- **Agent**: `bmad-architect` (Winston - System Architect)
|
||||
- **Quality Gate**: Design score ≥ 90/100
|
||||
- **Output**: `02-system-architecture.md`
|
||||
- **Process**:
|
||||
1. Architect reads PRD + repo context
|
||||
2. Generates technical design document
|
||||
3. System calculates design quality score
|
||||
4. If < 90: User provides feedback → Architect revises
|
||||
5. If ≥ 90: User confirms → Save artifact → Next phase
|
||||
|
||||
### Phase 3: Sprint Planning (SM)
|
||||
- **Agent**: `bmad-sm` (Mike - Scrum Master)
|
||||
- **Quality Gate**: User approval
|
||||
- **Output**: `03-sprint-plan.md`
|
||||
- **Process**:
|
||||
1. SM reads PRD + Architecture
|
||||
2. Breaks down tasks with story points
|
||||
3. User reviews sprint plan
|
||||
4. User confirms → Save artifact → Next phase
|
||||
- **Skip**: Use `--direct-dev` to skip this phase
|
||||
|
||||
### Phase 4: Development (Dev)
|
||||
- **Agent**: `bmad-dev` (Alex - Developer)
|
||||
- **Quality Gate**: Code completion
|
||||
- **Output**: Implementation files
|
||||
- **Process**:
|
||||
1. Dev reads all previous artifacts
|
||||
2. Implements features following sprint plan
|
||||
3. Creates or modifies code files
|
||||
4. Completes implementation → Next phase
|
||||
|
||||
### Phase 5: Code Review (Review)
|
||||
- **Agent**: `bmad-review` (Independent Reviewer)
|
||||
- **Quality Gate**: Pass / Pass with Risk / Fail
|
||||
- **Output**: `04-dev-reviewed.md`
|
||||
- **Process**:
|
||||
1. Review reads implementation + all specs
|
||||
2. Performs comprehensive code review
|
||||
3. Generates review report with status:
|
||||
- **Pass**: No issues, proceed to QA
|
||||
- **Pass with Risk**: Non-critical issues noted
|
||||
- **Fail**: Critical issues, return to Dev
|
||||
4. Updates sprint plan with review findings
|
||||
|
||||
**Enhanced Review (Optional)**:
|
||||
- Use GPT-5 via Codex CLI for deeper analysis
|
||||
- Set via `BMAD_REVIEW_MODE=enhanced` environment variable
|
||||
|
||||
### Phase 6: Quality Assurance (QA)
|
||||
- **Agent**: `bmad-qa` (Emma - QA Engineer)
|
||||
- **Quality Gate**: Test execution
|
||||
- **Output**: `05-qa-report.md`
|
||||
- **Process**:
|
||||
1. QA reads implementation + review + all specs
|
||||
2. Creates targeted test strategy
|
||||
3. Executes tests
|
||||
4. Generates QA report
|
||||
5. Workflow complete
|
||||
- **Skip**: Use `--skip-tests` to skip this phase
|
||||
|
||||
## 📊 Quality Scoring System
|
||||
|
||||
### PRD Quality (100 points)
|
||||
- **Business Value** (30): Clear value proposition, user benefits
|
||||
- **Functional Requirements** (25): Complete, unambiguous requirements
|
||||
- **User Experience** (20): User flows, interaction patterns
|
||||
- **Technical Constraints** (15): Performance, security, scalability
|
||||
- **Scope & Priorities** (10): Clear boundaries, must-have vs nice-to-have
|
||||
|
||||
### Architecture Quality (100 points)
|
||||
- **Design Quality** (30): Modularity, maintainability, clarity
|
||||
- **Technology Selection** (25): Appropriate tech stack, justification
|
||||
- **Scalability** (20): Growth handling, performance considerations
|
||||
- **Security** (15): Authentication, authorization, data protection
|
||||
- **Feasibility** (10): Realistic implementation, resource alignment
|
||||
|
||||
### Review Status (3 levels)
|
||||
- **Pass**: No critical issues, code meets standards
|
||||
- **Pass with Risk**: Non-critical issues, recommendations included
|
||||
- **Fail**: Critical issues, requires Dev iteration
|
||||
|
||||
## 📁 Workflow Artifacts
|
||||
|
||||
All documents are saved to `.claude/specs/{feature-name}/`:
|
||||
|
||||
```
|
||||
.claude/specs/e-commerce-checkout/
|
||||
├── 00-repository-context.md # Repo analysis (auto)
|
||||
├── 01-product-requirements.md # PRD (PO, score ≥ 90)
|
||||
├── 02-system-architecture.md # Design (Architect, score ≥ 90)
|
||||
├── 03-sprint-plan.md # Sprint plan (SM, user approved)
|
||||
├── 04-dev-reviewed.md # Code review (Review, Pass/Risk/Fail)
|
||||
└── 05-qa-report.md # Test report (QA, tests executed)
|
||||
```
|
||||
|
||||
Feature name generated from project description (kebab-case: lowercase, spaces/punctuation → `-`).
|
||||
|
||||
## 🔧 Advanced Usage
|
||||
|
||||
### Approval Gates
|
||||
|
||||
Critical phases require explicit user confirmation:
|
||||
|
||||
```
|
||||
Architect: "Technical design complete (Score: 93/100)"
|
||||
System: "Ready to proceed to sprint planning? (yes/no)"
|
||||
User: yes
|
||||
```
|
||||
|
||||
### Iterative Refinement
|
||||
|
||||
Each phase supports feedback loops:
|
||||
|
||||
```
|
||||
PO: "Here's the PRD (Score: 75/100)"
|
||||
User: "Add mobile support and offline mode"
|
||||
PO: "Updated PRD (Score: 92/100) ✅"
|
||||
```
|
||||
|
||||
### Repository Context
|
||||
|
||||
BMAD automatically scans your repository to understand:
|
||||
- Technology stack (languages, frameworks, libraries)
|
||||
- Project structure (directories, modules, patterns)
|
||||
- Existing conventions (naming, formatting, architecture)
|
||||
- Dependencies (package managers, external services)
|
||||
- Integration points (APIs, databases, third-party services)
|
||||
|
||||
### Workflow Variations
|
||||
|
||||
**Fast Prototyping** - Skip non-essential phases:
|
||||
```bash
|
||||
/bmad-pilot "Quick admin UI" --skip-tests --direct-dev
|
||||
# Workflow: PO → Architect → Dev
|
||||
```
|
||||
|
||||
**Architecture-First** - Focus on design:
|
||||
```bash
|
||||
/bmad-architect "Microservices architecture for e-commerce"
|
||||
# Only runs Architect agent
|
||||
```
|
||||
|
||||
**Full Rigor** - All phases with maximum quality:
|
||||
```bash
|
||||
/bmad-pilot "Enterprise payment gateway with PCI compliance"
|
||||
# Workflow: Scan → PO → Architect → SM → Dev → Review → QA
|
||||
```
|
||||
|
||||
## 🎨 Output Style
|
||||
|
||||
BMAD workflow uses a specialized output style that:
|
||||
- Creates phase-separated contexts
|
||||
- Manages agent handoffs with clear boundaries
|
||||
- Tracks quality scores across phases
|
||||
- Handles approval gates with user prompts
|
||||
- Supports Codex CLI integration for enhanced reviews
|
||||
|
||||
## 📚 Related Documentation
|
||||
|
||||
- **[Quick Start Guide](QUICK-START.md)** - Get started in 5 minutes
|
||||
- **[Plugin System](PLUGIN-SYSTEM.md)** - Installation and configuration
|
||||
- **[Development Commands](DEVELOPMENT-COMMANDS.md)** - Alternative workflows
|
||||
- **[Requirements Workflow](REQUIREMENTS-WORKFLOW.md)** - Lightweight alternative
|
||||
|
||||
## 💡 Best Practices
|
||||
|
||||
1. **Don't skip repository scan** - Helps agents understand your project context
|
||||
2. **Provide detailed descriptions** - Better input → better output
|
||||
3. **Engage with agents** - Provide feedback during quality gates
|
||||
4. **Review artifacts** - Check generated documents before confirming
|
||||
5. **Use appropriate workflows** - Full BMAD for complex features, lightweight for simple tasks
|
||||
6. **Keep artifacts** - They serve as project documentation and context for future work
|
||||
|
||||
---
|
||||
|
||||
**Transform your development with BMAD** - One command, complete agile workflow, quality assured.
|
||||
321
docs/DEVELOPMENT-COMMANDS.md
Normal file
321
docs/DEVELOPMENT-COMMANDS.md
Normal file
@@ -0,0 +1,321 @@
|
||||
# Development Commands Reference
|
||||
|
||||
> Direct slash commands for daily coding tasks without workflow overhead
|
||||
|
||||
## 🎯 Overview
|
||||
|
||||
Development Essentials provides focused slash commands for common development tasks. Use these when you need direct implementation without the full workflow structure.
|
||||
|
||||
## 📋 Available Commands
|
||||
|
||||
### `/code` - Direct Implementation
|
||||
|
||||
Implement features, add functionality, or write code directly.
|
||||
|
||||
**Usage**:
|
||||
```bash
|
||||
/code "Add input validation for email fields"
|
||||
/code "Implement pagination for user list API"
|
||||
/code "Create database migration for orders table"
|
||||
```
|
||||
|
||||
**Agent**: `code`
|
||||
|
||||
**Best for**:
|
||||
- Clear, well-defined tasks
|
||||
- Quick implementations
|
||||
- Following existing patterns
|
||||
- Adding straightforward features
|
||||
|
||||
### `/debug` - Systematic Debugging
|
||||
|
||||
Analyze and fix bugs with structured debugging approach.
|
||||
|
||||
**Usage**:
|
||||
```bash
|
||||
/debug "Login fails with 500 error on invalid credentials"
|
||||
/debug "Memory leak in background worker process"
|
||||
/debug "Race condition in order processing"
|
||||
```
|
||||
|
||||
**Agent**: `debug`
|
||||
|
||||
**Approach**:
|
||||
1. Reproduce the issue
|
||||
2. Analyze root cause
|
||||
3. Propose solution
|
||||
4. Implement fix
|
||||
5. Verify resolution
|
||||
|
||||
### `/test` - Testing Strategy
|
||||
|
||||
Create tests, improve test coverage, or test existing code.
|
||||
|
||||
**Usage**:
|
||||
```bash
|
||||
/test "Add unit tests for authentication service"
|
||||
/test "Create integration tests for payment flow"
|
||||
/test "Test edge cases for date parser"
|
||||
```
|
||||
|
||||
**Agent**: `develop` (testing mode)
|
||||
|
||||
**Covers**:
|
||||
- Unit tests
|
||||
- Integration tests
|
||||
- Edge cases
|
||||
- Error scenarios
|
||||
- Test data setup
|
||||
|
||||
### `/optimize` - Performance Tuning
|
||||
|
||||
Improve performance, reduce resource usage, or optimize algorithms.
|
||||
|
||||
**Usage**:
|
||||
```bash
|
||||
/optimize "Reduce database queries in dashboard endpoint"
|
||||
/optimize "Speed up report generation process"
|
||||
/optimize "Improve memory usage in data processing pipeline"
|
||||
```
|
||||
|
||||
**Agent**: `develop` (optimization mode)
|
||||
|
||||
**Focus areas**:
|
||||
- Algorithm efficiency
|
||||
- Database query optimization
|
||||
- Caching strategies
|
||||
- Resource utilization
|
||||
- Load time reduction
|
||||
|
||||
### `/bugfix` - Bug Resolution
|
||||
|
||||
Fix specific bugs with focused approach.
|
||||
|
||||
**Usage**:
|
||||
```bash
|
||||
/bugfix "Users can't reset password with special characters"
|
||||
/bugfix "Session expires too quickly on mobile"
|
||||
/bugfix "File upload fails for large files"
|
||||
```
|
||||
|
||||
**Agent**: `bugfix`
|
||||
|
||||
**Process**:
|
||||
1. Understand the bug
|
||||
2. Locate problematic code
|
||||
3. Implement fix
|
||||
4. Add regression tests
|
||||
5. Verify fix
|
||||
|
||||
### `/refactor` - Code Improvement
|
||||
|
||||
Improve code structure, readability, or maintainability without changing behavior.
|
||||
|
||||
**Usage**:
|
||||
```bash
|
||||
/refactor "Extract user validation logic into separate module"
|
||||
/refactor "Simplify nested conditionals in order processing"
|
||||
/refactor "Remove code duplication in API handlers"
|
||||
```
|
||||
|
||||
**Agent**: `develop` (refactor mode)
|
||||
|
||||
**Goals**:
|
||||
- Improve readability
|
||||
- Reduce complexity
|
||||
- Eliminate duplication
|
||||
- Enhance maintainability
|
||||
- Follow best practices
|
||||
|
||||
### `/review` - Code Validation
|
||||
|
||||
Review code for quality, security, and best practices.
|
||||
|
||||
**Usage**:
|
||||
```bash
|
||||
/review "Check authentication implementation for security issues"
|
||||
/review "Validate API error handling patterns"
|
||||
/review "Assess database schema design"
|
||||
```
|
||||
|
||||
**Agent**: Independent reviewer
|
||||
|
||||
**Review criteria**:
|
||||
- Code quality
|
||||
- Security vulnerabilities
|
||||
- Performance issues
|
||||
- Best practices compliance
|
||||
- Maintainability
|
||||
|
||||
### `/ask` - Technical Consultation
|
||||
|
||||
Get technical advice, design patterns, or implementation guidance.
|
||||
|
||||
**Usage**:
|
||||
```bash
|
||||
/ask "Best approach for real-time notifications in React"
|
||||
/ask "How to handle database migrations in production"
|
||||
/ask "Design pattern for plugin system"
|
||||
```
|
||||
|
||||
**Agent**: Technical consultant
|
||||
|
||||
**Provides**:
|
||||
- Architecture guidance
|
||||
- Technology recommendations
|
||||
- Design patterns
|
||||
- Best practices
|
||||
- Trade-off analysis
|
||||
|
||||
### `/docs` - Documentation
|
||||
|
||||
Generate or improve documentation.
|
||||
|
||||
**Usage**:
|
||||
```bash
|
||||
/docs "Create API documentation for user endpoints"
|
||||
/docs "Add JSDoc comments to utility functions"
|
||||
/docs "Write README for authentication module"
|
||||
```
|
||||
|
||||
**Agent**: Documentation writer
|
||||
|
||||
**Creates**:
|
||||
- Code comments
|
||||
- API documentation
|
||||
- README files
|
||||
- Usage examples
|
||||
- Architecture docs
|
||||
|
||||
### `/think` - Advanced Analysis
|
||||
|
||||
Deep reasoning and analysis for complex problems.
|
||||
|
||||
**Usage**:
|
||||
```bash
|
||||
/think "Analyze scalability bottlenecks in current architecture"
|
||||
/think "Evaluate different approaches for data synchronization"
|
||||
/think "Design migration strategy from monolith to microservices"
|
||||
```
|
||||
|
||||
**Agent**: `gpt5` (deep reasoning)
|
||||
|
||||
**Best for**:
|
||||
- Complex architectural decisions
|
||||
- Multi-faceted problems
|
||||
- Trade-off analysis
|
||||
- Strategic planning
|
||||
- System design
|
||||
|
||||
## 🔄 Command Workflows
|
||||
|
||||
### Simple Feature Development
|
||||
|
||||
```bash
|
||||
# 1. Ask for guidance
|
||||
/ask "Best way to implement rate limiting in Express"
|
||||
|
||||
# 2. Implement the feature
|
||||
/code "Add rate limiting middleware to API routes"
|
||||
|
||||
# 3. Add tests
|
||||
/test "Create tests for rate limiting behavior"
|
||||
|
||||
# 4. Review implementation
|
||||
/review "Validate rate limiting implementation"
|
||||
```
|
||||
|
||||
### Bug Investigation and Fix
|
||||
|
||||
```bash
|
||||
# 1. Debug the issue
|
||||
/debug "API returns 500 on concurrent requests"
|
||||
|
||||
# 2. Fix the bug
|
||||
/bugfix "Add mutex lock to prevent race condition"
|
||||
|
||||
# 3. Add regression tests
|
||||
/test "Test concurrent request handling"
|
||||
```
|
||||
|
||||
### Code Quality Improvement
|
||||
|
||||
```bash
|
||||
# 1. Review current code
|
||||
/review "Analyze user service for improvements"
|
||||
|
||||
# 2. Refactor based on findings
|
||||
/refactor "Simplify user validation logic"
|
||||
|
||||
# 3. Optimize performance
|
||||
/optimize "Cache frequently accessed user data"
|
||||
|
||||
# 4. Update documentation
|
||||
/docs "Document user service API"
|
||||
```
|
||||
|
||||
## 🎯 When to Use What
|
||||
|
||||
### Use Direct Commands When:
|
||||
- Task is clear and well-defined
|
||||
- No complex planning needed
|
||||
- Fast iteration is priority
|
||||
- Working within existing patterns
|
||||
|
||||
### Use Requirements Workflow When:
|
||||
- Feature has unclear requirements
|
||||
- Need documented specifications
|
||||
- Multiple implementation approaches possible
|
||||
- Quality gates desired
|
||||
|
||||
### Use BMAD Workflow When:
|
||||
- Complex business requirements
|
||||
- Architecture design needed
|
||||
- Sprint planning required
|
||||
- Multiple stakeholders involved
|
||||
|
||||
## 💡 Best Practices
|
||||
|
||||
1. **Be Specific**: Provide clear, detailed descriptions
|
||||
- ❌ `/code "fix the bug"`
|
||||
- ✅ `/code "Fix null pointer exception in user login when email is missing"`
|
||||
|
||||
2. **One Task Per Command**: Keep commands focused
|
||||
- ❌ `/code "Add feature X, fix bug Y, refactor module Z"`
|
||||
- ✅ `/code "Add email validation to registration form"`
|
||||
|
||||
3. **Provide Context**: Include relevant details
|
||||
- ✅ `/debug "Login API returns 401 after password change, only on Safari"`
|
||||
|
||||
4. **Use Appropriate Command**: Match command to task type
|
||||
- Use `/bugfix` for bugs, not `/code`
|
||||
- Use `/refactor` for restructuring, not `/optimize`
|
||||
- Use `/think` for complex analysis, not `/ask`
|
||||
|
||||
5. **Chain Commands**: Break complex tasks into steps
|
||||
```bash
|
||||
/ask "How to implement OAuth2"
|
||||
/code "Implement OAuth2 authorization flow"
|
||||
/test "Add OAuth2 integration tests"
|
||||
/review "Validate OAuth2 security"
|
||||
/docs "Document OAuth2 setup process"
|
||||
```
|
||||
|
||||
## 🔌 Agent Configuration
|
||||
|
||||
All commands use specialized agents configured in:
|
||||
- `development-essentials/agents/`
|
||||
- Agent prompt templates
|
||||
- Tool access permissions
|
||||
- Output formatting
|
||||
|
||||
## 📚 Related Documentation
|
||||
|
||||
- **[BMAD Workflow](BMAD-WORKFLOW.md)** - Full agile methodology
|
||||
- **[Requirements Workflow](REQUIREMENTS-WORKFLOW.md)** - Lightweight workflow
|
||||
- **[Quick Start Guide](QUICK-START.md)** - Get started quickly
|
||||
- **[Plugin System](PLUGIN-SYSTEM.md)** - Installation and configuration
|
||||
|
||||
---
|
||||
|
||||
**Development Essentials** - Direct commands for productive coding without workflow overhead.
|
||||
348
docs/PLUGIN-SYSTEM.md
Normal file
348
docs/PLUGIN-SYSTEM.md
Normal file
@@ -0,0 +1,348 @@
|
||||
# Plugin System Guide
|
||||
|
||||
> Native Claude Code plugin support for modular workflow installation
|
||||
|
||||
## 🎯 Overview
|
||||
|
||||
This repository provides 4 ready-to-use Claude Code plugins that can be installed individually or as a complete suite.
|
||||
|
||||
## 📦 Available Plugins
|
||||
|
||||
### 1. bmad-agile-workflow
|
||||
|
||||
**Complete BMAD methodology with 6 specialized agents**
|
||||
|
||||
**Commands**:
|
||||
- `/bmad-pilot` - Full agile workflow orchestration
|
||||
|
||||
**Agents**:
|
||||
- `bmad-po` - Product Owner (Sarah)
|
||||
- `bmad-architect` - System Architect (Winston)
|
||||
- `bmad-sm` - Scrum Master (Mike)
|
||||
- `bmad-dev` - Developer (Alex)
|
||||
- `bmad-review` - Code Reviewer
|
||||
- `bmad-qa` - QA Engineer (Emma)
|
||||
- `bmad-orchestrator` - Main orchestrator
|
||||
|
||||
**Use for**: Enterprise projects, complex features, full agile process
|
||||
|
||||
### 2. requirements-driven-workflow
|
||||
|
||||
**Streamlined requirements-to-code workflow**
|
||||
|
||||
**Commands**:
|
||||
- `/requirements-pilot` - Requirements-driven development flow
|
||||
|
||||
**Agents**:
|
||||
- `requirements-generate` - Requirements generation
|
||||
- `requirements-code` - Code implementation
|
||||
- `requirements-review` - Code review
|
||||
- `requirements-testing` - Testing strategy
|
||||
|
||||
**Use for**: Quick prototyping, simple features, rapid development
|
||||
|
||||
### 3. development-essentials
|
||||
|
||||
**Core development slash commands**
|
||||
|
||||
**Commands**:
|
||||
- `/code` - Direct implementation
|
||||
- `/debug` - Systematic debugging
|
||||
- `/test` - Testing strategy
|
||||
- `/optimize` - Performance tuning
|
||||
- `/bugfix` - Bug resolution
|
||||
- `/refactor` - Code improvement
|
||||
- `/review` - Code validation
|
||||
- `/ask` - Technical consultation
|
||||
- `/docs` - Documentation
|
||||
- `/think` - Advanced analysis
|
||||
|
||||
**Agents**:
|
||||
- `code` - Code implementation
|
||||
- `bugfix` - Bug fixing
|
||||
- `debug` - Debugging
|
||||
- `develop` - General development
|
||||
|
||||
**Use for**: Daily coding tasks, quick implementations
|
||||
|
||||
### 4. advanced-ai-agents
|
||||
|
||||
**GPT-5 deep reasoning integration**
|
||||
|
||||
**Commands**: None (agent-only)
|
||||
|
||||
**Agents**:
|
||||
- `gpt5` - Deep reasoning and analysis
|
||||
|
||||
**Use for**: Complex architectural decisions, strategic planning
|
||||
|
||||
## 🚀 Installation Methods
|
||||
|
||||
### Method 1: Plugin Commands (Recommended)
|
||||
|
||||
```bash
|
||||
# List all available plugins
|
||||
/plugin list
|
||||
|
||||
# Get detailed information about a plugin
|
||||
/plugin info bmad-agile-workflow
|
||||
|
||||
# Install a specific plugin
|
||||
/plugin install bmad-agile-workflow
|
||||
|
||||
# Install all plugins
|
||||
/plugin install bmad-agile-workflow
|
||||
/plugin install requirements-driven-workflow
|
||||
/plugin install development-essentials
|
||||
/plugin install advanced-ai-agents
|
||||
|
||||
# Remove an installed plugin
|
||||
/plugin remove development-essentials
|
||||
```
|
||||
|
||||
### Method 2: Repository Reference
|
||||
|
||||
```bash
|
||||
# Install from GitHub repository
|
||||
/plugin github.com/cexll/myclaude
|
||||
```
|
||||
|
||||
This will present all available plugins from the repository.
|
||||
|
||||
### Method 3: Make Commands
|
||||
|
||||
For traditional installation or selective deployment:
|
||||
|
||||
```bash
|
||||
# Install everything
|
||||
make install
|
||||
|
||||
# Deploy specific workflows
|
||||
make deploy-bmad # BMAD workflow only
|
||||
make deploy-requirements # Requirements workflow only
|
||||
make deploy-commands # All slash commands
|
||||
make deploy-agents # All agents
|
||||
|
||||
# Deploy everything
|
||||
make deploy-all
|
||||
|
||||
# View all options
|
||||
make help
|
||||
```
|
||||
|
||||
### Method 4: Manual Installation
|
||||
|
||||
Copy files to Claude Code configuration directories:
|
||||
|
||||
**Commands**:
|
||||
```bash
|
||||
cp bmad-agile-workflow/commands/*.md ~/.config/claude/commands/
|
||||
cp requirements-driven-workflow/commands/*.md ~/.config/claude/commands/
|
||||
cp development-essentials/commands/*.md ~/.config/claude/commands/
|
||||
```
|
||||
|
||||
**Agents**:
|
||||
```bash
|
||||
cp bmad-agile-workflow/agents/*.md ~/.config/claude/agents/
|
||||
cp requirements-driven-workflow/agents/*.md ~/.config/claude/agents/
|
||||
cp development-essentials/agents/*.md ~/.config/claude/agents/
|
||||
cp advanced-ai-agents/agents/*.md ~/.config/claude/agents/
|
||||
```
|
||||
|
||||
**Output Styles** (optional):
|
||||
```bash
|
||||
cp output-styles/*.md ~/.config/claude/output-styles/
|
||||
```
|
||||
|
||||
## 📋 Plugin Configuration
|
||||
|
||||
Plugins are defined in `.claude-plugin/marketplace.json` following the Claude Code plugin specification.
|
||||
|
||||
### Plugin Metadata Structure
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "plugin-name",
|
||||
"displayName": "Human Readable Name",
|
||||
"description": "Plugin description",
|
||||
"version": "1.0.0",
|
||||
"author": "Author Name",
|
||||
"category": "workflow|development|analysis",
|
||||
"keywords": ["keyword1", "keyword2"],
|
||||
"commands": ["command1", "command2"],
|
||||
"agents": ["agent1", "agent2"]
|
||||
}
|
||||
```
|
||||
|
||||
## 🔧 Plugin Management
|
||||
|
||||
### Check Installed Plugins
|
||||
|
||||
```bash
|
||||
/plugin list
|
||||
```
|
||||
|
||||
Shows all installed plugins with their status.
|
||||
|
||||
### Plugin Information
|
||||
|
||||
```bash
|
||||
/plugin info <plugin-name>
|
||||
```
|
||||
|
||||
Displays detailed information:
|
||||
- Description
|
||||
- Version
|
||||
- Commands provided
|
||||
- Agents included
|
||||
- Author and keywords
|
||||
|
||||
### Update Plugins
|
||||
|
||||
Plugins are updated when you pull the latest repository changes:
|
||||
|
||||
```bash
|
||||
git pull origin main
|
||||
make install
|
||||
```
|
||||
|
||||
### Uninstall Plugins
|
||||
|
||||
```bash
|
||||
/plugin remove <plugin-name>
|
||||
```
|
||||
|
||||
Or manually remove files:
|
||||
|
||||
```bash
|
||||
# Remove commands
|
||||
rm ~/.config/claude/commands/<command-name>.md
|
||||
|
||||
# Remove agents
|
||||
rm ~/.config/claude/agents/<agent-name>.md
|
||||
```
|
||||
|
||||
## 🎯 Plugin Selection Guide
|
||||
|
||||
### Install Everything (Recommended for New Users)
|
||||
|
||||
```bash
|
||||
make install
|
||||
```
|
||||
|
||||
Provides complete functionality with all workflows and commands.
|
||||
|
||||
### Selective Installation
|
||||
|
||||
**For Agile Teams**:
|
||||
```bash
|
||||
/plugin install bmad-agile-workflow
|
||||
```
|
||||
|
||||
**For Rapid Development**:
|
||||
```bash
|
||||
/plugin install requirements-driven-workflow
|
||||
/plugin install development-essentials
|
||||
```
|
||||
|
||||
**For Individual Developers**:
|
||||
```bash
|
||||
/plugin install development-essentials
|
||||
/plugin install advanced-ai-agents
|
||||
```
|
||||
|
||||
**For Code Quality Focus**:
|
||||
```bash
|
||||
/plugin install development-essentials # Includes /review
|
||||
/plugin install bmad-agile-workflow # Includes bmad-review
|
||||
```
|
||||
|
||||
## 📁 Directory Structure
|
||||
|
||||
```
|
||||
myclaude/
|
||||
├── .claude-plugin/
|
||||
│ └── marketplace.json # Plugin registry
|
||||
├── bmad-agile-workflow/
|
||||
│ ├── commands/
|
||||
│ │ └── bmad-pilot.md
|
||||
│ └── agents/
|
||||
│ ├── bmad-po.md
|
||||
│ ├── bmad-architect.md
|
||||
│ ├── bmad-sm.md
|
||||
│ ├── bmad-dev.md
|
||||
│ ├── bmad-review.md
|
||||
│ ├── bmad-qa.md
|
||||
│ └── bmad-orchestrator.md
|
||||
├── requirements-driven-workflow/
|
||||
│ ├── commands/
|
||||
│ │ └── requirements-pilot.md
|
||||
│ └── agents/
|
||||
│ ├── requirements-generate.md
|
||||
│ ├── requirements-code.md
|
||||
│ ├── requirements-review.md
|
||||
│ └── requirements-testing.md
|
||||
├── development-essentials/
|
||||
│ ├── commands/
|
||||
│ │ ├── code.md
|
||||
│ │ ├── debug.md
|
||||
│ │ ├── test.md
|
||||
│ │ └── ... (more commands)
|
||||
│ └── agents/
|
||||
│ ├── code.md
|
||||
│ ├── bugfix.md
|
||||
│ ├── debug.md
|
||||
│ └── develop.md
|
||||
├── advanced-ai-agents/
|
||||
│ └── agents/
|
||||
│ └── gpt5.md
|
||||
└── output-styles/
|
||||
└── bmad-phase-context.md
|
||||
```
|
||||
|
||||
## 🔄 Plugin Dependencies
|
||||
|
||||
**No Dependencies**: All plugins work independently
|
||||
|
||||
**Complementary Combinations**:
|
||||
- BMAD + Advanced Agents (enhanced reviews)
|
||||
- Requirements + Development Essentials (complete toolkit)
|
||||
- All four plugins (full suite)
|
||||
|
||||
## 🛠️ Makefile Reference
|
||||
|
||||
```bash
|
||||
# Installation
|
||||
make install # Install all plugins
|
||||
make deploy-all # Deploy all configurations
|
||||
|
||||
# Selective Deployment
|
||||
make deploy-bmad # BMAD workflow only
|
||||
make deploy-requirements # Requirements workflow only
|
||||
make deploy-commands # All slash commands only
|
||||
make deploy-agents # All agents only
|
||||
|
||||
# Testing
|
||||
make test-bmad # Test BMAD workflow
|
||||
make test-requirements # Test Requirements workflow
|
||||
|
||||
# Cleanup
|
||||
make clean # Remove generated artifacts
|
||||
make help # Show all available commands
|
||||
```
|
||||
|
||||
## 📚 Related Documentation
|
||||
|
||||
- **[BMAD Workflow](BMAD-WORKFLOW.md)** - Complete BMAD guide
|
||||
- **[Requirements Workflow](REQUIREMENTS-WORKFLOW.md)** - Lightweight workflow guide
|
||||
- **[Development Commands](DEVELOPMENT-COMMANDS.md)** - Command reference
|
||||
- **[Quick Start Guide](QUICK-START.md)** - Get started quickly
|
||||
|
||||
## 🔗 External Resources
|
||||
|
||||
- **[Claude Code Plugin Docs](https://docs.claude.com/en/docs/claude-code/plugins)** - Official plugin documentation
|
||||
- **[Claude Code CLI](https://claude.ai/code)** - Claude Code interface
|
||||
|
||||
---
|
||||
|
||||
**Modular Installation** - Install only what you need, when you need it.
|
||||
326
docs/QUICK-START.md
Normal file
326
docs/QUICK-START.md
Normal file
@@ -0,0 +1,326 @@
|
||||
# Quick Start Guide
|
||||
|
||||
> Get started with Claude Code Multi-Agent Workflow System in 5 minutes
|
||||
|
||||
## 🚀 Installation (2 minutes)
|
||||
|
||||
### Option 1: Plugin System (Fastest)
|
||||
|
||||
```bash
|
||||
# Install everything with one command
|
||||
/plugin github.com/cexll/myclaude
|
||||
```
|
||||
|
||||
### Option 2: Make Install
|
||||
|
||||
```bash
|
||||
git clone https://github.com/cexll/myclaude.git
|
||||
cd myclaude
|
||||
make install
|
||||
```
|
||||
|
||||
### Option 3: Selective Install
|
||||
|
||||
```bash
|
||||
# Install only what you need
|
||||
/plugin install bmad-agile-workflow # Full agile workflow
|
||||
/plugin install development-essentials # Daily coding commands
|
||||
```
|
||||
|
||||
## 🎯 Your First Workflow (3 minutes)
|
||||
|
||||
### Try BMAD Workflow
|
||||
|
||||
Complete agile development automation:
|
||||
|
||||
```bash
|
||||
/bmad-pilot "Build a simple todo list API with CRUD operations"
|
||||
```
|
||||
|
||||
**What happens**:
|
||||
1. **Product Owner** generates requirements (PRD)
|
||||
2. **Architect** designs system architecture
|
||||
3. **Scrum Master** creates sprint plan
|
||||
4. **Developer** implements code
|
||||
5. **Reviewer** performs code review
|
||||
6. **QA** runs tests
|
||||
|
||||
All documents saved to `.claude/specs/todo-list-api/`
|
||||
|
||||
### Try Requirements Workflow
|
||||
|
||||
Fast prototyping:
|
||||
|
||||
```bash
|
||||
/requirements-pilot "Add user authentication to existing API"
|
||||
```
|
||||
|
||||
**What happens**:
|
||||
1. Generate functional requirements
|
||||
2. Implement code
|
||||
3. Review implementation
|
||||
4. Create tests
|
||||
|
||||
### Try Direct Commands
|
||||
|
||||
Quick coding without workflow:
|
||||
|
||||
```bash
|
||||
# Implement a feature
|
||||
/code "Add input validation for email fields"
|
||||
|
||||
# Debug an issue
|
||||
/debug "API returns 500 on missing parameters"
|
||||
|
||||
# Add tests
|
||||
/test "Create unit tests for validation logic"
|
||||
```
|
||||
|
||||
## 📋 Common Use Cases
|
||||
|
||||
### 1. New Feature Development
|
||||
|
||||
**Complex Feature** (use BMAD):
|
||||
```bash
|
||||
/bmad-pilot "User authentication system with OAuth2, MFA, and role-based access control"
|
||||
```
|
||||
|
||||
**Simple Feature** (use Requirements):
|
||||
```bash
|
||||
/requirements-pilot "Add pagination to user list endpoint"
|
||||
```
|
||||
|
||||
**Tiny Feature** (use direct command):
|
||||
```bash
|
||||
/code "Add created_at timestamp to user model"
|
||||
```
|
||||
|
||||
### 2. Bug Fixing
|
||||
|
||||
**Complex Bug** (use debug):
|
||||
```bash
|
||||
/debug "Memory leak in background job processor"
|
||||
```
|
||||
|
||||
**Simple Bug** (use bugfix):
|
||||
```bash
|
||||
/bugfix "Login button not working on mobile Safari"
|
||||
```
|
||||
|
||||
### 3. Code Quality
|
||||
|
||||
**Full Review**:
|
||||
```bash
|
||||
/review "Review authentication module for security issues"
|
||||
```
|
||||
|
||||
**Refactoring**:
|
||||
```bash
|
||||
/refactor "Simplify user validation logic and remove duplication"
|
||||
```
|
||||
|
||||
**Optimization**:
|
||||
```bash
|
||||
/optimize "Reduce database queries in dashboard API"
|
||||
```
|
||||
|
||||
## 🎨 Workflow Selection Guide
|
||||
|
||||
```
|
||||
┌─────────────────────────────────────────────────────────┐
|
||||
│ Choose Your Workflow │
|
||||
└─────────────────────────────────────────────────────────┘
|
||||
|
||||
Complex Business Feature + Architecture Needed
|
||||
↓
|
||||
🏢 Use BMAD Workflow
|
||||
/bmad-pilot "description"
|
||||
• 6 specialized agents
|
||||
• Quality gates (PRD ≥90, Design ≥90)
|
||||
• Complete documentation
|
||||
• Sprint planning included
|
||||
|
||||
────────────────────────────────────────────────────────
|
||||
|
||||
Clear Requirements + Fast Iteration Needed
|
||||
↓
|
||||
⚡ Use Requirements Workflow
|
||||
/requirements-pilot "description"
|
||||
• 4 phases: Requirements → Code → Review → Test
|
||||
• Quality gate (Requirements ≥90)
|
||||
• Minimal documentation
|
||||
• Direct to implementation
|
||||
|
||||
────────────────────────────────────────────────────────
|
||||
|
||||
Well-Defined Task + No Workflow Overhead
|
||||
↓
|
||||
🔧 Use Direct Commands
|
||||
/code | /debug | /test | /optimize
|
||||
• Single-purpose commands
|
||||
• Immediate execution
|
||||
• No documentation overhead
|
||||
• Perfect for daily tasks
|
||||
```
|
||||
|
||||
## 💡 Tips for Success
|
||||
|
||||
### 1. Be Specific
|
||||
|
||||
**❌ Bad**:
|
||||
```bash
|
||||
/bmad-pilot "Build an app"
|
||||
```
|
||||
|
||||
**✅ Good**:
|
||||
```bash
|
||||
/bmad-pilot "Build a task management API with user authentication, task CRUD,
|
||||
task assignment, and real-time notifications via WebSocket"
|
||||
```
|
||||
|
||||
### 2. Provide Context
|
||||
|
||||
Include relevant technical details:
|
||||
```bash
|
||||
/code "Add Redis caching to user profile endpoint, cache TTL 5 minutes,
|
||||
invalidate on profile update"
|
||||
```
|
||||
|
||||
### 3. Engage with Agents
|
||||
|
||||
During BMAD workflow, provide feedback at quality gates:
|
||||
|
||||
```
|
||||
PO: "Here's the PRD (Score: 85/100)"
|
||||
You: "Add mobile app support and offline mode requirements"
|
||||
PO: "Updated PRD (Score: 94/100) ✅"
|
||||
```
|
||||
|
||||
### 4. Review Generated Artifacts
|
||||
|
||||
Check documents before confirming:
|
||||
- `.claude/specs/{feature}/01-product-requirements.md`
|
||||
- `.claude/specs/{feature}/02-system-architecture.md`
|
||||
- `.claude/specs/{feature}/03-sprint-plan.md`
|
||||
|
||||
### 5. Chain Commands for Complex Tasks
|
||||
|
||||
Break down complex work:
|
||||
```bash
|
||||
/ask "Best approach for implementing real-time chat"
|
||||
/bmad-pilot "Real-time chat system with message history and typing indicators"
|
||||
/test "Add integration tests for chat message delivery"
|
||||
/docs "Document chat API endpoints and WebSocket events"
|
||||
```
|
||||
|
||||
## 🎓 Learning Path
|
||||
|
||||
**Day 1**: Try direct commands
|
||||
```bash
|
||||
/code "simple task"
|
||||
/test "add some tests"
|
||||
/review "check my code"
|
||||
```
|
||||
|
||||
**Day 2**: Try Requirements workflow
|
||||
```bash
|
||||
/requirements-pilot "small feature"
|
||||
```
|
||||
|
||||
**Week 2**: Try BMAD workflow
|
||||
```bash
|
||||
/bmad-pilot "larger feature"
|
||||
```
|
||||
|
||||
**Week 3**: Combine workflows
|
||||
```bash
|
||||
# Use BMAD for planning
|
||||
/bmad-pilot "new module" --direct-dev
|
||||
|
||||
# Use Requirements for sprint tasks
|
||||
/requirements-pilot "individual task from sprint"
|
||||
|
||||
# Use commands for daily work
|
||||
/code "quick fix"
|
||||
/test "add test"
|
||||
```
|
||||
|
||||
## 📚 Next Steps
|
||||
|
||||
### Explore Documentation
|
||||
|
||||
- **[BMAD Workflow Guide](BMAD-WORKFLOW.md)** - Deep dive into full agile workflow
|
||||
- **[Requirements Workflow Guide](REQUIREMENTS-WORKFLOW.md)** - Learn lightweight development
|
||||
- **[Development Commands Reference](DEVELOPMENT-COMMANDS.md)** - All command details
|
||||
- **[Plugin System Guide](PLUGIN-SYSTEM.md)** - Plugin management
|
||||
|
||||
### Try Advanced Features
|
||||
|
||||
**BMAD Options**:
|
||||
```bash
|
||||
# Skip testing for prototype
|
||||
/bmad-pilot "prototype" --skip-tests
|
||||
|
||||
# Skip sprint planning for quick dev
|
||||
/bmad-pilot "feature" --direct-dev
|
||||
|
||||
# Skip repo scan (if context exists)
|
||||
/bmad-pilot "feature" --skip-scan
|
||||
```
|
||||
|
||||
**Individual Agents**:
|
||||
```bash
|
||||
# Just requirements
|
||||
/bmad-po "feature requirements"
|
||||
|
||||
# Just architecture
|
||||
/bmad-architect "system design"
|
||||
|
||||
# Just orchestration
|
||||
/bmad-orchestrator "complex project coordination"
|
||||
```
|
||||
|
||||
### Check Quality
|
||||
|
||||
Run tests and validation:
|
||||
```bash
|
||||
make test-bmad # Test BMAD workflow
|
||||
make test-requirements # Test Requirements workflow
|
||||
```
|
||||
|
||||
## 🆘 Troubleshooting
|
||||
|
||||
**Commands not found**?
|
||||
```bash
|
||||
# Verify installation
|
||||
/plugin list
|
||||
|
||||
# Reinstall if needed
|
||||
make install
|
||||
```
|
||||
|
||||
**Agents not working**?
|
||||
```bash
|
||||
# Check agent configuration
|
||||
ls ~/.config/claude/agents/
|
||||
|
||||
# Redeploy agents
|
||||
make deploy-agents
|
||||
```
|
||||
|
||||
**Output styles missing**?
|
||||
```bash
|
||||
# Deploy output styles
|
||||
cp output-styles/*.md ~/.config/claude/output-styles/
|
||||
```
|
||||
|
||||
## 📞 Get Help
|
||||
|
||||
- **Issues**: [GitHub Issues](https://github.com/cexll/myclaude/issues)
|
||||
- **Documentation**: [docs/](.)
|
||||
- **Examples**: Check `.claude/specs/` after running workflows
|
||||
- **Make Help**: Run `make help` for all commands
|
||||
|
||||
---
|
||||
|
||||
**You're ready!** Start with `/code "your first task"` and explore from there.
|
||||
259
docs/REQUIREMENTS-WORKFLOW.md
Normal file
259
docs/REQUIREMENTS-WORKFLOW.md
Normal file
@@ -0,0 +1,259 @@
|
||||
# Requirements-Driven Workflow Guide
|
||||
|
||||
> Lightweight alternative to BMAD for rapid prototyping and simple feature development
|
||||
|
||||
## 🎯 What is Requirements Workflow?
|
||||
|
||||
A streamlined 4-phase workflow that focuses on getting from requirements to working code quickly:
|
||||
|
||||
**Requirements → Implementation → Review → Testing**
|
||||
|
||||
Perfect for:
|
||||
- Quick prototypes
|
||||
- Small features
|
||||
- Bug fixes with clear scope
|
||||
- Projects without complex architecture needs
|
||||
|
||||
## 🚀 Quick Start
|
||||
|
||||
### Basic Command
|
||||
|
||||
```bash
|
||||
/requirements-pilot "Implement JWT authentication with refresh tokens"
|
||||
|
||||
# Automated workflow:
|
||||
# 1. Requirements generation (90% quality gate)
|
||||
# 2. Code implementation
|
||||
# 3. Code review
|
||||
# 4. Testing strategy
|
||||
```
|
||||
|
||||
### When to Use
|
||||
|
||||
**Use Requirements Workflow** when:
|
||||
- Feature scope is clear and simple
|
||||
- No complex architecture design needed
|
||||
- Fast iteration is priority
|
||||
- You want minimal workflow overhead
|
||||
|
||||
**Use BMAD Workflow** when:
|
||||
- Complex business requirements
|
||||
- Multiple systems integration
|
||||
- Architecture design is critical
|
||||
- Need detailed sprint planning
|
||||
|
||||
## 📋 Workflow Phases
|
||||
|
||||
### Phase 1: Requirements Generation
|
||||
- **Agent**: `requirements-generate`
|
||||
- **Quality Gate**: Requirements score ≥ 90/100
|
||||
- **Output**: Functional requirements document
|
||||
- **Focus**:
|
||||
- Clear functional requirements
|
||||
- Acceptance criteria
|
||||
- Technical constraints
|
||||
- Implementation notes
|
||||
|
||||
**Quality Criteria (100 points)**:
|
||||
- Clarity (30): Unambiguous, well-defined
|
||||
- Completeness (25): All aspects covered
|
||||
- Testability (20): Clear verification points
|
||||
- Technical Feasibility (15): Realistic implementation
|
||||
- Scope Definition (10): Clear boundaries
|
||||
|
||||
### Phase 2: Code Implementation
|
||||
- **Agent**: `requirements-code`
|
||||
- **Quality Gate**: Code completion
|
||||
- **Output**: Implementation files
|
||||
- **Process**:
|
||||
1. Read requirements + repository context
|
||||
2. Implement features following requirements
|
||||
3. Create or modify code files
|
||||
4. Follow existing code conventions
|
||||
|
||||
### Phase 3: Code Review
|
||||
- **Agent**: `requirements-review`
|
||||
- **Quality Gate**: Pass / Pass with Risk / Fail
|
||||
- **Output**: Review report
|
||||
- **Focus**:
|
||||
- Code quality
|
||||
- Requirements alignment
|
||||
- Security concerns
|
||||
- Performance issues
|
||||
- Best practices compliance
|
||||
|
||||
**Review Status**:
|
||||
- **Pass**: Meets standards, ready for testing
|
||||
- **Pass with Risk**: Minor issues noted
|
||||
- **Fail**: Requires implementation revision
|
||||
|
||||
### Phase 4: Testing Strategy
|
||||
- **Agent**: `requirements-testing`
|
||||
- **Quality Gate**: Test execution
|
||||
- **Output**: Test report
|
||||
- **Process**:
|
||||
1. Create test strategy from requirements
|
||||
2. Generate test cases
|
||||
3. Execute tests (unit, integration)
|
||||
4. Report results
|
||||
|
||||
## 📁 Workflow Artifacts
|
||||
|
||||
Generated in `.claude/requirements/{feature-name}/`:
|
||||
|
||||
```
|
||||
.claude/requirements/jwt-authentication/
|
||||
├── 01-requirements.md # Functional requirements (score ≥ 90)
|
||||
├── 02-implementation.md # Implementation summary
|
||||
├── 03-review.md # Code review report
|
||||
└── 04-testing.md # Test strategy and results
|
||||
```
|
||||
|
||||
## 🔧 Command Options
|
||||
|
||||
```bash
|
||||
# Standard workflow
|
||||
/requirements-pilot "Add API rate limiting"
|
||||
|
||||
# With specific technology
|
||||
/requirements-pilot "Redis caching layer with TTL management"
|
||||
|
||||
# Bug fix with requirements
|
||||
/requirements-pilot "Fix login session timeout issue"
|
||||
```
|
||||
|
||||
## 📊 Quality Scoring
|
||||
|
||||
### Requirements Score (100 points)
|
||||
|
||||
| Category | Points | Description |
|
||||
|----------|--------|-------------|
|
||||
| Clarity | 30 | Unambiguous, well-defined requirements |
|
||||
| Completeness | 25 | All functional aspects covered |
|
||||
| Testability | 20 | Clear acceptance criteria |
|
||||
| Technical Feasibility | 15 | Realistic implementation plan |
|
||||
| Scope Definition | 10 | Clear feature boundaries |
|
||||
|
||||
**Threshold**: ≥ 90 points to proceed
|
||||
|
||||
### Automatic Optimization
|
||||
|
||||
If initial score < 90:
|
||||
1. User provides feedback
|
||||
2. Agent revises requirements
|
||||
3. System recalculates score
|
||||
4. Repeat until ≥ 90
|
||||
5. User confirms → Save → Next phase
|
||||
|
||||
## 🎯 Comparison: Requirements vs BMAD
|
||||
|
||||
| Aspect | Requirements Workflow | BMAD Workflow |
|
||||
|--------|----------------------|---------------|
|
||||
| **Phases** | 4 (Requirements → Code → Review → Test) | 6 (PO → Arch → SM → Dev → Review → QA) |
|
||||
| **Duration** | Fast (hours) | Thorough (days) |
|
||||
| **Documentation** | Minimal | Comprehensive |
|
||||
| **Quality Gates** | 1 (Requirements ≥ 90) | 2 (PRD ≥ 90, Design ≥ 90) |
|
||||
| **Approval Points** | None | Multiple (after PRD, Architecture, Sprint Plan) |
|
||||
| **Best For** | Simple features, prototypes | Complex features, enterprise projects |
|
||||
| **Artifacts** | 4 documents | 6 documents |
|
||||
| **Planning** | Direct implementation | Sprint planning included |
|
||||
| **Architecture** | Implicit in requirements | Explicit design phase |
|
||||
|
||||
## 💡 Usage Examples
|
||||
|
||||
### Example 1: API Feature
|
||||
|
||||
```bash
|
||||
/requirements-pilot "REST API endpoint for user profile updates with validation"
|
||||
|
||||
# Generated requirements include:
|
||||
# - Endpoint specification (PUT /api/users/:id/profile)
|
||||
# - Request/response schemas
|
||||
# - Validation rules
|
||||
# - Error handling
|
||||
# - Authentication requirements
|
||||
|
||||
# Implementation follows directly
|
||||
# Review checks API best practices
|
||||
# Testing includes endpoint testing
|
||||
```
|
||||
|
||||
### Example 2: Database Schema
|
||||
|
||||
```bash
|
||||
/requirements-pilot "Add audit logging table for user actions"
|
||||
|
||||
# Generated requirements include:
|
||||
# - Table schema definition
|
||||
# - Indexing strategy
|
||||
# - Retention policy
|
||||
# - Query patterns
|
||||
|
||||
# Implementation creates migration
|
||||
# Review checks schema design
|
||||
# Testing verifies logging behavior
|
||||
```
|
||||
|
||||
### Example 3: Bug Fix
|
||||
|
||||
```bash
|
||||
/requirements-pilot "Fix race condition in order processing queue"
|
||||
|
||||
# Generated requirements include:
|
||||
# - Problem description
|
||||
# - Root cause analysis
|
||||
# - Solution approach
|
||||
# - Verification steps
|
||||
|
||||
# Implementation applies fix
|
||||
# Review checks concurrency handling
|
||||
# Testing includes stress tests
|
||||
```
|
||||
|
||||
## 🔄 Iterative Refinement
|
||||
|
||||
Each phase supports feedback:
|
||||
|
||||
```
|
||||
Agent: "Requirements complete (Score: 85/100)"
|
||||
User: "Add error handling for network failures"
|
||||
Agent: "Updated requirements (Score: 93/100) ✅"
|
||||
```
|
||||
|
||||
## 🚀 Advanced Usage
|
||||
|
||||
### Combining with Individual Commands
|
||||
|
||||
```bash
|
||||
# Generate requirements only
|
||||
/requirements-generate "OAuth2 integration requirements"
|
||||
|
||||
# Just code implementation (requires existing requirements)
|
||||
/requirements-code "Implement based on requirements.md"
|
||||
|
||||
# Standalone review
|
||||
/requirements-review "Review current implementation"
|
||||
```
|
||||
|
||||
### Integration with BMAD
|
||||
|
||||
Use Requirements Workflow for sub-tasks within BMAD sprints:
|
||||
|
||||
```bash
|
||||
# BMAD creates sprint plan
|
||||
/bmad-pilot "E-commerce platform"
|
||||
|
||||
# Use Requirements for individual sprint tasks
|
||||
/requirements-pilot "Shopping cart session management"
|
||||
/requirements-pilot "Payment webhook handling"
|
||||
```
|
||||
|
||||
## 📚 Related Documentation
|
||||
|
||||
- **[BMAD Workflow](BMAD-WORKFLOW.md)** - Full agile methodology
|
||||
- **[Development Commands](DEVELOPMENT-COMMANDS.md)** - Direct coding commands
|
||||
- **[Quick Start Guide](QUICK-START.md)** - Get started quickly
|
||||
|
||||
---
|
||||
|
||||
**Requirements-Driven Development** - From requirements to working code in hours, not days.
|
||||
26
requirements-clarity/.claude-plugin/marketplace.json
Normal file
26
requirements-clarity/.claude-plugin/marketplace.json
Normal file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"name": "requirements-clarity",
|
||||
"source": "./",
|
||||
"description": "Transforms vague requirements into actionable PRDs through systematic clarification with 100-point scoring system",
|
||||
"version": "1.0.0",
|
||||
"author": {
|
||||
"name": "Claude Code Dev Workflows",
|
||||
"url": "https://github.com/cexll/myclaude"
|
||||
},
|
||||
"homepage": "https://github.com/cexll/myclaude",
|
||||
"repository": "https://github.com/cexll/myclaude",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
"requirements",
|
||||
"clarification",
|
||||
"prd",
|
||||
"specifications",
|
||||
"quality-gates",
|
||||
"requirements-engineering"
|
||||
],
|
||||
"category": "essentials",
|
||||
"strict": false,
|
||||
"skills": [
|
||||
"./skills/SKILL.md"
|
||||
]
|
||||
}
|
||||
323
requirements-clarity/skills/SKILL.md
Normal file
323
requirements-clarity/skills/SKILL.md
Normal file
@@ -0,0 +1,323 @@
|
||||
---
|
||||
name: Requirements Clarity
|
||||
description: Clarify ambiguous requirements through focused dialogue before implementation. Use when requirements are unclear, features are complex (>2 days), or involve cross-team coordination. Ask two core questions - Why? (YAGNI check) and Simpler? (KISS check) - to ensure clarity before coding.
|
||||
---
|
||||
|
||||
# Requirements Clarity Skill
|
||||
|
||||
## Description
|
||||
|
||||
Automatically transforms vague requirements into actionable PRDs through systematic clarification with a 100-point scoring system.
|
||||
|
||||
## Activation
|
||||
|
||||
Auto-activate when detecting vague requirements:
|
||||
|
||||
1. **Vague Feature Requests**
|
||||
- User says: "add login feature", "implement payment", "create dashboard"
|
||||
- Missing: How, with what technology, what constraints?
|
||||
|
||||
2. **Missing Technical Context**
|
||||
- No technology stack mentioned
|
||||
- No integration points identified
|
||||
- No performance/security constraints
|
||||
|
||||
3. **Incomplete Specifications**
|
||||
- No acceptance criteria
|
||||
- No success metrics
|
||||
- No edge cases considered
|
||||
- No error handling mentioned
|
||||
|
||||
4. **Ambiguous Scope**
|
||||
- Unclear boundaries ("user management" - what exactly?)
|
||||
- No distinction between MVP and future enhancements
|
||||
- Missing "what's NOT included"
|
||||
|
||||
**Do NOT activate when**:
|
||||
- Specific file paths mentioned (e.g., "auth.go:45")
|
||||
- Code snippets included
|
||||
- Existing functions/classes referenced
|
||||
- Bug fixes with clear reproduction steps
|
||||
|
||||
## Core Principles
|
||||
|
||||
1. **Systematic Questioning**
|
||||
- Ask focused, specific questions
|
||||
- One category at a time (2-3 questions per round)
|
||||
- Build on previous answers
|
||||
- Avoid overwhelming users
|
||||
|
||||
2. **Quality-Driven Iteration**
|
||||
- Continuously assess clarity score (0-100)
|
||||
- Identify gaps systematically
|
||||
- Iterate until ≥ 90 points
|
||||
- Document all clarification rounds
|
||||
|
||||
3. **Actionable Output**
|
||||
- Generate concrete specifications
|
||||
- Include measurable acceptance criteria
|
||||
- Provide executable phases
|
||||
- Enable direct implementation
|
||||
|
||||
## Clarification Process
|
||||
|
||||
### Step 1: Initial Requirement Analysis
|
||||
|
||||
**Input**: User's requirement description
|
||||
|
||||
**Tasks**:
|
||||
1. Parse and understand core requirement
|
||||
2. Generate feature name (kebab-case format)
|
||||
3. Determine document version (default `1.0` unless user specifies otherwise)
|
||||
4. Ensure `./docs/prds/` exists for PRD output
|
||||
5. Perform initial clarity assessment (0-100)
|
||||
|
||||
**Assessment Rubric**:
|
||||
```
|
||||
Functional Clarity: /30 points
|
||||
- Clear inputs/outputs: 10 pts
|
||||
- User interaction defined: 10 pts
|
||||
- Success criteria stated: 10 pts
|
||||
|
||||
Technical Specificity: /25 points
|
||||
- Technology stack mentioned: 8 pts
|
||||
- Integration points identified: 8 pts
|
||||
- Constraints specified: 9 pts
|
||||
|
||||
Implementation Completeness: /25 points
|
||||
- Edge cases considered: 8 pts
|
||||
- Error handling mentioned: 9 pts
|
||||
- Data validation specified: 8 pts
|
||||
|
||||
Business Context: /20 points
|
||||
- Problem statement clear: 7 pts
|
||||
- Target users identified: 7 pts
|
||||
- Success metrics defined: 6 pts
|
||||
```
|
||||
|
||||
**Initial Response Format**:
|
||||
```markdown
|
||||
I understand your requirement. Let me help you refine this specification.
|
||||
|
||||
**Current Clarity Score**: X/100
|
||||
|
||||
**Clear Aspects**:
|
||||
- [List what's clear]
|
||||
|
||||
**Needs Clarification**:
|
||||
- [List gaps]
|
||||
|
||||
Let me systematically clarify these points...
|
||||
```
|
||||
|
||||
### Step 2: Gap Analysis
|
||||
|
||||
Identify missing information across four dimensions:
|
||||
|
||||
**1. Functional Scope**
|
||||
- What is the core functionality?
|
||||
- What are the boundaries?
|
||||
- What is out of scope?
|
||||
- What are edge cases?
|
||||
|
||||
**2. User Interaction**
|
||||
- How do users interact?
|
||||
- What are the inputs?
|
||||
- What are the outputs?
|
||||
- What are success/failure scenarios?
|
||||
|
||||
**3. Technical Constraints**
|
||||
- Performance requirements?
|
||||
- Compatibility requirements?
|
||||
- Security considerations?
|
||||
- Scalability needs?
|
||||
|
||||
**4. Business Value**
|
||||
- What problem does this solve?
|
||||
- Who are the target users?
|
||||
- What are success metrics?
|
||||
- What is the priority?
|
||||
|
||||
### Step 3: Interactive Clarification
|
||||
|
||||
**Question Strategy**:
|
||||
1. Start with highest-impact gaps
|
||||
2. Ask 2-3 questions per round
|
||||
3. Build context progressively
|
||||
4. Use user's language
|
||||
5. Provide examples when helpful
|
||||
|
||||
**Question Format**:
|
||||
```markdown
|
||||
I need to clarify the following points to complete the requirements document:
|
||||
|
||||
1. **[Category]**: [Specific question]?
|
||||
- For example: [Example if helpful]
|
||||
|
||||
2. **[Category]**: [Specific question]?
|
||||
|
||||
3. **[Category]**: [Specific question]?
|
||||
|
||||
Please provide your answers, and I'll continue refining the PRD.
|
||||
```
|
||||
|
||||
**After Each User Response**:
|
||||
1. Update clarity score
|
||||
2. Capture new information in the working PRD outline
|
||||
3. Identify remaining gaps
|
||||
4. If score < 90: Continue with next round of questions
|
||||
5. If score ≥ 90: Proceed to PRD generation
|
||||
|
||||
**Score Update Format**:
|
||||
```markdown
|
||||
Thank you for the additional information!
|
||||
|
||||
**Clarity Score Update**: X/100 → Y/100
|
||||
|
||||
**New Clarified Content**:
|
||||
- [Summarize new information]
|
||||
|
||||
**Remaining Points to Clarify**:
|
||||
- [List remaining gaps if score < 90]
|
||||
|
||||
[If score < 90: Continue with next round of questions]
|
||||
[If score ≥ 90: "Perfect! I will now generate the complete PRD document..."]
|
||||
```
|
||||
|
||||
### Step 4: PRD Generation
|
||||
|
||||
Once clarity score ≥ 90, generate comprehensive PRD.
|
||||
|
||||
**Output File**:
|
||||
|
||||
1. **Final PRD**: `./docs/prds/{feature_name}-v{version}-prd.md`
|
||||
|
||||
Use the `Write` tool to create or update this file. Derive `{version}` from the document version recorded in the PRD (default `1.0`).
|
||||
|
||||
## PRD Document Structure
|
||||
|
||||
```markdown
|
||||
# {Feature Name} - Product Requirements Document (PRD)
|
||||
|
||||
## Requirements Description
|
||||
|
||||
### Background
|
||||
- **Business Problem**: [Describe the business problem to solve]
|
||||
- **Target Users**: [Target user groups]
|
||||
- **Value Proposition**: [Value this feature brings]
|
||||
|
||||
### Feature Overview
|
||||
- **Core Features**: [List of main features]
|
||||
- **Feature Boundaries**: [What is and isn't included]
|
||||
- **User Scenarios**: [Typical usage scenarios]
|
||||
|
||||
### Detailed Requirements
|
||||
- **Input/Output**: [Specific input/output specifications]
|
||||
- **User Interaction**: [User operation flow]
|
||||
- **Data Requirements**: [Data structures and validation rules]
|
||||
- **Edge Cases**: [Edge case handling]
|
||||
|
||||
## Design Decisions
|
||||
|
||||
### Technical Approach
|
||||
- **Architecture Choice**: [Technical architecture decisions and rationale]
|
||||
- **Key Components**: [List of main technical components]
|
||||
- **Data Storage**: [Data models and storage solutions]
|
||||
- **Interface Design**: [API/interface specifications]
|
||||
|
||||
### Constraints
|
||||
- **Performance Requirements**: [Response time, throughput, etc.]
|
||||
- **Compatibility**: [System compatibility requirements]
|
||||
- **Security**: [Security considerations]
|
||||
- **Scalability**: [Future expansion considerations]
|
||||
|
||||
### Risk Assessment
|
||||
- **Technical Risks**: [Potential technical risks and mitigation plans]
|
||||
- **Dependency Risks**: [External dependencies and alternatives]
|
||||
- **Schedule Risks**: [Timeline risks and response strategies]
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
### Functional Acceptance
|
||||
- [ ] Feature 1: [Specific acceptance conditions]
|
||||
- [ ] Feature 2: [Specific acceptance conditions]
|
||||
- [ ] Feature 3: [Specific acceptance conditions]
|
||||
|
||||
### Quality Standards
|
||||
- [ ] Code Quality: [Code standards and review requirements]
|
||||
- [ ] Test Coverage: [Testing requirements and coverage]
|
||||
- [ ] Performance Metrics: [Performance test pass criteria]
|
||||
- [ ] Security Review: [Security review requirements]
|
||||
|
||||
### User Acceptance
|
||||
- [ ] User Experience: [UX acceptance criteria]
|
||||
- [ ] Documentation: [Documentation delivery requirements]
|
||||
- [ ] Training Materials: [If needed, training material requirements]
|
||||
|
||||
## Execution Phases
|
||||
|
||||
### Phase 1: Preparation
|
||||
**Goal**: Environment preparation and technical validation
|
||||
- [ ] Task 1: [Specific task description]
|
||||
- [ ] Task 2: [Specific task description]
|
||||
- **Deliverables**: [Phase deliverables]
|
||||
- **Time**: [Estimated time]
|
||||
|
||||
### Phase 2: Core Development
|
||||
**Goal**: Implement core functionality
|
||||
- [ ] Task 1: [Specific task description]
|
||||
- [ ] Task 2: [Specific task description]
|
||||
- **Deliverables**: [Phase deliverables]
|
||||
- **Time**: [Estimated time]
|
||||
|
||||
### Phase 3: Integration & Testing
|
||||
**Goal**: Integration and quality assurance
|
||||
- [ ] Task 1: [Specific task description]
|
||||
- [ ] Task 2: [Specific task description]
|
||||
- **Deliverables**: [Phase deliverables]
|
||||
- **Time**: [Estimated time]
|
||||
|
||||
### Phase 4: Deployment
|
||||
**Goal**: Release and monitoring
|
||||
- [ ] Task 1: [Specific task description]
|
||||
- [ ] Task 2: [Specific task description]
|
||||
- **Deliverables**: [Phase deliverables]
|
||||
- **Time**: [Estimated time]
|
||||
|
||||
---
|
||||
|
||||
**Document Version**: 1.0
|
||||
**Created**: {timestamp}
|
||||
**Clarification Rounds**: {clarification_rounds}
|
||||
**Quality Score**: {quality_score}/100
|
||||
```
|
||||
|
||||
## Behavioral Guidelines
|
||||
|
||||
### DO
|
||||
- Ask specific, targeted questions
|
||||
- Build on previous answers
|
||||
- Provide examples to guide users
|
||||
- Maintain conversational tone
|
||||
- Summarize clarification rounds within the PRD
|
||||
- Use clear, professional English
|
||||
- Generate concrete specifications
|
||||
- Stay in clarification mode until score ≥ 90
|
||||
|
||||
### DON'T
|
||||
- Ask all questions at once
|
||||
- Make assumptions without confirmation
|
||||
- Generate PRD before 90+ score
|
||||
- Skip any required sections
|
||||
- Use vague or abstract language
|
||||
- Proceed without user responses
|
||||
- Exit skill mode prematurely
|
||||
|
||||
## Success Criteria
|
||||
|
||||
- Clarity score ≥ 90/100
|
||||
- All PRD sections complete with substance
|
||||
- Acceptance criteria checklistable (using `- [ ]` format)
|
||||
- Execution phases actionable with concrete tasks
|
||||
- User approves final PRD
|
||||
- Ready for development handoff
|
||||
33
requirements-driven-workflow/.claude-plugin/marketplace.json
Normal file
33
requirements-driven-workflow/.claude-plugin/marketplace.json
Normal file
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"name": "requirements-driven-development",
|
||||
"source": "./",
|
||||
"description": "Streamlined requirements-driven development workflow with 90% quality gates for practical feature implementation",
|
||||
"version": "1.0.0",
|
||||
"author": {
|
||||
"name": "Claude Code Dev Workflows",
|
||||
"url": "https://github.com/cexll/myclaude"
|
||||
},
|
||||
"homepage": "https://github.com/cexll/myclaude",
|
||||
"repository": "https://github.com/cexll/myclaude",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
"requirements",
|
||||
"workflow",
|
||||
"automation",
|
||||
"quality-gates",
|
||||
"feature-development",
|
||||
"agile",
|
||||
"specifications"
|
||||
],
|
||||
"category": "workflows",
|
||||
"strict": false,
|
||||
"commands": [
|
||||
"./commands/requirements-pilot.md"
|
||||
],
|
||||
"agents": [
|
||||
"./agents/requirements-generate.md",
|
||||
"./agents/requirements-code.md",
|
||||
"./agents/requirements-testing.md",
|
||||
"./agents/requirements-review.md"
|
||||
]
|
||||
}
|
||||
159
skills/codex/SKILL.md
Normal file
159
skills/codex/SKILL.md
Normal file
@@ -0,0 +1,159 @@
|
||||
---
|
||||
name: codex
|
||||
description: Execute Codex CLI for code analysis, refactoring, and automated code changes. Use when you need to delegate complex code tasks to Codex AI with file references (@syntax) and structured output.
|
||||
---
|
||||
|
||||
# Codex CLI Integration
|
||||
|
||||
## Overview
|
||||
|
||||
Execute Codex CLI commands and parse structured JSON responses. Supports file references via `@` syntax, multiple models, and sandbox controls.
|
||||
|
||||
## When to Use
|
||||
|
||||
- Complex code analysis requiring deep understanding
|
||||
- Large-scale refactoring across multiple files
|
||||
- Automated code generation with safety controls
|
||||
- Tasks requiring specialized reasoning models (gpt-5.1, gpt-5.1-codex)
|
||||
|
||||
## Usage
|
||||
|
||||
**Mandatory**: Run every automated invocation through the Bash tool in the foreground with the command below, keeping the `timeout` parameter fixed at `7200000` milliseconds (do not change it or use any other entry point).
|
||||
```bash
|
||||
uv run ~/.claude/skills/codex/scripts/codex.py "<task>" [model] [working_dir]
|
||||
```
|
||||
|
||||
**Optional methods** (direct execution or via Python):
|
||||
```bash
|
||||
~/.claude/skills/codex/scripts/codex.py "<task>" [model] [working_dir]
|
||||
# or
|
||||
python3 ~/.claude/skills/codex/scripts/codex.py "<task>" [model] [working_dir]
|
||||
```
|
||||
|
||||
Resume a session:
|
||||
```bash
|
||||
uv run ~/.claude/skills/codex/scripts/codex.py resume <session_id> "<task>" [model] [working_dir]
|
||||
```
|
||||
|
||||
## Environment Variables
|
||||
|
||||
- **CODEX_MODEL**: Override default model (default: `gpt-5.1-codex`)
|
||||
- Example: `export CODEX_MODEL=gpt-5-codex`
|
||||
- **CODEX_TIMEOUT**: Override timeout in milliseconds (default: 7200000 = 2 hours)
|
||||
- Example: `export CODEX_TIMEOUT=3600000` for 1 hour
|
||||
|
||||
## Timeout Control
|
||||
|
||||
- **Built-in**: Script enforces 2-hour timeout by default
|
||||
- **Override**: Set `CODEX_TIMEOUT` environment variable (in milliseconds, e.g., `CODEX_TIMEOUT=3600000` for 1 hour)
|
||||
- **Behavior**: On timeout, sends SIGTERM, then SIGKILL after 5s if process doesn't exit
|
||||
- **Exit code**: Returns 124 on timeout (consistent with GNU timeout)
|
||||
- **Bash tool**: Always set `timeout: 7200000` parameter for double protection
|
||||
|
||||
### Parameters
|
||||
|
||||
- `task` (required): Task description, supports `@file` references
|
||||
- `model` (optional): Model to use (default: gpt-5.1-codex)
|
||||
- `gpt-5.1-codex`: Default, optimized for code
|
||||
- `gpt-5.1`: Fast general purpose
|
||||
- `working_dir` (optional): Working directory (default: current)
|
||||
|
||||
### Return Format
|
||||
|
||||
Extracts `agent_message` from Codex JSON stream and appends session ID:
|
||||
```
|
||||
Agent response text here...
|
||||
|
||||
---
|
||||
SESSION_ID: 019a7247-ac9d-71f3-89e2-a823dbd8fd14
|
||||
```
|
||||
|
||||
Error format (stderr):
|
||||
```
|
||||
ERROR: Error message
|
||||
```
|
||||
|
||||
### Invocation Pattern
|
||||
|
||||
All automated executions may only invoke `uv run ~/.claude/skills/codex/scripts/codex.py "<task>" ...` through the Bash tool in the foreground, and the `timeout` must remain fixed at `7200000` (non-negotiable):
|
||||
```
|
||||
Bash tool parameters:
|
||||
- command: uv run ~/.claude/skills/codex/scripts/codex.py "<task>" [model] [working_dir]
|
||||
- timeout: 7200000
|
||||
- description: <brief description of the task>
|
||||
```
|
||||
Run every call in the foreground—never append `&` to background it—so logs and errors stay visible for timely interruption or diagnosis.
|
||||
|
||||
Alternatives:
|
||||
```
|
||||
# Direct execution (simplest)
|
||||
- command: ~/.claude/skills/codex/scripts/codex.py "<task>" [model] [working_dir]
|
||||
|
||||
# Using python3
|
||||
- command: python3 ~/.claude/skills/codex/scripts/codex.py "<task>" [model] [working_dir]
|
||||
```
|
||||
|
||||
### Examples
|
||||
|
||||
**Basic code analysis:**
|
||||
```bash
|
||||
# Recommended: via uv run (auto-manages Python environment)
|
||||
uv run ~/.claude/skills/codex/scripts/codex.py "explain @src/main.ts"
|
||||
# timeout: 7200000
|
||||
|
||||
# Alternative: direct execution
|
||||
~/.claude/skills/codex/scripts/codex.py "explain @src/main.ts"
|
||||
```
|
||||
|
||||
**Refactoring with specific model:**
|
||||
```bash
|
||||
uv run ~/.claude/skills/codex/scripts/codex.py "refactor @src/utils for performance" "gpt-5.1-codex"
|
||||
# timeout: 7200000
|
||||
```
|
||||
|
||||
**Multi-file analysis:**
|
||||
```bash
|
||||
uv run ~/.claude/skills/codex/scripts/codex.py "analyze @. and find security issues" "gpt-5.1-codex" "/path/to/project"
|
||||
# timeout: 7200000
|
||||
```
|
||||
|
||||
**Resume previous session:**
|
||||
```bash
|
||||
# First session
|
||||
uv run ~/.claude/skills/codex/scripts/codex.py "add comments to @utils.js" "gpt-5.1-codex"
|
||||
# Output includes: SESSION_ID: 019a7247-ac9d-71f3-89e2-a823dbd8fd14
|
||||
|
||||
# Continue the conversation
|
||||
uv run ~/.claude/skills/codex/scripts/codex.py resume 019a7247-ac9d-71f3-89e2-a823dbd8fd14 "now add type hints"
|
||||
# timeout: 7200000
|
||||
```
|
||||
|
||||
**Using python3 directly (alternative):**
|
||||
```bash
|
||||
python3 ~/.claude/skills/codex/scripts/codex.py "your task here"
|
||||
```
|
||||
|
||||
### Large Task Protocol
|
||||
|
||||
- For every large task, first produce a canonical task list that enumerates the Task ID, description, file/directory scope, dependencies, test commands, and the expected Codex Bash invocation.
|
||||
- Tasks without dependencies should be executed concurrently via multiple foreground Bash calls (you can keep separate terminal windows) and each run must log start/end times plus any shared resource usage.
|
||||
- Reuse context aggressively (such as @spec.md or prior analysis output), and after concurrent execution finishes, reconcile against the task list to report which items completed and which slipped.
|
||||
|
||||
| ID | Description | Scope | Dependencies | Tests | Command |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| T1 | Review @spec.md to extract requirements | docs/, @spec.md | None | None | uv run ~/.claude/skills/codex/scripts/codex.py "analyze requirements @spec.md" |
|
||||
| T2 | Implement the module and add test cases | src/module | T1 | npm test -- --runInBand | uv run ~/.claude/skills/codex/scripts/codex.py "implement and test @src/module" |
|
||||
|
||||
## Notes
|
||||
|
||||
- **Recommended**: Use `uv run` for automatic Python environment management (requires uv installed)
|
||||
- **Alternative**: Direct execution `./codex.py` (uses system Python via shebang)
|
||||
- Python implementation using standard library (zero dependencies)
|
||||
- All automated runs must use the Bash tool with the fixed timeout to provide dual timeout protection and unified logging/exit semantics; any alternative approach is limited to manual foreground execution.
|
||||
- Cross-platform compatible (Windows/macOS/Linux)
|
||||
- PEP 723 compliant (inline script metadata)
|
||||
- Runs with `--dangerously-bypass-approvals-and-sandbox` for automation (new sessions only)
|
||||
- Uses `--skip-git-repo-check` to work in any directory
|
||||
- Streams progress, returns only final agent message
|
||||
- Every execution returns a session ID for resuming conversations
|
||||
- Requires Codex CLI installed and authenticated
|
||||
296
skills/codex/scripts/codex.py
Executable file
296
skills/codex/scripts/codex.py
Executable file
@@ -0,0 +1,296 @@
|
||||
#!/usr/bin/env python3
|
||||
# /// script
|
||||
# requires-python = ">=3.8"
|
||||
# dependencies = []
|
||||
# ///
|
||||
"""
|
||||
Codex CLI wrapper with cross-platform support and session management.
|
||||
**FIXED**: Auto-detect long inputs and use stdin mode to avoid shell argument issues.
|
||||
|
||||
Usage:
|
||||
New session: uv run codex.py "task" [model] [workdir]
|
||||
Resume: uv run codex.py resume <session_id> "task" [model] [workdir]
|
||||
Alternative: python3 codex.py "task"
|
||||
Direct exec: ./codex.py "task"
|
||||
"""
|
||||
import subprocess
|
||||
import json
|
||||
import sys
|
||||
import os
|
||||
from typing import Optional
|
||||
|
||||
DEFAULT_MODEL = os.environ.get('CODEX_MODEL', 'gpt-5.1-codex')
|
||||
DEFAULT_WORKDIR = '.'
|
||||
DEFAULT_TIMEOUT = 7200 # 2 hours in seconds
|
||||
FORCE_KILL_DELAY = 5
|
||||
|
||||
|
||||
def log_error(message: str):
|
||||
"""输出错误信息到 stderr"""
|
||||
sys.stderr.write(f"ERROR: {message}\n")
|
||||
|
||||
|
||||
def log_warn(message: str):
|
||||
"""输出警告信息到 stderr"""
|
||||
sys.stderr.write(f"WARN: {message}\n")
|
||||
|
||||
|
||||
def log_info(message: str):
|
||||
"""输出信息到 stderr"""
|
||||
sys.stderr.write(f"INFO: {message}\n")
|
||||
|
||||
|
||||
def resolve_timeout() -> int:
|
||||
"""解析超时配置(秒)"""
|
||||
raw = os.environ.get('CODEX_TIMEOUT', '')
|
||||
if not raw:
|
||||
return DEFAULT_TIMEOUT
|
||||
|
||||
try:
|
||||
parsed = int(raw)
|
||||
if parsed <= 0:
|
||||
log_warn(f"Invalid CODEX_TIMEOUT '{raw}', falling back to {DEFAULT_TIMEOUT}s")
|
||||
return DEFAULT_TIMEOUT
|
||||
# 环境变量是毫秒,转换为秒
|
||||
return parsed // 1000 if parsed > 10000 else parsed
|
||||
except ValueError:
|
||||
log_warn(f"Invalid CODEX_TIMEOUT '{raw}', falling back to {DEFAULT_TIMEOUT}s")
|
||||
return DEFAULT_TIMEOUT
|
||||
|
||||
|
||||
def normalize_text(text) -> Optional[str]:
|
||||
"""规范化文本:字符串或字符串数组"""
|
||||
if isinstance(text, str):
|
||||
return text
|
||||
if isinstance(text, list):
|
||||
return ''.join(text)
|
||||
return None
|
||||
|
||||
|
||||
def parse_args():
|
||||
"""解析命令行参数"""
|
||||
if len(sys.argv) < 2:
|
||||
log_error('Task required')
|
||||
sys.exit(1)
|
||||
|
||||
# 检测是否为 resume 模式
|
||||
if sys.argv[1] == 'resume':
|
||||
if len(sys.argv) < 4:
|
||||
log_error('Resume mode requires: resume <session_id> <task>')
|
||||
sys.exit(1)
|
||||
return {
|
||||
'mode': 'resume',
|
||||
'session_id': sys.argv[2],
|
||||
'task': sys.argv[3],
|
||||
'model': sys.argv[4] if len(sys.argv) > 4 else DEFAULT_MODEL,
|
||||
'workdir': sys.argv[5] if len(sys.argv) > 5 else DEFAULT_WORKDIR
|
||||
}
|
||||
else:
|
||||
return {
|
||||
'mode': 'new',
|
||||
'task': sys.argv[1],
|
||||
'model': sys.argv[2] if len(sys.argv) > 2 else DEFAULT_MODEL,
|
||||
'workdir': sys.argv[3] if len(sys.argv) > 3 else DEFAULT_WORKDIR
|
||||
}
|
||||
|
||||
|
||||
def read_piped_task() -> Optional[str]:
|
||||
"""
|
||||
从 stdin 读取任务文本:
|
||||
- 如果 stdin 是管道(非 tty)且存在内容,返回读取到的字符串
|
||||
- 否则返回 None
|
||||
"""
|
||||
stdin = sys.stdin
|
||||
if stdin is None or stdin.isatty():
|
||||
return None
|
||||
data = stdin.read()
|
||||
return data if data else None
|
||||
|
||||
|
||||
def should_stream_via_stdin(task_text: str, piped: bool) -> bool:
|
||||
"""
|
||||
判定是否通过 stdin 传递任务:
|
||||
- 有管道输入
|
||||
- 文本包含换行
|
||||
- 文本包含反斜杠
|
||||
- 文本长度 > 800
|
||||
"""
|
||||
if piped:
|
||||
return True
|
||||
if '\n' in task_text:
|
||||
return True
|
||||
if '\\' in task_text:
|
||||
return True
|
||||
if len(task_text) > 800:
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
def build_codex_args(params: dict, target_arg: str) -> list:
|
||||
"""
|
||||
构建 codex CLI 参数
|
||||
|
||||
Args:
|
||||
params: 参数字典
|
||||
target_arg: 最终传递给 codex 的参数('-' 或具体 task 文本)
|
||||
"""
|
||||
if params['mode'] == 'resume':
|
||||
return [
|
||||
'codex', 'e',
|
||||
'--skip-git-repo-check',
|
||||
'--json',
|
||||
'resume',
|
||||
params['session_id'],
|
||||
target_arg
|
||||
]
|
||||
else:
|
||||
base_args = [
|
||||
'codex', 'e',
|
||||
'-m', params['model'],
|
||||
'--dangerously-bypass-approvals-and-sandbox',
|
||||
'--skip-git-repo-check',
|
||||
'-C', params['workdir'],
|
||||
'--json',
|
||||
target_arg
|
||||
]
|
||||
|
||||
return base_args
|
||||
|
||||
|
||||
def run_codex_process(codex_args, task_text: str, use_stdin: bool, timeout_sec: int):
|
||||
"""
|
||||
启动 codex 子进程,处理 stdin / JSON 行输出和错误,成功时返回 (last_agent_message, thread_id)。
|
||||
失败路径上负责日志和退出码。
|
||||
"""
|
||||
thread_id: Optional[str] = None
|
||||
last_agent_message: Optional[str] = None
|
||||
process: Optional[subprocess.Popen] = None
|
||||
|
||||
try:
|
||||
# 启动 codex 子进程(文本模式管道)
|
||||
process = subprocess.Popen(
|
||||
codex_args,
|
||||
stdin=subprocess.PIPE if use_stdin else None,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=sys.stderr,
|
||||
text=True,
|
||||
bufsize=1,
|
||||
)
|
||||
|
||||
# 如果使用 stdin 模式,写入任务到 stdin 并关闭
|
||||
if use_stdin and process.stdin is not None:
|
||||
process.stdin.write(task_text)
|
||||
process.stdin.close()
|
||||
|
||||
# 逐行解析 JSON 输出
|
||||
if process.stdout is None:
|
||||
log_error('Codex stdout pipe not available')
|
||||
sys.exit(1)
|
||||
|
||||
for line in process.stdout:
|
||||
line = line.strip()
|
||||
if not line:
|
||||
continue
|
||||
|
||||
try:
|
||||
event = json.loads(line)
|
||||
|
||||
# 捕获 thread_id
|
||||
if event.get('type') == 'thread.started':
|
||||
thread_id = event.get('thread_id')
|
||||
|
||||
# 捕获 agent_message
|
||||
if (event.get('type') == 'item.completed' and
|
||||
event.get('item', {}).get('type') == 'agent_message'):
|
||||
text = normalize_text(event['item'].get('text'))
|
||||
if text:
|
||||
last_agent_message = text
|
||||
|
||||
except json.JSONDecodeError:
|
||||
log_warn(f"Failed to parse line: {line}")
|
||||
|
||||
# 等待进程结束并检查退出码
|
||||
returncode = process.wait(timeout=timeout_sec)
|
||||
if returncode != 0:
|
||||
log_error(f'Codex exited with status {returncode}')
|
||||
sys.exit(returncode)
|
||||
|
||||
if not last_agent_message:
|
||||
log_error('Codex completed without agent_message output')
|
||||
sys.exit(1)
|
||||
|
||||
return last_agent_message, thread_id
|
||||
|
||||
except subprocess.TimeoutExpired:
|
||||
log_error('Codex execution timeout')
|
||||
if process is not None:
|
||||
process.kill()
|
||||
try:
|
||||
process.wait(timeout=FORCE_KILL_DELAY)
|
||||
except subprocess.TimeoutExpired:
|
||||
pass
|
||||
sys.exit(124)
|
||||
|
||||
except FileNotFoundError:
|
||||
log_error("codex command not found in PATH")
|
||||
sys.exit(127)
|
||||
|
||||
except KeyboardInterrupt:
|
||||
log_error("Codex interrupted by user")
|
||||
if process is not None:
|
||||
process.terminate()
|
||||
try:
|
||||
process.wait(timeout=FORCE_KILL_DELAY)
|
||||
except subprocess.TimeoutExpired:
|
||||
process.kill()
|
||||
sys.exit(130)
|
||||
|
||||
|
||||
def main():
|
||||
params = parse_args()
|
||||
timeout_sec = resolve_timeout()
|
||||
|
||||
piped_task = read_piped_task()
|
||||
piped = piped_task is not None
|
||||
task_text = piped_task if piped else params['task']
|
||||
|
||||
use_stdin = should_stream_via_stdin(task_text, piped)
|
||||
|
||||
if use_stdin:
|
||||
reasons = []
|
||||
if piped:
|
||||
reasons.append('piped input')
|
||||
if '\n' in task_text:
|
||||
reasons.append('newline')
|
||||
if '\\' in task_text:
|
||||
reasons.append('backslash')
|
||||
if len(task_text) > 800:
|
||||
reasons.append('length>800')
|
||||
|
||||
if reasons:
|
||||
log_warn(f"Using stdin mode for task due to: {', '.join(reasons)}")
|
||||
|
||||
target_arg = '-' if use_stdin else params['task']
|
||||
codex_args = build_codex_args(params, target_arg)
|
||||
|
||||
log_info('codex running...')
|
||||
|
||||
last_agent_message, thread_id = run_codex_process(
|
||||
codex_args=codex_args,
|
||||
task_text=task_text,
|
||||
use_stdin=use_stdin,
|
||||
timeout_sec=timeout_sec,
|
||||
)
|
||||
|
||||
# 输出 agent_message
|
||||
sys.stdout.write(f"{last_agent_message}\n")
|
||||
|
||||
# 输出 session_id(如果存在)
|
||||
if thread_id:
|
||||
sys.stdout.write(f"\n---\nSESSION_ID: {thread_id}\n")
|
||||
|
||||
sys.exit(0)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
137
skills/gemini/SKILL.md
Normal file
137
skills/gemini/SKILL.md
Normal file
@@ -0,0 +1,137 @@
|
||||
---
|
||||
name: gemini
|
||||
description: Execute Gemini CLI for AI-powered code analysis and generation. Use when you need to leverage Google's Gemini models for complex reasoning tasks.
|
||||
---
|
||||
|
||||
# Gemini CLI Integration
|
||||
|
||||
## Overview
|
||||
|
||||
Execute Gemini CLI commands with support for multiple models and flexible prompt input. Integrates Google's Gemini AI models into Claude Code workflows.
|
||||
|
||||
## When to Use
|
||||
|
||||
- Complex reasoning tasks requiring advanced AI capabilities
|
||||
- Code generation and analysis with Gemini models
|
||||
- Tasks requiring Google's latest AI technology
|
||||
- Alternative perspective on code problems
|
||||
|
||||
## Usage
|
||||
|
||||
**推荐方式**(使用 uv run,自动管理 Python 环境):
|
||||
```bash
|
||||
uv run ~/.claude/skills/gemini/scripts/gemini.py -m <model> -p "<prompt>" [working_dir]
|
||||
```
|
||||
|
||||
**备选方式**(直接执行或使用 Python):
|
||||
```bash
|
||||
~/.claude/skills/gemini/scripts/gemini.py -m <model> -p "<prompt>" [working_dir]
|
||||
# 或
|
||||
python3 ~/.claude/skills/gemini/scripts/gemini.py -m <model> -p "<prompt>" [working_dir]
|
||||
```
|
||||
|
||||
## Environment Variables
|
||||
|
||||
- **GEMINI_MODEL**: Override default model (default: `gemini-3-pro-preview`)
|
||||
- Example: `export GEMINI_MODEL=gemini-3`
|
||||
- **GEMINI_TIMEOUT**: Override timeout in milliseconds (default: 7200000 = 2 hours)
|
||||
- Example: `export GEMINI_TIMEOUT=3600000` for 1 hour
|
||||
|
||||
## Timeout Control
|
||||
|
||||
- **Built-in**: Script enforces 2-hour timeout by default
|
||||
- **Override**: Set `GEMINI_TIMEOUT` environment variable (in milliseconds)
|
||||
- **Bash tool**: Always set `timeout: 7200000` parameter for double protection
|
||||
|
||||
### Parameters
|
||||
|
||||
- `-m, --model` (optional): Model to use (default: gemini-3-pro-preview)
|
||||
- `gemini-3-pro-preview`: Latest flagship model
|
||||
- `-p, --prompt` (required): Task prompt or question
|
||||
- `working_dir` (optional): Working directory (default: current)
|
||||
|
||||
### Return Format
|
||||
|
||||
Plain text output from Gemini:
|
||||
|
||||
```text
|
||||
Model response text here...
|
||||
```
|
||||
|
||||
Error format (stderr):
|
||||
|
||||
```text
|
||||
ERROR: Error message
|
||||
```
|
||||
|
||||
### Invocation Pattern
|
||||
|
||||
When calling via Bash tool, always include the timeout parameter:
|
||||
|
||||
```yaml
|
||||
Bash tool parameters:
|
||||
- command: uv run ~/.claude/skills/gemini/scripts/gemini.py -m gemini-3-pro-preview -p "<prompt>"
|
||||
- timeout: 7200000
|
||||
- description: <brief description of the task>
|
||||
```
|
||||
|
||||
Alternatives:
|
||||
|
||||
```yaml
|
||||
# Direct execution (simplest)
|
||||
- command: ~/.claude/skills/gemini/scripts/gemini.py -m gemini-3-pro-preview -p "<prompt>"
|
||||
|
||||
# Using python3
|
||||
- command: python3 ~/.claude/skills/gemini/scripts/gemini.py -m gemini-3-pro-preview -p "<prompt>"
|
||||
```
|
||||
|
||||
### Examples
|
||||
|
||||
**Basic query:**
|
||||
|
||||
```bash
|
||||
# Recommended: via uv run
|
||||
uv run ~/.claude/skills/gemini/scripts/gemini.py -m gemini-3-pro-preview -p "explain quantum computing"
|
||||
# timeout: 7200000
|
||||
|
||||
# Alternative: direct execution
|
||||
~/.claude/skills/gemini/scripts/gemini.py -m gemini-3-pro-preview -p "explain quantum computing"
|
||||
```
|
||||
|
||||
**Code analysis:**
|
||||
|
||||
```bash
|
||||
uv run ~/.claude/skills/gemini/scripts/gemini.py -m gemini-3-pro-preview -p "review this code for security issues: $(cat app.py)"
|
||||
# timeout: 7200000
|
||||
```
|
||||
|
||||
**With specific working directory:**
|
||||
|
||||
```bash
|
||||
uv run ~/.claude/skills/gemini/scripts/gemini.py -m gemini-3-pro-preview -p "analyze project structure" "/path/to/project"
|
||||
# timeout: 7200000
|
||||
```
|
||||
|
||||
**Using fast model:**
|
||||
|
||||
```bash
|
||||
uv run ~/.claude/skills/gemini/scripts/gemini.py -m gemini-3-pro-preview -p "quick code suggestion"
|
||||
# timeout: 7200000
|
||||
```
|
||||
|
||||
**Using python3 directly (alternative):**
|
||||
|
||||
```bash
|
||||
python3 ~/.claude/skills/gemini/scripts/gemini.py -m gemini-3-pro-preview -p "your prompt here"
|
||||
```
|
||||
|
||||
## Notes
|
||||
|
||||
- **Recommended**: Use `uv run` for automatic Python environment management (requires uv installed)
|
||||
- **Alternative**: Direct execution `./gemini.py` (uses system Python via shebang)
|
||||
- Python implementation using standard library (zero dependencies)
|
||||
- Cross-platform compatible (Windows/macOS/Linux)
|
||||
- PEP 723 compliant (inline script metadata)
|
||||
- Requires Gemini CLI installed and authenticated
|
||||
- Supports all Gemini model variants
|
||||
- Output is streamed directly from Gemini CLI
|
||||
160
skills/gemini/scripts/gemini.py
Executable file
160
skills/gemini/scripts/gemini.py
Executable file
@@ -0,0 +1,160 @@
|
||||
#!/usr/bin/env python3
|
||||
# /// script
|
||||
# requires-python = ">=3.8"
|
||||
# dependencies = []
|
||||
# ///
|
||||
"""
|
||||
Gemini CLI wrapper with cross-platform support.
|
||||
|
||||
Usage:
|
||||
uv run gemini.py -m <model> -p "<prompt>" [workdir]
|
||||
python3 gemini.py -m <model> -p "<prompt>"
|
||||
./gemini.py -m gemini-3-pro-preview -p "your prompt"
|
||||
"""
|
||||
import subprocess
|
||||
import sys
|
||||
import os
|
||||
import argparse
|
||||
|
||||
DEFAULT_MODEL = os.environ.get('GEMINI_MODEL', 'gemini-3-pro-preview')
|
||||
DEFAULT_WORKDIR = '.'
|
||||
DEFAULT_TIMEOUT = 7200 # 2 hours in seconds
|
||||
FORCE_KILL_DELAY = 5
|
||||
|
||||
|
||||
def log_error(message: str):
|
||||
"""输出错误信息到 stderr"""
|
||||
sys.stderr.write(f"ERROR: {message}\n")
|
||||
|
||||
|
||||
def log_warn(message: str):
|
||||
"""输出警告信息到 stderr"""
|
||||
sys.stderr.write(f"WARN: {message}\n")
|
||||
|
||||
|
||||
def resolve_timeout() -> int:
|
||||
"""解析超时配置(秒)"""
|
||||
raw = os.environ.get('GEMINI_TIMEOUT', '')
|
||||
if not raw:
|
||||
return DEFAULT_TIMEOUT
|
||||
|
||||
try:
|
||||
parsed = int(raw)
|
||||
if parsed <= 0:
|
||||
log_warn(f"Invalid GEMINI_TIMEOUT '{raw}', falling back to {DEFAULT_TIMEOUT}s")
|
||||
return DEFAULT_TIMEOUT
|
||||
# 环境变量是毫秒,转换为秒
|
||||
return parsed // 1000 if parsed > 10000 else parsed
|
||||
except ValueError:
|
||||
log_warn(f"Invalid GEMINI_TIMEOUT '{raw}', falling back to {DEFAULT_TIMEOUT}s")
|
||||
return DEFAULT_TIMEOUT
|
||||
|
||||
|
||||
def parse_args():
|
||||
"""解析命令行参数"""
|
||||
parser = argparse.ArgumentParser(
|
||||
description='Gemini CLI wrapper for Claude Code integration',
|
||||
formatter_class=argparse.RawDescriptionHelpFormatter
|
||||
)
|
||||
parser.add_argument(
|
||||
'-m', '--model',
|
||||
default=DEFAULT_MODEL,
|
||||
help=f'Gemini model to use (default: {DEFAULT_MODEL})'
|
||||
)
|
||||
parser.add_argument(
|
||||
'-p', '--prompt',
|
||||
required=True,
|
||||
help='Prompt to send to Gemini'
|
||||
)
|
||||
parser.add_argument(
|
||||
'workdir',
|
||||
nargs='?',
|
||||
default=DEFAULT_WORKDIR,
|
||||
help='Working directory (default: current directory)'
|
||||
)
|
||||
|
||||
return parser.parse_args()
|
||||
|
||||
|
||||
def build_gemini_args(args) -> list:
|
||||
"""构建 gemini CLI 参数"""
|
||||
return [
|
||||
'gemini',
|
||||
'-m', args.model,
|
||||
'-p', args.prompt
|
||||
]
|
||||
|
||||
|
||||
def main():
|
||||
args = parse_args()
|
||||
gemini_args = build_gemini_args(args)
|
||||
timeout_sec = resolve_timeout()
|
||||
|
||||
# 如果指定了工作目录,切换到该目录
|
||||
if args.workdir != DEFAULT_WORKDIR:
|
||||
try:
|
||||
os.chdir(args.workdir)
|
||||
except FileNotFoundError:
|
||||
log_error(f"Working directory not found: {args.workdir}")
|
||||
sys.exit(1)
|
||||
except PermissionError:
|
||||
log_error(f"Permission denied: {args.workdir}")
|
||||
sys.exit(1)
|
||||
|
||||
try:
|
||||
# 启动 gemini 子进程,直接透传 stdout 和 stderr
|
||||
process = subprocess.Popen(
|
||||
gemini_args,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
text=True,
|
||||
bufsize=1 # 行缓冲
|
||||
)
|
||||
|
||||
# 实时输出 stdout
|
||||
stdout_lines = []
|
||||
for line in process.stdout:
|
||||
sys.stdout.write(line)
|
||||
sys.stdout.flush()
|
||||
stdout_lines.append(line)
|
||||
|
||||
# 等待进程结束
|
||||
returncode = process.wait(timeout=timeout_sec)
|
||||
|
||||
# 读取 stderr
|
||||
stderr_output = process.stderr.read()
|
||||
if stderr_output:
|
||||
sys.stderr.write(stderr_output)
|
||||
|
||||
# 检查退出码
|
||||
if returncode != 0:
|
||||
log_error(f'Gemini exited with status {returncode}')
|
||||
sys.exit(returncode)
|
||||
|
||||
sys.exit(0)
|
||||
|
||||
except subprocess.TimeoutExpired:
|
||||
log_error(f'Gemini execution timeout ({timeout_sec}s)')
|
||||
process.kill()
|
||||
try:
|
||||
process.wait(timeout=FORCE_KILL_DELAY)
|
||||
except subprocess.TimeoutExpired:
|
||||
pass
|
||||
sys.exit(124)
|
||||
|
||||
except FileNotFoundError:
|
||||
log_error("gemini command not found in PATH")
|
||||
log_error("Please install Gemini CLI: https://github.com/google/generative-ai-python")
|
||||
sys.exit(127)
|
||||
|
||||
except KeyboardInterrupt:
|
||||
process.terminate()
|
||||
try:
|
||||
process.wait(timeout=FORCE_KILL_DELAY)
|
||||
except subprocess.TimeoutExpired:
|
||||
process.kill()
|
||||
sys.exit(130)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
Reference in New Issue
Block a user