mirror of
https://github.com/cexll/myclaude.git
synced 2026-02-04 02:20:42 +08:00
refactor: rename feature-dev to do workflow
- Rename skills/feature-dev/ → skills/do/ - Update config.json module name and paths - Shorter command: /do instead of /feature-dev - State file: .claude/do.local.md - Completion promise: <promise>DO_COMPLETE</promise> Generated with SWE-Agent.ai Co-Authored-By: SWE-Agent.ai <noreply@swe-agent.ai>
This commit is contained in:
@@ -169,15 +169,15 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"feature-dev": {
|
||||
"do": {
|
||||
"enabled": false,
|
||||
"description": "7-phase feature development workflow with codeagent orchestration",
|
||||
"operations": [
|
||||
{
|
||||
"type": "copy_dir",
|
||||
"source": "skills/feature-dev",
|
||||
"target": "skills/feature-dev",
|
||||
"description": "Install feature-dev skill with hooks"
|
||||
"source": "skills/do",
|
||||
"target": "skills/do",
|
||||
"description": "Install do skill with hooks"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
86
skills/do/README.md
Normal file
86
skills/do/README.md
Normal file
@@ -0,0 +1,86 @@
|
||||
# do
|
||||
|
||||
7-phase feature development workflow, orchestrating multiple agents via codeagent-wrapper.
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
python install.py --module do
|
||||
```
|
||||
|
||||
Installs:
|
||||
- `~/.claude/skills/do/` - skill files
|
||||
- hooks auto-merged into `~/.claude/settings.json`
|
||||
|
||||
## Usage
|
||||
|
||||
```
|
||||
/do <feature description>
|
||||
```
|
||||
|
||||
Examples:
|
||||
```
|
||||
/do add user login feature
|
||||
/do implement order export to CSV
|
||||
```
|
||||
|
||||
## Workflow Phases
|
||||
|
||||
| Phase | Name | Goal |
|
||||
|-------|------|------|
|
||||
| 1 | Discovery | Understand requirements |
|
||||
| 2 | Exploration | Explore codebase |
|
||||
| 3 | Clarification | Resolve ambiguities (mandatory) |
|
||||
| 4 | Architecture | Design approach |
|
||||
| 5 | Implementation | Build (requires approval) |
|
||||
| 6 | Review | Code review |
|
||||
| 7 | Summary | Document results |
|
||||
|
||||
## Agents
|
||||
|
||||
- `code-explorer` - Code tracing, architecture mapping
|
||||
- `code-architect` - Design approaches, file planning
|
||||
- `code-reviewer` - Code review, simplification suggestions
|
||||
- `develop` - Implement code, run tests
|
||||
|
||||
Agent prompts are in the `agents/` directory. To customize, create same-named files in `~/.codeagent/agents/` to override.
|
||||
|
||||
## ~/.codeagent/models.json Configuration
|
||||
|
||||
Optional. Uses codeagent-wrapper built-in config by default. To customize agent models:
|
||||
|
||||
```json
|
||||
{
|
||||
"agents": {
|
||||
"code-explorer": {
|
||||
"backend": "claude",
|
||||
"model": "claude-sonnet-4-5-20250929"
|
||||
},
|
||||
"code-architect": {
|
||||
"backend": "claude",
|
||||
"model": "claude-sonnet-4-5-20250929"
|
||||
},
|
||||
"code-reviewer": {
|
||||
"backend": "claude",
|
||||
"model": "claude-sonnet-4-5-20250929"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Loop Mechanism
|
||||
|
||||
A Stop hook is registered after installation. When `/do` runs:
|
||||
|
||||
1. Creates `.claude/do.local.md` state file
|
||||
2. Updates `current_phase` after each phase
|
||||
3. Stop hook checks state, blocks exit if incomplete
|
||||
4. Outputs `<promise>DO_COMPLETE</promise>` when finished
|
||||
|
||||
Manual exit: Set `active` to `false` in the state file.
|
||||
|
||||
## Uninstall
|
||||
|
||||
```bash
|
||||
python install.py --uninstall --module do
|
||||
```
|
||||
@@ -1,30 +1,30 @@
|
||||
---
|
||||
name: feature-dev
|
||||
description: This skill should be used for structured feature development with codebase understanding. Triggers on /feature-dev command. Provides a 7-phase workflow (Discovery, Exploration, Clarification, Architecture, Implementation, Review, Summary) using codeagent-wrapper to orchestrate code-explorer, code-architect, code-reviewer, and develop agents in parallel.
|
||||
allowed-tools: ["Bash(${SKILL_DIR}/scripts/setup-feature-dev.sh:*)"]
|
||||
name: do
|
||||
description: This skill should be used for structured feature development with codebase understanding. Triggers on /do command. Provides a 7-phase workflow (Discovery, Exploration, Clarification, Architecture, Implementation, Review, Summary) using codeagent-wrapper to orchestrate code-explorer, code-architect, code-reviewer, and develop agents in parallel.
|
||||
allowed-tools: ["Bash(${SKILL_DIR}/scripts/setup-do.sh:*)"]
|
||||
---
|
||||
|
||||
# Feature Development Orchestrator
|
||||
# do - Feature Development Orchestrator
|
||||
|
||||
An orchestrator for systematic feature development. Invoke agents via `codeagent-wrapper`, never write code directly.
|
||||
|
||||
## Loop Initialization (REQUIRED)
|
||||
|
||||
When triggered via `/feature-dev <task>`, **first** initialize the loop state:
|
||||
When triggered via `/do <task>`, **first** initialize the loop state:
|
||||
|
||||
```bash
|
||||
"${SKILL_DIR}/scripts/setup-feature-dev.sh" "<task description>"
|
||||
"${SKILL_DIR}/scripts/setup-do.sh" "<task description>"
|
||||
```
|
||||
|
||||
This creates `.claude/feature-dev.local.md` with:
|
||||
This creates `.claude/do.local.md` with:
|
||||
- `active: true`
|
||||
- `current_phase: 1`
|
||||
- `max_phases: 7`
|
||||
- `completion_promise: "<promise>FEATURE_COMPLETE</promise>"`
|
||||
- `completion_promise: "<promise>DO_COMPLETE</promise>"`
|
||||
|
||||
## Loop State Management
|
||||
|
||||
After each phase, update `.claude/feature-dev.local.md` frontmatter:
|
||||
After each phase, update `.claude/do.local.md` frontmatter:
|
||||
```yaml
|
||||
current_phase: <next phase number>
|
||||
phase_name: "<next phase name>"
|
||||
@@ -32,7 +32,7 @@ phase_name: "<next phase name>"
|
||||
|
||||
When all 7 phases complete, output the completion signal:
|
||||
```
|
||||
<promise>FEATURE_COMPLETE</promise>
|
||||
<promise>DO_COMPLETE</promise>
|
||||
```
|
||||
|
||||
To abort early, set `active: false` in the state file.
|
||||
@@ -44,7 +44,7 @@ To abort early, set `active: false` in the state file.
|
||||
3. **Phase 5 (Implementation) requires explicit approval.** Stop after Phase 4 if not approved.
|
||||
4. **Pass complete context forward.** Every agent invocation includes the Context Pack.
|
||||
5. **Parallel-first.** Run independent tasks via `codeagent-wrapper --parallel`.
|
||||
6. **Update state after each phase.** Keep `.claude/feature-dev.local.md` current.
|
||||
6. **Update state after each phase.** Keep `.claude/do.local.md` current.
|
||||
|
||||
## Agents
|
||||
|
||||
@@ -90,7 +90,7 @@ To abort early, set `active: false` in the state file.
|
||||
```bash
|
||||
codeagent-wrapper --agent code-architect - . <<'EOF'
|
||||
## Original User Request
|
||||
/feature-dev <request>
|
||||
/do <request>
|
||||
|
||||
## Context Pack
|
||||
- Code-explorer output: None
|
||||
@@ -119,7 +119,7 @@ agent: code-explorer
|
||||
workdir: .
|
||||
---CONTENT---
|
||||
## Original User Request
|
||||
/feature-dev <request>
|
||||
/do <request>
|
||||
|
||||
## Context Pack
|
||||
- Code-architect output: <Phase 1 output>
|
||||
@@ -136,7 +136,7 @@ agent: code-explorer
|
||||
workdir: .
|
||||
---CONTENT---
|
||||
## Original User Request
|
||||
/feature-dev <request>
|
||||
/do <request>
|
||||
|
||||
## Context Pack
|
||||
- Code-architect output: <Phase 1 output>
|
||||
@@ -153,7 +153,7 @@ agent: code-explorer
|
||||
workdir: .
|
||||
---CONTENT---
|
||||
## Original User Request
|
||||
/feature-dev <request>
|
||||
/do <request>
|
||||
|
||||
## Context Pack
|
||||
- Code-architect output: <Phase 1 output>
|
||||
@@ -189,7 +189,7 @@ agent: code-architect
|
||||
workdir: .
|
||||
---CONTENT---
|
||||
## Original User Request
|
||||
/feature-dev <request>
|
||||
/do <request>
|
||||
|
||||
## Context Pack
|
||||
- Code-explorer output: <ALL Phase 2 outputs>
|
||||
@@ -208,7 +208,7 @@ agent: code-architect
|
||||
workdir: .
|
||||
---CONTENT---
|
||||
## Original User Request
|
||||
/feature-dev <request>
|
||||
/do <request>
|
||||
|
||||
## Context Pack
|
||||
- Code-explorer output: <ALL Phase 2 outputs>
|
||||
@@ -236,7 +236,7 @@ Use AskUserQuestion to let user choose approach.
|
||||
```bash
|
||||
codeagent-wrapper --agent develop - . <<'EOF'
|
||||
## Original User Request
|
||||
/feature-dev <request>
|
||||
/do <request>
|
||||
|
||||
## Context Pack
|
||||
- Code-explorer output: <ALL Phase 2 outputs>
|
||||
@@ -267,7 +267,7 @@ agent: code-reviewer
|
||||
workdir: .
|
||||
---CONTENT---
|
||||
## Original User Request
|
||||
/feature-dev <request>
|
||||
/do <request>
|
||||
|
||||
## Context Pack
|
||||
- Code-architect output: <Phase 4 blueprint>
|
||||
@@ -285,7 +285,7 @@ agent: code-reviewer
|
||||
workdir: .
|
||||
---CONTENT---
|
||||
## Original User Request
|
||||
/feature-dev <request>
|
||||
/do <request>
|
||||
|
||||
## Context Pack
|
||||
- Code-architect output: <Phase 4 blueprint>
|
||||
@@ -310,7 +310,7 @@ Use AskUserQuestion: Fix now / Fix later / Proceed as-is.
|
||||
```bash
|
||||
codeagent-wrapper --agent code-reviewer - . <<'EOF'
|
||||
## Original User Request
|
||||
/feature-dev <request>
|
||||
/do <request>
|
||||
|
||||
## Context Pack
|
||||
- Code-architect output: <Phase 4 blueprint>
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"description": "Feature-dev loop hook for 7-phase workflow",
|
||||
"description": "do loop hook for 7-phase workflow",
|
||||
"hooks": {
|
||||
"Stop": [
|
||||
{
|
||||
@@ -26,7 +26,7 @@ json_escape() {
|
||||
}
|
||||
|
||||
project_dir="${CLAUDE_PROJECT_DIR:-$PWD}"
|
||||
state_file="${project_dir}/.claude/feature-dev.local.md"
|
||||
state_file="${project_dir}/.claude/do.local.md"
|
||||
|
||||
if [ ! -f "$state_file" ]; then
|
||||
exit 0
|
||||
@@ -82,7 +82,7 @@ if [ -z "${phase_name:-}" ]; then
|
||||
fi
|
||||
|
||||
if [ -z "${completion_promise:-}" ]; then
|
||||
completion_promise="<promise>FEATURE_COMPLETE</promise>"
|
||||
completion_promise="<promise>DO_COMPLETE</promise>"
|
||||
fi
|
||||
|
||||
phases_done=0
|
||||
@@ -114,9 +114,9 @@ if [ "$phases_done" -eq 1 ] && [ "$promise_met" -eq 1 ]; then
|
||||
fi
|
||||
|
||||
if [ "$phases_done" -eq 0 ]; then
|
||||
reason="feature-dev 循环未完成:当前阶段 ${current_phase}/${max_phases}(${phase_name})。继续执行剩余阶段;完成每个阶段后更新 ${state_file} 的 current_phase/phase_name。全部完成后在最终输出中包含 completion_promise:${completion_promise}。如需退出,将 active 设为 false。"
|
||||
reason="do loop incomplete: current phase ${current_phase}/${max_phases} (${phase_name}). Continue with remaining phases; update ${state_file} current_phase/phase_name after each phase. Include completion_promise in final output when done: ${completion_promise}. To exit early, set active to false."
|
||||
else
|
||||
reason="feature-dev 已到最终阶段(current_phase=${current_phase} / max_phases=${max_phases},phase_name=${phase_name}),但未检测到 completion_promise:${completion_promise}。请在最终输出中包含该标记(或写入 ${state_file} 正文),然后再结束;如需强制退出,将 active 设为 false。"
|
||||
reason="do reached final phase (current_phase=${current_phase} / max_phases=${max_phases}, phase_name=${phase_name}), but completion_promise not detected: ${completion_promise}. Please include this marker in your final output (or write it to ${state_file} body), then finish; to force exit, set active to false."
|
||||
fi
|
||||
|
||||
printf '{"decision":"block","reason":"%s"}\n' "$(json_escape "$reason")"
|
||||
@@ -4,14 +4,14 @@ set -euo pipefail
|
||||
|
||||
usage() {
|
||||
cat <<'EOF'
|
||||
Usage: setup-feature-dev.sh [options] PROMPT...
|
||||
Usage: setup-do.sh [options] PROMPT...
|
||||
|
||||
Creates (or overwrites) project state file:
|
||||
.claude/feature-dev.local.md
|
||||
.claude/do.local.md
|
||||
|
||||
Options:
|
||||
--max-phases N Default: 7
|
||||
--completion-promise STR Default: <promise>FEATURE_COMPLETE</promise>
|
||||
--completion-promise STR Default: <promise>DO_COMPLETE</promise>
|
||||
-h, --help Show this help
|
||||
EOF
|
||||
}
|
||||
@@ -35,7 +35,7 @@ phase_name_for() {
|
||||
}
|
||||
|
||||
max_phases=7
|
||||
completion_promise="<promise>FEATURE_COMPLETE</promise>"
|
||||
completion_promise="<promise>DO_COMPLETE</promise>"
|
||||
declare -a prompt_parts=()
|
||||
|
||||
while [ $# -gt 0 ]; do
|
||||
@@ -81,7 +81,7 @@ fi
|
||||
|
||||
project_dir="${CLAUDE_PROJECT_DIR:-$PWD}"
|
||||
state_dir="${project_dir}/.claude"
|
||||
state_file="${state_dir}/feature-dev.local.md"
|
||||
state_file="${state_dir}/do.local.md"
|
||||
|
||||
mkdir -p "$state_dir"
|
||||
|
||||
@@ -96,7 +96,7 @@ max_phases: $max_phases
|
||||
completion_promise: "$completion_promise"
|
||||
---
|
||||
|
||||
# feature-dev loop state
|
||||
# do loop state
|
||||
|
||||
## Prompt
|
||||
$prompt
|
||||
@@ -1,86 +0,0 @@
|
||||
# feature-dev
|
||||
|
||||
7 阶段功能开发工作流,使用 codeagent-wrapper 编排多个 agent。
|
||||
|
||||
## 安装
|
||||
|
||||
```bash
|
||||
python install.py --module feature-dev
|
||||
```
|
||||
|
||||
安装内容:
|
||||
- `~/.claude/skills/feature-dev/` - skill 文件
|
||||
- hooks 自动合并到 `~/.claude/settings.json`
|
||||
|
||||
## 使用
|
||||
|
||||
```
|
||||
/feature-dev <功能描述>
|
||||
```
|
||||
|
||||
示例:
|
||||
```
|
||||
/feature-dev 添加用户登录功能
|
||||
/feature-dev 实现订单导出 CSV
|
||||
```
|
||||
|
||||
## 工作流阶段
|
||||
|
||||
| 阶段 | 名称 | 目标 |
|
||||
|------|------|------|
|
||||
| 1 | Discovery | 理解需求 |
|
||||
| 2 | Exploration | 探索代码库 |
|
||||
| 3 | Clarification | 澄清疑问(必须) |
|
||||
| 4 | Architecture | 设计方案 |
|
||||
| 5 | Implementation | 实现(需审批) |
|
||||
| 6 | Review | 代码审查 |
|
||||
| 7 | Summary | 总结文档 |
|
||||
|
||||
## Agents
|
||||
|
||||
- `code-explorer` - 代码追踪、架构映射
|
||||
- `code-architect` - 方案设计、文件规划
|
||||
- `code-reviewer` - 代码审查、简化建议
|
||||
- `develop` - 实现代码、运行测试
|
||||
|
||||
Agent 提示词位于 `agents/` 目录。如需自定义,可在 `~/.codeagent/agents/` 创建同名文件覆盖。
|
||||
|
||||
## ~/.codeagent/models.json 配置
|
||||
|
||||
可选。默认使用 codeagent-wrapper 内置配置。如需自定义 agent 模型:
|
||||
|
||||
```json
|
||||
{
|
||||
"agents": {
|
||||
"code-explorer": {
|
||||
"backend": "claude",
|
||||
"model": "claude-sonnet-4-5-20250929"
|
||||
},
|
||||
"code-architect": {
|
||||
"backend": "claude",
|
||||
"model": "claude-sonnet-4-5-20250929"
|
||||
},
|
||||
"code-reviewer": {
|
||||
"backend": "claude",
|
||||
"model": "claude-sonnet-4-5-20250929"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Loop 机制
|
||||
|
||||
安装后会注册 Stop hook。当 `/feature-dev` 执行时:
|
||||
|
||||
1. 创建 `.claude/feature-dev.local.md` 状态文件
|
||||
2. 每阶段更新 `current_phase`
|
||||
3. Stop hook 检测状态,未完成时阻止退出
|
||||
4. 完成后输出 `<promise>FEATURE_COMPLETE</promise>` 结束
|
||||
|
||||
手动退出:将状态文件中 `active` 设为 `false`。
|
||||
|
||||
## 卸载
|
||||
|
||||
```bash
|
||||
python install.py --uninstall --module feature-dev
|
||||
```
|
||||
Reference in New Issue
Block a user