Skip to content

docs: fix CLI reference drift, add ARCH-016 subcommand coverage rule#305

Merged
rhuanbarreto merged 2 commits into
mainfrom
docs/fix-cli-reference-drift
May 11, 2026
Merged

docs: fix CLI reference drift, add ARCH-016 subcommand coverage rule#305
rhuanbarreto merged 2 commits into
mainfrom
docs/fix-cli-reference-drift

Conversation

@rhuanbarreto

Copy link
Copy Markdown
Contributor

Summary

  • Fix documentation drift in adr.mdx and upgrade.mdx (EN + pt-br) — adr import, adr sync subcommands were undocumented; upgrade incorrectly described as npm-only
  • Create ARCH-016 (CLI Subcommand Documentation Accuracy) with companion rule subcommand-has-docs-heading that mechanically enforces every subcommand file has a matching heading in the parent .mdx page
  • Update skill reference (commands.md in archgate/plugins) with all missing content: --log-level global option, opencode editor choice, adr import/sync, doctor, telemetry subcommands, accurate upgrade description (separate repo, committed there)

Drift fixed

Surface Gap Fix
adr.mdx (EN + pt-br) Missing adr import and adr sync Added full subcommand docs
upgrade.mdx (EN + pt-br) Said "npm install" — actual is auto-detect binary/proto/PM Rewrote with install-method table
Skill reference commands.md (4 copies) Missing --log-level, opencode, adr import/sync, doctor, telemetry detail Updated all 4 copies (plugins repo)

New enforcement (ARCH-016)

The companion rule subcommand-has-docs-heading checks both directions:

  1. Code → docs: Every src/commands/<parent>/<sub>.ts must have a ## archgate <parent> <sub> heading in <parent>.mdx
  2. Docs → code: Every such heading must correspond to an actual subcommand file

This complements ARCH-015 (top-level command ↔ page parity) to give full two-level coverage.

Test plan

  • bun run validate passes (lint, typecheck, format, test, ADR check including new ARCH-016 rule, knip, build)
  • ARCH-016 rule detects undocumented subcommands (remove a heading from adr.mdx and verify archgate check fails)
  • ARCH-016 rule detects orphan headings (add a fake heading and verify archgate check fails)
  • pt-br docs match EN structure (GEN-002 i18n-page-parity rule passes)

rhuanbarreto and others added 2 commits May 11, 2026 22:53
The CLI reference docs drifted from the actual commands after `adr import`
and `adr sync` shipped without documentation updates. The `upgrade` docs
also inaccurately described the upgrade mechanism as npm-only.

Fixes:
- adr.mdx (EN + pt-br): add `archgate adr import` and `archgate adr sync`
  subcommand sections with arguments, options, and examples
- upgrade.mdx (EN + pt-br): rewrite to accurately describe the auto-detecting
  upgrade system (binary, proto, local dev dep, global PM)

New ADR:
- ARCH-016 (CLI Subcommand Documentation Accuracy): enforces that every
  subcommand file at `src/commands/<parent>/<sub>.ts` has a matching heading
  in the parent's `.mdx` reference page, and vice versa. Companion rule
  `subcommand-has-docs-heading` runs as part of `bun run validate`.

Signed-off-by: Rhuan Barreto <rhuan@barreto.work>
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented May 11, 2026

Copy link
Copy Markdown

Deploying archgate-cli with  Cloudflare Pages  Cloudflare Pages

Latest commit: c71db14
Status: ✅  Deploy successful!
Preview URL: https://8bb40f4e.archgate-cli.pages.dev
Branch Preview URL: https://docs-fix-cli-reference-drift.archgate-cli.pages.dev

View logs

@sentry

sentry Bot commented May 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@rhuanbarreto rhuanbarreto merged commit 4da1326 into main May 11, 2026
12 checks passed
@rhuanbarreto rhuanbarreto deleted the docs/fix-cli-reference-drift branch May 11, 2026 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant