skills/new-workspace/SKILL.md
Create Git branches or worktrees for research code and paper versions. Use for experiments, baselines, rebuttal fixes, arXiv/camera-ready branches, and worktree memory.
npx skillsauth add a-green-hand-jack/ml-research-skills new-workspaceInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
git rev-parse --git-common-dir vs --show-toplevel to confirm which repo you are operating on. In a project-control-root layout, identify whether the target is the root repo, code/, or paper/.memory/BRIEFING.md exists:
memory/BRIEFING.md — current phase and active worktreesmemory/project-conventions.md — worktree naming policy and path conventions for this projectgit worktree list before creating a new one to avoid name collisions or orphaned worktrees.Skipping step 2 risks placing the worktree in the wrong path or using a name that conflicts with an existing branch or worktree policy.
Create a branch or Git worktree without confusing project-level management with component-repo management.
Use this skill for:
In a full research project, code worktrees should live under <ProjectName>/code-worktrees/, and paper worktrees should live under <ProjectName>/paper-worktrees/.
Pair this skill with:
safe-git-ops for non-trivial Git state, conflicts, or sandbox write failuresresearch-project-memory to record worktree purpose and exit conditionremote-project-control when a code worktree will be used on an SSH/HPC serverrun-experiment when the new workspace immediately launches jobssubmit-paper when a paper worktree is for a submission, arXiv, or camera-ready versioncamera-ready-finalizer when a paper worktree is for an accepted version<ProjectName>/code-worktrees/.<ProjectName>/paper-worktrees/.code/ or paper/ unless the user explicitly requires that layout.agent-private, author-visible, anonymous-submission, public-preprint, camera-ready-public, or publisher-artifact.experiments/ is runnable logic; stable result summaries belong in docs/results/, reports in docs/reports/, and run pointers in docs/runs/.Ask the user for:
branch or worktreecode or paperfeature, exp, baseline, debug, rebuttal, or customvenue, submission, arxiv, camera-ready, rebuttal, paper-fix, or customIf running inside <ProjectName>/, prefer the code/ repo for experiment, baseline, debug, and rebuttal implementation work.
Prefer the paper/ repo for venue retargeting, arXiv releases, camera-ready versions, source cleanup, paper-only rebuttal edits, or submission formatting.
If running inside <ProjectName>/code/, infer:
code repo root: <ProjectName>/code/
project control root: <ProjectName>/
worktree root: <ProjectName>/code-worktrees/
If running inside <ProjectName>/paper/, infer:
paper repo root: <ProjectName>/paper/
project control root: <ProjectName>/
worktree root: <ProjectName>/paper-worktrees/
If running inside a standalone code repo, use the fallback worktree root:
<code-repo-parent>/worktrees/
If running inside a standalone paper repo, use the fallback worktree root:
<paper-repo-parent>/paper-worktrees/
In the target repo:
git -C <repo-root> rev-parse --show-toplevel
git -C <repo-root> status --short
git -C <repo-root> branch --show-current
git -C <repo-root> worktree list
If there are uncommitted changes, ask whether to commit, stash, continue with a branch only, or cancel.
Use:
<branch-type>/<branch-name>
Examples:
exp/new-lossbaseline/fair-tuningdebug/nan-lossrebuttal/add-ablationfeature/data-loadervenue/neuripsvenue/icmlarxiv/v1camera-ready/neuripsprivate/draftoverleaf/main-cleanThe worktree directory name should be filesystem-friendly:
<branch-type>-<branch-name-with-slashes-replaced-by-hyphens>
For branch-only work:
git -C <repo-root> checkout -b <branch-type>/<branch-name>
Then update component memory if the branch has a research purpose.
Determine the worktree root:
For code:
<repo-root> is <ProjectName>/code/, use <ProjectName>/code-worktrees/.<repo-root>/../code-worktrees/ exists, use that.<repo-root>/../worktrees/.For paper:
<repo-root> is <ProjectName>/paper/, use <ProjectName>/paper-worktrees/.<repo-root>/../paper-worktrees/ exists, use that.<repo-root>/../paper-worktrees/.Create the worktree:
mkdir -p <worktree-root>
git -C <repo-root> worktree add <worktree-root>/<worktree-dir-name> -b <branch-type>/<branch-name>
If the branch already exists, ask whether to create the worktree from the existing branch:
git -C <repo-root> worktree add <worktree-root>/<worktree-dir-name> <branch-type>/<branch-name>
Copy local IDE/tooling directories when present:
.vscode/
.cursor/
.claude/
Copy, do not symlink, because each worktree may need independent IDE state.
If <repo-root>/.worktree-links exists, read relative paths from it and symlink shared large assets into the worktree. Typical entries:
data/
models/
.env
configs/local_settings.yaml
Use absolute symlink targets so links remain valid from the worktree path.
In the worktree, ensure:
docs/results/
docs/reports/
docs/runs/
.agent/
Use these paths for branch-local evidence:
docs/results/: stable result summaries, table notes, figure notesdocs/reports/: experiment reports and result narrativesdocs/runs/: job IDs, config paths, commit hashes, remote paths, short metrics.agent/worktree-status.md: purpose, linked claims/risks, latest reliable state, exit conditionDo not store raw logs, checkpoints, wandb runs, tensorboard caches, or large outputs in docs/.
In a paper worktree, ensure:
.agent/
Create or update .agent/worktree-status.md with paper-version fields:
agent-private: may contain .agent/, AGENTS.md, CLAUDE.md, writing memory, provenance notes, internal result docs, CSVs, and plotting scripts; should not sync to Overleaf/public remotesauthor-visible: coauthor/Overleaf-visible; must exclude .agent/, AGENTS.md, CLAUDE.md, raw CSVs, internal docs, plotting scripts, reviewer strategy, and private pathsanonymous-submission: venue/source-upload-visible; must enforce anonymity and exclude agent/private filespublic-preprint: arXiv/public source; must be public-cleancamera-ready-public: final accepted public/publisher source; must be de-anonymized and public-cleanpublisher-artifact: final public source plus artifact/release-facing files only.agent/, AGENTS.md, CLAUDE.md, raw CSVs, internal result docs, plotting scripts, private paths, and agent-only notestex-fmt --check --nowrap --recursive . when tex-fmt is installed; format with tex-fmt --nowrap --recursive . only after the user requests it or the project policy requires itDo not copy code-side docs/results/, docs/reports/, or docs/runs/ conventions into paper worktrees unless the user explicitly wants paper-local notes. Prefer .agent/ for paper-version memory and root memory/ for durable cross-version state.
For code worktrees, if pyproject.toml exists in the worktree, choose the uv environment path before running uv sync.
Default for a project-control-root layout:
<ProjectName>/.uv-envs/code
Run uv with an absolute UV_PROJECT_ENVIRONMENT pointing at that shared environment from both <ProjectName>/code/ and <ProjectName>/code-worktrees/*/:
cd <worktree-path>
UV_PROJECT_ENVIRONMENT=<absolute-project-root>/.uv-envs/code uv sync
Do not use a relative UV_PROJECT_ENVIRONMENT for cross-worktree sharing; uv resolves relative values against the active workspace root, which can still produce different environments for different worktrees.
Run commands from the active worktree with uv run .... Do not treat <absolute-project-root>/.uv-envs/code/bin/python as a branch selector; a shared editable install can point at the last synced worktree if Python is invoked directly outside uv.
If the branch changes dependencies, Python version, CUDA stack, or performs destructive package tests, create a named stage environment instead and record the reason:
UV_PROJECT_ENVIRONMENT=<absolute-project-root>/.uv-envs/code-<stage-or-lock-hash> uv sync
If uv sync fails, report the error but do not delete the worktree. The user may still want to inspect or fix the branch.
For paper worktrees, do not install TeX by default. Use the project's compile workflow: local static checks plus tex-fmt when available plus GitHub-linked Overleaf unless the user explicitly wants local TeX.
If the workspace has a research purpose, create or update:
<worktree>/.agent/worktree-status.md
Include:
If project memory exists, also add a short pointer to:
memory/component-index.yaml: known worktree path<component>/.agent/worktree-index.md: component-local active worktree rollupmemory/source-visibility-board.md: source visibility tier and cleanup gate for paper worktrees or visible branchesmemory/action-board.md: next action for the worktreememory/current-status.md: only if this is the active focusmemory/project-conventions.md: if this worktree introduces a new naming convention, branch policy, or worktree-scope rule that future agents must know, add it under worktree categoryThe root registry and component worktree index are the cross-worktree memory surfaces. Do not rely on one worktree's leaf status file to tell future agents what other sibling branches or paper versions exist.
Report:
Workspace created
Repo: <repo-root>
Branch: <branch-type>/<branch-name>
Worktree: <path or branch-only>
Evidence paths:
<code worktree only: docs/results/, docs/reports/, docs/runs/>
Memory:
.agent/worktree-status.md <created|skipped>
Next:
cd <worktree-path>
<code: run uv with UV_PROJECT_ENVIRONMENT=<absolute-project-root>/.uv-envs/code, then run/edit the planned experiment>
<paper: run submit-paper checks and sync to Overleaf/GitHub if needed>
safe-git-ops.If .worktree-links does not exist, offer to create:
# .worktree-links
#
# Symlinks to create in new worktrees.
# List paths relative to the code repo root.
# data/
# models/
# .env
# configs/local_settings.yaml
code/ or paper/ unless explicitly requestedgit worktree list shows the expected pathtesting
Bootstrap project-local ml-research-skills. Use from global installs when creating a new ML research project, enabling this collection in an existing ML research repo, or deciding whether to install the full bundle locally. Route to project-init for new projects; do not handle paper or experiment work directly.
development
Route project operations tasks — git, memory, bootstrap, remote, workspace, code review, timeline, ops — to the correct skill. Use when the task involves commits, pushes, worktrees, project memory, enabling project-local skills, SSH/server coordination, sidecar runners, or audits. Do not solve the ops task directly.
testing
Route ML/AI paper writing tasks to the correct skill — contract planning, prose drafting, section writing, consistency editing, review simulation, rebuttal, submission, or citation work. Use when the task involves writing, revising, reviewing, or submitting a paper instead of guessing between paper-writing-assistant, paper-writing-contract-planner, paper-reviewer-simulator, auto-paper-improvement-loop, or citation skills. Do not draft prose directly.
data-ai
Project-local router for ML research skill selection. Use inside an initialized ML research project, or while maintaining this skill repo, when the user describes an ML research/paper/experiment/discovery/ops/release workflow and may not know the skill; route to a domain router or high-signal leaf. Do not use for generic non-ML projects.