Skip to content

refactor: migrate protocol + docs tooling into buddy commands#2168

Merged
glennmichael123 merged 1 commit into
mainfrom
refactor/scripts-to-buddy-commands
Jul 24, 2026
Merged

refactor: migrate protocol + docs tooling into buddy commands#2168
glennmichael123 merged 1 commit into
mainfrom
refactor/scripts-to-buddy-commands

Conversation

@glennmichael123

Copy link
Copy Markdown
Member

Per Chris - reusable tooling should be discoverable behind buddy, not loose scripts. Full migration of the protocol governance + docs-freshness tooling out of .github/scripts and into the buddy CLI.

What

  • .github/scripts/{protocol,docs}app/Commands/{protocol,docs}, exposed as 16 buddy protocol:* + 6 buddy docs:* commands.
  • Protocol data (suite/evidence/reports) stays under .github/protocol.
  • Stays as scripts (pre-install / CI-internal, correctly not commands): check-lockfile-version (runs before bun install), check-dependency-commits, deploy/resolve-target.

How

  • Source and destination are the same directory depth, so root + ../../../storage framework-import paths are unchanged. The one exception the fork caught: sync-suite.test.ts's combined ../../protocol ref needed one more ../ (app/Commands and .github/protocol aren't siblings, unlike the .github relocation).
  • Each tool's if (import.meta.main) body → export run(); a small runTool() swaps process.argv so each tool's existing --check/--write parsing works untouched.
  • app/Commands/{Protocol,Docs}.ts register the commands (both flag modes each); package.json (22 scripts) + ci.yml/desktop-lifecycle.yml now invoke buddy <cmd>.

Verification (independently re-run, not just the fork's word)

  • Every command runs; buddy protocol:conformance15 pass / 32 skipped; moved tests 48/0; lint clean; zero lingering .github/scripts/{protocol,docs} refs.
  • The 4 checks that fail locally (protocol:manifest:check, :desktop:check, :craft:check, docs:buddy:check) fail identically on origin/main - missing rfcs git object, env-dependent evidence, machine-path doc noise - and are green in CI. Confirmed the migration changed no evidence-generating logic (only a usage-hint string).

🤖 Generated with Claude Code

@github-actions github-actions Bot added cli @stacksjs/cli docs @stacksjs/docs app deps labels Jul 24, 2026
Per Chris: reusable tooling should be discoverable behind `buddy`, not loose
scripts. Move the protocol governance + docs-freshness tooling out of
.github/scripts and expose it as `buddy protocol:*` (16 commands) and
`buddy docs:*` (6). The protocol suite/evidence data stays under
.github/protocol; the pre-install / CI-internal glue (check-lockfile-version,
check-dependency-commits, deploy/resolve-target) stays as scripts.

- .github/scripts/{protocol,docs} -> app/Commands/{protocol,docs}. Same depth,
  so root + framework-import paths are unchanged; sync-suite.test.ts's combined
  `../../protocol` ref needed one more `../` since app/Commands and
  .github/protocol are not siblings.
- Each tool's `if (import.meta.main)` body extracted to `export run()`; a
  runTool() helper swaps process.argv so each tool's existing --check/--write
  parsing works unchanged.
- app/Commands/{Protocol,Docs}.ts register the commands; package.json + CI now
  invoke `buddy <cmd>`.

Verified: every command runs; protocol:conformance 15/37; moved tests 48/0;
lint clean. The manifest/desktop/craft/docs:buddy checks fail only locally
(missing rfcs git object, env-dependent evidence, machine-path doc noise),
identical on origin/main and green in CI.
@glennmichael123
glennmichael123 force-pushed the refactor/scripts-to-buddy-commands branch from 444c3dc to eb7a3d8 Compare July 24, 2026 08:04
@glennmichael123
glennmichael123 merged commit 460440a into main Jul 24, 2026
8 of 13 checks passed
@glennmichael123
glennmichael123 deleted the refactor/scripts-to-buddy-commands branch July 24, 2026 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app cli @stacksjs/cli deps docs @stacksjs/docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant