跳至正文
OpenAgentSkill
浏览已开放 · 目录记录日期 2026-11-21 · 自动更新和账户服务暂时关闭。
其他技能

vue-clean-components

Rules for structuring Vue 3 components so humans can read and maintain them. Component level hierarchy (Page/Feature/Controller/Humble/Atomic), composable lifecycle cohesion, Core-Adapter separation, props drilling resolution, and store responsibility boundaries. Use when writing, splitting, or refactoring Vue components.

KIMJINWOO4 · 已有静态检查记录

安装与使用

运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。

npx skills add KIMJINWOO4/vue-skills --skill vue-clean-components

技能说明


name: vue-clean-components description: Rules for structuring Vue 3 components so humans can read and maintain them. Component level hierarchy (Page/Feature/Controller/Humble/Atomic), composable lifecycle cohesion, Core-Adapter separation, props drilling resolution, and store responsibility boundaries. Use when writing, splitting, or refactoring Vue components. license: MIT

Vue Clean Components

Rules for writing Vue 3 components that are easy for humans to read and maintain. Based on Michael Thiessen's Clean Components Toolkit and the toss.tech Core-Adapter pattern.

When to Use

  • Writing or refactoring Vue components
  • A component exceeds 150 lines
  • Props exceed 5 or include 3+ handler functions
  • A composable exceeds 200 lines or mixes unrelated lifecycle concerns
  • A store mixes UI state with business state
  • User requests "component split", "refactor", or "readability improvement"

Quick Reference

Working on...Load file
Deciding component levelreferences/component-levels.md
When/how to splitreferences/split-decision-tree.md
Composable structurereferences/composable-lifecycle.md
Core-Adapter separationreferences/core-adapter.md
Props drilling fixreferences/props-resolution.md
Store boundariesreferences/store-boundary.md
Boilerplate extractionreferences/boilerplate-extraction.md

Key Principles

  1. Every component has a level (L0-Page → L4-Atomic) with strict responsibility boundaries
  2. A composable is a lifecycle unit: keep a related ref, its watcher and its cleanup together
  3. Core-Adapter separation: business logic in plain TypeScript, Vue reactivity in thin composables
  4. No props drilling beyond one level: use provide/inject or a store
  5. Stores hold only shared business state: UI-only state stays in components
  6. Extract boilerplate after three repetitions, not before

Pattern Sources

RuleSource
Level HierarchyController + Humble Components (Thiessen)
Split DecisionLong Components + Hidden Components (Thiessen)
Core-AdapterThin Composables (Thiessen) + Framework Agnostic (toss.tech)
Lifecycle CohesionReact Custom Hooks principle
Props ResolutionProps Down Events Up + Preserve Whole Object (Thiessen)
Store BoundaryData Store + Lightweight State Management (Thiessen)
Conditional SplitExtract Conditional + Strategy (Thiessen)
Loop SplitList Component + Item Component (Thiessen)