UNPKG

claude-flow-depth

Version:

DEPTH Methodology Installer - Ousterhout-First Development for Claude Code

182 lines (144 loc) • 5.92 kB
# claude-flow-depth šŸŽÆ **DEPTH Methodology Installer for Claude Code** An npm package that initializes new projects with the DEPTH (Design-Twice, Eliminate complexity, Pull complexity down, Trade-off documentation, Hide implementation) methodology - an Ousterhout-first development approach. ## šŸš€ Quick Start ### Global Installation ```bash npm install -g claude-flow-depth@alpha ``` ### Initialize New Project ```bash # Interactive setup npx claude-flow-depth@alpha init my-project # Quick setup with defaults npx claude-flow-depth@alpha init my-project --yes # Force overwrite existing directory npx claude-flow-depth@alpha init my-project --force # With MCP integration npx claude-flow-depth@alpha init my-project \ --frontend-mcp https://your-project.supabase.co/functions/v1/frontend-mcp \ --backend-mcp https://your-project.supabase.co/functions/v1/backend-mcp \ --api-key your-supabase-key ``` ### Test MCP Connections ```bash npx claude-flow-depth@alpha test-mcp \ --frontend https://your-project.supabase.co/functions/v1/frontend-mcp \ --backend https://your-project.supabase.co/functions/v1/backend-mcp \ --api-key your-api-key ``` ## šŸŽÆ What Gets Installed ### Project Structure ``` my-project/ ā”œā”€ā”€ .depth # Global DEPTH configuration ā”œā”€ā”€ .depthmodes # Phase-specific settings ā”œā”€ā”€ .claude/ │ ā”œā”€ā”€ commands/depth/ # DEPTH methodology commands │ └── settings.json # Claude Code + MCP configuration ā”œā”€ā”€ depth-sessions/ # Session history ā”œā”€ā”€ depth-reports/ # Generated reports ā”œā”€ā”€ depth-memory/ # Persistent memory ā”œā”€ā”€ examples/ # Sample DEPTH workflows ā”œā”€ā”€ docs/ # Methodology guides ā”œā”€ā”€ CLAUDE.md # Project overview └── package.json # Pre-configured scripts ``` ### DEPTH Commands Available ```bash /depth orchestrator "Build feature" # Complete methodology /depth design-twice "Create API" # Design alternatives /depth interface-simplify "Optimize API" # Interface optimization /depth complexity-allocate "Design modules" # Complexity distribution /depth strategic-invest "Plan improvements" # Strategic planning /depth implementation-hide "Generate code" # Code generation ``` ### Quality Gates Enforced - āœ… **Module Depth Ratio** > 0.6 (deep modules) - āœ… **Interface Complexity** < 0.4 (simple interfaces) - āœ… **Strategic Investment** 10-20% (Ousterhout's rule) - āœ… **Information Hiding** > 80% (encapsulation) ## šŸ”§ CLI Options ### `init` Command ```bash npx claude-flow-depth init [directory] [options] Options: -f, --force Force overwrite existing directory -y, --yes Skip prompts, use defaults --frontend-mcp <url> Frontend MCP URL --backend-mcp <url> Backend MCP URL --api-key <key> Supabase API key ``` ### `test-mcp` Command ```bash npx claude-flow-depth test-mcp [options] Options: --frontend <url> Frontend MCP URL to test --backend <url> Backend MCP URL to test --api-key <key> API key for authentication ``` ## šŸŽ“ DEPTH Methodology ### What is DEPTH? **D**esign-Twice • **E**liminate complexity • **P**ull complexity down • **T**rade-off documentation • **H**ide implementation DEPTH follows John Ousterhout's principles from "A Philosophy of Software Design" to create maintainable, scalable software. ### Methodology Phases 1. **Design-Twice**: Create two design alternatives, choose the superior approach 2. **Interface-Simplification**: Minimize cognitive load while maintaining functionality 3. **Complexity-Allocation**: Push complexity into modules, away from interfaces 4. **Strategic-Investment**: Enforce 10-20% time on long-term improvements 5. **Implementation-Hiding**: Generate well-commented code with maximum encapsulation ### vs Other Methodologies - **SPARC**: Context-first, rapid iteration, pattern-based - **DEPTH**: Design-first, strategic thinking, principle-based - **Agile**: Sprint-focused, adaptive, team-based ## šŸ”— MCP Integration DEPTH automatically integrates with: - **Frontend MCP**: Pattern recommendations, best practices - **Backend MCP**: Architecture guidance, system design - **Claude Flow Swarm**: Parallel execution, coordination ### Pre-configured MCP Endpoints The installer comes pre-configured with working MCP endpoints: ``` Frontend: https://plwgqygbzreiogubsaui.supabase.co/functions/v1/frontend-mcp Backend: https://plwgqygbzreiogubsaui.supabase.co/functions/v1/backend-mcp ``` ## šŸ“Š Session Tracking DEPTH automatically tracks: - **Quality Metrics**: Module depth, interface complexity, strategic investment - **Phase Progress**: Completion status, quality gate validation - **Decisions**: Design choices and rationale documentation - **Reports**: Comprehensive session summaries ## šŸ¤ Development ### Build from Source ```bash git clone https://github.com/your-username/claude-flow-depth.git cd claude-flow-depth npm install npm run build npm link ``` ### Test Locally ```bash npm run dev init test-project --yes ``` ## šŸ“„ License MIT License - see LICENSE file for details. ## 🌟 Examples ### Initialize Todo App with DEPTH ```bash npx claude-flow-depth@alpha init todo-app-depth --yes cd todo-app-depth # Open in Claude Code /depth orchestrator "Build todo application with CRUD operations" ``` ### Initialize E-commerce API ```bash npx claude-flow-depth@alpha init ecommerce-api \ --frontend-mcp https://your-project.supabase.co/functions/v1/frontend-mcp \ --backend-mcp https://your-project.supabase.co/functions/v1/backend-mcp cd ecommerce-api /depth design-twice "Design product catalog API" ``` --- Built with ā¤ļø using the DEPTH Methodology *Ousterhout-first development for Claude Code*