# Architecture foundation

> Architecture foundation is an open-source agent skill for developer tools. Guides an agent to design architecture boundaries and a spec before coding. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/majiayu000/spellbook/tree/main/skills/architecture-foundation
- **Repository:** https://github.com/majiayu000/spellbook
- **GitHub stars:** 303
- **License:** MIT
- **Skill name:** architecture-foundation
- **Collection:** https://github.com/majiayu000/spellbook
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-04

## About

This skill helps an agent work out the architecture for a change before any implementation starts. It has the agent first survey the existing code, manifests, public APIs, open issues and tests, then classify the project shape and choose one primary state ownership model. The workflow sets out a standard set of boundaries such as product, core domain, runtime, adapters and testing, and asks the agent to write down the contracts for ownership, lifecycle, effects, errors, configuration and observability before breaking the work into prioritized tasks.

For existing repositories the skill focuses on migration debt. It asks the agent to name the source of truth for each contract, label duplicated paths as bridges, legacy compatibility or accidental forks, and favor convergence or deletion plans over new abstractions. It also includes decision rules and red flags, such as hidden global state, plugins acting as escape hatches, and silent fallbacks, along with templates for a quick verdict or a durable architecture spec.

The skill references Rust and Go pattern guides and a spec template bundled in its folder. It is written for Rust and Go projects but the method is general. It needs no scripts or special tools; the agent works from the repository and the user's question.

## When your agent uses it

> Design architecture foundations before implementation. Use when asked to design or refactor architecture, choose Rust/Go crate, package, module, runtime, workflow, or service boundaries, compare mature project architecture, prevent stacked one-off PRs, audit migration debt in existing repos, or produce a spec before coding.

## What it can access

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

- [Instructions only, no scripts](https://github.com/majiayu000/spellbook/tree/HEAD/skills/architecture-foundation)
- [License: MIT](https://github.com/majiayu000/spellbook/tree/HEAD/skills/architecture-foundation)

## Features

- **Architecture shape classification:** Sorts a project into a shape such as library, CLI, gateway, runtime, framework or agent system to pick a suitable structure.
- **Boundary mapping:** Lays out product, core domain, runtime, adapters, plugins and headless testing boundaries for a change.
- **Contract matrix:** Defines ownership, lifecycle, effects, error policy, config and tests before any tasks are written.
- **Migration debt audit:** Checks existing repos for duplicated sources of truth and compatibility paths that need exit conditions.
- **Spec and roadmap output:** Produces a structured architecture spec with non-goals, borrow and do-not-copy notes, and P0/P1/P2 work.
- **Anti-pattern checklist:** Flags issues such as mixed state models, unowned shims and platform callbacks mutating core state.

## Good for

- Design the module boundaries for a new Rust service before writing code
- Decide whether a set of stacked pull requests should be merged or reworked
- Audit an existing repo for duplicated configuration sources of truth
- Write an architecture spec with a phased roadmap for a large feature
- Compare how a mature project structures its runtime and what not to copy

## Install

### Claude Code

Copy the skill folder to `~/.claude/skills/architecture-foundation` to use it in all your projects:

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

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

### Codex

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

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

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

### Cursor

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

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

For one project only, put the folder in `.cursor/skills/architecture-foundation` 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/majiayu000/spellbook.git --path skills/architecture-foundation
```

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

### VS Code

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

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

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

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/majiayu000/spellbook.git
```

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

## FAQ

### When does Architecture foundation trigger?

It is meant for requests to design or refactor architecture, choose crate, package, module or service boundaries, compare project architecture, audit migration debt, or produce a spec before coding. The skill says not to use it for small local fixes.

### Does Architecture foundation change any code?

The skill describes an analysis and design process that produces a verdict or a spec. It does not describe editing source files or running scripts, and the folder contains no scripts.

### Which languages does Architecture foundation cover?

It has reference guides for Rust and Go architecture patterns, and its decision rules apply to general codebases.

### Does Architecture foundation require any tools or permissions?

The allowed tools are not set and the skill does not name any external integrations.

### How do I install Architecture foundation in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/architecture-foundation to use it in all your projects, or to .claude/skills/architecture-foundation in one project.

### Does Architecture foundation 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 Architecture foundation?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to Architecture foundation?

The closest alternatives to Architecture foundation are Architecture reasoning, Architect, Spec driven develop, Improve architecture and Architecture research.

## Where this comes from

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

## Alternatives

- [Architecture reasoning](https://ai-powered.com/skills/architecture-reasoning): Architecture reasoning is an open-source agent skill for developer tools.
- [Architect](https://ai-powered.com/skills/architect-michael-denyer): Architect is an open-source agent skill for developer tools.
- [Spec driven develop](https://ai-powered.com/skills/spec-driven-develop): Spec driven develop is an open-source agent skill for developer tools.
- [Improve architecture](https://ai-powered.com/skills/improve-architecture): Improve architecture is an open-source agent skill for developer tools.
- [Architecture research](https://ai-powered.com/skills/architecture-research): Architecture research is an open-source agent skill for developer tools.
- [Architecture review](https://ai-powered.com/skills/architecture-review): Architecture review is an open-source agent skill for developer tools.
- [Architecture blueprint generator](https://ai-powered.com/skills/architecture-blueprint-generator): Architecture blueprint generator is an open-source agent skill for developer tools.
- [Think like architect](https://ai-powered.com/skills/think-like-architect): Think like architect is an open-source agent skill for developer tools.

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