Use when asked about harness9 architecture, module design, or how components interact — explains the system design
日本語の概要は準備中です。原文の説明を表示しています。
Feature auto-development — clarify requirements, generate spec, dispatch dev sub-agent to implement and merge into current branch
インストールする前に、エージェントに与えられる指示の中身を確認できます。
当用户输入 /autodev <功能描述> 时,你按以下三个阶段工作。
首先用 read_file 读取 AGENTS.md,了解项目当前模块、架构和规范(重点:第 4 节项目结构、第 5 节开发流程)。
然后向用户提 2-3 个关键澄清问题,每次只问一个:
2-3 轮澄清后直接进入 Phase 2,不要过度追问。
以如下格式生成并展示 spec:
## Feature Spec: <标题>
### 功能描述
<简洁描述该功能做什么>
### 实现范围
新增文件:
- internal/<pkg>/<file>.go
- internal/<pkg>/<file>_test.go
修改文件:
- cmd/harness9/main.go(如需注册新工具)
### 验收标准
- [ ] go build ./... 通过
- [ ] go test ./... 通过
- [ ] (如涉及 Agent 行为)internal/evals/dataset/ 新增 eval 用例
### 不在范围内
- <明确列出不做的事>
展示完成后,输出以下提示,不要调用任何工具,直接结束本轮回复(TUI 会自动等待用户输入):
请确认 spec(输入「确认」继续实现),或告知需要修改的地方。
如果用户要求修改,更新 spec 后重新展示,再次等待确认。 只有用户明确输入「确认」后才进入 Phase 3。
依次用 bash 执行以下检查,任一失败则停下来告知用户并等待修复:
# 检查 Go 已安装(项目要求 1.25+)
go version
# 检查 git 可用
git --version
如果 SANDBOX_ENABLED=true,还需检查 Go 镜像是否配置:
echo "SANDBOX_IMAGE=${SANDBOX_IMAGE:-未设置}"
# 若未设置或不含 golang,提示用户在 .env 中添加:
# SANDBOX_IMAGE=golang:1.25-bookworm
从 spec 标题生成 slug(全小写,空格替换为 -,去掉非 ASCII 字母数字字符),然后执行:
示例:"Add WebSocket 支持" → "add-websocket-"(中文字符去掉)→ 可简化为 "add-websocket-support"
git worktree add .autodev/<slug> -b feature/autodev-<slug>
用 bash 获取绝对路径:
readlink -f .autodev/<slug>
调用 task 工具委派 dev sub-agent:
task("dev", "以下是需要实现的 Feature Spec:\n\n<spec 全文>\n\n工作目录(git worktree 绝对路径):<worktreePath>")
成功(sub-agent 返回 AUTODEV_RESULT: SUCCESS):
从 sub-agent 返回结果中提取 BRANCH: <branch-name>,然后执行合并:
# 将 feature 分支合并到当前分支
git merge feature/autodev-<slug>
若合并成功:
git worktree remove .autodev/<slug>若合并产生冲突:
git worktree remove .autodev/<slug> --force失败(sub-agent 报告无法通过测试):
cd .autodev/<slug> 进入排查」git worktree remove .autodev/<slug> --forceまだレビューはありません。使ってみた感想をお寄せください。
概要と使いどころ
Use when asked about harness9 architecture, module design, or how components interact — explains the system design
日本語の概要は準備中です。原文の説明を表示しています。
Use when the user invokes /commit or asks to commit changes, after a code review has been completed and the changes are confirmed ready to stage and commit to git.
日本語の概要は準備中です。原文の説明を表示しています。
Use when the user invokes /cr, requests a code review, or before committing to verify correctness, security, and quality of new or modified code in the working tree.
日本語の概要は準備中です。原文の説明を表示しています。
Use when debugging Go errors, test failures, or unexpected behavior — step-by-step diagnosis approach
日本語の概要は準備中です。原文の説明を表示しています。
Use when writing or reviewing Go code — explains harness9 project coding conventions and patterns
日本語の概要は準備中です。原文の説明を表示しています。
Use when the user invokes /pr or asks to push changes and open a pull request, after commits are ready to be pushed to a remote branch and merged into the main branch.
日本語の概要は準備中です。原文の説明を表示しています。