markshust/hcf/plan-orchestrate
Claude Code and agent skill by markshust/hcf
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Checking that the SKILL.md file is still in the repository.
Execute implementation plans with parallel TDD workers. Use when ready to run, execute, or start a plan. Triggers on "run the plan", "execute the plan", "implement the plan", "start the plan", "start implementation", "orchestrate", "begin autonomous execution". Requires a plan created by plan-create.
Install
npx vskill@latest install markshust/hcf/plan-orchestrateSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
Plan Orchestrate
Execute all tasks in a plan using parallel TDD workers. Fully autonomous after invocation.
Usage
Example: plan-orchestrate user-auth
Prerequisites
First, resolve the plans directory, once, and reuse $PLANS_DIR for every path below. It is .claude/plans unless the project overrides it in .claude/hcf.json (see Plans Directory in the README). The script answers with an absolute path resolved from the project root, so the result does not depend on the working directory:
Never substitute a hand-written `jq` line or a literal `.claude/plans`. A non-zero exit means the project root or the configured value is unusable; surface the script's stderr verbatim and stop. Quote every path built from $PLANS_DIR — a configured directory may contain spaces.
Then:
- Plan must exist at
$PLANS_DIR/{plan-name}/ - Project must be configured (
.claude/testing.mdexists) - Plan status must be
readyorin_progress
Check prerequisites:
If not found, output error and stop.
- Must be on the correct feature branch
Verify the current branch matches feature/{plan-name}:
If the current branch is not feature/{plan-name}:
- Output an error explaining which branch is expected
- Ask the user if they'd like to check out
feature/{plan-name} - Do NOT proceed until on the correct branch
Project Configuration
<testing> @.claude/testing.md </testing>
<code-standards> @.claude/code-standards.md </code-standards>
Execution Algorithm
Step 0: Suggest Unattended Completion via /goal
Claude Code's built-in /goal command keeps a session working toward a verifiable end state — its evaluator runs after each turn and pushes execution to continue until the condition is met. Only the user can set a goal (/goal is a user-typed command and cannot be invoked from a skill), so surface a copy-pasteable tip and continue immediately. This is informational, never a gate — do not wait for a response.
Display:
The suggested condition deliberately names both terminal outputs. A goal phrased as only ALL_TASKS_COMPLETE leaves the evaluator demanding more turns after a legitimately blocked run, when the correct behavior is to stop and report the blockage.
Step 1: Load Plan Context
Read plan files:
$PLANS_DIR/{plan-name}/_plan.md- Plan overview$PLANS_DIR/{plan-name}/*.md- All task files (excluding _plan.md)
Note: Testing and code standards are auto-included above.
Parse each task file to extract:
- Task number (from filename)
- Status (pending | in_progress | completed | blocked)
- Dependencies (from
Depends onfield) - Requirements (checkboxes)
- Retry count
Build a dependency graph as a data structure.
Step 2: Update Plan Status
If plan status is ready, change to in_progress:
- Edit
$PLANS_DIR/{plan-name}/_plan.md - Set
## Statustoin_progress
Establish the run fingerprint. Every hook call below passes this back via --expect=, so that agent files changing mid-run halt the orchestration rather than silently swapping the pipeline. Read $PLANS_DIR/{plan-name}/.hook-fingerprint and handle three distinct states — conflating them is the mistake to avoid:
| State | Action | |
|---|---|---|
Present and parseable (one line: discover-hooks-fingerprint-v1 <64-hex>) | Use it as $RUN_FINGERPRINT. Pass the file's contents verbatim — do not trim, reformat, or re-derive them. | |
| Missing | Not an error. Plans created before this feature have none. Capture one and write it to the plan directory so a resumed run is covered too, then continue: "{skill-base-dir}/../../hooks/discover-hooks.sh" --fingerprint > "$PLANS_DIR/{plan-name}/.hook-fingerprint" | |
| Present but unparseable (empty, truncated, prose, wrong length) | Halt. Do not silently recapture — that would mask a botched write. Tell the user to delete the file to re-baseline. |
Never reconstruct, abbreviate, or recall a fingerprint from memory. It is only ever produced by running the script. A hallucinated digest fails every subsequent hook with bogus drift and bricks the run.
Step 2a: Pre-Implementation Hook
Run the pre-implementation hook once, after the status is set to in_progress and before the first batch is launched.
Resolve and run enrolled agents via the HOOKS.md discovery routine (see Hook Discovery below) with HOOK = pre-implementation. Pass each agent the project context as described in Spawning hook agents.
Exit 0 with empty stdout is an empty hook: return immediately, log nothing, do no work, and proceed to Step 3. Any non-zero exit stops the run — see Hook Discovery for the full result table.
Step 3: Find Ready Tasks
Execution is a rolling loop, not a lockstep one. Each task starts as soon as its own dependencies are complete; it never waits for unrelated tasks that happened to start alongside its dependencies. Track a running set — the tasks with a worker in flight in this session.
A task is ready when:
- Status is
pending(anin_progresstask from an interrupted run counts as
pending — see Task Already In Progress)
- ALL dependencies have status
completed - It is not in the running set
Step 4: Check Termination Conditions
All Complete:
Waiting:
Blocked State:
Hook Discovery
All hooks in this skill (pre-implementation, pre-batch, post-batch, post-implementation, pre-commit, post-commit) resolve their enrolled agents by running `hooks/discover-hooks.sh`, the single implementation of HOOKS.md → Discovery Routine. Never enumerate agent files by hand and never write a glob loop to do it. For a given HOOK:
{skill-base-dir} is the `Base directory for this skill` value stated when this skill loaded — it is given verbatim, so no path inference is needed. ${CLAUDE_PLUGIN_ROOT} is not available in a skill's Bash calls. $RUN_FINGERPRINT is the value established at Step 2.
Then, by result:
- Exit 0, empty stdout → empty hook. Return immediately — no staging, no
diffing, no spawns, and no logging or narration. "No narration" is literal and is the rule most often broken: do not name the hook, do not say it is empty/skipped, do not explain why it is empty, and do not say the discovery script returned no agents. A filtered query prints zero bytes precisely so there is nothing to echo. An empty hook is completely invisible in the user-facing output. See HOOKS.md → Empty-hook fast path.
- Exit 0, output → PRINT it verbatim as the resolved order, then spawn.
- Exit 1 or 2 → stop the run. Surface stderr verbatim.
- Exit 3 → stop the run. An agent file declares an invalid
phaseor
mode. Surface stderr verbatim; it names the file and the fix.
- Exit 4 → halt HCF. Hook enrollment changed since this run started, so the
remaining hooks would execute a different pipeline than the plan was reviewed against. Surface stderr verbatim. Stop launching (see Stopping mid-run) and do not commit.
- Script missing or not executable → hard failure. Say so and stop. There is
no prose fallback; reconstructing the routine by hand is the failure this design exists to end.
Only exit 0 with empty stdout is an empty hook. Every other non-zero exit is an error to report loudly.
On a normal (exit 0, non-empty) result, spawn each agent per its `mode` field (single → one subagent for the whole plan; batch → split the relevant file list into batches of ~10 and spawn parallel subagents, one Task call per batch, all in a single message). The spawn mode comes from the agent's mode frontmatter field — never from sniffing the agent body text.
Spawning hook agents
Hook agents are spawned with the Task tool using subagent_type="{agent-name}". The orchestrator only has <testing> and <code-standards> in context (see Project Configuration) — it does NOT have <architecture>. Pass each hook agent the project context it needs verbatim:
**CRITICAL: Pass the COMPLETE, VERBATIM content of the<code-standards>and<testing>tags above. Do NOT summarize, condense, or paraphrase. The fulldocuments contain nuanced rules that are lost when summarized. Copy-paste theentire content between the tags.**
For a `batch` agent, send one prompt per batch:
For a `single` agent, send one prompt covering the whole plan, including the plan name, the changed-files list, and <testing> + <code-standards> verbatim.
If a hook agent needs project architecture, that is out of scope for thisorchestrator — it does not load<architecture>. Do NOT fabricate an## Project Architecturepaste here.
Step 4a: End-of-Run Hooks (Post-Implementation → Tests → Commit)
When all tasks are complete, run the end-of-run hook sequence. The control flow is strictly:
post-implementation → run full test suite → pre-commit → commit → post-commit
**CRITICAL INVARIANT: NOTHING is committed until AFTER the full test suitepasses.** This ensures no broken code is ever committed. Thepre-commithookruns after tests pass and before the commit;post-commitruns afterthe commit and before the push/PR prompt.
1. Run the `post-implementation` hook:
Resolve and run enrolled agents via the Hook Discovery routine with HOOK = post-implementation. To give batch agents a file list, first compute the changed files (this stages everything only to read the list, then unstages — nothing is committed). The plans directory is left out: plan files are working state, not code for agents to review.
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/plan-orchestrate/SKILL.md
Popularity
- Repository stars
- 75
- Repository forks
- 14
- 7-day trend score
- 22
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Extension points
hookPre/post lifecycle hooks
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/markshust/hcf/plan-orchestrate)