Skip to content

m3taz-ahmed/aizee / skills/bmad-toolsmith

bmad-toolsmith

Verified

Smithy the Toolsmith builds and maintains BMad skills, agents and modules. Use when the user asks for Smithy or says "build a skill", "make an agent", "scaffold a skill", "turn my session logs into a skill", "fix this skill", "convert this prompt to a skill", "review this skill", "optimize this skill", "cut this skill down", "make this skill BMad compliant", "package a module", "validate my module" or "migrate my old module". Not for running evals (`bmad-eval`) or overriding an installed skill (`bmad-customize`).

FileKindSize
SKILL.mdskill md3.6 KB
approaches/eval-first.mdmarkdown1.3 KB
approaches/eval-loop.mdmarkdown2.4 KB
approaches/from-logs.mdmarkdown1.7 KB
approaches/lean.mdmarkdown1.7 KB
approaches/scaffold.mdmarkdown1.3 KB
approaches/skill-creator-loop.mdmarkdown1.2 KB
bmod.tomlconfig118 B
canon.mdmarkdown10.5 KB
customize.tomlconfig4.8 KB
discover.mdmarkdown5.5 KB
evals/triggers.jsonconfig3.3 KB
lenses/lens-architecture.mdmarkdown2.9 KB
lenses/lens-contract.mdmarkdown1.4 KB
lenses/lens-customization.mdmarkdown2.4 KB
lenses/lens-determinism.mdmarkdown1.8 KB
lenses/lens-leanness.mdmarkdown3.1 KB
lenses/lens-trigger.mdmarkdown2.4 KB
lenses/standards.mdmarkdown5.2 KB
modes/convert.mdmarkdown2.1 KB
modes/cut-roles.mdmarkdown3.3 KB
modes/cut.mdmarkdown3.3 KB
modes/edit.mdmarkdown1.3 KB
modes/migrate.mdmarkdown3.3 KB
modes/package.mdmarkdown2.6 KB
modes/review.mdmarkdown1.3 KB
modes/validate.mdmarkdown1.8 KB
scripts/count_tokens.pyscript3.6 KB
scripts/cut_check.pyscript5.1 KB
scripts/init_skill.pyscript13.3 KB
scripts/prepass.pyscript7.5 KB
scripts/process_template.pyscript4.8 KB
scripts/read_session_log.pyscript9.8 KB
scripts/registry.pyscript5.9 KB
scripts/scan_legacy_module.pyscript7.7 KB
scripts/scan_paths.pyscript9.2 KB
scripts/scan_scripts.pyscript6.6 KB
scripts/tests/test_count_tokens.pyscript4.1 KB
scripts/tests/test_cut_check.pyscript3.1 KB
scripts/tests/test_init_skill.pyscript9.7 KB
scripts/tests/test_memory_agent_scripts.pyscript8.6 KB
scripts/tests/test_prepass.pyscript8.3 KB
scripts/tests/test_process_template.pyscript4.7 KB
scripts/tests/test_read_session_log.pyscript7.3 KB
scripts/tests/test_registry.pyscript6.0 KB
scripts/tests/test_scan_legacy_module.pyscript8.2 KB
scripts/tests/test_scan_paths.pyscript7.7 KB
scripts/tests/test_scan_scripts.pyscript4.1 KB
shapes/agent/assets/SKILL-template.mdmarkdown2.0 KB
shapes/agent/assets/capability-template.mdmarkdown582 B
shapes/agent/assets/customize-template.tomlconfig1.9 KB
shapes/agent/assets/sample-capability.mdmarkdown887 B
shapes/agent/shape.mdmarkdown3.2 KB
shapes/memory-agent/assets/BOND-template.mdmarkdown392 B
shapes/memory-agent/assets/CAPABILITIES-template.mdmarkdown1017 B
shapes/memory-agent/assets/CREED-template.mdmarkdown2.1 KB
shapes/memory-agent/assets/HOW-I-REMEMBER-template.mdmarkdown3.3 KB
shapes/memory-agent/assets/PERSONA-template.mdmarkdown705 B
shapes/memory-agent/assets/PULSE-template.mdmarkdown849 B
shapes/memory-agent/assets/SKILL-template-bootloader.mdmarkdown4.2 KB
shapes/memory-agent/assets/customize-template.tomlconfig1.2 KB
shapes/memory-agent/assets/first-breath-config-template.mdmarkdown4.5 KB
shapes/memory-agent/assets/first-breath-template.mdmarkdown9.3 KB
shapes/memory-agent/assets/init-sanctum-template.pyscript5.7 KB
shapes/memory-agent/assets/intake-capability-template.mdmarkdown975 B
shapes/memory-agent/assets/wake-template.pyscript6.8 KB
shapes/memory-agent/shape.mdmarkdown5.0 KB
shapes/multi-skill-module/assets/help-template.mdmarkdown623 B
shapes/multi-skill-module/assets/member-bmod-template.tomlconfig490 B
shapes/multi-skill-module/assets/record-SKILL-template.mdmarkdown374 B
shapes/multi-skill-module/assets/record-bmod-template.tomlconfig802 B
shapes/multi-skill-module/assets/retired-template.tomlconfig287 B
shapes/multi-skill-module/assets/roster-template.tomlconfig567 B
shapes/multi-skill-module/shape.mdmarkdown4.3 KB
shapes/plain-skill/assets/SKILL-template.mdmarkdown2.0 KB
shapes/plain-skill/assets/customize-template.tomlconfig1.0 KB
shapes/plain-skill/shape.mdmarkdown2.9 KB
shapes/rendered-agent/assets/SKILL-template.mdmarkdown1.0 KB
shapes/rendered-agent/assets/capability.mdmarkdown1.1 KB
shapes/rendered-agent/assets/customize-template.tomlconfig2.6 KB
shapes/rendered-agent/assets/workflow.mdmarkdown1.8 KB
shapes/rendered-agent/shape.mdmarkdown3.8 KB
shapes/rendered-skill/assets/SKILL-template.mdmarkdown1.0 KB
shapes/rendered-skill/assets/customize-template.tomlconfig990 B
shapes/rendered-skill/assets/step.mdmarkdown688 B
shapes/rendered-skill/assets/workflow.mdmarkdown1004 B
shapes/rendered-skill/shape.mdmarkdown2.2 KB
shapes/script-utility/assets/SKILL-template.mdmarkdown859 B
shapes/script-utility/assets/script-template.pyscript1.5 KB
shapes/script-utility/assets/test-template.pyscript1.2 KB
shapes/script-utility/shape.mdmarkdown1.6 KB
shapes/single-skill-module/assets/bmod-template.tomlconfig696 B
shapes/single-skill-module/assets/help-template.mdmarkdown177 B
shapes/single-skill-module/shape.mdmarkdown2.5 KB
ship.mdmarkdown6.4 KB

scripts/tests/test_scan_legacy_module.py

View on GitHub
"""Tests for scan_legacy_module.py on fixtures shaped like the old multi-skill and single-skill modules."""

import json
import subprocess
import sys
import tempfile
import unittest
from pathlib import Path

SCRIPT = Path(__file__).resolve().parents[1] / "scan_legacy_module.py"

MODULE_YAML = """code: sam
name: "BMad Samples"
description: "Demo module"
module_version: 1.2.0
default_selected: false
module_greeting: >
  The BMad Samples module is ready!
  Enjoy.

agents:
  - code: dw-agent
    name: Oneira
    title: Dream Guide

sample_output_folder:
  prompt: "Where should sample output be saved?"
  default: "{project-root}/_bmad-output"
  result: "{project-root}/{value}"

tone:
  prompt: "Which tone?"
  default: warm
  user_setting: true
  single-select:
    - value: warm
      label: Warm
    - value: dry
      label: Dry

verbose:
  prompt: "Verbose output?"
  default: false
"""

HELP_CSV = (
    "module,skill,display-name,menu-code,description,action,args,phase,preceded-by,followed-by,required,output-location,outputs\n"
    'BMad Samples,sample-module-setup,Setup Samples Module,SS,"Install or update config.",configure,"{-H: headless}",anytime,,,false,{project-root}/_bmad,config.yaml\n'
    'BMad Samples,bmad-agent-dream-weaver,Dream Capture,DL,"Capture a dream.",dream-log,,anytime,,,false,,journal entry\n'
    'BMad Samples,bmad-excalidraw,Create Diagram,XD,"Create diagrams.",diagram-generation,,anytime,,,false,sample_output_folder,excalidraw file\n'
)

SETUP_SKILL_MD = "---\nname: sample-module-setup\ndescription: 'Setup. Use when installing.'\n---\n\nRead `./assets/module.yaml`; write `{project-root}/_bmad/config.yaml`.\n"
DREAM_SKILL_MD = (
    "---\nname: bmad-agent-dream-weaver\ndescription: 'Dreams. Use when dreaming.'\n---\n\n"
    "If `{project-root}/_bmad/config.yaml` has no `sam` section, run the `sample-module-setup` skill.\n"
    "Personal settings live in `config.user.yaml`.\n"
)
EXCALIDRAW_SKILL_MD = "---\nname: bmad-excalidraw\ndescription: 'Diagrams. Use when drawing.'\n---\n\nRead `{project-root}/_bmad/config.toml`.\n"


def write(root: Path, files: dict[str, str]) -> None:
    for relative, text in files.items():
        path = root / relative
        path.parent.mkdir(parents=True, exist_ok=True)
        path.write_text(text, encoding="utf-8")


def run(folder: Path):
    res = subprocess.run([sys.executable, str(SCRIPT), str(folder)], capture_output=True, text=True)
    return res.returncode, json.loads(res.stdout) if res.stdout.strip() else None, res.stderr


class ScanLegacyModuleTest(unittest.TestCase):
    def test_multi_skill_module_with_setup_skill(self):
        with tempfile.TemporaryDirectory() as tmp:
            root = Path(tmp) / "samples"
            write(
                root,
                {
                    "sample-module-setup/SKILL.md": SETUP_SKILL_MD,
                    "sample-module-setup/assets/module.yaml": MODULE_YAML,
                    "sample-module-setup/assets/module-help.csv": HELP_CSV,
                    "sample-module-setup/scripts/merge-config.py": "print(1)\n",
                    "sample-module-setup/scripts/merge-help-csv.py": "print(1)\n",
                    "sample-module-setup/scripts/cleanup-legacy.py": "print(1)\n",
                    "bmad-agent-dream-weaver/SKILL.md": DREAM_SKILL_MD,
                    "bmad-agent-dream-weaver/references/memory.md": "Nothing legacy here.\n",
                    "bmad-excalidraw/SKILL.md": EXCALIDRAW_SKILL_MD,
                    "node_modules/x/module.yaml": "code: ignored\n",
                },
            )
            code, data, err = run(root)
            self.assertEqual(code, 0, err)
            self.assertEqual(
                set(data),
                {"module", "config_keys", "help_rows", "skills", "legacy_reads", "setup_skill", "files_to_delete"},
            )
            self.assertEqual(
                data["module"],
                {
                    "code": "sam",
                    "name": "BMad Samples",
                    "version": "1.2.0",
                    "greeting": "The BMad Samples module is ready! Enjoy.",
                    "agents": [{"code": "dw-agent", "name": "Oneira", "title": "Dream Guide"}],
                },
            )
            keys = {k["key"]: k for k in data["config_keys"]}
            self.assertEqual(list(keys), ["sample_output_folder", "tone", "verbose"])
            self.assertEqual(keys["sample_output_folder"]["kind"], "text")
            self.assertEqual(keys["sample_output_folder"]["default"], "{project-root}/_bmad-output")
            self.assertFalse(keys["sample_output_folder"]["user_setting"])
            self.assertEqual(len(keys["sample_output_folder"]["unconvertible"]), 1)
            self.assertIn("result template", keys["sample_output_folder"]["unconvertible"][0])
            self.assertEqual(keys["tone"]["kind"], "single-select")
            self.assertTrue(keys["tone"]["user_setting"])
            self.assertEqual(keys["tone"]["prompt"], "Which tone?")
            self.assertEqual(keys["verbose"]["kind"], "confirm")
            self.assertEqual(keys["verbose"]["default"], False)
            self.assertEqual(len(data["help_rows"]), 3)
            self.assertEqual(data["help_rows"][1]["skill"], "bmad-agent-dream-weaver")
            self.assertEqual(data["help_rows"][1]["menu-code"], "DL")
            self.assertEqual(data["help_rows"][2]["output-location"], "sample_output_folder")
            self.assertEqual(data["skills"], ["bmad-agent-dream-weaver", "bmad-excalidraw"])
            self.assertEqual(data["setup_skill"], "sample-module-setup")
            self.assertEqual(data["files_to_delete"], ["sample-module-setup/"])
            self.assertEqual(
                [(r["skill"], r["path"], r["line"]) for r in data["legacy_reads"]],
                [
                    ("bmad-agent-dream-weaver", "bmad-agent-dream-weaver/SKILL.md", 6),
                    ("bmad-agent-dream-weaver", "bmad-agent-dream-weaver/SKILL.md", 7),
                ],
            )
            self.assertIn("sample-module-setup", data["legacy_reads"][0]["text"])

    def test_single_skill_module_with_module_setup(self):
        with tempfile.TemporaryDirectory() as tmp:
            root = Path(tmp) / "bmad-agent-dream-weaver"
            write(
                root,
                {
                    "SKILL.md": DREAM_SKILL_MD.replace(
                        "run the `sample-module-setup` skill", "load `assets/module-setup.md`"
                    ),
                    "assets/module.yaml": "code: dw\nname: Dream Weaver\nmodule_version: 1.0.0\nmodule_greeting: Hi.\n",
                    "assets/module-help.csv": HELP_CSV.splitlines()[0] + "\n" + HELP_CSV.splitlines()[2] + "\n",
                    "assets/module-setup.md": "Writes `{project-root}/_bmad/config.yaml`.\n",
                    "scripts/merge-config.py": "print(1)\n",
                    "scripts/merge-help-csv.py": "print(1)\n",
                    "scripts/seed_tracker.py": "print(1)\n",
                },
            )
            code, data, err = run(root)
            self.assertEqual(code, 0, err)
            self.assertEqual(data["module"]["code"], "dw")
            self.assertEqual(data["module"]["agents"], [])
            self.assertEqual(data["config_keys"], [])
            self.assertIsNone(data["setup_skill"])
            self.assertEqual(data["skills"], ["bmad-agent-dream-weaver"])
            self.assertEqual(
                data["files_to_delete"],
                [
                    "assets/module-help.csv",
                    "assets/module-setup.md",
                    "assets/module.yaml",
                    "scripts/merge-config.py",
                    "scripts/merge-help-csv.py",
                ],
            )
            self.assertEqual([r["line"] for r in data["legacy_reads"]], [6, 7])
            self.assertEqual(data["legacy_reads"][0]["skill"], "bmad-agent-dream-weaver")

    def test_no_module_yaml_and_bad_path(self):
        with tempfile.TemporaryDirectory() as tmp:
            code, data, err = run(Path(tmp))
            self.assertEqual(code, 1)
            self.assertIn("no module.yaml", err)
        res = subprocess.run([sys.executable, str(SCRIPT), "/nonexistent"], capture_output=True, text=True)
        self.assertEqual(res.returncode, 2)


if __name__ == "__main__":
    unittest.main()
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 322kUpdated Claude CodeCodexVerifiedInstall