Логотип Untangle Codebase

Untangle Codebase

ОрганізаціяПопулярне
caldoai
untangle-codebase

Untangle a whole codebase in one pass, so agents working in it read less per change, break less without noticing, and debug faster.

Огляд

Видавецьcaldoai
Репозиторійskills
Назва навичкиuntangle-codebase
Зірки
1.1K
Форки
30
Файли в пакеті
Лише інструкції
ЛіцензіяMIT
Посилання
  • Інструкції у форматі Markdown

    Файл SKILL.md, який модель завантажує за потреби, тож токени витрачаються лише тоді, коли запит справді відповідає навичці.

  • Працює з будь-якою LLM

    Навички ШІ — це звичайний Markdown, а не код для певного постачальника, тому вони працюють із GPT, Claude, Gemini, Grok або локальною моделлю.

  • Усе необхідне — в інструкціях

    Усе потрібне моделі міститься в інструкціях — жодних додаткових файлів для синхронізації.

  • Відкритий вихідний код

    Опубліковано на GitHub користувачем caldoai. Перегляньте вихідний вміст перед установленням.

Встановлення

Установіть навичку ШІ Untangle Codebase у TypingMind, щоб використовувати її з будь-якою LLM, або додайте її до іншого агента, що читає SKILL.md.

1

Встановити в TypingMind

TypingMind встановлює навичку безпосередньо з її папки GitHub — читає SKILL.md, збирає файли ресурсів у пакет і зберігає результат локально.

  1. Відкрийте застосунок і перейдіть до Плагіни → Навички.
  2. Виберіть «Встановити з GitHub».
  3. Вставте наведений нижче URL папки навички та підтвердьте встановлення.
    https://github.com/caldoai/skills/tree/main/skills/untangle-codebase
  4. Увімкніть навичку в кожному чаті, де хочете її використовувати.
Плагіни → Навички → Нова навичка → За URL GitHub, потім вставте URL папки й натисніть «Продовжити».
2

Встановити в іншому агенті

Будь-який агент, що підтримує формат Agent Skills, може використовувати цю навичку — скопіюйте папку до каталогу навичок цього агента.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/caldoai/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/skills/untangle-codebase .claude/skills/untangle-codebase
Після копіювання перезапустіть Claude Code, щоб завантажити нову навичку.

Використовуйте навичку в TypingMind

Увімкніть навичку Untangle Codebase в будь-якому чаті TypingMind, і далі модель усе зробить сама. Назва й опис навички містяться в системному промпті, а щойно надходить відповідний запит, модель самостійно завантажує повні інструкції — вам не потрібно викликати навичку вручну, і до фактичного використання вона не витрачає токенів.

Модель самостійно завантажує навичку Untangle Codebase, щойно надходить відповідний запит.

Працює з будь-якою моделлю ШІ

Навички ШІ — це звичайні інструкції Markdown, а не код для певного постачальника, тому навичка Untangle Codebase не прив’язана до моделі, для якої її створено. Установіть її один раз у TypingMind і використовуйте з GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama або локальною моделлю, яку ви запускаєте самостійно, — усе з вашими власними ключами API.

  • Завантажується лише за потреби

    Системний промпт містить лише назву й опис. Інструкції завантажуються за першого відповідного запиту, тож невикористана навичка нічого не коштує.

  • Змінюйте моделі під час чату

    Оскільки навичка — це інструкції, а не код, зміна моделі не порушує її роботу: наступна модель читає той самий файл SKILL.md.

Інструкції навички

Це вміст файлу SKILL.md, який завантажує модель. Прочитайте його перед установленням — навичка містить інструкції, яких дотримуватиметься ваша модель.

Start a thorough refactor of this codebase and complete it to the end.

Treat this as a goal.

Why do this at all?

  • Better output: agents write better code in a well-structured codebase.
  • Cheaper & faster changes: agents spend fewer tokens searching and more on the problem.
  • Fewer silent breaks: agents break less without noticing.
  • Faster debugging: agents find root causes faster.

1. Ask

Besides untangling the codebase, there are two other things you may do:

AdditionWhat it does
CommentsRemove comments that only restate the code.
TestsRemove tests that wouldn't catch a real bug, and fix the ones that fail without one.

List these (with their exact descriptions) for the user and ask which ones to do. Then do only those.

2. List every problem

Don't change anything yet.

Go through the codebase asking one thing: should these pieces change together? Write down every place the code gets the answer wrong, as in the decision log example. There are only three ways to get it wrong.

Hidden links: pieces that must change together, where the code doesn't show it.

  • Copies of logic or values: change one and the others must change too, but nothing says so.
  • A module that reads a global or file set by another module: change that module and this one breaks, but nothing shows it (self-contained code).
  • A feature split across folders by layer, or related code in different folders: one change needs all of them, but the layout hides that (domain-driven code, colocation).
  • A call order or convention callers just have to know: change it and callers break, but nothing warns them (explicit over implicit).

Needless links: pieces tied together that change for different reasons.

  • Callers that depend on internals: the internals change for their own reasons, and the callers break anyway (encapsulation).
  • Stable code that imports something more volatile: the stable code has to change whenever the volatile code does (dependency direction).
  • A general function with a parameter only one workflow understands: the function has to change whenever that workflow does (caller vocabulary).
  • A shallow module: its interface changes whenever its internals do, so its callers change with it (deep modules).

Surplus: pieces with no reason of their own to change.

  • Wrappers: they only change when the thing they wrap does (pass-through wrappers).
  • Extension points and config for things that never vary: nothing will ever change them (speculative generality).
  • Dead code: nothing uses it, so nothing will ever need it to change.

Also write down every special case: code that exists for one situation instead of following from how the system works. Each one is a requirement the design never accounted for, so use them to work out what the system needs to be.

  • An if for one value
  • A parameter for a specific caller
  • A swallowed exception
  • A retry or sleep
  • A disabled test

3. Redesign from first principles

Work out the fixes as if the system had known today's requirements from the start. Look for the one fix behind several problems, which often looks nothing like them. Don't fix special cases one by one.

Ask the same thing of every fix, even one that looks better in the code: pieces that change together end up together, pieces that don't aren't tied, and everything depends on what changes less.

Write each fix above the problems it solves, as in the decision log example.

4. Fix everything on the list

Remove the special cases the redesign makes unnecessary, and keep the ones the system still needs. Don't go looking for bugs separately. A structural fix may fix some along the way, which is fine.

If the user chose Comments:

  • Comments that restate the implementation, like // sort first so the binary search works, only change when it does, so they have no reason of their own to change. Remove them, even if they're phrased as a why.
  • Comments about something outside the code, like // the proxy drops websockets, so we poll, change when that does, and the code can't show it. Keep them.
  • Comments that explain a workaround om the codebase, like // wait 100ms because the cache isn't ready yet, only change when the problem behind the workaround does. They go when the redesign removes that problem.

If the user chose Tests, do this last, because tests are your regression safety net. A test should fail on a regression, and only then:

  • Tests that repeat the implementation only change when it does, so they have no reason of their own to change. They check the same interpretation against itself, so remove them.
  • Tests tied to internals break when the code changes but behavior doesn't, so they change for the wrong reason. Rewrite them to depend on behavior, which changes less.
  • Tests that can't fail pass whatever the code does, so no change ever affects them. They aren't checking anything, so remove them.

5. Check, and repeat until done

Have subagents search for special cases, hidden links, needless links and surplus. Do not stop until there is nothing worth fixing left.

You're done when:

  • As few special cases are left in the system as possible. How many remain is the best measure of how close you are.
  • A typical change lands in one place.
  • Every import is reasonable, and nothing imports anything more volatile than itself.
  • Subagents have no issues left that are worth fixing.
  • Intended behavior is the same as when you started, apart from bugs the refactor fixed. Test this at the end.

Tips

  • Start from a skeleton: script away the function bodies, so the whole codebase fits in context.
  • Summarize with subagents: have them summarize parts of the codebase, so you can reason across all of it at once.
  • Check the dependency graph often: script one that shows what imports what, and rerun it as you go.
  • Enter where leverage is highest: start looking there first.
  • Keep a decision log: compaction is less of a problem that way.
  • Use Git as evidence: for how often pieces change, and what changes together.

Decision log example

The list of problems:

md
- `ui/LogoutDialog.tsx:30` waits 100ms after closing and hopes the message input can take focus by then.
- `ui/Toolbar.tsx:40` and `ui/Menu.tsx:22` call the same actions, each with its own check for when they're disabled.
- `checkout/submit.ts:9` depends directly on `payments/stripe.ts`.
- `shortcuts/keymap.ts:18` has a switch with one case per action, separate from the menu's list.
- `ui/CommandPalette.tsx:55` keeps its own list of actions, and it's missing the newer ones.
- `ui/SettingsDialog.tsx:61` sets a global `skipRefocus` flag to stop the logout dialog it opens from sending focus to the message input.
- `history/undo.ts:30` has a special case for every action that can be undone.
- `refunds/refund.ts:22` wraps every Stripe call in `if (order.provider === "paypal")`.
- Every action handler has to call `track()` by hand, and some don't.
- `ui/Toolbar.test.tsx` and `ui/Menu.test.tsx` test the same actions separately.

Then with the fixes:

md
- Make the general `Dialog` give focus back to whatever had it before it opened, so the wait and the flag can both go.
  - `ui/LogoutDialog.tsx:30` waits 100ms after closing and hopes the message input can take focus by then.
  - `ui/SettingsDialog.tsx:61` sets a global `skipRefocus` flag to stop the logout dialog it opens from sending focus to the message input.
- Define a `PaymentProvider` interface that Stripe and PayPal both implement, so checkout and refunds no longer know which one they're using.
  - `checkout/submit.ts:9` depends directly on `payments/stripe.ts`.
  - `refunds/refund.ts:22` wraps every Stripe call in `if (order.provider === "paypal")`.
- Make every user action a command with a name, a handler and an undo, so the toolbar, menu, shortcuts, palette and undo history all run from one list.
  - `ui/Toolbar.tsx:40` and `ui/Menu.tsx:22` call the same actions, each with its own check for when they're disabled.
  - `shortcuts/keymap.ts:18` has a switch with one case per action, separate from the menu's list.
  - `ui/CommandPalette.tsx:55` keeps its own list of actions, and it's missing the newer ones.
  - `history/undo.ts:30` has a special case for every action that can be undone.
  - Every action handler has to call `track()` by hand, and some don't.
  - `ui/Toolbar.test.tsx` and `ui/Menu.test.tsx` test the same actions separately.

Поширені запитання

Що робить навичка ШІ Untangle Codebase?

Untangle a whole codebase in one pass, so agents working in it read less per change, break less without noticing, and debug faster.

Навіщо використовувати Untangle Codebase у TypingMind?

Тому що ви встановлюєте її один раз і використовуєте з будь-якою моделлю. Untangle Codebase — це звичайний Markdown, а не код для конкретного постачальника, тому та сама навичка працює з GPT-5, Claude, Gemini, Grok або локальною моделлю. Ви можете змінити модель навіть посеред чату, і навичка продовжить працювати. TypingMind використовує ваші власні ключі API, тож ви платите безпосередньо постачальникам замість передплати за кожне місце користувача, а ваші навички й чати залишаються у вашому сховищі.

Як встановити Untangle Codebase у TypingMind?

Відкрийте в TypingMind Плагіни → Навички → Встановити з GitHub і вставте https://github.com/caldoai/skills/tree/main/skills/untangle-codebase. TypingMind прочитає файл SKILL.md і встановить навичку, яку можна вмикати окремо для кожного чату.

Які моделі ШІ можуть використовувати Untangle Codebase?

Будь-яка модель, яку ви підключите в TypingMind. Навички ШІ — це звичайні інструкції у форматі Markdown, а не код для конкретного постачальника, тому GPT, Claude, Gemini, Grok і локальні моделі можуть завантажувати цю навичку, коли запит їй відповідає.

Зі скількома моделями ШІ можна використовувати Untangle Codebase?

Зі скількома забажаєте. Якщо модель підтримує навички, ви можете використовувати з нею Untangle Codebase — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama та інші — усе в TypingMind із власними ключами API.

Чи безкоштовна навичка ШІ Untangle Codebase?

Так. Навичку опубліковано на GitHub: caldoai, за ліцензією MIT. Ви платите лише своєму постачальнику ШІ за використані токени.

Що таке навички ШІ?

Навичка ШІ — це багаторазовий набір інструкцій, який навчає модель ШІ виконувати одне конкретне завдання. Він відповідає відкритому формату Agent Skills: файл SKILL.md із назвою та описом, а також скрипти, шаблони чи довідкові файли, які можуть знадобитися моделі. Модель читає інструкції лише тоді, коли ваш запит відповідає навичці, тому встановлена навичка нічого не коштує, доки її не використано.

Чим навички ШІ відрізняються від плагінів або серверів MCP?

Плагін або сервер MCP надає моделі нові інструменти для виклику — код, який десь виконується й повертає результат. Натомість навичка ШІ надає моделі знання та порядок дій: як підійти до завдання, яких кроків дотримуватися та яким має бути якісний результат. Навички — це звичайний Markdown, тож їм не потрібні ні сервер, ні ключ API, ні середовище виконання, і вони працюють із будь-якою моделлю.

Усі

Створіть власний ШІ-простір уже зараз

Підпишіться на нашу розсилку, щоб дізнаватися про нові функції та майбутні розіграші 👇