/layout-skills-dir:worktree-sparsity-evalfrom layout-skills-dir
Evaluate repository size metrics to determine whether a separate working copy should use sparse checkout. **Invoke when a separate working copy is already warranted — a `git worktree` or a `jj workspace add` — and only to size that invocation.** It does not decide whether to create one. In jj mode the diamond workflow's development join remains the default for parallel chains and needs no sparsity evaluation; see the `jj-version-control` skill's `tiered-ceremony.md` for the triggers and `jj-version-control` §"Worktree interop" for the discipline. Also invoke for periodic re-evaluation when a repo has grown significantly.
Ships in layout-skills-dir. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Collect repository metrics and determine whether worktrees should use sparse checkout. Three conditions must all hold for sparse checkout to be recommended.
This skill sizes a separate working copy that is already warranted; it does not decide whether to create one.
That decision belongs to the jj-version-control skill's tiered-ceremony.md, whose default in jj mode is the diamond workflow's development join in a single working copy — which needs no sparsity evaluation.
In a flake repository the separate working copy is a git worktree or a colocated jj workspace (jj 0.46.0 or later), never a non-colocated jj workspace; the git sparse-checkout recipes below apply to a git worktree, and a jj workspace narrows its checkout with jj sparse set instead.
Before creating a worktree in a jj-colocated repository, read jj-version-control §"Worktree interop" for the branch-ownership and return-by-ref discipline.
| Metric | Threshold | Rationale |
|---|---|---|
| File count | > 10,000 | Below this, checkout is fast enough |
| Working tree size | > 500 MB | Below this, disk cost of concurrent worktrees is negligible |
| Change locality | < 0.01 (1%) | Above this, sparse sets grow until approaching full checkout |
Run the collection script from the repository root being evaluated:
bash <skill-dir>/scripts/collect_metrics.sh
The script is platform-aware (macOS/Linux) and outputs JSON with raw and formatted values:
{
"file_count": 98432,
"tree_size_bytes": 2253211648,
"tree_size_human": "2.1 GB",
"change_locality": 0.000312,
"change_locality_pct": "0.03%",
"avg_files_per_commit": 30,
"platform": "Darwin"
}
Pipe the JSON into the update script, providing the path to CLAUDE.md:
bash <skill-dir>/scripts/collect_metrics.sh | bash <skill-dir>/scripts/update_claude_md.sh ./CLAUDE.md
The update script handles:
When existing metrics are found, the script compares and only rewrites if any value changed by more than 5% or the recommendation flipped. It reports deltas (e.g., "File count: 98,432 -> 102,891 (+4.5%)").
The commit goes in the repository containing the resolved CLAUDE.md target, not necessarily the evaluated repository.
The update script prints the resolved target path and repository — use that for git -C.
Commit the updated metrics per git-preferences conventions.
The commit goes in <target-repo> against <resolved-claude-md>.
Create a working branch per the working branch isolation conventions in git-preferences. When sparse checkout is recommended, additionally configure sparse checkout with cone mode and set paths relevant to the task.
In a jj-colocated repository the branch the worktree checks out must be one the jj primary does not hold: never a bookmark on or under the primary's @, and never one a live development join includes.
Point the worktree at a stable base or at nothing.
For guidance on choosing paths for git sparse-checkout set, see references/sparse-checkout-patterns.md.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub cameronraysmith/skills-marketplace-test --plugin layout-skills-dir6 skills in this plugin
/ci-log-verificationVerify CI results by downloading and analyzing complete workflow logs across both CI backends (GitHub Actions and buildbot-nix), rather than piecing together fragments via repeated API calls. Use when validating a branch or PR for merge, when a check fails and log evidence is needed, or when triaging which backend a failing check lives on from gh pr checks output./nix-flake-pr-cycleOperational workflow for flake-bearing repositories: enumerate checks, probe targeted slices with nix eval and nix build, validate locally, warm CI through git-stacked-pr-integration, publish a PR, inspect nixbot feedback, and hand off through that skill's Queue authorization section. Phase 1 is also a standalone coverage audit. Load when validating a flake before publication, opening a PR, investigating CI feedback, or preparing asynchronous queue authorization.
/nixpkgs-broken-packageTriage a broken nixpkg after flake update with systematic debugging steps./process-compose-initAdd process-compose integration with dual Nix/non-Nix support for local service orchestration./sync-probeUse never. A probe added after install to see whether the marketplace syncs without version numbers.