| name | implement-prd |
| description | Implements a Conductor PRD (Product Requirements Document) end-to-end. Reads the PRD, implements all stories in priority order, writes tests, tracks progress, and logs learnings for the next session. Usage: /implement-prd [number] — e.g., /implement-prd 01. If no number given, auto-detects the next uncompleted PRD. |
| user_invocable | true |
Implement PRD
Implements a Conductor PRD session end-to-end: reads the PRD, implements stories, writes tests, and logs learnings for the next session.
Determine Which PRD to Implement
If the user provided a PRD number as an argument (e.g., /implement-prd 05), use that number.
If no argument was provided, auto-detect the next PRD:
- Read
tasks/prd-status.md
- Find the first unchecked PRD (
- [ ]) following the phase order
- Announce: "Next uncompleted PRD is PRD {NUMBER} — {Name}. Starting implementation."
Set {PRD_NUM} to the two-digit number (e.g., 01, 05, 11).
Step 1: Load Context (Do This First, Every Time)
Read these files IN ORDER before writing any code:
tasks/conductor-progress.md — What was built in previous sessions. Understand the current state.
tasks/codebase-patterns.md — Established patterns. You MUST follow these.
tasks/prd-status.md — What's done, what's pending. Verify dependencies are met.
prd/00-index.md — Architecture overview, dependency graph, phase ordering.
prd/{PRD_NUM}-*.md — Your PRD. Read it FULLY:
- Project Context blockquote (project summary + domain role)
- Introduction and Goals
- Architecture (schema, domain structure, flow diagrams)
- Technical Standards (MUST comply with every item)
- ALL User Stories (your work items)
- Functional Requirements (system constraints)
- Technical Considerations (gotchas)
- Dependencies (verify these PRDs are complete)
- Verification (how to prove it works at the end)
If the PRD references database schemas, also read prd/ref-database-schema.md.
If creating enums/DTOs, also read prd/ref-enums-types.md.
If creating routes/events, also read prd/ref-routes-events.md.
Step 2: Verify Dependencies
Check tasks/prd-status.md to confirm all dependency PRDs are complete. If a dependency is incomplete:
- Announce which dependency is missing
- Ask the user whether to proceed anyway or stop
Step 3: Verify Baseline
Run these commands to confirm the codebase is stable:
php artisan test --compact
If tests fail, stop and report. Don't build on a broken foundation.
Step 4: Implement Stories
Work through stories in priority order (Priority 1 first, then 2, then 3). Within the same priority, follow story number order.
For Each Story:
- Read the story's description and acceptance criteria
- Check sibling files in the target domain to match existing patterns
- Scaffold using
php artisan make:* commands when possible (pass --no-interaction)
- Implement the story, checking off each acceptance criterion
- Write Pest tests for all Actions and Controllers created
- Format: Run
vendor/bin/pint --dirty on modified PHP files
- Lint: Run
npm run lint if TypeScript files were modified
- Test: Run
php artisan test --compact to verify ALL tests pass
- Commit:
feat: {STORY_ID} - {Story Title}
- Example:
feat: EXE-001 - Execution and ExecutionLog Models
- NEVER stage files in
.conductor/ directory
- Stage only files you created/modified for this story
Technical Standards (Non-Negotiable)
PHP:
declare(strict_types=1); at the top of EVERY file
- All Actions:
final class, single public execute() method, constructor injection
- All DTOs:
final readonly class with constructor property promotion
- All ValueObjects:
final readonly class
- All methods: explicit return type declarations
- All Enums:
string backing type, TitleCase keys
- PHPDoc
@var generics for array types
- No inline comments — self-documenting code, PHPDoc only for complex types
Model::query() not DB:: facade
- ULID primary keys on all domain models
Frontend:
- All React props: explicit TypeScript types — zero
any
- All routes: Wayfinder-generated functions from
@/actions/ or @/routes/
- All forms: Inertia
useForm()
- UI components: shadcn/ui — reuse before creating new
Testing:
- Every Action: Pest feature test at
tests/Feature/{Domain}/{ActionName}Test.php
- Use model factories (check existing factory states before manual setup)
- Every Controller: feature test for all endpoints
Activate Skills When Relevant
- Working with tests? Activate
pest-testing
- Working with Inertia React pages? Activate
inertia-react-development
- Working with Tailwind CSS? Activate
tailwindcss-development
- Working with Wayfinder routes? Activate
wayfinder-development
- Working with NativePHP? Activate
nativephp-desktop
- Working with Laravel models/controllers? Activate
laravel-specialist
Step 5: Run Verification
After all stories are implemented, run EVERY item in the PRD's "Verification" section. These are end-to-end checks, not just unit tests. If any verification fails, fix it before proceeding.
Step 6: Log Progress (Critical — Don't Skip)
Update tasks/conductor-progress.md
Append an entry for EACH completed story:
## {DATE} - {STORY_ID}: {Story Title}
**PRD:** {PRD_NUM} - {PRD Name}
**Status:** Completed
### What was built
- {Brief description}
### Key decisions made
- {Architectural choices, trade-offs}
### Patterns established
- {New patterns future sessions should follow}
### Files created
- {List of key files}
### Dependencies satisfied
- {Which downstream PRD stories are now unblocked}
### Gotchas for future sessions
- {Things the next session should know}
---
Update tasks/codebase-patterns.md
Add any NEW patterns discovered during this session to the "Patterns Discovered During Implementation" section. Only add patterns that are general and reusable, not story-specific.
Update tasks/prd-status.md
Mark each completed story with [x]. If the entire PRD is done, mark the PRD-level checkbox too.
Step 7: Final Summary
After completing all stories and logging progress, provide a summary:
- Stories completed: {count}/{total}
- Tests written: {count}
- Key files created: {list}
- Patterns established: {list}
- Next PRD(s) unblocked: {list with numbers}
- Any issues or warnings for the next session