Integrated project management system with documentation, language initialization, and template optimization modules
Core Modules:
Quick Start:
# Complete project initialization
from moai_menu_project import MoaiMenuProject
project = MoaiMenuProject("./my-project")
result = project.initialize_complete_project(
language="en",
user_name="Developer Name",
domains=["backend", "frontend"],
project_type="web_application"
)
Key Features:
DocumentationManager:
LanguageInitializer:
TemplateOptimizer:
Complete Project Initialization:
# Step 1: Initialize integrated system
project = MoaiMenuProject("/path/to/project")
# Step 2: Complete setup with all modules
result = project.initialize_complete_project(
language="ko", # Korean language support
user_name="",
domains=["backend", "frontend", "mobile"],
project_type="web_application",
optimization_enabled=True
)
# Result includes:
# - Language configuration with token cost analysis
# - Documentation structure creation
# - Template analysis and optimization
# - Multilingual documentation setup
Documentation Generation from SPEC:
# SPEC data for feature documentation
spec_data = {
"id": "SPEC-001",
"title": "User Authentication System",
"description": "Implement secure authentication with JWT",
"requirements": [
"User registration with email verification",
"JWT token generation and validation",
"Password reset functionality"
],
"status": "Planned",
"priority": "High",
"api_endpoints": [
{
"path": "/api/auth/login",
"method": "POST",
"description": "User login endpoint"
}
]
}
# Generate comprehensive documentation
docs_result = project.generate_documentation_from_spec(spec_data)
# Results include:
# - Feature documentation with requirements
# - API documentation with endpoint details
# - Updated project documentation files
# - Multilingual versions if configured
Template Performance Optimization:
# Analyze current templates
analysis = project.template_optimizer.analyze_project_templates()
# Apply optimizations with backup
optimization_options = {
"backup_first": True,
"apply_size_optimizations": True,
"apply_performance_optimizations": True,
"apply_complexity_optimizations": True,
"preserve_functionality": True
}
optimization_result = project.optimize_project_templates(optimization_options)
# Results include:
# - Size reduction percentage
# - Performance improvement metrics
# - Backup creation confirmation
# - Detailed optimization report
Automatic Language Detection:
# System analyzes project for language indicators
language = project.language_initializer.detect_project_language()
# Detection methods:
# - File content analysis (comments, strings)
# - Configuration file examination
# - System locale detection
# - Directory structure patterns
Multilingual Documentation:
# Create documentation structure for multiple languages
multilingual_result = project.language_initializer.create_multilingual_documentation_structure("ko")
# Creates:
# - /docs/ko/ - Korean documentation
# - /docs/en/ - English fallback
# - Language negotiation configuration
# - Automatic redirection setup
Agent Prompt Localization:
# Localize agent prompts with cost consideration
localized_prompt = project.language_initializer.localize_agent_prompts(
base_prompt="Generate user authentication system",
language="ko"
)
# Result includes:
# - Korean language instructions
# - Cultural context adaptations
# - Token cost optimization recommendations
Performance Analysis:
# Comprehensive template analysis
analysis = project.template_optimizer.analyze_project_templates()
# Analysis includes:
# - File size and complexity metrics
# - Performance bottleneck identification
# - Optimization opportunity scoring
# - Resource usage patterns
# - Backup recommendations
Intelligent Optimization:
# Create optimized versions with backup
optimization_result = project.template_optimizer.create_optimized_templates({
"backup_first": True,
"apply_size_optimizations": True,
"apply_performance_optimizations": True,
"apply_complexity_optimizations": True
})
# Optimizations applied:
# - Whitespace and redundancy reduction
# - Template structure optimization
# - Complexity reduction techniques
# - Performance caching improvements
Integrated Configuration:
# Get comprehensive project status
status = project.get_project_status()
# Status includes:
# - Project metadata and type
# - Language configuration and costs
# - Documentation completion status
# - Template optimization results
# - Module initialization states
Language Settings Updates:
# Update language configuration
update_result = project.update_language_settings({
"language.conversation_language": "ja",
"language.agent_prompt_language": "english", # Cost optimization
"language.documentation_language": "ja"
})
# Automatic updates:
# - Configuration file changes
# - Documentation structure updates
# - Template localization adjustments
For advanced patterns including custom template development, performance optimization strategies, and integration workflows, see:
Core Implementation:
modules/documentation_manager.py - Documentation generation and managementmodules/language_initializer.py - Language detection and configurationmodules/template_optimizer.py - Template analysis and optimization__init__.py - Unified interface and integration logicTemplates and Examples:
templates/doc-templates/ - Documentation template collectionexamples/complete_project_setup.py - Comprehensive usage examplesexamples/quick_start.py - Quick start guideProject Configuration:
{
"project": {
"name": "My Project",
"type": "web_application",
"initialized_at": "2025-11-25T..."
},
"language": {
"conversation_language": "en",
"agent_prompt_language": "english",
"documentation_language": "en"
},
"menu_system": {
"version": "1.0.0",
"fully_initialized": true
}
}
Language Configuration:
{
"en": {
"name": "English",
"native_name": "English",
"code": "en",
"locale": "en_US.UTF-8",
"agent_prompt_language": "english",
"token_cost_impact": 0
},
"ko": {
"name": "Korean",
"native_name": "",
"code": "ko",
"locale": "ko_KR.UTF-8",
"agent_prompt_language": "localized",
"token_cost_impact": 20
}
}
Command Line Usage:
# CLI interface for project management
python -m moai_menu_project.cli init --language ko --domains backend,frontend
python -m moai_menu_project.cli generate-docs --spec-file SPEC-001.json
python -m moai_menu_project.cli optimize-templates --backup
python -m moai_menu_project.cli export-docs --format html --language ko
API Integration:
# REST API integration example
from moai_menu_project import MoaiMenuProject
app = FastAPI()
@app.post("/projects/{project_id}/initialize")
async def initialize_project(project_id: str, config: ProjectConfig):
project = MoaiMenuProject(f"./projects/{project_id}")
result = project.initialize_complete_project(config.dict())
return result
@app.post("/projects/{project_id}/docs")
async def generate_docs(project_id: str, spec_data: SpecData):
project = MoaiMenuProject(f"./projects/{project_id}")
result = project.generate_documentation_from_spec(spec_data.dict())
return result
Module Performance:
Memory Usage:
File Size Impact:
Version: 1.0.0 Last Updated: 2025-11-25 Integration Status: Complete - All modules implemented and tested