docs(cli): remove duplicate docs/CLI-TOOLS.md + lint anti-regression

Phase 0.1 — single source of truth for CLI Tools documentation.

`docs/CLI-TOOLS.md` was a 492-line copy frozen at v3.0.0-rc.16 (13 tools,
outdated provider tables). The current source of truth is
`docs/reference/CLI-TOOLS.md` (v3.8.0, 17 tools, referenced by CLAUDE.md
and every cross-doc link in docs/).

Changes:
- delete docs/CLI-TOOLS.md (no remaining references; all docs already
  pointed at docs/reference/CLI-TOOLS.md)
- scripts/check/check-docs-sync.mjs: add anti-regression check that
  fails if a legacy superseded doc reappears

Verified: \`npm run check:docs-sync\` passes; rg shows zero remaining
references to the legacy path outside _references/ and _tasks/.

Refs: _tasks/features-v3.8.0/cli/fase-0-preparacao/0.1-limpar-docs-duplicada.md
This commit is contained in:
diegosouzapw
2026-05-14 20:27:40 -03:00
parent 4fe2ef8887
commit cfc83e2fd8
2 changed files with 12 additions and 492 deletions

View File

@@ -244,6 +244,18 @@ try {
checkI18nMirrorFile("llm.txt", llmPath);
// CHANGELOG.md mirrors are translations — check version sections and size, not exact content
checkI18nChangelogFile(changelogPath);
// Anti-regression: legacy duplicate docs that have been superseded must not return.
// Use docs/reference/* as the source of truth.
const supersededDocs = [{ legacy: "docs/CLI-TOOLS.md", current: "docs/reference/CLI-TOOLS.md" }];
for (const { legacy, current } of supersededDocs) {
const legacyAbs = path.resolve(cwd, legacy);
if (fs.existsSync(legacyAbs)) {
fail(
`legacy duplicate ${legacy} reappeared — use ${current} instead (single source of truth)`
);
}
}
} catch (error) {
fail(error instanceof Error ? error.message : String(error));
}