Skip to content

Commit 4518339

Browse files
docs(docs): add markdown output
Statistics: 9 files changed, 450 insertions, 297 deletions Summary: - Dirs: project=6, .=3 - Exts: .md=3, .yaml=2, .yml=1, .mmd=1, .png=1, .html=1 - A/M/D: 1/8/0 - Added: redsl_refactor_plan.md - Symbols: files Added files: - redsl_refactor_plan.md (+40/-0) Modified files: - README.md (+5/-5) - Taskfile.yml (+113/-0) - project/calls.mmd (+19/-19) - project/calls.png (+0/-0) - project/calls.toon.yaml (+8/-8) - project/calls.yaml (+223/-223) - project/context.md (+41/-41) - project/index.html (+1/-1) Implementation notes (heuristics): - Type inferred from file paths + diff keywords + add/delete ratio - Scope prefers 'goal' when goal/* is touched; otherwise based on top-level dirs - For <=6 files: generate short per-file notes from added lines (defs/classes/click options/headings) - A/M/D derived from git name-status; per-file +X/-X from git numstat
1 parent 8e740bf commit 4518339

13 files changed

Lines changed: 470 additions & 302 deletions

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,21 @@
22

33
## [Unreleased]
44

5+
## [3.0.29] - 2026-04-19
6+
7+
### Docs
8+
- Update README.md
9+
- Update project/context.md
10+
- Update redsl_refactor_plan.md
11+
12+
### Other
13+
- Update Taskfile.yml
14+
- Update project/calls.mmd
15+
- Update project/calls.png
16+
- Update project/calls.toon.yaml
17+
- Update project/calls.yaml
18+
- Update project/index.html
19+
520
## [3.0.28] - 2026-04-18
621

722
### Docs

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
## AI Cost Tracking
22

3-
![PyPI](https://img.shields.io/badge/pypi-costs-blue) ![Version](https://img.shields.io/badge/version-3.0.28-blue) ![Python](https://img.shields.io/badge/python-3.9+-blue) ![License](https://img.shields.io/badge/license-Apache--2.0-green)
4-
![AI Cost](https://img.shields.io/badge/AI%20Cost-$7.50-orange) ![Human Time](https://img.shields.io/badge/Human%20Time-22.8h-blue) ![Model](https://img.shields.io/badge/Model-openrouter%2Fqwen%2Fqwen3--coder--next-lightgrey)
3+
![PyPI](https://img.shields.io/badge/pypi-costs-blue) ![Version](https://img.shields.io/badge/version-3.0.29-blue) ![Python](https://img.shields.io/badge/python-3.9+-blue) ![License](https://img.shields.io/badge/license-Apache--2.0-green)
4+
![AI Cost](https://img.shields.io/badge/AI%20Cost-$7.50-orange) ![Human Time](https://img.shields.io/badge/Human%20Time-23.8h-blue) ![Model](https://img.shields.io/badge/Model-openrouter%2Fqwen%2Fqwen3--coder--next-lightgrey)
55

6-
- 🤖 **LLM usage:** $7.5000 (65 commits)
7-
- 👤 **Human dev:** ~$2284 (22.8h @ $100/h, 30min dedup)
6+
- 🤖 **LLM usage:** $7.5000 (68 commits)
7+
- 👤 **Human dev:** ~$2384 (23.8h @ $100/h, 30min dedup)
88

9-
Generated on 2026-04-18 using [openrouter/qwen/qwen3-coder-next](https://openrouter.ai/qwen/qwen3-coder-next)
9+
Generated on 2026-04-19 using [openrouter/qwen/qwen3-coder-next](https://openrouter.ai/qwen/qwen3-coder-next)
1010

1111
---
1212

13-
![version](https://img.shields.io/badge/version-3.0.28-blue) ![python](https://img.shields.io/badge/python-%3E%3D3.9-blue) ![docs](https://img.shields.io/badge/docs-auto--generated-blueviolet)
13+
![version](https://img.shields.io/badge/version-3.0.29-blue) ![python](https://img.shields.io/badge/python-%3E%3D3.9-blue) ![docs](https://img.shields.io/badge/docs-auto--generated-blueviolet)
1414

1515
> Auto-generate and sync project documentation from source code analysis.
1616
@@ -147,7 +147,7 @@ code2docs can update only specific sections of an existing README using markers:
147147
```markdown
148148
<!-- code2docs:start --># code2docs
149149

150-
![version](https://img.shields.io/badge/version-3.0.28-blue) ![python](https://img.shields.io/badge/python-%3E%3D3.9-blue) ![coverage](https://img.shields.io/badge/coverage-unknown-lightgrey) ![functions](https://img.shields.io/badge/functions-276-green)
150+
![version](https://img.shields.io/badge/version-3.0.29-blue) ![python](https://img.shields.io/badge/python-%3E%3D3.9-blue) ![coverage](https://img.shields.io/badge/coverage-unknown-lightgrey) ![functions](https://img.shields.io/badge/functions-276-green)
151151
> **276** functions | **57** classes | **51** files | CC̄ = 3.8
152152

153153
> Auto-generated project documentation from source code analysis.

Taskfile.yml

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,116 @@ tasks:
7171
desc: Auto-format with ruff (alias of fmt)
7272
cmds:
7373
- ruff format .
74+
sumd:
75+
desc: Generate SUMD (Structured Unified Markdown Descriptor) for AI-aware project description
76+
cmds:
77+
- |
78+
echo "# $(basename $(pwd))" > SUMD.md
79+
echo "" >> SUMD.md
80+
echo "$(python3 -c "import tomllib; f=open('pyproject.toml','rb'); d=tomllib.load(f); print(d.get('project',{}).get('description','Project description'))" 2>/dev/null || echo 'Project description')" >> SUMD.md
81+
echo "" >> SUMD.md
82+
echo "## Contents" >> SUMD.md
83+
echo "" >> SUMD.md
84+
echo "- [Metadata](#metadata)" >> SUMD.md
85+
echo "- [Architecture](#architecture)" >> SUMD.md
86+
echo "- [Dependencies](#dependencies)" >> SUMD.md
87+
echo "- [Source Map](#source-map)" >> SUMD.md
88+
echo "- [Intent](#intent)" >> SUMD.md
89+
echo "" >> SUMD.md
90+
echo "## Metadata" >> SUMD.md
91+
echo "" >> SUMD.md
92+
echo "- **name**: \`$(basename $(pwd))\`" >> SUMD.md
93+
echo "- **version**: \`$(python3 -c "import tomllib; f=open('pyproject.toml','rb'); d=tomllib.load(f); print(d.get('project',{}).get('version','unknown'))" 2>/dev/null || echo 'unknown')\`" >> SUMD.md
94+
echo "- **python_requires**: \`>=$(python3 --version 2>/dev/null | cut -d' ' -f2 | cut -d. -f1,2)\`" >> SUMD.md
95+
echo "- **license**: $(python3 -c "import tomllib; f=open('pyproject.toml','rb'); d=tomllib.load(f); print(d.get('project',{}).get('license',{}).get('text','MIT'))" 2>/dev/null || echo 'MIT')" >> SUMD.md
96+
echo "- **ecosystem**: SUMD + DOQL + testql + taskfile" >> SUMD.md
97+
echo "- **generated_from**: pyproject.toml, Taskfile.yml, Makefile, src/" >> SUMD.md
98+
echo "" >> SUMD.md
99+
echo "## Architecture" >> SUMD.md
100+
echo "" >> SUMD.md
101+
echo '```' >> SUMD.md
102+
echo "SUMD (description) → DOQL/source (code) → taskfile (automation) → testql (verification)" >> SUMD.md
103+
echo '```' >> SUMD.md
104+
echo "" >> SUMD.md
105+
echo "## Source Map" >> SUMD.md
106+
echo "" >> SUMD.md
107+
find . -name '*.py' -not -path './.venv/*' -not -path './venv/*' -not -path './__pycache__/*' -not -path './.git/*' | head -50 | sed 's|^./||' | sed 's|^|- |' >> SUMD.md
108+
echo "Generated SUMD.md"
109+
- |
110+
python3 -c "
111+
import json, os, subprocess
112+
from pathlib import Path
113+
project_name = Path.cwd().name
114+
py_files = list(Path('.').rglob('*.py'))
115+
py_files = [f for f in py_files if not any(x in str(f) for x in ['.venv', 'venv', '__pycache__', '.git'])]
116+
data = {
117+
'project_name': project_name,
118+
'description': 'SUMD - Structured Unified Markdown Descriptor for AI-aware project refactorization',
119+
'files': [{'path': str(f), 'type': 'python'} for f in py_files[:100]]
120+
}
121+
with open('sumd.json', 'w') as f:
122+
json.dump(data, f, indent=2)
123+
print('Generated sumd.json')
124+
" 2>/dev/null || echo 'Python generation failed, using fallback'
125+
sumr:
126+
desc: Generate SUMR (Summary Report) with project metrics and health status
127+
cmds:
128+
- |
129+
echo "# $(basename $(pwd)) - Summary Report" > SUMR.md
130+
echo "" >> SUMR.md
131+
echo "SUMR - Summary Report for project analysis" >> SUMR.md
132+
echo "" >> SUMR.md
133+
echo "## Contents" >> SUMR.md
134+
echo "" >> SUMR.md
135+
echo "- [Metadata](#metadata)" >> SUMR.md
136+
echo "- [Quality Status](#quality-status)" >> SUMR.md
137+
echo "- [Metrics](#metrics)" >> SUMR.md
138+
echo "- [Refactoring Analysis](#refactoring-analysis)" >> SUMR.md
139+
echo "- [Intent](#intent)" >> SUMR.md
140+
echo "" >> SUMR.md
141+
echo "## Metadata" >> SUMR.md
142+
echo "" >> SUMR.md
143+
echo "- **name**: \`$(basename $(pwd))\`" >> SUMR.md
144+
echo "- **version**: \`$(python3 -c "import tomllib; f=open('pyproject.toml','rb'); d=tomllib.load(f); print(d.get('project',{}).get('version','unknown'))" 2>/dev/null || echo 'unknown')\`" >> SUMR.md
145+
echo "- **generated_at**: \`$(date -Iseconds)\`" >> SUMR.md
146+
echo "" >> SUMR.md
147+
echo "## Quality Status" >> SUMR.md
148+
echo "" >> SUMR.md
149+
if [ -f pyqual.yaml ]; then
150+
echo "- **pyqual_config**: ✅ Present" >> SUMR.md
151+
echo "- **last_run**: $(stat -c %y .pyqual/pipeline.db 2>/dev/null | cut -d' ' -f1 || echo 'N/A')" >> SUMR.md
152+
else
153+
echo "- **pyqual_config**: ❌ Missing" >> SUMR.md
154+
fi
155+
echo "" >> SUMR.md
156+
echo "## Metrics" >> SUMR.md
157+
echo "" >> SUMR.md
158+
py_files=$(find . -name '*.py' -not -path './.venv/*' -not -path './venv/*' | wc -l)
159+
echo "- **python_files**: $py_files" >> SUMR.md
160+
lines=$(find . -name '*.py' -not -path './.venv/*' -not -path './venv/*' -exec cat {} \; 2>/dev/null | wc -l)
161+
echo "- **total_lines**: $lines" >> SUMR.md
162+
echo "" >> SUMR.md
163+
echo "## Refactoring Analysis" >> SUMR.md
164+
echo "" >> SUMR.md
165+
echo "Run \`code2llm ./ -f evolution\` for detailed refactoring queue." >> SUMR.md
166+
echo "Generated SUMR.md"
167+
- |
168+
python3 -c "
169+
import json, os, subprocess
170+
from pathlib import Path
171+
from datetime import datetime
172+
project_name = Path.cwd().name
173+
py_files = len([f for f in Path('.').rglob('*.py') if not any(x in str(f) for x in ['.venv', 'venv', '__pycache__', '.git'])])
174+
data = {
175+
'project_name': project_name,
176+
'report_type': 'SUMR',
177+
'generated_at': datetime.now().isoformat(),
178+
'metrics': {
179+
'python_files': py_files,
180+
'has_pyqual_config': Path('pyqual.yaml').exists()
181+
}
182+
}
183+
with open('SUMR.json', 'w') as f:
184+
json.dump(data, f, indent=2)
185+
print('Generated SUMR.json')
186+
" 2>/dev/null || echo 'Python generation failed, using fallback'

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.0.28
1+
3.0.29

code2docs/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
README.md, API references, module docs, examples, and architecture diagrams.
66
"""
77

8-
__version__ = '3.0.28'
8+
__version__ = '3.0.29'
99
__author__ = 'Tom Sapletta'
1010
__all__ = ['Code2DocsConfig', 'generate_readme', 'generate_docs', 'analyze_and_document']
1111

project/calls.mmd

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,39 +4,39 @@ flowchart LR
44
end
55
subgraph code2docs__cli
66
code2docs__cli___run_sync["_run_sync"]
7-
code2docs__cli___run_check["_run_check"]
8-
code2docs__cli__diff["diff"]
9-
code2docs__cli___run_watch["_run_watch"]
7+
code2docs__cli__sync["sync"]
108
code2docs__cli___load_config["_load_config"]
9+
code2docs__cli__watch["watch"]
1110
code2docs__cli___run_diff["_run_diff"]
12-
code2docs__cli__sync["sync"]
11+
code2docs__cli__diff["diff"]
12+
code2docs__cli___run_check["_run_check"]
13+
code2docs__cli___run_watch["_run_watch"]
1314
code2docs__cli__check["check"]
14-
code2docs__cli__watch["watch"]
1515
end
1616
subgraph code2docs__config
1717
code2docs__config__Code2DocsConfig__from_yaml["from_yaml"]
1818
end
1919
subgraph code2docs__formatters
20+
code2docs__formatters__toc__generate_toc["generate_toc"]
21+
code2docs__formatters__badges__generate_badges["generate_badges"]
2022
code2docs__formatters__toc___slugify["_slugify"]
2123
code2docs__formatters__toc__extract_headings["extract_headings"]
2224
code2docs__formatters__badges___make_badge["_make_badge"]
23-
code2docs__formatters__toc__generate_toc["generate_toc"]
24-
code2docs__formatters__badges__generate_badges["generate_badges"]
2525
end
2626
subgraph code2docs__generators
27-
code2docs__generators__code2llm_gen___extract_patterns["_extract_patterns"]
28-
code2docs__generators__contributing_gen__ContributingGenerator___get_python_style_lines["_get_python_style_lines"]
27+
code2docs__generators__code2llm_gen___process_line["_process_line"]
2928
code2docs__generators__contributing_gen__ContributingGenerator___render_code_style["_render_code_style"]
30-
code2docs__generators__code2llm_gen__parse_gitignore["parse_gitignore"]
31-
code2docs__generators__contributing_gen__ContributingGenerator___get_jsts_style_lines["_get_jsts_style_lines"]
29+
code2docs__generators__code2llm_gen__Code2LlmGenerator___add_exclude_patterns["_add_exclude_patterns"]
30+
code2docs__generators__contributing_gen__ContributingGenerator___get_style_lines["_get_style_lines"]
3231
code2docs__generators__code2llm_gen___should_skip_line["_should_skip_line"]
33-
code2docs__generators__code2llm_gen___is_valid_pattern["_is_valid_pattern"]
32+
code2docs__generators__readme_gen__generate_readme["generate_readme"]
33+
code2docs__generators__code2llm_gen___extract_patterns["_extract_patterns"]
3434
code2docs__generators__code2llm_gen___clean_pattern["_clean_pattern"]
35+
code2docs__generators__contributing_gen__ContributingGenerator___get_jsts_style_lines["_get_jsts_style_lines"]
36+
code2docs__generators__code2llm_gen___is_valid_pattern["_is_valid_pattern"]
37+
code2docs__generators__contributing_gen__ContributingGenerator___get_python_style_lines["_get_python_style_lines"]
38+
code2docs__generators__code2llm_gen__parse_gitignore["parse_gitignore"]
3539
code2docs__generators__readme_gen__ReadmeGenerator___build_context["_build_context"]
36-
code2docs__generators__contributing_gen__ContributingGenerator___get_style_lines["_get_style_lines"]
37-
code2docs__generators__readme_gen__generate_readme["generate_readme"]
38-
code2docs__generators__code2llm_gen___process_line["_process_line"]
39-
code2docs__generators__code2llm_gen__Code2LlmGenerator___add_exclude_patterns["_add_exclude_patterns"]
4040
end
4141
subgraph code2docs__llm_helper
4242
code2docs__llm_helper___get_litellm["_get_litellm"]
@@ -49,10 +49,10 @@ flowchart LR
4949
examples__02_configuration__load_config_from_yaml["load_config_from_yaml"]
5050
end
5151
subgraph examples__03_programmatic_api
52-
examples__03_programmatic_api__custom_documentation_pipeline["custom_documentation_pipeline"]
53-
examples__03_programmatic_api__inspect_project_structure["inspect_project_structure"]
5452
examples__03_programmatic_api__generate_docs_if_needed["generate_docs_if_needed"]
5553
examples__03_programmatic_api__generate_readme_simple["generate_readme_simple"]
54+
examples__03_programmatic_api__custom_documentation_pipeline["custom_documentation_pipeline"]
55+
examples__03_programmatic_api__inspect_project_structure["inspect_project_structure"]
5656
examples__03_programmatic_api__generate_full_documentation["generate_full_documentation"]
5757
end
5858
subgraph examples__04_sync_and_watch
@@ -62,9 +62,9 @@ flowchart LR
6262
examples__05_custom_generators__generate_custom_report["generate_custom_report"]
6363
end
6464
subgraph examples__06_formatters
65-
examples__06_formatters__badge_examples["badge_examples"]
6665
examples__06_formatters__toc_examples["toc_examples"]
6766
examples__06_formatters__build_custom_readme["build_custom_readme"]
67+
examples__06_formatters__badge_examples["badge_examples"]
6868
end
6969
subgraph examples__07_web_frameworks
7070
examples__07_web_frameworks__document_web_project["document_web_project"]

project/calls.png

-527 Bytes
Loading

project/calls.toon.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,30 +19,30 @@ HUBS[20]:
1919
CC=5 in:0 out:16 total:16
2020
code2docs.cli._run_sync
2121
CC=4 in:1 out:14 total:15
22-
code2docs.generators.contributing_gen.ContributingGenerator._get_python_style_lines
23-
CC=7 in:1 out:11 total:12
2422
code2docs.cli._load_config
2523
CC=4 in:5 out:7 total:12
2624
code2docs.cli._run_diff
2725
CC=2 in:1 out:11 total:12
28-
code2docs.analyzers.project_scanner.ProjectScanner.analyze
29-
CC=1 in:11 out:1 total:12
3026
code2docs.formatters.toc.extract_headings
3127
CC=6 in:2 out:10 total:12
28+
code2docs.generators.contributing_gen.ContributingGenerator._get_python_style_lines
29+
CC=7 in:1 out:11 total:12
3230
examples.03_programmatic_api.generate_full_documentation
3331
CC=2 in:0 out:12 total:12
32+
code2docs.analyzers.project_scanner.ProjectScanner.analyze
33+
CC=1 in:11 out:1 total:12
3434
examples.03_programmatic_api.generate_docs_if_needed
3535
CC=3 in:0 out:10 total:10
3636
examples.07_web_frameworks.document_web_project
3737
CC=3 in:0 out:9 total:9
3838
examples.05_custom_generators.generate_custom_report
3939
CC=1 in:0 out:9 total:9
40-
examples.03_programmatic_api.custom_documentation_pipeline
41-
CC=1 in:0 out:8 total:8
42-
code2docs.cli._run_watch
43-
CC=2 in:1 out:7 total:8
40+
code2docs.cli.sync
41+
CC=2 in:0 out:8 total:8
4442
code2docs.generators.contributing_gen.ContributingGenerator._get_jsts_style_lines
4543
CC=5 in:1 out:7 total:8
44+
examples.03_programmatic_api.custom_documentation_pipeline
45+
CC=1 in:0 out:8 total:8
4646

4747
MODULES:
4848
code2docs.analyzers.project_scanner [1 funcs]

0 commit comments

Comments
 (0)