a-green-hand-jack/ml-project-repo-agent-native-template
Agent-native ML research repo template for AI PhD workflows with Claude Code: repo-as-control-plane, repo-local subagents/skills/hooks, anti-drift ANATOMY + runnable governance validators.
ARCHETYPE
Fort Knox
Deny lists, pre-tool hooks, sandboxing. Nothing touches prod without a signature.
GUARDRAILS
5/5
Blocks destructive commands · Protects secrets · Pre-tool screening hook · No YOLO mode · Sandbox or ask-first rules · details
Copy this rig
# review before running: this installs third-party code
$ npx degit a-green-hand-jack/ml-project-repo-agent-native-template/.claude ./rig-ml-project-repo-agent-native-template # inspect, then merge into .claude/ MCP servers are added to Claude Code at local scope; env vars are shown as YOUR_… placeholders — we never store values. Files are fetched with degit into a separate folder so you can review before merging.
$ npx degit a-green-hand-jack/ml-project-repo-agent-native-template/.agents/skills/adopt-existing-repo .claude/skills/adopt-existing-repo $ npx degit a-green-hand-jack/ml-project-repo-agent-native-template/.agents/skills/anatomy-drift-control .claude/skills/anatomy-drift-control $ npx degit a-green-hand-jack/ml-project-repo-agent-native-template/.agents/skills/artifact-indexing .claude/skills/artifact-indexing $ npx degit a-green-hand-jack/ml-project-repo-agent-native-template/.agents/skills/bootstrap-project .claude/skills/bootstrap-project $ npx degit a-green-hand-jack/ml-project-repo-agent-native-template/.agents/skills/coding-agent-quota .claude/skills/coding-agent-quota $ npx degit a-green-hand-jack/ml-project-repo-agent-native-template/.agents/skills/command-adopt-existing-repo .claude/skills/command-adopt-existing-repo $ npx degit a-green-hand-jack/ml-project-repo-agent-native-template/.agents/skills/command-checkpoint .claude/skills/command-checkpoint $ npx degit a-green-hand-jack/ml-project-repo-agent-native-template/.agents/skills/command-experiment-watch .claude/skills/command-experiment-watch $ npx degit a-green-hand-jack/ml-project-repo-agent-native-template/.agents/skills/command-feature-split .claude/skills/command-feature-split $ npx degit a-green-hand-jack/ml-project-repo-agent-native-template/.agents/skills/command-paper-reproduce .claude/skills/command-paper-reproduce $ npx degit a-green-hand-jack/ml-project-repo-agent-native-template/.agents/skills/command-pr-review .claude/skills/command-pr-review $ npx degit a-green-hand-jack/ml-project-repo-agent-native-template/.agents/skills/command-result-promote .claude/skills/command-result-promote $ npx degit a-green-hand-jack/ml-project-repo-agent-native-template/.agents/skills/command-weekly-maintenance .claude/skills/command-weekly-maintenance $ npx degit a-green-hand-jack/ml-project-repo-agent-native-template/.agents/skills/experiment-workflow .claude/skills/experiment-workflow $ npx degit a-green-hand-jack/ml-project-repo-agent-native-template/.agents/skills/interactive-plan-doc .claude/skills/interactive-plan-doc $ npx degit a-green-hand-jack/ml-project-repo-agent-native-template/.agents/skills/session-boundary-control .claude/skills/session-boundary-control $ npx degit a-green-hand-jack/ml-project-repo-agent-native-template/.agents/skills/spawn .claude/skills/spawn $ npx degit a-green-hand-jack/ml-project-repo-agent-native-template/.agents/skills/subagent-routing .claude/skills/subagent-routing $ npx degit a-green-hand-jack/ml-project-repo-agent-native-template/.agents/skills/template-feedback .claude/skills/template-feedback $ npx degit a-green-hand-jack/ml-project-repo-agent-native-template/.agents/skills/template-stress-test .claude/skills/template-stress-test $ npx degit a-green-hand-jack/ml-project-repo-agent-native-template/.agents/skills/workflow-recipe-harvesting .claude/skills/workflow-recipe-harvesting $ npx degit a-green-hand-jack/ml-project-repo-agent-native-template/.agents/skills/worktree-pr-flow .claude/skills/worktree-pr-flow
$ curl -fsSL --create-dirs -o .claude/agents/artifact-librarian.md https://raw.githubusercontent.com/a-green-hand-jack/ml-project-repo-agent-native-template/main/.claude/agents/artifact-librarian.md $ curl -fsSL --create-dirs -o .claude/agents/branch-reporter.md https://raw.githubusercontent.com/a-green-hand-jack/ml-project-repo-agent-native-template/main/.claude/agents/branch-reporter.md $ curl -fsSL --create-dirs -o .claude/agents/checkpoint-writer.md https://raw.githubusercontent.com/a-green-hand-jack/ml-project-repo-agent-native-template/main/.claude/agents/checkpoint-writer.md $ curl -fsSL --create-dirs -o .claude/agents/experiment-monitor.md https://raw.githubusercontent.com/a-green-hand-jack/ml-project-repo-agent-native-template/main/.claude/agents/experiment-monitor.md $ curl -fsSL --create-dirs -o .claude/agents/experiment-orchestrator.md https://raw.githubusercontent.com/a-green-hand-jack/ml-project-repo-agent-native-template/main/.claude/agents/experiment-orchestrator.md $ curl -fsSL --create-dirs -o .claude/agents/feature-worker.md https://raw.githubusercontent.com/a-green-hand-jack/ml-project-repo-agent-native-template/main/.claude/agents/feature-worker.md $ curl -fsSL --create-dirs -o .claude/agents/hook-maker-agent.md https://raw.githubusercontent.com/a-green-hand-jack/ml-project-repo-agent-native-template/main/.claude/agents/hook-maker-agent.md $ curl -fsSL --create-dirs -o .claude/agents/interactive-plan-writer.md https://raw.githubusercontent.com/a-green-hand-jack/ml-project-repo-agent-native-template/main/.claude/agents/interactive-plan-writer.md $ curl -fsSL --create-dirs -o .claude/agents/repo-doc-steward.md https://raw.githubusercontent.com/a-green-hand-jack/ml-project-repo-agent-native-template/main/.claude/agents/repo-doc-steward.md $ curl -fsSL --create-dirs -o .claude/agents/repo-researcher.md https://raw.githubusercontent.com/a-green-hand-jack/ml-project-repo-agent-native-template/main/.claude/agents/repo-researcher.md $ curl -fsSL --create-dirs -o .claude/agents/session-boundary-agent.md https://raw.githubusercontent.com/a-green-hand-jack/ml-project-repo-agent-native-template/main/.claude/agents/session-boundary-agent.md $ curl -fsSL --create-dirs -o .claude/agents/sub-agent-maker-agent.md https://raw.githubusercontent.com/a-green-hand-jack/ml-project-repo-agent-native-template/main/.claude/agents/sub-agent-maker-agent.md $ curl -fsSL --create-dirs -o .claude/agents/subagent-router-agent.md https://raw.githubusercontent.com/a-green-hand-jack/ml-project-repo-agent-native-template/main/.claude/agents/subagent-router-agent.md $ curl -fsSL --create-dirs -o .claude/agents/test-runner.md https://raw.githubusercontent.com/a-green-hand-jack/ml-project-repo-agent-native-template/main/.claude/agents/test-runner.md $ curl -fsSL --create-dirs -o .claude/agents/workflow-recipe-harvester.md https://raw.githubusercontent.com/a-green-hand-jack/ml-project-repo-agent-native-template/main/.claude/agents/workflow-recipe-harvester.md $ curl -fsSL --create-dirs -o .claude/agents/zh-review-gate.md https://raw.githubusercontent.com/a-green-hand-jack/ml-project-repo-agent-native-template/main/.claude/agents/zh-review-gate.md
Merge into .claude/settings.json (project) or ~/.claude/settings.json (user). Hook commands reference scripts in the source repo — copy those too.
{
"permissions": {
"deny": [
"Agent(general-purpose)",
"Edit(lab/data/**)",
"Write(lab/data/**)",
"NotebookEdit(lab/data/**)",
"Edit(lab/runs/**)",
"Write(lab/runs/**)",
"NotebookEdit(lab/runs/**)",
"Edit(lab/models/**)",
"Write(lab/models/**)",
"NotebookEdit(lab/models/**)",
"Edit(lab/infra/private/**)",
"Write(lab/infra/private/**)",
"NotebookEdit(lab/infra/private/**)",
"Edit(checkpoints/**)",
"Write(checkpoints/**)",
"NotebookEdit(checkpoints/**)",
"Edit(wandb/**)",
"Write(wandb/**)",
"NotebookEdit(wandb/**)",
"Edit(mlruns/**)",
"Write(mlruns/**)",
"NotebookEdit(mlruns/**)",
"Edit(.env)",
"Write(.env)",
"Bash(sudo *)",
"Bash(curl *| sh)",
"Bash(pip install *)"
],
"ask": [
"Bash(git checkout *)",
"Bash(git switch *)",
"Bash(git reset *)",
"Bash(git clean *)",
"Bash(git rebase *)",
"Bash(git merge *)",
"Bash(git branch -d *)",
"Bash(git branch -D *)",
"Bash(git worktree remove *)",
"Bash(uv add *)",
"Bash(uv sync *)",
"Bash(uv remove *)",
"Bash(kill *)",
"Bash(sbatch *)",
"Bash(scancel *)",
"Bash(srun *)",
"Bash(runai *)",
"Bash(python lab/infra/launch/fake_job.py launch *)",
"Bash(python lab/infra/launch/fake_job.py kill *)",
"Bash(python lab/infra/launch/fake_job.py restart *)",
"Bash(python lab/infra/launch/fake_job.py _worker *)",
"Bash(python3 lab/infra/launch/fake_job.py launch *)",
"Bash(python3 lab/infra/launch/fake_job.py kill *)",
"Bash(python3 lab/infra/launch/fake_job.py restart *)",
"Bash(python3 lab/infra/launch/fake_job.py _worker *)",
"Bash(python -m lab.infra.launch.fake_job launch *)",
"Bash(python -m lab.infra.launch.fake_job kill *)",
"Bash(python -m lab.infra.launch.fake_job restart *)",
"Bash(python -m lab.infra.launch.fake_job _worker *)",
"Bash(python3 -m lab.infra.launch.fake_job launch *)",
"Bash(python3 -m lab.infra.launch.fake_job kill *)",
"Bash(python3 -m lab.infra.launch.fake_job restart *)",
"Bash(python3 -m lab.infra.launch.fake_job _worker *)",
"Bash(python lab/infra/launch/expctl.py apply-recovery *)",
"Bash(python3 lab/infra/launch/expctl.py apply-recovery *)",
"Bash(env sbatch *)",
"Bash(env scancel *)",
"Bash(env srun *)",
"Bash(env runai *)",
"Bash(nohup sbatch *)",
"Bash(nohup scancel *)",
"Bash(nohup srun *)",
"Bash(nohup runai *)",
"Bash(nice *)",
"Bash(timeout *)",
"Bash(python -u lab/infra/launch/fake_job.py *)",
"Bash(python3 -u lab/infra/launch/fake_job.py *)",
"Bash(env python lab/infra/launch/fake_job.py *)",
"Bash(env python3 lab/infra/launch/fake_job.py *)",
"Bash(python -u lab/infra/launch/expctl.py apply-recovery *)",
"Bash(python3 -u lab/infra/launch/expctl.py apply-recovery *)",
"Bash(env python lab/infra/launch/expctl.py apply-recovery *)",
"Bash(env python3 lab/infra/launch/expctl.py apply-recovery *)",
"Bash(env *)",
"Bash(/usr/bin/env *)",
"Bash(CLAUDE_ALLOW_LAUNCH=1 *)",
"Bash(CODEX_ALLOW_LAUNCH=1 *)",
"Bash(env -S *)",
"Bash(env -S*)",
"Bash(env --split-string *)",
"Bash(env --split-string=*)",
"Bash(/usr/bin/env -S *)",
"Bash(/usr/bin/env -S*)",
"Bash(/usr/bin/env --split-string *)",
"Bash(/usr/bin/env --split-string=*)",
"Bash(bash -c *)",
"Bash(bash -lc *)",
"Bash(/bin/bash -c *)",
"Bash(/bin/bash -lc *)",
"Bash(sh -c *)",
"Bash(sh -lc *)",
"Bash(/bin/sh -c *)",
"Bash(/bin/sh -lc *)",
"Bash(zsh -c *)",
"Bash(zsh -lc *)",
"Bash(/bin/zsh -c *)",
"Bash(/bin/zsh -lc *)",
"Bash(dash -c *)",
"Bash(dash -lc *)",
"Bash(/bin/dash -c *)"
]
},
"hooks": {
"PreToolUse": [
{
"matcher": "Bash|Edit|Write|NotebookEdit",
"hooks": [
{
"type": "command",
"command": "python3 \"$CLAUDE_PROJECT_DIR/.claude/hooks/pre_tool_guard.py\""
}
]
}
]
}
} Skills (22)
adopt-existing-repoanatomy-drift-controlartifact-indexingbootstrap-projectcoding-agent-quotacommand-adopt-existing-repocommand-checkpointcommand-experiment-watchcommand-feature-splitcommand-paper-reproducecommand-pr-reviewcommand-result-promotecommand-weekly-maintenanceexperiment-workflowinteractive-plan-docsession-boundary-controlspawnsubagent-routingtemplate-feedbacktemplate-stress-testworkflow-recipe-harvestingworktree-pr-flow
Subagents (16)
| artifact-librarian model: inherit | 维护 dataset/checkpoint/table/figure/result/document 的索引与归档状态、生成 stale asset 报告时使用;绝不删除或移动数据。 |
| branch-reporter model: inherit | 汇总所有 active branch/worktree 的状态与依赖关系、生成 worktree 报告时使用;绝不操作 git 写动作。 |
| checkpoint-writer model: inherit | 在 compact/clear/handoff 或结束 session 前,把当前工作状态固化到 memory/current-status.md 时使用。 |
| experiment-monitor model: inherit | 只读监控长时间运行的实验、做一次性快照健康检查(watcher)并产出结构化 alert 时使用;绝不干预实验。 |
| experiment-orchestrator model: inherit | 维护实验从 claim 到 artifact 的证据链、组织实验卡片与状态机 ledger、把 alert 并入台账、校验并交接 human 恢复提案时使用;agent 内恢复执行 fail-closed。 |
| feature-worker model: inherit | 在隔离 worktree 中实现单个清晰的功能或 bugfix 时使用;一个 worker 只做一个任务。 |
| hook-maker-agent model: inherit | 从反复出现的安全/状态/格式化/compact/artifact 维护动作中提炼 repo-local hook 草稿时使用;需 human review。 |
| interactive-plan-writer model: inherit | 把当前阶段写成可让 human 在文件中批注的中文 plan doc、再据批注收敛计划时使用;只写 plans/。 |
| repo-doc-steward model: inherit | 维护重要目录的 README/AGENTS/CLAUDE/ANATOMY 导航四件套、根级 DESIGN.md 能力清单、在结构改动时同步 anatomy 时使用。 |
| repo-researcher model: inherit | 需要只读地探索代码库、定位实现、收集证据并提出假设时使用;绝不修改文件。 |
| session-boundary-agent model: inherit | 判断是否到达 session 边界(该 checkpoint/compact/clear/branch/换 reviewer)并维护 session-tree 时使用。 |
| sub-agent-maker-agent model: inherit | 从重复出现的 human-cc 轨迹中提炼出窄边界 subagent 草稿时使用;只产出 draft,不自行启用。 |
| subagent-router-agent model: inherit | 为一个 child task 生成 launch packet(agent 类型、预算、模型、边界、停止条件)时使用;只读、只产出 packet。 |
| test-runner model: inherit | 运行指定的定向测试命令并总结失败时使用;不擅自全量测试,不粘贴完整日志。 |
| workflow-recipe-harvester model: inherit | 从 human-cc trace 中提炼有行为证据的候选 workflow recipe 时使用;只提炼结构片段,不总结主观好用。 |
| zh-review-gate model: haiku | 检查即将面向 human 的说明性文字(PR 正文、review、决策文档等)是否遵守"文档默认中文"doctrine、发现大段非中文正文时原地翻译改写时使用;只做语言翻译,不判断内容对错。 |
Hooks (9)
| event | matcher | runs |
|---|---|---|
| PreToolUse | Bash|Edit|Write|NotebookEdit | python3 "$CLAUDE_PROJECT_DIR/.claude/hooks/pre_tool_guard.py" |
| PostToolUse | Edit|Write | python3 "$CLAUDE_PROJECT_DIR/.claude/hooks/format_changed_python.py" |
| PostToolUse | Edit|Write | python3 "$CLAUDE_PROJECT_DIR/.claude/hooks/zh_review_advisory.py" |
| PreCompact | * | python3 "$CLAUDE_PROJECT_DIR/.claude/hooks/pre_compact_memory_check.py" |
| SubagentStop | * | python3 "$CLAUDE_PROJECT_DIR/.claude/hooks/subagent_report_index.py" |
| UserPromptSubmit | * | python3 "$CLAUDE_PROJECT_DIR/.claude/hooks/context_threshold_notice.py" |
| UserPromptSubmit | * | python3 "$CLAUDE_PROJECT_DIR/.claude/hooks/agent_identity_hook.py" |
| SessionStart | compact|clear | python3 "$CLAUDE_PROJECT_DIR/.claude/hooks/context_continuity.py" |
| SessionStart | * | python3 "$CLAUDE_PROJECT_DIR/.claude/hooks/agent_identity_hook.py" |
Slash commands (8)
/adopt-existing-repo/checkpoint/experiment-watch/feature-split/paper-reproduce/pr-review/result-promote/weekly-maintenance
Permissions
deny (27)
Agent(general-purpose)
Edit(lab/data/**)
Write(lab/data/**)
NotebookEdit(lab/data/**)
Edit(lab/runs/**)
Write(lab/runs/**)
NotebookEdit(lab/runs/**)
Edit(lab/models/**)
Write(lab/models/**)
NotebookEdit(lab/models/**)
Edit(lab/infra/private/**)
Write(lab/infra/private/**)
NotebookEdit(lab/infra/private/**)
Edit(checkpoints/**)
Write(checkpoints/**)
NotebookEdit(checkpoints/**)
Edit(wandb/**)
Write(wandb/**)
NotebookEdit(wandb/**)
Edit(mlruns/**)
Write(mlruns/**)
NotebookEdit(mlruns/**)
Edit(.env)
Write(.env)
Bash(sudo *)
Bash(curl *| sh)
Bash(pip install *)
ask (91)
Bash(git checkout *)
Bash(git switch *)
Bash(git reset *)
Bash(git clean *)
Bash(git rebase *)
Bash(git merge *)
Bash(git branch -d *)
Bash(git branch -D *)
Bash(git worktree remove *)
Bash(uv add *)
Bash(uv sync *)
Bash(uv remove *)
Bash(kill *)
Bash(sbatch *)
Bash(scancel *)
Bash(srun *)
Bash(runai *)
Bash(python lab/infra/launch/fake_job.py launch *)
Bash(python lab/infra/launch/fake_job.py kill *)
Bash(python lab/infra/launch/fake_job.py restart *)
Bash(python lab/infra/launch/fake_job.py _worker *)
Bash(python3 lab/infra/launch/fake_job.py launch *)
Bash(python3 lab/infra/launch/fake_job.py kill *)
Bash(python3 lab/infra/launch/fake_job.py restart *)
Bash(python3 lab/infra/launch/fake_job.py _worker *)
Bash(python -m lab.infra.launch.fake_job launch *)
Bash(python -m lab.infra.launch.fake_job kill *)
Bash(python -m lab.infra.launch.fake_job restart *)
Bash(python -m lab.infra.launch.fake_job _worker *)
Bash(python3 -m lab.infra.launch.fake_job launch *)
Bash(python3 -m lab.infra.launch.fake_job kill *)
Bash(python3 -m lab.infra.launch.fake_job restart *)
Bash(python3 -m lab.infra.launch.fake_job _worker *)
Bash(python lab/infra/launch/expctl.py apply-recovery *)
Bash(python3 lab/infra/launch/expctl.py apply-recovery *)
Bash(env sbatch *)
Bash(env scancel *)
Bash(env srun *)
Bash(env runai *)
Bash(nohup sbatch *)
Bash(nohup scancel *)
Bash(nohup srun *)
Bash(nohup runai *)
Bash(nice *)
Bash(timeout *)
Bash(python -u lab/infra/launch/fake_job.py *)
Bash(python3 -u lab/infra/launch/fake_job.py *)
Bash(env python lab/infra/launch/fake_job.py *)
Bash(env python3 lab/infra/launch/fake_job.py *)
Bash(python -u lab/infra/launch/expctl.py apply-recovery *)
Bash(python3 -u lab/infra/launch/expctl.py apply-recovery *)
Bash(env python lab/infra/launch/expctl.py apply-recovery *)
Bash(env python3 lab/infra/launch/expctl.py apply-recovery *)
Bash(env *)
Bash(/usr/bin/env *)
Bash(CLAUDE_ALLOW_LAUNCH=1 *)
Bash(CODEX_ALLOW_LAUNCH=1 *)
Bash(env -S *)
Bash(env -S*)
Bash(env --split-string *)
allow (114)
Edit(**)
Write(**)
Bash(git status*)
Bash(git diff*)
Bash(git log*)
Bash(git show *)
Bash(git branch)
Bash(git branch -v*)
Bash(git branch -a*)
Bash(git branch --list*)
Bash(git branch --show-current)
Bash(git remote -v)
Bash(git remote show *)
Bash(git rev-parse *)
Bash(git ls-files*)
Bash(git ls-tree *)
Bash(git cat-file *)
Bash(git blame *)
Bash(git describe*)
Bash(git shortlog*)
Bash(git config --get *)
Bash(git config --list)
Bash(git config -l)
Bash(git stash list)
Bash(git stash show *)
Bash(git tag)
Bash(git tag --list*)
Bash(git reflog*)
Bash(git for-each-ref*)
Bash(git merge-base *)
Bash(git rev-list *)
Bash(git show-ref*)
Bash(git worktree list)
Bash(git worktree add *)
Bash(git fetch*)
Bash(git add *)
Bash(git commit *)
Bash(git stash)
Bash(git stash push *)
Bash(git stash pop*)
Bash(git restore --staged *)
Bash(git push *)
Bash(ls*)
Bash(cat *)
Bash(head *)
Bash(tail *)
Bash(wc *)
Bash(find *)
Bash(tree*)
Bash(file *)
Bash(stat *)
Bash(du *)
Bash(df*)
Bash(pwd)
Bash(which *)
Bash(command -v *)
Bash(type *)
Bash(echo *)
Bash(printf *)
Bash(sort *)
Similar rigs
GGPrompts/TFE
—
Pragmatist 3.9k tok ·
msiShariful/claude-code-studio
A local GUI for managing Claude Code settings — config, MCP servers, plugins, hooks, agents, skills, and CLAUDE.md. npx cc-studio
Fort Knox 2.1k tok ·
przadka/configure-cc
Claude Code configuration agent — bootstraps and audits your global CC setup
Pragmatist 1.7k tok ·
nexusweblabs/claude-bedrock-setup
CLI tool to configure Claude Code for AWS Bedrock
Orchestrator 1.2k tok ·