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

new-quill-field

Skill0 starsChanged 8 months agoMITView on GitHub

Scaffold a Quill rich text editor component. Use when the user asks to create a rich text editor, WYSIWYG field, content editor, or any Quill-based input.

  • Installs packages

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 1 is distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

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

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

    ALWAYS wrap in <ClientOnly> — Quill requires the DOM, SSR will break

    line 9
  2. Very specific:

    Always provide a #fallback slot with a skeleton placeholder

    line 10
  3. Very specific:

    Use content-type="html" — content is stored as HTML string in Postgres

    line 11
  4. Very specific:

    Always sanitize HTML server-side before storing (remind user to use sanitize-html)

    line 12
  5. Very specific:

    Use v-model:content not v-model

    line 13
  6. Distinctive:

    If image upload is needed, ask about image storage strategy (local, S3, etc.)

    line 114

≈ “Common” is an estimate: at least 1 in 5 of the 372,429 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.

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

Skill: New Quill Field

Rules

  • ALWAYS wrap in <ClientOnly> — Quill requires the DOM, SSR will break
  • Always provide a #fallback slot with a skeleton placeholder
  • Use content-type="html" — content is stored as HTML string in Postgres
  • Always sanitize HTML server-side before storing (remind user to use sanitize-html)
  • Use v-model:content not v-model
  • Expose as a form-compatible component with v-model support via defineModel
  • Place in components/editor/

Component Template

<!-- components/editor/RichTextField.vue -->
<script setup lang="ts">
import { QuillEditor } from '@vueup/vue-quill'
import '@vueup/vue-quill/dist/vue-quill.snow.css'

interface Props {
  placeholder?: string
  readOnly?: boolean
  toolbar?: 'minimal' | 'full' | 'custom'
}

const props = withDefaults(defineProps<Props>(), {
  placeholder: '',
  readOnly: false,
  toolbar: 'full',
})

// Two-way binding via defineModel
const content = defineModel<string>({ default: '' })

const toolbarOptions = {
  minimal: [
    ['bold', 'italic', 'underline'],
    [{ list: 'ordered' }, { list: 'bullet' }],
    ['clean'],
  ],
  full: [
    [{ header: [1, 2, 3, false] }],
    ['bold', 'italic', 'underline', 'strike'],
    [{ color: [] }, { background: [] }],
    [{ list: 'ordered' }, { list: 'bullet' }],
    [{ align: [] }],
    ['link', 'image'],
    ['clean'],
  ],
  custom: [], // override via slot or prop if needed
}

const quillOptions = computed(() => ({
  placeholder: props.placeholder,
  readOnly: props.readOnly,
  modules: {
    toolbar: toolbarOptions[props.toolbar],
  },
}))
</script>

<template>
  <div class="rich-text-field">
    <ClientOnly>
      <QuillEditor
        v-model:content="content"
        content-type="html"
        :options="quillOptions"
        class="min-h-[200px] rounded-md border border-input bg-background"
      />
      <template #fallback>
        <div class="h-[200px] animate-pulse rounded-md border border-input bg-muted" />
      </template>
    </ClientOnly>
  </div>
</template>

Usage in a Form

<RichTextField
  v-model="form.content"
  placeholder="Write your article..."
  toolbar="full"
/>

Server-side Sanitization (ALWAYS add this to resolvers)

// In your GraphQL mutation resolver before saving to DB:
import sanitizeHtml from 'sanitize-html'

const cleanContent = sanitizeHtml(input.content, {
  allowedTags: sanitizeHtml.defaults.allowedTags.concat(['img', 'h1', 'h2', 'h3']),
  allowedAttributes: {
    ...sanitizeHtml.defaults.allowedAttributes,
    img: ['src', 'alt', 'title'],
  },
})

Steps

  1. Generate the components/editor/RichTextField.vue component
  2. Remind the user to install: npm install @vueup/vue-quill sanitize-html @types/sanitize-html
  3. Remind the user: ALWAYS sanitize in the server resolver before storing to Postgres
  4. If image upload is needed, ask about image storage strategy (local, S3, etc.)

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.