Analyze Phase
Produces a detailed migration specification for a single module.
What Happens
- Selects the target module from the migration plan
- Fetches external dependencies (e.g., Chef Supermarket cookbooks via
berks) - Parses source code using technology-specific tools (Tree-sitter for Ruby, LLM for PowerShell/Ansible)
- Maps source resources to Ansible equivalents
- Extracts variable translations and template conversions
- Validates completeness of the analysis
- Cleans up and finalizes the specification
flowchart LR
module[Module Selection] --> deps[Dependency Fetch]
deps --> parse[Source Parser]
parse --> report[Report Writer]
report --> validate[File Validator]
validate --> cleanup[Spec Cleanup]
style module fill:#fff3e0
style deps fill:#f3e5f5
style parse fill:#fff3e0
style report fill:#fff3e0
style validate fill:#fff3e0
style cleanup fill:#e8f5e9
Output
File: migration-plan-<module-name>.md
Contains:
- Module-specific overview
- File-by-file mapping (source file to target Ansible file)
- Resource translation table (e.g., Chef
packageto Ansibleansible.builtin.package) - Variable mapping (e.g., Chef attributes to Ansible defaults)
- Template conversion notes (ERB to Jinja2)
- Handler and notification mappings
CLI Usage
uv run app.py analyze --source-dir ./chef-repo "Analyze nginx-multisite cookbook"
Review Checklist
Before proceeding to Migrate:
- All source files are mapped to target files
- Template variable conversions are correct
- Resource mappings preserve the original logic
- Dependencies are properly handled
- Edge cases and complex conversions are flagged
Re-running Analyze
Edit the migration plan manually if mappings need correction, or re-run with additional context:
uv run app.py analyze --source-dir ./chef-repo "Focus on SSL configuration details in nginx"