1+ # code2llm - Generated Analysis Files
2+
3+ This directory contains the complete analysis of your project generated by ` code2llm ` . Each file serves a specific purpose for understanding, refactoring, and documenting your codebase.
4+
15## 📁 Generated Files Overview
26
37When you run ` code2llm ./ -f all ` , the following files are created:
@@ -16,10 +20,30 @@ When you run `code2llm ./ -f all`, the following files are created:
1620| ` prompt.txt ` | ** Text** | ** 📝 Ready-to-send prompt** - Lists all files with instructions | Attach to LLM conversation as context guide |
1721| ` context.md ` | ** Markdown** | ** 📖 LLM narrative** - Architecture summary | Paste into ChatGPT/Claude for code analysis |
1822
23+ ### 📊 Visualizations
24+
25+ | File | Format | Purpose | Description |
26+ | ------| --------| ---------| -------------|
27+ | ` flow.mmd ` | ** Mermaid** | ** 🔄 Control flow diagram** | Function call paths with complexity styling |
28+ | ` calls.mmd ` | ** Mermaid** | ** 📞 Call graph** | Function dependencies (edges only) |
29+ | ` compact_flow.mmd ` | ** Mermaid** | ** 📦 Module overview** | Aggregated module-level view |
30+
31+ ## 🚀 Quick Start Commands
32+
33+ ### Basic Analysis
34+ ``` bash
35+ # Quick health check (TOON format only)
36+ code2llm ./ -f toon
37+
38+ # Generate all formats (what created these files)
39+ code2llm ./ -f all
40+
1941# LLM-ready context only
2042code2llm ./ -f context
2143```
2244
45+ ### Performance Options
46+ ``` bash
2347# Fast analysis for large projects
2448code2llm ./ -f toon --strategy quick
2549
@@ -30,6 +54,8 @@ code2llm ./ -f all --max-memory 500
3054code2llm ./ -f all --no-png
3155```
3256
57+ ### Refactoring Focus
58+ ``` bash
3359# Get refactoring recommendations
3460code2llm ./ -f evolution
3561
@@ -40,6 +66,20 @@ code2llm ./ -f toon --refactor --smell god_function
4066code2llm ./ -f flow --data-flow
4167```
4268
69+ ## 📖 Understanding Each File
70+
71+ ### ` analysis.toon ` - Health Diagnostics
72+ ** Purpose** : Quick overview of code health issues
73+ ** Key sections** :
74+ - ** HEALTH** : Critical issues (🔴) and warnings (🟡)
75+ - ** REFACTOR** : Prioritized refactoring actions
76+ - ** COUPLING** : Module dependencies and potential cycles
77+ - ** LAYERS** : Package complexity metrics
78+ - ** FUNCTIONS** : High-complexity functions (CC ≥ 10)
79+ - ** CLASSES** : Complex classes needing attention
80+
81+ ** Example usage** :
82+ ``` bash
4383# View health issues
4484cat analysis.toon | head -30
4585
@@ -122,24 +162,60 @@ grep -E "^ .*[0-9]{3,}$" project.toon.yaml | sort -t',' -k2 -n -r | head -10
122162
123163** Example usage** :
124164``` bash
165+ # View the prompt
166+ cat prompt.txt
167+
125168# Copy to clipboard and paste into ChatGPT/Claude
126169cat prompt.txt | pbcopy # macOS
127170cat prompt.txt | xclip -sel clip # Linux
128171```
129172
173+ ### ` context.md ` - LLM Narrative
174+ ** Purpose** : Ready-to-paste context for AI assistants
175+ ** Key sections** :
176+ - ** Overview** : Project statistics
177+ - ** Architecture** : Module breakdown
178+ - ** Entry Points** : Public interfaces
179+ - ** Patterns** : Design patterns detected
180+
181+ ** Example usage** :
182+ ``` bash
130183# Copy to clipboard for LLM
131184cat context.md | pbcopy # macOS
132185cat context.md | xclip -sel clip # Linux
133186
187+ # Use with Claude/ChatGPT for code analysis
188+ ```
189+
190+ ### Visualization Files (` *.mmd ` , ` *.png ` )
191+ ** Purpose** : Visual understanding of code structure
192+ ** Files** :
193+ - ` flow.mmd ` - Detailed control flow with complexity colors
194+ - ` calls.mmd ` - Simple call graph
195+ - ` compact_flow.mmd ` - High-level module view
196+ - ` *.png ` - Pre-rendered images
197+
198+ ** Example usage** :
199+ ``` bash
134200# View diagrams
135201open flow.png # macOS
136202xdg-open flow.png # Linux
137203
204+ # Edit in Mermaid Live Editor
205+ # Copy content of .mmd files to https://mermaid.live
206+ ```
207+
208+ ## 🔍 Common Analysis Patterns
209+
210+ ### 1. Code Health Assessment
211+ ``` bash
138212# Quick health check
139213code2llm ./ -f toon
140214cat analysis.toon | grep -E " (HEALTH|REFACTOR)"
141215```
142216
217+ ### 2. Refactoring Planning
218+ ``` bash
143219# Get refactoring queue
144220code2llm ./ -f evolution
145221cat evolution.toon.yaml
@@ -148,17 +224,33 @@ cat evolution.toon.yaml
148224code2llm ./ -f toon --refactor --smell god_function
149225```
150226
227+ ### 3. LLM Assistance
228+ ``` bash
151229# Generate context for AI
152230code2llm ./ -f context
153231cat context.md
154232
233+ # Use with Claude: "Based on this context, help me refactor the god modules"
234+ ```
235+
236+ ### 4. Team Documentation
237+ ``` bash
155238# Generate all docs for team
156239code2llm ./ -f all -o ./docs/
157240
158241# Create visual diagrams
159242open docs/flow.png
160243```
161244
245+ ## 📊 Interpreting Metrics
246+
247+ ### Complexity Metrics (CC)
248+ - ** 🔴 Critical (≥5.0)** : Immediate refactoring needed
249+ - ** 🟠 High (3.0-4.9)** : Consider refactoring
250+ - ** 🟡 Medium (1.5-2.9)** : Monitor complexity
251+ - ** 🟢 Low (0.1-1.4)** : Acceptable
252+ - ** ⚪ Basic (0.0)** : Simple functions
253+
162254### Module Health
163255- ** GOD Module** : Too large (>500 lines, >20 methods)
164256- ** HUB** : High fan-out (calls many modules)
@@ -170,6 +262,11 @@ open docs/flow.png
170262- ** CONTRACT** : Clear input/output specification
171263- ** SIDE_EFFECT** : External state modification
172264
265+ ## 🛠️ Integration Examples
266+
267+ ### CI/CD Pipeline
268+ ``` bash
269+ #! /bin/bash
173270# Analyze code quality in CI
174271code2llm ./ -f toon -o ./analysis
175272if grep -q " 🔴 GOD" ./analysis/analysis.toon; then
@@ -178,6 +275,9 @@ if grep -q "🔴 GOD" ./analysis/analysis.toon; then
178275fi
179276```
180277
278+ ### Pre-commit Hook
279+ ``` bash
280+ #! /bin/sh
181281# .git/hooks/pre-commit
182282code2llm ./ -f toon -o ./temp_analysis
183283if grep -q " 🔴" ./temp_analysis/analysis.toon; then
186286rm -rf ./temp_analysis
187287```
188288
289+ ### Documentation Generation
290+ ``` bash
189291# Generate docs for README
190292code2llm ./ -f context -o ./docs/
191293echo " ## Architecture" >> README.md
192294cat docs/context.md >> README.md
193295```
194296
297+ ## 📚 Next Steps
298+
299+ 1 . ** Review ` analysis.toon ` ** - Identify critical issues
300+ 2 . ** Check ` evolution.toon.yaml ` ** - Plan refactoring priorities
301+ 3 . ** Use ` context.md ` ** - Get LLM assistance for complex changes
302+ 4 . ** Reference visualizations** - Understand system architecture
303+ 5 . ** Track progress** - Re-run analysis after changes
304+
305+ ## 🔧 Advanced Usage
306+
307+ ### Custom Analysis
308+ ``` bash
195309# Deep analysis with all insights
196310code2llm ./ -m hybrid -f all --max-depth 15 -v
197311
@@ -202,6 +316,8 @@ code2llm ./ -m static -f toon --strategy quick
202316code2llm ./ -f toon,evolution --refactor
203317```
204318
319+ ### Output Customization
320+ ``` bash
205321# Separate output directories
206322code2llm ./ -f all -o ./analysis-$( date +%Y%m%d)
207323
@@ -215,7 +331,7 @@ code2llm ./ -f yaml --separate-orphans
215331---
216332
217333** Generated by** : ` code2llm ./ -f all --readme `
218- ** Analysis Date** : 2026-04-13
334+ ** Analysis Date** : 2026-04-19
219335** Total Functions** : 351
220336** Total Classes** : 60
221337** Modules** : 54
0 commit comments