This guide provides detailed techniques for iterating on implementation plans using structured markdown documentation, as referenced in the Planned Implementation pattern.
Effective plan iteration requires structured refinement cycles using markdown documentation. This approach enables systematic improvement of implementation plans through stakeholder feedback and iterative enhancement.
Start with a simple, structured markdown document that captures the essential elements:
# Feature: User Authentication
## Initial Plan (Draft 1)
- Add login endpoint
- Store user sessions
- Add logout functionalityKey Principles for Initial Plans:
- Keep structure simple and scannable
- Focus on major components/endpoints
- Avoid implementation details in first draft
- Use consistent markdown formatting
Share the initial plan with team members and gather structured feedback:
# Share initial plan with team, gather feedback
ai "Review this authentication plan for security gaps and suggest improvements:
[paste initial plan]
Focus on:
- Security best practices
- Integration with existing systems
- Performance considerations
- Testing strategy"Review Guidelines:
- Include specific review criteria in prompts
- Focus on one concern area per review cycle
- Document feedback sources and rationale
- Set clear expectations for review depth
Incorporate feedback to create enhanced plan versions:
# Feature: User Authentication
## Refined Plan (Draft 2)
### Security Considerations (Added from review)
- JWT with refresh tokens for session management
- Rate limiting on login attempts (5 attempts/minute/IP)
- Password hashing with bcrypt (cost factor 12)
### API Design (Enhanced)
- POST /auth/login (returns access + refresh tokens)
- POST /auth/refresh (extends session)
- POST /auth/logout (revokes tokens)
### Integration Points (New section)
- Existing user table schema compatibility
- Current session middleware replacement strategy
- Gradual migration plan for existing sessions
### Performance Requirements (Added)
- Login response time: <200ms
- Token validation: <50ms
- Support for 1000 concurrent loginsEnhancement Best Practices:
- Add sections rather than completely rewriting
- Maintain version history in git
- Include specific metrics and thresholds
- Document architectural decisions and trade-offs
Validate the refined plan before moving to implementation:
# Final validation before coding
ai "Validate this refined plan for implementation readiness:
[paste refined plan]
Check:
- All acceptance criteria are testable
- Dependencies are clearly identified
- Rollback strategy is defined
- Time estimates are realistic
- Security requirements are comprehensive"Readiness Criteria:
- Every feature has clear acceptance criteria
- All dependencies are identified and available
- Implementation can be broken into <8 hour tasks
- Rollback procedures are documented
- Performance targets are measurable
# Track plan evolution in git
git add auth-implementation-plan.md
git commit -m "docs: initial authentication plan (draft 1)"
# After stakeholder review
git add auth-implementation-plan.md
git commit -m "docs: enhance auth plan with security requirements (draft 2)"
# Final version before implementation
git add auth-implementation-plan.md
git commit -m "docs: finalize auth implementation plan (ready for development)"- 2-3 iteration cycles maximum: Avoid over-planning
- 24-48 hours between iterations: Allow time for thoughtful review
- Stakeholder sign-off: Get explicit approval before implementation
- Plan-to-code traceability: Reference plan sections in implementation commits
- Assign specific reviewers: Security, architecture, operations perspectives
- Set review deadlines: Prevent planning paralysis
- Document decisions: Capture rationale for plan changes
- Communicate changes: Share plan updates with all stakeholders
# Start interactive session and use plan mode for iterative refinement
claude
# Then in the session:
# > /plan
# > "Create authentication implementation plan for SaaS application"
# > "Enhance this plan with security and performance considerations"
# > "Check this plan for implementation readiness"
# > /exitplan
# Or use single-prompt mode for non-interactive planning
claude -p "Create an authentication implementation plan for a SaaS application"# Use Cmd+L chat with context references for planning
# "Plan authentication implementation with JWT and session migration" @codebase
# Use @docs for context-aware refinement
# "Refine authentication plan considering existing architecture" @docs
# Validate before implementation
# "Review plan readiness for authentication implementation" @codebase @docs- Use the markdown templates as structured prompts
- Break planning into focused sessions (problem → approach → details)
- Maintain consistent formatting across tools
- Save plan versions for comparison and rollback
# User Dashboard Feature
## Components
- User profile display
- Activity timeline
- Settings panel# User Dashboard Feature
## Components
- User profile display (avatar, name, email, role)
- Activity timeline (last 30 days, paginated)
- Settings panel (preferences, notifications, security)
## Technical Requirements
- Mobile responsive design
- <2 second load time
- Real-time activity updates
## API Endpoints
- GET /api/user/profile
- GET /api/user/activity?page=1&limit=20
- PUT /api/user/settings# User Dashboard Feature
## Components
- User profile display (avatar, name, email, role)
- Avatar upload with 2MB size limit
- Role-based visibility controls
- Activity timeline (last 30 days, paginated)
- WebSocket for real-time updates
- Infinite scroll with 20 items per page
- Settings panel (preferences, notifications, security)
- Form validation with real-time feedback
- Two-factor authentication toggle
## Technical Requirements
- Mobile responsive design (320px minimum width)
- <2 second load time (measured at P95)
- Real-time activity updates via WebSocket
- Progressive loading for large activity histories
## API Endpoints
- GET /api/user/profile (includes avatar URL, permissions)
- GET /api/user/activity?page=1&limit=20 (returns total count)
- PUT /api/user/settings (validates before save)
- WebSocket /ws/activity (real-time updates)
## Security Considerations
- Avatar uploads scanned for malware
- Activity data filtered by user permissions
- Settings changes require password confirmation
- Rate limiting on API endpoints (100 requests/minute)
## Testing Strategy
- Unit tests: Component rendering and API logic
- Integration tests: Full dashboard workflow
- Performance tests: Load time with 1000+ activities
- Security tests: Permission boundary validationThis complete iteration demonstrates how structured markdown planning evolves from simple concepts to implementation-ready specifications through systematic refinement cycles.