loki-seal — скилл для Claude Code: что делает и как установить
Запрещает объявлять задачу завершённой, если тесты упали, пропущены или ослаблены. Помогает агенту соблюдать правила хука loki-seal перед сдачей работы.
npx skills add asklokesh/loki-mode --skill loki-seal -a claude-codeЧто делает loki-seal
Скилл даёт агенту инструкции перед сдачей работы. Сам контроль выполняет Stop-хук bin/loki-seal.js. Хук определяет тестовый раннер и запускает тесты прямо в рабочем дереве без вызовов внешних нейросетей. Поддерживаются npm test с Jest, Vitest или node --test, а также pytest, go test и cargo test.
Процесс завершения блокируется при свежих падениях тестов или сбое тестового раннера. Блокировка сработает и при снижении общего числа проверок. Хук замечает удаление тестовых файлов, появление маркеров skip, xfail или only, а также правки в CI, ослабляющие шаги тестирования. Система также проверяет контракт из первого запроса: под каждый пункт ТЗ нужен пройденный тест с утверждениями.
Сам по себе скилл только инструктирует агента, поэтому для реальной блокировки нужен плагин с хуком. После успешной проверки формируется квитанция из 6 строк с хешем дерева.
Какие задачи решает
- предотвратить завершение задачи при падении новых тестов
- заблокировать удаление проверок или добавление маркеров skip
- проверить покрытие пунктов запроса реальными утверждениями
- пресечь ослабление проверок в конфигурационных файлах CI
Примеры запросов агенту
- Запусти проверку репозитория через loki-seal перед завершением задачи
- Проверь тесты и убедись, что все требования запроса покрыты проверками
- Сформируй квитанцию о прохождении тестов перед сдачей кода
Как установить loki-seal
1Через Skills CLI (Vercel)
npx skills add asklokesh/loki-mode --skill loki-seal -a claude-code2Вручную: положить файлы
~/.claude/skills/loki-seal/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/loki-seal/
1Через Skills CLI (Vercel)
npx skills add asklokesh/loki-mode --skill loki-seal -a codex2Вручную: положить файлы
.agents/skills/loki-seal/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add asklokesh/loki-mode --skill loki-seal -a cursor2Вручную: положить файлы
.cursor/skills/loki-seal/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install asklokesh/loki-mode loki-seal2Вручную: положить файлы
.github/skills/loki-seal/SKILL.md1Через Skills CLI (Vercel)
npx skills add asklokesh/loki-mode --skill loki-seal -a gemini-cli2Командой платформы
gemini skills install https://github.com/asklokesh/loki-mode --path packages/loki-seal/skills/loki-sealВручную: положить файлы
.devin/skills/loki-seal/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add asklokesh/loki-mode --skill loki-seal -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о loki-seal
Как установить loki-seal в Claude Code?
Выполните команду npx skills add asklokesh/loki-mode --skill loki-seal -a claude-code. Файл скилла будет сохранён в ~/.claude/skills/loki-seal/SKILL.md.
Что делает loki-seal?
Он объясняет агенту правила завершения задач в репозитории с тестами. Скилл запрещает закрывать задачу, если тесты падают, ослаблены или удалены.
Нужен ли плагин для принудительной блокировки?
Да, скилл носит справочный характер и не содержит хуков. Реальную проверку перед выходом выполняет Stop-хук bin/loki-seal.js из репозитория плагина.
Исходный текст
SKILL.md · Apache-2.0
---
name: loki-seal
description: Use when finishing any coding task in a repo with tests. Loki Seal runs the repo's real test suite and refuses to let you declare done while tests newly fail, or while tests or CI config were deleted, skipped, xfailed or weakened. Runs locally with no model calls.
---
# Loki Seal
The enforcing piece is the plugin's Stop hook (`bin/loki-seal.js`). This skill is advisory: it tells you what the hook checks so you do not trip it. It registers no hooks itself.
When you try to finish, the hook:
1. Detects the runner (npm test with node --test/jest/vitest, pytest, go test, cargo test) and runs the real suite on the working tree.
2. Blocks the stop when tests newly fail since session start (already-red tests are reported, not blamed, except that a request item whose tests fail now always blocks), when the run crashed or ran nothing, when the total test count dropped, or when, compared with the session baseline, a test file was removed, test declarations or assertions dropped, a skip/xfail/only marker was added, or a CI workflow test step was removed or softened.
3. Reads the delivery contract from your first request (see README) and blocks while a request item (a must or bullet line of 2+ keywords) has no matching test that contains an assertion token and that the runner reported as passed (comments, docstrings, string, template and regex literals, skipped tests and tests in files the runner never ran never count), and always blocks while any test matched to a request item fails now: failing tests never count as covered. Only sentences opening with I, we, let me or let's (and tool-version or status notes) are dropped as chat and listed in the contract line; You, Our, My and Please sentences with a modal are requirement items. A spec file counts only when you mark it ("spec: docs/x.md"); when no contract can be derived the receipt says "NOT VERIFIED: no contract".
4. Reports a 6-line receipt (outcome, runner and counts, tests-integrity, contract, tree hash, Verified by Loki link).
## What to do when it blocks
Fix the production code. Do not delete, skip, xfail or weaken tests to get green; that is exactly what the hook detects. If a test is genuinely wrong, tell the user and let them decide.
## Install
Install the plugin: `claude plugin marketplace add <owner/repo or path>`, then install `loki-seal` from the `/plugin` UI. Installing only this skill gives you the guidance but no enforcement.
© asklokesh · Apache-2.0 · asklokesh/loki-mode