mirror of
https://github.com/ruvnet/ruflo.git
synced 2026-11-24 06:06:02 +09:00
This commit brings v2.0.4 changes to main without problematic SQLite database files: ### 🗄️ SQLite Memory System - Enhanced SQLite Schema with 12 specialized tables - Persistent storage in .swarm/memory.db with WAL mode - Cross-session persistence for Claude Code sessions - Namespace support for organized memory management ### 🔧 MCP Server Integration - EnhancedMemory class extending SqliteMemoryStore - 14 Hook types for comprehensive operation tracking - Memory synchronization between CLI and MCP tools - Robust error handling and database integrity ### 📁 Project Organization - Archive legacy systems to archive/legacy-memory-system - Clean root structure for better maintainability - Updated documentation reflecting SQLite architecture ### 🔗 NPM Package Updates - Include memory JS/SQL files in distribution - MCP server files included in npm package - Version updated to 2.0.0-alpha.42 ### ⚙️ Configuration Updates - .gitignore excludes SQLite database files - .npmignore includes necessary memory components - CLI version consistency at 2.0.0-alpha.42 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
6.8 KiB
6.8 KiB
Init Command Analysis Report
Overview
This report provides a comprehensive analysis of the claude-flow init command structure, dependencies, and integration with SPARC modes.
Init Command Structure
Primary Entry Point
- Location:
/src/cli/simple-commands/init.js - Type: Re-export module
- Actual Implementation:
/src/cli/simple-commands/init/index.js
Command Flow
- init.js → Re-exports from modular structure
- init/index.js → Main init command implementation
- Handles flags:
--sparc,--minimal,--force - Creates project structure and configuration files
File Structure
Init Module Components
src/cli/simple-commands/init/
├── index.js # Main init command logic
├── help.js # Help text display
├── executable-wrapper.js # Creates local claude-flow executable
├── sparc-structure.js # SPARC environment setup
├── templates/
│ ├── claude-md.js # CLAUDE.md templates
│ ├── memory-bank-md.js # memory-bank.md templates
│ ├── coordination-md.js # coordination.md templates
│ └── readme-files.js # README templates
├── sparc/
│ ├── roomodes-config.js # .roomodes configuration
│ ├── workflows.js # Workflow templates
│ └── roo-readme.js # .roo directory README
└── claude-commands/
├── slash-commands.js # Main command creator
├── sparc-commands.js # SPARC-specific commands
└── claude-flow-commands.js # Claude-flow commands
Key Functions and Dependencies
1. Main Init Function (initCommand)
- Purpose: Initialize Claude Code integration files
- Parameters:
subArgs,flags - Key Operations:
- Parse command flags
- Check existing files
- Create project structure
- Initialize SPARC if requested
2. Directory Creation
Creates the following structure:
project/
├── CLAUDE.md # Project configuration
├── memory-bank.md # Memory documentation
├── coordination.md # Coordination guidelines
├── memory/
│ ├── agents/
│ ├── sessions/
│ └── claude-flow-data.json
├── coordination/
│ ├── memory_bank/
│ ├── subtasks/
│ └── orchestration/
└── .claude/
├── commands/
│ └── sparc/
└── logs/
3. SPARC Integration
When --sparc flag is used:
-
Attempts to run
create-sparc:npx -y create-sparc init --force -
Fallback mechanism: If create-sparc fails, uses
createSparcStructureManually() -
Creates SPARC structure:
.roomodesfile with mode configurations.roo/directory with templates and workflows- Claude slash commands in
.claude/commands/
SPARC Mode Configuration
.roomodes File
Generated from sparc/roomodes-config.js, contains:
- 9 core SPARC modes (architect, code, tdd, etc.)
- Each mode has:
slug: Identifiername: Display name with emojiroleDefinition: Purpose descriptioncustomInstructions: Specific instructionsgroups: Tool access permissionssource: "project"
Available SPARC Modes
- architect - System design and architecture
- code - Clean, efficient code writing
- tdd - Test-Driven Development
- spec-pseudocode - Requirements and pseudocode
- integration - System integration
- debug - Troubleshooting and debugging
- security-review - Security analysis
- docs-writer - Documentation creation
- swarm - Multi-agent coordination
Template System
CLAUDE.md Templates
Three variants based on flags:
- Minimal (
--minimal): Basic configuration - Full (default): Comprehensive setup
- SPARC (
--sparc): Full SPARC methodology integration
Template Sources
- CLAUDE.md: Generated from
templates/claude-md.js - memory-bank.md: From
templates/memory-bank-md.js - coordination.md: From
templates/coordination-md.js - Slash commands: From
claude-commands/sparc-commands.js
Claude Slash Commands
Command Generation Process
- Reads
.roomodesfile - Creates individual command for each mode
- Creates main
/sparccommand - Saves to
.claude/commands/directory
Command Structure
Each slash command includes:
- Mode description
- Role definition
- Custom instructions
- Available tools
- Usage examples
- Memory integration examples
Critical Dependencies
External Dependencies
create-sparcnpm package (optional, with fallback)- Deno runtime for file operations
- Node.js for command execution
Internal Dependencies
utils.jsfor console output formatting- Template modules for file content generation
- SPARC configuration modules
Key Findings
1. Modular Architecture
- Init command is well-modularized
- Clear separation of concerns
- Template-based file generation
2. SPARC Integration Points
.roomodesfile is central to SPARC functionality- Slash commands are auto-generated from mode configurations
- Fallback mechanism ensures SPARC works even without create-sparc
3. File Locations
- Templates are embedded in JavaScript modules
- No external template files
- Configuration is generated programmatically
4. Extensibility
- Easy to add new SPARC modes
- Template system allows customization
- Slash commands are dynamically generated
Modification Points for Optimization
To integrate optimized .claude prompts:
-
Modify template generators:
templates/claude-md.jsclaude-commands/sparc-commands.js
-
Update SPARC mode configurations:
sparc/roomodes-config.js
-
Enhance slash command generation:
claude-commands/slash-commands.jsclaude-commands/sparc-commands.js
-
Consider external template option:
- Add ability to load templates from files
- Allow custom template directories
Recommendations
- Template Externalization: Consider moving templates to separate files for easier maintenance
- Configuration Override: Add ability to use custom .roomodes configurations
- Template Variables: Implement a template variable system for dynamic content
- Validation: Add validation for generated files and configurations
- Backup: Create backups before overwriting existing files
Next Steps for Other Agents
- Agent 12: Should focus on modifying template generators
- Agent 13: Should work on enhancing SPARC mode configurations
- Agent 14: Should implement the optimized prompt integration
- Agent 15: Should handle testing and validation
This analysis provides the foundation for implementing optimized .claude folder prompts within the existing init command structure.