Help us improve
Share bugs, ideas, or general feedback.
From plangate
Stack-aware orchestrator for PLAN.md execution. Sequential pipeline: implementer agent > build gate > reviewer agent. Fresh context per stage prevents bias.
npx claudepluginhub bishnubista/plangate --plugin plangateHow this skill is triggered — by the user, by Claude, or both
Slash command
/plangate:orchestrateThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Execute PLAN.md tasks sequentially with fresh subagents per stage, build gates between implementation and review, and retry loops until each task passes. The orchestrator (you) stays active at every checkpoint — never fire-and-forget.
Executes multi-phase implementation plans by dispatching tasks to sub-agents, tracking progress per-task in plan.json, and coordinating sequential phases.
Defines a 4-phase execution loop (IMPLEMENT, VALIDATE, ADVERSARIAL REVIEW, COMMIT) for orchestrating complex multi-step work units with written specs and quality gates.
Orchestrates an adversarial plan-implement-review pipeline by spawning agents with separate context windows. Use after intake skills produce a starting document.
Share bugs, ideas, or general feedback.
Execute PLAN.md tasks sequentially with fresh subagents per stage, build gates between implementation and review, and retry loops until each task passes. The orchestrator (you) stays active at every checkpoint — never fire-and-forget.
Before starting:
PLAN.md to identify the current phase and its tasksCommands: line from <plangate-manifest> in session context. It contains the pre-resolved typecheck, lint, build, and test commands. If a command is SKIP, skip that stage. If the manifest is not available, fall back to the Stack Commands table below..plangate.json exists, its commands override the manifest (see Custom Validation Commands)Select commands based on detected stack. The session hook auto-detects and reports this in <plangate-manifest>.
| Stack | Typecheck | Lint | Build | Test |
|---|---|---|---|---|
| bun | bunx tsc --noEmit | bunx eslint . --max-warnings=0 | bun run build | bun test |
| pnpm | pnpm tsc --noEmit | pnpm eslint . --max-warnings=0 | pnpm build | pnpm test |
| yarn | yarn tsc --noEmit | yarn eslint . --max-warnings=0 | yarn build | yarn test |
| npm | npx tsc --noEmit | npx eslint . --max-warnings=0 | npm run build | npm test |
| uv/Python | uv run pyright | uv run ruff check . | — | uv run pytest |
| gradle/Kotlin | ./gradlew compileKotlin | ./gradlew detekt | ./gradlew build | ./gradlew test |
| go | go vet ./... | golangci-lint run | go build ./... | go test ./... |
| cargo/Rust | cargo check | cargo clippy -- -D warnings | cargo build | cargo test |
| spm/Swift | swift build | swiftlint | swift build -c release | swift test |
If .plangate.json exists in the project root, its commands block overrides the stack-detected defaults:
{
"commands": {
"typecheck": "./gradlew compileKotlin",
"lint": "./gradlew detekt",
"build": "./gradlew build",
"test": "./gradlew test"
}
}
Read this file at the start of orchestration and use its commands throughout the pipeline.
Orchestration can be interrupted by context limits, session timeouts, or crashes. To enable resumption, maintain a checkpoint file at .plangate/orchestration-state.json.
After each stage completes for each task, update the checkpoint file:
{
"phase": 1,
"started_at": "2026-02-07T14:30:00Z",
"tasks": [
{
"id": "1.1",
"text": "Create project structure",
"status": "complete",
"stages": {
"implement": "complete",
"gate": "complete",
"review": "complete"
}
},
{
"id": "1.2",
"text": "Add health-check endpoint",
"status": "in_progress",
"stages": {
"implement": "complete",
"gate": "failed",
"review": "pending"
},
"retry_count": 1
},
{
"id": "1.3",
"text": "Set up error handling",
"status": "pending",
"stages": {
"implement": "pending",
"gate": "pending",
"review": "pending"
}
}
]
}
When /plangate:orchestrate N is invoked:
.plangate/orchestration-state.json exists for phase NIf no checkpoint exists, start fresh.
After all tasks in a phase are complete, archive the checkpoint:
mv .plangate/orchestration-state.json .plangate/orchestration-state-phase-{N}.json
For each task in the phase:
0. CHECK FOR CHECKPOINT (resume if exists)
+-- Read .plangate/orchestration-state.json
+-- Skip completed tasks/stages
+-- Resume from first incomplete item
1. DISPATCH IMPLEMENTER (implementer agent, Sonnet)
+-- Full task text + stack commands + project context in prompt
+-- "Default-and-document" — proceeds with reasonable defaults, rarely blocks
+-- Implement > write tests > self-validate > commit > report
+-- Update .plangate/orchestration-state.json
2. RUN BUILD GATE (Bash, no subagent -- objective validation)
+-- typecheck > lint > build
+-- If fails: dispatch fix subagent > re-run gate (max 2 retries)
+-- Update .plangate/orchestration-state.json
3. DISPATCH REVIEWER (reviewer agent, Sonnet)
+-- Combined spec compliance + code quality with distrust
+-- If issues found: dispatch fix subagent > re-review (max 2 retries)
+-- Update .plangate/orchestration-state.json
4. UPDATE PLAN.MD
+-- Check off completed task
+-- Update .plangate/orchestration-state.json
5. NEXT TASK
plangate:gate skill/plangate:phase finishImportant: Do NOT update PLAN.md status (e.g., "In Progress" → "Complete") or commit a phase-completion update. That is the responsibility of plangate:phase finish, which owns lifecycle transitions. Committing here would create duplicate commits.
After all tasks complete and the final gate passes, output a summary in this format:
## Phase {N} Orchestration Summary
| Task | Implement | Gate | Review | Retries |
|------|-----------|------|--------|---------|
| {id}: {short title} | PASS | PASS | APPROVED | 0 |
| {id}: {short title} | PASS | PASS (retry 1) | APPROVED | 1 |
**Results:** {total} tasks completed, {retry_total} total retries
**Final gate:** PASSED
**Ready for:** `/plangate:phase finish`
Build the summary from the checkpoint file (.plangate/orchestration-state.json). Count retries per task by checking retry_count fields. This gives the user a clear picture of pipeline health — clean runs (0 retries) mean well-written task specs, while high retry counts suggest tasks need clearer acceptance criteria.
Launch the implementer agent via the Task tool. Include in the prompt:
The implementer agent will:
When the implementer returns:
Run validation directly via Bash (no subagent — this is objective pass/fail):
{TYPECHECK_CMD} && {LINT_CMD} && {BUILD_CMD}
Use the stack-appropriate commands from the table above or from .plangate.json if present.
Note on optional linters: For stacks where the linter is optional (detekt, golangci-lint, clippy, swiftlint), check if the command exists before running (e.g., command -v golangci-lint >/dev/null). Skip with a warning if not installed.
If the build gate fails:
The build gate is non-negotiable. Do not skip it. Do not proceed to review if it fails.
After the build gate passes, update the checkpoint file with gate stage status.
Launch the reviewer agent via the Task tool. Include in the prompt:
git diff to capture what was implementedThe reviewer agent will independently:
If the reviewer finds issues:
Orchestrator discretion on trivial fixes: For simple fixes (1-3 line changes addressing a single, clear issue like a missing clearTimeout or an off-by-one), the orchestrator may skip the re-review and proceed directly if the build gate passes. Use this only when the fix is obviously correct and the original review had no other concerns. When in doubt, re-review.
After the reviewer approves, update the checkpoint file with review stage status.
After a task passes all gates:
- [ ] to - [x]Each subagent starts with clean context. The orchestrator (you) maintains continuity between stages. This prevents implementer bias from leaking into review.
Never make a subagent read files to understand their task. Paste the full task description, relevant code snippets, and stack commands directly into the prompt.
Execute tasks one at a time. Parallel execution causes quality issues — tasks often have implicit dependencies, and parallel commits create merge conflicts.
You (the orchestrator) read every subagent report, run every build gate, and make every dispatch decision. You are the quality gatekeeper.
plangate:gate for final validationplangate:phase finish for PR creation.plangate/orchestration-state.json for checkpoint/resume capability