Init Python Project
Use this skill to turn a small project brief into a ready-to-run Python repository.
Workflow
- Collect the project metadata in a config file. Prefer
assets/examples/project-config.toml. - Render the bundled template with
scripts/render_project.py. - In the generated project directory, initialize git with
git initand switch tomasterusinggit checkout -B master. - Copy the generated
pre-commithook file into.git/hooks/pre-commit, then make it executable withchmod +x .git/hooks/pre-commit. - Review the generated repository and adjust dependencies or docs only if the user asked for extra customization.
- When the environment allows it, finish by running
make install,make format, andmake testinside the generated project.
Commands
Render into a new directory:
python3 scripts/render_project.py \
--config /absolute/path/to/new-project/project-config.toml \
--output /absolute/path/to/new-project
Overwrite an existing scaffold when the user explicitly wants regeneration:
python3 scripts/render_project.py \
--config /absolute/path/to/existing-project/project-config.toml \
--output /absolute/path/to/existing-project \
--overwrite
After rendering, bootstrap git and install the local pre-commit hook:
cd /absolute/path/to/new-project
git init
git checkout -B master
cp pre-commit .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit
Defaults
- Derive
package_namefromproject_namewhen it is omitted. - Default
python_versionto3.12. - Default
minimum_python_versiontopython_version. - Default
copyright_yearto the current year.
Resources
- Use
scripts/render_project.pyfor deterministic rendering of both file contents and path names that contain Jinja2 placeholders. - Use
assets/project-template/as the source template tree. - Read
references/configuration.mdonly when you need the supported config keys, file formats, or renderer behavior.