AGENT SKILL

create_domain_contract

Use when defining a typed domain contract — an application use case (business flow) or a repository interface (persistence boundary) — with clean architecture boundaries.

适用职业律师与法务
License 许可
Apache-2.0
最近更新
2026-09-12
Stars
★ 0
Forks
0

01 前言 Front Matter

name
create_domain_contract
risk
writes-files
family
architecture-contracts
profile
core
summary
Define a typed use case or repository interface with clean-architecture boundaries
maturity
stable
triggers
[ "use case", "repository interface", "domain contract", "persistence boundary", "port and adapter", "protocol for the repository" ]
visibility
internal
description
Use when defining a typed domain contract — an application use case (business flow) or a repository interface (persistence boundary) — with clean architecture boundaries.
auto_trigger
true
small_model_path
false

03 SKILL.md 正文

Skill: create_domain_contract

Purpose

Create a typed domain contract aligned with clean architecture boundaries. This skill covers two contract shapes selected via contract_type:

  • use_case — an application use case that expresses an explicit business flow.
  • repository — a repository/persistence interface that isolates infrastructure details from domain and application logic.

Required Input

  • contract_type: use_case | repository.
  • Common: entity/aggregate or business goal, and the typed input/output models.
  • For use_case: actor(s) involved and the expected business outcome.
  • For repository: required operations (CRUD/query) and consistency/transactional constraints.

Output Format

  • Contract name (use case name, or interface/protocol name).
  • Python module/class/function (or protocol) proposal.
  • Typed input/output models involved in each operation.
  • For use_case: ordered execution flow and error-handling strategy.
  • For repository: method signatures, adapter implementation guidance (infra side), and a contract-behavior test strategy.

Mode

  • use_case — model the business flow as an application-layer use case. Keep the flow ordered and explicit; define error handling.
  • repository — model the persistence boundary as an interface/protocol. Keep the domain independent from infrastructure implementations; prefer minimal, explicit method contracts.

Execution Rules

  1. Follow .github/architecture.md.
  2. Apply .github/standards.md.
  3. Respect .github/domain-boundaries.md (domain must not depend on infrastructure).
  4. Use absolute imports and type hints.
  5. Keep naming/docstrings in English.

04 同仓库更多 Skills