Token导航 LogoToken导航TokenDH.com
前端设计执行命令github未标认证来源可访问许可证需确认审计未展示

python%3aarchitecturePython 3aarchitecture 测试

Agent Skill

用于辅助 Python 项目开发、测试、依赖管理和常见框架工作流。它适合让 Agent 阅读 Python 代码、定位测试问题、整理运行命令、生成脚本或分析数据处理逻辑。使用时需要确认项目虚拟环境、依赖版本和测试入口;涉及执行脚本、读写文件、访问数据库或调用外部 API 时,应先明确运行目录和输入输出范围,避免误改生产数据。

总安装

326

周安装

14

GitHub Stars

20

下载量

114
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:python%3aarchitecture(Python 3aarchitecture 测试)
来源仓库:https://github.com/martinffx/claude-code-atelier
仓库路径:skills/python%3Aarchitecture
安装命令:
npx skills add https://github.com/martinffx/claude-code-atelier --skill python:architecture
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/martinffx/claude-code-atelier --skill python:architecture

简介

用于评估和改进 Python 项目的架构设计与模块化程度。

  • 可分析代码耦合度、分层合理性及可扩展性建议。
  • 支持生成架构图草稿和组件职责说明文档。
  • 应基于现有代码结构进行分析,避免主观臆断设计缺陷。
  • python%3aarchitecture 属于前端设计类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Python Application Architecture

Modern Python application architecture following functional core / imperative shell pattern, Domain-Driven Design, and type-safe data modeling.

Core Principle: Functional Core / Imperative Shell

Separate pure business logic from side effects:

  • Functional Core: Pure functions, business logic, no IO
  • Imperative Shell: Coordinates external dependencies, handles side effects

See references/functional-core.md for detailed patterns and examples.

Layered Architecture

Follow bottom-up dependency flow:

Router/Handler → Service → Repository → Entity → Database

Each layer depends only on layers below.

Responsibilities:

  • Entity: Domain models, validation, business rules, data transformations (fromRequest, toRecord, toResponse)
  • Repository: Abstract storage interface, returns domain entities
  • Service: Business workflows, orchestrates entities and repositories
  • Router/Handler: HTTP handling, delegates to services

Domain Models

Entity Example

from dataclasses import dataclass
from uuid import UUID
from decimal import Decimal

@dataclass
class Order:
    """Entity - has identity and encapsulated behavior"""
    id: UUID
    customer_id: UUID
    total: Decimal
    status: str

    def apply_discount(self, rate: Decimal) -> None:
        """Business rule - encapsulated in entity"""
        if self.status == "pending":
            self.total = self.total * (1 - rate)

    @classmethod
    def from_request(cls, req, customer_id: UUID) -> "Order":
        """Transform API request → entity"""
        return cls(id=uuid4(), customer_id=customer_id, total=Decimal("0"), status="pending")

    def to_response(self):
        """Transform entity → API response"""
        return {"id": self.id, "total": self.total, "status": self.status}

Value Object Example

from dataclasses import dataclass

@dataclass(frozen=True)
class Money:
    """Value object - immutable, no identity"""
    amount: Decimal
    currency: str

    def add(self, other: "Money") -> "Money":
        if self.currency != other.currency:
            raise ValueError("Cannot add different currencies")
        return Money(self.amount + other.amount, self.currency)

See references/ddd.md for aggregates, bounded contexts, and domain services.

Repository Pattern

Abstract storage behind interface:

from abc import ABC, abstractmethod
from typing import Optional

class OrderRepository(ABC):
    """Abstract repository - interface only"""

    @abstractmethod
    def get(self, order_id: UUID) -> Optional[Order]:
        pass

    @abstractmethod
    def save(self, order: Order) -> None:
        pass

class PostgresOrderRepository(OrderRepository):
    """Concrete implementation"""

    def get(self, order_id: UUID) -> Optional[Order]:
        record = self.session.get(OrderRecord, order_id)
        return Order.from_record(record) if record else None

    def save(self, order: Order) -> None:
        record = order.to_record()
        self.session.merge(record)
        self.session.commit()

Data Modeling

  • dataclasses: Domain models and internal logic (lightweight, standard library)
  • Pydantic: API boundaries (validation, JSON schema, OpenAPI)
  • Entity transformations: from_request(), to_response(), from_record(), to_record()

See references/data-modeling.md for validation patterns, Pydantic features, and transformation examples.

Best Practices

  1. Pure functions first - Write business logic without IO dependencies
  2. Entity encapsulation - Keep business rules inside entities
  3. Repository abstraction - Hide storage details, work with domain entities
  4. Validate at boundaries - Use Pydantic at API edges, simple validation in entities
  5. Immutable value objects - Always use frozen=True
  6. Single Responsibility - Each layer has one reason to change
  7. Dependency direction - Always depend on abstractions, not implementations

Anti-Patterns

Anemic Domain Model - Entities with only getters/setters, all logic in services ❌ Transaction Script - All logic in service layer, entities just data ❌ Leaky Abstraction - Repository exposing database details ❌ God Object - Entity with too many responsibilities ❌ Mixed Concerns - Business logic calling IO directly

For detailed examples, patterns, and decision trees, see the reference materials:

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

36.4%
按下载量换算41

Claude

29.17%
按下载量换算33

Cursor

21.55%
按下载量换算25

Gemini CLI

9.17%
按下载量换算10

安全审计

暂无安全审计结果可展示。

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/martinffx/claude-code-atelier --skill python:architecture 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills