Token导航 LogoToken导航

Agent Skill · 研究检索

apply-clean-architecture(应用干净的架构)

apply-clean-architecture 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

apply-clean-architecture 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证信息还不明确,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 64,557。

总安装 297周安装 12GitHub Stars 5下载 93核验 2026-05-01

安装说明

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

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/yigitkonur/skills-by-yigitkonur --skill apply-clean-architecture

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

用于查找、检索和筛选相关信息。apply-clean-architecture 属于研究检索类 Skill,可作为该场景下的辅助能力补充。适合根据关键词快速定位候选结果。通过 GitHub 安装,需确认权限和维护状态。可能触发联网或文件读写,建议提前评估风险。

适用于 Codex、Claude、Cursor 和 Gemini CLI。

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

上手步骤

4 步
  1. 1

    确认自己的宿主工具

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

  2. 2

    拿到安装命令

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

  3. 3

    安装后重启宿主

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

  4. 4

    按最小权限试用

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

常见问题

6 条

apply-clean-architecture 怎么安装?

在终端执行 npx skills add https://github.com/yigitkonur/skills-by-yigitkonur --skill apply-clean-arch…。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

apply-clean-architecture 支持哪些 AI 工具?

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

apply-clean-architecture 需要什么权限?

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

apply-clean-architecture 是免费的吗?

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

apply-clean-architecture 用的人多吗?

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

apply-clean-architecture 安全吗?

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

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

值得选的地方

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

先想清楚的地方

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

适不适合你

更适合

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

不太适合

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

研究检索类 Skill 对比

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

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
apply-clean-architecture

应用干净的架构 · 本页

2975需要联网未明确通过

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

SKILL.md 原文

Clean Architecture — TypeScript

Apply Clean Architecture (Robert C. Martin), DDD tactical patterns, Hexagonal/Explicit Architecture (Herberto Graca), and Clean Code practices to TypeScript codebases. 76 rules across 11 categories.

Guardrails — never violate these

  • Never import outer layers from inner layers — domain imports nothing; application imports only domain
  • Never put ORM decorators or Prisma types on domain entities — use mappers in infrastructure
  • Never return null for domain errors — use a discriminated Result<T, E> return. In this repo the result branch uses ok: true | false; if E is a rich error union, give each error variant an _tag for exhaustive handling.
  • Never use as any or @ts-ignore without a documented justification comment
  • Never dispatch domain events before persistence — pull events AFTER save(), dispatch AFTER commit
  • Never share one type across domain/API/DB layers — accept cross-layer duplication, each model serves a different master
  • Never use barrel files (index.ts with export *) in application code — use direct imports
  • Never validate inside domain or use cases — parse at the adapter boundary with Zod, trust inside
  • Always use # private fields on entities (runtime encapsulation) — not the private keyword
  • Always separate Entity.create() (validates, emits events) from Entity.reconstitute() (loads from DB, no events)
  • Always wire dependencies in a single composition root (main.ts) — the only file that knows all concretions
  • Always use import type for cross-layer type imports — enable verbatimModuleSyntax: true
  • Always require strict: true + noUncheckedIndexedAccess + exactOptionalPropertyTypes in tsconfig

Trigger boundary

Use this skill when:

  • Designing new modules, services, or bounded contexts
  • Reviewing code for architectural or dependency-direction violations
  • Refactoring coupled systems toward cleaner layer separation
  • Implementing entities, value objects, aggregates, or domain events
  • Auditing tsconfig strictness, naming quality, or function design
  • Choosing between layered architecture and vertical slices

Do NOT use this skill when:

  • The task is purely about React/Vue/Angular component rendering (use framework skill)
  • The task is about build tooling, CI/CD, or deployment only
  • The task is a quick script or throwaway prototype with no long-term maintenance

Mode detection

Before starting, determine your mode:

SignalModeBehavior
"Design", "architect", "structure", "plan"DesigningPropose layer structure, reference decision-tables.md
"Review", "audit", "check", "assess"ReviewingReport findings with severity, never auto-fix, block on guardrail violations
"Implement", "write", "create", "add", "build"ImplementingWrite code following loaded references, verify with typecheck
"Refactor", "migrate", "extract", "move"RefactoringApply minimal targeted changes, preserve behavior, verify tests pass
AmbiguousAskClarify with the user before proceeding

Required workflow

Step 1 — Classify the task

Identify the primary category and one adjacent category:

CategoryReferences to loadWhen
Dependency Directiondep-inward-only, dep-interface-ownership, dep-dry-vs-duplicationImport direction issues, layer coupling, DRY vs duplication
Entity Designentity-rich-not-anemic, entity-aggregate-roots, entity-create-reconstituteDomain modeling, invariants, aggregates, factories
Use Case Isolationusecase-orchestrates-not-implements, usecase-input-output-portsUse case design, port definitions, orchestration
Clean Codecode-error-handling, code-parse-dont-validate, code-objects-vs-dataNaming, functions, error handling, validation
TypeScript Strictnessts-strict-config, ts-branded-types, ts-result-type, ts-lsp-performanceType safety, config, branded types, LSP speed
Architecture Patternspattern-cqrs-separation, pattern-domain-events, pattern-vertical-slicesCQRS, events, vertical slices
Boundariesbound-composition-root, adapt-explicit-architecture, adapt-controller-thinComposition root, ports, adapters, controllers
Framework Isolationframe-domain-purity, frame-orm-in-infrastructureORM leaks, framework coupling
Testingtest-testing-pyramid, test-layer-isolationTest strategy, pyramid alignment
Steering note: Most tasks span two categories. Load the primary reference plus one adjacent. If uncertain, scan the category table for keywords matching the user's request.

Step 2 — Load references

Read the reference file(s) from references/ identified in Step 1. Read the full file — do not skim. If a loaded reference example conflicts with the guardrails or repo conventions in this file, follow this file.

If the task involves existing code, also read:

  • The project's tsconfig.json (compare against ts-strict-config.md)
  • The project's layer structure (identify domain/, application/, infrastructure/ or equivalents)
Steering note: Always check if the project already has an AGENTS.md or architecture docs. Adapt your output to match the project's existing naming conventions and layer structure.

Step 3 — Execute the task

Apply patterns from loaded references. Follow mode-specific behavior:

In designing mode:

  • Propose folder structure per comp-screaming-architecture.md (package-by-component)
  • Define port interfaces in application/domain layer, implementations in infrastructure
  • Load decision-tables.md for architecture selection based on domain complexity

In implementing mode:

  • Entities: # private fields, create() + reconstitute() factories, pullDomainEvents()
  • Use cases: constructor-injected ports, Result<T,E> returns, orchestrate-not-implement
  • Adapters: thin controllers (parse, delegate, respond), Zod schemas at boundary
  • import type for all type-only imports across layers

In reviewing mode:

  • Check every guardrail (top of this file) — violations are automatically CRITICAL
  • Check dependency direction: inner layers must never import from outer layers
  • Check entity design: no anemic models, no ORM decorators, proper factories
  • Flag severity: CRITICAL (guardrail), WARNING (quality degradation), INFO (polish)

In refactoring mode:

  • Apply minimal changes. One refactoring at a time.
  • Preserve public API contracts. Preserve test behavior.
  • Load decision-tables.md for anti-pattern recognition table
  • For low-complexity requests, the smallest acceptable boundary split is: pure domain logic, one application entry point, boundary parsing in adapters, and one composition root.
Steering note: Never apply Clean Architecture to a simple CRUD app that doesn't need it. Check domain complexity first. For LOW complexity, vertical slices + Zod + Result types are sufficient. If the user explicitly asks for a refactor toward cleaner boundaries anyway, do the smallest useful version: isolate pure domain logic, keep one composition root, and move boundary parsing to adapters without forcing extra ceremony.

Step 4 — Verify

After making changes:

  1. Read the project's scripts or workspace docs first, then run the strongest project-native typecheck command available (npm run typecheck, pnpm typecheck, tsc --noEmit -p tsconfig.json, or npx tsc --noEmit only if the repo installs TypeScript locally and that command works here)
  2. Run tests if configured (npm test, pnpm test, or project equivalent). If no tests are configured, state that explicitly and fall back to build + typecheck instead of pretending a test step exists.
  3. Check imports: no outer-to-inner violations
  4. Check entities: # private fields, create/reconstitute separation
  5. Check boundaries: ports in consuming layer, implementations in infrastructure

If the project contains TSX but the task is architecture-only, either install the required React runtime/types before typechecking or scope the verification command to the non-UI packages/modules you actually changed. State which path you took.

Step 5 — Deliver

  • Designing: Output folder structure, port interfaces, layer diagram
  • Implementing: Output complete, compilable code with explicit return types
  • Reviewing: Output structured findings list with severity, file, line references
  • Refactoring: Output targeted diffs with before/after
Steering note: Always produce a deliverable — code, findings list, or structure. Never end with only commentary.

Common mistakes to avoid

MistakeWhy it's wrongWhat to do instead
Applying full Clean Architecture to a simple CRUD appOver-engineering; 4+ layers for no benefitUse vertical slices; add layers only when complexity emerges
Sharing one type across all layers ("DRY")DB schema change breaks API; passwordHash leaksPer-layer models with mappers — each has different change reason
Mocking domain entities in testsEntities are pure — mocking defeats the purposeTest entities directly; mock only ports in use case tests
Dispatching events before commitEvent published, DB rolled back = inconsistencyPull events after save, dispatch after commit
Using private keyword on entity fieldsCompile-time only — bypassable with as anyUse # private fields for runtime encapsulation
Putting Zod validation inside domain/use casesWrong layer — parsing belongs at the adapter boundaryParse at HTTP boundary with Zod; domain receives trusted types
Using barrel index.ts in app codeCascade loads 3x+ modules, causes circular depsDirect imports from source files
One constructor for both creation and DB loadingDuplicate event emission on every load; or skipped validationcreate() for new entities, reconstitute() for DB loads
Flagging absence of patterns as violationsOptional patterns (events, CQRS) are not mandatoryOnly audit what exists — don't flag absence of optional patterns

Reference routing

All references live in references/. Load by category:

PrefixCategoryCountKey files
dep-Dependency Direction7dep-inward-only, dep-interface-ownership, dep-dry-vs-duplication, dep-acyclic-dependencies, dep-data-crossing-boundaries, dep-no-framework-imports, dep-stable-abstractions
entity-Entity Design8entity-rich-not-anemic, entity-aggregate-roots, entity-create-reconstitute, entity-domain-services, entity-encapsulate-invariants, entity-no-persistence-awareness, entity-pure-business-rules, entity-value-objects
usecase-Use Case Isolation6usecase-orchestrates-not-implements, usecase-input-output-ports, usecase-explicit-dependencies, usecase-no-presentation-logic, usecase-single-responsibility, usecase-transaction-boundary
code-Clean Code11code-error-handling, code-parse-dont-validate, code-objects-vs-data, code-comments-discipline, code-composition-over-inheritance, code-flag-arguments, code-function-arguments, code-immutability, code-meaningful-names, code-no-side-effects, code-small-functions
comp-Component Cohesion6comp-screaming-architecture, comp-barrel-file-discipline, comp-common-closure, comp-common-reuse, comp-reuse-release-equivalence, comp-stable-dependencies
ts-TypeScript Strictness11ts-strict-config, ts-branded-types, ts-result-type, ts-lsp-performance, ts-boundary-enforcement, ts-conditional-types, ts-discriminated-unions, ts-module-structure, ts-phantom-types, ts-satisfies-operator, ts-verbatim-module-syntax
pattern-Architecture Patterns4pattern-cqrs-separation, pattern-domain-events, pattern-vertical-slices, pattern-repository-ts
bound-Boundary Definition7bound-composition-root, bound-main-component, bound-boundary-cost-awareness, bound-defer-decisions, bound-humble-object, bound-partial-boundaries, bound-service-internal-architecture
adapt-Interface Adapters6adapt-controller-thin, adapt-explicit-architecture, adapt-anti-corruption-layer, adapt-gateway-abstraction, adapt-mapper-translation, adapt-presenter-formats
frame-Framework Isolation5frame-domain-purity, frame-orm-in-infrastructure, frame-di-container-edge, frame-logging-abstraction, frame-web-in-infrastructure
test-Testing Architecture5test-testing-pyramid, test-layer-isolation, test-boundary-verification, test-testable-design, test-tests-are-architecture
—Decision Tables1decision-tables (architecture selector, anti-patterns, conflicts, Do/Don't)

Additional supporting files:

Guardrails — repeated for recall

  • Source dependencies point inward only — domain never imports outer layers
  • Entities use # private fields, create() + reconstitute() factories, Result<T,E> returns using the repo's discriminated union convention
  • Parse at boundary with Zod — never validate inside domain
  • Events dispatched AFTER persistence — never before commit
  • Accept cross-layer DTO duplication — DRY ends at the layer boundary
  • main.ts is the only composition root — the only file that knows all concretions

平台分布

Codex

32.07%
按下载量换算30

Claude

31.24%
按下载量换算29

Cursor

19.96%
按下载量换算19

Gemini CLI

9.79%
按下载量换算9

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

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

安装前确认

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

继续浏览同类 Skills