research‑code‑skillconformance registry · v1.3.0一致性规则登记表 · v1.3.0
enforced as code is written ML / DL research repos

Code that stays in spec, not just reviewed after.

代码始终符合规范,而非事后才审查。

A coding-standard enforcer for AI agents working inside a research codebase. It enforces two standards: a steady project framework that stays consistent, and healthy code — clear comments, sensible APIs, thorough modularization.

§01 · 能力

What it does.

§02 · 场景

Two scenario examples.

A · build from zero
“Create a new research project here and add a model trained on CIFAR.”

The agent scaffolds the structure, then writes src/, configs/, and Hydra _target_ per the standard.

B · tidy an existing repo
“Tidy this repo: move code into the right dirs, turn training params into config, unify naming.”

The agent audits drift, then refactors/rename into compliance and re-runs the gates.

§03 · 参考

Reference projects.

Concern Basis
Project structure & style Lightning-Hydra-Template, Hydra, Google Python Style
Model & component design PyTorch Lightning Style, timm, OpenMMLab
Reproducible experiments Hydra, FAIR, SemVer, Git Flow, Meta Research
Engineering habits & interfaces Software Engineering at Google, Scientific Python, research-code commenting standard
LLM coding discipline Karpathy Skills
§04 · 快速开始

Quick start.

Clone to a stable path (don't develop inside this copy); point the agent at SKILL.md:

~/ai-skills — bash
# clone the skill to a stable path
git clone https://github.com/SaltGardenia/research-code-skill.git \
  ~/ai-skills/research-code-skill

# Claude Code — load the main file as a subagent
mkdir -p ~/.claude/agents
cat > ~/.claude/agents/research-code-skill.md <<'EOF'
---
name: research-code-skill
description: 用于以固定结构、统一规范搭建或整理科研(ML/DL)代码库。
---
When invoked, first read `~/ai-skills/research-code-skill/SKILL.md` and follow it as the governing workflow.
Read supporting files from `~/ai-skills/research-code-skill/` only when needed.
Do not replace this skill with a generic coding response.
EOF

Other agents (Kilo, Codex, etc.) keep the full folder: create a subagent / slash command / custom prompt pointing at the main file. Update: cd ~/ai-skills/research-code-skill && git pull.

Run the checker locally: first python -m pip install -r requirements.txt, then python scripts/audit_style.py ., python scripts/sync_gitignore.py ., bash scripts/run_gate.sh.