Logo Backend Architecture Spec

Backend Architecture Spec

Cộng đồng
LuckyOneTwoThree
backend-architecture-spec

Dùng khi thiết kế kiến trúc backend. Tạo tài liệu đặc tả thiết kế kiến trúc backend, tự động đánh giá mẫu kiến trúc dựa trên quy mô kinh doanh, thiết kế phương án phân chia dịch vụ và đánh giá kiến trúc. Có sẵn chức năng ghi lại ADR và nợ kỹ thuật để truy xuất các quyết định. Ưu tiên các ràng buộc kiến trúc, đồng thời đưa ra quyết định về quyền sở hữu dữ liệu dịch vụ và ngăn xếp công nghệ để các bước sau sử dụng. Từ khóa: mẫu kiến trúc, microservices, nguyên khối, Serverless, thiết kế dịch vụ, DDD, bounded context, đánh giá kiến trúc, nợ kỹ thuật, quyết định kiến trúc.

Tổng quan

Nhà phát hànhLuckyOneTwoThree
Kho mãvibe-skill
Tên kỹ năngbackend-architecture-spec
Sao
34
Bản fork
8
Tệp đi kèm
Chỉ có hướng dẫn
Giấy phépMIT
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • Hướng dẫn có đủ mọi thứ cần thiết

    Mọi thứ mô hình cần đều nằm trong hướng dẫn — không có tệp bổ sung cần đồng bộ.

  • Mã nguồn mở

    Được LuckyOneTwoThree công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Backend Architecture Spec trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/LuckyOneTwoThree/vibe-skill/tree/main/.codex/skills/backend-architecture-spec
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/LuckyOneTwoThree/vibe-skill.git /tmp/vibe-skill
mkdir -p .claude/skills
cp -r /tmp/vibe-skill/.codex/skills/backend-architecture-spec .claude/skills/backend-architecture-spec
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Backend Architecture Spec trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Backend Architecture Spec ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Backend Architecture Spec với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

Backend Architecture Design Specification

Core Principles

  1. Appropriate Architecture: Architecture serves business, not technical advancement
  2. Evolutionary Architecture: Start simple, evolve as needed, not all at once
  3. Traceable Decisions: Every architecture decision has clear rationale and context, ADR auto-generated
  4. Visible Tech Debt: Technical debt explicitly registered and managed, not hidden
  5. Architecture Constraints First: Architecture decisions constrain subsequent data models and API design; service data ownership and tech stack decisions must be explicit

Interaction Mode

AI->Human AI suggests, human approves

Input

Input ItemTypeRequiredSourceDescription
PRDmarkdownYesoutput/pm-design/design-prd/prd.mdBusiness domain and processes
PRD Structured DataJSONYesoutput/pm-design/design-prd/prd.jsonMachine-consumable PRD version for architecture review alignment check
Business ScaleJSONYesUser providedUser count, QPS, data volume, team size
Technical ConstraintsJSONOUser providedTech stack, ops capability, budget

Execution Steps

Step 1: Architecture Pattern Evaluation and Selection [Core]

Evaluate and recommend architecture patterns (Monolithic/Microservices/Serverless) based on multiple dimensions, generate system topology diagram.

Architecture Evaluation Quantitative Matrix:

Score each candidate architecture pattern across the following dimensions (1-5 points), quantitatively compare and recommend the optimal solution.

Evaluation Dimension1 Point2 Points3 Points4 Points5 Points
ScalabilityNo horizontal scaling, single point bottleneckLimited scaling, requires downtime for capacity expansionSupports vertical scaling, limited horizontal scalingGood horizontal scaling capabilityUnlimited horizontal scaling, automatic elastic scaling
MaintainabilityTightly coupled, changes have wide impactPartially decoupled, core modules coupledModular design, clear boundariesWell decoupled, independently modifiableFully decoupled, services independently deployable and evolvable
Performance ExpectationObvious single-point performance bottleneckMeets low-load requirements basicallyMeets medium load, pressure during peaksMeets high load, locally optimizableMeets extremely high load, full-chain optimizable
SecurityNo isolation, large attack surfaceBasic isolation, blurry boundariesService-level isolation, clear boundariesFine-grained isolation + independent security policiesZero-trust architecture + defense in depth
Deployment ComplexityExtremely simple deployment, single processSimple deployment, few dependenciesModerately complex, needs orchestration toolsComplex, needs complete DevOps systemExtremely complex, needs professional ops team (lower score is better for this dimension)
Team FitnessTeam cannot manageNeeds extensive training to get startedTeam has partial experienceTeam has rich experienceTeam is proficient, has best practices

Composite Score Formula:

Composite Score = Scalability x W1 + Maintainability x W2 + Performance Expectation x W3 + Security x W4 + (6 - Deployment Complexity) x W5 + Team Fitness x W6

Default Weights (adjustable by business type):

Business TypeW1 (Scalability)W2 (Maintainability)W3 (Performance)W4 (Security)W5 (Deployment)W6 (Team)
General/SaaS0.250.200.200.100.100.15
E-commerce0.300.150.250.100.100.10
Finance0.150.150.200.250.100.15

Score Interpretation:

Composite ScoreRecommendation Strategy
>=4.0Recommended, low risk
3.0-3.9Acceptable, monitor low-scoring dimensions and develop compensating measures
2.0-2.9Not recommended, adjust solution or supplement capabilities before re-evaluation
<2.0Rejected, solution not viable

Stage Gate: Architecture pattern and evolution path human-confirmed

Step 2: Architecture Decision Records [Core]

Generate ADR for each architecture decision:

  • Decision background and drivers
  • Alternative options and evaluation
  • Decision result and rationale
  • Impact scope and consequences

ADR Template:

json
{
  "id": "ADR-001",
  "title": "Decision title",
  "status": "proposed | accepted | deprecated | superseded",
  "date": "2025-01-01",
  "context": "Decision background: describe drivers, constraints, and problem statement",
  "alternatives": [
    {
      "name": "Option name",
      "description": "Option description",
      "pros": ["Advantage 1", "Advantage 2"],
      "cons": ["Disadvantage 1", "Disadvantage 2"],
      "evaluation_scores": {
        "scalability": 0,
        "maintainability": 0,
        "performance": 0,
        "security": 0,
        "deployment_complexity": 0,
        "team_fitness": 0
      }
    }
  ],
  "decision": "Final decision result",
  "rationale": "Decision rationale: why this option was chosen over others",
  "consequences": {
    "positive": ["Positive impact 1"],
    "negative": ["Negative impact 1"],
    "risks": ["Risk 1"]
  },
  "affected_services": ["List of affected services"],
  "related_adrs": ["ADR-000"],
  "supersedes": null,
  "superseded_by": null
}

ADR Numbering Rule: Increment in architecture decision order (ADR-001, ADR-002, ...), core architecture decisions are numbered first.

ADR Status Transitions: proposed -> accepted -> (deprecated / superseded), status changes require human confirmation.

Stage Gate: Core architecture decisions 100% have ADR

Step 3: Service Design [Core]

Identify bounded contexts based on Domain-Driven Design, design service division and communication scheme.

Bounded Context Identification Method:

Identify bounded contexts following the three rules below, in descending priority:

Identification RuleDivision BasisIdentification SignalExample
Business DomainEntities within the same business domain aggregate togetherEntities in the same business process, same business rules and invariantsOrder domain (Order/OrderItem/Payment), User domain (User/Profile/Role)
Data OwnershipSame data can only be owned and modified by one contextSame entity has different attribute subsets and lifecycles in different contextsProduct catalog context owns product base info, inventory context owns inventory quantities
Change FrequencyEntities with same change frequency and reason grouped into same contextModules always modified together when requirements changeMarketing rules change frequently, separated from stable product base info

Bounded Context Mapping Template:

json
{
  "contexts": [
    {
      "name": "Context name",
      "description": "Context responsibility description",
      "core_entities": ["List of owned core entities"],
      "ubiquitous_language": ["List of ubiquitous language keywords"],
      "incoming_relations": [
        {
          "from_context": "Upstream context",
          "relationship_type": "Upstream-Downstream|Customer-Supplier|Conformist|Open Host Service|Anti-Corruption Layer",
          "data_flow": "Data flow direction description"
        }
      ]
    }
  ],
  "context_map_summary": "Context mapping overview description"
}

Inter-Context Communication Pattern Selection:

Communication PatternApplicable ScenarioConsistencyComplexityExample
Synchronous Call (HTTP/gRPC)Needs real-time response, low call frequencyStrong consistencyLowUser service queries order service for order list
Asynchronous Message (MQ)No real-time response needed, needs decouplingEventual consistencyMediumOrder creation notifies inventory service for deduction
Event-Driven (Event Sourcing)Needs complete audit trail, multiple downstream consumersEventual consistencyHighPayment completion triggers order status change + notification + points
Shared DatabaseSmall team size, strong data dependency between servicesStrong consistencyLow (short-term)Shared database between modules within monolithic architecture
CQRSLarge read-write model difference, reads far exceed writesEventual consistencyHighProduct list query and product detail use different models

Stage Gate: Each bounded context has clear entity ownership and communication pattern

New Outputs:

  • Service Data Ownership (service_data_ownership.json): Explicitly defines data entities owned by each service/bounded context, for data-architecture-spec to partition data models by service boundaries
  • Tech Stack Decision (tech_stack_decision.json): Unified tech stack decision (language/framework/ORM/database/cache), for all impl Skills to consume uniformly, avoiding each defaulting to different tech stacks

Stage Gate: No circular dependencies between services, data ownership explicit, tech stack decision complete

Step 4: Backend Review [Core]

Review performance, security, maintainability, and scalability, output issue list and fix recommendations.

Note: This stage does not review API and data model alignment (they are not yet designed); focus on reviewing the reasonableness of architecture pattern selection and service boundary division.

Stage Gate: P0 issues=0, architecture decision records complete

Step 5: Tech Debt Registration [Core]

Identify and register technical debt:

  • Extract tech debt from review issues
  • Assess impact scope and fix priority
  • Generate tech debt register
  • Recommend fix pace

Stage Gate: P0 tech debt=0, tech debt register generated

Output

Metadata Output: output/backend-architecture/backend-architecture-spec/

Output Files:

  • architecture_decision.json -- Architecture plan + topology diagram
  • adr.json -- Architecture Decision Records
  • service_design.json -- Service division + context mapping
  • service_data_ownership.json -- Data entities owned by each service/bounded context, for data-architecture-spec consumption
  • tech_stack_decision.json -- Unified tech stack decision (language/framework/ORM/database/cache), for all impl Skills consumption
  • review_report.json -- Review issue list + fix recommendations
  • tech_debt_register.json -- Tech debt register

service_data_ownership.json Schema:

json
{
  "type": "object",
  "required": ["services"],
  "properties": {
    "services": {
      "type": "array",
      "items": {
        "type": "object",
        "required": ["name", "bounded_context", "owned_entities"],
        "properties": {
          "name": { "type": "string" },
          "bounded_context": { "type": "string" },
          "owned_entities": { "type": "array", "items": { "type": "string" } },
          "database_strategy": { "type": "string", "enum": ["shared", "separate"] }
        }
      }
    }
  }
}

tech_stack_decision.json Schema:

json
{
  "type": "object",
  "required": ["language", "framework", "orm", "database", "cache"],
  "properties": {
    "language": { "type": "object", "required": ["name", "version"], "properties": { "name": { "type": "string" }, "version": { "type": "string" } } },
    "framework": { "type": "object", "required": ["name", "version"], "properties": { "name": { "type": "string" }, "version": { "type": "string" } } },
    "orm": { "type": "object", "required": ["name", "version"], "properties": { "name": { "type": "string" }, "version": { "type": "string" } } },
    "database": { "type": "object", "required": ["name", "version"], "properties": { "name": { "type": "string" }, "version": { "type": "string" } } },
    "cache": { "type": "object", "required": ["name", "version"], "properties": { "name": { "type": "string" }, "version": { "type": "string" } } },
    "message_queue": { "type": "object", "properties": { "name": { "type": "string" }, "version": { "type": "string" } } }
  }
}

Decision Rules

ConditionDecision
Team size <5Monolithic architecture preferred
Team size 5-20Microservices architecture
QPS <1000Monolithic or Serverless
Core business entities cross sub-domainsSplit services by bounded context
Review P0 issues >0Block release, must fix
Tech debt affects core functionalityP0 priority, fix this iteration

Quality Checks

  • Architecture pattern matches business scale
  • Architecture evaluation quantitative matrix completed, composite score >=3.0
  • Core architecture decisions 100% have ADR
  • ADR includes alternative option evaluation scores
  • Bounded contexts identified by business domain/data ownership/change frequency three rules
  • Each bounded context has clear entity ownership and communication pattern
  • No circular dependencies between services
  • P0 issues=0
  • Tech debt register generated
  • Each service has clear data ownership

Degradation Strategy

Missing Upstream InputDegradation PlanOutput ImpactData Acquisition Note
PRD missingCannot design architectureOutput is emptyRequire user to provide PRD, or extract minimal PRD from user's verbal business requirements
Business scale not specifiedDefault medium scale (10K users, QPS 100, 10GB data, team of 5)Architecture pattern may not match actual scalePrompt user to provide business scale, or annotate "scale pending confirmation" in architecture decisions
API design missingArchitecture design does not depend on API design, derive service interaction requirements from PRDService communication scheme may need subsequent adjustmentNormal case, API not yet designed; after architecture design, api-design-spec consumes architecture outputs
Data architecture missingDerive core data entities from PRD, annotate "data ownership pending data-architecture-spec confirmation"Entity ownership in service_data_ownership.json based on derivationNormal case, data architecture not yet designed; after architecture design, data-architecture-spec consumes service data ownership
Non-functional requirements missingDerive default non-functional metrics from business scale (availability 99.9%, response time <500ms, RTO <1h)Performance and reliability design may not meet actual requirementsPrompt user to provide non-functional requirements, or record assumptions and pending items in ADR
Technical constraints missingDo not limit tech stack selection, recommend based on team fitness score optimal solutionRecommended tech stack may not meet organizational constraintsPrompt user to provide technical constraints (tech stack preferences, ops capability, budget), or annotate "technical constraints pending confirmation" in architecture decisions

Upstream Change Response

Upstream ChangeImpact ScopeResponse Strategy
PRD business domain changeService divisionMark affected service boundaries, assess whether re-division is needed
PRD business scale changeArchitecture patternRe-evaluate whether architecture pattern matches
Change TypeImpact ScopeNotification Method
Architecture plan changedata-architecture-spec, api-design-spec, all impl SkillsMark affected downstream Skills, update architecture_decision.json
Service design changedata-architecture-spec, api-design-spec, backend-architecture-implMark affected service boundaries, update service_design.json
Tech stack decision changeall impl SkillsMark affected code generation, update tech_stack_decision.json
Service data ownership changedata-architecture-specMark affected data entity ownership, update service_data_ownership.json

Câu hỏi thường gặp

Kỹ năng AI Backend Architecture Spec làm được gì?

Dùng khi thiết kế kiến trúc backend. Tạo tài liệu đặc tả thiết kế kiến trúc backend, tự động đánh giá mẫu kiến trúc dựa trên quy mô kinh doanh, thiết kế phương án phân chia dịch vụ và đánh giá kiến trúc. Có sẵn chức năng ghi lại ADR và nợ kỹ thuật để truy xuất các quyết định. Ưu tiên các ràng buộc kiến trúc, đồng thời đưa ra quyết định về quyền sở hữu dữ liệu dịch vụ và ngăn xếp công nghệ để các bước sau sử dụng. Từ khóa: mẫu kiến trúc, microservices, nguyên khối, Serverless, thiết kế dịch vụ, DDD, bounded context, đánh giá kiến trúc, nợ kỹ thuật, quyết định kiến trúc.

Vì sao nên dùng Backend Architecture Spec trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Backend Architecture Spec là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Backend Architecture Spec trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/LuckyOneTwoThree/vibe-skill/tree/main/.codex/skills/backend-architecture-spec. TypingMind đọc tệp SKILL.md rồi cài đặt kỹ năng để bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Backend Architecture Spec?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Backend Architecture Spec với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Backend Architecture Spec với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Backend Architecture Spec có miễn phí không?

Có. Kỹ năng này được LuckyOneTwoThree phát hành trên GitHub theo giấy phép MIT. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇