review-architecture

review-architecture is a command for Claude Code from nwiizo/ccswarm. It costs 0 tokens per session (900 once invoked), scanned A, original, MIT.

An architecture review command for checking whether ccswarm follows its documented Rust design patterns. It examines compile-time state handling, message channels, iterator-based code, independent actors, and test scope.

In plain words
What is it for?
Use it during code reviews to check architecture compliance and identify uses of shared locks or missing state-safety patterns.
Why use it?
It helps find design inconsistencies that ordinary compilation or tests may not reveal.

Command for Claude Code

Written for Claude Code: installed under .claude/. Also seen: mentions CLAUDE.md.

Good fit Use it during code reviews to check architecture compliance and identify uses of shared locks or missing state-safety patterns.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/nwiizo/ccswarm/review-architecture
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/nwiizo/ccswarm

Made for: Claude Code.

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 review-architecture

README.md
[![agentmods](https://agentmods.dev/badge/commands/nwiizo/ccswarm/review-architecture/github.svg)](https://agentmods.dev/commands/nwiizo/ccswarm/review-architecture)
Your own site
<a href="https://agentmods.dev/commands/nwiizo/ccswarm/review-architecture"><img src="https://agentmods.dev/badge/commands/nwiizo/ccswarm/review-architecture/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 review-architecture

Your own site · 80×15
<a href="https://agentmods.dev/commands/nwiizo/ccswarm/review-architecture"><img src="https://agentmods.dev/badge/commands/nwiizo/ccswarm/review-architecture.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 900 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.00000 $0.00900
Opus 5 $0.00000 $0.00450
Sonnet 5 $0.00000 $0.00180
Haiku 4.5 $0.00000 $0.00090

Measured 9d ago against content hash e483fbef9dd9, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

review-architecture 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 9d 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.

.claude/commands/review-architecture.md · 155 lines

How it starts

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

Architecture Review

Reviews ccswarm's architecture pattern compliance in detail.

Execution Content

Based on CLAUDE.md and docs/ARCHITECTURE.md, verify compliance with the following patterns:

  1. Type-State Pattern - Compile-time state verification
  2. Channel-Based Orchestration - Message passing
  3. Iterator Pipelines - Zero-cost abstractions
  4. Actor Model - Lock-free design
  5. Minimal Testing - Minimum necessary tests

Check Items

1. Type-State Pattern

// Expected: Verify state transitions at compile time
struct Agent<S: State> {
    state: PhantomData<S>,
    // ...
}

impl Agent<Uninitialized> {
    fn initialize(self) -> Agent<Ready> { ... }
}

impl Agent<Ready> {
    fn execute(self, task: Task) -> Agent<Running> { ... }
}

Search patterns:

grep -r "PhantomData" crates/
grep -r "impl.*<.*State>" crates/

2. Channel-Based Orchestration

// Expected: Prefer Channel over Arc<Mutex>
let (tx, rx) = tokio::sync::mpsc::channel(100);

// Avoid:
// let shared = Arc::new(Mutex::new(state));

Search patterns:

grep -r "Arc<Mutex" crates/ | wc -l  # Lower is better
grep -r "mpsc::channel\|broadcast::channel" crates/

3. Iterator Pipelines

// Expected: Zero-cost abstractions with iterator chains
let results: Vec<_> = items
    .iter()
    .filter(|x| x.active)
    .map(|x| process(x))
    .collect();

// Avoid:
// for item in items { if item.active { ... } }

4. Actor Model

// Expected: Each agent as an independent actor
struct AgentActor {
    receiver: mpsc::Receiver<Message>,
}

impl AgentActor {
    async fn run(mut self) {
        while let Some(msg) = self.receiver.recv().await {
            self.handle(msg).await;
        }
    }
}

5. Minimal Testing

Criteria Expected Value
Total tests Around 8-10
Integration tests Core functionality only
Unit tests Complex logic only

Output Format

{
  "patterns": {
    "type_state": {
      "status": "OK|PARTIAL|NG",
      "usage_count": N,
      "examples": ["Agent<Ready>", "Session<Connected>"],
      "missing": ["recommended application areas"]
    },
    "channel_based": {
      "status": "OK|PARTIAL|NG",
      "channel_count": N,
      "arc_mutex_count": N,
      "refactor_candidates": ["candidates for channel conversion"]
    },
    "iterator_pipelines": {
      "status": "OK|PARTIAL|NG",
      "iterator_usage": N,
      "loop_usage": N,
      "refactor_candidates": ["candidates for iterator conversion"]
    },
    "actor_model": {
      "status": "OK|PARTIAL|NG",
      "actor_count": N,
      "message_types": ["TaskMessage", "StatusMessage"]
    },
    "minimal_testing": {
      "status": "OK|PARTIAL|NG",
      "test_count": N,
      "integration_tests": N,
      "unit_tests": N,
      "recommendation": "test addition/removal recommendation"
    }
  },
  "score": "N/5",
  "recommendations": ["priority action items"]
}

Read the full file on GitHub · 155 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. 9d ago First seen · 155 lines · 0 tokens per session scan A e483fbef9dd9

Subscribe to this mod's changes

review-architecture is a command published in the GitHub repository nwiizo/ccswarm (151 stars, last pushed 1mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 900 tokens. 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-08-30.