Use when executing an approved compact or extended repository-owned plan from tmp/superpowers/<clear-action-or-task-name>/ and the numbered-file order, done-* loop, and blocker handling must stay explicit.
Install
mkdir -p .claude/skills/internal-gateway-execute-plans && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/14907" && unzip -o skill.zip -d .claude/skills/internal-gateway-execute-plans && rm skill.zipInstalls to .claude/skills/internal-gateway-execute-plans
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Use when executing an approved compact or extended repository-owned plan from tmp/superpowers/<clear-action-or-task-name>/ and the numbered-file order, done-* loop, and blocker handling must stay explicit.About this skill
Internal Gateway Execute Plans
Referenced skills
internal-gateway-writing-plans: retained-plan authoring owner for plans that feed this execution loop.superpowers-executing-plans: imported step-by-step execution engine when local policy is settled.superpowers-subagent-driven-development: imported worker-isolation engine when same-session subagents are available.superpowers-verification-before-completion: evidence gate before item completion and final retained-plan completion claims.
Repository-owned wrapper for applying retained numbered plans. This owner
consumes approved compact and extended retained plans.
When to use
- Executing approved
compactretained plans fromtmp/superpowers/mini-plan-*. - Executing approved
extendedretained plans fromtmp/superpowers/<action>/. - Applying a
compactorextendedplan authored withinternal-gateway-writing-plans.
When not to use
- Reviewing or challenging a plan; use
internal-gateway-revieworinternal-gateway-critical-master. - Treating
questions.mdas an executable file.
Core Algorithm
- Read
01-change-summary.mdfirst. - For
compact, read02-execution.md; forextended, read02-control.md. - Verify
Plan profile: compactorPlan profile: extended, then infer the execution strategy from profile, folder shape, and validation path. - Establish execution state from summary, control file, and active validator outcomes; keep it compact and update it as items close.
- Avoid repeated full rereads: inspect changed sections, active executable item context, and failing-validator evidence first.
- Run the ledger evidence pass.
- Identify mandatory applicable requirements from selected skills using target, runtime, ownership, and validation path.
- For
compact, confirm the folder usesmini-plan-*and02-execution.mdis the only executable file. - For
extended, read numbered executable files after02-control.mdin order starting at03-execution.md. - Process numbered executable files in order with the Agentic Execution Loop.
- Run an item-level compliance audit before closing each executable item.
- Track progress through the live ledger.
- Aggregate unresolved mandatory applicable requirements before closeout.
- Determine the completion state using the Closing Procedure state tree.
- Package closeout only for
DONE; for all other states, write a<STATE>-plan-state.mdmarker and keep the live ledger.
Execution Contract
- Reject unsupported profiles immediately.
- Reject
compactfolders outside themini-plan-*convention. - Ignore
questions.mdduring execution. - Maintain a compact execution state and prefer targeted rereads over full file re-ingestion unless new evidence invalidates current state.
- Use
Compact Evidence Reportingfor large validator output: read enough output to decide the state honestly, then retain command, exit code, material counts, header or schema checks, changed files, and exact gaps instead of pasting raw logs. - Infer the execution strategy from
Plan profile, folder shape, merged control-contract sections in02-control.mdwhen applicable, and the validation path. Do not require a separate retained-plan consumer field. - Audit only mandatory requirements that are applicable; do not convert specialist rules into universal policy.
- Use
superpowers-verification-before-completionas the fresh-evidence owner; do not duplicate its mechanics. - Block item closure and block
SHIPPEDwhenever mandatory applicable requirements remain unverified. - Escalate architecture ownership conflicts, cross-owner skill conflicts, and undefined validation strategy.
- Pressure-test boundary: a Lambda-owned hashed requirements file does not grant a separate stdlib-only CLI launcher permission to install that dependency set.
- Only
DONEmay createdone-*markers or remove numbered plan files, or publish a lightweightDONE-plan-state.mdmarker (<STATE>-plan-state.mdconvention) withState: DONEandContinuation: none. - Non-
DONEexits keep the live ledger and numbered files in place.
Agentic Execution Loop
When execution is already authorized, stay inside the active owner, target scope, anti-scope, and validation path, then iterate:
- Confirm the current goal and nearest evidence.
- Apply the smallest in-scope action.
- Run the focused validation or evidence check.
- If validation fails for an in-scope, repairable reason, fix once and re-run.
- Continue only while evidence improves and no stop condition fires.
- Stop with
DONE, a blocker, or an explicit evidence gap.
Apply Compact Evidence Reporting after each focused validation: preserve the
exact gap and proof path, but keep large outputs summarized unless the raw
output is itself the missing evidence.
Stop on scope drift, destructive action, owner conflict, missing validation path, human approval need, secret exposure risk, or repeated non-improving failures.
Closing Procedure
A retained plan folder must end every execution session in exactly one explicit state. The agent determines the state from evidence, not from intent. Use the state tree below, then apply the matching per-state actions.
State Determination
Evaluate the following checks in order and stop at the first match:
- Cancelled? The user explicitly decided to abandon the plan, and the
decision is recorded as
INTENTIONAL_NON_ACTIONwith a documented reason in the ledger. State:CANCELLED. - Blocked? A real, evidenced blocker prevents safe continuation. State:
BLOCKED. - Rolled back? Applied work was reverted or superseded by a different safe
state, and the original ledger rows are closed with evidence. State:
ROLLED_BACK. - Done? All in-scope ledger rows are closed, validators pass, mandatory
applicable evidence is verified, and no open blocker remains. State:
DONE. - Applied but unverified? Edits were applied, but a required validator,
review, or evidence coverage is missing. State:
APPLIED_UNVERIFIED. - Partial? Some in-scope items remain incomplete or intentionally deferred.
State:
PARTIAL.
If the ledger is absent, stale, or cannot be reconstructed, the state cannot be
DONE; use APPLIED_UNVERIFIED or PARTIAL and report the exact gap.
Per-State Actions
| State | Numbered files | Live ledger | done-* markers | <STATE>-plan-state.md | completion-report.md |
|---|---|---|---|---|---|
DONE | May be removed after evidence is stable | Finalized and retained | Required for full packaging | Optional lightweight marker (DONE-plan-state.md) | Required for full packaging, optional for lightweight |
APPLIED_UNVERIFIED | Keep in place | Keep in place | Do not create | Required | Optional but recommended |
PARTIAL | Keep in place | Keep in place | Do not create | Required | Optional but recommended |
BLOCKED | Keep in place | Keep in place | Do not create | Required | Optional but recommended |
ROLLED_BACK | Keep in place | Keep in place | Do not create | Required | Optional but recommended |
CANCELLED | Keep in place | Keep in place | Do not create | Required | Optional but recommended |
done-* markers and numbered-file removal are exclusive to DONE. Every other
state is a live-folder state and must preserve the retained plan for resume or
manual continuation.
Lightweight Marker Contract
A lightweight marker is a file named <STATE>-plan-state.md in the plan folder.
It is a terminal marker only when State: DONE and Continuation: none. For
non-DONE states it documents the current live-folder state.
Required fields:
State:exactly the state encoded in the filename.Continuation:noneforDONE;continuingorwaitingfor all other states.User action required:mandatory whenContinuationiswaiting.Next-step package:Owner,Scope,Action,Validation, andRiskmandatory for non-DONEstates.Evidence gaps:the exact gap preventingDONE.
Only one <STATE>-plan-state.md marker may exist in a plan folder at a time.
When the state changes, replace the marker; do not accumulate multiple state
markers.
State Transitions
Allowed transitions:
- Any live-folder state (
APPLIED_UNVERIFIED,PARTIAL,BLOCKED,ROLLED_BACK,CANCELLED) toDONEwhen evidence gaps close. APPLIED_UNVERIFIEDtoPARTIALorBLOCKEDwhen new evidence shows the work is incomplete or blocked.PARTIALtoAPPLIED_UNVERIFIEDwhen all planned edits are applied but verification is still missing.BLOCKEDtoPARTIALorAPPLIED_UNVERIFIEDwhen the blocker is resolved.ROLLED_BACKto any state if new work restarts or supersedes the rolled-back state.CANCELLEDis terminal. A new plan must be authored to restart cancelled work.
A transition must be evidenced by a fresh ledger pass and, when validators exist,
by fresh validator output. Do not move a folder to DONE from a non-DONE state
without re-running the applicable validation.
Closeout Artifact Checklist
Before declaring any closeout step complete:
- Compare promised work with observed delivery using the source-item ledger, current diff, touched files, validators, and explicit non-actions.
- Record the completion state in
completion-report.mdfor full packaging, or in<STATE>-plan-state.mdfor lightweight live-folder orDONEmarkers. - For
DONE, ensure the evidence envelope maps every ledger row ordone-*item to a status, evidence path or command, and route. - For non-
DONEstates, ensure the marker records the exact evidence gap, continuation intent, and next-step package. - Run the bundle-local
state-checkandcompletion-checkcommands and resolve any ERROR or WARNING they report.
Validation
- Summary and profile-control files are read first.
Plan profileiscompactorextended.- Execution stra
Content truncated.