- Version: 2.0
Archives completed stories with metrics, lessons learned, and reusable components.
/plugin marketplace add ninthspace/claude-code-marketplace/plugin install sdd@ninthspace-marketplacePurpose: Archive a shipped story, capture comprehensive lessons learned, extract reusable components, and update project metrics for continuous improvement.
Syntax: /sdd:story-complete <story_id>
| Parameter | Type | Required | Default | Description | Validation |
|---|---|---|---|---|---|
| story_id | string | Yes | - | Story identifier (e.g., "STORY-2025-001") | Must match pattern STORY-\d{4}-\d{3} |
/docs/stories/completed/ directory/docs/stories/qa/ - suggest running /sdd:story-ship first/docs/stories/review/ - suggest completing QA and shippingCALCULATE timeline metrics:
ANALYZE story progress log to determine:
EXTRACT quality metrics:
ASSESS business impact:
GENERATE metrics summary:
š STORY METRICS
āāāāāāāāāāāāāāāā
Timeline:
- Started: [YYYY-MM-DD]
- Completed: [YYYY-MM-DD]
- Total duration: [X] days ([Y] working days)
- Development: [X] days
- Review: [Y] days
- QA: [Z] days
Effort Breakdown:
- Planning: [X] hours
- Implementation: [Y] hours
- Testing: [Z] hours
- Review/QA: [W] hours
- Total: [TOTAL] hours
Quality Metrics:
- Commits: [count]
- Files changed: [count]
- Bugs found in review: [count]
- Bugs found in QA: [count]
- Test coverage: [X%]
- Tests added: [count]
Velocity:
- Story points (if applicable): [points]
- Actual vs estimated: [comparison]
PROMPT user for lessons learned (if not in story file):
ANALYZE story file for:
COMPILE comprehensive lessons:
š LESSONS LEARNED
āāāāāāāāāāāāāāāāāā
What Went Well:
- [Success 1: with specific details]
- [Success 2: with specific details]
- [Success 3: with specific details]
What Could Improve:
- [Improvement 1: with action items]
- [Improvement 2: with action items]
- [Improvement 3: with action items]
Surprises & Challenges:
- [Unexpected finding 1]
- [Unexpected finding 2]
Technical Insights:
- [New technique/pattern learned]
- [Library/tool discovery]
- [Architecture decision validated/challenged]
Process Improvements:
- [Workflow enhancement suggestion]
- [Tool/automation opportunity]
For Next Time:
- [ ] [Specific action item 1]
- [ ] [Specific action item 2]
- [ ] [Specific action item 3]
IDENTIFY documentation that needs updating:
EXTRACT reusable patterns from implementation:
UPDATE project context if needed:
/docs/project-context/technical-stack.md/docs/project-context/coding-standards.md/docs/project-context/development-process.mdSCAN implementation for reusable code:
IDENTIFY candidates for:
DOCUMENT reusable assets:
š§ REUSABLE COMPONENTS
āāāāāāāāāāāāāāāāāāāāā
Created:
- [Component/utility name]: [path] - [description]
- [Component/utility name]: [path] - [description]
Patterns Documented:
- [Pattern name]: [location] - [use case]
Suggested Extractions:
- [ ] [Code to extract]: [benefit]
- [ ] [Component to generalize]: [benefit]
UPDATE story file with completion data using EXACT STRUCTURE:
APPEND the following sections to the story file in this exact order:
---
## š COMPLETION METRICS
**Archived:** [YYYY-MM-DD HH:MM]
**Total Duration:** [X] calendar days ([Y] working days)
**Status:** Completed and Archived
### Timeline
- **Started:** [YYYY-MM-DD]
- **Completed:** [YYYY-MM-DD]
- **Development:** [X] days
- **Review:** [Y] days
- **QA:** [Z] days
### Effort
- **Planning:** [X] hours
- **Implementation:** [Y] hours
- **Testing:** [Z] hours
- **Review/QA:** [W] hours
- **Total:** [TOTAL] hours
### Quality
- **Commits:** [count]
- **Files Changed:** [count]
- **Tests Added:** [count]
- **Test Coverage:** [X%]
- **Bugs in Review:** [count]
- **Bugs in QA:** [count]
### Velocity
- **Story Points:** [points] (if applicable)
- **Estimated vs Actual:** [comparison]
---
## š RETROSPECTIVE
### What Went Well
- [Specific success 1 with details]
- [Specific success 2 with details]
- [Specific success 3 with details]
### What Could Improve
- [Specific improvement 1 with action]
- [Specific improvement 2 with action]
- [Specific improvement 3 with action]
### Surprises & Challenges
- [Unexpected finding 1]
- [Unexpected finding 2]
### Technical Insights
- [Technical learning 1]
- [Technical learning 2]
- [Technical learning 3]
### Process Improvements
- [Process improvement 1]
- [Process improvement 2]
### Action Items for Next Time
- [ ] [Specific action 1]
- [ ] [Specific action 2]
- [ ] [Specific action 3]
---
## š§ REUSABLE COMPONENTS
### Components Created
- **[Component Name]**: `[file path]` - [description]
- **[Component Name]**: `[file path]` - [description]
### Patterns Documented
- **[Pattern Name]**: [location] - [use case]
- **[Pattern Name]**: [location] - [use case]
### Extraction Opportunities
- [ ] **[Code to Extract]**: [benefit]
- [ ] **[Component to Generalize]**: [benefit]
---
## š IMPACT ASSESSMENT
### User Impact
[Description of how this benefits end users]
### Business Impact
[Description of business value delivered]
### Technical Impact
[Description of technical improvements or debt addressed]
### Performance Metrics (if applicable)
- [Metric 1]: [baseline] ā [achieved]
- [Metric 2]: [baseline] ā [achieved]
---
## šÆ KEY ACHIEVEMENTS
- [Major achievement 1 with specific deliverable]
- [Major achievement 2 with specific deliverable]
- [Major achievement 3 with specific deliverable]
---
## š TECHNICAL ADDITIONS
- [New capability/feature 1]
- [New pattern/approach 2]
- [Infrastructure/tooling improvement 3]
---
## š FOLLOW-UP ITEMS
### Technical Debt
- [Technical debt item 1]
- [Technical debt item 2]
### Future Enhancements
- [Enhancement opportunity 1]
- [Enhancement opportunity 2]
### Related Stories
- [Dependency or follow-up story 1]
- [Dependency or follow-up story 2]
---
**Archive Status:** ā
Complete
**Indexed:** Yes - `/docs/stories/completed/INDEX.md`
NOTES:
---) between major sectionsRENAME story file:
/docs/stories/completed/[story-id].md/docs/stories/completed/[ARCHIVED]-[story-id].mdCREATE OR UPDATE /docs/stories/completed/INDEX.md:
IF FILE DOESN'T EXIST, create with this header:
# Completed Stories Index
A chronological index of all completed and archived stories with key metrics.
## Stories
THEN ADD story entry using this EXACT format:
### [STORY-ID] - [Title]
- **Completed:** [YYYY-MM-DD]
- **Duration:** [X] days ([Y] working days)
- **Test Coverage:** [Z%]
- **Impact:** [one-line business impact summary]
- **File:** [`[ARCHIVED]-[STORY-ID].md`](./%5BARCHIVED%5D-[STORY-ID].md)
NOTES:
COMPRESS large artifacts (optional):
UPDATE project-level metrics:
CREATE OR UPDATE /docs/project-context/project-metrics.md:
IDENTIFY trends:
GENERATE comprehensive completion report:
ā
STORY COMPLETION REPORT
āāāāāāāāāāāāāāāāāāāāāāāāāā
Story: [STORY-ID] - [Title]
Archived: [YYYY-MM-DD]
SUMMARY:
Successfully delivered [description of implementation] which
[business impact and user value provided].
KEY ACHIEVEMENTS:
⢠[Achievement 1: specific deliverable]
⢠[Achievement 2: specific deliverable]
⢠[Achievement 3: specific deliverable]
TECHNICAL ADDITIONS:
⢠[New capability/feature added]
⢠[New pattern/approach implemented]
⢠[Infrastructure/tooling improvement]
QUALITY METRICS:
⢠Duration: [X] days ([Y] working days)
⢠Test coverage: [Z%]
⢠Bugs found: [review: X, qa: Y]
⢠Performance: [metrics if applicable]
TEAM LEARNINGS:
⢠[Key learning 1]
⢠[Key learning 2]
⢠[Key learning 3]
REUSABLE ASSETS:
⢠[Component/utility created]
⢠[Pattern documented]
⢠[Template created]
FOLLOW-UP ITEMS:
⢠[Technical debt to address]
⢠[Future enhancement opportunity]
⢠[Process improvement action]
IMPACT:
⢠Users: [description of user benefit]
⢠Business: [description of business value]
⢠Technical: [description of technical improvement]
DISPLAY next steps:
š” NEXT STEPS:
1. Review follow-up items for backlog
2. Share learnings with team
3. Update related documentation
4. /sdd:project-status to view remaining stories
5. /sdd:story-new to begin next story
/docs/stories/completed/[ARCHIVED]-[story-id].md - Archived story with metrics and learnings/docs/stories/completed/INDEX.md - Updated story index (created or updated)/docs/project-context/sdd:project-metrics.md - Updated project metrics (created or updated)/docs/stories/completed/ before processing/docs/stories/completed/INDEX.md with exact format specifiedINPUT:
/sdd:story-complete STORY-2025-001
PROCESS:
ā Verifying story location...
ā Found in /docs/stories/completed/STORY-2025-001.md
ā Analyzing story timeline and progress log...
ā Calculating metrics...
ā Extracting lessons learned...
ā Identifying reusable components...
OUTPUT:
ā
STORY COMPLETION REPORT
āāāāāāāāāāāāāāāāāāāāāāāāāā
Story: STORY-2025-001 - User Authentication System
Archived: 2025-03-15
SUMMARY:
Successfully delivered a complete user authentication system with
email/password login, registration, password reset, and session
management. This provides secure user access and enables all future
user-specific features.
KEY ACHIEVEMENTS:
⢠Implemented secure authentication with bcrypt hashing
⢠Added comprehensive test coverage (95% for auth components)
⢠Created reusable authentication middleware
⢠Documented authentication patterns for future features
TECHNICAL ADDITIONS:
⢠AuthMiddleware for route protection
⢠SessionManager utility for token handling
⢠Reusable LoginForm and RegistrationForm components
⢠Comprehensive authentication test suite
QUALITY METRICS:
⢠Duration: 12 days (9 working days)
⢠Test coverage: 95%
⢠Bugs found: review: 2, qa: 1
⢠Performance: Login < 200ms, avg 150ms
TEAM LEARNINGS:
⢠JWT implementation was simpler than session-based auth
⢠Browser testing caught critical edge cases missed in unit tests
⢠Early security review prevented potential vulnerabilities
⢠Test-driven approach significantly reduced bugs in QA
REUSABLE ASSETS:
⢠AuthMiddleware: app/Middleware/AuthMiddleware.php
⢠SessionManager: app/Utils/SessionManager.php
⢠Authentication test helpers: tests/Helpers/AuthHelper.php
⢠LoginForm component: resources/views/components/LoginForm.blade.php
FOLLOW-UP ITEMS:
⢠Consider adding OAuth providers (Google, GitHub)
⢠Implement 2FA in future security story
⢠Add rate limiting to prevent brute force attacks
⢠Extract auth utilities to shared package
IMPACT:
⢠Users: Secure account creation and access to personalized features
⢠Business: Foundation for user-specific features and data
⢠Technical: Established authentication pattern for all future features
š STORY METRICS
āāāāāāāāāāāāāāāā
Timeline:
- Started: 2025-03-03
- Completed: 2025-03-15
- Total duration: 12 days (9 working days)
- Development: 6 days
- Review: 2 days
- QA: 1 day
Effort Breakdown:
- Planning: 4 hours
- Implementation: 28 hours
- Testing: 12 hours
- Review/QA: 6 hours
- Total: 50 hours
Quality Metrics:
- Commits: 24
- Files changed: 18
- Bugs found in review: 2
- Bugs found in QA: 1
- Test coverage: 95%
- Tests added: 36
š LESSONS LEARNED
āāāāāāāāāāāāāāāāāā
What Went Well:
- Test-driven development caught edge cases early
- Browser testing revealed UX issues unit tests missed
- Early security review prevented auth vulnerabilities
- Modular design made testing straightforward
What Could Improve:
- Could have started with browser tests earlier
- Initial API design needed refinement during review
- Password reset flow took longer than estimated
- Documentation could have been written alongside code
Surprises & Challenges:
- JWT library had better DX than expected
- Session persistence across subdomains required extra config
- Password reset tokens needed expiration strategy
- Browser autofill behavior required special handling
Technical Insights:
- JWT significantly simpler than session-based auth for SPA
- httpOnly cookies provide better security than localStorage
- Middleware composition pattern works well for auth
- Playwright's auto-wait eliminated flaky tests
Process Improvements:
- Start browser tests earlier in development
- Document API contracts before implementation
- Include security review checklist in story template
- Create reusable test data factories upfront
For Next Time:
- [ ] Write API documentation as first step
- [ ] Create browser test scaffold when starting story
- [ ] Review security checklist during implementation
- [ ] Extract utilities earlier to improve testability
š” NEXT STEPS:
1. Review follow-up items for backlog
2. Share learnings with team
3. Update authentication documentation
4. /sdd:project-status to view remaining stories
5. /sdd:story-new to begin next story
ā Story archived: /docs/stories/completed/[ARCHIVED]-STORY-2025-001.md
ā Story index updated: /docs/stories/completed/INDEX.md
ā Project metrics updated: /docs/project-context/sdd:project-metrics.md
INPUT:
/sdd:story-complete STORY-2025-002
PROCESS:
ā Searching for STORY-2025-002...
ā Found in /docs/stories/qa/
OUTPUT:
ā Story Not Ready for Completion
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
Story: STORY-2025-002 - User Profile Management
Location: /docs/stories/qa/
The story has not been shipped to production yet.
Current Status: qa
Required Status: complete (in /docs/stories/completed/)
NEXT STEPS:
1. /sdd:story-ship STORY-2025-002 # Ship to production
2. /sdd:story-complete STORY-2025-002 # Archive after shipping
Note: Stories must be shipped before archival to ensure
all deployment data and production metrics are captured.
INPUT:
/sdd:story-complete STORY-2025-003
PROCESS:
ā Verifying story location...
ā Found in /docs/stories/completed/STORY-2025-003.md
ā Analyzing story data...
ā Lessons learned section is empty
What went well in this story? (Enter each, then empty line when done)
> Test-driven approach worked great
> Reused authentication patterns from STORY-001
> Performance exceeded expectations
>
What could be improved? (Enter each, then empty line when done)
> Initial design needed iteration
> Could have communicated progress better
>
Any technical insights gained?
> Discovered excellent caching pattern for profile data
> Learned avatar upload optimization techniques
>
ā Capturing lessons learned...
ā Generating completion report...
OUTPUT:
[Full completion report with user-provided lessons learned integrated]
/docs/stories/completed//docs/project-context/sdd:project-metrics.md with initial structure/sdd:story-ship - Ship story to production before archival/sdd:story-metrics - View project-wide metrics and trends/sdd:project-status - View all project stories and progress/sdd:story-new - Create next story to work on/docs/stories/completed/INDEX.md with exact format