# compounding-engineering > Execute pattern search, template matching, and todo generation for faster feature development. This skill should be used when planning features, estimating effort, researching similar implementations, or creating implementation roadmaps with the /plan command. - Author: MiraclesGIT - Repository: Nissimmiracles/versatil-sdlc-framework - Version: 20251124173735 - Stars: 1 - Forks: 0 - Last Updated: 2026-02-08 - Source: https://github.com/Nissimmiracles/versatil-sdlc-framework - Web: https://mule.run/skillshub/@@Nissimmiracles/versatil-sdlc-framework~compounding-engineering:20251124173735 --- --- name: compounding-engineering description: Execute pattern search, template matching, and todo generation for faster feature development. This skill should be used when planning features, estimating effort, researching similar implementations, or creating implementation roadmaps with the /plan command. allowed-tools: - Bash - Read - Write --- # Compounding Engineering Skill **Auto-invoked during**: Feature planning, `/plan` command, effort estimation Make each feature 40% faster than the last through systematic learning and proven patterns. ## What This Skill Provides Three bash-executable services that power compounding engineering: 1. **Pattern Search** - Find similar historical features (GraphRAG/Vector stores) 2. **Template Matcher** - Match features to proven YAML templates 3. **Todo Generator** - Create dual todo system with dependency graphs **Result**: Features 2-5 are 17% → 40% faster than baseline ## When to Use Use this skill when you need to: - **Plan new features** - `/plan "Add user authentication"` - **Estimate effort** - Get historical data (±10-20% vs ±50% without) - **Research implementations** - Find similar past work - **Create todos** - Generate dual tracking system - **Avoid mistakes** - Consolidated lessons from similar features ## Quick Start ### 1. Pattern Search Find similar historical features: ```bash ! npx tsx .claude/skills/compounding-engineering/scripts/execute-pattern-search.ts \ --description "Add user authentication" \ --min-similarity 0.75 ``` **Returns**: Top 5 similar features with effort estimates, confidence scores, lessons learned **Key Feature**: GraphRAG-first routing (offline, no API quota) --- ### 2. Template Matching Match to proven templates: ```bash ! npx tsx .claude/skills/compounding-engineering/scripts/execute-template-matcher.ts \ --description "Add user authentication" ``` **5 Templates Available**: - `auth-system` - OAuth2, JWT, sessions (28h baseline) - `crud-endpoint` - REST API CRUD operations (8h) - `dashboard` - Analytics with charts (16h) - `api-integration` - Third-party APIs (12h) - `file-upload` - Secure file upload (10h) **Threshold**: 70% match score required --- ### 3. Todo Generation Create dual todo system: ```bash ! npx tsx .claude/skills/compounding-engineering/scripts/execute-todo-generator.ts \ --specs-json '[{"title":"Setup auth","priority":"p1",...}]' ``` **Generates**: - TodoWrite items (in-session tracking) - `todos/*.md` files (cross-session persistence) - Dependency graph (Mermaid) - Execution waves (parallel vs sequential) --- ## Integration with /plan Command **Automatic workflow**: ```bash /plan "Add user authentication" ↓ 1. Pattern Search → Finds 3 similar auth features (avg 27h ± 4h, 88% confidence) 2. Template Match → Matches auth-system.yaml (88% score, 28h baseline) 3. Combined Estimate → 29h ± 3h (91% confidence - WAY better than ±50%) 4. Todo Generation → Creates 6 todo files + TodoWrite items 5. Output → Confidence scores, risk assessment, execution waves ``` **Result**: Accurate estimates + historical learnings + proven patterns = 40% faster --- ## Compounding Effect **How it works**: - **Feature 1**: 100% effort (baseline, no patterns yet) - **Feature 2**: 83% effort (17% faster - learn from Feature 1) - **Feature 3**: 74% effort (26% faster - learn from 1+2) - **Feature 4**: 69% effort (31% faster) - **Feature 5**: **60% effort** (40% faster) ← **Target achieved!** **Formula**: More features implemented = More patterns stored = Faster future features --- ## Service Details For complete API documentation, examples, and troubleshooting: - **Pattern Search**: See `references/pattern-search-api.md` - Store routing chain (GraphRAG → Vector → Local) - Anti-hallucination gates (5 quality checks) - Quality scoring (0-100) - **Template Matcher**: See `references/template-matcher-api.md` - Scoring algorithm (keywords + category + name) - Template specifications (5 YAML files) - Custom templates (how to add your own) - **Todo Generator**: See `references/todo-generator-api.md` - TodoFileSpec schema - Dependency graph generation - Execution wave detection --- ## Critical Requirements 1. **GraphRAG preferred** - Always try GraphRAG first (offline, no quota) 2. **70% threshold** - Template must score ≥70% to be used 3. **Dual todo system** - Both TodoWrite + markdown files 4. **Graceful degradation** - Services return valid JSON even on failure --- ## Success Metrics - **Effort Accuracy**: ±10-20% (vs ±50% without patterns) - **Compounding Effect**: 40% faster by feature 5 - **Pattern Quality**: 95/100 average (with anti-hallucination gates) - **Time Savings**: ~10-30 hours per feature (on average) --- ## Common Use Cases **New feature planning**: ```bash /plan "Add payment processing with Stripe" # Pattern search finds similar payment integrations # Template matcher suggests api-integration template # Combined: Accurate estimate with proven approach ``` **Research similar work**: ```bash # Ask: "Have we built authentication before?" # Skill automatically triggers → Pattern search # Returns: 3 auth implementations with lessons learned ``` **Estimate effort**: ```bash # Pattern search: avg 27h (24-30h range, 95% confidence) # Template match: 28h baseline # Result: 27-29h estimate (±7% variance) ``` --- ## Error Handling All services return graceful JSON errors: ```json { "error": "GraphRAG initialization failed", "patterns": [], "search_method": "degraded", "recommended_approach": "Proceed with template-based planning" } ``` **Fallback strategy**: GraphRAG fails → Vector store → Local → Empty (never crashes) --- ## Performance - **Pattern Search**: 200-500ms (GraphRAG), 1-2s (Vector fallback) - **Template Matcher**: 50-100ms (local YAML parsing) - **Todo Generator**: 100-200ms per todo file **Total /plan overhead**: ~500ms - 2s for 40% faster development --- ## Related Skills - `rag-patterns` - Historical implementation patterns (native-sdk, victor-verifier, etc.) - `rag-query` - General RAG memory operations - Skills auto-coordinate when using `/plan` command --- ## Quick Reference **Commands**: - `/plan "feature"` - Full workflow with all 3 services - `/work todos/001-...md` - Execute generated todos **Files**: - Scripts: `.claude/skills/compounding-engineering/scripts/` - Templates: `templates/plan-templates/*.yaml` - Generated todos: `todos/*.md` **Key Insight**: Each feature makes the next one faster - compound your engineering productivity