Use during implementation execution for preflight, pre-commit scope checks, step closeout, pre-push/pre-PR gates, hard process gates, and completion verification. For authoring or editing implementation plans, use implementation-plan first.
Install
npx skillscat add igor1309/ai-labs/process-gates Install via the SkillsCat registry.
Process Gates
For implementation plan authoring and declaration validation, useimplementation-plan first. This skill governs execution after a plan exists.
Pre-Commit Scope Check
Before each commit:
- Verify every changed file is directly tied to the current step.
- Verify no out-of-scope files were added.
- Run the required verification for the changed scope.
Step Closeout Protocol
Mandatory after each implementation step:
- Self-review the step against the approved spec and implementation plan scope.
- Fix any issues found in the self-review.
- Run the required verification for the changed scope and fix failures until it passes.
- Summarize what changed and why.
- Commit only files related to the current step.
- Update plan tracker checkboxes only for gates with verified evidence (successful command/check output).
- Follow the active plan's push policy. If no push policy is declared, do not push unless the user explicitly asks.
- Follow the active plan's execution mode. In
auto-continuemode, continue to the next step after green gates and local commit. Inhuman-review-gatedmode, stop and wait for review approval before starting the next step.
Pre-Push / Pre-PR Gate (Blocking)
Before pushing a branch or creating a PR, verify ALL of the following. Do not push until every item passes:
- Log updated: relevant changelog reflects what changed.
- Plan updated: active plan checkboxes match completed work.
- No leftover changes:
git statusis clean — no uncommitted docs, config, or code changes that belong in this branch. - Docker verified: for Docker-producing units,
docker buildmust pass. - Verification passes: required verification for the changed scope is green.
- Plan adversarial review (if a plan changed): when the branch adds or modifies an implementation plan, run an adversarial review against the plan's mandatory structure and any repo-declared plan-review skill. Fix every fail/warn finding and commit before pushing. Scattered equivalent bullets do not substitute for required headings.
- PR narrative quality (plan or implementation PRs): derive PR title and body from the plan's goal, scope, source artifacts, verification gates, and changed docs/code. A vague commit-summary title or body is not acceptable when the plan provides better context.
If any item fails, fix it and commit before pushing. Do not push code and leave docs for a follow-up commit.
Required verification is scope-based:
- Code, config, dependency, CI, release, or generated-artifact changes require the targeted or full test/build gates defined by repo instructions.
- Docs-only changes require document-structure and content checks only, unless they change executable examples, generated outputs, CI/release behavior, or package/tooling configuration.
- Mixed changes require every applicable gate.
Implementation Preflight Gate (Blocking)
Before any implementation action (editing files, running implementation tests, or committing), run and report preflight:
- Establish/realign the execution lock. Before Step 1, read the plan's
Expected worktreeandExpected branch. When either is a pattern, the literalset at execution, or names a branch that no longer exists — the case of a plan authored for deferred execution and then committed/merged — establish the lock against the current session's real worktree and branch instead of honoring the authored value. A pinned-but-deadExpected branchis replaced, not honored as a blocker. Record the resolved worktree and branch as the active lock for the remaining steps. A concrete, still-liveExpected branchis used as-is. - Confirm the active plan's worktree mode:
create new,reuse existing, ornone. - Verify with git commands (minimum):
git worktree list --porcelainandgit branch --show-current. - Capture current worktree path and branch.
- Emit a preflight status line:
Preflight: worktree=<path>, branch=<branch>, separate_worktree=<pass|fail>separate_worktree=passmeans the current worktree satisfies the active plan's worktree mode and branch lock. Forreuse existing, it may be an existing non-root dedicated worktree.
- If worktree mode is
create newand preflight isfail, create a new separate worktree and rerun preflight until it ispass(do not implement from the root worktree). - If worktree mode is
reuse existingand preflight isfail, stop and report the mismatch instead of creating or switching worktrees. - If any preflight item fails, no file edits are allowed.
Process Discipline Hard Gates
- Execution lock is mandatory, never advisory.
- If a plan requires a separate worktree/branch or a specific existing worktree/branch, no edits may start before preflight passes.
- Human review stops are plan-controlled. Self-review is always required; human review is required only when the active plan declares
human-review-gatedmode or the user explicitly asks for it. - User scope changes do not implicitly waive plan locks.
- If a requested action would violate a plan lock, ask one explicit override question first and proceed only after confirmation.
- Commit is forbidden while any mandatory plan gate is incomplete, unless the user explicitly approves overriding that gate.
- Immediately before commit, list gate status (
passedornot passed) for required preflight, scope verification, step closeout, and plan-tracker updates. - Do not claim completion ("done", "in full", "completed") unless all mandatory gates have passed.
- If blocked by environment (tooling, network, permissions), report blocked status and list exact unmet gates.
- If the agent detects it already violated a lock, report that violation immediately before any further action.
Plan Structure Gate (Blocking)
Implementation plans MUST follow the repo's declared mandatory plan structure when one exists. When the repo does not declare one, the following minimum sections apply:
GoalExecution modeExecution lockScope guardrails- One or more phases/tasks (
## Phase N — Nameor## Task N — Name) Done criteriaFinal closeout
Rules:
- Missing any required section is a blocking failure, not a style warning.
- Scattered equivalent bullets do not satisfy a required heading. A
Goal:line under another section is not a## Goalsection. Done criteriamust be explicit and observable, not implied by the phase list.Final closeoutmust declare archive behavior (move completed plan to the implemented directory) and push/PR behavior.- Plan-creation, plan-modification, and pre-PR adversarial review (see Pre-Push gate) all enforce this gate.
- If the repo declares a stricter structure (e.g.
docs/my-way/05-implementation-plan/structure.mdor an equivalent), the stricter list wins and every section it names becomes mandatory.
Completion Verification
After an implementation step or plan completion, verify:
- Every changed file is tied to the current step (no scope creep).
- Required verification passes for the changed scope.
- Plan tracker checkboxes match completed work.
-
git statusis clean before push. - Preflight passed before any edits (if required by plan).
- No gate was skipped without explicit user override.
- Active plan has every required section (see Plan Structure Gate).
-
Done criteriaare explicit and observable. -
Final closeoutdeclares archive behavior and push/PR behavior. - At plan completion: completed plan is moved to the implemented directory in the same change set as the implementation.