install
source · Clone the upstream repo
git clone https://github.com/Intense-Visions/harness-engineering
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/Intense-Visions/harness-engineering "$T" && mkdir -p ~/.claude/skills && cp -r "$T/agents/skills/claude-code/vue-slots-pattern" ~/.claude/skills/intense-visions-harness-engineering-vue-slots-pattern-d29636 && rm -rf "$T"
manifest:
agents/skills/claude-code/vue-slots-pattern/SKILL.mdsource content
Vue Slots Pattern
Use named, scoped, and dynamic slots to build flexible, composable component APIs
When to Use
- Building layout components (Card, Modal, Page) where the consumer controls the content
- Creating data-driven components (tables, lists) where the consumer controls how each item renders
- Designing component libraries with maximum flexibility
Instructions
- Use
for the default slot,<slot>
for named slots.<slot name="header"> - Pass data to the consumer via scoped slots:
.<slot :item="item"> - The consumer accesses scoped data with
.<template #slotName="{ item }"> - Provide fallback content inside
tags for when the consumer does not fill the slot.<slot>
<!-- Card.vue --> <template> <div class="card"> <div class="header"><slot name="header">Default Header</slot></div> <div class="body"><slot /></div> <div class="footer"><slot name="footer" /></div> </div> </template> <!-- Consumer --> <Card> <template #header><h2>Custom Title</h2></template> <p>Body content goes in the default slot</p> </Card>
- Use
to check if a slot was provided:$slots
.v-if="$slots.header" - Dynamic slot names:
for runtime-determined slots.<template #[dynamicSlotName]>
Details
Slots are Vue's content distribution mechanism, equivalent to React's
children and render props. They allow parent components to inject content into child component templates. Named slots organize multiple content areas, and scoped slots pass data back to the parent for custom rendering.
Trade-offs:
- Slot-heavy components can be verbose in usage — many
blocks<template #name> - Scoped slots add complexity — the data flow (child-to-parent via slot props) is the reverse of props
- TypeScript support for slot props is improving but still requires explicit typing via
defineSlots()
When NOT to use:
- When the component always renders the same structure — just use props for data
- When only a string or simple value varies — a prop is simpler than a slot
- For behavior sharing — use composables instead of renderless components with scoped slots
Source
https://patterns.dev/vue/slots-pattern
Process
- Read the instructions and examples in this document.
- Apply the patterns to your implementation, adapting to your specific context.
- Verify your implementation against the details and edge cases listed above.
Harness Integration
- Type: knowledge — this skill is a reference document, not a procedural workflow.
- No tools or state — consumed as context by other skills and agents.
Success Criteria
- The patterns described in this document are applied correctly in the implementation.
- Edge cases and anti-patterns listed in this document are avoided.