codebase-arch-governance

codebase-arch-governance is a command for Claude Code from btspoony/mstar-harness. It costs 58 tokens per session (1,259 once invoked), scanned A, original, MIT.

A workflow for simplifying a codebase in complete batches: inspect the current structure, choose a lower-complexity change, move every caller, remove the replaced path, and enforce the resulting rule.

In plain words
What is it for?
Use it to audit architecture, select a focused cleanup, migrate all users of an old path, remove that path, and check that the codebase still follows the intended design.
Why use it?
It prevents half-finished migrations that leave two competing implementations or add abstractions without actually reducing complexity.

Command for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the morning-star-harness plugin — 28 skills, 10 commands, 14 agents, 2 hooks shipped together

Good fit Use it to audit architecture, select a focused cleanup, migrate all users of an old path, remove that path, and check that the codebase still follows the intended design.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/btspoony/mstar-harness/codebase-arch-governance
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/btspoony/mstar-harness

Made for: Claude Code.

Or install morning-star-harness, the plugin that ships this one along with the rest of its 28 skills, 10 commands, 14 agents, 2 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for codebase-arch-governance

README.md
[![agentmods](https://agentmods.dev/badge/commands/btspoony/mstar-harness/codebase-arch-governance/github.svg)](https://agentmods.dev/commands/btspoony/mstar-harness/codebase-arch-governance)
Your own site
<a href="https://agentmods.dev/commands/btspoony/mstar-harness/codebase-arch-governance"><img src="https://agentmods.dev/badge/commands/btspoony/mstar-harness/codebase-arch-governance/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for codebase-arch-governance

Your own site · 80×15
<a href="https://agentmods.dev/commands/btspoony/mstar-harness/codebase-arch-governance"><img src="https://agentmods.dev/badge/commands/btspoony/mstar-harness/codebase-arch-governance.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 58 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,259 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00058 $0.01259
Opus 5.5 $0.00023 $0.00504
Sonnet 5.5 $0.00012 $0.00252
Haiku 4.5 $0.00006 $0.00126

Measured 4d ago against content hash e2bfbe21e3f9, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

codebase-arch-governance scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/codebase-arch-governance.md · 33 lines

How it starts

The opening of the file, as written. The whole thing — 33 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Architecture Governance

Entry

  • Work mode: direct · writable
  • View: fullstack-dev
  • Boot: drt → mstar-harness-core → references/entry-contract.md → mstar-roles → references/fullstack-dev-shared.md → mstar-coding-behavior → references/architecture-governance.md · mstar-conventions (path symbols) · mstar-audit → references/codebase-audit.md § scope variants (simplify) as the ranking rubric · mstar-doc-corpus → references/adr.md when a structural decision is promoted
  • Exit: AC evidence report

Governance, not a rewrite: the codebase is converged batch by batch, and every batch leaves the product working with one path per semantic. A batch that adds an abstraction, directory or interface without migrating its callers, or that leaves the replaced implementation alive beside the new one, is not progress and is rejected.

Procedure SSOT → mstar-coding-behavior → references/architecture-governance.md (target state, the seven properties and their owners, closed-batch conditions, batch selection by total complexity, rejected moves, stop conditions).

Execute

  1. Discover. Resolve the round's budget once before any batch: rounds N (a positive integer) when the invocation states it, one batch when it does not; a value that is not a positive integer is refused with the offending value and both retries (omit the token, or pass a positive integer such as rounds 1). Then perform the recon of mstar-coding-behavior → references/architecture-governance.md § Recon in this session, over the whole codebase or over the path|subsystem scope when that token is given; a recon that cannot be completed stops here, names the missing evidence and the read that would close it, and selects no batch — reported in the response with nothing written when dry-run was given. Then rank candidate moves from that recon by the simplify rubric (mstar-audit → references/codebase-audit.md), keeping only evidence the reads produced and only candidates inside the path|subsystem scope when that token is given. dry-run returns the six inventories with the ranked candidates and the already-observed baseline in the response, then exits, writing nothing — no audit run directory, report or evidence file, scout dispatch, issue capture, ADR write, edit, or claimed net-complexity figure. Otherwise run the same pass as a read-only audit, keep its evidence, and record the six inventories in the response or a reused audit report.
  2. Select one batch. Take the candidate with the lowest total complexity per mstar-coding-behavior → references/architecture-governance.md § Choosing the batch, and drop every candidate its § Not a finding list rejects. One batch per round.
  3. Publish the AC list. Before the first edit, publish the batch's AC from the closed-batch conditions — every live caller accounted for, the replaced path absent, the behaviour baseline observed, the rule landed on a constraint or recorded as an authorized residual — plus the behaviour-preservation gates of mstar-audit/references/codebase-audit.md § Write the report. A caller the batch cannot migrate rejects the whole move; the old path is never kept alive beside the new one.
  4. Execute and lock. Land the settled rule on the strongest available constraint (constraint-ladder.md) or record an authorized residual. A batch that is not a complete move is not progress and is not reported as one.
  5. Next batch. Record the batch's net complexity, then check the round's budget — the only stop that needs no fresh candidate list; spent, the round ends. If it remains, re-run discovery over the current tree and only then apply the candidate stops (no eligible move, or the next move needs a decision), so an accepted batch can make a move eligible that the previous ranking could not see. Invoking this command opts into the batches its budget allows without a confirmation prompt between them; it is never approval for a merge (that authorization belongs to the delivery path), a destructive migration, or a product or architecture decision. A destructive migration or a required product or architecture decision captures an issue and ends the round per that reference's § Stop conditions.

Read the full file on GitHub · 33 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago Changed · +2 lines e2bfbe21e3f9
  2. 6d ago First seen · 31 lines · 58 tokens per session scan A c13a4f04bb70

Subscribe to this mod's changes

codebase-arch-governance is a command published in the GitHub repository btspoony/mstar-harness (74 stars, last pushed today), licensed MIT. It adds 58 tokens to every session and 1,259 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-11-29.

Related

codebase-arch-governance compared with commands from other repositories

codebase-arch-governance next to 6 commands from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
codebase-arch-governancebtspoony/mstar-harnessCommand74todayMITA58Claude Code
auditopenplanr/planr-pipelineCommand22mo agoMITA0Claude Code
check-filedavepoon/buildwithclaudeCommand3.8ktodayMITA21Claude Code
refactor-codecentminmod/my-claude-code-setupCommand2.8k12d agoMITC0Claude Code
branch-reviewhamr0/liteagentsCommand288d agoApache-2.0A0Claude Code
review-specZts0hg/codexspecCommand72d agoMITA19Claude Code
mainframe-review-branchCATWILLgh/MAINFRAMECommand22d agoMITA0Claude Code