Skip to content

Restructure documentation with dedicated usage and hooks guides#31

Merged
agarcher merged 3 commits intomainfrom
docs
Jan 15, 2026
Merged

Restructure documentation with dedicated usage and hooks guides#31
agarcher merged 3 commits intomainfrom
docs

Conversation

@agarcher
Copy link
Owner

@agarcher agarcher commented Jan 15, 2026

Summary

  • Add docs/USAGE.md with comprehensive command reference including all flags, example output, and full configuration documentation
  • Add docs/HOOKS.md with dedicated hooks guide covering all hook types, environment variables, worktree index system, and examples
  • Streamline README.md to high-level overview with deep links to detailed docs
  • Prioritize Homebrew installation, collapse alternatives into collapsible sections
  • Simplify CONTRIBUTING.md to essentials with link to architecture docs
  • Trim docs/ARCHITECTURE.md to technical implementation details only (remove duplicated config/hook info)

Test plan

  • Verify all internal links work when viewing on GitHub
  • Confirm command documentation matches actual CLI behavior
  • Check that all configuration options are documented

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Simplified README with a concise intro, Quick Start, and links to detailed docs.
    • Added comprehensive Hooks guide with examples, environment variables, hook types, and configuration patterns.
    • Added full Usage guide documenting all commands, flags, behavior, examples, and shell integration.
    • Updated contributor guide with prerequisites, build/test/lint steps, and PR guidance.
    • Reorganized architecture and supporting docs for clarified design and conventions.
  • Examples
    • Added an example hook script demonstrating info output for worktrees.

✏️ Tip: You can customize this high-level summary in your review settings.

- Add docs/USAGE.md with comprehensive command reference, all flags,
  example output, and full configuration documentation
- Add docs/HOOKS.md with dedicated hooks guide covering all hook types,
  environment variables, worktree index, and examples
- Streamline README.md to high-level overview with deep links to docs
- Prioritize Homebrew installation, collapse alternatives into details
- Simplify CONTRIBUTING.md to essentials with link to architecture
- Trim docs/ARCHITECTURE.md to technical implementation details only

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@coderabbitai
Copy link

coderabbitai bot commented Jan 15, 2026

📝 Walkthrough

Walkthrough

This PR reorganizes and expands project documentation: updates contributor guidance, streamlines the README, restructures ARCHITECTURE.md, and adds comprehensive docs for Hooks and Usage plus an example hook script.

Changes

Cohort / File(s) Summary
Contributor & Project Docs
CONTRIBUTING.md, README.md, CLAUDE.md
Rewrote contributor workflow and build/test/lint steps; simplified README (removed many detailed sections and examples); refocused CLAUDE.md toward documentation, package structure, and config layering.
Architecture
docs/ARCHITECTURE.md
Reorganized Go Binary section, consolidated previously separated subblocks, removed Hook Environment and Worktree Index subsections, added Output Conventions and repo-local config placement.
Hooks Guide (new)
docs/HOOKS.md
Added full Hooks documentation: hook types (pre_create, post_create, pre_delete, post_delete, info), env vars, config format (.wt.yaml), examples, multi-hook support, script rules, and worktree index usage.
Usage Guide (new)
docs/USAGE.md
Added comprehensive usage reference for all wt commands, flags, behaviors, configuration schema (repo vs user), shell integration, examples, and hook interactions.
Examples
examples/hooks/show-info.sh
New example info hook script that emits key:value lines and computes a per-worktree Vite port using WT_INDEX.

Sequence Diagram(s)

(omitted)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐰 I hopped through pages, tidy and spry,
I scrawled some hooks and taught ports to fly.
Readme trimmed, docs grown wide,
Examples nested by my side.
A carrot-coded cheer — worktrees glide! 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and accurately summarizes the main change—restructuring documentation by adding dedicated usage and hooks guides.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

🧹 Recent nitpick comments
docs/USAGE.md (3)

106-112: Add language specifier to fenced code block.

Static analysis flags this output block as missing a language specifier. Use text or plaintext for non-code output blocks to satisfy linting and improve accessibility.

Suggested fix
-```
+```text
   NAME         INDEX  BRANCH         STATUS
 * feature-auth   1    feature-auth   ↑2 [in_progress]
   feature-nav    2    feature-nav    ↑5 [in_progress, dirty]
   doc-fix        3    doc-fix        [merged]
   experiment     -    experiment     [new]
</details>

---

`147-156`: **Add language specifier to fenced code block.**

Same as above—use `text` for this output example.

<details>
<summary>Suggested fix</summary>

```diff
-```
+```text
 ================================================================================
 * feature-auth
   Branch:  feature-auth
   Index:   2
   Created: 2025-01-10 (3 days ago)
   Status:  ↑3 ↓1 [in_progress, dirty]
   URL:     http://localhost:5193
 ================================================================================
</details>

---

`373-375`: **Add language specifier to fenced code block.**

Same as above—use `text` for this output example.

<details>
<summary>Suggested fix</summary>

```diff
-```
+```text
 wt version 1.2.3
</details>

</blockquote></details>

</blockquote></details>



---

<details>
<summary>📜 Recent review details</summary>

**Configuration used**: defaults

**Review profile**: CHILL

**Plan**: Pro

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between 19644a41f98cfce9d721abe7e9a706d872709b6e and 9be0daffa1eb1dfda2b5839d9c2f517c44f02ebf.

</details>

<details>
<summary>📒 Files selected for processing (2)</summary>

* `docs/USAGE.md`
* `examples/hooks/show-info.sh`

</details>

<details>
<summary>🧰 Additional context used</summary>

<details>
<summary>🧠 Learnings (2)</summary>

<details>
<summary>📚 Learning: 2026-01-13T19:27:50.183Z</summary>

Learnt from: CR
Repo: agarcher/wt PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-13T19:27:50.183Z
Learning: Hooks should receive standardized environment variables: WT_NAME, WT_PATH, WT_BRANCH, WT_REPO_ROOT, WT_WORKTREE_DIR, WT_INDEX


**Applied to files:**
- `examples/hooks/show-info.sh`
- `docs/USAGE.md`

</details>
<details>
<summary>📚 Learning: 2026-01-13T19:27:50.183Z</summary>

Learnt from: CR
Repo: agarcher/wt PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-13T19:27:50.183Z
Learning: Each worktree should get a stable numeric index (1+) stored in .git/worktrees//wt-index for port offsets and resource isolation


**Applied to files:**
- `docs/USAGE.md`

</details>

</details><details>
<summary>🪛 markdownlint-cli2 (0.18.1)</summary>

<details>
<summary>docs/USAGE.md</summary>

106-106: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

---

147-147: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

---

373-373: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

</details>

</details>

</details>

<details>
<summary>🔇 Additional comments (2)</summary><blockquote>

<details>
<summary>examples/hooks/show-info.sh (1)</summary><blockquote>

`1-18`: **LGTM! Well-structured example hook script.**

The script correctly demonstrates the info hook pattern:
- Silently exits when `WT_INDEX` is unset (appropriate for non-worktree contexts)
- Port calculation aligns with the example in `docs/USAGE.md` (index 2 → port 5193)
- Clear documentation header explains usage and output format

Based on learnings, this correctly uses `WT_INDEX` from the standardized hook environment variables.

</blockquote></details>
<details>
<summary>docs/USAGE.md (1)</summary><blockquote>

`1-4`: **Well-structured documentation with comprehensive coverage.**

The usage guide provides excellent coverage of all commands and configuration options. The consistent structure (syntax, flags, behavior, examples, hooks triggered) makes it easy to navigate. Configuration precedence and per-repo overrides are clearly explained.



Also applies to: 396-544

</blockquote></details>

</blockquote></details>

<sub>✏️ Tip: You can disable this entire section by setting `review_details` to `false` in your review settings.</sub>

</details>

<!-- tips_start -->

---



<sub>Comment `@coderabbitai help` to get the list of available commands and usage tips.</sub>

<!-- tips_end -->

<!-- internal state start -->


<!-- DwQgtGAEAqAWCWBnSTIEMB26CuAXA9mAOYCmGJATmriQCaQDG+Ats2bgFyQAOFk+AIwBWJBrngA3EsgEBPRvlqU0AgfFwA6NPEgQAfACgjoCEYDEZyAAUASpETZWaCrKPR1AGxJcb03BWwxbAoSSFp8Bkd2anh8LAB3dVgwungGajpIbEQ0UnQMelh8fABrZCJseCVkAApbSDMAZgBGSDl0ImcGWEoAGjaqDG6ucIZkQCTCSGZtDH6GEIz6ACYABiWANjAV5rBmgFZoFb2OJcaOfYAtAEojKABBWnpRxAB6AFUAZTuAcQBRDWYtC4TGYvBIPQwiEkoRB0wKkBCADNKGQGKF4EMPNhaBiiOgPB5IIiPLlEP0SAAPNCgrz8PDcPD9TD0RHYAkKDCI+AVKjiO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NpAIGSwrABAqwGrmgBaBdICuyIarn0JKHvcU6D3PYBv1SFu9bAq/VAf1DaRdISAXSGoRt2VRdJ2uyWNpG0maBtC5ue3BgFtzaTTcSArXFOm0OaB/cGAs3NAIm3a6PdQwy3PrnsGqFPcOuzQRoF0gmExDcQtAzQSQHiYnh1wGcGgKz0x4JCEhXnY7ksSR6kBliMvNLrDwS5AA== -->

<!-- internal state end -->

- Add Documentation section outlining doc structure and update policy
- Remove make install and make build-all (not commonly used)
- Add internal/userconfig/ package (was missing)
- Add Config Layering design pattern
- Remove Version Injection pattern (implementation detail)
- Make descriptions more terse

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@docs/HOOKS.md`:
- Around line 1-368: The docs reference a non-existent example script
"show-info.sh" (mentioned under "Examples" and as examples/hooks/show-info.sh);
fix by either adding the missing script file at examples/hooks/show-info.sh
implementing the shown info hook behavior (use WT_INDEX to print URL/ports) or
remove the "### show-info.sh" example and any other references to
examples/hooks/show-info.sh in HOOKS.md so the Examples list only contains real
files (ensure the Examples list and "Example hook scripts are available in
[examples/hooks/]" section stay consistent).
🧹 Nitpick comments (1)
docs/USAGE.md (1)

1-540: Comprehensive and well-organized usage documentation.

This guide thoroughly documents all commands with clear syntax, flags, behavior descriptions, and practical examples. The configuration reference is complete and easy to navigate. The structure makes it easy for users to find exactly what they need.

Consider adding language identifiers to the example output fenced code blocks to satisfy markdown linters:

📝 Optional markdown linting fixes

The static analysis tool flags three fenced code blocks without language specifiers. While these are example outputs (not code), you can add text or console identifiers to satisfy linters:

Line 106-112:

-```
+```text
   NAME         INDEX  BRANCH         STATUS
 * feature-auth   1    feature-auth   ↑2 [in_progress]

Line 147-156:

-```
+```text
 ================================================================================
 * feature-auth

Line 370-372:

-```
+```text
 wt version 1.2.3
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f7d7e28 and a1ebbd4.

📒 Files selected for processing (5)
  • CONTRIBUTING.md
  • README.md
  • docs/ARCHITECTURE.md
  • docs/HOOKS.md
  • docs/USAGE.md
🧰 Additional context used
🧠 Learnings (8)
📚 Learning: 2026-01-13T19:27:50.183Z
Learnt from: CR
Repo: agarcher/wt PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-13T19:27:50.183Z
Learning: Set version at build time via LDFLAGS: -X github.com/agarcher/wt/internal/commands.Version=$(VERSION)

Applied to files:

  • CONTRIBUTING.md
  • docs/ARCHITECTURE.md
📚 Learning: 2026-01-13T19:27:50.183Z
Learnt from: CR
Repo: agarcher/wt PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-13T19:27:50.183Z
Learning: Never squash or rebase on merge; always use 'gh pr merge --merge' for merging pull requests

Applied to files:

  • CONTRIBUTING.md
📚 Learning: 2026-01-13T19:27:50.183Z
Learnt from: CR
Repo: agarcher/wt PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-13T19:27:50.183Z
Learning: Each worktree should get a stable numeric index (1+) stored in .git/worktrees/<name>/wt-index for port offsets and resource isolation

Applied to files:

  • docs/USAGE.md
  • README.md
  • docs/ARCHITECTURE.md
  • docs/HOOKS.md
📚 Learning: 2026-01-13T19:27:50.183Z
Learnt from: CR
Repo: agarcher/wt PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-13T19:27:50.183Z
Learning: Hooks should receive standardized environment variables: WT_NAME, WT_PATH, WT_BRANCH, WT_REPO_ROOT, WT_WORKTREE_DIR, WT_INDEX

Applied to files:

  • docs/USAGE.md
  • README.md
  • docs/ARCHITECTURE.md
  • docs/HOOKS.md
📚 Learning: 2026-01-13T19:27:50.183Z
Learnt from: CR
Repo: agarcher/wt PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-13T19:27:50.183Z
Learning: The binary should output paths; shell wrapper function (wt()) generated by 'wt init <shell>' should handle the actual cd command to solve subprocess directory change limitation

Applied to files:

  • README.md
  • docs/ARCHITECTURE.md
📚 Learning: 2026-01-13T19:27:50.183Z
Learnt from: CR
Repo: agarcher/wt PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-13T19:27:50.183Z
Learning: Entry point for the application is cmd/wt/main.go which delegates to commands.Execute()

Applied to files:

  • docs/ARCHITECTURE.md
📚 Learning: 2026-01-13T19:27:50.183Z
Learnt from: CR
Repo: agarcher/wt PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-13T19:27:50.183Z
Learning: Git worktree command wrapping and porcelain output parsing should be implemented in internal/git/

Applied to files:

  • docs/ARCHITECTURE.md
📚 Learning: 2026-01-13T19:27:50.183Z
Learnt from: CR
Repo: agarcher/wt PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-13T19:27:50.183Z
Learning: Determine if running in main repository vs worktree by checking if .git is a file (worktree) or directory (main repo)

Applied to files:

  • docs/ARCHITECTURE.md
🪛 markdownlint-cli2 (0.18.1)
docs/USAGE.md

106-106: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


147-147: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


370-370: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🔇 Additional comments (4)
CONTRIBUTING.md (1)

1-55: LGTM! Clear and practical contributor guidelines.

The updated structure with build/test/lint instructions and the explicit merge commit requirement aligns well with the project's workflow. The instructions are actionable and easy to follow.

docs/ARCHITECTURE.md (1)

1-100: Well-structured technical documentation.

The architecture doc now focuses appropriately on implementation details after moving configuration and hooks documentation to dedicated guides. The updated diagram clearly shows the component relationships, and the new Output Conventions section helpfully explains the stdout/stderr separation that enables shell integration.

README.md (1)

1-159: Excellent restructure - README is now concise and navigable.

The streamlined README effectively serves as a high-level overview with appropriate deep links to detailed documentation. The installation flow is clear, and the command reference table provides quick navigation to comprehensive usage docs.

However, verification of internal documentation link targets (docs/USAGE.md command anchors, configuration sections, and docs/HOOKS.md) requires direct access to the repository, which could not be completed. Manual verification is recommended to ensure all referenced documentation files and anchor targets exist as expected.

docs/USAGE.md (1)

26-26: No action required. All HOOKS.md anchor targets referenced from USAGE.md exist and use consistent heading formats (level 3 headings for hook types, level 2 for Worktree Index).

Likely an incorrect or invalid review comment.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

- Create examples/hooks/show-info.sh referenced in docs/HOOKS.md
- Add example showing wt config --global --unset in docs/USAGE.md

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@agarcher agarcher merged commit 44af2d5 into main Jan 15, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant