Логотип Refactor Research Code

Refactor Research Code

Сообщество
ShaishavMaisuria
refactor-research-code

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

Add to TypingMind

Обзор

ИздательShaishavMaisuria
Репозиторийresearch-paper-lifecycle-skills
Название навыкаrefactor-research-code
Звёзды
59
Форки
22
Файлы в комплекте
2
ЛицензияApache-2.0
Ссылки
  • Инструкции в формате Markdown

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

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

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

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

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

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

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

Установка

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

1

Установка в TypingMind

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Refactor Research Code

Take a research repo from "works on my machine" to a clean, documented, re-runnable public release — without changing a single number the paper reports. Research code accretes dead experiment branches, hardcoded paths, magic hyperparameters, an undocumented "run this file, then that one" ritual, and identifying breadcrumbs. This skill removes that cruft and gives the repo a sensible layout, but it treats result preservation as the prime directive: it classifies every proposed change as safe (mechanical, behavior-preserving) or ask-first (could move the numbers), and it never touches an ask-first item without the author's explicit say-so.

It is not generic refactoring (no perf rewrites, no "modernize the API," no restructuring for its own sake). The only goal is release readiness with identical behavior. When a "cleanup" would change what the code computes, the right move is to flag it and ask — not to make the repo prettier at the cost of the paper's claims.

When to use

  • "Clean up / refactor my research code for release." / "It's a mess — get it publishable."
  • "Remove the dead experiment branches and commented-out code."
  • "Separate config from code." / "These hyperparameters are hardcoded everywhere."
  • "Make my runs deterministic / re-runnable." / "Document the entrypoint."
  • "Give the repo a clear layout." / "Strip my identity for double-blind."
  • Before test-research-code (which adds tests/seeds/env) and prepare-artifacts (which packages and hosts for a badge) — this is the structural cleanup that comes first.

What this is NOT (route elsewhere)

You want…Use instead
Add smoke tests, pin seeds, capture the environmenttest-research-code
Package + archival DOI/SWHID + badge taxonomy + appendixprepare-artifacts
Deep double-blind sweep of the paper + reversible de-anonanonymize-paper
Confirm the produced numbers match the paper's tablesverify-results
Reorganize the paper's sections/argumentrefactor-structure

This skill flags seeding/env gaps and identity leaks and hands them off; it does the structural cleanup itself.

Inputs

  1. The research-code directory (the repo, or a subfolder holding the experiment scripts). This skill reads local files only; it does not clone.
  2. Whether review is double-blind / single-blind / not blind (drives the identity scan), and any identifying terms to scan for (author names, institution, internal codenames).
  3. Optionally .paper-memory/profile.yml (contribution type — a system or dataset paper is judged harder on code quality, leaning toward a Reusable release).
  4. Optionally the target venue's artifact track, if the cleanup is in service of one — but badge rules are fetched live by prepare-artifacts, not here.

Prime directive: preserve exact numerical behavior

Every action this skill takes falls in one of three buckets. Treat the boundary between them as sacred.

  • SAFE — apply freely (with the author's nod): add a README / LICENSE / .gitignore; move files into a src//package layout (then fix imports); delete pure junk (__pycache__, *.pyc, .DS_Store, editor swap files); document the existing entrypoint; reformat whitespace/comments only. These cannot change what the code computes.
  • ASK-FIRST — never touch without explicit confirmation: delete a code path (a backup file, a commented-out block, an if False: branch — it may be a toggled experiment or silently shadow the live version); extract a hardcoded hyperparameter or path into config (the value must be preserved exactly); change anything touching seeding, RNG, thread/worker count, dtype/precision, or evaluation order (these define the numbers). For each, present the finding, the proposed change, and why it might change results, then wait.
  • IDENTITY — scrub before any blind upload: emails, home paths, author names, .git history. Surface them here; hand the deep sweep to anonymize-paper.

If you cannot tell whether a change is safe, it is ask-first by default. A prettier repo that reports different numbers is a failure, not a success.

Process

This follows plan → confirm → apply-safe → ask-on-risk, with the plan grounded in an external, measurable signal — the static audit, not the model's sense that the repo "looks clean." Name assumptions, show competing readings, and keep the author in control.

  1. Read memory first. Read .paper-memory/lessons.md (and profile.yml if present) so you skip what the author already fixed and lead with their recurring habits (e.g. "you tend to ship .git and hardcoded /home paths"). See paper-memory-convention.md.

  2. Confirm scope and blind level. Ask whether review is double-blind and what the release is for (a public GitHub release, a blind-review supplement, an artifact track). Don't anonymize a single-blind/non-blind release — it mangles a fine repo. Get the identifying terms to scan for if blind.

  3. Run the static release-refactor audit (deterministic). Do not hand-grep:

    python3 scripts/release_audit.py <code-dir> \
        --blind <none|single|double> --names "Jane Doe,Example University"
    # machine-readable:
    python3 scripts/release_audit.py <code-dir> --blind double --json

    It walks the repo (read-only, no execution, no network, no writes) and emits findings tagged by category (dead-code, config, entrypoint, layout, determinism, identity, hygiene) and, critically, by risk: SAFE, ASK-FIRST (behavior-risk), or IDENTITY. Flags: --strict (any finding fails), --max-files N, --max-bytes N (in-tree blob threshold). Exit codes: 0 no ask-first/identity findings, 1 ask-first or identity findings present, 2 usage error. This is the signal the plan is built on (an external check, not self-judgment); the audit maps opportunities — it does not prove the repo reproduces.

  4. Present a refactor plan the author approves BEFORE any edit. Group the findings into the three buckets, ordered SAFE → ASK-FIRST → IDENTITY. For each ask-first item, state the change and the result-risk ("deleting this if False: block is safe only if it is unreachable in every config — confirm?"). The author approves or vetoes per item. Categories and the safe refactor recipes are in references/release-refactor-catalog.md.

  5. Apply SAFE refactors (with the author's go-ahead), in this order — each maps to an audit category:

    • Layout — add README (entrypoint, the exact reproduce command per result, deps, the directory map), LICENSE, .gitignore; move a flat dump of scripts into a src//package layout and fix the imports.
    • Entrypoint — document (or wire) one obvious command that runs the pipeline end to end (make reproduce / run.sh / python -m pkg).
    • Hygiene — remove __pycache__, *.pyc, .DS_Store, editor swaps from the release copy; move large in-tree data/model blobs to a download script / archival host (this last one is ask-first — confirm the blob isn't needed at runtime).
  6. Walk ASK-FIRST items one at a time, never in bulk. For each approved change: make the minimal edit, then verify behavior is preserved by an external check — re-run the pipeline (or the smoke test) and diff the output, not by eyeballing the diff. Behavior preservation is confirmed by re-running, which is test-research-code / verify-results territory; this skill flags and coordinates, and stops to ask when a change is genuinely risky. Escalation is a feature. In particular:

    • dead-code — only after confirming nothing imports/reaches it.
    • config — extract the literal into config/CLI with the identical value; a typo here silently changes results.
    • determinism — set/record seeds and pin order in coordination with the author, then re-run to re-confirm the paper's numbers. Adding a seed changes an unseeded run — this is the highest-risk edit. Hand the seed/env mechanics to test-research-code.
  7. Handle IDENTITY leaks for blind review. Surface emails, home paths, names, and .git history; hand the deep sweep (commit history, notebook metadata, self-citation phrasing, anonymized mirror) to anonymize-paper. Never expose the author through the repo on a blind upload.

  8. Re-run the audit until SAFE-clean, with an explicit stop condition. Loop audit → fix → audit until no SAFE/layout/hygiene findings remain and every ask-first item is resolved or consciously deferred — not open-endedly. Hard cap ~3 passes; if the audit still flags the same ask-first item, that is a judgment call to escalate, not to keep editing.

  9. Write the refactor plan + change log to paper-workspace/submission/refactor-research-code-plan.md and append a line to paper-workspace/INDEX.md. Lead with what was done (safe), then the ask-first decisions (applied / vetoed / deferred, each with the result-risk noted), then the identity handoff. Cite each item's audit finding.

Output

  • A refactor plan (SAFE / ASK-FIRST / IDENTITY buckets, each finding with category + risk + file[:line]) plus a change log of what was applied, vetoed, or deferred — written to paper-workspace/submission/.
  • The edited repo files (only with per-item approval): README / LICENSE / .gitignore, a src//package layout, a documented entrypoint, junk removed, and any ask-first edits the author confirmed.
  • A clear handoff list: seeds/env/tests → test-research-code; packaging/DOI/ badge → prepare-artifacts; deep anonymization → anonymize-paper; number-vs-paper check → verify-results.

Adapt to your discipline

The audit reads a directory, not a discipline, so the layout/dead-code/identity checks apply broadly. For non-Python stacks, the determinism and config patterns differ (R set.seed, Julia Random.seed!, a renv.lock/Manifest.toml for the env) — the script already knows several; extend the pattern tables in scripts/release_audit.py for your language. The result-preservation contract is universal: clean the repo, keep the numbers.

Guardrails

  • Preserve exact numerical behavior — this is the whole point. Never apply an ask-first change (delete code, extract a constant, touch seeding/threading/ dtype/order) without explicit author approval, and verify preservation by re-running, never by reading the diff (self-reflection validates its own mistakes — the verification must be external).
  • When unsure whether a change is safe, it is ask-first. A prettier repo that reports different numbers is a failure.
  • Run nothing destructive and nothing untrusted. release_audit.py is static, read-only, no network. Re-running the pipeline to verify behavior is the author's call and may need a sandbox/GPU.
  • Anonymization-aware: for blind review, never expose identity through the repo or .git history; hand the deep sweep to anonymize-paper.
  • Stay in your lane. Don't add tests/seeds/env (that's test-research-code), mint a DOI or package an artifact (that's prepare-artifacts), or claim the results reproduce (that's verify-results, and "reproduce" is never bit-exact and never this skill's call).
  • Copilot, not pilot: it plans, asks, and edits on approval; it never submits, deposits, or pushes on the author's behalf.
  • references/ files stay one level deep; keep this file under 500 lines.

Memory

Uses the shared .paper-memory/ convention (full spec: paper-memory-convention.md).

  • At start: read lessons.md to skip already-fixed cleanups and lead with recurring release habits (e.g. "you ship hardcoded /home/<you> paths every repo"); read profile.yml for the contribution type.
  • At end: append one dated entry per recurring habit, in the canonical format, via reflect-and-improve's reflect_log.py:
    python3 ../reflect-and-improve/scripts/reflect_log.py append \
        --memory .paper-memory --skill refactor-research-code --scope recurring \
        --issue "hyperparameters hardcoded across scripts, no config file" \
        --rec "extract to config.yaml/CLI with identical values every release"
  • Create .paper-memory/ on demand and offer to add it to .gitignore; local-only, never uploaded, never copied into this repo.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Все
Логотип openclaw

Tavily

openclaw
ОрганизацияПопулярный

Инструменты Tavily для поиска в интернете, извлечения содержимого и исследований.

82.2K
391K
Инструкции
Открыть
Логотип affaan-m

Deep Research

affaan-m
СообществоПопулярный

Проводите глубокие исследования по нескольким источникам с помощью firecrawl и exa MCPs. Ищите информацию в интернете, обобщайте результаты и готовьте отчёты со ссылками и указанием источников. Используйте этот навык, если пользователю нужно тщательно…

40.4K
270.2K
Файлы: 1
Открыть
Логотип affaan-m

Exa Search

affaan-m
СообществоПопулярный

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

40.4K
270.2K
Файлы: 1
Открыть
Логотип mattpocock

Wayfinder

mattpocock
СообществоПопулярный

Спланируйте крупный объём работы, который не поместится в одну сессию агента, в виде общей карты задач для принятия решений в трекере. Затем решайте их по одной, пока путь к цели не станет понятен.

22.3K
264.4K
Файлы: 1
Открыть

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

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