/arckit-repo:repo-audit <repo path or URL, plus optional focus and --diagram-format mermaid|plantuml, e.g. 'https://github.com/org/repo security --diagram-format plantuml'>from ArcKit Repository Tooling
Audits a codebase (local or remote GitHub/GitLab) against architecture principles and requirements, surfacing drift, risk, and missing decisions. Supports optional focus area and diagram format flags.
Ships in ArcKit Repository Tooling. Installing the plugin adds it to Claude Code.
Read a real codebase and produce a governance-shaped audit: the as-built architecture, scored against the project's principles and requirements where they exist, with every gap expressed as a proposed ADR.
This is the inverse of the usual ArcKit flow. Instead of generating artefacts that a build will later satisfy, it reads a build that already exists and works backwards to the governance record it should have had.
$ARGUMENTS
These are not negotiable and not subject to a faster alternative.
npm install, pip install, make, go build, cargo, docker build, test runs, or running any script found in the tree. The audit is static reading only. The code is untrusted at the moment it is read, and "just run the build to find out" is precisely the reasoning this rule exists to stop.audits/ directory.Absent with a statement of where you looked.The first token of $ARGUMENTS is the target. Everything after it is optional focus text.
| Input form | Interpretation |
|---|---|
| omitted | Audit the current repository. |
. or a local path | Audit that path. Must be a directory; error if it is a file. |
https://github.com/owner/repo | Public GitHub repo. Shallow clone. |
https://gitlab.com/group/project (any subgroup depth) | Public GitLab repo. Shallow clone. |
git@host:owner/repo.git | SSH form. Clone with the user's existing credentials. |
owner/repo | Ambiguous. Assume GitHub and state that assumption in the summary. |
Strip a trailing .git and any trailing slash before resolving. If --check or --dry-run appears anywhere in the arguments, run in Check mode (Step 7).
Focus text narrows the audit, for example security, dependencies and CI only, data protection. With no focus text, run all dimensions. Flags are not focus text — strip any --* token and its value before treating the remainder as focus.
--diagram-format mermaid|plantuml selects the syntax of the as-built C4 diagram in Step 6. Default: mermaid.
| Value | When to prefer it |
|---|---|
mermaid (default) | The report will be read in the repository it audits. GitHub, GitLab and ArcKit Pages all render Mermaid inline with no toolchain. |
plantuml | Layout quality matters more than portability. C4-PlantUML lays out large container diagrams better and supports directional hints. Needs a PlantUML server, the VS Code extension, or ArcKit Pages to render. |
Accept --diagram-format=plantuml and --diagram-format plantuml. Treat puml and c4-plantuml as synonyms for plantuml, and mmd as a synonym for mermaid. On an unrecognised value, say so, state that you are falling back to mermaid, and continue — never abort the audit over a diagram flag.
Local target. Read it in place. No network, no clone, no confirmation.
Remote target.
Ask before cloning. Show the resolved URL and the destination path. Cloning an arbitrary third-party repo touches the network and writes to disk, so it is never silent.
Clone shallow, into a temporary directory outside the user's project:
git clone --depth 100 --single-branch --no-tags --recurse-submodules=no \
"<URL>" "<TMPDIR>/repo-audit/<slug>"
--depth 100 gives enough history for commit-cadence and contributor signals without a full mirror. Record that history is truncated so nobody reads the commit count as the repo total.
If the clone fails with an authentication error, the repo is private. Say so plainly, and tell the user to clone it themselves and re-run against the local path. Do not prompt for, read, or store credentials. Private repos are out of scope.
Delete the clone once the report is written, unless the user asked to keep it. State in the summary where it went.
Capture for the report before reading anything else:
git -C "<repo>" rev-parse HEAD
git -C "<repo>" rev-parse --abbrev-ref HEAD
git -C "<repo>" rev-list --count HEAD
git -C "<repo>" log -1 --format=%cs
git -C "<repo>" shortlog -sn --all | wc -l
Use bash ${CLAUDE_PLUGIN_ROOT}/scripts/bash/list-projects.sh --json to enumerate projects. If it fails, glob projects/*/ directly rather than failing.
create-project.sh here: it requires ARC-000-PRIN-*.md and will refuse, which would block the audit on a prerequisite this command deliberately does not need. Write the artefact to projects/001-{repo-slug}/audits/, creating the directory directly.${CLAUDE_PLUGIN_ROOT}/references/interview-pattern.md, section 5). Do not guess: with no answer, stop.A project existing in the repo does not mean it describes the code you are auditing. Check before scoring anything against it. Read the candidate's REQ (and PRIN) title, Document Purpose, and a sample of requirements, then judge whether they describe this codebase.
Signals that it does not:
If the evidence is weak or contradictory, use the AskUserQuestion tool to ask: "Project {id}-{name} looks like it describes {summary} rather than this codebase. Audit against it, or run a standalone audit?", offering "Run a standalone audit (Recommended)" and "Audit against the project", as ${CLAUDE_PLUGIN_ROOT}/references/interview-pattern.md sets out. With no answer, run the standalone audit and record that as an assumption in the Audit Scope: it scores nothing against requirements that may belong to another system. A wrong answer here is expensive: it produces a full page of confident Met/Not-met verdicts scoring the code against requirements for an unrelated system.
Record the outcome in the artefact's Audit Scope, whichever way it goes.
Only once 3b confirms correspondence:
| Found | Mode |
|---|---|
| PRIN and/or REQ, confirmed to describe this repo | Conformance — score the codebase against them. |
| Neither, or correspondence not confirmed | Cold — standalone as-built audit. |
If only one of the two exists, score against it and mark the other as not assessed. Do not hard-error on missing prerequisites. A repo audit is often the first thing a user runs, and blocking on artefacts they have not created yet defeats the command.
Do not read the whole repository. Read enough to support every claim.
README, CONTRIBUTING, ARCHITECTURE, CHANGELOG, and anything under docs/ or adr/.package.json, requirements.txt, pyproject.toml, go.mod, Cargo.toml, pom.xml, Gemfile, *.csproj..github/workflows/, .gitlab-ci.yml, azure-pipelines.yml, Jenkinsfile, .circleci/.*.tf, CDK app entrypoints, template.yaml, *.bicep, Helm charts, docker-compose*.yml..specify/memory/constitution.md and specs/*/spec.md, plan.md and tasks.md. They record what the team set out to build, so treat them as design intent, not evidence of what was built.List candidates with rg --files when available, otherwise find. Exclude: .git/, node_modules/, .venv/, vendor/, dist/, build/, target/, coverage/, .next/, __pycache__/, and any minified or generated bundle.
Never open .env, *.pem, *.key, id_rsa*, .npmrc, .pypirc, credential stores, or shell history. If a secret-bearing file is present, that presence is itself a finding; record the path without reading the contents.
Run all ten unless focus text narrows the set. Record any dimension skipped, and why, in the Limitations section.
arckit-agent-architecture overlay as the follow-up.Read the template (user override takes precedence):
.arckit/templates-custom/codebase-audit-template.md.arckit/templates/codebase-audit-template.md${CLAUDE_PLUGIN_ROOT}/templates/codebase-audit-template.md${CLAUDE_PLUGIN_ROOT}/templates/_partials/RENDERING.md and resolve the <!-- DOC-CONTROL-HEADER --> marker in the template before writing. Do not hand-write the Document Control table: the partial RENDERING.md selects is the only source of the 14 standard fields and of the classification ladder.Generate the document ID:
node ${CLAUDE_PLUGIN_ROOT}/scripts/generate-document-id.mjs {PID} CDAU --next-num projects/{P}-{NAME}/audits --filename
CDAU is multi-instance, so a project can hold audits of several repositories. Create projects/{P}-{NAME}/audits/ if it does not exist.
Use the Write tool to save the document. Never emit the full report into the conversation — it will exceed the 32K output token limit.
Populate every section of the template. Specific requirements:
As-Built Architecture carries a C4 container diagram. The template ships the Mermaid form. Emit whichever form --diagram-format selected (Step 1), replacing the template's fenced block entirely rather than adding a second one. Both describe the same model, so derive them from the same component list you evidenced.
mermaid (default) — keep the template's block, fill in the real containers:
```mermaid
C4Container
title Container diagram — {REPO_NAME} (as built)
Person(user, "User")
Container(app, "{Component}", "{Tech}", "{Responsibility}")
ContainerDb(db, "{Store}", "{Tech}", "{What it holds}")
Rel(user, app, "{Interaction}")
```
plantuml — replace the block with C4-PlantUML. The !include line is required, or every Container() macro fails to resolve:
```plantuml
@startuml
!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Container.puml
title Container diagram — {REPO_NAME} (as built)
Person(user, "User")
Container(app, "{Component}", "{Tech}", "{Responsibility}")
ContainerDb(db, "{Store}", "{Tech}", "{What it holds}")
Rel(user, app, "{Interaction}")
@enduml
```
For PlantUML, consult the plantuml-syntax skill for directional layout hints (Lay_D, Lay_R) on diagrams above roughly ten containers — that layout control is the main reason to choose this format. State the chosen format in the summary so the reader knows why the block looks the way it does.
Blocking Decisions is the section that makes this more than a repo summary. Every decision the codebase implies but never records becomes a numbered entry with enough context to file directly via /arckit:adr. If there are none, say so; do not invent them.
Requirements Coverage: where the repository holds Spec Kit specs, use the [ArcKit <ID>] tags in them to map each requirement to its feature, then look for the code that implements the feature. Use only features whose ownership tag, [ArcKit Project NNN], names the project resolved in Step 3 and no other: requirement IDs repeat across projects. List features with no ownership tag, or more than one, under Limitations instead of mapping them. A tag says what a feature set out to do, not that it was done. A feature whose tasks are all checked but whose code you cannot find is a finding. Spec Kit's own per-feature IDs (FR-001) are not ArcKit IDs.
Findings must sort CRITICAL first. Any finding without evidence or an explicit Absent marker is cut before writing.
Limitations must be honest and specific. A reader must not mistake the report for exhaustive.
Then show the user only: the artefact path, the finding counts by severity, the biggest single risk, the count of blocking decisions, and the recommended next command. Nothing else.
With --check or --dry-run: report the resolved target, whether it is local or would be cloned, the detected project, whether that project appears to describe this repository (step 3b) and the mode that follows from it, which artefacts would be scored against, which dimensions would run, and the resolved diagram format. Write nothing, and do not clone.
Check mode is the cheapest way to catch a wrong project before a full run.
Absent./arckit-repo:repo-audit
/arckit-repo:repo-audit https://github.com/org/service security and resilience
/arckit-repo:repo-audit ../other-checkout
/arckit-repo:repo-audit https://gitlab.com/group/subgroup/project --check
/arckit-repo:repo-docs documents a repository. This command judges one./arckit:conformance checks decided-vs-designed conformance across ArcKit artefacts, with no source code involved./arckit:gov-reuse searches UK government repositories for reusable code, scored for reuse candidacy rather than audit./arckit:adr records the blocking decisions this audit surfaces.What the command file sets; muted values are Claude Code's defaults
7-day visitors to each command page
2 commands in this plugin
npx claudepluginhub tractorjuice/arckit-claude --plugin arckit-repoOther plugins' commands for the same job