بنقرة واحدة
phase-start
Execute all tasks in a phase autonomously. Use after /phase-prep confirms prerequisites are met.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Execute all tasks in a phase autonomously. Use after /phase-prep confirms prerequisites are met.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Generate EXECUTION_PLAN.md and scoped AGENTS.md files for a feature. Use after /feature-technical-spec to create the task breakdown.
Generate the greenfield execution plan plus root and scoped AGENTS.md files. Use after /technical-spec to create the phased task breakdown.
Guide discovery and discussion to determine how an AI coding agent can autonomously run and verify a specific user flow end to end. Use when the user asks what would be needed to test a flow, prove an app works, create an E2E/self-test harness, make agent verification repeatable, or evaluate whether an existing test setup lets the agent verify behavior. This skill is for shaping the verification approach before implementation: read the repo's product docs and existing verification contracts, identify the real user flow and channel under test, uncover missing controllable state or external dependencies, ask focused questions, and produce a concrete agent-runnable verification plan only after the flow is understood.
Exploratory conversation before /product-spec. Asks one question at a time, runs background research for open-source/off-the-shelf alternatives, and writes DISCOVERY_NOTES.md. Use when the user has an idea but hasn't scoped it yet.
Define feature requirements (problem, users, scope, acceptance criteria) through guided Q&A and write FEATURE_SPEC.md. Use when starting a new feature.
Define technical approach (architecture, integration points, data model) for a feature through guided Q&A and write FEATURE_TECHNICAL_SPEC.md. Use after /feature-spec.
| name | phase-start |
| description | Execute all tasks in a phase autonomously. Use after /phase-prep confirms prerequisites are met. |
| argument-hint | <phase-number> [--codex] [--pause] |
| allowed-tools | Read, Write, Edit, Bash, Glob, Grep, Task, Skill, WebFetch, WebSearch |
Execute all steps and tasks in Phase $1 from EXECUTION_PLAN.md.
Copy this checklist and track progress:
Phase Start Progress:
- [ ] Parse arguments and detect execution mode
- [ ] Context detection (project root vs feature)
- [ ] Directory guard (EXECUTION_PLAN.md + AGENTS.md)
- [ ] Plan status guard (confirm this scoped directory is current)
- [ ] Context check (compact if <40% remaining)
- [ ] Codex mode prerequisites (if --codex)
- [ ] Git setup (commit dirty files, create phase branch)
- [ ] Execute tasks sequentially (test → implement → verify → commit)
- [ ] Track state in phase-state.json
- [ ] Phase completion summary
- [ ] Auto-advance to checkpoint (if conditions met)
| Argument | Required | Description |
|---|---|---|
$1 | Yes | Phase number to execute |
--codex | No | Switch to Codex execution mode (persists to settings) |
--no-codex | No | Switch to default execution mode (persists to settings) |
--pause | No | Stop after phase completes (skip auto-advance to checkpoint) |
When --codex or --no-codex is passed, update executionMode in .claude/settings.local.json before proceeding:
--codex → write "executionMode": "codex"--no-codex → write "executionMode": "default"These flags are persistent toggles, not one-time overrides. The setting survives across sessions, auto-advance, and /go resume.
When neither flag is passed, read executionMode from .claude/settings.local.json. If not set, default to "default" (Claude Code executes directly).
Default mode: Claude Code executes tasks directly using its tools.
Codex mode (--codex): Claude Code orchestrates while /codex-implement handles each task:
/codex-implement --no-commit --batch with a spec file/codex-implement provides decomposition, scoped context, safety guards, and multi-tier verificationUse --codex when:
CRITICAL: Before implementing code that integrates with external services, you MUST read the latest official documentation first.
Fetch documentation when ANY of these apply:
| Service | SDK/API Documentation |
|---|---|
| Supabase | https://supabase.com/docs/reference/javascript |
| Firebase | https://firebase.google.com/docs/reference/js |
| Stripe | https://stripe.com/docs/api |
| Auth0 | https://auth0.com/docs/api |
| Clerk | https://clerk.com/docs/references/javascript |
| Resend | https://resend.com/docs/api-reference |
| OpenAI | https://platform.openai.com/docs/api-reference |
| Anthropic | https://docs.anthropic.com/en/api |
| Trigger.dev | https://trigger.dev/docs |
For services not listed, use WebSearch: {service name} {language} SDK documentation
When implementing external service integrations:
Determine working context. Run execution commands from the scoped directory that contains the active EXECUTION_PLAN.md.
If current working directory matches pattern */features/*:
/project/features/foo → /project)If current working directory matches pattern */plans/greenfield*:
/project/plans/greenfield → /project)Otherwise:
Before starting, read these files:
Before starting, confirm the required files exist:
EXECUTION_PLAN.md exists in the current working directory
PROJECT_ROOT/AGENTS.md exists
If either is missing, STOP and tell the user to cd into their project/feature directory (the one containing EXECUTION_PLAN.md) and re-run /phase-start $1.
If plans/greenfield/EXECUTION_PLAN.md exists in the current working directory, tell the user to cd plans/greenfield and re-run /phase-start $1.
Read PROJECT_ROOT/plans/PLAN_STATUS.md if it exists.
plans/greenfield/ for greenfield
mode, or features/<name>/ for feature mode.plans/archive/ or features/archive/, STOP. Archived
plans are historical context only.Current status is not active, STOP and ask the user to choose or
reactivate a plan before execution.Current plan does not match the current scoped path, STOP. Report the
current active plan path and tell the user to run /phase-start $1 from that
directory instead.Before starting: If context is below 40% remaining, run /compact first. This ensures the full command instructions remain in context throughout execution. Compaction mid-command loses procedural instructions.
--codex flag provided)Skip this section if --codex was not provided.
See CODEX_MODE.md for detailed Codex CLI setup and configuration.
Git Workflow (Auto-Commit)
One branch per phase, one commit per task:
main
└── phase-$1 (branch)
├── task(1.1.A): Add user model ← step 1.1
├── task(1.1.B): Add user routes
├── task(1.1.C): Add user tests
├── task(1.2.A): Add auth middleware ← step 1.2 continues
├── task(1.2.B): Add login endpoint
└── task(1.3.A): Add session handling ← step 1.3 continues
Before starting the phase (once, at the beginning):
# Commit any dirty files first (preserves user work)
git add -A && git diff --cached --quiet || git commit -m "wip: uncommitted changes before phase-$1"
Verify with git status that the working tree is clean after the commit.
Check for unpushed commits before branching:
# Get current branch and check if ahead of remote
CURRENT_BRANCH=$(git branch --show-current)
UNPUSHED=$(git rev-list --count @{upstream}..HEAD 2>/dev/null || echo "no-upstream")
UNPUSHED is a number > 0:
{CURRENT_BRANCH}. Push before creating phase branch? (recommended)"git pushUNPUSHED is "no-upstream" or 0: Continue without prompting# Create phase branch from current HEAD
git checkout -b phase-$1
Verify branch creation:
git branch --show-current
If the output does not match phase-$1, the checkout failed. Check if the branch already exists (git branch --list phase-$1) and append a suffix (e.g., phase-$1-2).
After each task completion (sequential commits on same branch):
git add -A
git commit -m "task({id}): {description} [REQ-XXX]"
Verify with git status that the commit succeeded and the working tree is clean.
Requirement traceability: Check the task's Requirement: field in EXECUTION_PLAN.md.
REQ-002), include it: task(1.2.A): Add auth [REQ-002]task(1.1.A): Set up scaffoldingDo NOT push. Leave pushing to the human after manual verification at checkpoint.
Commit discipline:
task({id}): {imperative description}Task Execution (for each task)
{If --codex flag provided}
Codex Execution Mode:
See CODEX_MODE.md for full details. Summary:
/codex-implement <spec> --no-commit --batch via Skill tool/verify-task then commit (Claude Code verifies and commits){Else}
Default Execution Mode:
- [ ] → - [x]{/If}
Stuck Detection and Recovery
Track failures in .claude/phase-state.json so counters survive context compaction.
For each task, maintain a failures object in the task's state entry:
{
"consecutive": 0,
"verification_attempts": {"V-001": 2, "V-003": 1},
"last_errors": ["error msg 1", "error msg 2"]
}
consecutive, append to last_errors (keep last 3), write to phase-state.json. Read back the file to confirm valid JSON.consecutive to 0, clear last_errorsverification_attemptsRead these counters before each attempt. If ANY threshold is met, STOP and escalate to human:
| Trigger | Threshold | Check |
|---|---|---|
| Consecutive task failures | 3 tasks | failures.consecutive >= 3 |
| Same error pattern | 2 occurrences | Same error string in failures.last_errors twice |
| Verification loop | 5 attempts on same criterion | failures.verification_attempts[criterion] >= 5 |
| Test flakiness | Same test passes then fails | Detected during verification (log to last_errors) |
When stuck, report:
STUCK: Phase $1, Task {id}
─────────────────────────────
Pattern: {describe what keeps failing}
Attempts: {N}
Last 3 errors:
1. {error summary}
2. {error summary}
3. {error summary}
Possible causes:
- {hypothesis 1}
- {hypothesis 2}
Options:
1. Skip this task and continue
2. Modify acceptance criteria
3. Take a different approach: {suggestion}
4. Abort phase for manual intervention
Do not:
Blocking Issues
Context Hygiene
Maintain .claude/phase-state.json throughout execution. See STATE_TRACKING.md for JSON formats.
Key updates:
IN_PROGRESS with timestamp and execution mode. Read back phase-state.json to confirm valid JSON.COMPLETE status; reset failures.consecutive to 0. Read back phase-state.json to confirm valid JSON.failures.consecutive, append error to failures.last_errors (max 3)failures.verification_attempts[criterion_id]If .claude/phase-state.json doesn't exist, run /populate-state first to initialize it.
Do not check back until Phase $1 is complete, unless blocked or stuck.
When done, provide:
Note: Branches are not pushed automatically. After /phase-checkpoint passes, the human will review and push.
Check if auto-advance is enabled and this phase completes with no manual items.
Read .claude/settings.local.json for auto-advance configuration:
{
"autoAdvance": {
"enabled": true // default: true
}
}
If autoAdvance is not configured, use defaults (enabled: true).
Before evaluating auto-advance conditions, attempt automation on checkpoint manual items:
MANUAL, downstream dependencyMANUAL:DEFER, no dependency → enqueue to .claude/deferred-reviews.jsonAuto-advance to /phase-checkpoint $1 ONLY if ALL of these are true:
.claude/deferred-reviews.json, not blocking)--pause flag was NOT passed to this commandautoAdvance.enabled is true (or not configured, defaulting to true)Rationale: Auto-verify attempts automation before blocking. Only items
tagged (MANUAL) that genuinely require human judgment and affect downstream
work block auto-advance. Items tagged (MANUAL:DEFER) are enqueued for later
review. Items that can be verified with curl, file checks, or browser
automation do not require human presence.
Show brief notification:
AUTO-ADVANCE
============
All Phase $1 tasks complete. No truly manual verification items.
{N} checkpoint items can be auto-verified.
Proceeding to checkpoint...
Execute immediately:
/phase-checkpoint $1 using the Skill toolStop and report why:
PHASE $1 COMPLETE
=================
All tasks finished.
Cannot auto-advance because:
- {reason: e.g., "Phase has blocking manual verification items"}
Checkpoint Verification Preview:
--------------------------------
Automatable ({N} items):
- [auto] "{item}" — can verify with {method}
Blocking Manual ({N} items requiring human judgment):
- [ ] "{item}"
- Reason: {why this blocks downstream work}
{If deferred items exist:}
Deferred ({N} items queued for later review):
- "{item}" — no downstream dependency
{/If}
Next: Run /phase-checkpoint $1 when ready to verify
Ready to open a PR? Run: /create-pr