Phase 1: convert cosmic-fastapi into a Copier template#26
Merged
Conversation
Move the generated project under template/ (Copier _subdirectory), rename the package to {{ package_name }}, and templatize identity, Python version, license, and database defaults across pyproject, Dockerfile, docker-compose, CI, settings, migrations, and README (62 .jinja files). Add a root template-authoring project with a bake-and-test harness that renders the template and runs the generated suite (Ruff, Pyrefly, pytest at 100% coverage) plus template CI, and an author-facing README.
The User example slice stays included; the include_user_example false path is deferred to #21, and author-vs-generated doc cleanup to #23.
Closes #20
Refs #22, #24
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
17 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 1 — Convert cosmic-fastapi into a Copier template
First slice of the conversion epic #24. The repository is now a working Copier template, validated end-to-end by a bake-and-test that renders the template and runs the generated project's full quality gate.
What changed
copier update, Jinja in contents+paths, typed questions).copier.ymldefines the questions:project_name,project_slug,package_name, identity (author_*,github_owner,license),python_version,database_url, andinclude_user_example; a post-copyuv locktask.template/(Copier_subdirectory); the package was renamedtemplate→{{ package_name }}and identity/Python-version/license/DB defaults were templatized across 62.jinjafiles (pyproject, Dockerfile, compose, CI, settings, migrations, README, LICENSE). GitHub Actions${{ }}expressions are wrapped in{% raw %}.tests/test_bake.py) and Template CI that render the template and assert the generated suite passes Ruff + Pyrefly + pytest at 100% coverage.README.md,.gitignore, and.pre-commit-config.yaml.Validation
Independently baked with default/sample answers → generated project:
uv sync✅,ruff check✅,pyrefly check✅, 53 tests, 100% coverage ✅.Deferred (tracked, not in this PR)
include_user_examplefalse-path (Jinja guards +_exclude); the User slice is always included for now.Cosmic FastAPI/src/templateprose, and ADR 0015 currently ships into generated projects.Closes #20
Refs #22, #24
🤖 Generated with Claude Code