docs(tools): split area pages into per-tool pages by tmux scope#26
docs(tools): split area pages into per-tool pages by tmux scope#26
Conversation
why: The 7 area pages (`tools/{panes,sessions,windows,buffers,
hooks,options,waits}.md`) packed 47 tools into long documents
organized by safety tier (Inspect/Act/Destroy). Agent-facing
navigation was by-tool, not by-area, and every {tool}\`…\` role
in prose produced deep links into section anchors on those long
pages. Per-tool pages are easier to cite, easier to cache, and
match the hierarchy agents already reason about (Server >
Session > Window > Pane).
what:
- **6 per-scope directories.** `docs/tools/{server,session,
window,pane,buffer,hook}/`. Each holds one page per tool
(kebab-case filename; title-case `# Tool name` heading) plus
an `index.md` with a grid-item-card overview and a hidden
toctree so the sidebar populates when an area page is open.
- **Mechanical extraction.** Each tool page is the old `{fastmcp-
tool}` directive + "Use when / Avoid when / Side effects /
Example" prose + `{fastmcp-tool-input}` directive, copy-pasted
from the old area pages unchanged. No content was rewritten.
- **`docs/tools/index.md` toctree** now lists the 6 area
indexes (`server/index`, `session/index`, …). The existing
grid-card navigation and "Which tool do I want?" decision
tree remain unchanged; their `:link: <tool-ref> :link-type:
ref` bindings still resolve because the `fastmcp-tool`
directive auto-creates the ref labels wherever the tool
lives.
- **`fastmcp_area_map`** in `docs/conf.py` re-mapped from old
area basenames (`"pane_tools": "panes"`) to new area-index
paths (`"pane_tools": "pane/index"`). `option_tools` /
`env_tools` now live under `server/`; `wait_for_tools` lives
under `pane/`.
- **`sphinxext-rediraffe` redirects.** 7 new entries in
`docs/redirects.txt` map the deleted area pages to their
corresponding new area index:
`tools/panes → tools/pane/index`,
`tools/sessions → tools/server/index`,
`tools/windows → tools/window/index`,
`tools/buffers → tools/buffer/index`,
`tools/hooks → tools/hook/index`,
`tools/options → tools/server/index`,
`tools/waits → tools/pane/index`.
The build's rediraffe check confirms each old URL resolves to
its new leaf.
- **Old area pages deleted** (`panes.md`, `sessions.md`,
`windows.md`, `buffers.md`, `hooks.md`, `options.md`,
`waits.md`). Only their content was redistributed; no prose
lost.
- **One relative link fixed.** `search-panes.md` now points
`../../../CHANGES` (three levels up) instead of the old
`../../CHANGES` (two levels up).
Zero-warning build on `just build-docs`. Full gate
(`uv run ruff check`, `ruff format`, `mypy`, `py.test --reruns 0
-vvv` (366 passed), `just build-docs`) clean.
Supersedes (closed unmerged) PR #12.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #26 +/- ##
==========================================
+ Coverage 86.67% 86.91% +0.23%
==========================================
Files 38 38
Lines 1719 1719
Branches 204 204
==========================================
+ Hits 1490 1494 +4
+ Misses 169 166 -3
+ Partials 60 59 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…r-tool-pages Temporary branch filter so the docs build/deploy workflow runs for PR #26 (per-tool-pages preview). Revert this commit before merging the PR into main.
Code reviewIgnoring the temp Found 1 issue:
libtmux-mcp/docs/tools/buffer/index.md Lines 1 to 5 in d17c648 Recommend hoisting the old intro into Two other content-loss concerns — the old One soft UX note (score 58, not flagged): 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
…nale Hoist the page-level intro that the mechanical split dropped. Original prose lives at 970b000:docs/tools/buffers.md:1-13; the per-tool pages inherit tool-scoped Use/Avoid blocks from autodoc but cannot carry area-level design rationale, so buffer/index.md is the natural home. Restores: - UUID-scoped namespacing (libtmux_mcp_<32-hex>_<logical>) and the concurrent-agent collision-safety it provides. - Deliberate absence of a list_buffers tool, because the user's OS clipboard often syncs into tmux paste buffers and generic enumeration would leak credentials.
Hoist the page-level intro the mechanical split dropped. Original prose lives at 970b000:docs/tools/hooks.md:9-22; the per-tool pages inherit tool-scoped Use/Avoid blocks from autodoc but cannot carry area-level design rationale explaining WHY the surface is read-only. Content restored explains: - tmux servers outlive the MCP process. - FastMCP lifespan teardown runs only on graceful SIGTERM/SIGINT; kill -9, OOM-kill, and C-extension-fault crashes bypass it. - Three candidate future paths (tmux-side client-detached meta-hook, LIBTMUX_SAFETY=destructive gating, one-shot run_hook) are explicitly out of scope until one is implemented.
…intro Hoist the composition pattern + status=$? idiom the mechanical split dropped. Original prose lives at 970b000:docs/tools/waits.md:1-21. The function docstring carries the idiom at the tool level, but the page-level composition pattern (send_keys → wait_for_channel with on-crash signal emission) was absent from the per-tool page. Content restored: - tmux wait-for channels as cheaper-than-polling synchronization. - Composition pattern: send_keys a command that signals on exit, then wait_for_channel. - The load-bearing safety idiom: ; status=$?; tmux wait-for -S NAME; exit $status, explaining edge-triggered wait-for would deadlock until timeout if the shell crashes before emitting. Also strips a trailing '---\n## Signal' artifact left by the mechanical splitter when it hit the old area page's next section heading; signal_channel has its own page at pane/signal-channel.md.
47cdec2 to
ca17bbc
Compare
Summary
Split the 7 area pages (
tools/{panes,sessions,windows,buffers,hooks,options,waits}.md) into 47 per-tool pages organized by tmux scope:docs/tools/{server,session,window,pane,buffer,hook}/. Each scope has anindex.mdwith a grid-item-card overview and a hidden{toctree}so the sidebar populates when that area is open.Supersedes #12 (closed unmerged earlier today — audit showed most of its commits had already landed on main via different routes and the remainder conflicted with main's drift). This PR re-derives the per-tool structure from current main, uses gp-sphinx's upstream
sphinx-autodoc-fastmcpdirectives rather than a vendored copy, and keeps existing{tool}\…`` cross-refs working because the ref labels are auto-created by the directive regardless of which page hosts it.Navigation shape
tools/index.md— overview + "Which tool do I want?" decision tree + grid cards + hidden toctree → 6 area indexes.tools/<area>/index.md— one per scope (server,session,window,pane,buffer,hook) with grid cards → per-tool pages + hidden toctree for sidebar.tools/<area>/<tool>.md— one per tool. Contains the existing{fastmcp-tool}directive + "Use when / Avoid when / Side effects / Example" prose +{fastmcp-tool-input}directive, copy-pasted unchanged from the old area pages.Mapping (42 tools from old area pages → new scope)
sessions.mdlist_sessions,list_servers,get_server_info,create_session,kill_serverserver/sessions.mdrename_session,select_window,kill_sessionsession/windows.mdlist_windows,create_windowsession/windows.mdlist_panes,split_window,rename_window,select_layout,resize_window,move_window,kill_windowwindow/panes.mdpane/waits.mdwait_for_channel,signal_channelpane/options.mdshow_option,set_option,show_environment,set_environmentserver/buffers.mdbuffer/hooks.mdshow_hooks,show_hookhook/Config + redirects
docs/conf.py—fastmcp_area_mapremapped from old area basenames to new area-index paths ("pane_tools": "pane/index", etc.).option_tools/env_toolsnow map toserver/index;wait_for_toolsmaps topane/index.docs/redirects.txt— 7 newsphinxext-rediraffeentries redirect every old URL:```
"tools/panes" "tools/pane/index"
"tools/sessions" "tools/server/index"
"tools/windows" "tools/window/index"
"tools/buffers" "tools/buffer/index"
"tools/hooks" "tools/hook/index"
"tools/options" "tools/server/index"
"tools/waits" "tools/pane/index"
```
Rediraffe's check-diff builder confirms every deletion has a redirect; build log shows
(good)for each.What did not change
{tool}\…`role,{fastmcp-tool}directive,{fastmcp-tool-input}` directive — same usage, same rendering, same ref labels (auto-generated by the upstream autodoc).docs/tools/index.mdbody (the "Which tool do I want?" guide + grids) — unchanged; only the toctree at the bottom was updated.src/libtmux_mcp/. No tests.Test plan
uv run ruff check . --fix --show-fixes— all checks passeduv run ruff format .— no changesuv run mypy— success, no issuesuv run py.test --reruns 0 -vvv— 366 passedjust build-docs— build succeeded, zero warnings (one stale../../CHANGESrelative link insearch-panes.mdfixed to../../../CHANGESfor the new depth)Out of scope (deferred)
c729553 docs(style): Strip badges from sidebar) was not re-derived. Current build doesn't show leak; if sidebar badge leakage reappears in production, a follow-up PR can contribute the fix upstream to gp-sphinx rather than vendoring.f0ee3d0) were not re-derived — already provided bygp-sphinx==0.0.1a9'ssphinx-autodoc-fastmcppackage.Closes none (PR #12 was already closed unmerged with rationale).