agentleFS
violacaseviolacase/Nuxt4-test/.claude/skills/new-component/SKILL.md

new-component

Skill0 starsChanged 8 months agoMITView on GitHub

Scaffold a new Vue 3 component using reka-ui primitives and Tailwind CSS. Use when the user asks to create a component, UI element, widget, or any .vue file in the components/ directory.

8 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use new-page.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • kkhh26864Skill

    new-page

    Vue 2 page creation specialist. Auto-triggers when user wants to: create new page, add page, build page, new vue page, create vue component page. Handles: page structure, routing, Vant components, Tailwind styling, mobile optimization. Works with Vue 2.6.11, Vant 2.13.2, Tailwind CSS, Vue Router.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

8 rules. 0 are common, 2 are distinctive, and 6 are very specific to this project.

  • 0

    Common

    Most of the 7 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Always use <script setup lang="ts"> — never Options API

    line 9
  2. Distinctive:

    Use reka-ui primitives where applicable (Dialog, Popover, Select, etc.)

    line 12
  3. Very specific:

    Use cn() from ~/lib/utils for conditional class merging

    line 13
  4. Very specific:

    Use useI18n() for all user-facing strings

    line 15
  5. Very specific:

    Place in components/ui/ for primitives, components/ root for domain components

    line 17
  6. Distinctive:

    Ask the user: what does this component do, what props does it need, does it use reka-ui?

    line 84
  7. Very specific:

    If it uses GraphQL data, import the correct type from ~/types/gql

    line 87
  8. Very specific:

    If it contains user-facing text, use t('key') and add key to app/locales/en.json

    line 88

“Common” is measured: kept by at least 6 in 10 of the 7 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Skill: New Component

Rules

  • Always use <script setup lang="ts"> — never Options API
  • Props via TypeScript interface + withDefaults
  • Emits via typed defineEmits
  • Use reka-ui primitives where applicable (Dialog, Popover, Select, etc.)
  • Use cn() from ~/lib/utils for conditional class merging
  • Tailwind semantic utilities only — no raw color classes, no inline styles
  • Use useI18n() for all user-facing strings
  • Single root element in template
  • Place in components/ui/ for primitives, components/ root for domain components

Template

<script setup lang="ts">
import { cn } from '~/lib/utils'
// import { SomeRekaComponent } from 'reka-ui'
// import type { MyType } from '~/types/gql'

interface Props {
  // required props first, optional after
  label: string
  variant?: 'default' | 'outline' | 'ghost'
  disabled?: boolean
  class?: string
}

const props = withDefaults(defineProps<Props>(), {
  variant: 'default',
  disabled: false,
})

const emit = defineEmits<{
  click: [event: MouseEvent]
}>()

const { t } = useI18n()

// Reactive state
// const isOpen = ref(false)

const classes = computed(() =>
  cn(
    'base classes here',
    props.variant === 'outline' && 'border border-border',
    props.disabled && 'opacity-50 cursor-not-allowed',
    props.class,
  ),
)
</script>

<template>
  <div :class="classes">
    <!-- component content -->
  </div>
</template>

Color Class Reference

Semantic tokenTailwind class
Page backgroundbg-background
Card/panel bgbg-card
Primary texttext-foreground
Secondary texttext-muted-foreground
Borderborder-border
Action color (blue)bg-primary / text-primary
Text on action bgtext-primary-foreground
Hover bgbg-accent
Error/dangertext-destructive
Successtext-success
Warningtext-warning

Steps

  1. Ask the user: what does this component do, what props does it need, does it use reka-ui?
  2. Identify the correct components/ subdirectory
  3. Generate the component following the template above
  4. If it uses GraphQL data, import the correct type from ~/types/gql
  5. If it contains user-facing text, use t('key') and add key to app/locales/en.json

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.