npx skills add https://github.com/rysweet/amplihack --skill workflow-enforcement引导 Claude 完成所有工作流步骤,通过:
~/.amplihack/.claude/runtime/workflow_state.yaml)实施状态:此技能目前是一个指导 Claude 行为的规范。实际的阻塞执行需要以下任一方式:
代理经常跳过强制性的工作流步骤,尤其是:
根本原因:
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
创建此技能是因为一个代理在构建功能时跳过了工作流步骤。导致步骤跳过的相同认知模式也可能导致此技能被忽略。我们直接承认这一局限性。
| 原则 | 此技能如何对齐 |
|---|---|
| 极致简洁 | 单一 YAML 文件用于状态;无复杂基础设施 |
| 零废话实施 | 诚实说明是指导,而非强制执行 |
| 模块化设计 | 自包含技能,具有清晰的集成点 |
| 故障开放 | 出错时记录并继续;绝不阻塞用户 |
自我意识说明:此技能本身是一个可以从其规范重新生成的“砖块”。它不包含可执行代码——它是通过加载的上下文指导 Claude 行为的文档。
选项 A - TodoWrite(推荐):
为所有 22 个步骤(0-21)创建 TodoWrite 条目:
- "步骤 0:工作流准备 - 为所有步骤创建待办事项"
- "步骤 1:准备工作区"
- ...
- "步骤 21:确保 PR 可合并 - 任务完成"
选项 B - YAML 状态文件:
cp .claude/templates/workflow_state.yaml.template \
.claude/runtime/workflow_state.yaml
# 编辑 workflow_id、task_description、started_at
2. 显示初始进度:
工作流进度 [0/22] [.......................] 步骤 0:工作流准备
强制关卡:步骤 0(准备)、步骤 10(审查)、步骤 16(PR 审查)、步骤 17(反馈)
3. 验证初始化:在继续之前确认存在 22 个待办事项。
completedcurrent_step 更新为下一个步骤编号步骤 15 之前(以草稿形式打开 PR):
+------------------------------------------------------------------+
| 检查点:PR 前验证 |
+------------------------------------------------------------------+
| [ ] 步骤 10:预提交代码审查 |
| 状态:???(检查您的 TodoWrite/YAML 状态) |
| |
| 如果步骤 10 未完成: |
| - 停止:不要继续到步骤 15 |
| - 操作:调用审查代理进行代码审查 |
| - 操作:调用安全代理进行安全审查 |
| - 然后返回此处并验证完成情况 |
+------------------------------------------------------------------+
步骤 21 之前(确保可合并):
+------------------------------------------------------------------+
| 检查点:最终验证 |
+------------------------------------------------------------------+
| [ ] 步骤 10:预提交代码审查 |
| [ ] 步骤 16:PR 审查 |
| [ ] 步骤 17:审查反馈实施 |
| |
| 所有强制步骤必须在步骤 21 之前完成。 |
| 检查您的 TodoWrite/YAML 状态以获取状态。 |
+------------------------------------------------------------------+
[######################] 22/22 步骤完成~/.amplihack/.claude/runtime/workflow_state.yaml,则删除它工作流:DEFAULT_WORKFLOW v1.1.0
进度:[##########............] 10/22 (45%)
当前:步骤 10 - 预提交代码审查(强制)
下一个:步骤 11 - 纳入审查反馈
+======================================================================+
| 默认工作流 - 进度 |
+======================================================================+
| 任务:添加身份验证功能 |
| 会话:session_20251125_143022 |
| 开始时间:2025-11-25T14:30:22 |
+----------------------------------------------------------------------+
| 进度:10/22 步骤 (45%) |
| [##########............] 10/22 |
+----------------------------------------------------------------------+
| 已完成 (10): |
| 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 |
| |
| 当前: |
| >> 步骤 10:预提交代码审查(强制) << |
| |
| 剩余 (12): |
| 11, 12, 13, 14, 15, *16*, *17*, 18, 19, 20, 21 |
| (* = 强制) |
+----------------------------------------------------------------------+
| 强制关卡: |
| [X] 步骤 0 - 工作流准备 已完成 |
| [ ] 步骤 10 - 预提交审查 进行中 |
| [ ] 步骤 16 - PR 审查 待处理 |
| [ ] 步骤 17 - 反馈实施 待处理 |
+======================================================================+
[10/22] 步骤 10(强制) | 关卡:0[X] 10[>] 16[ ] 17[ ]
模板位置:~/.amplihack/.claude/templates/workflow_state.yaml.template 活动状态位置:~/.amplihack/.claude/runtime/workflow_state.yaml
workflow_id: "session_20251125_143022"
workflow_name: DEFAULT
task_description: "添加身份验证功能"
started_at: "2025-11-25T14:30:22"
current_step: 10
steps:
0: { status: completed, timestamp: "2025-11-25T14:30:22", mandatory: true }
1: { status: completed, timestamp: "2025-11-25T14:31:05" }
# ... 步骤 2-9 ...
10: { status: in_progress, mandatory: true }
# ... 步骤 11-15 ...
16: { status: pending, mandatory: true }
17: { status: pending, mandatory: true }
# ... 步骤 18-21 ...
mandatory_steps: [0, 10, 16, 17]
checkpoints:
before_step_15:
required_steps: [10]
error_message: "未完成步骤 10 无法打开 PR"
before_step_21:
required_steps: [10, 16, 17]
error_message: "未完成所有强制审查无法标记为可合并"
Power steering 通过 considerations.yaml 中的 dev_workflow_complete 考量提供会话结束验证。
_check_dev_workflow_complete 分析转录内容considerations.yaml
==================
- id: dev_workflow_complete
category: 工作流流程遵守
question: 是否遵循了完整的 DEFAULT_WORKFLOW?
severity: blocker
checker: _check_dev_workflow_complete
applicable_session_types: ["DEVELOPMENT"]
当前限制:Power steering 检查工作流证据(代理使用、测试运行),但不读取 workflow_state.yaml。这是一个未来的增强机会。
# 在 power_steering_checker.py 中(未来)
def _check_dev_workflow_complete(self, transcript, session_id):
# 检查 workflow_state.yaml
state_file = Path(".claude/runtime/workflow_state.yaml")
if state_file.exists():
state = yaml.safe_load(state_file.read_text())
mandatory = state.get("mandatory_steps", [0, 10, 16, 17])
steps = state.get("steps", {})
for step_num in mandatory:
step = steps.get(step_num, {})
if step.get("status") != "completed":
return False # 强制步骤未完成
return True # 所有强制步骤已完成
# 回退到启发式分析
return self._check_workflow_heuristics(transcript)
使用 TodoWrite 时,确保步骤编号与工作流跟踪匹配:
TodoWrite(todos=[
{"content": "步骤 0:工作流准备 - 为所有步骤创建待办事项", "status": "completed", "activeForm": "创建步骤待办事项"},
{"content": "步骤 10:预提交代码审查 - 强制", "status": "in_progress", "activeForm": "审查代码"},
{"content": "步骤 16:PR 审查 - 强制", "status": "pending", "activeForm": "审查 PR"},
{"content": "步骤 17:实施审查反馈 - 强制", "status": "pending", "activeForm": "实施反馈"},
])
关键点:TodoWrite 是主要的跟踪机制。YAML 状态文件用于额外的持久性和结构化验证,是可选的。
当强制步骤被跳过时,Claude 应显示并遵循此模式:
+======================================================================+
| 工作流强制执行:已阻塞 |
+======================================================================+
| |
| 无法继续到步骤 15(以草稿形式打开 PR)。 |
| |
| 缺少的强制步骤: |
| 步骤 10:预提交代码审查 |
| |
| 为什么这很重要: |
| - 代码审查在错误到达 CI 之前捕获它们 |
| - 理念遵守确保质量 |
| - Issue #1607 将此识别为反复出现的问题 |
| |
| 所需操作: |
| 1. 调用审查代理进行全面代码审查 |
| 2. 调用安全代理进行安全审查 |
| 3. 在 TodoWrite 中将步骤 10 标记为已完成 |
| 4. 然后继续到步骤 15 |
| |
+======================================================================+
如果状态文件丢失或损坏:
dev_workflow_complete 检查# .pre-commit-config.yaml(未来)
- repo: local
hooks:
- id: workflow-validation
name: 验证工作流完成情况
entry: python .claude/tools/amplihack/validate_workflow.py
language: system
pass_filenames: false
# .github/workflows/ci.yml(未来)
- name: 验证工作流合规性
run: |
python -c "
from pathlib import Path
import yaml
state = yaml.safe_load(Path('.claude/runtime/workflow_state.yaml').read_text())
mandatory = state.get('mandatory_steps', [0, 10, 16, 17])
for step in mandatory:
if state['steps'].get(step, {}).get('status') != 'completed':
print(f'失败:强制步骤 {step} 未完成')
exit(1)
print('通过:所有强制工作流步骤已完成')
"
dev_workflow_complete 考量定义每周安装次数
90
仓库
GitHub 星标数
43
首次出现
2026年1月23日
安全审计
安装于
opencode80
codex74
cursor74
claude-code74
gemini-cli73
github-copilot71
Guides Claude to complete all workflow steps by:
~/.amplihack/.claude/runtime/workflow_state.yaml)Implementation Status : This skill is currently a SPECIFICATION that guides Claude behavior. Actual blocking enforcement requires either:
Agents routinely skip mandatory workflow steps, especially:
Root causes:
This skill was created because an agent skipped workflow steps while building a feature. The same cognitive patterns that cause step-skipping can also cause this skill to be ignored. We acknowledge this limitation directly.
| Principle | How This Skill Aligns |
|---|---|
| Ruthless Simplicity | Single YAML file for state; no complex infrastructure |
| Zero-BS Implementation | Honest about being guidance, not enforcement |
| Modular Design | Self-contained skill with clear integration points |
| Fail-Open | On errors, log and continue; never block users |
Self-Aware Note : This skill is itself a brick that could be regenerated from its specification. It does not contain executable code - it is documentation that guides Claude's behavior through loaded context.
Option A - TodoWrite (Recommended) :
Create TodoWrite entries for ALL 22 steps (0-21):
- "Step 0: Workflow Preparation - Create todos for ALL steps"
- "Step 1: Prepare the Workspace"
- ...
- "Step 21: Ensure PR is Mergeable - TASK COMPLETION"
Option B - YAML state file :
cp .claude/templates/workflow_state.yaml.template \
.claude/runtime/workflow_state.yaml
# Edit workflow_id, task_description, started_at
2. Display initial progress :
WORKFLOW PROGRESS [0/22] [.......................] Step 0: Workflow Preparation
Mandatory gates: Step 0 (Prep), Step 10 (Review), Step 16 (PR Review), Step 17 (Feedback)
3. Verify initialization : Confirm 22 todo items exist before proceeding.
completed in TodoWrite or YAMLcurrent_step to next step numberBefore Step 15 (Open PR as Draft) :
+------------------------------------------------------------------+
| CHECKPOINT: Pre-PR Validation |
+------------------------------------------------------------------+
| [ ] Step 10: Pre-commit code review |
| Status: ??? (check your TodoWrite/YAML state) |
| |
| If Step 10 is NOT completed: |
| - STOP: Do not proceed to Step 15 |
| - ACTION: Invoke reviewer agent for code review |
| - ACTION: Invoke security agent for security review |
| - Then return here and verify completion |
+------------------------------------------------------------------+
Before Step 21 (Ensure Mergeable) :
+------------------------------------------------------------------+
| CHECKPOINT: Final Validation |
+------------------------------------------------------------------+
| [ ] Step 10: Pre-commit code review |
| [ ] Step 16: PR review |
| [ ] Step 17: Review feedback implementation |
| |
| ALL mandatory steps must be completed before Step 21. |
| Check your TodoWrite/YAML state for status. |
+------------------------------------------------------------------+
[######################] 22/22 Steps Complete~/.amplihack/.claude/runtime/workflow_state.yaml if usedWORKFLOW: DEFAULT_WORKFLOW v1.1.0
PROGRESS: [##########............] 10/22 (45%)
Current: Step 10 - Pre-commit code review (MANDATORY)
Next: Step 11 - Incorporate Review Feedback
+======================================================================+
| DEFAULT WORKFLOW - Progress |
+======================================================================+
| Task: Add authentication feature |
| Session: session_20251125_143022 |
| Started: 2025-11-25T14:30:22 |
+----------------------------------------------------------------------+
| Progress: 10/22 steps (45%) |
| [##########............] 10/22 |
+----------------------------------------------------------------------+
| COMPLETED (10): |
| 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 |
| |
| CURRENT: |
| >> Step 10: Pre-commit code review (MANDATORY) << |
| |
| REMAINING (12): |
| 11, 12, 13, 14, 15, *16*, *17*, 18, 19, 20, 21 |
| (* = mandatory) |
+----------------------------------------------------------------------+
| MANDATORY GATES: |
| [X] Step 0 - Workflow Preparation COMPLETED |
| [ ] Step 10 - Pre-commit Review IN PROGRESS |
| [ ] Step 16 - PR Review PENDING |
| [ ] Step 17 - Feedback Implementation PENDING |
+======================================================================+
[10/22] Step 10 (MANDATORY) | Gates: 0[X] 10[>] 16[ ] 17[ ]
Template Location : ~/.amplihack/.claude/templates/workflow_state.yaml.template Active State Location : ~/.amplihack/.claude/runtime/workflow_state.yaml
workflow_id: "session_20251125_143022"
workflow_name: DEFAULT
task_description: "Add authentication feature"
started_at: "2025-11-25T14:30:22"
current_step: 10
steps:
0: { status: completed, timestamp: "2025-11-25T14:30:22", mandatory: true }
1: { status: completed, timestamp: "2025-11-25T14:31:05" }
# ... steps 2-9 ...
10: { status: in_progress, mandatory: true }
# ... steps 11-15 ...
16: { status: pending, mandatory: true }
17: { status: pending, mandatory: true }
# ... steps 18-21 ...
mandatory_steps: [0, 10, 16, 17]
checkpoints:
before_step_15:
required_steps: [10]
error_message: "Cannot open PR without completing Step 10"
before_step_21:
required_steps: [10, 16, 17]
error_message: "Cannot mark mergeable without all mandatory reviews"
Power steering provides session-end verification through the dev_workflow_complete consideration in considerations.yaml.
_check_dev_workflow_complete analyzes the transcriptconsiderations.yaml
==================
- id: dev_workflow_complete
category: Workflow Process Adherence
question: Was full DEFAULT_WORKFLOW followed?
severity: blocker
checker: _check_dev_workflow_complete
applicable_session_types: ["DEVELOPMENT"]
Current Limitation : Power steering checks for evidence of workflow (agent usage, test runs) but does NOT read workflow_state.yaml. This is a future enhancement opportunity.
# In power_steering_checker.py (future)
def _check_dev_workflow_complete(self, transcript, session_id):
# Check for workflow_state.yaml
state_file = Path(".claude/runtime/workflow_state.yaml")
if state_file.exists():
state = yaml.safe_load(state_file.read_text())
mandatory = state.get("mandatory_steps", [0, 10, 16, 17])
steps = state.get("steps", {})
for step_num in mandatory:
step = steps.get(step_num, {})
if step.get("status") != "completed":
return False # Mandatory step incomplete
return True # All mandatory steps completed
# Fall back to heuristic analysis
return self._check_workflow_heuristics(transcript)
When using TodoWrite, ensure step numbers match workflow tracking:
TodoWrite(todos=[
{"content": "Step 0: Workflow Preparation - Create todos for ALL steps", "status": "completed", "activeForm": "Creating step todos"},
{"content": "Step 10: Pre-commit code review - MANDATORY", "status": "in_progress", "activeForm": "Reviewing code"},
{"content": "Step 16: PR review - MANDATORY", "status": "pending", "activeForm": "Reviewing PR"},
{"content": "Step 17: Implement review feedback - MANDATORY", "status": "pending", "activeForm": "Implementing feedback"},
])
Key Point : TodoWrite is the primary tracking mechanism. YAML state file is optional for additional persistence and structured validation.
When mandatory steps are skipped, Claude SHOULD display and follow this pattern:
+======================================================================+
| WORKFLOW ENFORCEMENT: BLOCKED |
+======================================================================+
| |
| Cannot proceed to Step 15 (Open PR as Draft). |
| |
| MISSING MANDATORY STEP: |
| Step 10: Pre-commit code review |
| |
| WHY THIS MATTERS: |
| - Code review catches bugs before they reach CI |
| - Philosophy compliance ensures quality |
| - Issue #1607 identified this as a recurring problem |
| |
| ACTION REQUIRED: |
| 1. Invoke reviewer agent for comprehensive code review |
| 2. Invoke security agent for security review |
| 3. Mark Step 10 as completed in TodoWrite |
| 4. Then proceed to Step 15 |
| |
+======================================================================+
If state file is missing or corrupt:
dev_workflow_complete checks# .pre-commit-config.yaml (future)
- repo: local
hooks:
- id: workflow-validation
name: Validate workflow completion
entry: python .claude/tools/amplihack/validate_workflow.py
language: system
pass_filenames: false
# .github/workflows/ci.yml (future)
- name: Validate Workflow Compliance
run: |
python -c "
from pathlib import Path
import yaml
state = yaml.safe_load(Path('.claude/runtime/workflow_state.yaml').read_text())
mandatory = state.get('mandatory_steps', [0, 10, 16, 17])
for step in mandatory:
if state['steps'].get(step, {}).get('status') != 'completed':
print(f'FAIL: Mandatory step {step} not completed')
exit(1)
print('PASS: All mandatory workflow steps completed')
"
dev_workflow_complete consideration definitionWeekly Installs
90
Repository
GitHub Stars
43
First Seen
Jan 23, 2026
Security Audits
Gen Agent Trust HubFailSocketPassSnykPass
Installed on
opencode80
codex74
cursor74
claude-code74
gemini-cli73
github-copilot71
通过 LiteLLM 代理让 Claude Code 对接 GitHub Copilot 运行 | 高级变通方案指南
44,900 周安装
Nansen Token Research CLI - 区块链代币深度分析工具,获取价格、持有者、资金流数据
213 周安装
电子表格自动化技能:Python openpyxl与pandas创建、编辑、分析、可视化Excel/CSV数据
208 周安装
TypeScript单元测试指南:Jest与NestJS测试工作流与最佳实践
211 周安装
交互式作品集设计指南:30秒吸引招聘者,提升个人品牌与转化率
209 周安装
单细胞RNA测序质量控制工具 - 遵循scverse最佳实践的自动化QC工作流
227 周安装
DrugBank数据库Python访问指南:药物信息查询、相互作用分析与化学性质计算
210 周安装