Agent skill
phase-running
Execute individual plan phases as background sub-agents for context-efficient implementation.
Install this agent skill to your Project
npx add-skill https://github.com/desplega-ai/ai-toolbox/tree/main/cc-plugin/base/skills/phase-running
SKILL.md
Phase Running
You are executing a single phase of an implementation plan as an atomic background sub-agent. You work autonomously to completion and report results — you do NOT interact with the user.
Execution Model
This skill is designed to run inside a background Agent (sub-agent), NOT in the main session. The implementing skill (or user) spawns it via the Agent tool with run_in_background: true.
The phase agent receives:
- Plan path: Full path to the plan file
- Phase number: Which phase to execute
- Relevant context: Any additional context from the caller
When to Use
This skill activates when:
- The implementing skill spawns a phase agent (default execution mode)
- User invokes
/run-phasecommand for manual phase execution - Another skill references
desplega:phase-running
Autonomy
Phase agents always run as Autopilot within the sub-agent. The calling context (implementing skill or user) controls the outer autonomy and handles human checkpoints.
CRITICAL: Phase agents do NOT use AskUserQuestion. If something is ambiguous, report blocked status with details. The caller handles all user interaction.
Process Steps
Step 1: Load Context
- Read the full plan file
- Extract the specific phase to execute (by phase number)
- Read all files mentioned in the phase's "Changes Required" section
- Understand the phase's success criteria
Step 2: Pre-flight Check
Verify before executing:
| Check | Action if failed |
|---|---|
| Previous phases completed | Check that prior phases' automated verification items are checked. If not, report blocked |
| No merge conflicts | Check target files for conflict markers. If found, report blocked |
| Phase dependencies met | Verify files/directories from previous phases exist. If missing, report blocked |
Step 3: Execute Phase
Implement all changes described in the phase:
- Follow the plan's instructions precisely
- Create/edit files as specified in "Changes Required"
- Adapt to minor mismatches (file paths moved, code slightly different) without blocking
- For significant mismatches, report
blockedwith details
Step 4: Run Verification
Execute the automated verification commands from the phase's "Success Criteria" section:
- Run each command listed under "Automated Verification"
- Record pass/fail for each
- If a check fails, attempt to fix the issue and re-run
- If a check continues to fail after one fix attempt, include it in the report
- If the phase has a
### QA Spec (optional):section:- If the QA approach is
cli-verification, execute the test steps and record results - If the approach is
browser-automationormanual, reportQA: pending— the caller handles these - If no QA spec exists, report
QA: n/a
- If the QA approach is
Step 5: Update Plan
- Check off (
- [x]) automated verification items that passed - Do NOT check off manual verification items — those require human confirmation
- Update the plan's
last_updatedandlast_updated_byfrontmatter fields
Learning Capture
OPTIONAL SUB-SKILL: If significant learnings emerged during this phase, note them in the phase completion report for the parent session to capture via /learning capture.
Step 6: Report Results
The agent's return message MUST include:
If completed:
Status: completed
Phase: [N] - [Phase name]
Files changed: [list of files created/modified]
Automated checks: [N/M passed]
- [x] [Check 1] — passed
- [x] [Check 2] — passed
QA: passed | pending | n/a
Manual verification needed:
- [ ] [Manual check 1]
- [ ] [Manual check 2]
If blocked:
Status: blocked
Phase: [N] - [Phase name]
Reason: [Clear description of what's blocking]
Partial progress: [What was completed before blocking]
QA status: [status at time of block]
Suggested action: [How the caller/user can unblock]
If failed:
Status: failed
Phase: [N] - [Phase name]
Error: [Error details]
Partial progress: [What was completed before failure]
QA status: [status at time of failure]
Files modified: [List of files that were changed before failure]
Atomicity Contract
Phase agents are atomic — they run to completion or stop:
- No interactive questions (no AskUserQuestion)
- No partial states left unexplained
- If blocked or failed, the report includes enough detail for the caller to decide next steps
- All file changes are documented in the report
Context Handoff Pattern
| Direction | Data |
|---|---|
| Caller → Phase Agent | Plan path + phase number + autonomy mode |
| Phase Agent reads | Plan file + all source files referenced in the phase |
| Phase Agent → Caller | Status + changed files + verification results |
| Caller handles | Manual verification, cross-phase coordination, human checkpoints |
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
wts-expert
Git worktree management expert for @desplega.ai/wts. Use when the user asks about git worktrees, wts commands, worktree workflows, or wants help managing multiple branches simultaneously.
oapi-expert
OpenAPI CLI expert for @desplega.ai/oapi. Use when users want to register OpenAPI specs, execute API requests, manage auth profiles, explore API endpoints, or work with REST APIs from the terminal.
brainstorming
Interactive exploration of ideas through Socratic Q&A. Produces progressive documents that serve as lightweight pre-PRDs feeding into research.
tdd-planning
TDD-focused implementation planning. Creates plans with strict Red-Green-Commit/Rollback cycles for each step.
planning
Implementation planning skill. Creates detailed technical plans through interactive research and iteration.
reviewing
Structured critique of research, plan, and brainstorm documents for completeness, gaps, and quality.
Didn't find tool you were looking for?