phase-gatelisted
Install: claude install-skill Kucell/cortex-agent
# Phase Gate Skill
## Goal
Enforce state machine discipline in workflows (especially `/ship`) by validating preconditions before each phase transition.
## State Machine Definitions
### /ship Workflow States
```
PLAN → EXECUTE → LINT → REVIEW → COMMIT → DONE
```
### Phase Transition Rules
| Transition | Preconditions | Validation |
|------------|---------------|------------|
| **START → PLAN** | - Task description exists<br>- Architecture constraints loaded | Check `.agent/rules/architecture-design.md` exists |
| **PLAN → EXECUTE** | - Implementation plan written<br>- File paths identified<br>- Architecture pre-audit passed | Verify plan file exists<br>Run `architecture-guard` audit |
| **EXECUTE → LINT** | - Code files written/edited<br>- No uncommitted changes in constraints | Check files exist at planned paths<br>`git status` shows modifications |
| **LINT → REVIEW** | - Linter checks passed<br>- No hardcoded secrets detected | Exit code 0 from pre-commit-check.sh<br>No security violations |
| **REVIEW → COMMIT** | - Code review completed<br>- No blocking issues (❌ Must Fix) | Review report exists<br>Parse report for blocking issues |
| **COMMIT → DONE** | - Changes committed<br>- Task progress updated | `git log -1` shows new commit<br>task-progress.md updated |
## When to Use
Invoke this skill at **every phase transition** in `/ship` workflow:
```yaml
# Example in workflows/ship.md
phases:
- name: PLAN
agent: planner
gate_check: phase-gate --from START -