From ff3f74db39f8a77f72bd4f95602eaee7d30e04bf Mon Sep 17 00:00:00 2001 From: lukabor Date: Mon, 8 Jun 2026 23:05:05 +0200 Subject: [PATCH] add skill: engineering/write-readme-py (Python README from pyproject + justfile) --- skills/engineering/write-readme-py/SKILL.md | 51 +++++++++++++ .../write-readme-py/readme-py.template.md | 73 +++++++++++++++++++ 2 files changed, 124 insertions(+) create mode 100644 skills/engineering/write-readme-py/SKILL.md create mode 100644 skills/engineering/write-readme-py/readme-py.template.md diff --git a/skills/engineering/write-readme-py/SKILL.md b/skills/engineering/write-readme-py/SKILL.md new file mode 100644 index 0000000..a6c43d9 --- /dev/null +++ b/skills/engineering/write-readme-py/SKILL.md @@ -0,0 +1,51 @@ +--- +name: write-readme-py +description: Generate a README.md for a Python project scaffolded by `/build-py-project`. Reads `pyproject.toml` and `justfile` from the current directory to populate name, description, dependencies, license, and task-runner commands. Materialises a README.md and stops on `jj diff` for review before any commit. Use when the user says "write readme", "/write-readme-py", "generate readme", "document the project" inside a Python project. +--- + +# write-readme-py + +## When to use +- Inside a Python project (has `pyproject.toml` and `justfile`). +- User says "write readme", "/write-readme-py", "generate readme". + +## Process + +1. **Read sources.** + - `pyproject.toml` → `project.name`, `project.description`, + `project.dependencies`, `dependency-groups.dev`, `project.license`. + - `justfile` → each recipe name plus the comment line(s) above it. + Group by section comments (lines like `# ── Docker ───`). + +2. **Refuse to invent.** If `project.description` is empty, ask the user + for a one-line description before writing. Do not fabricate + dependency versions, deps not listed, or recipes not in the justfile. + +3. **Materialise `README.md`** from + [`readme-py.template.md`](readme-py.template.md), substituting: + - ``, ``, `` + - ``, `` + - ``, ``, ``, + ``, `` — built from the justfile. + Omit any section whose recipes are absent. + +4. **Stop.** Tell the user: + > "Review the Installation section — the `[dev]` extras may need + > adjustment if you've added optional dependency groups beyond `dev`. + > When satisfied, describe with [`/jj-atomic`](../../productivity/jj-atomic/SKILL.md)." + +## Guardrails +- **Never** invent dependency versions or recipe descriptions. +- **Never** commit. Stop after writing the file. +- **Omit sections** with no source data instead of hallucinating. + +## Out of scope +- R projects. The R counterpart (`write-readme-r`) is not yet written. + Reading `DESCRIPTION` for packages and `_targets.R` + `index.qmd` for + analyses is the planned interface. + +## See also +- [`../../scaffold/build-py-project/SKILL.md`](../../scaffold/build-py-project/SKILL.md) + — produces the `pyproject.toml` + `justfile` this skill reads. +- [`../dev-python/SKILL.md`](../dev-python/SKILL.md) — the workflow + whose `just check` commands this README documents. diff --git a/skills/engineering/write-readme-py/readme-py.template.md b/skills/engineering/write-readme-py/readme-py.template.md new file mode 100644 index 0000000..c1897dd --- /dev/null +++ b/skills/engineering/write-readme-py/readme-py.template.md @@ -0,0 +1,73 @@ +# + + + + + + +
+

+

+
+ +## Table of Contents +- [Installation](#installation) +- [Docker](#docker) +- [Quality checks](#quality-checks) +- [Project layout](#project-layout) +- [License](#license) + +
+ +## Installation + +Requires Python ≥ 3.11. Install with [uv](https://docs.astral.sh/uv/): + +```bash +uv pip install -e "." # core: +uv pip install -e ".[dev]" # + dev tools: +``` + +## Docker + +Uses [just](https://github.com/casey/just) as a task runner. +Run `just --list` for the full set of recipes. + +```bash + +``` + +## Quality checks + +All checks run inside Docker via `just`. + +```bash +# Linting + + +# Type checking + + +# Testing + + +# Combined + +``` + +## Project layout + +``` +src// # library source + __init__.py +tests/ + fixtures/ # real data fixtures for tests +Dockerfile # base / production / development stages +docker-compose.yml # dev + production services +justfile # task runner +pyproject.toml # dependencies and tool config +``` + +## License + + is licensed under .