Handle template comparison and optimization workflows including backup detection, smart merging, and update completion reporting. Enhanced with Context7 MCP for up-to-date documentation.
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
A direct command skips the review prompt. Inspect the source before running it.
Handle template comparison and optimization workflows including backup detection, smart merging, and update completion reporting. Enhanced with Context7 MCP for up-to-date documentation.
Primary Agent: alfred Secondary Agents: none Version: 4.0.0 Keywords: project, template, optimizer, test
📖 Progressive Disclosure
Level 1: Quick Reference (Core Concepts)
Purpose: Handle template comparison and optimization workflows including backup detection, smart merging, and update completion reporting. Enhanced with Context7 MCP for up-to-date documentation.
Template Default Detection: Identify original template content
User Customization Extraction: Isolate user modifications
Version Compatibility Check: Ensure merge compatibility
Conflict Identification: Flag unresolvable differences
Phase 3: Smart Merge Algorithm
Purpose: Preserve user customizations while updating template structure
Strategy: Three-way merge with intelligence
Merge Process:
Extraction Phase
# Extract user customizations from backup
user_customizations = extract_user_content(backup_files)
# Get latest template defaults
template_defaults = get_current_templates()
# Analyze current project state
current_state = analyze_current_project()
Merge Strategy
Template defaults: Always use latest template version
User configurations: Preserve from backup with compatibility updates
Custom content: Extract and merge with new structure
Deprecated features: Flag and offer migration options
Conflict Resolution
Template conflicts: Prefer latest template
User config conflicts: Preserve user choice with warnings
Structural conflicts: Create merge report with resolution options
Phase 4: Template Default Detection
Purpose: Identify and preserve only non-template content during updates
Method: Pattern recognition and content analysis
Detection Patterns:
Template Indicators | User Content Indicators
---------------------------- | -------------------------
"{{PROJECT_NAME}}" | Specific project names
"{{CONVERSATION_LANGUAGE}}" | Actual language codes
"src/moai_adk/templates/" | Custom file paths
Template placeholders | Real configuration values
Default examples | Custom implementations
Content Classification:
Template Content: Default placeholders, examples, standard structure
User Content: Custom configurations, specific implementations, personal settings
Mixed Content: Template files with user modifications (requires careful extraction)
Phase 5: Version Management & History
Purpose: Maintain version tracking and update history sections
Output: Comprehensive update reports and history tracking
This skill consolidates complex template optimization workflows into a focused, intelligent system that:
Reduces complexity: From 700+ lines to optimized skill implementation
Improves reliability: Automated backup and merge procedures
Enhances user experience: Smart customization preservation
Maintains traceability: Comprehensive version tracking and reporting
Provides flexibility: Multiple operation modes and rollback options
The skill serves as the foundation for template lifecycle management and can be extended with additional optimization patterns as template structures evolve.