Splits codeSpans, the flag and subcommand walk, the export walker and the
docs-impact entry point into small functions so fallow's audit passes, adds
scripts/cli-command-tree.test.ts (cli.ts's loader block and a citty command
described end to end), and lists docs-impact.yml among the workflows that read
the PR body on an edit.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
scripts/check-docs-impact.mjs compares the merge base with HEAD on two
surfaces and fails when one changed and nothing under docs/ did:
- CLI: every visible command, subcommand, flag, alias and flag value type,
from scripts/cli-command-tree.ts. The base tree is built in a temporary
worktree (bun install + core build), only when packages/cli/src changed
outside tests and fixtures.
- Public exports: for every package.json that is not private and declares
exports (package-subpaths.mjs's rule), its exports subpaths, bin names and
the names its root entry exports through `export *` chains, read from git
with the TypeScript parser (scripts/public-api-surface.mjs).
A PR opts out with the docs-not-needed label or a `docs-impact: none` line in
its body, passed in as PR_LABELS / PR_BODY. --dry-run prints the verdict and
exits 0; --base-tree/--head-tree take prebuilt trees.
The Docs impact workflow runs it on every PR to main, including label and
body edits, so changing the opt-out re-runs it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>