Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

yagni

БесплатноБез исполняемых скриптовНе проверен

WHEN changing production code under this codebase's working agreements, or when a task risks overengineering—extra abstractions, speculative design, or test…

mintuzот mintuz★ 38 звёзд на GitHub

Об этом скилле

YAGNI

Finish the current task or spec with the minimum sufficient approach. Do not over-engineer or widen scope. If you cannot prove a design is necessary, do not ship it (principle-subtract-before-you-add, principle-foundational-thinking).

TDD is the one exception to "prove it first": write the failing test before the production code, because the test defines the behaviour the code owes. Restraint limits a test's size, never its existence.

Workflow

  1. Read the requirement and the relevant code before changing anything; never change code and then guess the intent. For a bug, find every caller of the code you plan to change; when every caller shares the accepted contract, fix the shared function once instead of guarding each caller (principle-fix-root-causes).
  2. When the requirement is ambiguous or incomplete, name the facts you need, ask for them, and plan no work that depends on an unconfirmed answer. You may name the options you see; the user chooses. Never fill a missing requirement with your own assumption (principle-never-block-on-the-human).
  3. Before executing, state a minimal plan: the goal; the non-goals, including what is explicitly out of scope; the acceptance criteria; and what stays untouched (principle-define-done).
  4. Default to one agent. Split off only independent subtasks, and only when splitting materially helps (principle-guard-the-context-window).

Failure Modes

Each ends in work larger than the requirement: fixing the surface without the intent; piling patches, compatibility layers, dual implementations, or copies on a problem one root-cause fix would solve; over-designing for rare cases; starting from a wrong premise; guessing or searching where you should have read the code directly; using "add tests" as cover to expand scope, add abstractions, or look thorough.

Action Boundaries

  1. State the Workflow step 3 plan before executing; everything below depends on that boundary. Wait for agreement only where the requirement is ambiguous or a material choice is open.
  2. Get user confirmation before any irreversible operation. Losing uncommitted work counts as irreversible (principle-preserve-unrelated-work).
  3. Execute these reversible operations without asking:
    • git revert, and branch switches that carry your changes across;
    • git restore only when the target has no uncommitted changes you would lose;
    • moving files into a backup directory inside the repository, once you have confirmed the destination path does not exist;
    • test runs, diffs, plan generation, and read-only analysis.
  4. Stop and rewrite a smaller plan when you catch yourself:
    • adding abstractions, frameworks, or configuration layers the task does not need (principle-subtract-before-you-add);
    • designing ahead for possible future use (principle-foundational-thinking);
    • stacking constraints to satisfy existing constraints;
    • touching many unrelated files (principle-preserve-unrelated-work);
    • creating a second implementation to keep old logic alive (principle-migrate-callers-then-delete-legacy-apis).
  5. A request for extra mechanism is not by itself an accepted requirement. When the user asks for work no accepted behaviour needs, leave it out of the plan, name it as a non-goal, and say why. Ask the user to raise it as a separate requirement if they still want it.

Testing

Tests serve the acceptance of the current change, nothing else.

  1. Write one failing test for the next behaviour change (added, altered, or removed behaviour), then the minimum code that makes it pass. If you find yourself changing behaviour without a failing test, stop and write the test first.
  2. Exception: while tests are green, you may refactor production code without adding behaviour, then re-run the tests as the regression check.
  3. Run the related existing tests before adding anything. If one already fails for the behaviour you are about to build, that is your red: do not write a second test for it.
  4. When no existing test is your red, extend a related test that does not yet express the required behaviour, provided it can carry that behaviour without taking on a second responsibility. Otherwise add one focused test.
  5. Per behaviour (not per file or module), cover one main path and, where the behaviour can fail meaningfully, one critical failure path.
  6. Do not expand test scope for completeness, backfill unrelated modules, or test boundaries the requirement did not ask for.
  7. Do not introduce new test frameworks or infrastructure.
  8. Do not write snapshot matrices, parametrised grids, or end-to-end suites.
  9. Do not let green tests justify more abstraction.

Ask of each test:

  • Which accepted requirement does it verify?
  • Is it simpler than the implementation?

Test code longer or more complex than the implementation signals overengineering: look for a smaller test that still fails first.

Code Change Principles

  • Every change must leave tests, type checks,
Полный SKILL.md на GitHub

Установить yagni в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл yagni?

WHEN changing production code under this codebase's working agreements, or when a task risks overengineering—extra abstractions, speculative design, or test sprawl; NOT for removing complexity from existing code; enforces TDD, minimum sufficient execution, hard scope boundaries, and documentation practices.

Как установить скилл yagni?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл yagni запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить yagni с