execute
- Repo stars 55
- Author updated Live
- Author repo prd-breakdown-execute
- Domain
- Productivity
- Compatible agents
-
- Claude Code
- Cursor
- Cline
- Codex
- Windsurf
- Gemini CLI
- +20
- Trust score
- 88 / 100 · community maintained
- Author / version / license
- @vinzenz · no license declared
- Token usage
- Heavy
- Setup complexity
- Guided setup
- External API key
- Not required
- Operating systems
- Unspecified (assume cross-platform)
- Runtime requirements
- Python
- Permissions
-
- Read-only
- Write / modify
- Shell exec
- Network behavior
- External requests
- Install commands
- 26 variants
Profile is derived at build time from SKILL.md and install vectors. Subject to drift from author intent.
Heads up: 未限定 allowed-tools,默认拥有全部工具权限。
---
name: execute
description: Main entry point for hierarchical task execution. Orchestrates layer-by-layer implementation of…
category: productivity
runtime: Python
---
# execute output preview
## PART A: Task fit
- Use case: Main entry point for hierarchical task execution. Orchestrates layer-by-layer implementation of PRD tasks with parallel worktree execution. You are the main orchestrator for executing PRD implementation tasks. You coordinate layer-by-layer execution through a 4-level hierarchy: makes outbound network calls; runs on Python. Works with Claude Code, Cursor, ….
- Inputs: target material, constraints, expected output, and acceptance criteria.
- Evidence boundary: follow “Arguments / Required / Common Options” and do not present inference as author intent.
## PART B: Execution result
- **01** The card summarizes the use case; runtime output centers on “Main entry point for hierarchical task execution. Orchestrates layer-by-layer implementation of PRD tasks with parallel worktree execution. You are the main orchestrator for executing PRD implementation tasks. You coordinate layer-by-layer execution through a 4-level hierarchy: makes outbound network calls; runs on Python. Works with Claude Code, Cursor, …”.
- **02** When the source has headings, the agent prioritizes “Arguments / Required / Common Options” so the result follows the author’s structure.
- **03** Typical output includes task judgment, concrete steps, required commands or file edits, validation, and follow-up options.
- **04** Risk context follows the fingerprint: read files, write/modify files, run shell commands; may access external network resources; usually needs no extra API key.
## Running Rules
- read files, write/modify files, run shell commands; may access external network resources; usually needs no extra API key.
- Validate with a small sample before expanding scope.
- Return the result, validation criteria, and next iteration options. The source mentions slash commands such as `/execute`, `/execute-layer`, `/execute-batch`, `/execute-task`, `/execute-verify`; use them first when your agent supports command triggers.
Name target files or source material, expected output, forbidden changes, and whether network or shell access is allowed. Permission fingerprint: read files, write/modify files, run shell commands.
Start with a small task and check whether the result follows “Arguments / Required / Common Options”. Inspect diffs, logs, previews, or tests before expanding scope.
Confirm the final output includes a concrete result, evidence, and next action. If it stays generic, tighten inputs, boundaries, and acceptance criteria.
---
name: execute
description: Main entry point for hierarchical task execution. Orchestrates layer-by-layer implementation of…
category: productivity
source: vinzenz/prd-breakdown-execute
---
# execute
## When to use
- Main entry point for hierarchical task execution. Orchestrates layer-by-layer implementation of PRD tasks with paralle…
- Use it when the task has clear inputs, repeatable steps, and validation criteria.
## What to provide
- Target material, scope, expected result, and forbidden changes.
- Whether network, commands, file writes, or external services are allowed.
## Execution rules
- Organize steps around “Arguments / Required / Common Options” and keep inference separate from source facts.
- read files, write/modify files, run shell commands; may access external network resources; usually needs no extra API key.
- Validate with a small sample before expanding the task.
## Output requirements
- Return the deliverable, key evidence, validation method, and next action.
- Mark missing information as unknown; do not invent commands, platforms, or dependencies. The author source anchors workflow facts; repository files anchor sources and commands; Fluxly only adds fit, limitations, and quality judgment.
skill "execute" {
input -> user goal + target files + boundaries + acceptance criteria
context -> Arguments / Required / Common Options
rules -> SKILL.md triggers / order / output contract
runtime -> Python | read files, write/modify files, run shell commands | may access external network resources
guardrails -> usually needs no extra API key + small-sample validation + diff/log review
output -> copyable result + checklist + next iteration
} 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
Decide Fit First
Design Intent
How To Use It
Boundaries And Review