Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions docs-agent/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Daily docs change agent

A scheduled Claude Code cloud agent runs daily at 09:00 UTC. It detects code changes across Viam source repos, classifies their docs impact, and opens PRs against this repo. PRs from the agent are labeled "Generated by daily docs change agent" in the PR body.

## How it works

The agent follows [playbook-daily-code-changes.md](playbook-daily-code-changes.md), the complete procedure it executes on every run:

1. Diff each monitored repo from the last-checked commit to HEAD.
2. Classify every change against 14 docs-impact cases (API surface, config fields, CLI, UI, deprecations, SDK examples, and more).
3. Grep the entire docs repo for every affected symbol, value, and string.
4. Edit affected pages, validate with prettier, markdownlint, and vale.
5. Group changes by source-code cause and open at most 5 PRs per run, queueing the rest in a backlog.
6. Request a Copilot review on each PR and action the feedback before finishing.

## Monitored repos

`viamrobotics/rdk`, `viamrobotics/api`, `viamrobotics/app`, `viamrobotics/viam-python-sdk`, `viamrobotics/viam-cpp-sdk`, `viam-labs/motion-tools`, and this repo as the PR target.

## Where the rest of the agent lives

- **Schedule and environment**: the trigger (schedule, model, prompt, setup script) is configured as a Claude Code scheduled agent. The setup script installs `gh`, `prettier@3.2.5` (pinned to this repo's CI version), `markdownlint-cli`, and `vale`. The agent authenticates to GitHub with a `GH_TOKEN` environment variable set in the trigger environment; no credentials are stored in any file.
- **State files**: the agent reads and writes its working state in a separate private repo (`shannonbradshaw/viam-code-map`) on every run. Those files stay there because the agent mutates them daily and some contain summaries of private-repo commits:
- `maintenance.md`: last-checked commit SHA per repo
- `backlog.yaml`: findings awaiting PR creation beyond the per-run cap
- `search-patterns.yaml`: non-obvious symbol-to-docs-text mappings
- `missed-findings.md`: human-reported false negatives the agent learns from
- `false-positives.md`: human-reported false positives the agent learns from
- `exclusions.yaml`: paths and patterns to skip
- `run-history.yaml`: per-run metrics
- `playbook-feedback.md`: the agent's proposed playbook refinements
- **Cross-reference files**: the playbook references code-to-docs xref files, behavioral flow traces, and writing playbooks that also live in the code-map repo.

## Reporting problems

If the agent misses a docs-impacting change or opens a PR for something that was not a real docs issue, record it in `missed-findings.md` or `false-positives.md` in the code-map repo. The agent reads both files at the start of every run and incorporates the lessons.
Loading
Loading