architect

architect is an agent for Claude Code from zhukunpenglinyutong/ai-max. It costs 40 tokens per session (1,692 once invoked), scanned A, original, MIT.

A software architecture guide for planning how an application is organised, changed, and scaled. It reviews existing systems and records design decisions, trade-offs, and possible future problems.

In plain words
What is it for?
Use it to design new features, plan large refactors, review system structure, compare technical options, and consider performance, security, data flow, and future growth.
Why use it?
It helps avoid inconsistent code, hidden technical debt, and designs that become difficult or expensive to extend. It also makes the reasoning behind major technical choices easier to follow.

Agent for Claude Code

Written for Claude Code: a Claude Code subagent (agents/*.md). Also seen: model in frontmatter.

Good fit Use it to design new features, plan large refactors, review system structure, compare technical options, and consider performance, security, data flow, and future growth.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/zhukunpenglinyutong/ai-max/architect
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/zhukunpenglinyutong/ai-max

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 architect

README.md
[![agentmods](https://agentmods.dev/badge/agents/zhukunpenglinyutong/ai-max/architect/github.svg)](https://agentmods.dev/agents/zhukunpenglinyutong/ai-max/architect)
Your own site
<a href="https://agentmods.dev/agents/zhukunpenglinyutong/ai-max/architect"><img src="https://agentmods.dev/badge/agents/zhukunpenglinyutong/ai-max/architect/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 architect

Your own site · 80×15
<a href="https://agentmods.dev/agents/zhukunpenglinyutong/ai-max/architect"><img src="https://agentmods.dev/badge/agents/zhukunpenglinyutong/ai-max/architect.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
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,692 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.00040 $0.01692
Opus 5 $0.00020 $0.00846
Sonnet 5 $0.00008 $0.00338
Haiku 4.5 $0.00004 $0.00169

Measured 10d ago against content hash 01b51039e499, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, 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 10d 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.

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. 权衡分析

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

  • 优点:好处和优势
  • 缺点:缺点和限制
  • 替代方案:考虑的其他选项
  • 决定:最终选择和理由

架构原则

1. 模块化与关注点分离

  • 单一职责原则
  • 高内聚,低耦合
  • 组件间清晰的接口
  • 独立可部署性

2. 可扩展性

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

3. 可维护性

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

4. 安全性

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

5. 性能

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

常见模式

前端模式

  • 组件组合:从简单组件构建复杂 UI
  • 容器/展示:分离数据逻辑和展示
  • 自定义 Hooks:可复用的状态逻辑
  • Context 全局状态:避免属性穿透
  • 代码分割:懒加载路由和重型组件

后端模式

  • 仓储模式:抽象数据访问
  • 服务层:业务逻辑分离
  • 中间件模式:请求/响应处理
  • 事件驱动架构:异步操作
  • CQRS:分离读写操作

数据模式

  • 规范化数据库:减少冗余
  • 反规范化以提高读取性能:优化查询
  • 事件溯源:审计跟踪和可重放性
  • 缓存层:Redis、CDN
  • 最终一致性:用于分布式系统

架构决策记录 (ADR)

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

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

## 背景
需要存储和查询 1536 维的嵌入向量用于语义市场搜索。

## 决定
使用具有向量搜索能力的 Redis Stack。

## 后果

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

### 负面
- 内存存储(大数据集成本高)
- 无集群时单点故障
- 仅限余弦相似度

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

## 状态
已接受

## 日期
2025-01-15

系统设计检查清单

设计新系统或功能时:

功能需求

  • 用户故事已记录
  • API 契约已定义
  • 数据模型已指定
  • UI/UX 流程已映射

非功能需求

  • 性能目标已定义(延迟、吞吐量)
  • 可扩展性需求已指定
  • 安全需求已识别
  • 可用性目标已设定(正常运行时间 %)

技术设计

  • 架构图已创建
  • 组件职责已定义
  • 数据流已记录
  • 集成点已识别
  • 错误处理策略已定义
  • 测试策略已规划

运维

  • 部署策略已定义
  • 监控和告警已规划
  • 备份和恢复策略
  • 回滚计划已记录

危险信号

注意这些架构反模式:

  • 大泥球:没有清晰结构
  • 金锤:对所有问题使用相同解决方案
  • 过早优化:优化太早
  • 非我发明:拒绝现有解决方案
  • 分析瘫痪:过度规划,构建不足
  • 魔法:不清晰、未记录的行为
  • 紧耦合:组件过度依赖
  • 上帝对象:一个类/组件做所有事情

项目特定架构(示例)

AI 驱动的 SaaS 平台架构示例:

当前架构

  • 前端:Next.js 15(Vercel/Cloud Run)
  • 后端:FastAPI 或 Express(Cloud Run/Railway)
  • 数据库:PostgreSQL(Supabase)
  • 缓存:Redis(Upstash/Railway)
  • AI:具有结构化输出的 Claude API
  • 实时:Supabase 订阅

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. 10d ago First seen · 212 lines · 40 tokens per session scan A 01b51039e499

Subscribe to this mod's changes

architect is an agent published in the GitHub repository zhukunpenglinyutong/ai-max (335 stars, last pushed 7mo ago), licensed MIT. It adds 40 tokens to every session and 1,692 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.