# Improve architecture

> Improve architecture is an open-source agent skill for developer tools. Runs a架构 check-in on a growing Swift app and refactors it in proven steps. It is available on Claude Code.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code
- **Website:** https://github.com/daveebbelaar/bama/tree/main/skills/code/improve-architecture
- **Repository:** https://github.com/daveebbelaar/bama
- **GitHub stars:** 2,009
- **License:** MIT
- **Skill name:** improve-architecture
- **Collection:** https://github.com/daveebbelaar/bama
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-01

## About

This skill guides an agent through an architecture review of a macOS Swift codebase that has grown hard to change. It starts with a read-only survey: it checks project notes and decision records, ranks hot spots by recent git churn and file size, maps targets and dependencies, and looks for recurring Swift problems such as god models, pass-through wrappers and state published to every view.

The agent then writes a dated review file with one card per candidate module, each rated Strong, Worth exploring or Speculative, along with a top recommendation. It is told to stop and ask which candidate to pursue, and to act on its own only when the top pick is rated Strong. The workflow relies on a shared vocabulary of modules, seams, adapters and depth so that proposals stay comparable.

For the refactor, the skill requires recording proof of unchanged behavior first (interface tests, golden outputs, snapshots or performance baselines), then making one change per commit with the project building after each step. It also covers updating ARCHITECTURE.md and adding fix-log or decision records where the content calls for them. It expects a Swift project with git history and does not ship scripts, relying on shell commands the agent runs itself.

## When your agent uses it

> Architecture check-in for a growing macOS Swift codebase. Finds hot spots, proposes deeper modules, and refactors one step per commit with behavior proven unchanged. Use at the end of a milestone, before a big feature, when a file passes 600 lines, when one feature touches many files, when bugs repeat in one area, or when the user asks to refactor or clean up the code.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/daveebbelaar/bama/tree/HEAD/skills/code/improve-architecture)
- [License: MIT](https://github.com/daveebbelaar/bama/tree/HEAD/skills/code/improve-architecture)

## Features

- **Hot spot survey:** Ranks files by recent git churn and size, and maps targets, protocols and threading.
- **Swift friction checklist:** Checks for god models, forwarding wrappers, drifted duplicate types and main-thread work.
- **Deletion test:** Judges whether each candidate module earns its place by where its complexity would move.
- **Ranked architecture review:** Writes a dated review file with rated candidate cards and a top recommendation.
- **Stepwise refactoring:** Applies one behavior-preserving change per commit, with the build passing after each step.
- **Behavior proof first:** Requires interface tests, golden outputs or baselines before any code moves.
- **Architecture records:** Updates the architecture document, decision records and fix log to match the code.

## Good for

- Review my Swift app for hot spots before starting a big feature
- Split a 1,200-line view model into smaller modules without changing behavior
- Find duplicate private types across my macOS app's source files
- Plan a refactor of a feature that touches too many files
- Clean up repeated bugs in one area of my Swift codebase

## Install

### Claude Code

This skill ships in the `bama` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add daveebbelaar/bama
/plugin install bama@bama
```

Or copy only this skill to `~/.claude/skills/improve-architecture`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/daveebbelaar/bama.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/improve-architecture &&
cp -R "$tmp/skills/code/improve-architecture" ~/.claude/skills/improve-architecture &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/improve-architecture` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/improve-architecture` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/daveebbelaar/bama.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/improve-architecture &&
cp -R "$tmp/skills/code/improve-architecture" ~/.agents/skills/improve-architecture &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/improve-architecture` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/improve-architecture` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/daveebbelaar/bama.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/improve-architecture &&
cp -R "$tmp/skills/code/improve-architecture" ~/.cursor/skills/improve-architecture &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/improve-architecture` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/daveebbelaar/bama.git --path skills/code/improve-architecture
```

Or copy the folder to `~/.gemini/skills/improve-architecture` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/improve-architecture`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/daveebbelaar/bama.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/improve-architecture &&
cp -R "$tmp/skills/code/improve-architecture" ~/.copilot/skills/improve-architecture &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/improve-architecture` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/daveebbelaar/bama.git
```

Then copy `bama/skills/code/improve-architecture` into your agent's skills folder as `improve-architecture`. Agents that support SKILL.md read one folder per skill.

## FAQ

### When does Improve architecture trigger?

It applies at the end of a milestone, before a large feature, when a Swift file passes 600 lines, when one feature touches many files or targets, when bugs repeat in one area, or when the user asks for a refactor or cleanup.

### Does Improve architecture change code during the survey?

No. The survey step explicitly changes no code; the agent writes a review file and asks which candidate to pursue before refactoring.

### What does Improve architecture need from my project?

It is written for macOS Swift projects with git history and a Sources folder. It reads CLAUDE.md, ARCHITECTURE.md, docs/adr and docs/FIXLOG.md where they exist.

### Does Improve architecture ship scripts?

No scripts are included; it uses git and find/wc style shell commands that the agent runs during the survey.

### How do I install Improve architecture in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/improve-architecture to use it in all your projects, or to .claude/skills/improve-architecture in one project. Or install the bama plugin, which includes it: /plugin marketplace add daveebbelaar/bama, then /plugin install bama@bama.

### Does Improve architecture run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Improve architecture?

Claude Code. It reads skills in the SKILL.md format; the install steps on this page show where to put the folder.

### What are the best alternatives to Improve architecture?

The closest alternatives to Improve architecture are Improve codebase architecture, Build swiftui interface, Architecture reasoning, Arch review and Refactor seams.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Improve codebase architecture](https://ai-powered.com/skills/improve-codebase-architecture): Improve codebase architecture is an open-source agent skill for developer tools.
- [Build swiftui interface](https://ai-powered.com/skills/build-swiftui-interface): Build swiftui interface is an open-source agent skill for developer tools.
- [Architecture reasoning](https://ai-powered.com/skills/architecture-reasoning): Architecture reasoning is an open-source agent skill for developer tools.
- [Arch review](https://ai-powered.com/skills/arch-review-ramboz): Arch review is an open-source agent skill for developer tools.
- [Refactor seams](https://ai-powered.com/skills/refactor-seams): Refactor seams is an open-source agent skill for developer tools.
- [Refactor](https://ai-powered.com/skills/refactor): Refactor is an open-source agent skill for developer tools.
- [Thermo nuclear code quality review](https://ai-powered.com/skills/thermo-nuclear-code-quality-review-michael-denyer): Thermo nuclear code quality review is an open-source agent skill for developer tools.
- [Review and refactor](https://ai-powered.com/skills/review-and-refactor): Review and refactor is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/improve-architecture
