vue3-composition
Skill0 starsChanged 2 months agoMITView on GitHub
Write Vue 3 Composition API code that scales past the demo — component contracts, provide/inject boundaries, v-model conventions, and when NOT to extract a composable. Use when building or reviewing Vue 3 components, composables or stores.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- MsNan/vue-uniapp-skillstheir own version, first seen Oct 17, 2026
- caiqianha/vue-skillstheir own version, first seen Oct 11, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- caiqianha/vue-skills★ 2same name
- MsNan/vue-uniapp-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository11 other files it gives its agents.
- api-contract-designSkill
- browser-debuggingSkill
- component-reviewSkill
- css-architectureSkill
- frontend-testing-strategySkill
- nextjs-performanceSkill
- performance-budgetSkill
- react-hooks-disciplineSkill
- state-managementSkill
- typescript-strictnessSkill
- web-a11ySkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 29
Props are data, not config soup: If you pass more than 5 booleans, the component is doing two jobs — split it.
- Distinctive: line 43
If two components communicate via provide/inject and neither is an ancestor factory, that's a hidden global — use a store instead.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Vue 3 Composition API discipline
Contracts first
A component is an API. Before writing markup, write the contract:
// ❌ implicit contract — every prop optional, everything stringly-typed
defineProps(['item', 'dense', 'onChange'])
// ✅ explicit, typed, minimal
const props = withDefaults(defineProps<{
item: Todo
dense?: boolean
}>(), { dense: false })
const emit = defineEmits<{
change: [value: Todo['id'], source: 'user' | 'sync']
}>()Rules:
- Props are data, not config soup. If you pass more than 5 booleans, the component is doing two jobs — split it.
defineEmitswith tuple syntax — typed payloads prevent the "what's in$eventagain" archaeology.v-modelper field, not per form.v-model:titlebeats passing objects withupdate:*noise.
provide/inject boundaries
provideis for framework-level context (theme, i18n, feature flags), not for skipping props.- Injection keys must be typed and exported from one module:
// keys.ts
export const THEME_KEY: InjectionKey<Theme> = Symbol('theme')- If two components communicate via provide/inject and neither is an ancestor factory, that's a hidden global — use a store instead.
Composables: extract behavior, not syntax
Extract a composable when you have stateful behavior (timer, subscription, undo stack), not to save lines:
// ✅ behavior: owns state + lifecycle
export function useInterval(cb: () => void, ms: MaybeRef<number>) {
let id: ReturnType<typeof setInterval> | undefined
watch(() => toValue(ms), (ms) => {
if (id) clearInterval(id)
if (ms > 0) id = setInterval(cb, ms)
}, { immediate: true })
onScopeDispose(() => id && clearInterval(id))
}Anti-patterns:
useXxx()that only wraps a computed — that's a function, keep it plain.- Composables that call
onMountedfor side effects instead ofwatch/watchEffect— breaks SSR and testability.
Reactivity: don't lose the thread
- Destructuring props breaks reactivity — use
toRefs(props)or keepprops.x. reactive()for objects,ref()for primitives and API results. Mixingreactivearrays with replacement logic is a classic bug source; preferref<T[]>+value = next.- Async state: derive with
computedfrom a single source of truth (status+data+error), never three parallel refs you must keep in sync.
Performance without micro-optimizing
- Reach for
shallowReffor large lists you replace wholesale. v-memoonly with measured renders; it's a contract that the memo deps fully determine output — wrong deps = stale UI.- Virtualize lists > 1k rows; don't paginate what users scroll.
Definition of done (agent checklist)
- Props/emits are typed; no
defineProps(['a','b']) - No prop drilling past 2 levels (provide or store instead)
- Every composable owns its cleanup (
onScopeDispose) - SSR-safe: no
window/documentoutside lifecycle guards - List rendering keyed by stable ids, never index
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

