Flatten Repo Architecture
Scope
Use this skill when changing package structure, responsibilities between modules, CLI entry points, or release-related metadata wiring.
Rules
- •Keep production code under
src/flatten_repo/. - •Keep modules cohesive:
- •
cli.py: argument parsing and orchestration only. - •
settings.py: runtime configuration model. - •
logging.py: logging setup only. - •
config.py: enums, constants, shared models. - •
file_manipulation.py: filesystem/git/content processing. - •
output_construction.py: markdown/jsonl rendering and chunking.
- •
- •Avoid importing heavy runtime logic in
__init__.py. - •Keep CLI entry point at
flatten_repo.cli:main. - •Preserve
src/packaging and wheel/sdist config inpyproject.toml. - •Keep package version consistent between
pyproject.tomlandsrc/flatten_repo/__init__.py. - •Keep
project.urls, classifiers, and script metadata current for PyPI consumers.
Validation
Run:
- •
uv run pytest -m unit - •
uv run python -m flatten_repo.cli --help - •
uv run python -m flatten_repo.cli --version