Update documentation pages to match source code changes on the current branch
74%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Passed
No findings from the security scan
Fix and improve this skill with Tessl
tessl review fix ./.claude/skills/update-docs/SKILL.mdUpdate documentation pages to reflect source code changes on the current branch. Analyzes the diff against main, maps changed source files to their corresponding doc pages, and makes targeted edits.
This skill is repo-agnostic and shared. It is published by the
pipecat-dev-skills marketplace and used by every repository whose changes feed
pipecat-ai/docs, so it must stay free of anything specific to one of them.
Everything repo-specific — what is in scope, how files map to pages, what a new
page looks like, where it gets registered — comes from that repo's profile,
.claude/skills/update-docs/SOURCE_DOC_MAPPING.md, which lives in the repo
being documented. The skill never hardcodes a source path, a page template, or a
navigation group. See PROFILE_CONTRACT.md for what a profile must provide.
How pages read — what to document, what to leave out, page templates, prose —
comes from the docs repo's style guide, DOCS_PATH/STYLE.md. This skill covers
the process: finding what changed, deciding what the docs need, and checking
the result.
REVIEW.md is a second pass over a finished update, run in a fresh session
that did not write it. The automation runs it after this skill; run it by hand
the same way after a local update.
/update-docs [DOCS_PATH]DOCS_PATH (optional): Path to the docs repository root. If not provided, ask the user.Examples:
/update-docs /Users/me/src/docs/update-docsIf DOCS_PATH was provided as an argument, use it. Otherwise, ask the user for the path to their docs repository.
Verify the path exists and contains docs.json.
Read the profile at .claude/skills/update-docs/SOURCE_DOC_MAPPING.md in the
source repository. It defines this repo's scope, mapping tables, page
template, and registration steps. If it is missing, stop and say so — without it
there is no way to resolve a file to a page, and guessing produces edits to
pages that don't exist.
Read DOCS_PATH/STYLE.md in full. Every edit follows it. Where it and this
skill disagree about how a page reads, the style guide wins. If it is missing,
follow the Guidelines at the end of this skill.
Get the current source branch name:
git rev-parse --abbrev-ref HEADIn the docs repo, create a new branch off main with a matching name:
cd DOCS_PATH && git checkout main && git pull && git checkout -b {branch-name}-docsFor example, if the source branch is feat/new-service, the docs branch becomes feat/new-service-docs.
All doc edits in subsequent steps are made on this branch.
Run:
git diff main..HEAD --name-onlyEvery source file under the roots the profile's Scope section names is in scope. Repos ship public API well beyond their most obvious entry points, so scope is defined as exclusions rather than an allowlist: a new directory is covered the day it appears rather than when someone remembers to list it.
Exclude what the profile's Scope section excludes, plus build and cache
artifacts (__pycache__/, *.pyc, node_modules/, dist/) and re-export-only
index files that define nothing themselves.
Changes outside those roots — examples, CI config, the docs directory — don't trigger doc updates on their own.
Then apply the profile's Skip list (Step 4), which names the small set of genuinely internal files. Don't invent further reasons to drop a file here: being a base class, a shared module, or "core architecture" is not one. Public constructor parameters and observable behavior get documented wherever they live, and a file whose page isn't obvious should reach Step 8 as a reported gap rather than disappear.
For each changed source file, resolve the doc page to edit using the profile's
tables, in this order. Confirm every candidate path exists in DOCS_PATH
before using it.
.mdx file exists (glob/ls it under DOCS_PATH). If it exists, use it.DOCS_PATH for the file's main class or exported symbol name (see the profile's Search section).Never edit a path you haven't confirmed exists. If a candidate path doesn't resolve, fall through to the search step.
Reaching step 6 is a finding, not a dead end: an unmapped file means public API with no home on the docs site, which is exactly what Step 8 exists to surface. Never resolve a file by dropping it.
Before opening any page for editing, read the full PR: its description (including any Breaking Changes section), every changelog fragment it adds, and the diff. Then write down, for yourself, the list of reader-facing changes: things a user can now set, call, observe, or act on differently. Every bullet of a Breaking Changes section goes on the list, one item per bullet, unless it only affects code that subclasses or calls internals; it is there because a user's code or expectations change.
For each item, record the facts from the source, not from prose about it:
Verify every consequence you intend to state by reading the code that produces it. The PR description, changelog, and docstrings say what the author intended; the code says what happens. When they disagree, document the code, and check the Breaking Changes section for the cases the summary leaves out.
Docstrings, comments, PR descriptions, and changelog entries are sources of facts, never of sentences. They are written for maintainers and carry rationale ("Early Access", error codes, why the code works this way) that a reader does not need. Restate the fact for the reader in the page's own words.
Before deciding there is nothing to document, check what the docs already say. Search the mapped pages for the behavior the diff touches, and compare each statement with the code after the change. A statement the change made false is an item on the list, even when the code change is only a docstring or comment: docs often repeat the old docstring's wording, and it is now wrong.
If the list is still empty, the change needs no docs. Typical cases: an internal refactor, a fix that restores documented behavior, a change to log text. Record the reason (the automation's NOOP line) and stop. Do not write something because a file changed.
For each mapped pair:
git diff main..HEAD -- <source_file>For each item on the Step 5 list, find where the page already covers it, if anywhere. The profile's Section vocabulary names the sections this repo's pages use and what each is built from; check each one that applies:
<ParamField> entriesEach item on the Step 5 list goes in the one place a reader would look for it, in the page's existing format. STYLE.md's "Changing Existing Pages" table gives the expected size of each kind of edit: a new parameter is one entry, with no Note, no example, and no overview change.
<ParamField> or table row.<ParamField> tags, use them; if it uses tables, use tables.When source marks something deprecated — a DeprecationWarning, a
@deprecated decorator, a docstring note, or a removal version — the doc entry
for it says so too, in the format STYLE.md gives. Mark the entry itself rather
than adding a separate note elsewhere on the page.
Pages other than the mapped ones can be made wrong by the change. Search
DOCS_PATH (the profile's Guide directories, plus api-reference/) for
each of these:
DOCS_PATH. For each
snippet or instruction you find, trace what it does under the new behavior,
step by step: what runs, what fires, what the user hears. If the result is
now wrong, duplicated, or redundant (for example, the snippet does by hand
what the framework now does by default), fix the snippet.For each guide that references changed code: read it in full, fix the specific references that changed, and don't rewrite its prose. Leave guides alone if they mention the subject but don't use any changed API.
After processing all mapped pairs, check for two kinds of gaps:
Missing pages: Source files that resolved to no doc page (pattern, non-standard table, and search all came up empty) and are not on the skip list. For each, report:
Missing sections: Mapped doc pages missing a section the source implies — a page with no Configuration section for a type that takes constructor parameters, or no options table where the source declares a settings class. Flag these and offer to add them.
If a new page is wanted, follow the profile's New pages section, which provides the page template, the destination path, and every registration step this repo requires (navigation, and any index or support-matrix page). Do all of them: a page that exists but isn't registered is invisible. Follow STYLE.md for the page's structure, and CLAUDE.md in the docs repo for frontmatter.
A new page's title and description become its llms.txt entry and its
citation label in AI tools, and the docs repo's metadata lint enforces them:
- Pipecat suffix (Mintlify appends it). Add a
sidebarTitle when the title runs past 30 chars.og:title if set, else title) — add an
og:title when another page already uses the same short title.Last, re-read each page you edited, in full, as a reader who never saw the diff:
git diff in DOCS_PATHThen run each command in the profile's Checks section, if it has one. Fix every finding on a page you edited, whatever caused it: the docs repo's CI runs the same checks on every page a PR changes and fails the PR on any finding, so this overrides Step 6's rule against editing lines the change didn't make false. Fix each in the page's format and STYLE.md's (types in Python syntax). A finding on a page you didn't edit is yours to fix when this change caused it (a setting the diff added, a default it changed); otherwise leave it and list it under gaps.
Fix anything that fails before continuing.
The docs repo checks in llms.txt (a navigation-ordered index built from each
page's frontmatter) and llms-full.txt (every page's full body). Its metadata
lint fails when either is stale, so regenerate them after any page edit,
docs.json navigation change, or new page.
Prettier reflows MDX and llms-full.txt embeds the page bodies verbatim, so
formatting has to settle before generation:
cd DOCS_PATH
npx prettier --ignore-unknown --write <edited files>
node scripts/gen-llms-txt.mjsCommit the doc edits together with the regenerated llms.txt and
llms-full.txt. Generating before formatting leaves them stale — as does
relying on the repo's pre-commit hook, which formats pages after generation has
already run.
node scripts/docs-meta-lint.mjs reports the same staleness and frontmatter
findings CI will.
After all edits are complete, print a summary:
## Documentation Updates
### Updated reference pages
- `<page path>` — what changed, and in which section
### Updated guides
- `<guide path>` — what changed
### New pages
- `<page path>` — created, plus every place it was registered
### Unmapped source files
- `<source path>` — ClassName (no doc page exists)
### Skipped files
- `<source path>` — whySTYLE.md is the authority on how pages read. These are the minimum when it is absent:
<ParamField>/table entry do.Process:
Before finishing, verify:
llms.txt and llms-full.txt regenerated and committedpipecat-ai/pipecat
d49f309
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.