Command Palette

Search for a command to run...

Назад к скиллам
скилл № 86279

hoc-git-commit-order

The order commits land in once the work has been split: which of a test and the change it checks goes first, and how the rest of a branch is sequenced. Use…

БесплатноБез исполняемых скриптов
openreachtechот openreachtech★ 17 звёзд на GitHub

Установить hoc-git-commit-order в Claude Code и Claude Desktop

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

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

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

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

Git Commit Order

What belongs in each commit is settled first, by the git commit convention. This settles which of them comes first.

The first commit is the one that turns the suite red

Where a change and the tests that check it are separate commits, whichever of the two makes the suite fail goes first — the red side must come first. This is the basis of test-driven development: the red commit states the claim on its own, and what comes after it is what turns the suite green. A reader stands at the red commit and watches the test fail for the reason it exists; taken the other way round, every step is green and nothing distinguishes a test that checks the change from one that asserts nothing.

  • Neither side is limited to one commit. Several tests may each be turned red, one commit apiece, before any of them is answered; the fixes then follow, each turning its own test green, in the order the tests went red. A test that fails until two classes are both fixed is answered by one commit per class, and stays red until the last of them lands. The rule is about which side comes first, not about either side fitting in one commit:

    Commit Test A Test B Test C
    Update test A red green green
    Update test B red red green
    Update test C red red red
    Fix A green red red
    Fix B green green red
    Fix C green green green

Several classes in one branch stack their tests as a group

Where one branch changes several classes, every test commit comes first, one per class, and the implementation commits follow in the same class order. The table above is not one way among others for such a branch; it is the order. Test and implementation are not paired off class by class.

Update test for AlphaInflator to expect #defineBridgeHandler()
Update test for BetaInflator to expect #defineBridgeHandler()
Update AlphaInflator to define #defineBridgeHandler()
Update BetaInflator to define #defineBridgeHandler()
  • The Update test for subjects then stand in one run, so a reader finds every test commit of the branch at a glance. Paired off, they are scattered down the log between the implementations.
  • A commit of another kind does not join the run. A follow-up comment, an export, a class the others are built on: where a branch would hold one of those beside the group, the commits are not of equal standing, and the branch becomes a nested trunk with each kind on a sub-branch of its own. How that trunk is cut and merged belongs to the git branch convention.

Adding puts the tests first

A class, a member or a behavior that is being added has its tests committed before its implementation. The test commit states what the code is expected to do, and the implementation commit is the one that makes the statement true. Committed the other way round, the tests only confirm what already worked, and there is no commit at which the claim stands on its own to be reviewed. This is test-driven development written into the history rather than into the editor.

  • A test commit in which nothing fails asserts nothing. It may hold cases that pass — covering behavior the change leaves alone — but not only those. Which cases fail against the unchanged code, and which pass, is read as the Jest convention (/hoc-jest) describes.

Reducing puts the implementation first

Where the work takes something away, the implementation changes first and the tests are committed second. Deleting a file, a class or a method, or lowering a limit the implementation enforces, such as the length it allows a description: — taking the tests out, or bringing them into line, first turns nothing red, because the code they check still satisfies them. So the implementation goes first and fails the suite, and the commit that brings the tests into line is the one that clears it.

  • In this order the red persists until the correct tests come out. Remove the wrong ones and the suite is still failing, because the tests for the member just deleted are still sitting there. That is the check doing its work.
  • The reverse order is green at every step, because a suite with fewer tests still passes. Removing tests first and the member second reports nothing at either commit, whether or not the right tests were taken.
  • It is silent exactly where it matters most. Take a member that never had tests of its own. Remove tests first, take another member's by mistake, then remove the member: both commits pass, the other member is now uncovered, and nothing anywhere said so. There was no red to go missing, because there was never a test to turn red.

A test that holds a ceiling

A byte budget, a size limit, a threshold recorded per file: which side goes first follows from the same rule. Raising the ceiling first turns nothing red, because nothing is over it yet. So the change it guards

Полный SKILL.md на GitHub

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

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

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

FAQ

Что делает скилл hoc-git-commit-order?

The order commits land in once the work has been split: which of a test and the change it checks goes first, and how the rest of a branch is sequenced. Use when deciding which commit comes first, when tests and implementation change together, or when something is removed or a limit is lowered. What belongs in a single commit belongs to the git commit convention; which test cases fail against the old code, to the Jest convention.

Как установить скилл hoc-git-commit-order?

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

Скилл hoc-git-commit-order запускает скрипты?

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

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

Сравнить hoc-git-commit-order с