arch-code-review
Strictly reviews code diffs against canonical YAML artifacts for architecture compliance and contract integrity.
Install
mkdir -p .claude/skills/arch-code-review && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/16348" && unzip -o skill.zip -d .claude/skills/arch-code-review && rm skill.zipInstalls to .claude/skills/arch-code-review
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Architecture-aware review against canonical structured YAML artifacts. Read-only workflow; no legacy prose docs.Key capabilities
- →Review diffs against structured YAML artifacts
- →Check for architectural drift and data consistency
- →Validate contract compatibility and side-effect boundaries
- →Prioritize review findings based on correctness and invariants
- →Identify missing tests based on strategy and baseline
- →Generate a verdict with findings, missing tests, and recommendations
How it works
The skill reviews code changes by comparing them against canonical structured YAML artifacts, focusing on architectural components, dependency rules, data models, and invariants. It avoids legacy prose documentation.
Inputs & outputs
When to use arch-code-review
- →Validating code against API contracts
- →Checking architectural drift
- →Reviewing data consistency in YAML artifacts
About this skill
Architecture Code Review — Structured API Only
Goal: review diffs for correctness, drift, data consistency, side-effect boundaries, contract compatibility, and tests using YAML artifacts from the resolved structured docs root.
Structured Artifact API Contract
Legacy prose artifacts are deprecated. Do not create, update, or rely on docs/agent/*.md, scoped prose docs, or generated human-readable Markdown views. Use structured YAML for canonical artifacts. Root AGENTS.md remains a harness interoperability file and may be generated/updated only by workflows that explicitly say so.
Resolved structured docs root:
Treat docs/agent/api as a logical layout rooted at a resolved structured docs root, not a fixed repo path.
Resolution rules:
- Resolve
workspace_rootwithgit rev-parse --show-toplevel 2>/dev/nullor fallback topwd. - Canonicalize
workspace_rootbefore fingerprinting when possible (realpath,pwd -P,Path(...).resolve(), or equivalent). safe-startalways creates and uses the initial repo-local root:<workspace_root>/docs/agent/api.- Review reads repo-local only when
<workspace_root>/docs/agent/apialready exists. - Otherwise read the global overlay root:
~/.pi/agent/workspaces/<workspace-fingerprint>/docs/agent/api. - Compute
<workspace-fingerprint>exactly from canonicalworkspace_root: strip one leading slash/backslash, replace every slash, backslash, and colon with-, then wrap with--. This keeps the same workspace stable. - Example:
/data/data/com.termux/files/home/CodeProjects/pi-mono->--data-data-com.termux-files-home-CodeProjects-pi-mono--. - Do not create new repo-local structured docs in unadopted repos unless the user explicitly asks for repo-local adoption there.
Logical structured layout under the resolved docs root:
repo/
scopes.yaml
repo-inventory.yaml
project-intent.yaml
architecture.yaml
data-flow.yaml
data-model.yaml
invariants.yaml
dependency-rules.yaml
design-issues.yaml
risk-register.yaml
change-guide.yaml
testing-strategy.yaml
validation-baseline.yaml
contracts.yaml
adr.yaml
agent-operating-guide.yaml
scopes/
by-path/<repo-relative-path>/...
by-domain/<slug>/...
Every structured artifact must conform to ../_shared/references/schemas/common.schema.json plus its artifact-specific schema. Do not inline, invent, or vary envelope fields.
Stable IDs required: scope:*, component:*, entity:*, invariant:*, risk:*, contract:*, flow:*, command:*, issue:*, adr:*, testplan:*.
Ownership rules:
scopes: scope routing, ownership, cross-scope discovery only.repo-inventory: file tree, commands index, entry points, external boundaries, configs.validation-baseline: command status, blockers, recommended validation order.project-intent: goals, users, journeys, non-goals, constraints, assumptions.architecture: components, architecture style, side-effect boundaries, high-level flow refs.data-flow: typed flow graph/steps, inputs, outputs, error states.data-model: entities, IDs, schemas, relationships, lifecycles, serialized formats.invariants: rules, forbidden states, enforcement locations, invariant-test refs.dependency-rules: layers, allowed/forbidden dependencies, violations, coupling hotspots.design-issues: structural drift, deferred decisions, ambiguity, ownership gaps.risk-register: failure modes, severity/confidence, affected refs, suggested tests/fixes.contracts: cross-scope APIs, schemas, events, generated clients, DB/file/deployment/env contracts.testing-strategy: test topology, coverage gaps, risk-to-test priorities.change-guide: workflow routing and checklists; references owner artifacts, duplicates no facts.adr: structured decision records with bounded prose fields.agent-operating-guide: structured source for agent operating rules. RootAGENTS.mdmay mirror this in compact harness-readable Markdown when produced by safe-start or codebase-recon Pass 6.
Redundancy rule: define each fact in its owner artifact exactly once. Other artifacts reference IDs.
Prose rule: bounded prose allowed only in summary, notes, rationale, context, decision, recommended_action, and similar scalar fields.
Scope rule: if focus is path-like, read under <docs-root>/scopes/by-path/<focus>/; otherwise under <docs-root>/scopes/by-domain/<slug>/. Always resolve scope from <docs-root>/repo/scopes.yaml when present.
Runtime Schema Loading
When a workflow creates, updates, migrates, or validates structured artifacts, read ../_shared/references/artifact-api.md first. Then read only the shared skill package schemas needed for the artifacts being written:
../_shared/references/schemas/common.schema.json../_shared/references/schemas/<artifact-file-base>.schema.json
Do not read all schemas. Do not use templates. Schemas are runtime API contracts; project docs outside the shared runtime refs are maintainer aids unless the user asks about this package itself.
Structured Artifact Write/Update Protocol
Use this protocol whenever creating or updating YAML artifacts.
1. Scope and owner resolution
- Resolve scope first from task/focus and
<docs-root>/repo/scopes.yamlwhen present. - Path focus uses longest prefix match; domain focus requires explicit domain/contract/task evidence.
- Select the single owner artifact for each fact using the ownership rules above.
- Never duplicate owner facts in router/checklist artifacts; reference stable IDs instead.
2. Read-before-write
- Read the existing target YAML if it exists.
- Read directly referenced owner artifacts needed to preserve refs and avoid duplication.
- If target YAML is absent, create it with the common envelope and artifact-specific top-level keys.
- Preserve unknown fields unless they conflict with this protocol; do not silently drop agent/user-added structured data.
3. Stable ID generation
- Reuse existing IDs whenever the semantic object is the same, even if name/path changed.
- New IDs use deterministic slugs from owner scope + semantic name:
risk:<slug>,entity:<slug>,component:<slug>, etc. - If two objects slug-collide, append shortest stable discriminator from path/component/contract, not a random suffix.
- Never renumber IDs because order changed.
4. Upsert semantics
For each discovered fact/object:
- Match existing record by ID first.
- If no ID match, match by stable source-of-truth fields: path+symbol, contract source path, command string+cwd, entity name+owner scope, rule owner+kind.
- If matched, update only changed fields, append/refresh evidence, and preserve unrelated fields.
- If unmatched, insert new record in deterministic order by ID or explicit
orderfield. - If an existing observed record is no longer supported, do not delete it by default. Mark
status: staleordeprecated, add evidence/unknown explaining why, and link replacement ID when known. - Delete only records known to be accidental duplicates or malformed, and mention deletion in final response.
5. Evidence and confidence
- Every observed record needs at least one evidence ref with file/symbol/command/doc/diff observation.
- Planned records may use
evidence_mode: plannedand confidencelowormedium. - Mixed records must separate observed fields from planned/assumed fields via evidence refs or
unknowns. - Do not upgrade
status: currentor confidencehighwithout source or command evidence.
6. Reference integrity
Before writing final artifacts:
- Check every
*_ref,*_refs, anddepends_onID points to a record in the same artifact set or is explicitly listed as external/unknown. - Prefer adding missing owner records as compact stubs over leaving dangling refs.
- For cross-scope refs, ensure
scopes.yamlandcontracts.yamlidentify owner/consumer relationship. - If ownership is ambiguous, create/update
design-issues.yamlwithkind: ownership_gapand reference it.
7. Status transitions
Allowed transitions:
planned -> partial -> currentcurrent -> stale -> currentcurrent|stale|partial -> deprecated
Rules:
currentrequires sufficient observed evidence for the represented scope.partialmeans useful but incomplete evidence.stalemeans contradicted by newer source evidence or missing source path.deprecatedmeans superseded; includereplacement_refwhen known.
8. Deterministic formatting
- Use YAML with two-space indentation.
- Use stable top-level key order: envelope keys first, artifact-specific keys next.
- Sort unordered arrays by
id; keep ordered flow/checklist arrays byorder. - Use
null,[], or{}consistently rather than omitting required envelope fields. - Keep prose scalar fields concise; no long narrative blocks.
9. Validation before completion
Perform best-effort validation after writing:
- Re-read changed YAML for parse/syntax sanity when practical.
- Validate against the shared schemas by inspection/re-read: envelope keys, artifact-specific top-level keys, required arrays/items, stable ID prefixes, and obvious dangling refs.
- Verify no legacy Markdown artifacts were created or updated by the workflow, except root
AGENTS.mdwhen explicitly produced for harness interoperability. - Report changed YAML files, validation performed, unresolved unknowns, and any intentionally stale/deprecated records.
Invocation
Use this skill directly or use /review-arch as the prompt-template shortcut for architecture-aware diff review.
Rules
- Read-only. Do not edit code or artifacts.
- Review current diff unless user specifies target.
- Do not read legacy prose Markdown docs.
- Read
repo/scopes.yamlfirst if present; match changed paths by longest prefix; then read relevant owner YAML artifacts. - Every finding needs severity, location, evidence, owner artifact refs, why it
Content truncated.
When not to use it
- →When the review requires reading or updating legacy prose documentation
- →When the task involves editing code or artifacts
Limitations
- →The skill is read-only and does not edit code or artifacts
- →It does not read legacy prose Markdown docs
- →Every structured artifact must conform to `../_shared/references/schemas/common.schema.json` plus its artifact-specific schema
How it compares
This skill performs architecture-aware code reviews using only structured YAML artifacts, providing a consistent and machine-readable validation process compared to manual reviews of varied documentation formats.
Compared to similar skills
arch-code-review side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| arch-code-review (this skill) | 0 | 2mo | No flags | Advanced |
| architect-review | 109 | 4mo | No flags | Advanced |
| solid-principles | 57 | 9mo | No flags | Intermediate |
| codex | 32 | 2mo | Review | Advanced |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
architect-review
sickn33
Master software architect specializing in modern architecture patterns, clean architecture, microservices, event-driven systems, and DDD. Reviews system designs and code changes for architectural integrity, scalability, and maintainability. Use PROACTIVELY for architectural decisions.
solid-principles
SmidigStorm
Enforce SOLID principles (Single Responsibility, Open/Closed, Liskov Substitution, Interface Segregation, Dependency Inversion) in object-oriented design. Use when writing or reviewing classes and modules.
codex
Lucklyric
Invoke Codex CLI for complex coding tasks requiring high reasoning capabilities. This skill should be invoked when users explicitly mention "Codex", request complex implementation challenges, advanced reasoning, or need high-reasoning model assistance. Automatically triggers on codex-related requests and supports session continuation for iterative development.
error-handling-patterns
wshobson
Master error handling patterns across languages including exceptions, Result types, error propagation, and graceful degradation to build resilient applications. Use when implementing error handling, designing APIs, or improving application reliability.
deepwiki-rs
sopaco
AI-powered Rust documentation generation engine for comprehensive codebase analysis, C4 architecture diagrams, and automated technical documentation. Use when Claude needs to analyze source code, understand software architecture, generate technical specs, or create professional documentation from any programming language.
senior-fullstack
davila7
Comprehensive fullstack development skill for building complete web applications with React, Next.js, Node.js, GraphQL, and PostgreSQL. Includes project scaffolding, code quality analysis, architecture patterns, and complete tech stack guidance. Use when building new projects, analyzing code quality, implementing design patterns, or setting up development workflows.