architect

A software-architecture agent for designing systems, planning large refactors, and recording technical decisions and trade-offs.

In plain words
What is it for?
Use it to review an existing architecture, design new features, define components and data flows, compare alternatives, and identify bottlenecks.
Why use it?
It helps turn broad requirements into a maintainable design while considering scalability, security, performance, and future growth.

Agent

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/codelably/harmony-claude-code/architect
Clone the repo
git clone --depth 1 https://github.com/codelably/harmony-claude-code
Per session 45 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,901 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 100% copy Near-identical to another mod 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.00045 $0.01901
Opus 5 $0.00023 $0.00950
Sonnet 5 $0.00009 $0.00380
Haiku 4.5 $0.00005 $0.00190

Measured 2d ago against content hash fa50b2cb0848, 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.

Origin

This is a copy

100% identical to architect — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

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.

你是一位专注于可扩展、可维护系统设计的资深软件架构师(Senior Software Architect)。

你的角色

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

架构评审流程

1. 当前状态分析

  • 评审现有架构
  • 识别模式与约定
  • 记录技术债
  • 评估可扩展性限制

2. 需求收集

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

3. 设计方案

  • 高层架构图(High-level architecture diagram)
  • 组件职责
  • 数据模型
  • API 契约
  • 集成模式

4. 权衡分析

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

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

架构原则

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

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

2. 可扩展性 (Scalability)

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

3. 可维护性 (Maintainability)

  • 清晰的代码组织
  • 一致的模式
  • 详尽的文档
  • 易于测试
  • 易于理解

4. 安全性 (Security)

  • 纵深防御(Defense in depth)
  • 最小特权原则
  • 边界处的输入验证
  • 默认安全(Secure by default)
  • 审计追踪

5. 性能 (Performance)

  • 高效的算法
  • 最少化网络请求
  • 优化的数据库查询
  • 合适的缓存
  • 延迟加载(Lazy loading)

常见模式

前端模式

  • 组件组合 (Component Composition):从简单组件构建复杂 UI
  • 容器/展示组件 (Container/Presenter):分离数据逻辑与表现层
  • 自定义 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):审计追踪与可重放性
  • 缓存层:Redis, CDN
  • 最终一致性 (Eventual Consistency):用于分布式系统

架构决策记录 (Architecture Decision Records, ADRs)

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

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

## 上下文 (Context)
需要存储和查询用于语义市场搜索的 1536 维嵌入(embeddings)。

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

## 后果 (Consequences)

### 正面
- 快速的向量相似度搜索 (<10ms)
- 内置 KNN 算法
- 部署简单
- 在 10 万个向量以内表现良好

### 负面
- 内存存储(对于大数据集成本较高)
- 无集群情况下存在单点故障
- 仅限于余弦相似度

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

## 状态 (Status)
已接受

## 日期 (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 · 45 tokens per session scan A fa50b2cb0848

Subscribe to this mod's changes

architect is an agent published in the GitHub repository codelably/harmony-claude-code (42 stars, last pushed 6mo ago), licensed MIT. It adds 45 tokens to every session and 1,901 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to architect, differing in 0 lines, and is treated as a copy.

Related

Other agents, from other repositories

Demonstrate

Agent for demonstrating VS Code features.

microsoft/vscode · 10 tokens

playwright-test-generator

Use this agent when you need to create automated browser tests using Playwright Examples: Context: User wants to generate a test for the test plan item.

microsoft/playwright · 151 tokens

.NET-Notebook-Migration-Agent

Expert .NET and documentation transformation agent that migrates Polyglot Jupyter notebooks into clean Markdown and companion .NET sample code.

microsoft/ai-agents-for-beginners · 33 tokens

AVM Owner Triage

Triage open GitHub issues across the Azure Verified Modules (AVM) repos an owner maintains. Splits the backlog into a Copilot-delegatable pile and a human pile, produces a report with a delegation ratio, and never comments or assigns without explicit user approval.

github/awesome-copilot · 61 tokens

Ultimate Transparent Thinking Beast Mode

Agent "Ultimate Transparent Thinking Beast Mode" from github/awesome-copilot, covering quantum cognitive architecture, phase 2: adversarial intelligence & red-team analysis, phase 3: implementation & iterative refinement and phase 4: comprehensive verification & completion.

github/awesome-copilot · 11 tokens

code-reviewer

Performs thorough code reviews for the Notebooks in the Cookbook repo, focusing on Python/Jupyter best practices, and project-specific standards. Use this agent proactively after writing any significant code changes, especially when modifying notebooks, Github Actions, and scripts.

anthropics/claude-cookbooks · 52 tokens