From dev-harness
开发流水线编排器 — 自动检测状态、三层 Skill 解析、Hook 驱动续跑。通用于任何项目。Use when: 用户说"dev/开发/继续开发/下一步",或新会话需要续接上次进度。
How this skill is triggered — by the user, by Claude, or both
Slash command
/dev-harness:devThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
收到 `/dev` 调用后,**第一条回复必须严格按以下格式开头**:
收到 /dev 调用后,第一条回复必须严格按以下格式开头:
Using
dev-harness:devskill — running Step 0 (并行 3 条检测) now.
然后在同一条回复内立即并行调用下面"启动"段的 3 条 Bash 命令。
禁止行为:
Why:用户输入 /dev 是开始动作,不是请求解说。把"意图声明"绑死到"立即执行",是 harness engineering 的核心防摆烂手段(参考 superpowers executing-plans skill 的 "Announce at start" 同源设计)。
harness.py update — 续跑的唯一依据所有脚本通过 ${CLAUDE_PLUGIN_ROOT} 定位:
bash "${CLAUDE_PLUGIN_ROOT}/scripts/dh-python.sh" "${CLAUDE_PLUGIN_ROOT}/scripts/harness.py" <cmd>
bash "${CLAUDE_PLUGIN_ROOT}/scripts/detect-stack.sh"
bash "${CLAUDE_PLUGIN_ROOT}/scripts/dh-python.sh" "${CLAUDE_PLUGIN_ROOT}/scripts/skill-resolver.py" <stage>
并行执行环境检测:
cat .claude/harness-state.json 2>/dev/null || echo "NO_STATE"
bash "${CLAUDE_PLUGIN_ROOT}/scripts/detect-stack.sh"
bash "${CLAUDE_PLUGIN_ROOT}/scripts/dh-python.sh" "${CLAUDE_PLUGIN_ROOT}/scripts/skill-resolver.py" --all
current_stage,续接该阶段bash "${CLAUDE_PLUGIN_ROOT}/scripts/dh-python.sh" "${CLAUDE_PLUGIN_ROOT}/scripts/harness.py" init "任务名" --route C
对当前阶段运行三层解析:
bash "${CLAUDE_PLUGIN_ROOT}/scripts/dh-python.sh" "${CLAUDE_PLUGIN_ROOT}/scripts/skill-resolver.py" <stage_name>
/skill-name每个阶段:
# 开始
bash "${CLAUDE_PLUGIN_ROOT}/scripts/dh-python.sh" "${CLAUDE_PLUGIN_ROOT}/scripts/harness.py" update <stage> IN_PROGRESS
# 执行 Skill(根据解析结果)
# 完成
bash "${CLAUDE_PLUGIN_ROOT}/scripts/dh-python.sh" "${CLAUDE_PLUGIN_ROOT}/scripts/harness.py" update <stage> DONE
# 直接继续下一个阶段,不停下
产出: .claude/researches/*.md
需要多轮对话。产出: .claude/project-design/*-prd.md
产出: .claude/plans/*.md。等待策略读 pipeline.yml 或 dev-config.yml 的 plan.fallback:
fallback: wait(默认)— plan 写完停下,明确告诉用户"请 review,说'通过'后我会继续"。等审批fallback: auto-approve — plan 写完立即 harness.py update plan DONE 并进入 implement,不等用户。告诉用户已自动通过但不要等回复fallback: skip — 跳过整个 plan 阶段(D 路线/修 typo 类极简任务)无配置时默认 wait。禁止在 wait 模式下用任何形式自作主张进入 implement。
读取 .claude/plans/ 下的计划文档,逐 Phase 执行。
每个 Phase:
harness.py update implement IN_PROGRESS --phase N --gate build=passPhase > 3 时,可用 background Agent(isolation: "worktree") 并行执行无依赖的 Phase。
门禁命令来源(优先级):
.claude/dev-config.yml 的 gates 段detect-stack.sh 自动检测implement 完成后,用 background Agent 同时启动三路:
Agent(name="audit-worker", run_in_background=true): 解析 audit Skill → 执行 → harness.py update audit DONE
Agent(name="docs-worker", run_in_background=true): 解析 docs Skill → 执行 → harness.py update docs DONE
Agent(name="test-worker", run_in_background=true): 解析 test Skill → 执行 → harness.py update test DONE
等待三路全部完成后进入 review。
三路联合审查(code-reviewer + security-reviewer + architect)。CRITICAL → 自动修复。
调用 /remember 保存进度。
Stop Hook 检查六道防线(上下文/超时/频率/rate limit/死循环),通过则注入续跑指令。你应该尽量自己直接推进,Stop Hook 是兜底。
检测到项目: {project_name},技术栈: {stack}
未找到进行中的任务。请告诉我:
1. 任务名称 2. 类型(新功能/bugfix/紧急) 3. 涉及模块
续接任务: {task_name}
当前阶段: implement (Phase 3/4)
继续实现 Phase 3...
全流程完成!
Task: {task_name} | Route: {route} | Stages: {completed}/{total}
Reports: .claude/reports/
Provides behavioral guidelines to reduce common LLM coding mistakes, focusing on simplicity, surgical changes, assumption surfacing, and verifiable success criteria.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub brothelmdzz/dev-harness --plugin dev-harness