Logo Data Architecture Impl

Data Architecture Impl

Cộng đồng
LuckyOneTwoThree
data-architecture-impl

Use when generating data layer code. Implements data layer code from data-architecture-spec ER models and table structure designs, generating runnable Models, Migrations, Repositories, and cache layer code to the project directory. Built-in API alignment check and code self-review. Keywords: generate Model code, generate Migration, generate Repository, generate cache code, data layer code generation.

Tổng quan

Nhà phát hànhLuckyOneTwoThree
Kho mãvibe-skill
Tên kỹ năngdata-architecture-impl
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 là Markdown thuần túy, không phải 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ộ.

  • Đầy đủ trong hướng dẫn

    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 nội dung nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Data Architecture Impl 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 thư mục kỹ năng bên dưới và xác nhận.
    https://github.com/LuckyOneTwoThree/vibe-skill/tree/main/.codex/skills/data-architecture-impl
  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/data-architecture-impl .claude/skills/data-architecture-impl
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 Data Architecture Impl 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ự tải Data Architecture Impl 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 Data Architecture Impl không bị giới hạn ở mô hình mà kỹ năng này được viết cho. 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 kỹ năng chưa dùng không tốn chi phí.

  • Đổ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.

Data Layer Code Implementation

Code Write Boundary

Follow Engineering Boundary Protocol or the equivalent relative path from this skill.

  1. Scan first: identify framework, package manager, module layout, ORM, migration tool, validation library, auth middleware, and test conventions before implementation.
  2. Target scope: declare exact files/directories to create or modify; generated code must stay inside the target module unless integration files are explicitly required.
  3. No overwrite: preserve existing business logic, routes, models, migrations, configs, and tests unless the user explicitly asks for replacement.
  4. Consistency checks: verify OpenAPI, controller/service signatures, DTO/schema validation, ER model, migrations, repositories, and auth rules are aligned.
  5. Migration safety: generated migrations must be additive by default; destructive data changes require explicit human confirmation.
  6. Implementation report: list created/modified files, skipped files, checks run, failed checks, and residual risks.

Core Principles

  1. Design as Specification: Strictly follow data-architecture-spec outputs, Model fields fully consistent with DDL
  2. Clear Layering: Models only define data layer structure, API types defined by api-design-impl's types/api.ts
  3. Cache Alignment: Cache layer code aligned with cache strategy design
  4. Reversible Migrations: Every Migration script has a corresponding rollback script
  5. Test Coverage: Every Model and Repository has a test skeleton

Interaction Mode

AI->Human AI suggests, human approves

Input

Input ItemTypeRequiredSourceDescription
ER ModelJSONYesoutput/backend-data-architecture/data-architecture-spec/er_model.jsonEntity relationships and DDL definitions
Cache StrategyJSONYesoutput/backend-data-architecture/data-architecture-spec/cache_strategy.jsonCache scheme
Migration PlanJSONOoutput/backend-data-architecture/data-architecture-spec/migration_plan.jsonMigration plan (incremental projects)
API ContractYAMLOoutput/backend-api-design/api-design-spec/openapi.yamlFor API alignment check (empty when API not yet implemented, normal case)
Tech Stack DecisionJSONYesoutput/backend-architecture/backend-architecture-spec/tech_stack_decision.jsonUnified tech stack, including language/ORM/database type
project_dirstringYesUser providedProject root directory absolute path
tech_stackstringOUser providedFallback when tech_stack_decision.json is not available

Execution Steps

Step 1: Model Code Generation [Core]

Generate data layer entity code based on ER model:

Generated ContentPathDescription
Model/Entitysrc/models/ (or entities/)One Model file per entity, including field definitions, validation rules, relationships, defining data layer structure only
Database Configurationsrc/config/database.tsDatabase connection configuration + connection pool

Code Quality Requirements:

  • Model field types, constraints, default values fully consistent with DDL
  • Models only define data layer structure, API types defined by api-design-impl's types/api.ts

Stage Gate: Code compiles (npm run build or tsc --noEmit passes), Model fields consistent with DDL

Step 2: Migration and Seed Data Generation [Core]

Generate migration scripts and seed data based on DDL:

Generated ContentPathDescription
Migration Scriptssrc/migrations/Migration scripts for table creation/indexes/seed data
Seed Datasrc/seeds/Development environment seed data

Code Quality Requirements:

  • Migration scripts are executable and reversible
  • Seed data covers core business entities

Stage Gate: Migrations are executable (verified via npx prisma migrate status or equivalent), 100% have rollback scripts

Step 3: Repository Code Generation [Core]

Generate a Repository for each entity:

Generated ContentPathDescription
Repository/DAOsrc/repositories/ (or dao/)One Repository per entity, including CRUD operations + common queries

Code Quality Requirements:

  • Repository methods have complete type annotations + error handling
  • Query methods cover all API layer data access needs
  • Soft delete, pagination, sorting uniformly encapsulated in Repository layer

Stage Gate: Every API data access need has a corresponding Repository method

Step 4: Cache Layer Code Generation [Core]

Generate cache layer code based on cache strategy:

Generated ContentPathDescription
Cache Layersrc/cache/Redis connection configuration, CacheRepository, cache decorators/interceptors

Code Quality Requirements:

  • Cache layer aligned with cache strategy design: hit rate targets, invalidation strategy, penetration/breakdown/avalanche protection
  • CacheRepository encapsulates cache read/write logic, Services access data through Repository+CacheRepository

Stage Gate: Cache layer aligned with cache strategy design

Step 5: Alignment Check and Code Self-Review [Core]

API Alignment Check (optional, executed when API contract exists):

  • Check each API contract request/response structure one by one, ensuring Model fields cover all API requirements
  • Missing fields are marked and automatically supplemented
  • When no API contract exists, skip this check, mark "API alignment pending api-design-impl completion, to be verified by backend-architecture-impl unified check"

Code Self-Review:

  • Check Model field consistency with DDL
  • Check Migration scripts are executable and reversible
  • Check cache layer alignment with cache strategy design
  • Check Repository queries for N+1 issues
  • Check index coverage for high-frequency query scenarios
  • Auto-fix discovered issues, P0 issues block output

Stage Gate: Model fields consistent with DDL, code self-review P0 issues=0

Step 6: Data Layer Test Code Generation [Core]

Generate test code for the data layer:

  • Generate field validation tests for each Model
  • Generate CRUD test skeletons for each Repository
  • Generate execution + rollback verification tests for Migrations
  • Test files output to src/tests/models/ and src/tests/repositories/

Stage Gate: Every Model and Repository has a test skeleton

Output

Adopts dual output mode:

  1. Code Files -> Directly written to user-specified {project_dir}/src/ project directory
  2. Metadata Files -> Written to output/ directory for downstream Skill consumption

Code File Output: {project_dir}/src/ (Models, Migrations, Repositories, cache layer, configuration, tests directly written to project directory)

Metadata Output: output/backend-data-architecture/data-architecture-impl/

Metadata Output Files:

  • impl-report.json -- Code implementation report (generated file list + alignment check results + self-review results)

impl-report.json Schema:

json
{
  "type": "object",
  "required": ["skill_name", "version", "generated_files", "repositories", "alignment_check", "self_audit"],
  "properties": {
    "skill_name": { "type": "string" },
    "version": { "type": "string" },
    "generated_files": {
      "type": "array",
      "items": {
        "type": "object",
        "required": ["path", "type", "description"],
        "properties": {
          "path": { "type": "string" },
          "type": { "type": "string", "enum": ["model", "migration", "repository", "cache", "config", "seed", "test"] },
          "description": { "type": "string" }
        }
      }
    },
    "repositories": {
      "type": "array",
      "description": "Repository list and method signatures, for api-design-impl consumption",
      "items": {
        "type": "object",
        "required": ["name", "entity", "methods"],
        "properties": {
          "name": { "type": "string" },
          "entity": { "type": "string" },
          "file_path": { "type": "string" },
          "methods": {
            "type": "array",
            "items": {
              "type": "object",
              "required": ["name", "return_type"],
              "properties": {
                "name": { "type": "string" },
                "params": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "type": { "type": "string" } } } },
                "return_type": { "type": "string" },
                "description": { "type": "string" }
              }
            }
          }
        }
      }
    },
    "alignment_check": {
      "type": "object",
      "required": ["passed", "issues"],
      "properties": {
        "passed": { "type": "boolean" },
        "issues": { "type": "array", "items": { "type": "object", "properties": { "severity": { "type": "string", "enum": ["P0", "P1", "P2"] }, "category": { "type": "string" }, "message": { "type": "string" }, "resolution": { "type": "string" } } } }
      }
    },
    "self_audit": {
      "type": "object",
      "required": ["p0_count", "p1_count", "passed", "items"],
      "properties": {
        "p0_count": { "type": "integer" },
        "p1_count": { "type": "integer" },
        "passed": { "type": "boolean" },
        "items": { "type": "array", "items": { "type": "object", "properties": { "severity": { "type": "string", "enum": ["P0", "P1", "P2"] }, "check": { "type": "string" }, "result": { "type": "string", "enum": ["pass", "fail", "fixed"] }, "detail": { "type": "string" } } } }
      }
    }
  }
}

Decision Rules

ConditionDecision
ER model inconsistent with API contractFollow ER model, mark differences for human confirmation
Cache strategy conflicts with code implementationFollow cache strategy, adjust code implementation
Code self-review finds P0 issuesBlock output, auto-fix then re-review
Repository queries have N+1 issuesSwitch to JOIN or batch queries
Tech stack decision conflicts with user specificationPrefer tech_stack_decision.json (architecture design output), then tech_stack parameter (user direct input), default to Node.js/Prisma. Mark conflicts for human confirmation

Quality Checks

  • Code compiles (npm run build or tsc --noEmit passes)
  • Model fields fully consistent with DDL
  • Migration scripts are executable and reversible
  • Every Repository method has type annotations + error handling
  • Soft delete/pagination/sorting uniformly encapsulated
  • Cache layer aligned with cache strategy design
  • Models only define data layer structure, API types defined by api-design-impl's types/api.ts
  • Code self-review P0 issues=0
  • Every Model and Repository has a test skeleton
  • API field coverage (mandatory when API contract exists, mark pending verification when absent)

Degradation Strategy

Missing Upstream InputDegradation PlanOutput Impact
Tech stack decision missingUse tech_stack parameter (user provided), default to Node.js/Prisma if absentCode style may not match
Cache strategy missingDo not generate cache layer codeNo cache layer, Services directly access Repository
Migration plan missingDo not generate migration scriptsNo migration plan
API contract missingNormal case, generate code based on ER model only, API alignment check degraded to optionalAPI field coverage pending api-design-impl completion for verification
tech_stack parameter missingDefault Node.js/PrismaCode style may not match

Upstream Change Response

Upstream ChangeImpact ScopeResponse Strategy
ER model changeModel+Migration+RepositoryMark affected code files, assess modification scope
Cache strategy changeCache layer codeUpdate CacheRepository and cache configuration
Tech stack decision changeTech stack related configurationUpdate ORM configuration and database connection code
API contract changeRepository query methodsAssess whether new or modified query methods are needed
Change TypeImpact ScopeNotification Method
Repository method signature changeapi-design-implMark affected Service calls, update repositories field in impl-report.json
Model field changeapi-design-impl (mappers.ts)Mark affected type conversions, update impl-report.json
Cache layer interface changeapi-design-impl, backend-architecture-implMark affected cache calls, update impl-report.json

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

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

Use when generating data layer code. Implements data layer code from data-architecture-spec ER models and table structure designs, generating runnable Models, Migrations, Repositories, and cache layer code to the project directory. Built-in API alignment check and code self-review. Keywords: generate Model code, generate Migration, generate Repository, generate cache code, data layer code generation.

Vì sao nên dùng Data Architecture Impl 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. Data Architecture Impl 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 Data Architecture Impl 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/data-architecture-impl. TypingMind đọc tệp SKILL.md và cài đặt thành một kỹ năng mà 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 Data Architecture Impl?

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.

Bạn có thể dùng Data Architecture Impl 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 Data Architecture Impl 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 Data Architecture Impl 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 cho mô hình các công cụ mới để gọi — mã đượ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à tiêu chí của đầu ra tốt. 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 👇