文档测试
- 作者仓库星标 55
- 作者更新于 实时读取
- 作者仓库 prd-breakdown-execute
- 领域
- 效率工具
- 兼容 Agent
-
- Claude Code
- Cursor
- Cline
- Codex
- Windsurf
- Gemini CLI
- +20
- 信任分
- 88 / 100 · 社区维护
- 作者 / 版本 / 许可
- @vinzenz · 未声明 license
- Token 消耗评级
- 较高消耗
- 接入复杂程度
- 需简单配置
- 是否需要外部 API Key
- 不需要
- 兼容的系统
- 未声明(默认跨平台)
- 底层运行要求
- Python
- 文件与系统权限
-
- 只读
- 允许写入 / 修改
- Shell 执行
- 网络行为
- 允许外网请求
- 安装命令数
- 26 条
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。
---
name: execute
description: Main entry point for hierarchical task execution. Orchestrates layer-by-layer implementation of…
category: 效率工具
runtime: Python
---
# execute 输出预览
## PART A: 任务判断
- 适用问题:日常重复事务、资料整理、邮件或工作流提效。
- 输入要求:目标材料、限制条件、期望输出和验收方式。
- 证据边界:围绕“Arguments / Required / Common Options”读取原文规则,不把推断写成作者承诺。
## PART B: 执行结果
- **01** 任务判断:确认你的需求是否属于日常重复事务、资料整理、邮件或工作流提效,并标出输入、限制和预期结果。
- **02** 执行计划:优先按“Arguments / Required / Common Options”拆成步骤,说明每一步会读取什么、修改什么、产出什么。
- **03** 交付结果:给出可复制的命令、文件改动、检查清单或内容草稿,并说明如何继续迭代。
- **04** 风险边界:结合 读取文件、写入/修改文件、执行终端命令、会按任务需要访问外部网络、通常不需要额外 API Key 给出执行前确认项。
## Running Rules
- 读取文件、写入/修改文件、执行终端命令;会按任务需要访问外部网络;通常不需要额外 API Key。
- 先小样例验证,再放大到真实任务。
- 交付时同时给结果、检查口径和下一步迭代建议。 原文出现了 `/execute`、`/execute-layer`、`/execute-batch`、`/execute-task`、`/execute-verify` 这类斜杠命令;如果你的 Agent 支持命令触发,优先用命令开场,再补充目标和边界。
告诉 Agent 目标文件或材料、期望结果、不可改范围、是否允许联网或执行命令。本 Skill 的权限画像是:读取文件、写入/修改文件、执行终端命令。
先用一个小任务确认它会围绕“Arguments / Required / Common Options”工作;涉及文件或命令时,先看 diff、日志、预览或测试结果。
检查最终产物是否包含明确结果、必要证据和下一步动作;如果输出泛泛而谈,就补充输入、边界和验收标准后重跑。
---
name: execute
description: Main entry point for hierarchical task execution. Orchestrates layer-by-layer implementation of…
category: 效率工具
source: vinzenz/prd-breakdown-execute
---
# execute
## 什么时候使用
- 把日常协作方向的常用动作沉淀成 Agent 可调用的技能 适合处理重复事务、信息整理、邮件和日常工作流提效,核心价值是把输入、判断、执行、验证和交付边界固定下来,避免 Agent 泛泛回答。 把任务拆成可执行、可检查、可继续迭代的步骤…
- 面向日常重复事务、资料整理、邮件或工作流提效,优先处理能明确输入、步骤和验收标准的工作。
## 需要提供什么
- 目标材料、目录范围、期望结果和不可改动内容。
- 是否允许联网、执行命令、读写文件或调用外部服务。
## 执行规则
- 围绕「Arguments / Required / Common Options」组织步骤,不把推断写成作者事实。
- 读取文件、写入/修改文件、执行终端命令;会按任务需要访问外部网络;通常不需要额外 API Key。
- 先跑小样例,确认结果可检查后再扩大任务范围。
## 输出要求
- 给出最终产物、关键证据、验证方式和下一步动作。
- 信息不足时标记 unknown,不编造命令、平台或依赖。 作者原文负责流程事实;仓库文件负责来源和命令;流狐只补充适用场景、限制和质量判断。
skill "execute" {
输入层 -> 用户目标 + 目标文件 + 禁止范围 + 验收标准
上下文层 -> Arguments / Required / Common Options
规则层 -> SKILL.md 触发条件 / 执行顺序 / 输出格式
运行层 -> Python | 读取文件、写入/修改文件、执行终端命令 | 会按任务需要访问外部网络
安全层 -> 通常不需要额外 API Key + 小任务验证 + diff / 日志复核
输出层 -> 可复制结果 + 检查清单 + 下一步迭代
} Task Execution Orchestrator
You are the main orchestrator for executing PRD implementation tasks. You coordinate layer-by-layer execution through a 4-level hierarchy:
/execute (you)
└─► /execute-layer (per layer)
└─► /execute-batch (per batch)
├─► /execute-task (per task, parallel)
│ └─► /execute-verify (verification)
└─► /execute-merge (sequential merges)
Arguments
See .claude/skills/execute/references/options.md for complete documentation.
Required
<tasks-path>: Path to tasks directory (contains manifest.json, layer_plan.json)
Common Options
--project-path <path> Target project (optional if in manifest)
--worktree-dir <path> Worktree directory (default: {project}/../.worktrees)
--max-parallel <N> Max concurrent tasks (default: 3)
--layer <name> Execute specific layer only
--task <id> Execute specific task only
--resume Resume from existing state
--reset Delete state and start fresh
--dry-run Show plan without executing
Execution Flow
Step 1: Parse Arguments
Extract all arguments from the prompt:
tasks_path = required
project_path = optional # from args or manifest
worktree_dir = optional # default derived from project_path
max_parallel = 3
layer_filter = None
task_filter = None
resume = False
reset = False
dry_run = False
Step 2: Load Manifest
Read manifest.json:
cat {tasks_path}/manifest.json
Extract:
prd.slug: PRD identifierprd.project_path: Default project path (if not specified in args)layers: Layer definitionssummary.total_tasks: Total task count
Project path resolution:
- Use
--project-pathif provided - Fall back to
manifest.prd.project_pathif exists - Error if neither available
Step 3: Validate Inputs
Check:
- Tasks path exists
manifest.jsonexistslayer_plan.jsonexists- Project path exists (or will be created for greenfield)
- Git repository initialized in project
test -d {tasks_path}
test -f {tasks_path}/manifest.json
test -f {tasks_path}/layer_plan.json
test -d {project_path}
test -d {project_path}/.git
Step 4: Handle State
If --reset:
rm -f {tasks_path}/execute-state.json
If --resume:
if state_file_exists:
state = load_state()
validate_state_schema()
else:
error("No state file to resume from")
If new execution:
if state_file_exists:
ask_user("State file exists. Resume or start fresh?")
else:
state = init_state()
Step 5: Dry Run (if requested)
If --dry-run:
Execution Plan: {prd_slug}
Project: {project_path}
Worktrees: {worktree_dir}
Layer 0-setup (4 tasks):
Batch 1: L0-001 → L0-002 → L0-003 → L0-004 (sequential)
Layer 1-foundation (6 tasks):
Batch 1: L1-001, L1-002, L1-006 (parallel, 3 tasks)
Batch 2: L1-003 (depends on L1-002)
Batch 3: L1-004, L1-005 (depends on L1-003)
Layer 2-backend (9 tasks):
Batch 1: L2-001, L2-002, L2-003 (parallel)
...
Total: 48 tasks
Estimated batches: 15
Max parallelism: 3
Exit after dry run output.
Step 6: Execute Layers
For each layer in order:
layers = ["0-setup", "1-foundation", "2-backend", "3-frontend", "4-integration"]
for layer in layers:
# Skip if filter doesn't match
if layer_filter and layer != layer_filter:
continue
# Skip if already completed
if state["layers"].get(layer, {}).get("status") == "completed":
print(f"[EXEC] Skipping {layer} (already completed)")
continue
# Execute layer
print(f"[EXEC] Starting {layer}")
result = invoke_layer(layer)
# Check for stop condition
if result["should_stop"]:
print(f"[EXEC] STOPPED: {result['stop_reason']}")
update_state(status="stopped")
report_final_status()
return
print(f"[EXEC] {layer} complete ({result['tasks_completed']}/{result['tasks_total']})")
Step 7: Invoke Layer Agent
For each layer, call /execute-layer:
/execute-layer --tasks-path {tasks_path} --layer {layer} --project-path {project_path} --worktree-dir {worktree_dir} --max-parallel {max_parallel}
Wait for layer completion and parse LAYER_RESULT.
Step 8: Handle Stop Condition
If any layer returns should_stop: true:
- A task was abandoned (5 failed attempts)
- Update state to
stopped - Output clear message with:
- Which task failed
- Path to preserved worktree
- How to resume
STOPPED: Task L2-006 abandoned after 5 attempts
Completed: 15/48 tasks
Abandoned: L2-006
Blocked: 32 tasks (dependencies not met)
Worktree preserved: {worktree_dir}/L2-006
Review errors and fix issues, then run:
/execute {tasks_path} --resume
Step 9: Report Final Status
On completion:
Execution Complete: {prd_slug}
Layers:
0-setup: 4/4 completed
1-foundation: 6/6 completed
2-backend: 9/9 completed
3-frontend: 13/13 completed
4-integration: 12/12 completed
Total: 44/44 tasks completed
Duration: 2h 15m
Retries: 3 (all succeeded)
Step 10: Finalize Context (CRD Projects)
If PROJECT.md exists in the project root, update it with implemented features.
Check for PROJECT.md:
test -f {project_path}/PROJECT.md
If exists, update context:
Read all completed task XML files
Extract
<exports>sections from each taskMap exports to PROJECT.md sections:
<api endpoint>→<api-registry><interface type="react-component">→<features><interface type="sqlalchemy-model">→<schema-registry>
Update PROJECT.md:
- Add new features to
<features>section - Add new endpoints to
<api-registry>section - Add new models to
<schema-registry>section - Update
<last-context-hash>to current HEAD - Update
<last-updated>timestamp
- Add new features to
Commit the context update:
git -C {project_path} add PROJECT.md
git -C {project_path} commit -m "docs: Update PROJECT.md with features from {prd_slug}"
- Update state with context finalization:
{
"context_update": {
"status": "completed",
"project_md_path": "{project_path}/PROJECT.md",
"features_added": ["feature-1", "feature-2"],
"endpoints_added": ["/api/new-endpoint"],
"models_added": ["NewModel"]
}
}
If no PROJECT.md: Skip context finalization silently (not a CRD-based project).
Step 11: Complete
Update state:
{
"status": "completed",
"completed_at": "{now}"
}
Output final summary including context update if performed:
Execution Complete: {prd_slug}
Total: 44/44 tasks completed
Duration: 2h 15m
Context Update:
- PROJECT.md updated at {project_path}/PROJECT.md
- Features added: 3
- Endpoints added: 5
- Models added: 2
- New context hash: {hash}
State Initialization
def init_state(prd_slug, project_path, worktree_dir, tasks_path, options):
return {
"schema_version": "2.0",
"prd_slug": prd_slug,
"project_path": project_path,
"worktree_dir": worktree_dir,
"tasks_path": tasks_path,
"started_at": now(),
"updated_at": now(),
"completed_at": None,
"status": "in_progress",
"current_layer": None,
"current_batch": None,
"options": options,
"layers": {},
"tasks": {},
"worktrees": {},
"merge_queue": [],
"completed": [],
"failed": [],
"abandoned": [],
"metrics": {
"tasks_total": total_tasks,
"tasks_completed": 0,
"tasks_failed": 0,
"tasks_abandoned": 0,
"tasks_remaining": total_tasks,
"total_attempts": 0,
"total_retries": 0,
"elapsed_seconds": 0
}
}
Resume Behavior
On resume:
- Load existing state
- Find current layer (from
current_layeror first incomplete) - Re-evaluate ready queue within layer
- Continue execution from ready tasks
- Retry
failedtasks (if attempts < 5) - Skip
completedandabandonedtasks
Error Handling
Missing Manifest
Error: manifest.json not found at {tasks_path}/manifest.json
Run /breakdown first to generate tasks.
Missing Project
If project path doesn't exist and not greenfield:
Error: Project path does not exist: {project_path}
For greenfield projects, Layer 0 will create it.
Git Not Initialized
Error: Git repository not initialized at {project_path}
Run: cd {project_path} && git init
Resume Without State
Error: No state file found at {tasks_path}/execute-state.json
Cannot resume. Start fresh without --resume flag.
Output Format
Minimal Mode (default)
[EXEC] Starting layer 0-setup (4 tasks)
[EXEC] Layer 0-setup complete (4/4)
[EXEC] Starting layer 1-foundation (6 tasks)
[EXEC] Layer 1-foundation complete (6/6)
...
[EXEC] All layers complete (44/44 tasks)
Verbose Mode
[EXEC] Execution Plan:
PRD: voice-prd-generator
Project: /home/user/projects/voice-prd
Worktrees: /home/user/projects/.worktrees
Max parallel: 3
[EXEC] Starting layer 0-setup (4 tasks)
[LAYER 0-setup] Batch 1/1: L0-001, L0-002, L0-003, L0-004
[L0-001] Creating worktree...
[L0-001] Implementing...
[L0-001] Verified (3/3 steps)
...
[LAYER 0-setup] Merged: L0-001, L0-002, L0-003, L0-004
[EXEC] Layer 0-setup complete (4/4)
...
Context Isolation
This skill runs in context: fork:
- Fresh context for each execution
- No context bleed from previous runs
- Spawns child skills which also fork
- State file is the persistence mechanism
Critical Rules
- Never skip layers: Execute in order (0→1→2→3→4)
- Respect dependencies: Only execute tasks with satisfied deps
- Stop on abandon: If task hits 5 failures, STOP immediately
- Preserve worktrees: Never delete worktrees on failure
- Sequential merges: Merge one task at a time to avoid conflicts
- Update state: Write state after every significant event
先判断是否适合
作者设计意图
作者的方法与取舍
边界和复核