add-backend-architecture
Guides backend architecture decisions — over-engineering, folder structure, slices, layers, feature organization, where code goes.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Guides backend architecture decisions — over-engineering, folder structure, slices, layers, feature organization, where code goes.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Consolidated view of the add-pro ecosystem - commands, skills, relationships and dependencies. Loaded by /add as source of truth.
Source of truth for ADD doc rules, depth floors, IDs, refs, validation gate. Load before any doc write.
Use when running agent-judged QA validation (read-PNG by default; the playwright plugin adds live driving) — the Level C judge rubric, severity taxonomy, dual-judge (@ux-agent review ∥ @qa-agent) method, report schema/template, and the config.json/screens.json formats. Consumed by /add.qa and both judges.
Use when a state-materializing command starts or is asked to upgrade — reads the setup receipt, compares the recorded contract against the shipped one, executes the declared upgrade deltas sequentially, and rewrites the receipt even on a verified-current no-op. Consumed by /add.qa-setup STEP 1.5 and STEP 11.
Internal skill for developing ADD framework artefacts (commands, skills, agents, scripts). Use when add-framework--plan analyzes viability of new framework features, when add-framework--build implements framework artefacts, or when creating/modifying commands, skills, or agents. Always use this skill before proposing or implementing changes to the framework itself.
Use when building, styling, or theming UI components, pages, layouts, dashboards, charts, tables, or forms for SaaS products.
| name | add-backend-architecture |
| description | Guides backend architecture decisions — over-engineering, folder structure, slices, layers, feature organization, where code goes. |
Guide architectural decisions for backend projects. Language and framework agnostic. Choose between Vertical Slice, Clean Architecture, Simple Modular, or a Combined strategy based on project context.
Use for: Choosing architecture patterns, organizing features, structuring folders, deciding boundaries, avoiding over-engineering.
add-backend-development insteadadd-project-scaffolding insteadadd-architecture-discovery insteadadd-frontend-architecture insteadThe right architecture is the simplest one that handles your actual complexity.
Most projects fail not from too little architecture, but from too much too early. A 3-endpoint CRUD API does not need hexagonal architecture. A complex multi-provider AI platform does not survive with flat files.
The goal: match structural investment to actual complexity.
Before recommending any pattern, assess context, match to the Decision Matrix, load the relevant reference file, apply to the user's specific case, and watch for drift during implementation. Always explain the why behind the recommendation.
| Context | Architecture | Why |
|---|---|---|
| Small scale, few integrations, simple domain | Simple Modular | Anything more is waste |
| Medium scale, feature-focused growth, moderate integrations | Vertical Slice | Feature cohesion, low coupling, fast delivery |
| Complex domain, heavy integrations, high provider volatility | Clean Architecture | Strong isolation, testability, provider independence |
| Medium-large scale, moderate integrations with some volatility | Combined (VSA + Clean) | VSA for features, Clean principles for external boundaries |
Each pattern has detailed guidance in a reference file. Read only the one that fits the project context.
For small projects where Vertical Slice or Clean Architecture would be overkill. Organize by feature/module, not by technical layer. No separate reference file — guidance below is complete.
src/modules/{feature}/{feature}.{routes,service,repository}.ts
src/shared/{database,errors}.ts
Rules:
Graduate when "services calling services" creates confusion, or when external integrations appear that you might want to swap.
For medium projects focused on feature delivery and isolation. Organize by use case, not by layer — each slice owns everything it needs.
Read: references/vertical-slice.md for complete guidance.
src/features/{domain}/{use-case}/{use-case}.{handler,http,schema,spec}.ts
src/shared/{database,logger}.ts
For projects with complex domains, heavy external integrations, or high provider volatility. Dependencies point inward: domain knows nothing about infrastructure.
Read: references/clean-architecture.md for complete guidance.
src/domain/{entities,value-objects,errors}/
src/application/{use-cases,ports}/
src/infrastructure/{adapters,persistence,providers}/ src/presentation/{http,middleware}/
For medium-to-large projects that need feature cohesion AND external boundary isolation. Vertical Slice for feature organization, Clean principles for external boundaries.
Read: references/combined-strategy.md for complete guidance.
src/features/{domain}/{use-case}/ (handler + http + business contracts + adapters)
src/technical/{ai,payments,…}/{contracts,adapters}/
src/composition/register-dependencies.ts
Seven rules apply across all patterns (feature-over-layer, thin endpoints, business logic isolation, external provider isolation, shared folder discipline, cross-feature communication, testing strategy).
Read: references/universal-rules.md for the full list.