Implement one or more stories from a plan. Use when the user wants to execute stories, implement features, or mentions "implement story" or "do story" or "next story". Enforces dependency ordering - blocks stories whose prerequisites are incomplete.
Install
npx skillscat add joshuajbrunner/pi-config/implement-story Install via the SkillsCat registry.
SKILL.md
Implement Story
Implement stories from a plan while respecting dependency ordering. Tracks progress through subtasks.
Process
- Identify the plan — Ask which plan to work from, or list available plans from
docs/plans/ - Read PLAN.md — Parse the stories table and their statuses
- Identify target story — Which story does the user want to implement?
- Check dependencies — Verify prerequisite stories/phases are complete
- Read the story file — Load acceptance criteria
- Implement — Walk through each acceptance criterion, adding subtasks as you go
- Mark complete — Update story status + PLAN.md table
Dependency Rules
Phase Dependencies
- All stories in Phase N must be ✅ before starting any story in Phase N+1
- Check by reading the PLAN.md of the dependent phase
Story Dependencies (within a phase)
- Stories are ordered; earlier stories are prerequisites for later ones
- Story N.1 must be ✅ before starting N.2
Blocking Behavior
When a story is blocked:
⛔ Cannot implement Story 2.2: "Tenant Context Propagation"
Blocked by incomplete prerequisites:
- Story 2.1: "Tenant Model & RLS Isolation" (⬜ Not Started)
Complete this story first, or request it to be implemented together.Story Selection
The user can specify stories by:
- Number — "Implement story 2.1" or "Do story 3"
- Title — "Implement the tenant context story"
- Next — "Next story" (first incomplete story with satisfied dependencies)
- Phase — "Implement all Phase 2 stories" (sequential)
Implementation Flow
For each story, work through acceptance criteria incrementally. Explain reasoning behind decisions, record subtasks as you go.
Step-by-step:
- Announce — State which story and criterion you're working on
- Explain — Briefly describe the approach and any trade-offs
- Implement — Write the code, create files, run commands
- Verify — Run relevant tests or demonstrate it works
- Record subtask — Add the completed subtask to the story file
- Repeat — Move to next acceptance criterion
Adding Subtasks
As you implement, add completed subtasks to the story file's Subtasks section:
## Subtasks
- [x] Created `src/shared/infrastructure/tenant/tenant.interceptor.ts` with `SET LOCAL` logic
- [x] Installed `nestjs-cls` and registered `ClsModule` in `AppModule`
- [x] Added integration test `test/integration/tenant-isolation.int-spec.ts`
- [x] Verified cross-tenant query returns 0 rows
- [ ] Add error handling for missing tenant claim in JWTSubtasks should capture:
- What file was created/modified
- What was tested
- Any decisions made during implementation
- Any remaining work discovered
Completing a Story
When all acceptance criteria are met:
- Update story file — Set status to
✅ Done, add the commit message reference - Update PLAN.md — Change story status in the table from
⬜to✅ Done - Commit — All work for a story should be committed with a descriptive message
Story file after completion:
# Story 2.1: Tenant Model & RLS Isolation
**Status**: ✅ Done
**Commit**: `feat: add tenant model with rls isolation`
**As a** platform operator
...PLAN.md table after completion:
| # | Story | Status |
|---|-------|--------|
| 2.1 | [Tenant Model & RLS](./stories/001-tenant-model-rls.md) | ✅ Done |
| 2.2 | [Tenant Context](./stories/002-tenant-context-cls.md) | ⬜ Not Started |Listing Plans and Stories
# List available plans
ls docs/plans/
# View a specific plan's stories
cat docs/plans/002-tenant-foundation/PLAN.md
# Find incomplete stories
grep -r "⬜\|🟡" docs/plans/*/PLAN.md