reflect · sneg55 — скилл для Claude Code: самоулучшение проекта
Читает журнал .harness и заметки с правками разработчика, а потом предлагает изменения правил и порогов, чтобы проект перестал повторять одни и те же ошибки.
npx skills add sneg55/agent-starter --skill reflect -a claude-codeЧто делает reflect
Скилл проходит четыре фазы. Сначала собирает сигнал: гоняет скрипт статистики по журналу .harness/ledger.jsonl, читает правила проекта в CLAUDE.md, свежие заметки типа feedback и прошлый отчёт из .harness/reflections/. Потом группирует повторяющиеся проблемы: каждая строка recurring <rule> <prefix> <count> — это один кластер трения, а разовые события отбрасываются.
На каждую группу готовится ровно одно предложение. Тип выбирается по ситуации: правило проекта дописывается в CLAUDE.md, порог стража меняется диффом в .claude/settings.json или хуке, механически ловимую ошибку закрывает правило линтера в eslint.config.mjs или biome.jsonc, а долгое «почему» уходит в заметку памяти или docs/adr/. Все предложения показываются нумерованным списком, и ничего не применяется без вашего согласия.
Дальше вы одобряете, правите или отклоняете каждый пункт, одобренное коммитится, а в .harness/reflections/YYYY-MM-DD.md ложится отчёт со снимком метрик и причинами отказов. Отчёт попадает в git, а сырой журнал остаётся в .gitignore. Учтите: без установленных хуков в ~/.claude/hooks/ скрипт статистики не найдётся, и тогда его нужно запускать из того места, где проект держит хуки. Если скрипт выдаёт одни нули, сигнала ещё нет и размышлять не над чем.
Какие задачи решает
- найти проверки, которые срабатывают в одном и том же месте снова и снова
- превратить правки разработчика из заметок
feedbackв правило проекта - ослабить или ужесточить порог стража без ручной правки хука
- завести правило линтера под ошибку, которую видно механически
- зафиксировать в
docs/adr/причину решения, чтобы к ней не возвращались
Примеры запросов агенту
- Запусти reflect и посмотри, какие проверки повторяются чаще всего
- Собери кластеры из журнала
.harness/ledger.jsonlи предложи по одному изменению на каждый - Запиши отчёт о размышлении в
.harness/reflections/и сравни метрику с прошлой
Как установить reflect
1Через Skills CLI (Vercel)
npx skills add sneg55/agent-starter --skill reflect -a claude-code2Вручную: положить файлы
~/.claude/skills/reflect/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/reflect/
1Через Skills CLI (Vercel)
npx skills add sneg55/agent-starter --skill reflect -a codex2Вручную: положить файлы
.agents/skills/reflect/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add sneg55/agent-starter --skill reflect -a cursor2Вручную: положить файлы
.cursor/skills/reflect/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install sneg55/agent-starter reflect2Вручную: положить файлы
.github/skills/reflect/SKILL.md1Через Skills CLI (Vercel)
npx skills add sneg55/agent-starter --skill reflect -a gemini-cli2Командой платформы
gemini skills install https://github.com/sneg55/agent-starter --path skills/reflectВручную: положить файлы
.devin/skills/reflect/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add sneg55/agent-starter --skill reflect -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о reflect
Как установить reflect в Claude Code?
Выполните npx skills add sneg55/agent-starter --skill reflect -a claude-code. Скилл окажется в ~/.claude/skills/reflect/SKILL.md.
Что делает скилл reflect?
Читает журнал .harness и заметки с правками, находит повторяющиеся проблемы и предлагает изменения правил, порогов, линтера или ADR. Применяется только то, что вы одобрили.
Что нужно, чтобы reflect заработал?
Нужен непустой журнал .harness/ledger.jsonl и скрипт harness-ledger-stats.sh, обычно лежащий в ~/.claude/hooks/. Если статистика выдаёт нули, сигнала нет и скилл останавливается.
Исходный текст
SKILL.md · MIT
--- name: reflect description: Per-project self-improvement - reads the .harness ledger and feedback memories, then proposes gated rule/threshold/ADR changes so the project stops repeating mistakes. Run periodically. user_invocable: true allowed-tools: - Read - Write - Edit - Bash - Glob - Grep --- # Reflect: Per-Project Self-Improvement You are performing a reflection - turning the signal this project has captured into durable improvements. Nothing is applied without the developer's approval. ## Phase 1 - Orient (gather signal) - Run the stats script over the ledger: `~/.claude/hooks/harness-ledger-stats.sh --ledger .harness/ledger.jsonl --min-recurr 3` If that path doesn't exist, the hooks aren't installed at `~/.claude/hooks/` - run the copy from wherever this project keeps them. If the script prints all zeros there is no ledger yet (no signal captured) - stop; there is nothing to reflect on. - Read the current project rules in `CLAUDE.md` so you improve them rather than duplicate. - Read recent `feedback`-type memory files - these are the developer's explicit corrections and are the highest-value signal. Locate the memory directory first (it sits next to `MEMORY.md`; `find . -name MEMORY.md` if unsure), then `grep -l 'type: feedback' <memory-dir>/*.md`. - Read the most recent `.harness/reflections/*.md` report (if any) to recall the last metric snapshot and what was already changed. ## Phase 2 - Cluster From the stats output and feedback memories, identify recurring problems: - Each `recurring <rule> <prefix> <count>` line is a friction cluster - the same check keeps firing in the same area. - Group related feedback corrections by theme. - Ignore one-off events; focus on what repeats. ## Phase 3 - Propose (one candidate per cluster) For each cluster, draft exactly one proposed change, choosing the fitting type: | Type | When | Where it lands | |------|------|----------------| | **Project rule** | a convention would stop the repeat | append to `CLAUDE.md` project-specific section | | **Threshold change** | a guardrail is too strict/loose | a diff to `.claude/settings.json` or the hook - **shown, never auto-applied** | | **Lint rule** | the mistake is mechanically catchable | a diff to `eslint.config.mjs` / `biome.jsonc` | | **ADR / knowledge** | durable "why" worth keeping | a new memory file or `docs/adr/` note | Present all proposals together as a numbered list with the concrete change for each. ## Phase 4 - Gate & Record - Ask the developer to approve, edit, or reject each proposal (like `/remember`). - Apply only the approved ones, then commit them (use `/commit`). - Create `.harness/reflections/` if needed (`mkdir -p .harness/reflections`), then write a reflection report to `.harness/reflections/YYYY-MM-DD.md` containing: - the full stats output (the **metric snapshot**, so the next reflection can compare), - the clusters you found, - which proposals were approved / rejected and why. The report is committed; the raw `.harness/ledger.jsonl` stays gitignored. Signal is private; wisdom is shared. ## Measuring success The headline metric is `recurring_events` from the stats output. Compare it to the value in the previous reflection report. If a rule you promoted last time worked, the cluster it targeted should have shrunk. Note the trend explicitly in the new report.
© sneg55 · MIT · sneg55/agent-starter
Похожие скиллы
Все скиллы по теме «Настройка агента: память, контекст, субагенты» →Сначала — reflect от других авторов.