# doc-agent
[](https://github.com/samuel-as/doc-agent/actions/workflows/ci.yml)
[](LICENSE)

-5FA04E?logo=nodedotjs&logoColor=white)


**EN** · [PT-BR](README.pt-BR.md)
**Document a procedure by performing it.** You open the browser and do the process as
usual; doc-agent records every step with a screenshot, and Claude Code turns that into a
step-by-step guide in markdown — with an optional PDF.
```
you run it in the browser → the recorder logs steps + screenshots → Claude writes the doc
(5 minutes) (automatic) (automatic)
```
No writing tutorials by hand, no cropping screenshots, no keeping docs in sync with
screens that changed: re-recording is faster.
---
## Requirements
| What | Why |
|---|---|
| Windows 10/11 | the bootstrap and the runtime are `.ps1` + `node.exe` |
| Google Chrome **or** Microsoft Edge | the recorder attaches to the browser over CDP |
| [Claude Code](https://claude.com/claude-code) | runs the `/document` skill |
You do **not** need to install Node, npm or any dependency: on the first run doc-agent
reuses a Node.js 22+ already installed on the machine or downloads the official portable
Node (pinned zip from `nodejs.org`) — once per machine, into `%LOCALAPPDATA%\doc-agent` —
no admin rights, no PATH changes, no registry. Node only enters the picture in the `npx`
install path below, and only to copy the files.
## Install
### As a plugin — recommended, and the only one that updates itself
In Claude Code:
```
/plugin marketplace add samuel-as/doc-agent
```
```
/plugin install doc-agent@doc-agent
```
Installs once and is available in **every** project, as `/doc-agent:document` — the guides
are still written into the `docs/` folder of whichever project you are in. Each new release
published on `main` arrives on its own, at the next Claude Code session — no Node and no
`npx` involved. `/plugin update doc-agent@doc-agent` pulls one early;
`/plugin uninstall doc-agent@doc-agent` removes it.
### As a skill in a single project
```bash
npx skills add samuel-as/doc-agent
```
Puts the skill in the current project, as `/document`. Needs `npx` (that is, Node
installed) and gives you a frozen copy: to move to a new version, run the command again.
### Without Node, without npx
Clone the repository and open Claude Code in that folder:
```bash
git clone https://github.com/samuel-as/doc-agent.git
```
Or, with no git either: download the repository ZIP from GitHub ("Code" → "Download ZIP")
and copy the `.claude/skills/document` folder from it into `.claude/skills/` of your
project. The skill is self-contained — it carries its own runtime bootstrap.
## Usage
### Document a new procedure
```
/document vpn-ticket-request
```
(installed as a plugin, the command is `/doc-agent:document vpn-ticket-request` — the rest
of this README writes `/document` for short)
What happens:
1. The runtime is prepared (silent when it is already fine).
2. A recording browser opens with its own profile.
3. **You run the procedure as usual.**
4. **Close the browser** to finish — the recording is consolidated and the doc is written.
On the first recording, sign in to your systems in that browser: the profile is stored in
`%LOCALAPPDATA%\doc-agent\browser-profile`, so later recordings start already
authenticated — in every project.
### Regenerate the doc of an earlier recording
```
/document vpn-ticket-request
```
The same command: when a recording for that name already exists in the project, the skill
regenerates the documentation from it instead of recording again — handy to rewrite the
text or produce the PDF later. Run `/document` with no argument to pick from the existing
recordings.
## What you get
Everything for a procedure lives in one folder of the project where you ran `/document`:
```
docs/vpn-ticket-request/
├── README.md ← step-by-step guide
├── screenshots/step-01.png ... ← only the screenshots the guide references
├── vpn-ticket-request.pdf ← optional
└── sessions/2026-08-31-1745/ ← one folder per recording (kept as history)
├── session.json ← the recorded step log
└── shots/step-001.png ... ← all screenshots of that recording
```
Committing that folder (or not) is your decision — doc-agent never touches your
`.gitignore`. Machine-level data stays out of your project, in `%LOCALAPPDATA%\doc-agent`
(override with the `DOC_AGENT_HOME` environment variable): the portable runtime and the
recording browser profile.
The recorder follows the whole interaction: clicks (inside shadow DOM too, and on the plain
`div`/`span` an SPA wires as a button — recognized by the pointer cursor), text typed into
fields, dropdown selections, checkboxes and radio buttons, keyboard shortcuts, drag and
drop, and the scroll needed to reach a control that was off-screen. After a navigation it
waits for the new screen to be painted, so a page or an SPA route that renders late is
captured with its content instead of its spinner.
The text comes out in the imperative ("Click **Save**"), with micro-actions grouped into
logical steps — a whole form becomes one step, not ten. It is written in the **language of
the recorded screens**, so a Portuguese UI produces a Portuguese guide and an English UI
produces an English one.
## Privacy and security
The recorder was designed assuming you will walk through login screens and forms with
personal data:
- **Sensitive values are never recorded.** Passwords, one-time/MFA codes, card numbers and
security codes, personal documents (CPF, CNPJ, RG, passport, SSN…) and phone numbers keep
`value: null` in the step. Detection uses the field's `autocomplete` attribute, its
name/label (in several languages, Portuguese included) and, for documents and cards, the
value itself (check digits / Luhn).
- **Sensitive fields are painted over in every screenshot** with a solid box, before the
image is written to disk — including the temporary capture kept during the recording, so
an interrupted recording leaves no readable field behind. If painting fails, that step
gets no screenshot at all.
- **Known redaction gaps:** detection only scans the light DOM of the top frame plus the
element actually interacted with — a sensitive field in a shadow root that isn't the one
being interacted with may not be redacted. An action **inside an iframe gets no
screenshot**: its coordinates are relative to the iframe, so a box painted from them
would cover the wrong area of the page; the step is recorded without an image.
`contenteditable` elements have their sensitive values excluded from the recording the
same as ``/`