# pytemplate-uv 3.8: Your AI Agent Can Now Find, Use, and Make Python Templates

> Source: <https://dev.to/yuxuzi/pytemplate-uv-38-your-ai-agent-can-now-find-use-and-make-python-templates-cpd>
> Published: 2026-12-04 20:57:22+00:00

**Key takeaway:** Routing hub index searches through the CLI's local ranking instead of feeding agents the full 54,167-byte index.json cuts agent context to 1,332–9,457 bytes per query and returns structured JSON fields.

Ask your coding agent "find me a template for a FastAPI service with Postgres", and it searches a verified index, shows you how far each candidate can be trusted, and creates the project once you choose. Ask it "turn this project into a template", and it converts your repository, stops if it finds anything that looks like a secret, and proves the result renders and passes its tests under a new name.

Today I'm releasing **pytemplate-uv 3.8.0** on PyPI and **pytemplate-hub 1.0.2** on the web. Together they finish a loop I've been building since 3.0:

Each of those now has its own skill for AI coding agents, and each skill sits on a command with JSON output, so the agent drives real tools instead of improvising.

Here is the whole install, with nothing to set up first:

```
uvx pytemplate-uv@latest skill install
Installed skill at ~/.claude/skills/pytemplate/SKILL.md
Installed skill at ~/.claude/skills/pytemplate-find/SKILL.md
Installed skill at ~/.claude/skills/pytemplate-author/SKILL.md
```

Let me show you what each one does.

If you're new here: **pytemplate-uv** is an application factory for uv-native Python projects. You pick a *profile* (a CLI, a library, a FastAPI service), add *components* (a database, auth, a worker, an MCP server), and get a project that passes lint, format, strict mypy, and its tests from the first commit.

**[pytemplate-hub](https://yuxuzi.github.io/pytemplate-hub/)** is an open index of *template packs*: Git repositories that add new profiles and components without forking anything. Every listing pins a tag to an exact commit and a SHA-256 digest of every file, and pytemplate-uv refuses a pack whose tag moved or whose files changed. You get exactly the template that was checked, or nothing.

In 3.7, finding a pack meant browsing the website. Making one meant reading the docs and writing manifests by hand. 3.8 fixes both.

`pytemplate search` and the `pytemplate-find` skill
Search the hub from your terminal:

```
uvx pytemplate-uv@latest search fastapi postgres
┏━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Pack                   ┃ Name             ┃ Tag    ┃ Tier   ┃ Checked          ┃ Profiles      ┃ Use                              ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ yuxuzi/fastapi-service │ FastAPI services │ v1.1.0 │ listed │ 2026-11-25 (9 d) │ 2 of 2 passed │ -h yuxuzi/fastapi-service@v1.1.0 │
└────────────────────────┴──────────────────┴────────┴────────┴──────────────────┴───────────────┴──────────────────────────────────┘
Listed means the automated checks passed, not that the pack was reviewed or is safe. Showing 1 of 1.
```

Every result tells you three things most template registries don't:

`listed` means the hub's automated checks passed. `reviewed` means a person also read it. The footer says so in plain words every time.`-h owner/pack@tag` string that creates a project from exactly the checked revision.
You can narrow by category (`--category web`, from the fixed list `cli`, `library`, `web`, `worker`, `data`, `ai`, `quant`), and `--json` gives you the same results for scripts and agents.

This is where the design matters for AI. In 3.7, the agent skill read the hub's whole `index.json`: **54,167 bytes** of context for every search. In 3.8 the CLI reads the index, ranks it, and hands the agent only the matches:

| Query | JSON the agent reads | 
|---|---|
| `fastapi postgres` | 1,332 B | 
| `cli typer` | 5,783 B | 
| every pack on the hub | 9,457 B | 

That's 6 to 40 times less context, and the agent gets structured fields instead of a file it has to parse:

```
{
  "id": "yuxuzi/fastapi-service",
  "tier": "listed",
  "reviewed_by": null,
  "checked_on": "2026-11-25",
  "age_days": 9,
  "checked_with": "pytemplate-uv==3.6.0",
  "profiles": [
    {"id": "service", "lifecycle": "passed"},
    {"id": "service-sql", "lifecycle": "passed"}
  ],
  "matched": ["fastapi"],
  "use": "-h yuxuzi/fastapi-service@v1.1.0"
}
```

With the skills installed, you just ask:

**You:** Find me a template for a FastAPI service with a SQL database.

The `pytemplate-find` skill turns that into a few search words and runs `search --json`. It shows you each candidate with its tier and the date of its last check, and it calls out anything checked more than 180 days ago. Then it **waits for you to choose**. It never picks a stranger's template for you.

Once you choose, it hands off to the `pytemplate` skill, which:

`-h` pins (`service` and `service-sql` here);`plan`: components, dependencies, settings, every file;
If the hub website is down, the skill doesn't give up: it searches a shallow clone of the hub's entries with `--index`, and if that fails too, it offers the bundled profiles.

Every team has a project it's proud of. Until now, turning it into a template meant hand-converting files to Jinja, writing manifests, and hoping you'd caught every hard-coded name. 3.8 adds a `pack` command group:

```
init          Start a template pack from nothing, a bundled profile, or another pack.
from-project  Make a one-profile template pack from a git project (its tracked files only).
check         Check a template pack and report every problem (exit 0 when there are no errors).
```

Here's a real run. I generated a small CLI called `price-feed`, committed it, and converted it:

```
uvx pytemplate-uv@latest pack from-project price-feed feed-pack --project-name price-feed
Pack feed-pack written to …/feed-pack (profile feed-pack, kind cli).
Copied 17 file(s):
  .github/workflows/ci.yml -> .github/workflows/ci.yml.jinja [template, 1 replacement(s); template syntax escaped]
  AGENTS.md -> AGENTS.md.jinja [template, 6 replacement(s)]
  README.md -> README.md.jinja [template, 5 replacement(s)]
  price_feed/__init__.py -> {{ package_name }}/__init__.py [renamed]
  price_feed/cli.py -> {{ package_name }}/cli.py.jinja [template, 6 replacement(s); renamed]
  pyproject.toml -> pyproject.toml.jinja [template, 4 replacement(s)]
  tests/test_cli.py -> tests/test_cli.py.jinja [template, 2 replacement(s)]
  ...
Replaced price-feed with {{ project_name }} and price_feed with {{ package_name }}.
Lifecycle commands: uv sync; uv run ruff check .; uv run ruff format --check .; uv run mypy {package}; uv run pytest; uv build
```

What it did, and what it refused to do:

`.jinja` only when its text actually changed.`${{ … }}` GitHub Actions syntax that was already in the CI workflow, so the template engine leaves it alone.`pyproject.toml`, the CI workflows, and the Makefile, and `uv`
Then I did something careless on purpose: I committed a `prod.env` and a settings file with an AWS key in it, and converted again:

```
Left out 1 file(s):
  prod.env: an environment file, which may hold secrets (only .env.example is copied)
Secret-looking text in 1 place(s). Stop and ask the user before anything is published:
  price_feed/settings.py:1: AWS access key ID (AKIA)
```

Environment files, `.pypirc`, `.netrc`, `.npmrc`, private keys, `uv.lock`, and build output are always left out. Text that looks like a secret is reported **by file and kind, never echoed**. The report goes to your terminal, never into the pack. The `pytemplate-author` skill is told in so many words: *stop at any secret warning*, name the file and the kind, and don't go on until you answer.

```
uvx pytemplate-uv@latest pack init my-pack                                   # a minimal pack
uvx pytemplate-uv@latest pack init my-service --from bundled:fastapi         # a bundled profile, standalone
uvx pytemplate-uv@latest pack init my-fork --from yuxuzi/fastapi-service@v1.1.0  # a hub pack, by its pins
```

A copy keeps the source's LICENSE, resets the id, name, and version to 0.1.0, and its README says "Adapted from" the source. A blank pack gets no license at all, because choosing one is your decision, not the tool's.

For **Copier and cookiecutter** templates, the `pytemplate-author` skill walks the agent through the conversion by hand, with a list of everything that usually goes wrong: hooks that never run, `{% now %}`, custom filters, include paths, symbolic links, repository-only files, and choices a hook used to make.

`pytemplate pack check`
The hub has checked packs since 1.0. In 3.8 that check lives in pytemplate-uv, so you run **the exact check the hub runs** before you open a pull request:

```
uvx pytemplate-uv@latest pack check feed-pack --lifecycle --forbid price-feed --forbid price_feed
Pack feed-pack 0.1.0 (feed-pack): 1 profile(s)
  feed-pack: lifecycle passed, agent-ready no
Warnings (2):
  [license] The pack has no license file (LICENSE, LICENSE.md, LICENSE.txt, COPYING); the hub requires one for a listing.
  [agent-ready] feed-pack AGENTS.md: AGENTS.md does not list the lifecycle command(s): uv build.
Passed with 2 warning(s).
```

That took 5 seconds. Here's what each part means:

`--lifecycle`` PATH` and an empty home directory. That runs the pack's code, so it's opt-in.`--forbid TEXT``--outdated`` AGENTS.md`, or whose And the proof that it worked: I rendered the pack under a new name and ran its tests.

```
uvx pytemplate-uv@latest create fx-feed --template ./feed-pack -y
cd fx-feed && uv sync && uv run pytest
6 passed in 0.45s
```

No `price` left anywhere in the code.

`pytemplate.api.check_pack` returns the same report as a typed object, and **pytemplate-hub 1.0.2 now uses it**. The tool you run locally and the gate on the hub are one implementation, so "passes locally, fails in the hub's CI" can't happen because of a second copy of the rules.

Put together, this is the conversation the `pytemplate-author` skill is built for:

**You:** Turn this repository into a template my team can reuse.

`pack from-project --json`.` pack check` with the old name forbidden, fixes what it reports, and checks again.`add` command in a fork of the hub.
With no user present, for example in CI, it makes the conservative choice at every step: keep less, add no license, publish nothing. Then it lists each choice in its report.

Each skill is plain instructions over commands with `--json` output and stable exit codes (0 done, 1 refused with nothing written, 2 rendering failed). It works the same in Claude Code and, with `skill install --agent agents`, in Codex and other Agent Skills clients.

Before tagging 3.8.0 I tried the new commands on real projects, not toy examples:

| Trial | Result | 
|---|---|
| A 102-file numerical library | `--lifecycle` passes, and all**493 tests pass** under the new name. 2 hand edits left, both flagged in the report. | 
| pytemplate-hub itself | `--lifecycle` passes in**35 s** (605 s before a fix this trial prompted), and all**288 tests pass** renamed. | 
| The `copier-uv` Copier template | Adapted with the author skill alone in **about 2 minutes** of agent time. 0 errors, and the rendered project's tests pass. | 
| `cookiecutter-pytest-plugin` | About 2 minutes, `--lifecycle` passes, and the rendered project's tests pass. | 
| Every pack listed on the hub | All 8, plus the hub's sample pack, pass `pack check` with no errors. | 

The trials also found what didn't work, and that's the point of running them:

`from my-widget import …`, which isn't valid Python. Fixed: context now decides which name a match becomes.
The release itself: **903 tests** pass, plus **30 opt-in smoke tests** that generate projects and run their whole lifecycle. Every number in this post comes from the published 3.8.0, run on the day it was released.

`verify` use pytemplate-uv's `check_pack`. A refused pack lists every error at once, each naming its profile.`index.json` is now a documented `pytemplate-uv>=3.8,<4`.` from-project` once, and every new project starts from it.
Nothing breaks. 3.8 only adds commands.

Reinstall the skills to get all three (the old install has only `pytemplate`):

```
uvx pytemplate-uv@latest skill install --force
```

`skill install` now installs all three skills by default, and `--skill NAME` installs one. The `pytemplate` skill no longer reads the hub's index itself; it hands off to `pytemplate-find`.

```
# install the three skills for your agent
uvx pytemplate-uv@latest skill install

# find a template
uvx pytemplate-uv@latest search fastapi

# turn your project into one, and check it
uvx pytemplate-uv@latest pack from-project ./my-project ./my-pack --project-name my-project
uvx pytemplate-uv@latest pack check ./my-pack --lifecycle --forbid my-project
```

Both projects are free and MIT-licensed. Issues, criticism, and pull requests are all welcome.

3.0 let you **use** a template. The hub let you **find** one you could trust. 3.8 lets you **make** one from the project you already have, check it the same way the hub does, and hand all three jobs to your coding agent, which runs real commands, stops at secrets, and waits for your word before anything is published.

**Generate once. Own your code. Share what works.**

*pytemplate-uv 3.8.0 is on PyPI; pytemplate-hub 1.0.2 is live. Requires Python 3.11+ on Linux, macOS, or Windows.*

*Disclosure: written by me, polished with the help of AI.*
