This recipe bootstraps a typical Python library repo:
- Poetry for dependencies and packaging
- pytest for tests
- ruff for lint/format (optional but common)
It gives you:
AGENTS.md/RUNBOOK.mdwith safe marker-only sections- A ready-to-use
.agentsgen.jsonwith explicit commands - A PR Guard workflow snippet you can copy into
.github/workflows/agentsgen-guard.yml
pyproject.tomlsrc/<package_name>/...tests/...
If built-in presets are enough, start with agentsgen presets and agentsgen init . --preset python-lib before copying this recipe.
-
Copy
.agentsgen.jsonfrom this folder to your repo root. -
Run:
agentsgen init . --defaults
agentsgen update . --dry-run --print-diff
# Optional: create/update the pack files
agentsgen pack . --check --format json- Commit generated docs (once you’re happy with the diff).
Create .github/workflows/agentsgen-guard.yml:
name: agentsgen guard + pack check
on:
pull_request:
push:
branches: [ main ]
permissions:
contents: read
pull-requests: write
jobs:
agentsgen:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: markoblogo/AGENTS.md_generator/.github/actions/agentsgen-guard@main
with:
comment: "true"
files: "AGENTS.md,RUNBOOK.md"
pack_check: "true"
pack_format: "json"Notes:
- comment: "true" posts a PR comment with results (safe default).
- pack_check: "true" enforces drift detection for pack files in the same job.
- Edit the
commandsblock in.agentsgen.jsonif your project usesuv/pipinstead of Poetry, or if your test command isn’tpytest -q. - If your package isn’t under
src/, update any paths mentioned in AGENTS/RUNBOOK after the first init (the generator won’t guess your layout).