Skip to content

fix: invoke Python scripts with uv run across skills, samples, and docs - #105

Open
bmadcode wants to merge 2 commits into
mainfrom
uv-run-conversion
Open

fix: invoke Python scripts with uv run across skills, samples, and docs#105
bmadcode wants to merge 2 commits into
mainfrom
uv-run-conversion

Conversation

@bmadcode

@bmadcode bmadcode commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

#98 standardized on uv run for bmad-agent-builder and bmad-workflow-builder, but bmad-bmb-setup, bmad-module-builder, and bmad-eval-runner were missed. This finishes it — 57 invocations across skills/, samples/, and docs/how-to/.

Why it matters beyond consistency: a bare python3 is not guaranteed to be 3.11+, which BMad's shared resolve_customization.py requires for tomllib. uv run reads a script's own requires-python and provisions a matching interpreter.

Breakdown

Where Count
skills/ invocations 14
samples/ .md invocations 10
.py usage strings and docstrings 33
README badge >=3.10>=3.11 1

Five of the skills/ fixes are in emitted templatesassets/setup-skill-template/ and assets/standalone-module-template/ — so every module scaffolded by bmad-module-builder stops inheriting the defect.

There was a visible seam before this: init-sanctum-template.py had been converted, but the three samples/*/scripts/init-sanctum.py copies generated from it still said python3. They now agree.

pytest lines

python3 -m pytest X becomes uv run --with pytest -m pytest X, matching the convention in bmad-method. Those test files carry no PEP 723 block, so uv has nothing else to resolve pytest from. Verified rather than assumed:

$ uv run --with pytest -m pytest test_env_isolation.py
test_env_isolation.py ....                    [100%]
4 passed in 0.01s

Deliberately left alone

  • The two anti-pattern cells in docs/explanation/scripts-in-skills.md:110 (labelled Fragile) and skill-authoring-best-practices.md:22 ("do not modify"). They teach what not to do; converting them would invert the lesson.
  • "runs under a bare python3" prose in count_tokens.py and prepass.py — describes a script's lack of third-party dependencies, invokes nothing, still true.
  • Per-script requires-python floors (>=3.9 / >=3.10) — correct as written. None of these scripts import tomllib; the 3.11 requirement is inherited from bmad-method's shared resolver, not native here.

Verification

Every touched .py parses (AST check on all 28 files). A converted usage string was smoke-tested end to end — uv run samples/bmad-excalidraw/scripts/validate_excalidraw.py prints its argparse usage, so the line it now advertises is the line that works. markdownlint and prettier pass.

Note for the next release entry

CHANGELOG.md:13 claims #98 standardized uv run across builder scripts. That was not true when written — it covered two of five skills. I have not rewritten it, since editing shipped release history to hide an inaccuracy is worse than the inaccuracy. As of this branch the statement is finally true; worth a line in the next entry saying the conversion actually completed here.

Part of an ecosystem-wide pass — the same fix is going into bmad-method, creative-intelligence-suite, game-dev-studio, and test-architecture-enterprise.

Summary by CodeRabbit

  • Documentation
    • Updated the minimum supported Python version to 3.11.
    • Revised installation, setup, evaluation, validation, testing, and sample usage instructions to run commands through uv.
    • Updated usage messages and examples to consistently show the new command format.
    • Added the 2.2.0 changelog entry and standardized historical formatting.
  • Chores
    • Updated marketplace component versions to 2.2.0.
    • Standardized Python script execution guidance without changing runtime behavior.

PR #98 standardized on `uv run` for bmad-agent-builder and
bmad-workflow-builder, but bmad-bmb-setup, bmad-module-builder, and
bmad-eval-runner were missed. This finishes it: 57 invocations across
skills/, samples/, and docs/how-to/.

Why it matters beyond consistency: a bare `python3` is not guaranteed to
be 3.11+, which BMad's shared resolve_customization.py requires for
tomllib. `uv run` reads a script's own requires-python and provisions a
matching interpreter.

Five of the fixes are in assets/setup-skill-template/ and
assets/standalone-module-template/ — the templates bmad-module-builder
emits — so every module scaffolded from bmb stops inheriting the defect.

pytest lines become `uv run --with pytest -m pytest`, matching the
convention in bmad-method: those test files carry no PEP 723 block, so uv
has nothing else to resolve pytest from.

Left deliberately: the two anti-pattern cells in docs/explanation/
(labelled Fragile and "do not modify"), which teach what not to do; the
"runs under a bare python3" prose, which describes a script's lack of
dependencies rather than invoking anything; and the per-script
requires-python floors, which are correct as written.

Also corrects the README badge, which advertised >=3.10 — a floor that
cannot run the shared resolver.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your trial has ended. Reactivate Greptile to resume code reviews.

@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a0cf1826-caf5-41f3-83c5-3081c532c1e6

📥 Commits

Reviewing files that changed from the base of the PR and between 19e4d64 and 6759001.

📒 Files selected for processing (2)
  • .claude-plugin/marketplace.json
  • CHANGELOG.md

Walkthrough

The README now requires Python 3.11. Documentation, sample scripts, skill instructions, and test usage examples now invoke Python tooling through uv run. Marketplace versions and the changelog now reflect release 2.2.0.

Changes

Python command standardization

Layer / File(s) Summary
Baseline Python requirements and guides
README.md, docs/how-to/*
The minimum Python version is 3.11. General Python commands now use uv run.
Sample command usage
samples/bmad-agent-*/**, samples/bmad-excalidraw/**, samples/sample-module-setup/SKILL.md
Sample setup, generation, validation, wake, and initialization commands now use uv run.
Skill tooling and test usage
skills/bmad-bmb-setup/**, skills/bmad-eval-runner/**, skills/bmad-module-builder/**, skills/bmad-workflow-builder/**
Skill setup, evaluation, module-building, workflow, and test instructions now use uv run.
Release metadata synchronization
.claude-plugin/marketplace.json, CHANGELOG.md
Marketplace entries use version 2.2.0. The changelog adds the 2.2.0 entry and normalizes older list markers.

Estimated code review effort: 2 (Simple) | ~10 minutes

Poem

A rabbit checks each command line,
uv run makes the syntax align.
Python 3.11 leads the way,
Release notes mark 2.2.0 today.
No runtime logic hops astray.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: replacing direct Python invocations with uv run across skills, samples, and documentation.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch uv-run-conversion

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Documents the uv run conversion in this branch, and notes plainly that the
2.1.0 entry's claim about #98 covered only two of the five skills.

All three marketplace plugins go 2.1.0 -> 2.2.0.
@bmadcode

Copy link
Copy Markdown
Contributor Author

Pushed the v2.2.0 changelog entry and marketplace version bump onto this branch rather than opening a second PR, since the entry documents the work that lives here — splitting them would have left a changelog describing unmerged code.

Changelog — a ## [2.2.0] - 2026-08-09 entry covering the conversion, the emitted templates, the uv run --with pytest treatment, and the badge fix. It also states plainly that v2.1.0's claim about #98 covered only two of the five skills, and records what was deliberately left unconverted (the two anti-pattern cells, the "runs under a bare python3" prose, the per-script requires-python floors).

Version bump — all three marketplace plugins 2.1.02.2.0. Nothing in the release workflow touches .claude-plugin/marketplace.json, so it drifts from package.json unless bumped by hand. package.json is left alone; the release workflow owns it.

Worth copying from bmad-method-test-architecture-enterprise: it has a Sync marketplace version step in publish.yaml plus a test-release-metadata.js guard that fails the suite when the two disagree. That would remove the manual step here. In game-dev-studio, the same drift let a dead skill path survive a full release.

markdownlint and prettier pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant