Skip to content

worktree command, docs/agents moved to docs/coding-agents#2316

Merged
leshy merged 7 commits into
mainfrom
feat/ivan/worktreetool
Jun 1, 2026
Merged

worktree command, docs/agents moved to docs/coding-agents#2316
leshy merged 7 commits into
mainfrom
feat/ivan/worktreetool

Conversation

@leshy
Copy link
Copy Markdown
Member

@leshy leshy commented Jun 1, 2026

adds a ./bin/worktree cmd (totally vibed) that quickly creates a dimos worktree and installs dimos in it (pytest/mypy passes)

renames docs/agents to docs/coding-agents (there was some confusion here, these are docs for coding agents working on dimos, not docs ABOUT agents in dimos)

Comment thread bin/worktree Outdated
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@dimensionalOS dimensionalOS deleted a comment from greptile-apps Bot Jun 1, 2026
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Jun 1, 2026

Greptile Summary

This PR adds bin/worktree, a shell script that provisions fully-functional git worktrees (uv venv, sync, direnv, pre-commit) for parallel/agent development, and renames docs/agents/ to docs/coding-agents/ with all internal references updated.

  • bin/worktree: new new/ls/rm subcommand interface; handles existing branches, remote tracking branches, and LFS skip; GNU/macOS realpath compatibility addressed with a temp-variable guard.
  • flake.nix: xorg packages migrated to top-level pkgs.libx11-style names for nixpkgs-unstable; pre-commit hooks-dir logic updated to use git rev-parse --git-path hooks so the check works in linked worktrees where .git is a file, not a directory.
  • docs/: directory renamed and index/links updated throughout; new worktrees.md documents the new script.

Confidence Score: 4/5

Safe to merge with one fix recommended in flake.nix's pre-commit hook check.

The hooks-dir check in flake.nix can produce a relative path in the main worktree, making pre-commit install run every time nix develop is entered from a project subdirectory — the exact failure mode the change was trying to prevent. Everything else (worktree script logic, docs rename, nixpkgs package name migration) looks correct.

flake.nix — the HOOKS_DIR relative-path issue on lines 249-250

Important Files Changed

Filename Overview
bin/worktree New script for creating provisioned git worktrees; GNU/BSD realpath compatibility addressed with temp-variable guard; logic looks sound for the common Linux/nix-shell workflow
flake.nix xorg packages renamed from pkgs.xorg.libX11-style to pkgs.libx11-style for nixpkgs-unstable; pre-commit hooks-dir check updated for worktree support but uses a relative path that can resolve incorrectly when nix develop is entered from a project subdirectory
AGENTS.md Added 'For Coding Agents' section and updated the bottom reference list; one remaining stale └── agents/ entry in the docs tree diagram was flagged in a previous review
docs/coding-agents/worktrees.md New documentation page describing bin/worktree usage; content matches the script's actual interface
docs/coding-agents/index.md Index updated with worktrees.md and style.md entries; internal links updated from docs/agents/ to docs/coding-agents/
bin/run-doc-codeblocks Comment and usage text updated to reflect docs/agents/ → docs/coding-agents/ rename; no logic changes

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["bin/worktree new branch [base-ref]"] --> B{Branch exists locally?}
    B -- yes --> C["git worktree add DIR BRANCH"]
    B -- no --> D{Branch exists on origin?}
    D -- yes --> E["git worktree add --track -b BRANCH DIR origin/BRANCH"]
    D -- no --> F["git worktree add -b BRANCH DIR BASE-REF"]
    C --> G["cd DIR"]
    E --> G
    F --> G
    G --> H{.envrc exists?}
    H -- no --> I["ln -s .envrc.nix OR .envrc.venv"]
    H -- yes --> J["skip symlink"]
    I --> K{envrc == .envrc.nix?}
    J --> K
    K -- yes --> L["nix develop --command bash -c uv venv + uv sync"]
    K -- no --> M["uv venv + uv sync"]
    L --> N["direnv allow ."]
    M --> N
    N --> O["ready: DIR"]
Loading

Reviews (7): Last reviewed commit: "fix(worktree): finish docs/agents rename..." | Re-trigger Greptile

@leshy leshy requested a review from Dreamsorcerer as a code owner June 1, 2026 05:35
@leshy leshy force-pushed the feat/ivan/worktreetool branch from ea5961f to b31d0dd Compare June 1, 2026 07:05
Comment thread bin/worktree Outdated
- `bin/worktree ls` lists worktrees as a BRANCH/DIRECTORY table; the
  branch column is the value to pass to `rm`, main is tagged (main).
- Creation now requires `new` (aka create/add); a bare unknown word
  errors instead of silently creating a worktree (typo safety).
@leshy leshy force-pushed the feat/ivan/worktreetool branch from b31d0dd to 624e534 Compare June 1, 2026 07:59
- run-doc-codeblocks: point stale docs/agents/ comment+usage paths at
  docs/coding-agents/ to complete the rename
- bin/worktree: guard -d|--dir against a missing value so it prints usage
  instead of a raw set -u error
- coding-agents/index.md: add the renamed style.md to the index tree
@leshy leshy changed the title workgree command, docs/agents moved to docs/coding-agents worktree command, docs/agents moved to docs/coding-agents Jun 1, 2026
@leshy leshy enabled auto-merge (squash) June 1, 2026 08:59
@leshy leshy merged commit 7fb373b into main Jun 1, 2026
21 checks passed
@leshy leshy deleted the feat/ivan/worktreetool branch June 1, 2026 11:09
leshy added a commit that referenced this pull request Jun 1, 2026
Integrate origin/main (PR #2242 loop_closure rewrite, #2278 aruco
Detection3D, #2316 docs/coding-agents rename, mem2 time windowing, etc.).
Took origin's marker-free PGO/PoseGraph rewrite for loop_closure (eval,
pgo, test_pgo, markers_rrd), marker_transformer, and the map CLI; kept
branch map_rrd. Stripped remaining # ---- section markers from map_rrd.
Comment thread bin/worktree
@@ -0,0 +1,165 @@
#!/usr/bin/env bash
# Manage ready-to-work git worktrees for parallel/agent development.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't you just do claude --worktree?

Comment thread AGENTS.md
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We still need to move and replace this file. This entire file will end up in the context for most coding agents.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants