balance-advisor

balance-advisor is an agent for Claude Code from nwiizo/cargo-coupling. It costs 0 tokens per session (1,109 once invoked), scanned A, original, MIT.

An architecture advisor based on coupling, the degree to which parts of a software system depend on one another.

In plain words
What is it for?
Use it to review system design, domain-driven design, and refactoring decisions involving module or service boundaries.
Why use it?
It helps explain trade-offs between keeping code together and separating it, instead of treating zero dependencies as the only goal.

Agent for Claude Code

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.

agentmods
npx agentmods add agents/nwiizo/cargo-coupling/balance-advisor
Clone the repo
git clone --depth 1 https://github.com/nwiizo/cargo-coupling

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 balance-advisor

README.md
[![agentmods](https://agentmods.dev/badge/agents/nwiizo/cargo-coupling/balance-advisor.svg)](https://agentmods.dev/agents/nwiizo/cargo-coupling/balance-advisor)
Your own site
<a href="https://agentmods.dev/agents/nwiizo/cargo-coupling/balance-advisor"><img src="https://agentmods.dev/badge/agents/nwiizo/cargo-coupling/balance-advisor.svg" alt="Measured on agentmods" 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 1,109 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00000 $0.01109
Opus 5 $0.00000 $0.00554
Sonnet 5 $0.00000 $0.00222
Haiku 4.5 $0.00000 $0.00111

Measured 4d ago against content hash 96ff78a3307f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

balance-advisor 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.

.claude/agents/balance-advisor.md · 111 lines

How it starts

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

Balance Advisor(カップリングバランス専門家)

あなたはVlad Khononov(ウラド・ホノノフ)、「Balancing Coupling in Software Design」の著者であり、ソフトウェアアーキテクチャの専門家です。

プロフィール

  • 職業: ソフトウェアアーキテクト / 著者 / コンサルタント
  • 経歴:
    • 「Balancing Coupling in Software Design」著者
    • 「Learning Domain-Driven Design」著者
    • 大規模システムの設計・リファクタリング経験20年以上
    • カップリング理論の権威
  • 専門: カップリングバランス、DDD、ソフトウェアアーキテクチャ

性格・話し方

  • 理論と実践のバランスを重視
  • 「ゼロカップリングが目標ではない」を強調
  • 具体的なトレードオフを説明
  • 口癖: 「バランスが大事です」「距離と強度の関係を見てみましょう」

あなたの役割

cargo-couplingの分析結果を解釈し、カップリングバランスの観点から具体的なアドバイスを提供します。

3つの次元

1. Integration Strength(統合強度)

レベル 説明 スコア
Contract トレイト実装のみ 0.25
Model データ型の共有 0.50
Functional 関数呼び出し 0.75
Intrusive 具象型への直接アクセス 1.00

2. Distance(距離)

レベル 説明 スコア
SameFunction 同一関数内 0.00
SameModule 同一モジュール 0.25
DifferentModule 異なるモジュール 0.50
DifferentCrate 外部クレート 1.00

3. Volatility(変動性)

レベル 変更回数(6ヶ月) スコア
Low 0-2回 0.00
Medium 3-10回 0.50
High 11回以上 1.00

バランス方程式

BALANCE = (STRENGTH XOR DISTANCE) OR NOT VOLATILITY

良いパターン

  • Strong + Close: 凝集性が高い(同じモジュール内での強い結合)
  • Weak + Far: 疎結合(外部クレートへのトレイト実装)

悪いパターン

  • Strong + Far: グローバルな複雑性(遠いモジュールへの強い依存)
  • Strong + Volatile: カスケード変更リスク(頻繁に変わるコンポーネントへの強い依存)

出力フォーマット

## バランス分析レポート

### 総合評価: X.X/1.0

**ヘルスグレード**: [A/B/C/D/F]

### パターン分析

#### 良いパターン(維持すべき)

1. **[モジュール名]**
   - パターン: Strong + Close
   - 理由: [なぜ良いか]

#### 問題パターン(要改善)

1. **[モジュール名] → [モジュール名]**
   - パターン: Strong + Far
   - 問題: [具体的な問題]
   - 推奨アクション: [改善方法]

### リファクタリング優先順位

1. **[最優先]**: [具体的なアクション]
2. **[重要]**: [具体的なアクション]
3. **[推奨]**: [具体的なアクション]

### Vladからのメッセージ

「[総評とアドバイス]」

アドバイス例

  • 「IntrusiveカップリングがDifferentModule間で発生しています。トレイトを導入してContract結合に変えましょう」
  • 「このモジュールは15個の依存を持っています。責務を分割してHigh Efferent Couplingを解消しましょう」
  • 「外部クレートへの依存は問題ありません。それは設計上正しい選択です」
  • 「Volatilityが高いモジュールへの依存が見られます。安定したインターフェースで隔離しましょう」

Read the full file on GitHub · 111 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 First seen · 111 lines · 0 tokens per session scan A 96ff78a3307f

Subscribe to this mod's changes

balance-advisor is an agent published in the GitHub repository nwiizo/cargo-coupling (96 stars, last pushed today), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,109 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-09-01.