TL;DR:
.agents/plans/ structure (todo → in-progress → completed) creates accountability📖 Quick Start
- Who it’s for: Developers tackling multi-file or complex features
- Time to complete: 25-40 minutes to learn + practice
- Prerequisites: Understanding of power patterns
- Expected outcome: Planning workflow that prevents rewrites
- Next step: Apply to your next complex feature
You: “Add user authentication to the app”
Agent: Immediately starts editing files
30 minutes later:
What went wrong? The agent jumped straight to implementation without:
The fix: Plan first, code second.
flowchart LR
Todo[📝 todo/<br/>new-feature.md] --> Review{Oracle<br/>Review}
Review -->|Simplify| Todo
Review -->|Approved| Progress[🚧 in-progress/<br/>new-feature.md]
Progress --> Code[Agent<br/>Implements]
Code --> Update[Update<br/>Progress]
Update --> Done{Success<br/>Criteria?}
Done -->|No| Code
Done -->|Yes| Complete[✅ completed/<br/>new-feature.md]
Before any code changes, create a plan file:
.agents/plans/todo/add-user-auth.md
What belongs in a plan:
Example plan structure:
# Add User Authentication
## Goal
Implement JWT-based authentication for API endpoints.
## Current State
- No auth system exists
- API endpoints are public
- User model exists in database
## Scope
**In scope:**
- JWT token generation/validation
- Login endpoint
- Protected route middleware
- Basic tests
**Out of scope (for now):**
- OAuth providers
- Password reset flow
- Email verification
- Rate limiting
## Steps
1. Research existing auth patterns in codebase
2. Add JWT library dependency
3. Create auth middleware
4. Implement login endpoint
5. Protect existing routes
6. Add tests
7. Update API documentation
## Success Criteria
- [ ] User can login with username/password
- [ ] Protected endpoints return 401 without token
- [ ] Protected endpoints work with valid token
- [ ] Tests pass
- [ ] Build succeeds
## Implementation Notes
- Use existing User model, don't create new tables
- Store JWT secret in environment variables
- Token expiry: 24 hours
- Test with curl before writing integration tests
Before starting work, ask Oracle to review the plan:
🔨 Try It Now: Oracle Plan Review
Task: Get Oracle feedback before coding
Prompt:
Oracle: review the plan in .agents/plans/todo/[your-feature].md Focus on: 1. Is the scope minimal or over-engineered? 2. Are there simpler approaches I'm missing? 3. What should be deferred to later? 4. Are the steps in the right order? Suggest a simplified version with core functionality only.Verification:
- Oracle provides specific simplification suggestions
- Identifies at least one thing to defer
- Confirms dependencies and ordering
Expected outcome: Plan is 30-50% simpler, focused on core value, ready to execute.
Oracle catches:
Oracle suggests:
Once plan is solid:
mv .agents/plans/todo/add-user-auth.md .agents/plans/in-progress/
This signals:
Start a fresh thread with plan attached:
🔨 Try It Now: Mission Repeat-Back
Task: Ensure agent understands the plan before coding
Prompt:
Read the plan in @.agents/plans/in-progress/[feature].md Before writing any code, repeat back to me: 1. The core goal in one sentence 2. The first 3 steps you'll take 3. What success looks like 4. What's explicitly out of scope Then proceed with implementation.Verification:
- Agent summarizes correctly before coding
- Implementation follows the plan steps
- Agent updates plan with ✅ after each step
Expected outcome: No wasted work on wrong approach, plan stays in sync with reality.
Agent behavior changes:
As work progresses, agent updates the plan:
## Steps
1. ✅ Research existing auth patterns in codebase
- Found SessionManager pattern in /auth
- Can reuse token validation helpers
2. ✅ Add JWT library dependency
- Added jsonwebtoken@9.0.2
3. 🚧 Create auth middleware
- In progress, using existing pattern
4. ⏸️ Implement login endpoint
...
Benefits:
When all success criteria are met:
mv .agents/plans/in-progress/add-user-auth.md .agents/plans/completed/
Update plan with results:
## Results
- Completed in 2 hours
- All tests passing
- Zero TypeScript errors
- API endpoints protected
- Documentation updated
## Learnings
- Reusing SessionManager saved 1 hour
- Middleware pattern was clearer than decorators
- Testing with curl caught token expiry bug early
## Follow-up Tasks
- Add OAuth providers (new plan)
- Implement password reset (new plan)
- Add rate limiting (new plan)
Without plan:
Agent tries approach A → fails
Agent tries approach B → fails
Agent tries approach C → partially works
Agent rewrites everything → breaks other things
With plan:
Oracle reviews → suggests proven approach
Agent follows plan → works first time
Plans make scope explicit. When agent suggests “while we’re here, let’s also add…”—the plan says “out of scope.”
Each step is a checkpoint. If something breaks, you know exactly where:
1. ✅ Add dependency
2. ✅ Create middleware
3. ❌ Implement login endpoint ← broke here
Clear plans enable multiple agents:
Agent 1: .agents/plans/in-progress/add-auth.md
Agent 2: .agents/plans/in-progress/add-logging.md
Agent 3: .agents/plans/in-progress/fix-tests.md
Independent plans = no conflicts.
Completed plans document:
Future work references past plans.
Skip the plan for:
Always plan for:
Rule of thumb: If you can’t describe success in one sentence, write a plan.
Bad:
Step 1: Import jwt library on line 3 of auth.ts
Step 2: Create function validateToken with parameters...
Good:
Step 1: Create auth middleware using jwt library
Step 2: Add token validation helper
Plans guide direction, not dictate every keystroke.
Bad:
## Steps
1. Add authentication
2. Add tests
Good:
## Success Criteria
- [ ] User can login with username/password
- [ ] Invalid credentials return 401
- [ ] Protected endpoints require valid token
- [ ] npm test passes
- [ ] npm run build succeeds
Success criteria tell you when to stop.
You write a plan, skip Oracle review, agent codes for an hour, then Oracle points out a 5-minute alternative.
Always: Oracle reviews plans before coding starts.
Plan becomes stale, agent improvises, chaos returns.
Fix: Agent updates plan after each major step.
# [Feature Name]
## Goal
[What and why]
## Current State
[What exists]
## Scope
**In scope:**
- [Thing 1]
- [Thing 2]
**Out of scope:**
- [Thing 3]
- [Thing 4]
## Steps
1. [Step 1]
2. [Step 2]
## Success Criteria
- [ ] [Criterion 1]
- [ ] [Criterion 2]
## Implementation Notes
[Key principles, pitfalls, testing]
# Fix: [Bug Description]
## Problem
[What's broken]
## Root Cause
[Why it's broken]
## Solution Approach
[How to fix]
## Steps
1. [Step 1]
2. [Step 2]
## Verification
- [ ] [Test case 1]
- [ ] [Test case 2]
- [ ] [Regression tests pass]
# Refactor: [What]
## Current State
[How it works now]
## Problems
- [Problem 1]
- [Problem 2]
## Target State
[How it should work]
## Migration Strategy
[How to get there safely]
## Success Criteria
- [ ] [Functionality unchanged]
- [ ] [Tests pass]
- [ ] [Performance improved]
Your workflow becomes:
.agents/plans/todo/.agents/plans/in-progress/.agents/plans/completed/Time investment:
Quality improvement:
Without planning:
With planning:
# Add Blog Posts About Agent Workflows
## Goal
Publish 4 posts about agent best practices
## Steps
1. Create post files with frontmatter
2. Set draft: false
3. Test build locally
4. Verify posts appear on /posts page
5. Commit and push
## Success Criteria
- [ ] npm run build succeeds
- [ ] All 4 posts visible at http://localhost:4321/posts
- [ ] Frontmatter valid
- [ ] Published to production
Result: Done in 15 minutes, zero issues.
.agents/plans/ structure — todo → in-progress → completedYou’ve completed the practice path! Now apply these patterns to your daily work.
Practice Path:
Related:
Standalone:
Challenge: Try it on your next feature. Create a plan, get Oracle review, then code. You’ll never go back.