Add create-worktree skill and .worktrees isolation#67490
Open
javiercn wants to merge 1 commit into
Open
Conversation
8285c01 to
bb0861b
Compare
Adds a Copilot skill that creates fully isolated git worktrees for this
repo under .worktrees/<name>, plus the committed isolation that keeps
them out of git and buildable.
- .github/skills/create-worktree/SKILL.md: knowledge-only skill (nest the
worktree under .worktrees/, initialize submodules, share the parent
.dotnet SDK; copy the barrier files if the worktree is placed elsewhere
in the repo).
- .worktrees/: committed nested .gitignore (keeps worktree subdirs out of
the parent git status) plus MSBuild/NuGet/editorconfig traversal-barrier
files so worktrees never inherit the top-level build configuration.
- eng/skill-evals/create-worktree/eval.vally.yaml + skills-vs-baseline.experiment.yaml:
Vally A/B eval (baseline vs skill); the experiment globs every skill's
eval and loads .github/skills/<skill> via ${eval.parent}.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a repository-local convention for creating isolated git worktrees under .worktrees/, and adds a Copilot skill plus Vally evals to teach and measure the correct worktree setup for this repo (submodules + SDK reuse + config isolation).
Changes:
- Add committed isolation “ceiling” files under
.worktrees/(.gitignore,.editorconfig,Directory.Build.props/.targets,NuGet.config) to prevent nested worktrees from pollutinggit statusand from inheriting outer-repo configuration. - Add a knowledge-only Copilot skill (
.github/skills/create-worktree/SKILL.md) describing the repo-specific worktree workflow (placement, submodule init,.dotnetlinking). - Add Vally A/B evaluation specs to compare baseline vs skill-assisted behavior.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
eng/skill-evals/skill-vs-baseline.experiment.yaml |
Defines the baseline vs skilled A/B experiment varying /environment/skills. |
eng/skill-evals/create-worktree/eval.vally.yaml |
Capability eval stimuli/rubrics for worktree placement, submodule init, SDK reuse, and isolation explanation. |
.worktrees/.gitignore |
Ignores all worktree directories under .worktrees/ while keeping the isolation files tracked. |
.worktrees/.editorconfig |
Stops EditorConfig traversal at .worktrees/ for content placed directly under it. |
.worktrees/Directory.Build.props |
MSBuild traversal ceiling for content placed directly under .worktrees/. |
.worktrees/Directory.Build.targets |
MSBuild traversal ceiling for content placed directly under .worktrees/. |
.worktrees/NuGet.config |
NuGet traversal ceiling intended to prevent repo-root config merging under .worktrees/. |
.github/skills/create-worktree/SKILL.md |
Documents the repo-specific “create an isolated worktree” procedure for agents/users. |
Comment on lines
+2
to
+13
| <!-- Traversal ceiling: clears every inherited section so repo-root package | ||
| sources never merge into content placed directly under .worktrees/. --> | ||
| <configuration> | ||
| <config> | ||
| <clear /> | ||
| </config> | ||
| <packageSources> | ||
| <clear /> | ||
| </packageSources> | ||
| <packageSourceMapping> | ||
| <clear /> | ||
| </packageSourceMapping> |
bb0861b to
cf4827e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Agents frequently create a git worktree to work in. Done naively in this repo, a nested worktree pollutes the main checkout's
git status, fails to build (empty submodules, no SDK), or risks inheriting the top-level build configuration. This PR adds a committed, project-local worktree convention plus a Copilot skill that teaches agents how to use it.What's in here
.worktrees/committed isolation (the convention):.worktrees/.gitignoreignores every worktree subdirectory, so worktrees created under it never show up in the parent'sgit status(no per-clone.git/info/excludeneeded)..worktrees/.editorconfig(root = true),Directory.Build.props/.targets(empty<Project />), andNuGet.config(<clear/>) form a traversal ceiling so nothing under.worktrees/climbs into the repo-root MSBuild/NuGet/editorconfig configuration..github/skills/create-worktree/SKILL.md— a knowledge-only skill (no scripts) covering the three repo-specific things plaingit worktreeknowledge misses:.worktrees/<name>(and copy the barrier files if it is placed elsewhere in the repo).MessagePack-CSharp,googletest)..dotnetSDK via a junction/symlink whenglobal.jsonsdk.versionmatches, instead of re-downloading gigabytes.eng/skill-evals/create-worktree/eval.vally.yaml+eng/skill-evals/skill-vs-baseline.experiment.yaml— a Vally A/B eval (baseline vs skill), matching the move to Vally for skill evals.Why a worktree under
.worktrees/is isolatedA worktree is a full checkout, so its own root
Directory.Build.props/.targets,global.json, and.editorconfig(root = true) terminate MSBuild/SDK/editorconfig discovery before it reaches the repo root (these are stop-at-first-match).NuGet.configis the one that merges up the tree, but the repo's<clear/>makes the worktree's own sources win. The committed.worktrees/barrier files harden this for any loose content placed directly under.worktrees/.Eval results (Vally, runs=5, claude-opus-4.6)
The skill activates in every skilled run and wins the two action scenarios (worktree placement, SDK sharing); it is neutral where the unaided agent is already strong.
Run it from an isolated empty directory (the stimuli ask the agent to create a worktree, so it acts on the cwd):