Skip to content

Standardize builders: runtime memlog + uv script invocations#98

Merged
bmadcode merged 2 commits into
mainfrom
memlog-standardization
Jun 20, 2026
Merged

Standardize builders: runtime memlog + uv script invocations#98
bmadcode merged 2 commits into
mainfrom
memlog-standardization

Conversation

@bmadcode

@bmadcode bmadcode commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Two related standardizations for bmad-workflow-builder and bmad-agent-builder.

1. Runtime-installed memlog

Point both builders at the runtime memlog CLI at {project-root}/_bmad/scripts/memlog.py instead of each skill bundling its own copy. Canonical source is bmad-bmm/src/scripts/memlog.py, which installs to {project-root}/_bmad/scripts/. One shared copy, no drift; {project-root} resolves at runtime so the call works from any skill root.

  • Redirect the builders' own memlog calls + what they teach/emit (incl. rewriting the obsolete "copy the CLI into each built skill" guidance).
  • Delete the bundled scripts/memlog.py copies (and workflow-builder's scripts/tests/test_memlog.py).

2. uv run script invocations

Replace python3 <script> with uv run <script> across prompt-facing invocations, script usage strings, and the emitted init-sanctum/wake template usage. Align bmad-workflow-builder/references/script-standards.md to mandate uv run for all scripts, matching agent-builder.

Left as-is (not invocations): #!/usr/bin/env python3 shebangs (stdlib-script convention per script-standards), "runs under a bare python3" capability notes, and python3 -m pytest test-runner docstrings.

Verification

  • Zero bare scripts/memlog.py references remain; nothing imports the deleted module.
  • Only intended python3 occurrences remain (shebangs / capability notes / pytest docstrings); edited scripts compile.

bmm core skills are being standardized separately.

Summary by CodeRabbit

  • Refactor

    • Consolidated memlog “decision trail” handling to a centralized project-root script, removing duplicate memlog implementations from individual skill directories.
  • Documentation

    • Updated skill/workflow build and activation instructions (including templates and reference guides) to run scripts via uv run, and to reference the centralized memlog and related tooling paths consistently.
  • Tests

    • Removed the memlog test suite for the workflow builder scripts.

Reference {project-root}/_bmad/scripts/memlog.py (sourced from bmm core
src/scripts) instead of bundling a per-skill copy, in bmad-workflow-builder
and bmad-agent-builder. Remove the bundled memlog.py copies and the
workflow-builder memlog test; rewrite the working-state teaching so produced
skills reference the runtime CLI rather than copying it in.
@coderabbitai

coderabbitai Bot commented Jun 20, 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

Run ID: 5174b623-46b3-47f0-a1e6-f2aa7a55e96c

📥 Commits

Reviewing files that changed from the base of the PR and between 908251b and 0ac8340.

📒 Files selected for processing (15)
  • skills/bmad-agent-builder/SKILL.md
  • skills/bmad-agent-builder/assets/SKILL-template-bootloader.md
  • skills/bmad-agent-builder/assets/SKILL-template.md
  • skills/bmad-agent-builder/assets/init-sanctum-template.py
  • skills/bmad-agent-builder/assets/wake-template.py
  • skills/bmad-agent-builder/references/build-process.md
  • skills/bmad-agent-builder/references/quality-analysis.md
  • skills/bmad-agent-builder/references/template-substitution-rules.md
  • skills/bmad-agent-builder/scripts/render_report.py
  • skills/bmad-workflow-builder/SKILL.md
  • skills/bmad-workflow-builder/assets/SKILL-template.md
  • skills/bmad-workflow-builder/references/build-process.md
  • skills/bmad-workflow-builder/references/scan-orchestration.md
  • skills/bmad-workflow-builder/references/script-standards.md
  • skills/bmad-workflow-builder/scripts/render_report.py
✅ Files skipped from review due to trivial changes (4)
  • skills/bmad-workflow-builder/scripts/render_report.py
  • skills/bmad-agent-builder/scripts/render_report.py
  • skills/bmad-agent-builder/assets/wake-template.py
  • skills/bmad-agent-builder/assets/init-sanctum-template.py
🚧 Files skipped from review as they are similar to previous changes (2)
  • skills/bmad-workflow-builder/assets/SKILL-template.md
  • skills/bmad-workflow-builder/SKILL.md

Walkthrough

Updates all Python script invocations across skill documentation and templates to use uv run instead of python3. Consolidates memlog.py path references from relative scripts/memlog.py to the shared {project-root}/_bmad/scripts/memlog.py location. Documentation in working-state-patterns.md and script-standards.md is updated to codify these patterns for future skill builds.

Changes

Script invocation standardization and memlog consolidation

Layer / File(s) Summary
Canonical memlog consolidation pattern
skills/bmad-workflow-builder/references/working-state-patterns.md
"Entry types and the CLI" section rewritten to establish that memlog.py resides at {project-root}/_bmad/scripts/memlog.py and that built skills invoke it from that shared location rather than copying it into their own scripts/ directory.
Consolidate memlog path references across skills and documentation
skills/bmad-agent-builder/SKILL.md, skills/bmad-agent-builder/references/build-process.md, skills/bmad-agent-builder/references/quality-analysis.md, skills/bmad-workflow-builder/SKILL.md, skills/bmad-workflow-builder/assets/SKILL-template.md, skills/bmad-workflow-builder/references/build-process.md, skills/bmad-workflow-builder/references/scan-orchestration.md, skills/bmad-workflow-builder/references/skill-quality-principles.md
All memlog.py invocation paths are updated from relative scripts/memlog.py to {project-root}/_bmad/scripts/memlog.py across both skill trees.
Standardize script invocation to uv run across all documentation
skills/bmad-agent-builder/references/build-process.md, skills/bmad-agent-builder/references/quality-analysis.md, skills/bmad-agent-builder/references/template-substitution-rules.md, skills/bmad-agent-builder/assets/SKILL-template-bootloader.md, skills/bmad-agent-builder/assets/SKILL-template.md, skills/bmad-workflow-builder/SKILL.md, skills/bmad-workflow-builder/assets/SKILL-template.md, skills/bmad-workflow-builder/references/build-process.md, skills/bmad-workflow-builder/references/scan-orchestration.md, skills/bmad-workflow-builder/references/script-standards.md
All Python script invocations migrate from python3 to uv run. Includes resolve_customization.py, process-template.py, render_report.py, prepass scripts, init_skill.py, and lint validation commands. Script-standards.md prescribes uv run as the universal invocation pattern for all local scripts.
Update script docstring usage examples to uv run
skills/bmad-agent-builder/assets/init-sanctum-template.py, skills/bmad-agent-builder/assets/wake-template.py, skills/bmad-agent-builder/scripts/render_report.py, skills/bmad-workflow-builder/scripts/render_report.py
Module docstrings and error messages are updated to show uv run invocation examples instead of direct python3 execution.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐇 From python3 to uv run, scripts now take flight,
One memlog home in _bmad/scripts/, unified and right.
I hopped through the docs with consistent care,
Every reference updated everywhere!
A standardized workflow, clean and fair! 🌟

🚥 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 'Standardize builders: runtime memlog + uv script invocations' accurately and specifically describes the two main changes: consolidating memlog to use a runtime centralized version and standardizing script invocations to use uv run instead of python3.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch memlog-standardization

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 and usage tips.

@augmentcode

augmentcode Bot commented Jun 20, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: This PR standardizes the two builder skills to use the runtime-installed memlog CLI instead of bundling per-skill copies.

Changes:

  • Updated bmad-workflow-builder docs/templates to reference {project-root}/_bmad/scripts/memlog.py for memlog operations.
  • Updated bmad-agent-builder docs to reference the same runtime memlog path.
  • Rewrote guidance that previously instructed copying memlog.py into each built skill.
  • Removed vendored scripts/memlog.py from both builders to avoid drift.
  • Removed the workflow-builder’s local memlog tests that exercised the vendored implementation.

Why: memlog is a shared core script; keeping a single canonical runtime-installed copy reduces duplication and prevents divergence between bundled copies.

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode 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.

Review completed. 2 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.


```bash
python3 scripts/memlog.py append --path {target-agent-path}/.memlog.md --type event --text "analyze: grade <grade>, <c> critical / <h> high / <m> medium / <l> low, report .analysis/<timestamp>/agent-analysis-report.html"
python3 {project-root}/_bmad/scripts/memlog.py append --path {target-agent-path}/.memlog.md --type event --text "analyze: grade <grade>, <c> critical / <h> high / <m> medium / <l> low, report .analysis/<timestamp>/agent-analysis-report.html"

@augmentcode augmentcode Bot Jun 20, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Because this is shown as a bash snippet, {project-root} will be a literal string if copy/pasted; unless something substitutes it before execution, the command will fail to locate memlog.py. Consider clarifying that the placeholder must be resolved (and safely handled if the resolved path can contain spaces) before running.

Severity: low

Other Locations
  • skills/bmad-workflow-builder/references/scan-orchestration.md:112
  • skills/bmad-workflow-builder/assets/SKILL-template.md:49

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

@@ -1,247 +0,0 @@
# /// script

@augmentcode augmentcode Bot Jun 20, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

With these tests removed, this repo no longer exercises the memlog CLI invariants (append-only ordering, atomic writes, JSON ack), so regressions in the runtime-installed memlog could slip by unnoticed. Consider ensuring equivalent coverage exists wherever {project-root}/_bmad/scripts/memlog.py is sourced/shipped.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

Replace `python3 <script>` with `uv run <script>` across bmad-workflow-builder
and bmad-agent-builder: prompt-facing invocations, script usage strings, and the
emitted init-sanctum/wake template usage. Align workflow-builder's
script-standards.md to mandate `uv run` for all scripts, matching agent-builder.

Left as-is: `#!/usr/bin/env python3` shebangs (stdlib-script convention per
script-standards), "runs under a bare python3" capability notes, and
`python3 -m pytest` test-runner docstrings.
@bmadcode bmadcode changed the title Standardize builders on runtime-installed memlog Standardize builders: runtime memlog + uv script invocations Jun 20, 2026
@bmadcode bmadcode merged commit d97d675 into main Jun 20, 2026
4 checks passed
bmadcode added a commit that referenced this pull request Jun 22, 2026
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