---
type: agent/information
requires-workflow: true
description: Workflow phase tracking policy
instruction: Follow this policy exactly. If {{workflow.file}} missing, create it and enter discussion phase.
---
{{h1}}Workflow Phases and Tracking

{{h2}}File Format
Development phases are tracked in {{workflow.file}}
```yaml
phase: [{{#workflow.phases}}{{value}}{{^last}}|{{/last}}{{/workflow.phases}}]
issue: <current-issue>
tracking: <tracker> <tracker-id>
description: <optional-context>
queue:
  - <queued-issues>
```

{{h2}}Core Rules
- Missing `.guide.yaml` = assume `phase: discussion`
- Missing issue = request from user
- Phase changes MUST update file
- Issue format: openspec ID or relative path

{{h2}}MCP Communication Protocol
{{b}}CRITICAL{{b}}: After ANY change to `{{workflow.file}}`:
1. Update the file with the new content
2. {{b}}IMMEDIATELY{{b}} call `send_file_content` with the complete updated content
3. The MCP cannot detect file changes automatically - you MUST notify it on every change
4. On phase transitions the MCP will respond with phase-specific instructions and restrictions
5. Never assume the MCP knows about file changes unless you explicitly send them

{{h2}}Phase Transitions

{{#workflow.discussion}}
{{h3}}Discussion Phase
- Default when no `{{workflow.file}}` exists - discussion mode
- Can modify: `{{workflow.file}}`, `openspec/`, `.todo/`
- Cannot modify: production code, tests
{{#workflow.consent.discussion.exit}}
- {{b}}EXPLICIT CONSENT OR REQUEST REQUIRED{{b}} before transition from discussion phase.
{{/workflow.consent.discussion.exit}}
{{/workflow.discussion}}

{{#workflow.planning}}
{{h3}}Planning Phase
{{#workflow.consent.planning.entry}}
- {{b}}EXPLICIT CONSENT OR REQUEST REQUIRED{{b}} before entering planning phase.
{{/workflow.consent.planning.entry}}
- Auto-transition when plan drafted
- Can modify: `{{workflow.file}}`, `openspec/`, `.todo/`
- Cannot modify: production code, tests
{{#workflow.consent.planning.exit}}
- {{b}}EXPLICIT CONSENT OR REQUEST REQUIRED{{b}} before transition from planning phase.
{{/workflow.consent.planning.exit}}
{{/workflow.planning}}

{{#workflow.implementation}}
{{h3}}Implementation Phase
{{#workflow.consent.implementation.entry}}
- {{b}}EXPLICIT CONSENT OR REQUEST REQUIRED{{b}} before entering implementation phase.
{{/workflow.consent.implementation.entry}}
- Can modify: all files including production code, tests
{{#workflow.consent.implementation.exit}}
- {{b}}EXPLICIT CONSENT OR REQUEST REQUIRED{{b}} before transition from implementation phase.
{{/workflow.consent.implementation.exit}}
{{/workflow.implementation}}

{{#workflow.check}}
{{h3}}Check Phase
{{#workflow.consent.check.entry}}
- {{b}}EXPLICIT CONSENT OR REQUEST REQUIRED{{b}} before entering check phase.
{{/workflow.consent.check.entry}}
{{^workflow.consent.check.entry}}
- Auto-transition when implementation complete
{{/workflow.consent.check.entry}}
- Run all tests and code quality checks across ALL files
- Can modify: all files
{{#workflow.consent.check.exit}}
- {{b}}EXPLICIT CONSENT OR REQUEST REQUIRED{{b}} before transition from check phase.
{{/workflow.consent.check.exit}}
{{/workflow.check}}

{{#workflow.review}}
{{h3}}Review Phase
{{#workflow.consent.review.entry}}
- {{b}}EXPLICIT CONSENT OR REQUEST REQUIRED{{b}} before entering review phase.
{{/workflow.consent.review.entry}}
{{^workflow.consent.review.entry}}
- Auto-transition when all tests and code quality checks pass.
{{/workflow.consent.review.entry}}
- Feedback and final review stage
{{#workflow.consent.review.exit}}
- {{b}}EXPLICIT CONSENT OR REQUEST REQUIRED{{b}} before transition from review phase.
{{/workflow.consent.review.exit}}
{{/workflow.review}}

{{h2}}Queue Management
- On transition to discussion phase confirm that the current issue can be marked completed.
  - YES: remove issue, and fetch top issue from queue (if one exists)
  - NO: retain issue
- Urgent issue → current issue moves to top of queue
- Queue is usually processed in priority order
