Commit Graph

1003 Commits

Author SHA1 Message Date
Maximilian Roos f92e2bb60f docs: clarify project vs user hook configuration locations 2026-01-15 00:12:01 -08:00
Maximilian Roos 5819e3f9e1 docs: document post-start/pre-remove cleanup pattern (#646)
Background processes spawned by post-start hooks outlive worktree removal.
Document this in the hooks guide with:
- General principle in "post-create vs post-start" section
- Pre-remove example added to Dev servers (matching Databases pattern)

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-14 23:00:28 -08:00
Maximilian Roos d97c0e99dc fix: prevent copy-ignored from copying nested worktrees (#645)
When worktree-path is configured to place worktrees inside the primary
worktree (e.g., .worktrees/{{ branch | sanitize }}), copy-ignored was
copying the entire .worktrees/ directory into new worktrees.

Changes:
- Filter out ignored entries that contain other worktrees
- Copy symlinks instead of skipping them (fixes node_modules/.bin/ etc.)
- Update docs to reflect the behavior

Fixes #641

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-15 06:31:27 +00:00
Maximilian Roos d70860afbb docs: improve command documentation structure (#643)
* feat: include command definition at top of doc pages

The first `///` doc comment line (the "about" / definition) now appears
at the top of each command's documentation page, before the subtitle
and after_long_help content.

Previously, this definition only appeared in the Command Reference
section at the bottom. Now the page structure is:

1. Definition (short about)
2. Subtitle (long about, if present)
3. Conceptual documentation (after_long_help)
4. Command reference

Co-Authored-By: Claude <noreply@anthropic.com>

* docs: improve command documentation structure

- Add definition to top of web doc pages (was missing)
- Combine definition + subdefinition into single lead paragraph on web
- Remove duplication between definition and after_long_help openers
- Fix em-dash spacing (spaced per style guide)
- Fix pronoun clarity ("Creates one" vs "Creates it")
- Use indicative mood instead of second person ("For finished feature branches" not "Use when you're done")
- Add documentation guidelines to docs/CLAUDE.md

Commands updated: switch, list, select, remove, merge, step, hook, config

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: update switch help snapshot for pronoun change

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-14 21:22:52 -08:00
Maximilian Roos cd8ac3e060 perf(tests): add pre-built fixture to speed up Windows CI (#634)
* perf(tests): add pre-built fixture to speed up Windows CI

Instead of creating repos from scratch for each test, copy a pre-built
fixture with worktrees and remote already configured. This should
significantly reduce test time on Windows where process spawning is slow.

- Add tests/fixtures/standard/ with repo, 3 worktrees, and bare remote
- Update TestRepo to copy fixture instead of running git init/commit
- Add fixture cleanup to doc-generating tests for clean output
- Remove git sample hooks and boilerplate from fixture

Co-Authored-By: Claude <noreply@anthropic.com>

* fix(tests): correctly clean fixture state for isolated tests

- Change `remove_fixture_worktrees()` to take `&mut self` and clear the
  worktrees map so `add_worktree()` can recreate branches
- Add remote removal to select and approval tests to prevent
  `origin/main` from appearing in snapshots
- Update select snapshots for fixture-based commit hashes

Co-Authored-By: Claude <noreply@anthropic.com>

* fix(tests): use relative paths in fixture for portability

The fixture gitdir files contained absolute paths to the local
development machine, causing CI failures. Updated to use relative
paths which work after the _git → .git rename during fixture copy.

Co-Authored-By: Claude <noreply@anthropic.com>

* fix(tests): remove invalid remote from bare repo fixture

The bare repository in the fixture had a remote configured with an
absolute path to the local machine, which wouldn't exist on CI.
Bare repositories don't need remotes configured.

Co-Authored-By: Claude <noreply@anthropic.com>

* fix(tests): remove origin in approval tests for consistent project_id

Tests manually create approvals using a computed project_id based on
repo path. With the fixture's origin remote, worktrunk computes a
different project_id from the remote URL. Removing origin makes both
use the same fallback (directory path).

Co-Authored-By: Claude <noreply@anthropic.com>

* fix(tests): improve fixture copy robustness for CI

- Add platform-specific copy: `cp -r` on Unix, `robocopy` on Windows
- Add verification that essential paths exist after copy
- Add verification that origin.git is a valid git repository after rename
- Include stderr in error messages for better debugging

Co-Authored-By: Claude <noreply@anthropic.com>

* fix(tests): add .gitkeep to preserve empty git directories in fixture

Git doesn't track empty directories, so objects/info, objects/pack, and
refs/tags were missing on CI after checkout. These directories are
required for a valid git repository.

Co-Authored-By: Claude <noreply@anthropic.com>

* fix(tests): ensure LF line endings in fixture git files

Add .gitattributes to force LF line endings for git internal files
(packed-refs, HEAD, config, etc.) to prevent CRLF corruption on Windows.

Co-Authored-By: Claude <noreply@anthropic.com>

* fix(tests): handle file copies separately from directories on Windows

robocopy only works with directories, not files. Use Rust's std::fs::copy
for individual files like .gitattributes, and robocopy only for directories.

Co-Authored-By: Claude <noreply@anthropic.com>

* fix(tests): enable rerere in test git config for consistent output

Git's rerere feature produces "Recorded preimage" messages during
conflicts. Enable this in test config so output is consistent between
local machines and CI.

Co-Authored-By: Claude <noreply@anthropic.com>

* fix(tests): restore accidentally deleted hook_clear tests

The tests test_hook_clear_no_approvals and test_hook_clear_with_approvals
were accidentally removed during the fixture refactoring. This restores them
with the necessary remote removal so project_identifier matches "repo"
(directory name) instead of the fixture's remote URL.

Also adds remote removal to test_hook_show_approval_status for consistency.

Co-Authored-By: Claude <noreply@anthropic.com>

* chore: remove unreferenced ping_pong snapshots

These snapshots used feature_a but the tests now use feature, leaving
these orphaned.

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-14 18:48:39 -08:00
Maximilian Roos 77ef8d22fd fix: use per-file COW on macOS to avoid freezing shell (#640)
macOS's atomic clonefile() on directories saturates disk I/O (~45K
ops/sec), blocking interactive processes like shell startup. Apple's
documentation explicitly discourages this for large hierarchies.

Switch to per-file reflink on all platforms. Slower but keeps the
system responsive. Update help text to remove misleading performance
claims.

References:
- Apple Developer Docs: Cloning Files and Directories
  https://developer.apple.com/documentation/foundation/file_system/cloning_files_and_directories

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-14 18:09:42 -08:00
Maximilian Roos 93acd3531c Restore visual hierarchy for help headers (#638)
* style: improve help hierarchy and add visible dividers

- Render `---` as visible dimmed line (────────────────) instead of blank
- Restructure user config: promote "LLM commit messages" to H2
- Group command defaults under "Command defaults" H2 with H3 subsections
- Remove "defaults" from titles: "List command defaults" → "List"
- Convert "Commit template"/"Squash template" to bold text (parent is now H3)

Co-Authored-By: Claude <noreply@anthropic.com>

* docs: add TODO explaining H1/divider tradeoff

Document why we use `---` dividers instead of H1 headers and list
alternative approaches considered.

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-14 16:43:19 -08:00
Maximilian Roos 1f54ee2131 docs(copy-ignored): update performance benchmarks and add Claude Code comparison (#635)
Update the `wt step copy-ignored` documentation with:

- Accurate benchmarked performance numbers (14GB target directory):
  - Full copy: 2m
  - cp -Rc / Linux: 20s
  - macOS clonefile: 4s

- New "Behavior vs Claude Code on desktop" section explaining differences:
  - worktrunk copies all gitignored by default vs requiring .worktreeinclude
  - COW performance advantage (30x macOS, 6x Linux vs plain copy)
  - Configurable hook integration

- Updated Features to highlight macOS atomic directory cloning

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-14 16:06:04 -08:00
Maximilian Roos e241215afe docs: add Contains and Committed columns to config table (#632)
Clarify which config file contains what settings and whether it should
be committed to git. The new table format immediately answers two common
questions: "what goes in each file?" and "should I commit this?"

Closes #626

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-14 15:51:01 -08:00
Maximilian Roos 46827d2d4e feat: restore visual hierarchy and add section dividers 2026-01-14 15:46:03 -08:00
Maximilian Roos f649a65061 Replace possessive pronouns with articles in user-facing text 2026-01-14 11:21:11 -08:00
Maximilian Roos be8959eec8 docs: add higher-resolution favicons for Google Search (#627)
Google recommends favicons of at least 48x48 pixels for proper display
in search results. The previous 32x32 favicon was below this threshold.

Changes:
- Add favicon-48.png (48x48) as primary favicon
- Add apple-touch-icon.png (180x180) for iOS home screen
- Update base.html to include sizes attributes for browser selection

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-14 11:02:09 -08:00
Maximilian Roos aec572ef8b docs(step): move --stage docs to commit/squash subcommands (#625)
The `--stage` and `--show-prompt` options were documented in a generic
"Options" section at the `wt step` level, even though they only apply
to commit and squash. This was inconsistent with how copy-ignored and
for-each document their own options.

Move the options documentation into dedicated `## wt step commit` and
`## wt step squash` sections, following the existing pattern. Each
subcommand's `--help` is now self-contained.

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-14 06:08:37 -08:00
Maximilian Roos 276dfbc6dc Revert "feat: add visual hierarchy to help headers (#623)"
This reverts commit 0d6e51e0a6.
2026-01-14 02:07:58 -08:00
Maximilian Roos 0d6e51e0a6 feat: add visual hierarchy to help headers (#623)
Establish clear visual distinction between header levels in --help output:
- H1: UPPERCASE green (major divisions like "USER CONFIG", "JSON OUTPUT")
- H2: Bold green (regular sections like "Examples", "Columns")
- H3: Green (subsections like "CI status", "commit object")

Add H1 headers to mark major divisions in `wt config` (User config,
Project config, Shell integration) and `wt list` (JSON output).

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-14 01:56:35 -08:00
Maximilian Roos cfc8a671a3 feat(docs): include long_about subtitles in web docs (#624)
The --help-page generator now extracts the "subtitle" from long_about
(the expanded description beyond the short about) and prepends it to
web docs. This ensures command pages show both the subtitle and the
conceptual intro from after_long_help.

Also fixes wt switch to have its demo after the intro text, matching
the pattern of other commands (list, merge, select).

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-14 01:54:44 -08:00
Maximilian Roos ad0c6ebeb8 fix(docs): prevent code block layout jump on page load (#622)
Move code block wrapper creation from deferred JavaScript to a synchronous
inline script at the end of <body>. This ensures the DOM structure is
finalized before the browser's first paint, eliminating the visible "jump"
when code blocks were wrapped after initial render.

Split into two phases:
1. Inline sync script wraps <pre> in .code-block-wrapper before first paint
2. Deferred code-copy.js adds copy buttons to existing wrappers

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-14 01:50:17 -08:00
Maximilian Roos 0a82dde795 fix: remove trailing blank lines from --help output (#621)
The `<!-- subdoc: ... -->` markers (used for web doc generation) had
unnecessary blank lines between them. Since subdoc markers are HTML
comments (invisible in terminal), the blank lines were showing up as
trailing whitespace in --help output.

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-14 01:41:45 -08:00
Maximilian Roos aea9962f8e Remove review comment from step workflow example
Remove the "# Review the squashed commit" comment from the step command
workflow example in documentation and help text.
2026-01-14 01:37:49 -08:00
Maximilian Roos 20a5b97546 style: use sentence case for CLI help headings (#620)
* Refactor config documentation into single source file

- Create `dev/config.source.md` as canonical markdown source for user config documentation
- Extract config content from CLI help text into sourced file via `include_str!`
- Generate `dev/config.example.toml` from source by commenting all lines
- Sync default LLM templates between `src/llm.rs` and source markdown
- Update help snapshots to reflect restructured content
- Simplify test logic: split template sync into separate source test
- Remove manual template commenting logic in favor of transform function

* refactor: move user config docs from dev/config.source.md into cli/mod.rs

The user config documentation is now embedded directly in src/cli/mod.rs
between USER_CONFIG_START/END markers, eliminating the separate markdown
file. The sync tests extract this section for transforming to
dev/config.example.toml.

Co-Authored-By: Claude <noreply@anthropic.com>

* Refactor config documentation formatting

Reorganize and clarify configuration documentation across multiple files
by improving readability of location information, worktree path examples,
template variable descriptions, and removing obsolete template-file
configuration options.

* refactor: inline user config docs into CLI help

Move user config documentation from separate `dev/config.source.md` into
`src/cli/mod.rs` using marker comments. This makes the CLI the single
source of truth for config documentation.

Changes:
- Add USER_CONFIG_START/END markers in mod.rs for content extraction
- Update readme_sync.rs to extract from mod.rs instead of separate file
- Delete dev/config.source.md (content now inline)
- Remove `wt config create` subdoc expansion (redundant with main help)
- Restore User Hooks section and approvals management tip
- Reorganize help: Examples first, then Configuration files table
- Fix various formatting issues (lists, line wrapping, TOML comments)
- Remove obsolete template-file documentation (feature removed)

Co-Authored-By: Claude <noreply@anthropic.com>

* style: use sentence case for CLI help headings

Standardize all help text headings to sentence case (only first word
capitalized, except for proper nouns and acronyms like CLI, JSON, LLM).

This follows common CLI conventions (git, cargo) where headings read
more naturally as prose.

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-14 01:28:13 -08:00
Maximilian Roos a6ee048120 docs(hook): reorganize and trim help for clarity (#619)
* docs(hook): reorganize help for better information flow

Move sections to group related concepts and put essential knowledge early:

- Security: moved up (was buried after patterns/examples)
- User hooks: demoted to subsection of Configuration (related concepts)
- Running manually: moved before patterns (reference before guide)

New order: Hook types → Security → Configuration (with User hooks) →
Template reference → Running manually → Patterns → Language tips

Co-Authored-By: Claude <noreply@anthropic.com>

* docs(hook): trim redundancy and consolidate patterns

- Per-hook sections: remove redundant blocking/fail-fast info (already in table)
- Template variables: remove Example column (values were obvious)
- Timing during merge: convert from section to inline note
- Language-specific tips: merge into Designing effective hooks

Reduces help by ~96 lines while keeping all essential information.

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-14 01:17:23 -08:00
Maximilian Roos fe12a688fb refactor: inline user config docs into CLI help (#618)
* Refactor config documentation into single source file

- Create `dev/config.source.md` as canonical markdown source for user config documentation
- Extract config content from CLI help text into sourced file via `include_str!`
- Generate `dev/config.example.toml` from source by commenting all lines
- Sync default LLM templates between `src/llm.rs` and source markdown
- Update help snapshots to reflect restructured content
- Simplify test logic: split template sync into separate source test
- Remove manual template commenting logic in favor of transform function

* refactor: move user config docs from dev/config.source.md into cli/mod.rs

The user config documentation is now embedded directly in src/cli/mod.rs
between USER_CONFIG_START/END markers, eliminating the separate markdown
file. The sync tests extract this section for transforming to
dev/config.example.toml.

Co-Authored-By: Claude <noreply@anthropic.com>

* Refactor config documentation formatting

Reorganize and clarify configuration documentation across multiple files
by improving readability of location information, worktree path examples,
template variable descriptions, and removing obsolete template-file
configuration options.

* refactor: inline user config docs into CLI help

Move user config documentation from separate `dev/config.source.md` into
`src/cli/mod.rs` using marker comments. This makes the CLI the single
source of truth for config documentation.

Changes:
- Add USER_CONFIG_START/END markers in mod.rs for content extraction
- Update readme_sync.rs to extract from mod.rs instead of separate file
- Delete dev/config.source.md (content now inline)
- Remove `wt config create` subdoc expansion (redundant with main help)
- Restore User Hooks section and approvals management tip
- Reorganize help: Examples first, then Configuration files table
- Fix various formatting issues (lists, line wrapping, TOML comments)
- Remove obsolete template-file documentation (feature removed)

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-14 01:16:19 -08:00
Maximilian Roos b0accacb21 refactor: combine doc sync tests into single cascading test (#617)
- Merge test_command_pages_are_in_sync and test_skill_files_are_in_sync_with_docs
  into test_command_pages_and_skill_files_are_in_sync
- Single test run now handles full chain: mod.rs → docs → skills
- Show actual file paths in error messages instead of counts
- Update CLAUDE.md documentation to reflect new test name

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-14 00:29:24 -08:00
Maximilian Roos 7832ca3e91 Refactor: rename worktree_path function to worktree_path_of_branch (#614)
Update function name across documentation, CLI help text, template
expansion implementation, and tests for improved clarity.
2026-01-13 23:10:20 -08:00
Maximilian Roos a9ed5344ed refactor: rename main_worktree_path template var to primary_worktree_path (#613)
* refactor: rename main_worktree_path template var to primary_worktree_path

The old name was confusing because "main worktree" has a specific meaning
in git (the original clone directory), but the template variable actually
provided the "primary" worktree — where established files live.

- Rename template var: main_worktree_path → primary_worktree_path
- Remove default_branch_worktree() method, inline into primary_worktree()
- Add deprecation mapping so existing configs continue to work
- Update all documentation and examples

Co-Authored-By: Claude <noreply@anthropic.com>

* docs: improve primary_worktree_path description in examples

Update the template variable description from "Where established files
live" to "Main worktree (or default branch worktree for bare repos)" for
clarity.

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-13 22:34:05 -08:00
Maximilian Roos 45aafe3b26 feat: add worktree_path(branch) template function (#609)
* feat: add worktree_path(branch) template function

Add a new template function that looks up the filesystem path of a
branch's worktree. This enables hooks to reference files in other
worktrees, e.g.:

    setup = "cp {{ worktree_path('main') }}/config.local {{ worktree_path }}"

The function returns an empty string if no worktree exists for the
given branch. Paths are normalized to POSIX format (forward slashes)
for cross-platform consistency.

Implementation required adding &Repository to expand_template's
signature so the function can perform worktree lookups.

Co-Authored-By: Claude <noreply@anthropic.com>

* refactor: remove test_dummy() from library code

Replace Repository::test_dummy() with proper test fixtures:

- Unit tests in src/config/ use local TestRepo structs that create
  real temporary git repositories (Rust limitation: src/ can't import
  from tests/)
- Integration test doc_templates.rs now uses the existing rstest
  fixture from tests/common instead of a duplicate TestRepo

This follows the CLAUDE.md guideline "No Test Code in Library Code" -
tests should call the real API directly rather than using test-only
methods on production structs.

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-13 21:42:18 -08:00
Maximilian Roos e551c4d333 feat(list): add experimental per-task timeout config (#601)
* feat(list): add experimental per-task timeout config

Add configurable timeout for `wt list` git operations via
`[list] timeout-ms` in user config.

- Replace `timed_out: bool` with `ErrorCause` enum for extensibility
- Show timeout count in footer: "3 tasks timed out (run with `-v` for details)"
- `0` means no timeout (explicit disable)
- `--full` always disables timeout for complete data collection
- Add comprehensive unit and integration tests

Co-Authored-By: Claude <noreply@anthropic.com>

* Address Codex review feedback for timeout feature

- Make `cause` field private, access via `is_timeout()` method
- Fix SHA slicing with safe `sha[..sha.len().min(8)]`
- Update "killed gracefully" to "terminated" in docs
- Add timeout-ms = 0 to config defaults
- Single constructor for TaskError (takes cause parameter)
- Show all errors in footer with timeout breakout:
  - "3 tasks timed out" (all timeouts)
  - "5 tasks failed (3 timed out)" (mixed)
  - "2 tasks failed" (no timeouts)

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-13 19:12:21 -08:00
Maximilian Roos 3460a723c6 Refactor Switch command doc to use doc attribute
Move Switch command's long description from `after_long_help` attribute to doc comment, improving code organization and consistency with documentation style.
2026-01-13 02:09:29 -08:00
Maximilian Roos 9a92f81702 Add template variable support to --execute command (#581)
* Add template variable support to --execute command

Support hook template variables ({{ branch }}, {{ worktree_path }}, etc.)
in --execute commands and trailing args. With --create, {{ base }} and
{{ base_worktree_path }} are also available.

Trailing args (after --) are expanded for templates, then shell-escaped
to safely handle values with spaces or special characters.

Co-Authored-By: Claude <noreply@anthropic.com>

* fmt: rustfmt switch test

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-12 21:39:26 -08:00
Maximilian Roos 052f96a3ff perf: parallelize list command and add trace instrumentation (#574)
* Add Chrome Trace Format export with timestamp and thread tracking

After the skeleton renders, remaining setup runs before spawning the worker thread.
These operations are parallelized using `rayon::scope` with single-level parallelism.

Pre-start fsmonitor daemons on macOS to avoid auto-start races. Git's builtin
fsmonitor has race conditions under parallel load that can cause git commands to
hang. By pre-starting daemons before parallel operations, we avoid this issue.

Cache invalid default branch config as a side effect of `default_branch()` lookup.
This allows `invalid_default_branch_config()` to be a pure cache read with no
additional git commands, suitable for post-skeleton operations.

* perf: parallelize status and trees_match_base in WorkingTreeDiffTask

Run `git status --porcelain` in parallel with the `rev-parse + diff-tree`
chain that checks if committed trees match the default branch. These are
independent operations - diff-tree compares committed trees, not the
working tree.

Also extract `trees_match_base()` method and `TreesMatchResult` enum to
separate the trees-match check from the full diff computation, enabling
the parallelization.

Reduces per-worktree latency in the working tree diff task by ~42% in
benchmarks (558ms → 322ms for 10 worktrees).

Co-Authored-By: Claude <noreply@anthropic.com>

* chore: remove unused working_tree_diff_with_base method

This method was refactored into trees_match_base but kept as a
wrapper that's never called. Remove the dead code.

Co-Authored-By: Claude <noreply@anthropic.com>

* chore: use cfg attributes for macOS-only fsmonitor code

Wrap the fsmonitor worktree collection in #[cfg(target_os = "macos")]
so that coverage tools don't flag it as uncovered on Linux CI.

Co-Authored-By: Claude <noreply@anthropic.com>

* refactor(list): remove dead `working_tree_diff_with_main` field

Remove the `diff_vs_main` JSON field and its backing computation. This
field was dead code: it only computed when `trees_match && is_dirty`,
but when dirty the diff can never be empty (changed files = non-zero
diff), making it useless for integration detection.

The `committed_trees_match` field already handles the useful case
(detecting squash-merged branches when the worktree is clean).

Removed:
- `working_tree_diff_with_main` from WorktreeData and TaskResult
- `trees_match_base()` function and `TreesMatchResult` enum
- `diff_vs_main` from JSON output and CLI docs
- `working_tree_matches_main` parameter from check_integration_state

Co-Authored-By: Claude <noreply@anthropic.com>

* docs: add trace_processor queries to benchmark CLAUDE.md

- Add trace_processor installation and useful SQL queries
- Rename 'Post-skeleton started' trace event to 'Skeleton rendered'
  for clarity (matches what the docs reference)
- Add example for generating traces from benchmark repos

Co-Authored-By: Claude <noreply@anthropic.com>

* chore: sync docs and snapshots after merge

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-12 17:40:36 -08:00
Maximilian Roos 90564bcc94 Add asset deletion safeguard and refactor demo build setup
Require manual publish when asset files are deleted to prevent
accidental removals. Refactor demo build to only copy starship config
for docs target and simplify setup_demo_output usage.
2026-01-12 14:17:49 -08:00
Maximilian Roos ca5b92be5a docs: add FAQ entry for shell setup issues (#567)
Suggests using Claude Code with the Worktrunk plugin to debug shell
integration problems. Includes a pre-filled issue template for
reporting issues (or successful fixes that could help others).

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-12 14:11:33 -08:00
Maximilian Roos dfc4ddea6b Clarify merge command description and target branch behavior
Update documentation and help text to better explain that merge operates
on the current branch merging into a target (defaulting to main), unlike
`git merge`. This clarifies the distinction from standard git behavior.
2026-01-12 13:49:49 -08:00
Maximilian Roos 6ecc51feef docs: clarify --force vs -D flags in wt remove (#565)
Add a "Force flags" section to explain the difference between:
- `--force` (`-f`) for worktree removal with untracked files
- `--force-delete` (`-D`) for deleting unmerged branches

This addresses user confusion reported in #564 where the `--force` flag
for worktrees was only documented in the command reference, not the
prose section.

Also removes the Shortcuts section (not relevant to remove) and uses
consistent single-quote styling for 'target' and 'same commit'.

Closes #564

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-12 13:46:24 -08:00
Maximilian Roos 29938c683f docs: add performance benchmarks to copy-ignored documentation (#560)
Document the real-world performance of `wt step copy-ignored` compared to
standard copy methods for a 31GB target/ directory with 110k files.

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-11 23:53:18 -08:00
Maximilian Roos 7503df1beb docs: add tmux pattern for agent handoffs (#501)
* docs: add tmux pattern for agent handoffs

Add documentation for spawning worktrees with Claude running in detached
tmux sessions, allowing one Claude session to hand off work to another
in the background.

Added to:
- Tips & Patterns (near end, with other advanced patterns)
- Claude Code Skill (as "Advanced" section with explicit requirements)

The skill guidance requires: explicit user request, running in tmux,
and authorization via CLAUDE.md or explicit instruction.

Related to #476

Co-Authored-By: Claude <noreply@anthropic.com>

* docs: clarify CLAUDE.md example wording

Co-Authored-By: Claude <noreply@anthropic.com>

* docs: reference skill instead of partial command

Co-Authored-By: Claude <noreply@anthropic.com>

* docs: add Zellij equivalent for agent handoffs

Add `zellij run` as an alternative to tmux for spawning worktrees
with Claude in the background. Rename section from "Agent handoffs
in tmux" to "Agent handoffs" to be multiplexer-agnostic.

The skill guidance now checks both $TMUX and $ZELLIJ env vars.

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-11 18:34:57 -08:00
Maximilian Roos 6a4aa35e7e docs: consolidate template variables reference into hook.md (#544)
- Remove deprecated variable mentions from all docs
- Replace duplicate table in step.md with link to hook.md#template-variables
- Add URL to canonical reference in project config template
- All filters (sanitize, sanitize_db, hash_port) documented in hook.md

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-11 17:20:38 -08:00
Maximilian Roos 56c26f289d refactor: replace dev scripts with Taskfile (#542)
Consolidate 7 shell scripts into a single Taskfile.yml using go-task:
- coverage: run tests with coverage
- setup-web: setup Claude Code web environment
- fetch-assets: download assets from worktrunk-assets
- publish-assets: publish assets to worktrunk-assets
- build-social-cards: generate social card PNGs
- generate-logo: generate logo with Gemini AI

Remove update-homebrew task (now handled by CI workflow).

Update CLAUDE.md files to reference `task X` commands and add
task runner installation instructions for web environments.

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-11 17:04:33 -08:00
Maximilian Roos cdbc102245 feat(select): add --branches and --remotes flags (#538)
Share [list] config section with wt list for consistent defaults.
Default behavior now shows only worktrees unless flags/config enable branches.

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-11 14:39:19 -08:00
Maximilian Roos c7e39e4b83 Remove PowerShell fallback on Windows, require Git for Windows (#536)
Previously, when Git Bash wasn't found on Windows, worktrunk fell back
to PowerShell for shell execution. This caused confusing errors when
users tried to run hooks (which use bash syntax).

Now worktrunk panics with a clear error message pointing to the Git for
Windows download page. Since worktrunk is a git workflow tool, requiring
Git for Windows is a reasonable dependency.

Changes:
- Remove PowerShell fallback in detect_windows_shell()
- Remove is_windows_without_git_bash() method (no longer needed)
- Remove unreachable warning in configure_shell.rs
- Update FAQ docs to clarify Git for Windows is required
- Simplify Windows tests

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-11 13:40:20 -08:00
Maximilian Roos 0c727fd2c5 Remove --refresh flag from config state get commands (#530)
The --refresh flag on `wt config state default-branch get` and
`wt config state ci-status get` conflated two operations: clearing the
cache and fetching fresh data. This violated single-responsibility
and muddied what `get` means.

Now `get` purely reads cached state. To force re-detection, use the
explicit two-step workflow: `clear` then `get`.

- Remove `refresh` field from DefaultBranchAction::Get and CiStatusAction::Get
- Simplify handle_state_get() by removing refresh parameter and logic
- Delete unused refresh_default_branch() method
- Update help text, doc comments, and documentation

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-11 12:36:08 -08:00
Maximilian Roos 6044f6d4a9 Improve wt-switch demo with better hooks and Claude instruction (#529)
- Add copy-ignored and dev server hooks (both as post-start for background execution)
- Use {{ branch | hash_port }} template for dev server port
- Add .env file so copy-ignored has something to demonstrate
- Use -- 'Add settings page' to showcase passing instructions to Claude
- Reduce pre-enter pause from 1s to 500ms for snappier feel

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-11 12:15:32 -08:00
Maximilian Roos 6de22f5501 Refactor link and code styling for improved UX
Simplify link styling with permanent underline and animated accent on
hover. Update inline code with new color variable and remove padding
from code inside links. Add CSS custom property for inline code text
color in both light and dark themes.
2026-01-11 11:31:08 -08:00
Maximilian Roos b33a45e85a Format branch names in backticks 2026-01-11 09:11:51 -08:00
Maximilian Roos bf575aaaee Redesign social cards with horizontal layout (#522)
* Redesign social cards with horizontal layout

- New horizontal layout: logo left, text right
- Warm radial glow emanating from logo
- Refined typography: 88px title with tight tracking, 28px tagline
- Darker title color (#1a1817) for better hierarchy
- Move generated PNGs to assets repo (same pattern as demos)
- Add build script with automatic font downloading

Co-Authored-By: Claude <noreply@anthropic.com>

* Fix deploy workflow to include social cards

The assets repo now has both demos/ and social/ directories.

Co-Authored-By: Claude <noreply@anthropic.com>

* Simplify assets structure: single path copy

Restructured worktrunk-assets repo to have all content under assets/
so deploy workflow can use a single `cp -r` command.

Co-Authored-By: Claude <noreply@anthropic.com>

* Address review feedback

- Fix typo: "ONGs" → "PNGs"
- Fix stale comment: "Google Fonts" → "GitHub releases"
- Add -f flag to curl for better error handling
- Document purpose of each social card size

Co-Authored-By: Claude <noreply@anthropic.com>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix asset URL in README for restructured repo

The worktrunk-assets repo was restructured from demos/ to assets/.
Update the URL transform in readme_sync.rs to match.

Co-Authored-By: Claude <noreply@anthropic.com>

* Fix README demo links after assets repo restructure

- Update wt-core.gif URL from demos/ to assets/ path
- Add PNGs exception to typos config (was incorrectly flagged)

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-01-10 17:55:35 -08:00
Maximilian Roos 962b548bbf feat: add sanitize_db filter for database-safe identifiers (#498)
* feat: add sanitize_db filter for database-safe identifiers

Add a new template filter `sanitize_db` that transforms strings into
database-safe identifiers compatible with PostgreSQL, MySQL, and SQL Server.

Transformation rules:
- Convert to lowercase
- Replace non-alphanumeric characters with underscore
- Collapse consecutive underscores
- Prefix with underscore if starts with digit
- Truncate to 63 characters (PostgreSQL limit)

Examples:
- feature/auth-oauth2 → feature_auth_oauth2
- 123-bug-fix → _123_bug_fix
- UPPERCASE.Branch → uppercase_branch

Closes #474

Co-Authored-By: Claude <noreply@anthropic.com>

* docs: add sanitize_db mention to database per worktree section

Add example showing how to use sanitize_db for branch-based database names
in the tips-patterns.md guide.

Co-Authored-By: Claude <noreply@anthropic.com>

* docs: add sanitize_db to example configs and tips-patterns

- Add sanitize_db to filter list in wt.example.toml
- Add sanitize_db to variables section in config.example.toml
- Add usage example in tips-patterns.md database section

Co-Authored-By: Claude <noreply@anthropic.com>

* docs: simplify URL template description

Remove filter list from URL template description - the example already
shows hash_port usage and other filters aren't relevant in this context.

Co-Authored-By: Claude <noreply@anthropic.com>

* feat(sanitize_db): add 3-char hash suffix for collision/keyword safety

Appends a deterministic 3-character base36 hash suffix to sanitize_db
output. This ensures:

- SQL reserved words are avoided (e.g., `user` → `user_abc`)
- Different inputs don't collide (e.g., `a-b` and `a_b` get different
  suffixes since hash is computed from original input)

The suffix uses 46,656 unique values (36^3), providing good uniqueness
while keeping identifiers readable.

Updated all documentation examples to use sanitize_db for database names
(POSTGRES_DB, DATABASE_URL) instead of repo name.

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-09 18:29:44 -08:00
Maximilian Roos 5d3655b417 docs: clarify copy-ignored behavior and .worktreeinclude usage
Update tips-patterns documentation to clarify that all gitignored files are
copied by default, and .worktreeinclude is optional for limiting patterns.
Also add .env to the examples of commonly copied files.
2026-01-09 18:17:50 -08:00
Maximilian Roos 53d6409500 feat(copy-ignored): default to copying all gitignored files (#481) 2026-01-08 22:29:12 -08:00
Maximilian Roos a4e5a6f600 docs: emphasize .worktreeinclude in copy-ignored section (#479)
Front-load the `.worktreeinclude` config file in the first sentence of the
"Eliminate cold starts" section, since it's the key concept users need to
understand. The gitignore syntax is secondary detail.

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-08 15:53:24 -08:00
Maximilian Roos 8d56331210 docs: document the Claude Code configuration skill (#477)
* docs: document the Claude Code configuration skill

The Claude Code integration page previously focused only on activity
tracking (🤖/💬 markers), burying installation and not mentioning
that the plugin includes a skill.

Restructure to make both features clear:
1. Configuration skill — documentation Claude Code can read
2. Activity tracking — status markers in wt list

Move installation to the top where users expect it.

Relates to #475

Co-Authored-By: Claude <noreply@anthropic.com>

* sync skill reference with docs

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-08 13:03:57 -08:00