Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add commands/rjwalters/kicad-tools/builder-worktreegit clone --depth 1 https://github.com/rjwalters/kicad-toolsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/commands/rjwalters/kicad-tools/builder-worktree)<a href="https://agentmods.dev/commands/rjwalters/kicad-tools/builder-worktree"><img src="https://agentmods.dev/badge/commands/rjwalters/kicad-tools/builder-worktree.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00000 | $0.03612 |
| Opus 5 | $0.00000 | $0.01806 |
| Sonnet 5 | $0.00000 | $0.00722 |
| Haiku 4.5 | $0.00000 | $0.00361 |
Grade A, and why
builder-worktree scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 398 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Builder: Worktree Workflows
This document covers git worktree management for the Builder role. For the core builder workflow, see builder.md.
On-Demand Git Worktrees
When working on issues, you should create worktrees on-demand to isolate your work. This prevents conflicts and allows multiple agents to work simultaneously.
IMPORTANT: Use the Worktree Helper Script
Always use ./.loom/scripts/worktree.sh <issue-number> to create worktrees. This helper script ensures:
- Correct path (
.loom/worktrees/issue-{number}) - Prevents nested worktrees
- Consistent branch naming
- Sandbox compatibility
# CORRECT - Use the helper script
./.loom/scripts/worktree.sh 84
# WRONG - Don't use git worktree directly
git worktree add .loom/worktrees/issue-84 -b feature/issue-84 main
Why This Matters
- Prevents Nested Worktrees: Helper detects if you're already in a worktree and prevents double-nesting
- Sandbox-Compatible: Worktrees inside
.loom/worktrees/stay within workspace - Gitignored:
.loom/worktrees/is already gitignored - Consistent Naming:
issue-{number}naming matches GitHub issues - Safety Checks: Validates issue numbers, checks for existing directories
Worktree Workflow Example
# 1. Claim an issue
gh issue edit 84 --remove-label "loom:issue" --add-label "loom:building"
# 2. Create worktree using helper
./.loom/scripts/worktree.sh 84
# -> Creates: .loom/worktrees/issue-84
# -> Branch: feature/issue-84
# 3. Capture the worktree ABSOLUTE path ONCE (see warning below)
WORKTREE_ABS="$(cd .loom/worktrees/issue-84 && pwd)"
# -> e.g. /Users/you/repo/.loom/worktrees/issue-84
# 3a. Assert it's really a managed worktree BEFORE any edit — the same two
# checks guard-worktree-paths.sh applies to every Edit/Write/Bash write
# it confines (#4178):
[[ -f "$WORKTREE_ABS/.loom-managed" ]] || echo "FATAL: no .loom-managed sentinel"
[[ "$(git -C "$WORKTREE_ABS" rev-parse --show-toplevel)" == "$WORKTREE_ABS" ]] || echo "FATAL: toplevel mismatch"
# 4. Do your work using ABSOLUTE paths (implement, test, commit)
# - Write/Edit: pass "$WORKTREE_ABS/<file>"
# - Bash: git -C "$WORKTREE_ABS" ... OR cd "$WORKTREE_ABS" && <cmd>
# ... work work work ...
# 5. Push and create PR from the worktree.
# ALWAYS ./.loom/scripts/create-pr.sh, never a bare `gh pr create` (#6074):
# it adopts an already-open PR for this branch instead of failing, and it
# survives the GitHub App permission window that made `git push` succeed
# while `gh pr create` returned 403 — see builder-pr.md § "Creating the PR".
git -C "$WORKTREE_ABS" push -u origin feature/issue-84
./.loom/scripts/create-pr.sh --title "fix: ..." --body "..." --label "loom:review-requested"
# 6. Worktree cleanup is automatic - DO NOT manually delete worktrees
# Worktrees are cleaned up automatically when PRs merge or by loom-clean
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 4d ago First seen · 398 lines · 0 tokens per session scan A 8b29f56f0c61
builder-worktree is a command published in the GitHub repository rjwalters/kicad-tools (53 stars, last pushed today), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 3,612 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other commands, from other repositories
document
Document a file or directory comprehensively - shaking the tree to truly understand it.
brand-generate
Generate an on-brand document from a saved Brand Profile.
tree
Show file tree with sync status indicators showing which files are indexed, modified, new, or deleted.
cti-report
Render case deliverables — relationship graph (PNG/SVG/Mermaid) and a polished PDF/DOCX assessment. Usage: /cti-report [--graph|--pdf].
ppt-image2-editable-rebuild
Rebuild image2 or imagegen reference slides as editable PowerPoint decks.
convert
Convert a file to Markdown using markitdown.