Command Palette

Search for a command to run...

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

hoc-test-cache

Reuse a recorded test pass when a verification unit's inputs are unchanged, through the `mentsu-testcase-cache` CLI. Use when wiring cached test execution…

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

Установить hoc-test-cache в Claude Code и Claude Desktop

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

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

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

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

Test Cache

A skill for reusing a recorded pass instead of executing the same inputs twice.

What is skipped is the second execution, never a test. The suite a unit runs is its whole suite, and the numbers reported are the runner's own.

Core principle: the cache records a pass, it never grants one

  • Only a pass is recorded. A failing command records nothing and executes on every run.
  • The input set is derived, not declared. It is every file git can see in the unit's directory; a declaration can only add to it. A wrong declaration costs time — it cannot manufacture a green.
  • A reused pass is worth what its audit is worth. The audit is on by default, and leaving it on is what makes reuse defensible.

The unit — one directory, one command

A unit is the granularity of the cache, declared in .hora-cache.json at the project root. The file is committed; the directory it names is not.

{
  "cacheDir": ".hora-cache",
  "units": {
    "backend": {
      "cwd": "myproject-backend",
      "command": "npm test",
      "extras": [".env*"]
    }
  }
}
field required meaning
cacheDir no, default .hora-cache where records are written. Machine-local — add it to .gitignore
units.<name>.cwd yes the directory the command runs in, relative to the project root
units.<name>.command yes the unit's own test command, exactly as the repository already runs it
units.<name>.extras no files git ignores that behavior depends on, such as env files
  • Declare the command the repository actually runs. The command string is part of the key, so npm test and ./test.sh are different units even when one calls the other.
  • An ordered chain is one unit. Suites that must run in a defined order are declared as a single unit and never split per suite.
  • Units run serially. Two commands that rebuild the same database collide when run at once.

Declaration examples and the extras patterns are in unit-declaration.md.

Wiring a repository

npm install --save-dev @openreachtech/mentsu-testcase-cache
{
  "scripts": {
    "test": "mentsu-testcase-cache",
    "test:cold": "mentsu-testcase-cache --cold",
    "test:status": "mentsu-testcase-cache --status",
    "test:clear": "mentsu-testcase-cache --clear"
  }
}
  • Run it from the project root. The CLI reads .hora-cache.json from the directory it is started in and never searches upward, and every unit's cwd is resolved from there. Started anywhere else — a sub-package's own script, a shell that wandered — it stops at exit 2 without running anything.
  • The cache directory is machine-local and never committed. A record carries the node version and platform it was made on, so another machine's key never matches it anyway.
  • A missing .hora-cache.json stops the CLI at exit 2. It never guesses a unit from what the directory looks like.

Reading a run

line meaning
━━━ unit: <name> — hashing inputs … <n> files, key <key> the key was computed over that many files
✘ MISS — executing no record for this key. The command runs, streaming its own output
✔ passed in <t> — recorded as <key> the execution passed and was recorded
✘ failed in <t> — not recorded the execution failed. Nothing was recorded
✔ REUSED — pass recorded at <time> a record matched, and its summary lines are replayed
━━━ cache-audit: … the spot audit's verdict for this run

Report the replayed summary lines as the run's numbers. They are the runner's own output from the execution that produced the record, so they are transcribed and never paraphrased.

Only a Jest-shaped summary is recorded. What a record keeps is the output lines beginning Test Suites: or Tests:, and nothing else. A runner that prints its counts in another shape records no summary lines at all, so its REUSED run replays none.

  • Report a lineless reuse as what it is — the unit, its key, the time the pass was recorded, and the audit's verdict. It is a statement that the inputs are unchanged, not a count.
  • Never reconstruct the counts from an earlier run. A number typed from memory is the unverified claim the whole convention exists to prevent.
  • Where the report has to carry the counts, run that unit cold and quote the execution's own output.

--status answers what the next run would do without executing anything: the cache directory, then one line per unit — <unit>: <n> recorded pass(es), REUSE ready or … stale — would MISS, with the key it judged that against. Keys are printed shortened, so two keys are compared by their first characters, never assumed equal because both were abbreviated.

Exit codes are the contract

code meaning what the caller does
0 every unit passed, reuse included continue
1 a unit's execu
Полный SKILL.md на GitHub

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

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

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

Вложенные файлы

  • references/key-composition.md
  • references/unit-declaration.md

FAQ

Что делает скилл hoc-test-cache?

Reuse a recorded test pass when a verification unit's inputs are unchanged, through the `mentsu-testcase-cache` CLI. Use when wiring cached test execution into a repository, or when reading a cached run's verdict. Driving a failing suite to green belongs to the test-execution convention; recording the verdict belongs to the acceptance run.

Как установить скилл hoc-test-cache?

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

Скилл hoc-test-cache запускает скрипты?

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

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

Сравнить hoc-test-cache с