From 2edeaa86b4178e505758291f5a25555208074016 Mon Sep 17 00:00:00 2001 From: Risley Lima Date: Sun, 9 Aug 2026 19:15:25 -0300 Subject: [PATCH 1/2] fix(skills): clear CodeQL code-quality findings in Python builders Add the missing list comma to avoid implicit string concatenation, document intentional empty except clauses, and drop unused sys import. Fixes #106. Co-authored-by: Cursor --- skills/bmad-agent-builder/assets/init-sanctum-template.py | 2 +- skills/bmad-agent-builder/scripts/render_report.py | 1 + .../bmad-module-builder/scripts/scaffold-standalone-module.py | 1 + skills/bmad-workflow-builder/scripts/render_report.py | 1 + skills/bmad-workflow-builder/scripts/tests/test_canon_sync.py | 1 - 5 files changed, 4 insertions(+), 2 deletions(-) diff --git a/skills/bmad-agent-builder/assets/init-sanctum-template.py b/skills/bmad-agent-builder/assets/init-sanctum-template.py index fa78511..5816bc6 100644 --- a/skills/bmad-agent-builder/assets/init-sanctum-template.py +++ b/skills/bmad-agent-builder/assets/init-sanctum-template.py @@ -167,7 +167,7 @@ def generate_capabilities_md(capabilities: list[dict], evolvable: bool) -> str: "", "## Tools", "", - "Prefer crafting your own tools over depending on external ones. A script you wrote " + "Prefer crafting your own tools over depending on external ones. A script you wrote ", "and saved is more reliable than an external API. Use the file system creatively.", "", "### User-Provided Tools", diff --git a/skills/bmad-agent-builder/scripts/render_report.py b/skills/bmad-agent-builder/scripts/render_report.py index 3b5d227..bc66b92 100644 --- a/skills/bmad-agent-builder/scripts/render_report.py +++ b/skills/bmad-agent-builder/scripts/render_report.py @@ -127,6 +127,7 @@ def atomic_write(path: Path, text: str) -> None: try: os.unlink(tmp) except OSError: + # Best-effort temp cleanup; original error must still propagate. pass raise diff --git a/skills/bmad-module-builder/scripts/scaffold-standalone-module.py b/skills/bmad-module-builder/scripts/scaffold-standalone-module.py index d997a76..e5eda7f 100755 --- a/skills/bmad-module-builder/scripts/scaffold-standalone-module.py +++ b/skills/bmad-module-builder/scripts/scaffold-standalone-module.py @@ -142,6 +142,7 @@ def main() -> int: elif stripped.startswith("module_version:"): module_version = stripped.split(":", 1)[1].strip().strip('"').strip("'") except Exception: + # Optional metadata — keep marketplace defaults when module.yaml is missing/unreadable. pass skill_dir_name = skill_dir.name diff --git a/skills/bmad-workflow-builder/scripts/render_report.py b/skills/bmad-workflow-builder/scripts/render_report.py index 3b5d227..bc66b92 100644 --- a/skills/bmad-workflow-builder/scripts/render_report.py +++ b/skills/bmad-workflow-builder/scripts/render_report.py @@ -127,6 +127,7 @@ def atomic_write(path: Path, text: str) -> None: try: os.unlink(tmp) except OSError: + # Best-effort temp cleanup; original error must still propagate. pass raise diff --git a/skills/bmad-workflow-builder/scripts/tests/test_canon_sync.py b/skills/bmad-workflow-builder/scripts/tests/test_canon_sync.py index 6b62b37..c02a071 100644 --- a/skills/bmad-workflow-builder/scripts/tests/test_canon_sync.py +++ b/skills/bmad-workflow-builder/scripts/tests/test_canon_sync.py @@ -9,7 +9,6 @@ Run with: python3 -m pytest test_canon_sync.py (or plain `python3 test_canon_sync.py` for a lightweight self-check). """ -import sys from pathlib import Path SKILLS_DIR = Path(__file__).resolve().parents[3] From 23967867f1f86831d9437504775520ce7f532469 Mon Sep 17 00:00:00 2001 From: Risley Lima Barradas Date: Sat, 15 Aug 2026 12:30:00 -0300 Subject: [PATCH 2/2] fix(skills): merge implicit list concatenations instead of splitting lines Keep CAPABILITIES.md output as a single line by using one list element, and apply the same pattern to shipped sample init scripts. Co-authored-by: Cursor --- samples/bmad-agent-code-coach/scripts/init-sanctum.py | 7 ++----- samples/bmad-agent-creative-muse/scripts/init-sanctum.py | 3 +-- samples/bmad-agent-sentinel/scripts/init-sanctum.py | 3 +-- skills/bmad-agent-builder/assets/init-sanctum-template.py | 3 +-- 4 files changed, 5 insertions(+), 11 deletions(-) diff --git a/samples/bmad-agent-code-coach/scripts/init-sanctum.py b/samples/bmad-agent-code-coach/scripts/init-sanctum.py index 6b86225..1b5a272 100755 --- a/samples/bmad-agent-code-coach/scripts/init-sanctum.py +++ b/samples/bmad-agent-code-coach/scripts/init-sanctum.py @@ -163,17 +163,14 @@ def generate_capabilities_md(capabilities: list[dict], evolvable: bool = False) if evolvable: lines.extend([ "", - "This agent is **evolvable** — you can teach it new skills, modify existing " - "ones, and retire capabilities that aren't useful. The built-in capabilities " - "above are starting points, not limits.", + "This agent is **evolvable** — you can teach it new skills, modify existing ones, and retire capabilities that aren't useful. The built-in capabilities above are starting points, not limits.", ]) lines.extend([ "", "## Tools", "", - "Prefer crafting your own tools over depending on external ones. A script you wrote " - "and saved is more reliable than an external API. Use the file system creatively.", + "Prefer crafting your own tools over depending on external ones. A script you wrote and saved is more reliable than an external API. Use the file system creatively.", "", "### User-Provided Tools", "", diff --git a/samples/bmad-agent-creative-muse/scripts/init-sanctum.py b/samples/bmad-agent-creative-muse/scripts/init-sanctum.py index e7853e7..18eccce 100644 --- a/samples/bmad-agent-creative-muse/scripts/init-sanctum.py +++ b/samples/bmad-agent-creative-muse/scripts/init-sanctum.py @@ -158,8 +158,7 @@ def generate_capabilities_md(capabilities: list[dict]) -> str: "", "## Tools", "", - "Prefer crafting your own tools over depending on external ones. A script you wrote " - "and saved is more reliable than an external API. Use the file system creatively.", + "Prefer crafting your own tools over depending on external ones. A script you wrote and saved is more reliable than an external API. Use the file system creatively.", "", "### User-Provided Tools", "", diff --git a/samples/bmad-agent-sentinel/scripts/init-sanctum.py b/samples/bmad-agent-sentinel/scripts/init-sanctum.py index 507ad8a..9901dd1 100644 --- a/samples/bmad-agent-sentinel/scripts/init-sanctum.py +++ b/samples/bmad-agent-sentinel/scripts/init-sanctum.py @@ -169,8 +169,7 @@ def generate_capabilities_md(capabilities: list[dict], evolvable: bool) -> str: "", "## Tools", "", - "Prefer crafting your own tools over depending on external ones. A script you wrote " - "and saved is more reliable than an external API. Use the file system creatively.", + "Prefer crafting your own tools over depending on external ones. A script you wrote and saved is more reliable than an external API. Use the file system creatively.", "", "### User-Provided Tools", "", diff --git a/skills/bmad-agent-builder/assets/init-sanctum-template.py b/skills/bmad-agent-builder/assets/init-sanctum-template.py index 5816bc6..065a5aa 100644 --- a/skills/bmad-agent-builder/assets/init-sanctum-template.py +++ b/skills/bmad-agent-builder/assets/init-sanctum-template.py @@ -167,8 +167,7 @@ def generate_capabilities_md(capabilities: list[dict], evolvable: bool) -> str: "", "## Tools", "", - "Prefer crafting your own tools over depending on external ones. A script you wrote ", - "and saved is more reliable than an external API. Use the file system creatively.", + "Prefer crafting your own tools over depending on external ones. A script you wrote and saved is more reliable than an external API. Use the file system creatively.", "", "### User-Provided Tools", "",