Логотип Refactor Evals

Refactor Evals

Сообщество
marekkirejczyk
refactor-evals

Bring an eval suite's cases up to written rules. Bundled cases are split to one requirement each, duplicates merged, every check moved to the cheapest grader that can decide it, and every failing or unsteady case diagnosed. Run it with what to refactor, such as a file, a PR or `failing`.

Обзор

Издательmarekkirejczyk
Репозиторийskills
Название навыкаrefactor-evals
Звёзды
157
Форки
1
Файлы в комплекте
3
ЛицензияMIT
Ссылки
  • Инструкции в формате Markdown

    Модель загружает файл SKILL.md по мере необходимости, поэтому токены расходуются только при подходящем запросе.

  • Работает с любой большой языковой моделью

    Навыки ИИ — это обычный Markdown, а не код для конкретного поставщика, поэтому они работают с GPT, Claude, Gemini, Grok и локальными моделями.

  • Файлы в комплекте: 3

    Скрипты, шаблоны и справочные материалы, которые модель может читать во время работы. Файлы доступны только для чтения и никогда не выполняются.

  • Открытый исходный код

    Издатель навыка на GitHub — marekkirejczyk. Перед установкой изучите исходные материалы.

Установка

Установите навык ИИ Refactor Evals в TypingMind, чтобы использовать его с любой LLM, или добавьте его в другой агент, который умеет читать SKILL.md.

1

Установка в TypingMind

TypingMind устанавливает навык прямо из его папки на GitHub: читает SKILL.md, собирает файлы ресурсов и сохраняет результат локально.

  1. Откройте приложение и перейдите в раздел «Плагины → Навыки».
  2. Выберите «Установить из GitHub».
  3. Вставьте указанную ниже ссылку на папку навыка и подтвердите установку.
    https://github.com/marekkirejczyk/skills/tree/main/skills/refactor-evals
  4. Включите навык в каждом чате, где хотите его использовать.
Плагины → Навыки → Добавить навык → По ссылке GitHub, затем вставьте ссылку на папку и нажмите «Продолжить».
2

Установка в другом агенте

Любой агент с поддержкой формата Agent Skills может использовать этот навык — скопируйте папку в каталог навыков этого агента.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/marekkirejczyk/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/skills/refactor-evals .claude/skills/refactor-evals
После копирования перезапустите Claude Code, чтобы загрузить новый навык.

Использование в TypingMind

Включите навык Refactor Evals в любом чате TypingMind, и дальше модель всё сделает сама. Его название и описание хранятся в системном промпте, а при появлении подходящего запроса модель сама загружает полные инструкции. Вам не нужно вызывать навык вручную, и до фактического использования он не расходует токены.

Модель сама загружает навык Refactor Evals, как только появляется подходящий для него запрос.

Работает с любой моделью ИИ

Навыки ИИ — это обычные инструкции в Markdown, а не код для конкретного поставщика, поэтому навык Refactor Evals не привязан к модели, для которой он был создан. Установите его один раз в TypingMind и используйте с GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama или локальной моделью, которую запускаете самостоятельно, — со своими ключами API.

  • Загружается только при необходимости

    Системный промпт содержит только название и описание. Инструкции загружаются при первом подходящем запросе, поэтому неиспользуемый навык не расходует токены.

  • Меняйте модели прямо в чате

    Навык состоит из инструкций, а не кода, поэтому смена модели не нарушает его работу: новая модель читает тот же файл SKILL.md.

Инструкции навыка

Это содержимое файла SKILL.md, которое загружает модель. Прочитайте его перед установкой: навык — это инструкции, которым будет следовать ваша модель.

Refactor evals

Bring the eval cases in a scope up to the rules below. Arguments: $ARGUMENTS. If your agent does not fill that in, take them from the user's message.

The scope is what the user names: the whole suite, a PR or branch's cases, a file or folder of cases, or failing (the cases red or marked in the latest run). With no scope given, use the whole suite.

Start by learning the suite: read its README, its case format, its runner and one case file, and map this skill's words onto the project's. Where the project has written its own eval rules, those win, and the conflict goes in the report. An example in its README is not a rule.

Change only the cases in scope, plus the suite's shared files (its list for every reply, shared fixtures) when a move needs them. Search the whole suite for duplicates of what is in scope, and report those outside it.

Why

A suite is worth running only while a red case means one known thing broke and a green case means its requirement held. Three things wear that away:

  • Bundles. A case holding several requirements fails more often than any of them: 17 checks that each hold 98% of the time pass together 71% of the time. Its failure doesn't say which requirement broke, and one mark on it silences them all.
  • Duplicates. A requirement held by several cases costs model calls on every run, and a change to it has to be found in every copy.
  • Checks at the wrong grader. A pattern that guesses at meaning fails good replies. A judge asked what code could decide costs a call and adds its own variance.

Words

  • Subject: the agent or prompt the evals test.
  • Requirement: one obligation from the product's sources (a spec, the system prompt, a policy) that the subject can break while keeping every other. A sentence that can be half kept is two requirements.
  • Scenario: the situation a case puts the subject in: its input and the fixtures the requirement depends on. Two situations are one scenario when the requirement reads the same in both: the same branch of it applies, and it predicts the same reply. Two cars or four, a link or a tick, are different scenarios only for a requirement that names the difference.
  • Case: one scenario with its expectations.
  • Check: an expectation code decides. Judge statement: one a model decides. Both are expectations.
  • Mark: what lets a case fail without failing the run (a known bug, a skip, an expected failure).
  • Trial: one run of a case against the subject.
  • Good reply, bad reply: replies you write by hand, one keeping a requirement and one breaking it. They go green and red in Proof.

Goal

You are done when all five hold:

  1. Every case holds one requirement, cited by its source and section, and every expectation in the case traces to it or is listed in Ask.
  2. Every requirement is held once per scenario. No two cases share both.
  3. Every expectation is at the cheapest grader that can decide it: code first, then the judge.
  4. Nothing is lost. Every pair of requirement and scenario held before is held after, or the user decided to drop it.
  5. Every red is explained. Each failing or unsteady case in scope has a verdict from A red case.

Then the project's format, lint and test commands pass, and every changed case passes every trial or carries a mark.

The ledger

Before the first change, write the ledger in your working notes: one row per expectation in scope.

Requirement (source, section)ScenarioGraderCaseWhere

Write "none found" for an expectation no source backs. Leave out what the runner adds to every case by itself. Then sort by requirement and scenario. The ledger finds the work:

  • A case whose rows name more than one requirement: Split.
  • A requirement and scenario held by more than one case: Merge.
  • One expectation repeated across cases, about every reply and not about their requirements: Hoist.
  • An expectation about what code decides, with nothing left to the model: Push down.
  • A row with "none found": Trace.

At the end, rebuild the ledger from the files and compare it with the first one, pair by pair. That comparison is goal 4.

Rules

examples.md, next to this file, shows each rule broken and kept. Read it before your first round.

Cases

  1. One requirement per case. The name states the behaviour a reader would observe. A name that needs "and" is two cases. Names are unique across the suite.
  2. The case cites its requirement: the source and its section, in the field the project has for it.
  3. A case asks what its requirement asks, and no more. Two people who read the requirement would give any reply the same verdict.
  4. The shortest scenario that reaches the requirement. Earlier turns are there only when the requirement depends on them. An earlier turn carries at most a precondition: one check that the scenario was reached (the list the next turn refers to was shown). A failed precondition is a case that didn't reach its requirement, never the requirement failing.
  5. Both sides of a boundary. A requirement with a condition ("only after", "unless") has a case on each side, and each name says which side.
  6. Invented data. No real person's words, names or records.

Checks

  1. Code decides what code can: how the reply ended, which tools ran and with what, what was shown, a literal, a count.
  2. A must-say pattern is a literal the reply has to carry: a price, a date, a name from a fixture. A list of synonyms is a judge statement.
  3. A must-never-say pattern is a literal no good reply contains. When a refusal or a negation can contain it ("I can't guarantee a date"), it is a judge statement. The exception is a requirement that bans the word itself.
  4. Grade the outcome. Expect a tool call only when the requirement is that it runs, with only the arguments the requirement names, and in an order only when the order is the requirement. Any other expectation about calls is one for Trace.
  5. What holds for every reply is written once, in the suite's list for every reply.
  6. Each fact is checked once in a case, by the cheaper grader that decides it.

Judge statements

  1. One fact per statement. It is two facts when a reply can make one half true and the other false. "A or B" appears only when the requirement itself gives the alternatives.
  2. Checkable from the transcript alone, in plain words, saying what the reply does.

Marks

  1. A mark's note says which expectation fails, what the reply did instead, how often (k of n trials), since when, and its ticket where the project has one.
  2. A mark comes off with the fix: when the cause its note names is gone and the case passes 5 of 5. A clean run alone only adds "not reproduced, 5 of 5" and the date to the note: a case that fails one time in six passes 5 of 5 four times in ten.

Changing an expectation

  1. An expectation changes only on proof: a good reply fails it, or a bad reply passes it. A case that is red because the subject broke its requirement stays as written.

Moves

  • Split. A case holding several requirements becomes one case per requirement on the same scenario. Each expectation goes to the case whose requirement it traces to.
  • Merge. Cases holding one requirement in one scenario become one: keep the shorter scenario and the union of what their expectations catch. Cases that share a requirement across different scenarios both stay, and their names say what differs. When you can't tell whether the scenarios differ, leave both and take them to Ask. Split first: two bundles that each hold "offers nothing for sale" in the same scenario only show as duplicates once they are apart.
  • Hoist. An expectation repeated across cases that holds for every reply moves to the suite's list for every reply and leaves the cases.
  • Push down. An expectation about what code decides (a tool's result, a card the code builds) moves to a unit test of that code. The eval keeps what the model does with it.
  • Regrade. A judge statement code can decide becomes a check (rule 7). A pattern that guesses at meaning becomes a judge statement (rules 8 and 9).
  • Trace. For an expectation with no requirement, search the sources. Found: it gets its own case citing it, in a scenario where the requirement applies. Not found: it stays, in the first case a split of its case makes, and goes to Ask.
  • Pair. A boundary with one side covered gets the other side's case when the source states both sides. Otherwise report the gap.
  • Shorten. Cut the turns the requirement doesn't depend on.

Proof

Both ways. Every expectation you write, reword, or rely on to remove another is shown green on a good reply and red on a bad reply. An expectation moved unchanged needs none. Write the two replies in the shape the runner grades (the words, the tools run, what was shown), and grade them with the project's own check function and judge from a scratch file you never commit. This calls the judge at most; the subject isn't needed. For a must-never-say pattern, the good reply contains the innocent use: a refusal that names the thing.

Removal. A case or an expectation goes only when, for each requirement it held, a remaining expectation is red on that requirement's bad reply.

When the runner can't grade a reply you give it, or there is no key for the judge, that is a finding (harness.md). Until it can, prove by reading each expectation against the two replies, and say so in the report.

Trials

The subject answers differently each time, so one pass proves little.

  • Baseline. Before the first round, run every case in scope for 3 trials with retries off, and record k of 3 for each, keeping each trial's transcript. Say first how many subject calls that makes: the turns in scope × 3. Use the runner's own options for trials, retries and choosing cases. Where it has none, run its command 3 times and count first tries only, and report the lack as a finding.
  • After the last round, do the same for every case you changed or created.
  • Steady is 3 of 3. A case steady at baseline is steady after, or the round that changed it is undone.
  • Parts of a split are judged on their own: the steady parts carry no mark, and a red or unsteady part gets a verdict from A red case.

A split multiplies subject calls. Report the case count and the calls per run, before and after.

With no key for the subject's model, make the moves Proof covers without it and report the trials as not run.

A red case

Read the transcript before anything else: the baseline's, or the latest report's. A mark's note is not a transcript. Then give each failing expectation one verdict:

VerdictThe transcript showsWhat you do
HarnessA model error, a timeout, a judge's answer that couldn't be readRun it again. If it repeats, report it as a finding (harness.md)
CaseA reply that keeps the requirement and still fails: the case asks more than the requirement, a pattern catches a good reply, a fixture is wrongFix the case under rule 17, and say why in the commit
SubjectA reply that breaks the requirementLeave the case as written and report it with the transcript. Mark it (rule 15) only if it was already red at baseline
RequirementSources that are unclear, contradict each other, or say nothing of the failing expectationAsk

A case at 0 of n is suspect before the subject is: look for a fixture typo or an expectation no reply could meet. For an unsteady case, read the failing trials, name the expectation that fails, and give the verdict for that one.

Rounds

Work on a new branch, in rounds: one move on one case or one cluster, then the project's checks that need no model (the case schema, lint, unit tests), then a commit. Leave the branch unpushed.

Order: the baseline, the ledger, verdicts for red cases, Trace, Split, Merge, Hoist, Regrade, Pair and Shorten, then the trials.

The runner and the fake world have their own rules in harness.md. Read it when the scope is the whole suite or includes the runner's files, or when a move needs something the runner can't do. When a rule needs a kind of expectation the case format lacks (the order of calls, a call that must never carry an argument), write the nearest the format has and report the lack as a finding.

Ask

Run everything above without asking. Then present these in one batch, numbered, each with its cases as file:line and your recommendation:

  • an expectation no source backs: add the requirement to the sources, or drop it
  • a merge where the scenarios may differ in a way that matters
  • a requirement that is unclear or contradicted
  • a harness finding marked ask in harness.md

Apply the answers in the same session, one commit each. What the user doesn't answer stays as it is.

Report

  • Cases before and after, and subject calls per run before and after.
  • Each move made: cases split, merged and removed, expectations hoisted and regraded.
  • The trials: k of n per changed case, before and after, or that they weren't run.
  • Each red case with its verdict, and each mark added, rewritten or removed.
  • Subject failures, each with its requirement and transcript.
  • Gaps: boundaries with one side, a cited requirement with no expectation, tool outcomes with no case, marks with no ticket, harness findings.
  • What was proved by reading instead of by grading.

Файлы в комплекте

Модель читает эти файлы по мере необходимости, пока навык загружен. Они доступны только для чтения и никогда не выполняются.

Часто задаваемые вопросы

Что делает навык ИИ Refactor Evals?

Bring an eval suite's cases up to written rules. Bundled cases are split to one requirement each, duplicates merged, every check moved to the cheapest grader that can decide it, and every failing or unsteady case diagnosed. Run it with what to refactor, such as a file, a PR or `failing`.

Зачем использовать Refactor Evals в TypingMind?

Потому что вы устанавливаете навык один раз и используете его с любой моделью. Refactor Evals — это обычный текст в формате Markdown, а не код для конкретного поставщика, поэтому один и тот же навык работает с GPT-5, Claude, Gemini, Grok или локальной моделью. Вы можете менять модель прямо во время чата, и навык продолжит работать. TypingMind использует ваши собственные ключи API, поэтому вы платите поставщикам напрямую, а не оформляете подписку с оплатой за каждое место. Ваши навыки и чаты остаются в вашем собственном хранилище.

Как установить Refactor Evals в TypingMind?

В TypingMind откройте «Плагины → Навыки → Установить из GitHub» и вставьте https://github.com/marekkirejczyk/skills/tree/main/skills/refactor-evals. TypingMind прочитает файл SKILL.md, включит сопутствующие файлы в пакет и установит навык, который можно включать отдельно для каждого чата.

Какие модели ИИ могут использовать Refactor Evals?

Любая модель, которую вы подключите в TypingMind. Навыки ИИ — это обычные инструкции в формате Markdown, а не код для конкретного поставщика, поэтому GPT, Claude, Gemini, Grok и локальные модели могут загружать этот навык, когда запрос ему соответствует.

Со сколькими моделями ИИ можно использовать Refactor Evals?

С любым количеством. В TypingMind вы можете использовать Refactor Evals с любой моделью, которая поддерживает навыки, в том числе с GPT, Claude, Gemini, Grok, DeepSeek, Mistral и Llama. Для этого вы используете собственные ключи API.

Бесплатен ли навык ИИ Refactor Evals?

Да. Навык опубликован на GitHub по лицензии MIT. Издатель — marekkirejczyk. Вы платите только своему поставщику ИИ за использованные токены.

Что такое навыки ИИ?

Навык ИИ — это набор инструкций, которыми модель ИИ может пользоваться каждый раз, когда ей нужно выполнить конкретную задачу. Он соответствует открытому формату Agent Skills: файл SKILL.md с названием и описанием, а также любые скрипты, шаблоны или справочные файлы, которые могут понадобиться модели. Модель читает инструкции, только когда ваш запрос соответствует навыку, поэтому установленный навык ничего не стоит, пока не используется.

Чем навыки ИИ отличаются от плагинов и серверов MCP?

Плагин или сервер MCP даёт модели новые инструменты, которые она может вызывать: при вызове где-то выполняется код и возвращает результат. Навык ИИ, напротив, даёт модели знания и описывает порядок действий: как подойти к задаче, какие шаги выполнить и каким должен быть хороший результат. Навыки — это обычный текст в формате Markdown, поэтому им не нужны сервер, ключ API или среда выполнения, и они работают с любой моделью.

Все

Создайте своё рабочее пространство с ИИ прямо сейчас

Подпишитесь на нашу рассылку, чтобы узнавать о новых функциях и предстоящих розыгрышах 👇