Token导航 LogoToken导航

Agent Skill · 前端设计

system-architecture(系统架构)

system-architecture 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

system-architecture 是前端设计类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证信息还不明确,第三方扫描已通过,按安装量在前端设计类的 10,216 个 Skill 里排第 3,352。

总安装 1,373周安装 55GitHub Stars 8下载 444核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

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

请帮我安装这个 Agent Skill:system-architecture(系统架构)
来源仓库:https://github.com/hieutrtr/ai1-skills
仓库路径:skills/system-architecture
安装命令:
npx skills add https://github.com/hieutrtr/ai1-skills --skill system-architecture
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/hieutrtr/ai1-skills --skill system-architecture

这个 Skill 是做什么的

前端设计类 Skill 关注页面结构、视觉规范和组件写法,输出通常是可运行的界面代码。

system-architecture 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息。适合在 Codex、Claude、Cursor、Gemini CLI 中围绕仓库状态、代码变更或协作事项进行整理。

通过 npx skills add 命令从指定 GitHub 仓库安装,需确认权限和维护状态。使用前建议核验具体用法,注意是否会触发联网、命令执行或文件读写操作。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

来源仓库内路径:skills/system-architecture

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/hieutrtr/ai1-skills --skill system-architectur…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

system-architecture 怎么安装?

在终端执行 npx skills add https://github.com/hieutrtr/ai1-skills --skill system-architecture。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

system-architecture 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

system-architecture 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

system-architecture 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

system-architecture 用的人多吗?

公开数据是累计安装 1,373 次,近一周安装 55 次,下载 444 次,GitHub 8 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

system-architecture 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理前端设计类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

前端设计类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
frontend-design

前端设计 · Codex、Claude

8,823,360126,072只读MIT通过
vercel-composition-patterns

Vercel 组合模式 · Codex、Claude

3,858,81625,893需要联网MIT通过
vercel-react-native-skills

Vercel React native skills 前端 · Codex、Claude

2,468,66425,878只读MIT通过
adapt

adapt 搜索 · Codex、Claude

2,027,04023,125操作浏览器未明确通过
bolder

bolder 分析 · Codex、Claude

2,004,28823,130只读未明确通过
system-architecture

系统架构 · 本页

1,3738需要联网未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

System Architecture

When to Use

Activate this skill when:

  • Designing a new module, service, or major feature that requires structural decisions
  • Choosing between architectural approaches (e.g., where to place logic, how to structure data flow)
  • Planning database schema changes or refactoring existing schema
  • Making frontend state management decisions (server state vs client state, context vs store)
  • Evaluating technology trade-offs for a new capability
  • Creating or reviewing Architecture Decision Records (ADRs)
  • Setting up a new project or major subsystem from scratch

Input: If plan.md exists (from project-planner), read it for context about the feature scope and affected modules. Otherwise, work from the user's request directly.

Output: Write architecture decisions to architecture.md and create ADRs in docs/adr/ADR-NNN-<title>.md. Tell the user: "Architecture written to architecture.md. Run /api-design-patterns for API contracts or /task-decomposition for implementation tasks."

Do NOT use this skill for:

  • Writing implementation code (use python-backend-expert or react-frontend-expert)
  • API contract design or endpoint specifications (use api-design-patterns)
  • Testing patterns or strategies (use pytest-patterns or react-testing-patterns)
  • Deployment or infrastructure decisions (use docker-best-practices or deployment-pipeline)

Instructions

Project Layer Architecture

The standard Python/React full-stack architecture follows a layered pattern with strict dependency direction.

Backend Layers (FastAPI)
HTTP Request
    ↓
┌─────────────────────┐
│   Routers (routes/)  │  ← HTTP concerns: request parsing, response formatting, status codes
│                      │     Uses: Depends() for injection, Pydantic schemas for validation
├─────────────────────┤
│   Services           │  ← Business logic: orchestration, validation rules, domain operations
│   (services/)        │     No HTTP awareness. Raises domain exceptions, not HTTPException.
├─────────────────────┤
│   Repositories       │  ← Data access: queries, CRUD operations, database interactions
│   (repositories/)    │     No business logic. Returns model instances or None.
├─────────────────────┤
│   Models (models/)   │  ← SQLAlchemy ORM models: table definitions, relationships, indexes
│   Schemas (schemas/) │  ← Pydantic v2 models: request/response contracts, validation
└─────────────────────┘
    ↓
Database

Dependency direction rules:

  • Routers depend on Services (never on Repositories directly)
  • Services depend on Repositories (never on Routers)
  • Repositories depend on Models (never on Services)
  • Schemas are shared across layers but define no dependencies themselves
  • Never skip layers: no direct database access from routes

Dependency injection pattern:

# Router depends on Service via Depends()
@router.post("/users", response_model=UserResponse)
async def create_user(
    data: UserCreate,
    service: UserService = Depends(get_user_service),
) -> UserResponse:
    return await service.create_user(data)

# Service depends on Repository via constructor injection
class UserService:
    def __init__(self, repo: UserRepository) -> None:
        self.repo = repo

# Repository depends on AsyncSession via Depends()
class UserRepository:
    def __init__(self, session: AsyncSession) -> None:
        self.session = session
Frontend Layers (React/TypeScript)
┌─────────────────────┐
│   Pages (pages/)     │  ← Route-level components: data fetching, layout composition
├─────────────────────┤
│   Layouts            │  ← Page structure: navigation, sidebars, content areas
│   (layouts/)         │
├─────────────────────┤
│   Features           │  ← Domain-specific: UserProfile, OrderList, ChatPanel
│   (features/)        │     Composed from shared components + hooks
├─────────────────────┤
│   Shared Components  │  ← Reusable UI: Button, Modal, Table, Form, Input
│   (components/)      │     No business logic. Configurable via props.
├─────────────────────┤
│   Hooks (hooks/)     │  ← Custom hooks: useAuth, usePagination, useDebounce
│   API (api/)         │  ← API client functions, TanStack Query configurations
├─────────────────────┤
│   Types (types/)     │  ← Shared TypeScript interfaces and type definitions
└─────────────────────┘

Component dependency direction:

  • Pages import Features and Layouts
  • Features import Shared Components and Hooks
  • Shared Components import only other Shared Components and Types
  • Hooks import API functions and Types
  • API functions import Types only

Decision Framework

When facing architectural decisions, follow this structured process:

Step 1: Define the Problem
  • What capability is needed?
  • What are the non-functional requirements? (performance, scalability, maintainability)
  • What constraints exist? (team size, timeline, existing infrastructure)
Step 2: Identify Options
  • List 2-3 viable architectural approaches
  • For each option, document:

- How it works (brief technical description) - Advantages - Disadvantages - Risks

Step 3: Evaluate Against Criteria
CriterionWeightDescription
MaintainabilityHighCan the team understand, modify, and debug this easily?
TestabilityHighCan each component be tested in isolation?
PerformanceMediumDoes it meet latency and throughput requirements?
Team familiarityMediumDoes the team have experience with this approach?
Operational costLowWhat are the infrastructure and maintenance costs?
Future flexibilityLowHow easily can this evolve as requirements change?
Step 4: Decide and Document
  • Choose the option that best satisfies the weighted criteria
  • Document the decision in an ADR (see references/architecture-decision-record-template.md)
  • Record what was NOT chosen and why — this context is valuable for future decisions
Step 5: Communicate
  • Share the ADR with the team
  • Identify any migration or rollout steps needed
  • Flag reversibility: is this a one-way door or a two-way door?

Database Schema Design

Design Principles
  1. Start normalized (3NF) — Denormalize only for proven performance bottlenecks, not speculation
  2. One migration per logical change — Each Alembic migration should represent a single, coherent schema modification
  3. Always include downgrade — Every migration must have a working downgrade() function
  4. Index strategically:

- Primary keys (automatic) - Foreign keys (always) - Columns in WHERE clauses of frequent queries - Composite indexes for multi-column lookups - Partial indexes for filtered queries (e.g., WHERE is_active = true)

SQLAlchemy 2.0 Async Patterns
# Model definition with Mapped types (SQLAlchemy 2.0 style)
class User(Base):
    __tablename__ = "users"

    id: Mapped[int] = mapped_column(primary_key=True)
    email: Mapped[str] = mapped_column(String(255), unique=True, index=True)
    is_active: Mapped[bool] = mapped_column(default=True)
    created_at: Mapped[datetime] = mapped_column(server_default=func.now())

    # Relationships: ALWAYS use eager loading with async
    posts: Mapped[list["Post"]] = relationship(
        back_populates="author",
        lazy="selectin",  # or "joined" — NEVER "lazy" with async
    )

Async session rules:

  • One AsyncSession per request — never share across concurrent tasks
  • Use async with context manager for automatic cleanup
  • Map session boundaries to transaction boundaries
  • Use selectin or joined loading — lazy loading is incompatible with asyncio
  • Use run_sync() only as a last resort for legacy code
Migration Planning
  1. Schema change → Generate migration: alembic revision --autogenerate -m "description"
  2. Review generated migration — verify column types, indexes, constraints
  3. Test upgrade: alembic upgrade head
  4. Test downgrade: alembic downgrade -1
  5. Test data preservation: ensure existing data survives the round-trip

Frontend Architecture

State Management Decision Tree
Is the data from the server?
├── YES → Use TanStack Query (useQuery, useMutation)
│         Configure staleTime, gcTime, query keys
│
└── NO → Is it needed across multiple components?
         ├── YES → Is it complex with actions/reducers?
         │         ├── YES → Use Zustand store
         │         └── NO  → Use React Context
         │
         └── NO → Use useState / useReducer locally

TanStack Query conventions:

  • Query keys: [resource,...identifiers] (e.g., ["users", userId], ["posts", {page, limit}])
  • Use queryOptions() factory to centralize key + fn definitions — prevents copy-paste key errors
  • Set staleTime based on data freshness needs (default 0 is too aggressive for most cases)
  • Invalidate with invalidateQueries() after mutations — never manual refetch()
  • Handle all states: isPending, isError, data

Component design rules:

  • Props for configuration, hooks for data
  • Lift state only as high as needed — no premature context creation
  • Keep components under 200 lines — extract sub-components or custom hooks when larger
  • Use children and composition over deep prop drilling
Routing Structure

Organize routes to mirror the URL structure:

src/
├── pages/
│   ├── HomePage.tsx           → /
│   ├── LoginPage.tsx          → /login
│   ├── users/
│   │   ├── UserListPage.tsx   → /users
│   │   └── UserDetailPage.tsx → /users/:id
│   └── settings/
│       └── SettingsPage.tsx   → /settings

Cross-Cutting Concerns

Authentication Flow
Login Request
    ↓
Backend: Validate credentials → Generate JWT (access + refresh tokens)
    ↓
Frontend: Store access token in memory, refresh token in httpOnly cookie
    ↓
API Calls: Attach access token via Authorization header
    ↓
Token Expired: Use refresh token to obtain new access token
    ↓
Refresh Failed: Redirect to login

Architecture decisions for auth:

  • Access tokens: short-lived (15-30 min), stored in memory (not localStorage)
  • Refresh tokens: longer-lived (7-30 days), stored in httpOnly cookie
  • Backend: FastAPI Depends() chain for token validation → user extraction → permission check
  • Frontend: Auth context providing user, login(), logout(), isAuthenticated
Error Handling Strategy

Errors should be handled at the appropriate layer:

LayerError TypeAction
RouterHTTPExceptionReturn HTTP error response with status code
ServiceDomain exceptionsRaise custom exceptions (e.g., UserNotFoundError)
RepositoryDatabase exceptionsCatch and re-raise as domain exceptions or let propagate
FrontendAPI errorsDisplay user-friendly messages, retry where appropriate

Backend exception hierarchy:

class AppError(Exception):
    """Base application error."""

class NotFoundError(AppError):
    """Resource not found."""

class ConflictError(AppError):
    """Resource conflict (duplicate, version mismatch)."""

class ValidationError(AppError):
    """Business rule violation."""

Router-level exception handler maps domain exceptions to HTTP responses:

@app.exception_handler(NotFoundError)
async def not_found_handler(request: Request, exc: NotFoundError):
    return JSONResponse(status_code=404, content={"detail": str(exc)})
Logging Architecture

Backend (structlog):

  • Structured JSON logs in production
  • Human-readable console in development
  • Bind request context (request_id, user_id) at middleware level
  • Log at service layer (business events), not repository layer (too noisy)
  • Use log levels: DEBUG (development only), INFO (business events), WARNING (recoverable issues), ERROR (failures requiring attention)

Frontend:

  • console.* in development
  • Structured error reporting to backend or Sentry in production
  • Log user actions for debugging, not for analytics
Configuration Management

Backend (pydantic-settings):

class Settings(BaseSettings):
    model_config = SettingsConfigDict(env_file=".env")

    database_url: str
    redis_url: str = "redis://localhost:6379"
    jwt_secret: str
    debug: bool = False

Frontend (environment variables):

  • VITE_API_URL for API base URL
  • Build-time injection via Vite's import.meta.env
  • No secrets in frontend environment variables

Output Files

architecture.md

Write the architecture document to architecture.md at the project root:

# Architecture: [Feature/System Name]

## Overview
[1-2 sentence summary of the architectural approach]

## Layer Structure
[Backend and frontend layer descriptions from this skill's patterns]

## Key Decisions
[Summary of decisions made, with links to ADRs]

## Database Schema
[Entity descriptions, relationships, key indexes]

## Cross-Cutting Concerns
[Auth, error handling, logging approach]

## Next Steps
- Run `/api-design-patterns` to define API contracts
- Run `/task-decomposition` to create implementation tasks
ADRs

For each significant decision, create an ADR in docs/adr/:

# ADR-NNN: [Decision Title]

## Status
Accepted | Proposed | Superseded

## Context
[Why this decision is needed]

## Decision
[What we decided]

## Consequences
[Positive and negative outcomes]

Number ADRs sequentially (ADR-001, ADR-002, etc.).

Examples

Architecture Decision: Real-Time Notifications

Problem: The application needs real-time notifications for users (new messages, status updates).

Options evaluated:

OptionProsCons
WebSocketTrue bidirectional, low latencyComplex connection management, harder to scale
Server-Sent Events (SSE)Simple, HTTP-based, auto-reconnectUnidirectional (server→client only), limited browser connections
PollingSimplest implementation, works everywhereHigher latency, unnecessary server load

Decision: WebSocket for this use case.

Rationale: Notifications require low latency and the system will eventually need bidirectional communication (typing indicators, presence). SSE would work for notifications alone but would require a separate solution for future bidirectional needs. Polling introduces unacceptable latency for real-time UX.

Architecture:

  • Backend: FastAPI WebSocket endpoint with ConnectionManager class
  • Frontend: Custom useWebSocket hook with automatic reconnection
  • Scaling: Redis pub/sub for multi-instance message distribution
  • Persistence: Store notifications in database for offline users
  • Fallback: REST endpoint for notification history and initial load

See references/architecture-decision-record-template.md for the full ADR format.

Edge Cases

Monolith vs Microservices

Default to modular monolith for teams smaller than 10 developers. A modular monolith provides:

  • Clear module boundaries without network overhead
  • Shared database with module-specific schemas
  • Easy refactoring and code navigation
  • Simple deployment and debugging

Consider microservices only when:

  • Independent scaling is required for specific components
  • Different modules need different technology stacks
  • Team size exceeds 10 and ownership boundaries are clear
  • Deployment independence is a business requirement

Migration path: Design module boundaries in the monolith as if they were services (no direct cross-module database access, communicate via service interfaces). This makes extraction to microservices straightforward when needed.

When to Break the Layer Pattern

The strict Router → Service → Repository pattern should be followed for standard CRUD operations. Acceptable exceptions:

  • Background tasks: May call services directly without going through a router
  • Event handlers: Domain event listeners may call services from any context
  • CLI commands: Management scripts may access services or repositories directly
  • Migrations: Data migrations may access models directly (no service/repo layer needed)
  • Health checks: May access the database directly for simple connectivity verification

In all cases, business logic should still live in the service layer — these exceptions are about the entry point, not about bypassing business rules.

Evolving Architecture

When the architecture needs to change:

  1. Write an ADR documenting the motivation and the proposed change
  2. Identify all affected modules and their dependencies
  3. Plan an incremental migration — never big-bang rewrites
  4. Maintain backward compatibility during transition (strangler fig pattern)
  5. Set a deadline for completing the migration and removing legacy code

平台分布

Codex

37.32%
按下载量换算166

Claude

29.77%
按下载量换算132

Cursor

20.22%
按下载量换算90

Gemini CLI

9.2%
按下载量换算41

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

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

继续浏览同类 Skills