Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

update replan command

Adam Eivy9429009a310f
diff --git a/.claude/commands/replan.md b/.claude/commands/replan.md
index 3bcd582627..fb851acf73 100644
--- a/.claude/commands/replan.md
+++ b/.claude/commands/replan.md
@@ -1,6 +1,6 @@
# Replan Command
-You are tasked with reviewing and updating the PLAN.md file to keep it clean, current, and action-oriented.
+You are tasked with reviewing and updating the PLAN.md file and ALL documentation to keep them clean, current, and action-oriented. You also generate new work items when the backlog is depleted.
## Your Responsibilities
@@ -8,6 +8,7 @@ You are tasked with reviewing and updating the PLAN.md file to keep it clean, cu
- Read the entire PLAN.md file
- Identify completed milestones (marked with [x]) that have detailed documentation
- Identify sections that should be moved to permanent documentation
+- Check if Next Actions section has actionable items remaining
### 2. Extract Documentation from Completed Work
For each completed milestone with substantial documentation:
@@ -21,6 +22,9 @@ For each completed milestone with substantial documentation:
- `docs/API.md` - API endpoints, schemas, WebSocket events
- `docs/PM2.md` - PM2 patterns and process management
- `docs/PORTS.md` - Port allocation and conventions
+- `docs/VERSIONING.md` - Version format, release process
+- `docs/GITHUB_ACTIONS.md` - CI/CD workflow patterns
+- `docs/CONTRIBUTING.md` - Code guidelines, git workflow
- `docs/TROUBLESHOOTING.md` - Common issues and solutions
- `docs/features/*.md` - Individual feature documentation
@@ -46,29 +50,98 @@ After:
- [x] M16: Memory System - Semantic memory with vector embeddings for CoS agent context. See [Memory System](./docs/features/memory-system.md)
```
-### 4. Update Documentation Index
+### 4. Maintain All Documentation Files
+Review and update ALL docs files to ensure accuracy:
+
+**Core Documentation:**
+- `docs/ARCHITECTURE.md` - Verify system diagrams match current implementation
+- `docs/API.md` - Ensure all endpoints are documented with current schemas
+- `docs/PM2.md` - Check PM2 patterns match ecosystem.config.cjs
+- `docs/PORTS.md` - Verify port allocations are current
+- `docs/VERSIONING.md` - Confirm version process is accurate
+- `docs/GITHUB_ACTIONS.md` - Check CI/CD workflows match .github/workflows/
+- `docs/CONTRIBUTING.md` - Verify code guidelines match CLAUDE.md
+- `docs/TROUBLESHOOTING.md` - Add any new issues discovered
+
+**Feature Documentation (`docs/features/`):**
+- Cross-reference each feature doc with its implementation
+- Update API tables if endpoints changed
+- Add new features that lack documentation
+- Remove docs for features that were removed
+
+**Maintenance Tasks:**
+1. Run `ls docs/` and `ls docs/features/` to see all doc files
+2. For each doc, check if it references current file paths
+3. Verify code examples still work
+4. Update version numbers if mentioned
+5. Ensure internal links between docs are valid
+
+### 5. Update Documentation Index
- Ensure the Documentation section in PLAN.md lists all docs files
- Add any new docs files you created
- Verify all links are correct
-### 5. Focus on Next Actions
+### 6. Focus on Next Actions
At the end of PLAN.md:
- Add a "## Next Actions" section if it doesn't exist
-- List 3-5 concrete next steps based on:
+- List 5-8 concrete next steps based on:
- Incomplete milestones
- Recent git commits
- Areas that need attention
+ - Documentation gaps
+ - Test coverage gaps
- Make these action items specific and actionable
-### 6. Commit Your Changes
+### 7. Generate New Work When Backlog is Depleted
+If the Next Actions list is nearly empty (fewer than 3 items) or all items are completed:
+
+**Discovery Methods:**
+1. **Analyze Recent Commits**: Run `git log --oneline -20` to see recent work and identify follow-up tasks
+2. **Check Test Coverage**: Look for untested or under-tested code areas
+3. **Review TODOs**: Run `grep -r "TODO\|FIXME\|HACK" server/ client/src/ --include="*.js" --include="*.jsx"` to find inline tasks
+4. **Audit Dependencies**: Check for outdated packages with `npm outdated`
+5. **Security Scan**: Identify potential security improvements
+6. **Performance Opportunities**: Look for optimization targets
+7. **UX Polish**: Identify UI/UX improvements needed
+8. **Documentation Gaps**: Find undocumented features or outdated docs
+9. **Code Quality**: Identify refactoring opportunities (duplication, complexity)
+10. **Feature Roadmap**: Review COS-GOALS.md for mission-aligned features
+
+**New Work Categories to Consider:**
+- **Technical Debt**: Code cleanup, refactoring, removing deprecated patterns
+- **Testing**: Unit tests, integration tests, E2E tests
+- **Performance**: Caching, query optimization, bundle size
+- **Security**: Input validation, auth hardening, dependency updates
+- **Accessibility**: ARIA labels, keyboard navigation, screen reader support
+- **Documentation**: API docs, user guides, architecture diagrams
+- **DevEx**: Better error messages, logging improvements, dev tooling
+- **Features**: New functionality aligned with project goals
+
+**Output Format for New Items:**
+```markdown
+## Next Actions
+
+1. **[Category] Brief Title** - Detailed description of what needs to be done and why
+2. **[Category] Brief Title** - Detailed description...
+...
+```
+
+**Prioritization:**
+- Security issues → Critical priority
+- Broken functionality → High priority
+- Technical debt → Medium priority
+- Polish/nice-to-have → Low priority
+
+### 8. Commit Your Changes
After reorganizing:
- Use `/gitup` to commit changes with a clear message like:
```
- docs: reorganize PLAN.md and extract completed work to docs
+ docs: reorganize PLAN.md and update documentation
- Moved M## documentation to docs/features/
+ - Updated docs/API.md with new endpoints
- Updated PLAN.md to focus on next actions
- - Added Next Actions section
+ - Generated new work items
```
## Guidelines
@@ -78,6 +151,8 @@ After reorganizing:
- **Be organized**: Group related content in docs files with clear headings
- **Be consistent**: Match the style and format of existing docs files
- **Be helpful**: Make it easy to find information by adding clear references
+- **Be proactive**: Always ensure there are 5+ actionable next items
+- **Be comprehensive**: Review ALL docs, not just PLAN.md
## Example Output Structure
@@ -103,11 +178,14 @@ After running `/replan`, the PLAN.md should have:
## Next Actions
-1. **Feature X**: Brief description of what needs to be done
-2. **Fix Y**: Brief description of issue to address
-3. **Improve Z**: Brief description of enhancement
-4. **Test A**: Brief description of testing needed
-5. **Deploy B**: Brief description of deployment task
+1. **[Feature] Complete M7 Templates** - Implement template management UI and app scaffolding
+2. **[Testing] Add Soul Service Tests** - Cover edge cases in soul document management
+3. **[Security] Dependency Audit** - Run npm audit and update vulnerable packages
+4. **[Docs] Update API.md** - Add missing /api/soul/* endpoints
+5. **[Performance] Optimize Memory Search** - Profile and improve BM25 index performance
+6. **[DevEx] Improve Error Messages** - Add context to validation errors in routes
+7. **[Feature] Memory Consolidation** - Implement automatic memory deduplication
+8. **[Polish] Mobile Navigation** - Fix responsive layout issues on smaller screens
```
## Notes
@@ -118,3 +196,10 @@ After running `/replan`, the PLAN.md should have:
- Create feature-specific docs in docs/features/ for complex systems
- Preserve all historical information but organize it better
- Update CLAUDE.md if any commands or conventions changed
+- Always leave the project with 5+ actionable Next Actions items
+- Review ALL docs files each time, not just those related to recent work
+- Check for broken internal links between docs
+- Ensure code examples in docs still match current implementation
+- Update version references if they've changed
+- Add new discoveries from TODOs/FIXMEs to Next Actions
+- Cross-reference COS-GOALS.md for mission-aligned work generation