Логотип Improve Architecture

Improve Architecture

Сообщество
daveebbelaar
improve-architecture

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.

Обзор

Издательdaveebbelaar
Репозиторийbama
Название навыкаimprove-architecture
Звёзды
952
Форки
136
Файлы в комплекте
2
ЛицензияMIT
Ссылки
  • Инструкции в формате Markdown

    Модель загружает файл SKILL.md по мере необходимости, поэтому токены расходуются только при подходящем запросе.

  • Работает с любой большой языковой моделью

    Навыки ИИ — это обычный Markdown, а не код для конкретного поставщика, поэтому они работают с GPT, Claude, Gemini, Grok и локальными моделями.

  • Файлы в комплекте: 2

    Скрипты, шаблоны и справочные материалы, которые модель может читать во время работы. Файлы доступны только для чтения и никогда не выполняются.

  • Открытый исходный код

    Издатель навыка на GitHub — daveebbelaar. Перед установкой изучите исходные материалы.

Установка

Установите навык ИИ Improve Architecture в TypingMind, чтобы использовать его с любой LLM, или добавьте его в другой агент, который умеет читать SKILL.md.

1

Установка в TypingMind

TypingMind устанавливает навык прямо из его папки на GitHub: читает SKILL.md, собирает файлы ресурсов и сохраняет результат локально.

  1. Откройте приложение и перейдите в раздел «Плагины → Навыки».
  2. Выберите «Установить из GitHub».
  3. Вставьте указанную ниже ссылку на папку навыка и подтвердите установку.
    https://github.com/daveebbelaar/bama/tree/main/skills/code/improve-architecture
  4. Включите навык в каждом чате, где хотите его использовать.
Плагины → Навыки → Добавить навык → По ссылке GitHub, затем вставьте ссылку на папку и нажмите «Продолжить».
2

Установка в другом агенте

Любой агент с поддержкой формата Agent Skills может использовать этот навык — скопируйте папку в каталог навыков этого агента.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/daveebbelaar/bama.git /tmp/bama
mkdir -p .claude/skills
cp -r /tmp/bama/skills/code/improve-architecture .claude/skills/improve-architecture
После копирования перезапустите Claude Code, чтобы загрузить новый навык.

Использование в TypingMind

Включите навык Improve Architecture в любом чате TypingMind, и дальше модель всё сделает сама. Его название и описание хранятся в системном промпте, а при появлении подходящего запроса модель сама загружает полные инструкции. Вам не нужно вызывать навык вручную, и до фактического использования он не расходует токены.

Модель сама загружает навык Improve Architecture, как только появляется подходящий для него запрос.

Работает с любой моделью ИИ

Навыки ИИ — это обычные инструкции в Markdown, а не код для конкретного поставщика, поэтому навык Improve Architecture не привязан к модели, для которой он был создан. Установите его один раз в TypingMind и используйте с GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama или локальной моделью, которую запускаете самостоятельно, — со своими ключами API.

  • Загружается только при необходимости

    Системный промпт содержит только название и описание. Инструкции загружаются при первом подходящем запросе, поэтому неиспользуемый навык не расходует токены.

  • Меняйте модели прямо в чате

    Навык состоит из инструкций, а не кода, поэтому смена модели не нарушает его работу: новая модель читает тот же файл SKILL.md.

Инструкции навыка

Это содержимое файла SKILL.md, которое загружает модель. Прочитайте его перед установкой: навык — это инструкции, которым будет следовать ваша модель.

Improve architecture

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.

When to run

Any one signal is enough:

  • The end of a milestone (the improve-loop skill calls this skill there).
  • Before a big feature. Ask: "What change to the code would make this feature easy?"
  • A Swift file over 600 lines (act at 1,000), a type over 400 lines, or "unable to type-check this expression".
  • One feature touched more than 6 files or more than 2 targets.
  • The same area shows up in 3 fix-log entries, or the same kind of bug happens twice.
  • State that changes more than 10 times a second sits on a model that many views observe.
  • A dependency cannot be replaced in a test.

Vocabulary

Use these words exactly, so proposals stay comparable:

  • Module: anything with an interface and an implementation (a type, a file group, a target).
  • Interface: everything a caller must know: signatures, ordering, error modes, threading, performance.
  • Depth: how much a module does per unit of interface. Deep modules hide a lot behind a small interface. Shallow modules are pass-throughs.
  • Seam: a place where you can swap behavior without editing callers.
  • Adapter: one implementation behind a seam. One adapter is a hypothetical seam. Two (production and test) make it real.
  • Locality: a change touches one place. Leverage: callers get a lot for little.

1. Survey

Change no code in this step.

  1. Read CLAUDE.md, ARCHITECTURE.md, docs/adr/, and docs/FIXLOG.md where they exist.

  2. Find hot spots:

    bash
    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
  3. Map the structure: targets and their dependencies, protocols and their conformers, @MainActor types that do I/O, and what runs on which queue.

  4. Look for Swift friction:

    • A view model that owns everything (a god model).
    • Wrappers that only forward calls.
    • App code that reaches into a library's internals.
    • Test hooks in the app target.
    • Fast-changing state published to every view.
    • Slow work on the main thread or a real-time queue.
    • Protocols with one conformer and no test adapter.
    • Drifted copies: the same private struct <Name> defined in two files (grep -rn 'private struct' Sources/ | awk '{print $3}' | sort | uniq -d).
    • A settings or detail page that lives far from its feature. Pages live in the feature's folder.
    • Pure logic inside a @MainActor store, which tests cannot compile alone. Move it into a plain type that takes plain values.
  5. 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.

2. Propose

Write docs/architecture-review-<YYYY-MM-DD>.md, one card per candidate:

markdown
## <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.

3. Refactor

  • Before: record the proof: tests at the interface, golden outputs (file bytes or hashes, snapshot PNGs, old files that must still load), and a performance baseline where speed matters.
  • One refactor per commit. Behavior stays the same. No features mixed in.
  • New types go in new files that compile first. Then move callers over. The project builds after every step.
  • Replacing an engine: keep the old path behind a flag for one milestone, then delete it.
  • Replace tests, do not layer them: delete the old shallow tests that the new interface tests cover.
  • If a diff passes about 10 files, split it.
  • If the interface is open, design it twice: sketch two or three interfaces under different constraints (fewest entry points, simplest common caller, ports and adapters) and pick one with a reason.

4. Record

  • Update ARCHITECTURE.md: targets, layers, dependency direction, seams.
  • Add an ADR in docs/adr/ only when the decision is hard to reverse, surprising without context, and a real trade-off.
  • Add a 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.

Файлы в комплекте

Модель читает эти файлы по мере необходимости, пока навык загружен. Они доступны только для чтения и никогда не выполняются.

Часто задаваемые вопросы

Что делает навык ИИ Improve Architecture?

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.

Зачем использовать Improve Architecture в TypingMind?

Потому что вы устанавливаете навык один раз и используете его с любой моделью. Improve Architecture — это обычный текст в формате Markdown, а не код для конкретного поставщика, поэтому один и тот же навык работает с GPT-5, Claude, Gemini, Grok или локальной моделью. Вы можете менять модель прямо во время чата, и навык продолжит работать. TypingMind использует ваши собственные ключи API, поэтому вы платите поставщикам напрямую, а не оформляете подписку с оплатой за каждое место. Ваши навыки и чаты остаются в вашем собственном хранилище.

Как установить Improve Architecture в TypingMind?

В TypingMind откройте «Плагины → Навыки → Установить из GitHub» и вставьте https://github.com/daveebbelaar/bama/tree/main/skills/code/improve-architecture. TypingMind прочитает файл SKILL.md, включит сопутствующие файлы в пакет и установит навык, который можно включать отдельно для каждого чата.

Какие модели ИИ могут использовать Improve Architecture?

Любая модель, которую вы подключите в TypingMind. Навыки ИИ — это обычные инструкции в формате Markdown, а не код для конкретного поставщика, поэтому GPT, Claude, Gemini, Grok и локальные модели могут загружать этот навык, когда запрос ему соответствует.

Со сколькими моделями ИИ можно использовать Improve Architecture?

С любым количеством. В TypingMind вы можете использовать Improve Architecture с любой моделью, которая поддерживает навыки, в том числе с GPT, Claude, Gemini, Grok, DeepSeek, Mistral и Llama. Для этого вы используете собственные ключи API.

Бесплатен ли навык ИИ Improve Architecture?

Да. Навык опубликован на GitHub по лицензии MIT. Издатель — daveebbelaar. Вы платите только своему поставщику ИИ за использованные токены.

Что такое навыки ИИ?

Навык ИИ — это набор инструкций, которыми модель ИИ может пользоваться каждый раз, когда ей нужно выполнить конкретную задачу. Он соответствует открытому формату Agent Skills: файл SKILL.md с названием и описанием, а также любые скрипты, шаблоны или справочные файлы, которые могут понадобиться модели. Модель читает инструкции, только когда ваш запрос соответствует навыку, поэтому установленный навык ничего не стоит, пока не используется.

Чем навыки ИИ отличаются от плагинов и серверов MCP?

Плагин или сервер MCP даёт модели новые инструменты, которые она может вызывать: при вызове где-то выполняется код и возвращает результат. Навык ИИ, напротив, даёт модели знания и описывает порядок действий: как подойти к задаче, какие шаги выполнить и каким должен быть хороший результат. Навыки — это обычный текст в формате Markdown, поэтому им не нужны сервер, ключ API или среда выполнения, и они работают с любой моделью.

Все

Создайте своё рабочее пространство с ИИ прямо сейчас

Подпишитесь на нашу рассылку, чтобы узнавать о новых функциях и предстоящих розыгрышах 👇