Skip to content

Commit 5542166

Browse files
committed
docs(workflow): add PRD-first, context reset, and system evolution guidance
- Add PRD-first “north star” guidance for non-trivial work - Add context reset guidance between planning and implementation - Document system evolution loop to reduce recurring agent mistakes - Teach /init to look for extras/prd.md and extras/project-brief.md
1 parent b5b23e1 commit 5542166

2 files changed

Lines changed: 26 additions & 1 deletion

File tree

commands/init.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Initialize a new task by analyzing the project and determining the appropriate w
1616
- Scan project structure
1717
- Identify tech stack and patterns
1818
- Note existing conventions
19-
- Check for existing context files (tasks.md, active-context.md)
19+
- Check for existing context files (`extras/prd.md`, `extras/project-brief.md`, `extras/tasks.md`, `extras/active-context.md`)
2020

2121
2. **Understand the Request**
2222
- What is the user asking for?

rules/010-workflow.mdc

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,15 @@ You MUST follow this three-phase approach for all non-trivial changes:
7979
- [ ] The scope is clearly defined and agreed upon
8080
- [ ] Risks and dependencies are identified
8181

82+
### PRD-first development (North Star)
83+
84+
For non-trivial work, keep a single “north star” scope document and use it to drive small, sequential feature slices.
85+
86+
- **Recommended file**: `extras/prd.md`
87+
- **Greenfield**: Define scope, non-goals, key flows, architecture, milestones
88+
- **Brownfield**: Capture current state + next desired state + constraints
89+
- **Rule**: Break work into features small enough for the agent to execute reliably (one feature per cycle)
90+
8291
**When Planning is Required:**
8392
- Multiple files or modules affected
8493
- New features or significant refactoring
@@ -162,6 +171,14 @@ You MUST follow this three-phase approach for all non-trivial changes:
162171
4. **Stop at boundaries** - Don't fix unrelated issues or add unplanned features
163172
5. **Complete the agreed scope** - Then STOP and wait for review
164173

174+
### Context reset between Plan → Build
175+
176+
When moving from planning to implementation, prefer a fresh context window so the agent has maximum room to reason.
177+
178+
- **Rule**: After the plan is approved, restart the chat/session before coding
179+
- **Input**: Provide the approved plan doc (and only the minimum extra context needed)
180+
- **Goal**: Keep implementation context lightweight; avoid carrying long planning threads into execution
181+
165182
**Constraints:**
166183
- Implement only what was planned
167184
- Follow all coding standards from `100-core.mdc` and language-specific rules
@@ -204,6 +221,14 @@ AI: [Adds only login form as specified]
204221
5. **Identify cleanup opportunities** - Can we remove/simplify existing code?
205222
6. **Propose next steps** - What should happen next?
206223

224+
### System evolution (make the agent better over time)
225+
226+
Treat recurring mistakes as a signal to improve the system, not just the code:
227+
228+
- **If a bug recurs**: update the relevant rule(s), command(s), or reference docs so it doesn’t happen again
229+
- **If validation was missed**: update templates/commands to force the check (tests, lint, security scan)
230+
- **Capture learnings**: record patterns in `extras/reflect-*.md` (Level 3-4) and keep the guidance crisp
231+
207232
**Review Checklist:**
208233
- [ ] Changes match the agreed plan
209234
- [ ] Security considerations addressed

0 commit comments

Comments
 (0)