design-policy

A command for creating software architecture plans, technology choices, and design decisions from a feature description. It presents system structure, layers, recommended technologies, and design patterns.

In plain words
What is it for?
For planning features such as authentication or real-time notifications, choosing tools for the existing stack, describing data and application layers, and documenting patterns such as separating database access from business logic.
Why use it?
It turns a broad development request into a concrete technical plan. This helps explain how the parts of a system should fit together before coding begins.

Command 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 commands/kewton/commandmate/design-policy
Clone the repo
git clone --depth 1 https://github.com/Kewton/CommandMate

Made for: Claude Code.

Per session 20 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,388 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.00020 $0.01388
Opus 5 $0.00010 $0.00694
Sonnet 5 $0.00004 $0.00278
Haiku 4.5 $0.00002 $0.00139

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

Security

Grade A, and why

design-policy 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 2d 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/design-policy.md · 192 lines

How it starts

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

設計方針作成コマンド

概要

アーキテクチャ設計、技術選定、設計判断を支援するコマンドです。

使用方法

/design-policy [要件概要]

:

/design-policy ユーザー認証機能の追加
/design-policy リアルタイム通知システム

実行内容

あなたはソフトウェアアーキテクトです。以下の観点から設計方針を策定してください:

1. アーキテクチャ設計

システム構成図
graph TD
    Client[クライアント] --> API[Next.js API Routes]
    API --> Auth[認証サービス]
    API --> BL[ビジネスロジック]
    BL --> DB[(SQLite)]
    BL --> Cache[(キャッシュ)]
    BL --> Queue[非同期処理]
レイヤー構成
  • プレゼンテーション層(src/app/
  • ビジネスロジック層(src/lib/
  • データアクセス層(src/lib/db.ts
  • インフラストラクチャ層

2. 技術選定

カテゴリ 選定技術 選定理由
言語/フレームワーク TypeScript/Next.js 14 既存技術スタック
データベース SQLite 軽量、ファイルベース
スタイル Tailwind CSS 既存技術スタック
テスト Vitest/Playwright 高速、型安全
監視/ログ console/file シンプル運用

3. 設計パターン

適用する設計パターンと理由:

Repository パターン

データアクセスを抽象化し、ビジネスロジックとデータ永続化を分離

// src/lib/repositories/worktree-repository.ts
export interface WorktreeRepository {
  findAll(): Promise<Worktree[]>
  findById(id: string): Promise<Worktree | null>
  create(data: CreateWorktreeInput): Promise<Worktree>
  update(id: string, data: UpdateWorktreeInput): Promise<Worktree>
  delete(id: string): Promise<void>
}
Factory パターン

複雑なオブジェクト生成を集約

Service パターン

ビジネスロジックをサービスクラスに集約

4. データモデル設計

ER図
erDiagram
    WORKTREE ||--o{ SESSION : has
    WORKTREE ||--o{ MESSAGE : contains
    SESSION ||--o{ MESSAGE : generates
    WORKTREE {
        string id PK
        string name
        string path
        string branch
        datetime created_at
    }
    SESSION {
        string id PK
        string worktree_id FK
        string status
        datetime started_at
        datetime ended_at
    }
    MESSAGE {
        string id PK
        string worktree_id FK
        string session_id FK
        string role
        text content
        datetime created_at
    }
主要テーブル設計
  • テーブル名、カラム、インデックス

5. API設計

RESTful API
GET    /api/worktrees          - 一覧取得
GET    /api/worktrees/:id      - 詳細取得
POST   /api/worktrees          - 新規作成
PUT    /api/worktrees/:id      - 更新
DELETE /api/worktrees/:id      - 削除

Read the full file on GitHub · 192 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. 2d ago First seen · 192 lines · 20 tokens per session scan A 2bbbb9e6a2f8

Subscribe to this mod's changes

design-policy is a command published in the GitHub repository Kewton/CommandMate (39 stars, last pushed 2d ago), licensed MIT. It adds 20 tokens to every session and 1,388 once invoked, about $0.0001 per session on Opus 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-08-30.