documentlisted
Install: claude install-skill samuel-as/doc-agent
# Document a browser procedure
One skill, two modes: **record** a new procedure (browser recording + doc generation)
or **regenerate** the documentation of an existing recording. Everything doc-agent
produces for a procedure lives in `docs/<slug>/` inside the current project:
- `README.md`, `screenshots/` and the optional PDF — the generated guide;
- `sessions/<YYYY-MM-DD-HHMM>/` — one folder per recording (`session.json` + `shots/`),
so earlier takes are preserved.
## Paths used below
- `<home>` = the `DOC_AGENT_HOME` environment variable if set, otherwise
`%LOCALAPPDATA%\doc-agent`. Holds machine-level data: `<home>\runtime\node.exe`
(portable Node) and `<home>\browser-profile\` (the recording browser's logins).
- Script paths are relative to this skill's directory. In Claude Code,
`${CLAUDE_SKILL_DIR}` resolves to it; in other agents, resolve them from wherever
this SKILL.md was read.
## 0. Decide the mode
Look at the argument the user passed (`/document <argument>`):
- Argument given and `docs/<argument>/sessions/` exists in the project →
**regenerate**: read `references/write-doc.md` and follow it for that procedure.
- Argument given and no such folder → treat it as the name of a new procedure →
**record** (section 1).
- No argument → ask the user (one question, options): record a new procedure, or —
if `docs/*/sessions/` folders exist — regenerate one of them (list the procedure
names as options). Then proceed accordingly.
## 1. Prepare the env