/bama:improve-architecturefrom bama
Surveys a growing macOS Swift codebase for architectural hot spots, proposes deeper modules, and refactors in small behavior-preserving steps. Run at milestone ends, before big features, or when files exceed 600 lines.
Ships in bama. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Features pile up, and an app that was easy to change gets hard to change. A check-in catches that early: survey, propose, let the user pick, then refactor in small steps that keep behavior the same. The target shape for apps that grow is in architecture.md.
Any one signal is enough:
improve-loop skill calls this skill there).Use these words exactly, so proposals stay comparable:
Change no code in this step.
Read CLAUDE.md, ARCHITECTURE.md, docs/adr/, and docs/FIXLOG.md
where they exist.
Find hot spots:
git log --since=30.days --name-only --format= | sort | uniq -c | sort -rn | head -20
find Sources -name '*.swift' | xargs wc -l | sort -n | tail -20
Map the structure: targets and their dependencies, protocols and their
conformers, @MainActor types that do I/O, and what runs on which
queue.
Look for Swift friction:
private struct <Name> defined in two files
(grep -rn 'private struct' Sources/ | awk '{print $3}' | sort | uniq -d).@MainActor store, which tests cannot compile
alone. Move it into a plain type that takes plain values.Deletion test for each candidate: if you deleted this module, would its complexity concentrate in one place (keep it) or spread to every caller (it earns its place)? Pass-throughs fail the test.
Write docs/architecture-review-<YYYY-MM-DD>.md, one card per candidate:
## <Title in domain nouns> [Strong | Worth exploring | Speculative]
Files: Sources/App/EditorModel.swift (1,750 lines), ...
Signal: <which trigger above>
Problem: <what is hard to change today, with one example>
Proposal: <the new module and its interface, 15 lines of Swift at most>
Benefits: <locality and leverage; which tests get simpler>
Proof of same behavior: <tests, golden files, snapshots, perf baseline>
Plan: <one commit per step>
End with a top recommendation and a short "considered, not
recommended" list. Saying "the code is fine" is a valid result: then
every card is Speculative or there are none.
Stop and ask the user which candidate to do. In an unattended loop, do the
top recommendation only if it is Strong. Leave the rest in the file.
ARCHITECTURE.md: targets, layers, dependency direction, seams.docs/adr/ only when the decision is hard to reverse,
surprising without context, and a real trade-off.docs/FIXLOG.md entry for any bug the refactor found. Every entry
ends with a Rule: line.Done when the review file exists, the chosen refactor is committed in
steps, the proof gives the same results before and after, and
ARCHITECTURE.md matches the code.
What SKILL.md sets; muted values are Claude Code's defaults
21 skills in this plugin
/agent-cliOptional command line and MCP server for a macOS app, so Claude Code, Codex, and scripts can drive it (list, add, change, search, act) through the running app. Use when the user wants agents to work with their app or its data, asks for a CLI, an MCP server, or automation for the app, or says "Claude should be able to use my app"./app-briefOne-page brief (docs/BRIEF.md) for a new macOS app, written before any code. Use when the user has an app idea, wants to replace an app they pay for, or the research and clone skills are done./app-iconLiquid Glass macOS app icon made as an Icon Composer file (Icon/AppIcon.icon, JSON plus SVG layers), compiled with actool, and reviewed in every look with ictool. Use when the user wants an app icon, a better icon, or a Dock icon./bamaBuild any Mac app. Start here to pick the next skill for a native macOS app./build-and-verifyBuild a SwiftUI macOS app from the command line, install it, and check light and dark window snapshots of every page before calling a change done. Use after any UI code change, when a build fails, or when the user asks to run, screenshot, or check the app./cloneWalk through any existing app (native Mac app with computer use, web app with a browser), screenshot every screen, menu, and dialog, write a screen index, and turn it into user stories. Use when the user wants to clone, rebuild, replace, or copy the design of an app, or says "screenshot every screen".npx claudepluginhub daveebbelaar/bama --plugin bamaOther plugins' skills for the same job