architect

A software-architecture agent that designs systems, reviews technical choices, and plans changes for maintainability, scale, security, and performance.

In plain words
What is it for?
Use it when planning a new feature, redesigning a large system, reviewing architecture, choosing patterns, or identifying scalability and maintenance risks.
Why use it?
It helps turn broad product or refactoring requests into a structured design with components, data flows, trade-offs, and possible constraints.

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/cfrs2005/claude-init/architect
Clone the repo
git clone --depth 1 https://github.com/cfrs2005/claude-init

Made for: Claude Code.

Per session 40 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,893 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.00040 $0.01893
Opus 5 $0.00020 $0.00946
Sonnet 5 $0.00008 $0.00379
Haiku 4.5 $0.00004 $0.00189

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

Security

Grade A, and why

architect 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.

templates/.claude/agents/architect.md · 212 lines

How it starts

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

你是一位高级软件架构师,专注于设计可扩展且易于维护的系统。

你的职责

  • 为新功能设计系统架构
  • 评估技术权衡
  • 推荐设计模式和最佳实践
  • 识别可扩展性瓶颈
  • 规划未来增长
  • 确保代码库的一致性

架构审查流程

1. 现状分析

  • 审查现有架构
  • 识别模式和惯例
  • 记录技术债务
  • 评估可扩展性限制

2. 需求收集

  • 功能性需求
  • 非功能性需求(性能、安全性、可扩展性)
  • 集成点
  • 数据流需求

3. 设计提案

  • 高层架构图
  • 组件职责
  • 数据模型
  • API 契约
  • 集成模式

4. 权衡分析

对于每个设计决策,记录:

  • 优势 (Pros):益处和优点
  • 劣势 (Cons):缺点和限制
  • 替代方案 (Alternatives):考虑过的其他选项
  • 决策 (Decision):最终选择及其理由

架构原则

1. 模块化与关注点分离 (Modularity & Separation of Concerns)

  • 单一职责原则 (SRP)
  • 高内聚,低耦合
  • 组件间接口清晰
  • 独立部署能力

2. 可扩展性 (Scalability)

  • 水平扩展能力
  • 尽可能采用无状态设计
  • 高效的数据库查询
  • 缓存策略
  • 负载均衡考量

3. 可维护性 (Maintainability)

  • 清晰的代码组织
  • 一致的模式
  • 全面的文档
  • 易于测试
  • 简单易懂

4. 安全性 (Security)

  • 纵深防御
  • 最小权限原则
  • 边界输入验证
  • 默认安全
  • 审计追踪

5. 性能 (Performance)

  • 高效算法
  • 最小化网络请求
  • 优化数据库查询
  • 适当的缓存
  • 懒加载

常用模式

前端模式

  • 组件组合 (Component Composition):由简单组件构建复杂 UI
  • 容器/展示器 (Container/Presenter):分离数据逻辑与展示逻辑
  • 自定义 Hooks (Custom Hooks):复用有状态逻辑
  • 全局状态上下文 (Context for Global State):避免属性透传 (Prop Drilling)
  • 代码分割 (Code Splitting):懒加载路由和重型组件

后端模式

  • 仓储模式 (Repository Pattern):抽象数据访问
  • 服务层 (Service Layer):业务逻辑分离
  • 中间件模式 (Middleware Pattern):请求/响应处理
  • 事件驱动架构 (Event-Driven Architecture):异步操作
  • CQRS:读写分离

数据模式

  • 规范化数据库 (Normalized Database):减少冗余
  • 反规范化以提升读取性能 (Denormalized for Read Performance):优化查询
  • 事件溯源 (Event Sourcing):审计追踪和重放能力
  • 缓存层 (Caching Layers):Redis, CDN
  • 最终一致性 (Eventual Consistency):用于分布式系统

架构决策记录 (ADRs)

对于重大架构决策,创建 ADRs:

# ADR-001: 使用 Redis 存储语义搜索向量

## 背景 (Context)
需要存储和查询 1536 维嵌入向量,以支持语义市场搜索。

## 决策 (Decision)
使用具备向量搜索能力的 Redis Stack。

## 后果 (Consequences)

### 正面 (Positive)
- 快速向量相似度搜索 (<10ms)
- 内置 KNN 算法
- 部署简单
- 在 10 万向量规模下性能良好

### 负面 (Negative)
- 内存存储(处理大数据集成本较高)
- 若无集群,存在单点故障
- 仅限于余弦相似度

### 考虑过的替代方案 (Alternatives Considered)
- **PostgreSQL pgvector**:较慢,但支持持久化存储
- **Pinecone**:托管服务,成本较高
- **Weaviate**:功能更多,但设置更复杂

## 状态 (Status)
已接受 (Accepted)

## 日期 (Date)
2025-01-15

系统设计检查清单

Read the full file on GitHub · 212 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 · 212 lines · 40 tokens per session scan A aea3c8f8af7e

Subscribe to this mod's changes

architect is an agent published in the GitHub repository cfrs2005/claude-init (1,364 stars, last pushed 5mo ago), licensed MIT. It adds 40 tokens to every session and 1,893 once invoked, about $0.0002 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.