Skip to content

Commit cf94a4d

Browse files
committed
skills: add pyclawd-web skill (document the dashboard for agents)
The web dashboard had only a one-line AGENTS.md row and nothing telling an agent what it can do. Add a proper `pyclawd-web` standalone skill covering: run/register, the Source⟷Rendered file views (Markdown → GFM + GitHub alerts + emoji; sandboxed HTML), the one line-anchored comment model across diff/rendered-md/rendered-html, the ⌘P quick-open palette, the Review tray (send-to-tmux / dispatch-a-headless-agent), and the verb runner — plus the authoring implication that alerts/emoji in a repo's Markdown render in the dashboard. Wire it into the umbrella router table, the skills README (four→five standalone), the root README, and the AGENTS.md web row.
1 parent c2b6b8b commit cf94a4d

5 files changed

Lines changed: 103 additions & 3 deletions

File tree

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ on `PYTHONPATH`. Bare `python` misses the env and the in-tree source.
5454
| Docs (if configured) | `pyclawd docs build\|run\|render\|serve\|status\|failures\|exec <page>` |
5555
| Code map (file → description) | `pyclawd ls [DIR]` · `pyclawd ls --missing` · `pyclawd ls --py` |
5656
| Manage agent skills | `pyclawd skills list` · `pyclawd skills install` |
57-
| Web diff/review dashboard (extra) | `pyclawd web serve` · `web add <path>` · `web list` · `web remove <name>` (needs `pip install 'pyclawd[web]'`) |
57+
| Web diff/review dashboard (extra) | `pyclawd web serve` · `web add <path>` · `web list` · `web remove <name>` (needs `pip install 'pyclawd[web]'`). Source/Rendered file views (Markdown → GFM + `> [!NOTE]` alerts + emoji; sandboxed HTML), line-anchored review comments across all views, ⌘P quick-open, send-to-tmux / dispatch-a-fix-agent — see the **`pyclawd-web`** skill. |
5858
| Version + config drift | `pyclawd version` · `pyclawd version --json` |
5959
| What changed (since config) | `pyclawd changelog [--since V] [--full]` |
6060
| Repo root | `pyclawd root` |

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ Copy whichever is closer and delete what you don't use.
135135

136136
## Skills
137137

138-
pyclawd ships agent-facing slash-command skills under [`src/pyclawd/skills/`](src/pyclawd/skills/): the start-here umbrella `pyclawd` router skill (a lean overview plus on-demand `references/{mental-model,tests,quality,docs,packaging}.md` carrying the testing/quality/docs/packaging doctrine) plus the four focused standalone skills `pyclawd-adopt` (adopt pyclawd into an existing repo — red-to-green with zero behavior regression), `pyclawd-golden`, `pyclawd-doctor`, and `pyclawd-upgrade` (migrate *after* a pyclawd version bump — the upgrade counterpart to first-time adoption). They are thin wrappers over the CLI. `pyclawd skills install` copies (or symlinks) the `pyclawd-*` directories into your **user-scope** `~/.claude/skills/` by default — they are generic, so they are shared across every project rather than committed per-repo — see [`src/pyclawd/skills/README.md`](src/pyclawd/skills/README.md). Agent doctrine for any pyclawd project lives in [`AGENTS.md`](AGENTS.md).
138+
pyclawd ships agent-facing slash-command skills under [`src/pyclawd/skills/`](src/pyclawd/skills/): the start-here umbrella `pyclawd` router skill (a lean overview plus on-demand `references/{mental-model,tests,quality,docs,packaging}.md` carrying the testing/quality/docs/packaging doctrine) plus the five focused standalone skills `pyclawd-adopt` (adopt pyclawd into an existing repo — red-to-green with zero behavior regression), `pyclawd-golden`, `pyclawd-doctor`, and `pyclawd-upgrade` (migrate *after* a pyclawd version bump — the upgrade counterpart to first-time adoption). They are thin wrappers over the CLI. `pyclawd skills install` copies (or symlinks) the `pyclawd-*` directories into your **user-scope** `~/.claude/skills/` by default — they are generic, so they are shared across every project rather than committed per-repo — see [`src/pyclawd/skills/README.md`](src/pyclawd/skills/README.md). Agent doctrine for any pyclawd project lives in [`AGENTS.md`](AGENTS.md).
139139

140140
## Web dashboard (optional)
141141

src/pyclawd/skills/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@ directory `<name>/SKILL.md` with YAML frontmatter (`name`, `description`,
55
`when_to_use`) plus a short body. They are thin wrappers over the real CLI — the
66
logic lives in `pyclawd`, the skills just say *what to run and when*.
77

8-
The tree is **one router + four standalone skills**:
8+
The tree is **one router + five standalone skills**:
99

1010
| Skill | Purpose |
1111
|---|---|
1212
| `pyclawd` | **Start here** — the router: a lean mental-model TL;DR, an index of on-demand `references/*.md` doctrine files, and pointers to the standalone skills and `AGENTS.md`. |
13+
| `pyclawd-web` | The optional `pyclawd web` dashboard — local multi-project diff & review UI: Source/Rendered file views (Markdown alerts/emoji, sandboxed HTML), line-anchored comments across views, ⌘P quick-open, send-to-tmux / dispatch-a-fix-agent. |
1314
| `pyclawd-adopt` | Adopt pyclawd into an existing/legacy repo — bootstrap the config with `pyclawd new` (adopt mode), then drive a red codebase to a green `pyclawd check` with zero behavior regression (curate the gate, pick the docstring convention, lay golden baselines first, fix in small verified batches). The first-time-onboarding counterpart to `pyclawd-upgrade`. |
1415
| `pyclawd-golden` | Prove behavior *unchanged* across a refactor/migration with the golden behavior-regression oracle. |
1516
| `pyclawd-doctor` | Diagnose a broken dev env; interpret `pyclawd doctor`'s FAIL/WARN; common fixes. |
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
---
2+
name: pyclawd-web
3+
description: The `pyclawd web` dashboard — a local, multi-project diff & code-review UI (the optional `pip install pyclawd[web]` extra). Browse the working diff across registered repos; view any file as syntax-highlighted **Source** or a rendered **preview** (Markdown renders GFM + GitHub alerts `> [!NOTE]` + emoji; HTML renders in a sandboxed, script-free iframe); leave **line-anchored review comments** on diff lines, on rendered-Markdown blocks, and on rendered-HTML elements; assemble them into one review and either send it to a running `claude` tmux pane or hand it to a headless agent to resolve. Also runs pyclawd verbs (check/test/golden/…) from the UI and edits/deletes files in the browser. Use when a human wants to review a diff or an agent's work in a browser, or when an agent needs to know what the dashboard renders and how comments flow.
4+
when_to_use: Reviewing a working diff or an agent's changes in a browser; collecting inline review comments and handing them to a tmux pane or a headless fix-agent; previewing how a Markdown doc (alerts / emoji / tables / task lists) or an HTML file will actually render; running `pyclawd check`/`test`/`golden` from a UI. Also relevant when an agent authors Markdown in the repo — it can use GitHub alerts and emoji knowing the dashboard renders them.
5+
---
6+
7+
# pyclawd-web
8+
9+
`pyclawd web` is an **optional** local dashboard for reviewing diffs and driving
10+
review workflows in a browser. It is not part of the core install — a project (or
11+
you) must `pip install 'pyclawd[web]'` (FastAPI + uvicorn + watchfiles). The core
12+
`pyclawd` CLI never depends on it; when the extra is absent the `web` commands
13+
self-report.
14+
15+
It is the **human side of the agent loop**: an agent makes changes on a branch /
16+
working tree, a human browses the diff, leaves inline comments, and then either
17+
sends those comments to the `claude` pane that is doing the work, or dispatches a
18+
fresh headless agent to resolve them.
19+
20+
## Run it
21+
22+
```bash
23+
pip install 'pyclawd[web]' # one-time, the optional extra
24+
pyclawd web serve # dashboard on http://127.0.0.1:8801
25+
pyclawd web serve --host 0.0.0.0 --port 8830 --repo /path/to/repo
26+
pyclawd web add <path> [--name N] # register a repo
27+
pyclawd web list # list registered + auto-discovered repos
28+
pyclawd web remove <name>
29+
```
30+
31+
It auto-discovers git repos under configured roots (default `~/workspace`) and
32+
tracks a working diff live (a filesystem watcher pushes updates over SSE — no
33+
polling). It is **multi-project**: switch repos and comparison refs (any branch /
34+
tag / SHA / the working tree) from the top bar.
35+
36+
## Viewing a file — Source ⟷ Rendered
37+
38+
Every file opens in **Source**: the syntax-highlighted diff (inline or split) or
39+
full-file view, with a comment gutter. For **`.md` / `.html`** files a
40+
**Source | Rendered** toggle appears in the file header (the choice is **sticky**
41+
it persists until you switch back):
42+
43+
- **Markdown → Rendered** renders the doc richly: GitHub-Flavored Markdown (tables,
44+
task lists, strikethrough), **GitHub alerts** (`> [!NOTE]` / `[!TIP]` /
45+
`[!IMPORTANT]` / `[!WARNING]` / `[!CAUTION]` → colored callout boxes with icons),
46+
and **emoji shortcodes** (`:rocket:` → 🚀). Code fences render as plain preformatted
47+
text.
48+
- **HTML → Rendered** renders the page in an iframe sandboxed to `allow-same-origin`
49+
only — **repo scripts never run** (safe) and styles stay isolated.
50+
51+
**Authoring implication for agents:** a Markdown doc you write in the repo will
52+
render with those features in the dashboard — so use `> [!NOTE]`/`[!WARNING]`
53+
callouts and emoji to make a hand-off / summary doc read well when a human previews
54+
it.
55+
56+
## Commenting — one line-anchored model across every view
57+
58+
Comments are always **anchored to a source line** and share **one store**, so the
59+
same comment shows up everywhere and feeds the review:
60+
61+
- **Source / diff view** — click the 💬 gutter on a line (old or new side).
62+
- **Rendered Markdown** — hover a block, click 💬; the comment anchors to that
63+
block's source line and shows as a **persistent inline thread** right below it
64+
(commented blocks get an amber highlight). Edit/delete inline.
65+
- **Rendered HTML** — click any element; the comment anchors to that element's
66+
source line (the element gets a gold outline) and shows in a list below the page.
67+
68+
Flip between Source and Rendered freely — it's the same comment either way.
69+
70+
## Turning comments into action (the Review tray)
71+
72+
The **Review (N)** tray lists every staged comment grouped by file. From there:
73+
74+
- **Send → tmux** — assemble the comments into one structured message and paste it
75+
into the selected running `claude` tmux pane (pick the pane in the session picker).
76+
- **Copy** — copy the assembled review to the clipboard.
77+
- **🤖 Run (edits only / full access)** — dispatch a **headless `claude -p` agent**
78+
that resolves every comment (edits auto-accepted); progress streams live in the UI.
79+
80+
So the loop is: agent works → human reviews the diff and leaves inline comments →
81+
one click sends them back to the same agent, or spins up a new one to fix them.
82+
83+
## Also in the dashboard
84+
85+
- **Verb runner** — run `pyclawd check` / `test` / `golden` / `lint` / `typecheck` /
86+
`format` / `doctor` from the UI; output streams with a pass/fail verdict.
87+
- **File edit / delete** — edit a file's working-tree content or delete it in the
88+
browser (the diff refreshes live).
89+
- **Sessions** — list running `claude` tmux panes to target with a review.
90+
91+
## Boundaries
92+
93+
- The `[web]` deps are an **optional extra** — never assume they're installed; the
94+
core CLI (`check`/`test`/`golden`/…) is the contract, the dashboard is a
95+
convenience over it.
96+
- Rendered views are for **preview + commenting**; the authoritative diff/lint/type
97+
signal is still `pyclawd check`. The dashboard runs those verbs, it doesn't replace
98+
them.

src/pyclawd/skills/pyclawd/SKILL.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ them directly when the situation matches:
5858
| **pyclawd-doctor** | Diagnose a **broken env** — runs `pyclawd doctor`, interprets OK/WARN/FAIL. | Mass import/collection errors, wrong interpreter, fresh clone, "module not found". |
5959
| **pyclawd-upgrade** | Migrate the project's `.pyclawd/config.py` after **pyclawd itself was upgraded** (config version drift). | `pyclawd version`/`doctor` reports config built on a different pyclawd; right after `pip install -U pyclawd`. |
6060
| **pyclawd-adopt** | Onboard an **existing/legacy repo** to pyclawd — bootstrap the config, then drive a red codebase to a green `pyclawd check` with zero behavior regression. The first-time-onboarding counterpart to pyclawd-upgrade. | "adopt pyclawd here", "get this existing repo ready", "make this red codebase pass check". |
61+
| **pyclawd-web** | The optional **`pyclawd web` dashboard** — a local multi-project diff & review UI: Source/Rendered file views (Markdown with GFM + GitHub alerts + emoji; sandboxed HTML), line-anchored review comments across all views, a ⌘P quick-open palette, and send-to-tmux / dispatch-a-headless-agent to resolve comments. | Reviewing a diff or agent work in a browser, gathering inline comments, previewing how a Markdown/HTML file renders. |
6162

6263
## The command contract
6364

0 commit comments

Comments
 (0)