Skip to content

Add docs maintenance agent: AGENTS.md, skills, and rule files - #846

Open
brandonjackson wants to merge 31 commits into
mainfrom
claude/docs-agent-skills-0e700j
Open

brandonjackson wants to merge 31 commits into
mainfrom
claude/docs-agent-skills-0e700j

Conversation

@brandonjackson

@brandonjackson brandonjackson commented Sep 4, 2026 •

Copy link
Copy Markdown

Short Description

Adds an AGENTS.md and four short skills under .agents/skills/ so an LLM agent can review, update, and translate the docs. Also adds glossary.yml (a seed list) and translation-rules.yml (empty, with a schema comment).

Where to focus review: translation. The other three skills are short and high level on purpose, and they only ever touch English pages through a normal PR. The translation workflow is where the real decisions are.

Details

The skills

Skill What it does
Identify gaps Reviews the docs and returns a report. It doesn't edit anything. It looks at four things: is it accurate against the code, can a newcomer follow it, what's missing, and what has changed. Every recommendation is marked Must change, Should change, or Could change, and anything it can't decide goes under Questions.
Update content Makes the edits and opens a PR. It works from direct instructions or from an identify-gaps report. With a report, it makes every Must change and makes Should changes where the right text is clear. If it's only told to "improve the docs", it runs identify gaps first and then updates, as one loop that ends in one PR.
Release review Plumbing only. It reads the changelogs in Lightning, kit, and adaptors (default: the last month), turns them into a list of changes users would notice, and passes that list to identify gaps. Designed for a monthly trigger, which isn't part of this PR.
Translate Generates Spanish and French versions of English pages, with governance around it (see below).

The default scope is the whole site. A user can narrow it to a sidebar category, a folder, or a single page. Update content stops at 20 changed files and lists any remaining work in the PR for the next run.

Lint's core checks now live in the House style section of AGENTS.md (glossary terms, site-absolute links, front matter titles, alt text) and in identify gaps (dead external links, orphan pages). Internal links are covered by yarn build, which already fails on broken links.

Translation (please look closely)

  • Source tracking. translation_source_hash is the content hash of the English file (git hash-object), not a commit SHA. This repo squash-merges, so a hash pointing at a branch commit would stop resolving as soon as the PR lands. A content hash is the same wherever the file lives, and a reviewer can recover the English they approved with git cat-file -p <hash>.
  • Review status. Pages are machine, needs-review, or human-reviewed. The agent never edits human-reviewed pages. When their English changes, it proposes a diff in a separate PR instead.
  • Do-not-retranslate fences protect text a reviewer corrected by hand.
  • Glossary. Terms marked translate: false stay in English in every locale. The seed goes a little beyond the original spec (dataclip, Canvas, Inspector, CLI, project, state, operation, collection, sandbox), based on terms already used across docs/. It's easy to trim.
  • Scope. Generated adaptor pages, the job library, v1 docs, articles, and blog posts are never translated.
  • Build. Run a full yarn build. yarn build --locale <x> builds the locale at the site root, which makes every correct /es/... link show up as broken (learned from the i18n PoC).
  • PRs. Translations get their own PR per locale and don't count toward the 20-file cap.

Things to look at carefully

  • .gitignore no longer ignores /i18n. The old rule contradicted keeping translations in the repo. There's no i18n/ directory yet, so nothing changes until the translate skill runs.
  • docusaurus.config.js has no i18n block, and I haven't added one: enabling locales changes what yarn build produces and deploys. The translate skill treats a missing locale as a blocking question. I'd suggest the first real translation PR enables the locale alongside the first translated content.

No existing docs pages were modified.

AI Usage

  • I have used Claude Code
  • I have used another model
  • I have not used AI

You can read more details in our
Responsible AI Policy

🤖 Generated with Claude Code

https://claude.ai/code/session_014z5Y9vFQSL1as9VQrMvQux

Adds the orchestrator (AGENTS.md) and seven self-contained skill files under
.agents/skills/ for linting, accuracy verification, fresh-user evaluation,
gap analysis, translation, corrections capture, and screenshot triage.

Seeds glossary.yml with product terms that must never be translated and
spelling variants lint should flag. Adds empty style-exceptions.yml and
translation-rules.yml with schema comments.

Stops ignoring /i18n so machine translations can be committed alongside
the English source, per the translation architecture in AGENTS.md.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CntaKNYyBkumpWvm5mTJa7
Keeps every rule from the spec; drops long command snippets, exhaustive
path tables, and repeated output templates so the files are easier to read
and maintain.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CntaKNYyBkumpWvm5mTJa7
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CntaKNYyBkumpWvm5mTJa7
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CntaKNYyBkumpWvm5mTJa7
The three rule files stay and are maintained by humans directly.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CntaKNYyBkumpWvm5mTJa7
… glossary check, exempt from file cap

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CntaKNYyBkumpWvm5mTJa7
Starts from a product PR and finds the docs pages that need updating.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CntaKNYyBkumpWvm5mTJa7
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CntaKNYyBkumpWvm5mTJa7
Commit SHAs made on a branch dangle after a squash merge. A git blob hash
is the same wherever the file lives and still lets a reviewer recover the
English they approved.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CntaKNYyBkumpWvm5mTJa7
…cation map

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CntaKNYyBkumpWvm5mTJa7
…rch invocations, separate ease from impact

Based on a test run against the CLI section.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CntaKNYyBkumpWvm5mTJa7
@brandonjackson
brandonjackson marked this pull request as draft September 4, 2026 14:39
Defaults to every release in the last month across the product repos and
reads changelogs before diffs. A single PR remains an optional narrower
input.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CntaKNYyBkumpWvm5mTJa7
brandonjackson pushed a commit that referenced this pull request Sep 4, 2026
…ranslate skill

Brings AGENTS.md, the agent skills, and the rule files (glossary.yml,
translation-rules.yml, style-exceptions.yml) onto this branch so the Spanish
translations can be produced under the translate skill rather than audited
against it after the fact.

Merged rather than copied so the files keep one history: when #846 lands,
this branch's diff against main shows only the i18n work.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0191JhrXtWiHnUGwfwesiq7T
- translate: run a full `yarn build`, not a single-locale build, which
  reports every correct /es/ link as broken
- translate: articles and blog posts are not translated either
- lint: convert relative .md links to site-absolute paths, per house style;
  they break the build once one end is translated
- .gitignore: point at the translate skill, which is where i18n/ being
  tracked is actually described

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DwEcZH8y5VxFiBW6oZ1Ly3
@brandonjackson
brandonjackson marked this pull request as ready for review September 24, 2026 11:33
claude and others added 8 commits September 24, 2026 11:43
Fold accuracy check, fresh-user evaluation, gap analysis, and the
what-changed part of release review into a single identify-gaps skill
that returns a Must / Should / Could change report without editing.
Add an update-content skill that applies a report or direct
instructions, with a light tidy pass in place of lint. Release review is
now just the plumbing that builds a list of shipped changes and hands it
to identify-gaps.

Remove lint, screenshot triage, and style-exceptions.yml. Translation
is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014z5Y9vFQSL1as9VQrMvQux
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014z5Y9vFQSL1as9VQrMvQux
Move each skill into .agents/skills/<name>/SKILL.md with a name and a
description that says when to use it, so agents can find and load them
instead of relying on AGENTS.md to point at flat files. Link
.claude/skills to the same folder so Claude Code finds them too.

update-content and translate open PRs, so they set
disable-model-invocation and only run when someone asks for them by name.
Handoffs from other skills read their SKILL.md directly.

Update paths in AGENTS.md, the skills, glossary.yml,
translation-rules.yml, and .gitignore.
Machine and needs-review pages were retranslated on every run, even
when translation_source_hash still matched the English. That gave a
~94-file PR per locale with no real changes, and overwrote reviewers'
work in progress. Now any page whose hash matches is skipped,
whatever its status.

Exception: if glossary.yml or translation-rules.yml was committed
after the translation, machine pages are retranslated anyway so they
pick up the new rules.
yarn build fails on a fresh clone: adaptors/packages/ is gitignored
and only created by generate-adaptors, and onBrokenLinks is 'throw'.
update-content now runs generate-library and generate-adaptors first,
as test-deploy.yml does.

Add a house style rule for blank lines around admonition markers.
Without them, Prettier merges the text into the :::tip line and
Docusaurus shows it as the title.
Tested on Docusaurus 3.10.1 with es enabled. Absolute links get the
locale added at build time, so the hand-added /es/ prefix did nothing
in a full build and broke yarn build --locale es. Keep them unchanged.

Relative .md links break when the target page has no translation yet,
so write those as full /documentation/ paths, using the slug where a
page sets one.

Build the locale after the same generate steps CI runs.
Docusaurus only reads translated docs from
i18n/<locale>/docusaurus-plugin-content-docs/current/ and silently
ignores them anywhere else. Sidebar labels come from sidebars-main.js,
so new entries need write-translations and a translation in
current.json, as the Spanish PoC (#848) did.
Lightning's UI is English only (priv/gettext has just en/errors.po),
so a translated button name points readers at a button that does not
exist. Say so in the skill, and replace the translation-rules.yml
example that assumed French UI strings with a real French rule.
Nothing looked for pages breaking the house style since lint was
removed, so relative links, weak alt text, and glossary variants were
only fixed by chance. Report them as Could change, grouped by rule.
Point glossary.yml's comments at this check instead of lint.
Kit's changesets changelogs have no dates, so take them from the
release tags. Lightning lists a release's changes under its -pre
heading and leaves the final one empty (e.g. 2.18.2), so read the -pre
entries and report them under the final version.
It said both "do not touch the file" and "open a PR with the diff".
Leave the page out of the translation PR and open a separate one for
the reviewer. Update translation_source_hash in that PR, or the same
diff is proposed on every run after it merges.
Agents are often told not to write model names into repo files, so
translation_model was unreliable (the Spanish PoC left it out). The PR
description is permanent and git log leads to it. Also drop "per
section" from the PR rule, left over from when the default scope was
one section, to match AGENTS.md.

@lmac-1 lmac-1 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a great start, thank you! I went through it, checked a few assumptions against the code and a test build, and pushed some changes straight to the branch:

Structure

  • Each skill is now a folder with a SKILL.md and front matter (name, and a description of when to use it), so agents can find them.
  • .claude/skills links to .agents/skills, so Claude Code finds them too.
  • update-content and translate only run when asked for by name, since they open PRs.

Skills

  • translate: skips pages whose English hasn't changed; keeps links as in the English (tested); exact save folder; app labels stay English; clearer rule for approved pages; model goes in the PR, not the page; builds the whole site like CI (building one locale reports every /es/ link as broken)
  • update-content: builds like CI
  • identify-gaps: checks the house style again
  • release-review: kit dates from tags, reads Lightning -pre entries

Rules

  • AGENTS.md: blank lines around :::tip and other admonitions, so Prettier doesn't break them
  • glossary.yml: removed Kafka from triggers (Lightning only has webhook and cron now)

Still to do, happy for these to be follow-ups:

  • AGENTS.md: only adaptors/library/jobs/auto/ is generated; the rest of adaptors/library/ is hand-written
  • AGENTS.md: can the agent edit articles/?
  • Prettier: add as a dependency, reformat docs/ in its own PR (tracking in #866)
  • #848: update it to match the new translate rules
  • Relative links clean-up (tracked in #867)
  • Language guidance (e.g. only use US English)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants