I built repocraft: a deterministic Python generator where the same input always gives byte-identical output

Wait 5 sec.

Every new Python repo started the same way for me: copy the last pyproject.toml, fix the package name, re-add the ruff config, re-add the mypy config, write a CI file that is 90% the file I already wrote, and then notice I forgot the CodeQL config again. After the fourth time I stopped pretending that was creative work. repocraft (0.4.1, MIT, Python 3.10+) does two jobs: - snippet mode - `repocraft make "triangle"` writes triangle.py plus test_triangle.py, standard library only, seven recipes in the box (fibonacci, factorial, prime_sieve, triangle, fizzbuzz, pascal, password) - project mode - `repocraft render spec.yaml my-project` turns a small YAML spec into a whole project: packaging metadata, src/ layout, tests, lint and type-check config, CI, CodeQL, Dependabot, and a test gate that rejects skipped tests The property I actually wanted is that the same input and the same version produce byte-identical paths and contents. Entries render in sorted order, files use LF and a trailing newline, nothing embeds a timestamp, a random id or an environment value, and the generated MIT copyright line carries the author but no year. Golden snapshots under tests/golden compare every generated file, so a change that makes output depend on dict order or the machine's locale fails in CI instead of surprising me six months later. CI runs 3.10 through 3.14 with a Windows leg, and the dev suite enforces 100% branch coverage. The unglamorous rules are what make it usable day to day: an unknown or ambiguous request stops without writing anything, existing files are never overwritten and never merged into, `--dry-run` prints the plan first, a request containing a standalone digit is refused (pass --param instead), and parameters are validated bounded integers. Now the honest part. There are two optional paths that do use a model, and they are deliberately outside the determinism claim: `ask` only gets back a {recipe, parameters} intent, which is validated against the catalog the same way `make` validates a typed request, so the model never writes a file; `craft` lets the model write the snippet and then runs four deterministic gates before anything lands (the code parses, the generated test imports the module by name, ruff where it is installed with autofixes labelled as auto-fixed, and the tests actually run with at least one test and pass), then shows the code plus every check that passed and asks before writing. Both need OPENAI_API_KEY and an OpenAI-compatible endpoint. Repo creation and push, an interactive wizard for people who do not want to write YAML, and an MCP server are on the roadmap and are not built yet. GitHub: https://github.com/Furox-Art/repocraft PyPI: https://pypi.org/project/repocraft/   submitted by   /u/Emergency-Tutor-7 [link]   [comments]