Architecture Foundation logo

Architecture Foundation

Community
majiayu000
architecture-foundation

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.

Overview

Publishermajiayu000
Repositoryspellbook
Skill namearchitecture-foundation
Stars
280
Forks
26
Bundled files
4
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 4 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by majiayu000 on GitHub. Read the source before you install it.

Installation

Install the Architecture Foundation AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/majiayu000/spellbook.git /tmp/spellbook
mkdir -p .claude/skills
cp -r /tmp/spellbook/skills/architecture-foundation .claude/skills/architecture-foundation
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Architecture Foundation in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Architecture Foundation on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Architecture Foundation is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Architecture Foundation

Overview

Use this skill to turn an architecture discussion into explicit boundaries, contracts, validation gates, and a small execution plan. The goal is not to copy an admired project, but to identify the project's shape and choose the minimum architecture that keeps ownership, effects, errors, and tests clear. For large existing repos, first explain the architecture they already have, then decide whether the work is boundary creation, boundary completion, or boundary deletion.

When To Use

  • The user asks "what architecture should this use?", "is this stacked work?", "make a complete spec", "design the runtime", or "compare good libraries".
  • The change touches runtime, state ownership, adapters, plugins, event loops, rendering, schedulers, persistence, or cross-module contracts.
  • A repo has many issues/PRs that look individually valid but may not converge on one architecture.
  • A mature repo has duplicated paths, compatibility shims, generated configs, workflow definitions, or docs that may disagree about the source of truth.
  • A new skill, framework, library, or large feature needs a foundation guide before implementation.

Do not use this for small, local fixes where the existing architecture is obvious and no boundary decision is needed.

Workflow

  1. Search first.
  • Inspect existing architecture docs, entrypoints, manifests, module trees, public APIs, open issues/PRs, and tests before proposing new structure.
  • If the user names a reference project, verify current source or official docs before treating it as evidence.
  • For existing repos, also inspect generated/config artifacts, migration files, background workers, cron jobs, adapters, and the largest files/tests.
  1. Classify the project shape.
  • Simple library: stable API plus internal implementation.
  • CLI or developer tool: command layer, core operations, IO adapters, reporter.
  • API gateway or model router: transport, auth/accounting, routing policy, provider adapters, billing/settlement, observability.
  • Long-running runtime: state root, scheduler, drivers, observability, shutdown.
  • Lifecycle/composition framework: dependency graph, construction phase, runtime hooks, rollback, shutdown, and test harness.
  • Event/cache/reconcile controller: watch/list input, cache/projection, queue/backpressure, worker/reconciler, retry, and drain.
  • Config/module platform: canonical config, adapters, module lifecycle, reload order, rollback, cleanup, and plugin host interfaces.
  • UI or app shell: state ownership, event protocol, renderer/platform boundary, headless tests.
  • Service framework: domain core, application services, transport, storage, middleware, error-to-response boundary.
  • Agent or workflow system: task model, scheduler, provider adapters, event log, replay/test harness.
  1. Choose one primary state ownership model.
  • App-owned entities and handles for native UI/editor runtimes.
  • State plus typed message for enumerated UI/application workflows.
  • Virtual DOM/signals when renderer portability and declarative UI dominate.
  • Typed state or service-instance state for services and middleware.
  • Event log plus projection/outbox for workflows, billing, async jobs, and reconciliation systems.
  • World/resource/system model only when data-parallel ECS is a product fit.
  • Snapshot database or input facts for incremental analysis tools.
  • Streaming pipeline for one-shot CLI tools and batch processors.
  1. Draw the foundation boundaries.
  • product/app: entrypoints, user workflows, product-specific orchestration.
  • core/domain: pure models, invariants, decisions, typed errors, no IO.
  • runtime/application: lifecycle, scheduling, event dispatch, state mutation.
  • adapters/backends: OS, renderer, provider, filesystem, network, database.
  • plugins/components: optional capabilities behind explicit contracts.
  • testing/headless: deterministic drivers, fake adapters, contract tests.
  1. Audit existing boundary health before adding tasks.
  • Name the current source of truth for each contract: code, database table, SQL seed, JSON/YAML config, generated docs, or external provider contract.
  • Mark duplicated paths as intentional bridge, legacy compatibility, or accidental fork; require an exit condition for compatibility paths.
  • Prefer a convergence/deletion plan over a new abstraction when the existing architecture is directionally correct but half migrated.
  • Treat generated files and docs as consumers unless the repo explicitly makes them authoritative.
  1. Write the contracts before tasks.
  • Ownership: who owns state, handles, resources, caches, and mutation rights.
  • Lifecycle: init, ready, run/tick/frame/request, shutdown, cleanup.
  • Effect contract: which layer may persist, call providers, bill, publish messages, mutate projections, or only emit effects for another layer.
  • Event/action: how external events become typed commands/messages/actions.
  • Effects: which layer may touch IO, processes, network, OS handles, GPU, DOM, databases, or providers.
  • Error policy: what is recoverable, user-visible, fatal, diagnostic-only, or converted at a boundary.
  • Config/resources: build-time, startup-time, runtime; owner and invalidation.
  • Observability: logs, metrics, traces, queue depth, frame/runtime telemetry.
  • Tests: unit, contract, headless, fake adapter, integration, platform/E2E.
  1. Produce a spec, not just a diagram.
  • Use references/spec-template.md when the user needs a durable artifact.
  • Include non-goals and "do not copy" notes from reference projects.
  • For every reference project, separate borrow from do_not_copy; borrow boundary contracts, not scale artifacts, global registries, generated machinery, historical migrations, or domain-specific complexity.
  • Convert the spec into P0/P1/P2 work where each task maps to one contract.
  • If issues/PRs already exist, map them to the contracts and identify gaps.

Decision Rules

  • Prefer a thin adapter around a mature runtime when the product does not need to own that runtime.
  • Split crates/modules only for stable API boundaries, side-effect isolation, compile-time isolation, independent tests, or real reuse.
  • In existing repos, do not split crates/packages first when the real problem is duplicated source-of-truth, an unfinished migration, or missing closed-loop tests.
  • Keep core free of platform handles, event loops, renderer handles, webviews, database clients, HTTP requests, process spawning, and environment reads.
  • Make hidden global state illegal unless it is deliberately modeled as typed runtime state or a scoped resource.
  • Do not let plugins become architecture escape hatches. Each plugin needs API, config/permissions when relevant, lifecycle, errors, and tests.
  • Do not accept silent degradation. Missing capability must be an explicit unsupported error, diagnostic, or blank result according to the contract.

Output Shape

For quick answers, return:

text
verdict:
chosen_shape:
state_owner:
boundaries:
contracts:
migration_debt:
validation:
risks:
next_steps:

For durable planning, create or update an architecture spec with:

text
objective
current evidence
reference models considered
chosen architecture
boundary map
source-of-truth map
contract matrix
compatibility/deletion plan
issue/PR map
validation matrix
P0/P1/P2 roadmap
open questions

Red Flags

  • A proposed module cannot say which boundary it belongs to.
  • The design names a trait/config/cache/plugin but does not wire it into startup, lifecycle, or tests.
  • Two state ownership models are mixed without an explicit bridge.
  • Two files, configs, SQL seeds, or docs claim to be the source of truth for the same product contract.
  • A compatibility shim or legacy path has no owner, test, telemetry, or removal condition.
  • Platform callbacks directly mutate core state.
  • Errors become warnings plus fallback for user-visible behavior.
  • Tests only cover the final UI/CLI and cannot drive the runtime headlessly.
  • The plan says "match X project" but cannot state what not to copy.

References

  • Read references/rust-architecture-patterns.md when designing Rust crates, runtimes, UI frameworks, app shells, schedulers, services, or developer tools.
  • Read references/go-architecture-patterns.md when designing Go modules, packages, services, ports/adapters, context-aware APIs, or concurrency flows.
  • Read references/spec-template.md when producing a repo-facing spec.
  • Use agents/openai.yaml only when a separate architecture review agent is needed for cross-checking the chosen boundaries or migration plan.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Architecture Foundation AI skill do?

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.

Why use Architecture Foundation on TypingMind?

Because you install it once and use it with any model. Architecture Foundation is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Architecture Foundation in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/majiayu000/spellbook/tree/main/skills/architecture-foundation. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Architecture Foundation?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Architecture Foundation?

As many as you like. As long as a model supports skills, you can use Architecture Foundation with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Architecture Foundation AI skill free?

Yes. It is published on GitHub by majiayu000 under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇