grinding-until-pass — скилл для Claude Code: гоняет код до зелёных
Скилл заставляет агента крутить цикл «правка → запуск → проверка» до тех пор, пока тесты не пройдут, сборка не соберётся или линтер не замолчит.
npx skills add spencerpauly/awesome-cursor-skills --skill grinding-until-pass -a claude-codeЧто делает grinding-until-pass
Скилл описывает цикл из четырёх шагов. Сначала задаётся команда-цель, по её коду возврата определяется успех: npm test, npm run build, npm run lint, npx tsc --noEmit или всё вместе через &&. Дальше агент запускает команду, читает вывод, находит корневую причину и делает минимальную правку. Потом возвращается к запуску.
В правилах цикла есть жёсткие рамки. Максимум 10 итераций: если после них команда всё ещё падает, агент останавливается и рассказывает, что мешает. Правит он по одной ошибке за раз, тесты не удаляет, ошибки не глушит через @ts-ignore, eslint-disable и any. Если число ошибок растёт, а не падает, цикл прерывается и подход пересматривается.
Для Cursor в скилле описан хук в .cursor/hooks.json: событие stop запускает bash .cursor/scripts/check-tests.sh, скрипт смотрит код возврата и шлёт followup_message, если тесты всё ещё красные. Ограничение простое — на медленных тестах цикл будет ползти, поэтому автор советует флаги --bail или --fail-fast. И ещё: агент упорный, но не изобретательный. Если правка требует смены дизайна, зовите человека.
Какие задачи решает
- добить упавшие тесты после крупного рефакторинга
- разгрести ошибки типов после обновления зависимости
- починить сборку после слияния ветки с конфликтами
- вычистить замечания линтера, не отключая правила
- довести проверку типов до чистого вывода
tsc
Примеры запросов агенту
- прогони
npm testи правь код, пока все тесты не пройдут - гоняй
npm run lint && npx tsc --noEmit && npm test && npm run build, пока всё не станет зелёным - после рефакторинга добейся, чтобы
npx vitest runпроходил без ошибок
Как установить grinding-until-pass
1Через Skills CLI (Vercel)
npx skills add spencerpauly/awesome-cursor-skills --skill grinding-until-pass -a claude-code2Вручную: положить файлы
~/.claude/skills/grinding-until-pass/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/grinding-until-pass/
1Через Skills CLI (Vercel)
npx skills add spencerpauly/awesome-cursor-skills --skill grinding-until-pass -a codex2Вручную: положить файлы
.agents/skills/grinding-until-pass/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add spencerpauly/awesome-cursor-skills --skill grinding-until-pass -a cursor2Вручную: положить файлы
.cursor/skills/grinding-until-pass/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install spencerpauly/awesome-cursor-skills grinding-until-pass2Вручную: положить файлы
.github/skills/grinding-until-pass/SKILL.md1Через Skills CLI (Vercel)
npx skills add spencerpauly/awesome-cursor-skills --skill grinding-until-pass -a gemini-cli2Командой платформы
gemini skills install https://github.com/spencerpauly/awesome-cursor-skills --path resources/grinding-until-passВручную: положить файлы
.devin/skills/grinding-until-pass/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add spencerpauly/awesome-cursor-skills --skill grinding-until-pass -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о grinding-until-pass
Как установить grinding-until-pass в Claude?
Выполните npx skills add spencerpauly/awesome-cursor-skills --skill grinding-until-pass -a claude-code. Скилл окажется в ~/.claude/skills/grinding-until-pass/SKILL.md.
Что делает grinding-until-pass?
Задаёт агенту цикл: запустить команду-цель, разобрать ошибку, внести минимальную правку и повторить. Останавливается, когда тесты, сборка или линтер проходят, либо после 10 итераций.
Чем ограничен цикл?
Лимитом в 10 итераций, правилом чинить по одной ошибке и запретом удалять тесты или глушить ошибки через @ts-ignore и eslint-disable. На медленных тестах цикл идёт долго, автор советует --bail или --fail-fast.
Исходный текст
SKILL.md · CC0-1.0
---
name: grinding-until-pass
description: Keep iterating on code changes until the tests pass, the build succeeds, or linting is clean. Runs in a tight loop of fix → run → check → repeat. Use when you want the agent to autonomously grind through test failures or build errors.
---
# Grind Until Pass
Use this skill when you want the agent to keep working autonomously until a specific goal is met — all tests pass, the build succeeds, or linting is clean. Instead of stopping after one attempt, the agent loops until done.
## Steps
1. **Define the goal command** — the command whose exit code determines success:
- Tests: `npm test` or `npx vitest run`
- Build: `npm run build`
- Lint: `npm run lint`
- Type-check: `npx tsc --noEmit`
- All of the above: `npm run lint && npx tsc --noEmit && npm test && npm run build`
2. **Run the command** — execute it and capture the output.
3. **If it fails — analyze and fix**:
- Read the error output carefully.
- Identify the root cause: failing test assertion, type error, lint violation, import error, etc.
- Make the minimal fix. Don't refactor — just fix the error.
- Go back to step 2.
4. **If it passes — stop and report**:
- Report what was fixed and how many iterations it took.
- Summarize the changes made.
## Rules for the Loop
- **Maximum 10 iterations** — if after 10 attempts the command still fails, stop and report what's blocking progress. Something fundamental is wrong and needs human input.
- **Fix one thing at a time** — don't try to fix all errors at once. Fix the first error, re-run, and see if the fix resolves downstream errors too.
- **Don't delete tests** — if a test is failing, fix the code to make it pass. Don't modify the test unless the test itself is clearly wrong (testing old behavior that was intentionally changed).
- **Don't suppress errors** — don't add `@ts-ignore`, `eslint-disable`, or `any` types to silence errors. Fix the actual problem.
- **Track progress** — if the number of errors is increasing instead of decreasing, stop and reassess the approach.
## When to Use This
- After a large refactor that broke multiple tests
- After upgrading a dependency that introduced type errors
- After merging a branch with conflicts that need resolution
- When you want to "just make it green" and trust the agent to grind through it
## Advanced: Cursor Hooks Integration
You can automate this with a Cursor hook in `.cursor/hooks.json` that triggers after the agent's turn ends, checks if tests pass, and sends a follow-up message if they don't:
```json
{
"hooks": [
{
"event": "stop",
"command": "bash .cursor/scripts/check-tests.sh",
"description": "Re-run tests after agent stops and send follow-up if failing"
}
]
}
```
The script checks the exit code and returns a `followup_message` if tests are still failing.
## Notes
- This works best with fast test suites. If your tests take 5+ minutes, the loop will be slow.
- Use `--bail` or `--fail-fast` flags to stop at the first failure for faster iteration.
- The agent will be thorough but not creative — if the fix requires a design change, it'll need human guidance.
© spencerpauly · CC0-1.0 · spencerpauly/awesome-cursor-skills