360 Secure SkillHub
360 安全技能中心

architecture-review

该 Skill 以纯提示词方式提供合并前的架构审查流程,覆盖需求、领域、架构、数据、API、安全、AI、性能、扩展性、成本、运维、可测性、可维护性、故障与可观测性等维度,并给出 0–10 分合并评分卡和反模式清单,用于挑战设计方案和判断生产就绪度。

分类:开发
imadnan4
热度 0.00
最近更新 2026-10-25 14:16:02

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add imadnan4/architect-skills/architecture-review
兼容性
通用兼容
联网要求
不联网
数据出网
数据不出本机
Metadata
name
architecture-review
description
Mandatory PRE-MERGE architecture review. Use before approving or merging any code — run the review dimensions and merge scorecard to challenge design, catch coupling/security/scalability/cost issues, and verify production readiness.
when_to_use
- about to approve or merge code - challenging a design before implementation - running the merge scorecard / architecture review dimensions
license
MIT
metadata
{"version":"0.11","category":"system-design"}
compatibility
OpenCode, Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Cline

Architecture Review Engine

The mandatory review that runs before, during, and after implementation. Writing code is easy; removing bad architecture is expensive. Every implementation must survive this review. A Principal Engineer asks "Should this exist?" — not just "Can I build it?"

Primary rule & thinking loop

Never approve your own first idea. Generate Option A → B → C, compare, choose. Never stop at the first working solution.

Understand → Question → Challenge → Simplify → Validate → Implement → Review → Improve

Repeat until complexity cannot be reduced.

Review dimensions (run before merge)

  • Requirements: clearly defined? measurable? assumptions documented? scope reducible / postponeable / already solved / actually needed?
  • Domain: which capability & domain owns it? duplicated? ownership ambiguous? vocabulary improved?
  • Architecture: tighter coupling? hidden/circular deps? global/shared mutable state? god objects? Should get simpler.
  • Data: single owner? duplicated ownership? normalize/denormalize? transactions? history? audits? indexes? growth (data survives code).
  • API: business capability (not DB structure)? async/event? immediate? pagination/filter/version/ idempotency?
  • Security: authN, authZ, tenant isolation, rate limit, input/output validation, prompt & SQL injection, secrets, encryption, audit logs, least privilege — every answer explicit.
  • AI: needs AI at all? deterministic alternative? retrieval first? tool used? memory stored? context reduced? prompts cached? outputs verified? Best AI call is often no AI call.
  • Performance: expected latency/throughput? largest payload? slowest op? async/stream/batch/cache?
  • Scalability: what breaks first (DB/mem/bandwidth/CPU/queue/storage/network/AI)? scale & fail independently?
  • Cost: infra, per-request AI, storage/embedding growth, bandwidth, logging/tracing — does doubling users double cost? Can cost be bounded?
  • Operations: deployed/monitored/rolled back/upgraded/debugged/restored? Another engineer can fix tonight?
  • Testability: unit/integration/contract/load/security/chaos? deps mockable? (hard-to-test = poor design).
  • Maintainability: new engineer/AI understand it? naming communicates intent? modules shrinkable?
  • Change blast radius: if this changes, how many modules/services/DBs/APIs/teams change? (high = poor boundaries).
  • Failure: DB/Redis/queue/search/LLM/payment/cloud fails → degrade gracefully?
  • Observability: logs/metrics/traces/events/alerts/dashboards? failures diagnosable remotely?
  • Dependency: exists already? maintained? security history? migration & exit strategy? (every dep is a long-term responsibility).
  • Refactor: module shrink? responsibilities separate? interfaces simplify? duplication reduce? Prefer deleting code over adding abstractions.
  • Simplicity: explainable in five minutes? If not, too complex.

Staff & principal questions

  • Staff: Would Stripe build this way? Linear ship it? Shopify approve? Vercel simplify? Netflix isolate? Survive 10× traffic? Think from principles, not imitation.
  • Principal: If I leave tomorrow, will it survive? Can another engineer/AI own & continue it? Reduces future complexity? Makes sense in two years? Architecture is measured in years, not PRs.

Merge scorecard

Score 0–10: Architecture · Security · Performance · Reliability · Maintainability · Scalability · Cost · Observability · Documentation · Testing. Only merge when every critical category meets the team's quality bar.

Final review

Before marking complete: can anything be deleted / simplified? responsibilities clearer? another engineer/AI understand it faster? operational burden / cost / risk / coupling decrease? If yes, keep improving.

Architecture decision tree

About to implement / merge
  ↓
Generate ≥3 options (A/B/C) → choose best, never first idea
  ↓
Run review dimensions (requirements → domain → architecture → data → API → security
  → AI → perf → scale → cost → ops → test → maintain → change → failure → observability
  → dependency → refactor → simplicity)
  ↓
Any critical category below the bar? → YES → challenge & simplify, then re-review
  ↓ NO → merge

Anti-patterns

  • ❌ Approving your own first idea without alternatives
  • ❌ Skipping the review engine for "simple" changes
  • ❌ Treating the merge scorecard as a formality
  • ❌ Implementing vague, unmeasured requirements
  • ❌ Adding a dependency without an exit strategy
  • ❌ Shipping without observability because "it works locally"

Architecture prompts

  • Should this exist at all, or can it be postponed / already solved?
  • Would this survive 10× traffic and two years of new engineers?
  • What is the change blast radius if this breaks?
  • Is the best AI call actually no AI call?
  • Does every critical review category clear the quality bar?