All skills
skilld-dev avatar

/unhead-vue-skilld

@b9c39cb

Full-stack <head> manager for Vue (@unhead/vue 3.x). Use when writing, reviewing, or debugging code that imports @unhead/vue, calls useHead, useSeoMeta, useHeadSafe, useScript, injectHead, createHead, or sets up Unhead SSR / streaming SSR / build plugins in a Vue app.

Use this Skill: https://skilld.dev/gh/skilld-dev/vue-ecosystem-skills/unhead-vue-skilld

This session only. Nothing lands on disk.

referencesbuild-plugins.md

≈703 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Build plugins

Unified bundler entry (3.4.1)

@unhead/vue/bundler exports Unhead(options?) returning a factory with per-bundler dispatch: .vite(), .webpack(), .rspack(), .rollup() (dist/bundler.d.ts:15-19, dependency @unhead/bundler).

// vite.config.ts
import { Unhead } from '@unhead/vue/bundler'
export default defineConfig({ plugins: [...Unhead({ streaming: true }).vite()] })

// Nuxt kit
addBuildPlugin(Unhead({ streaming: true }))

@unhead/vue/vite exports Unhead(options?): Plugin[] directly; it still works but the /bundler entry is preferred (dist/vite.d.ts:8-14).

Options

From the build plugins overview (https://unhead.unjs.io/docs/head/guides/build-plugins/overview):

Option Type Default Effect
treeshake object | false enabled strip server-only composables from the client bundle
transformSeoMeta object | false enabled rewrite useSeoMeta() to useHead() (~3kb smaller)
minify object | false disabled pre-minify static inline script/style
validate boolean enabled inject ValidatePlugin in dev for tag warnings
devtools object | false enabled Vite DevTools inspection (dev only)
filter object — shared include/exclude file filter
sourcemap boolean — sourcemaps for transforms
streaming { mode } disabled enable streaming SSR wiring (UnheadVueStreamingOptions, dist/shared/vue.B_EhRTsW.d.ts:3-11)

What the plugin does

  • Tree-shakes deprecated server composables (useServerHead*) and useSchemaOrg calls from client bundles.
  • Converts useSeoMeta() calls into useHead() at build time.
  • Streaming mode: wires the client bootstrap (virtual iife module + transformIndexHtml head-prepend). Vue needs no source transform; per-chunk head patches are emitted by wrapStream on the server as self-deleting inline scripts (dist/shared/vue.B_EhRTsW.d.ts:5-10).
  • Dev validation: ValidatePlugin warns about missing opt-in plugins and deprecated props in the browser console.

Webpack / rspack

import { Unhead } from '@unhead/vue/bundler'
export default { plugins: [Unhead().webpack()] }

Nuxt configures everything automatically; do not add the plugin manually in Nuxt.

ValidatePlugin without the build plugin

import { ValidatePlugin } from 'unhead/plugins' // also via @unhead/vue/plugins
const head = createHead({ plugins: [ValidatePlugin()] })

Warns on: missing TemplateParamsPlugin (params render literally), missing AliasSortingPlugin (before:/after: silently ignored), deprecated props (children, hid, vmid, body: true), removed { mode } option. Rules are configurable: ValidatePlugin({ rules: { 'missing-template-params-plugin': 'off' } }).

Source: SKILL.md on GitHub

No alerts9d3 checks · Risk SAFE
  • Gen Agent Trust Hub9d

    The unhead-vue-skilld skill is an extensive documentation resource for the Unhead library, focusing on Vue integration for managing document head tags. It is safe for use and follows standard development and documentation practices. The analysis identifies a potential indirect prompt injection surface where user-provided data could lead to Cross-Site Scripting (XSS) if rendered unsafely. However, the documentation correctly identifies this risk and provides a security-focused 'useHeadSafe' composable specifically designed to mitigate such issues.

  • Socket9d

    No alerts

  • Snyk9d

    Risk: LOW · No issues

Signed by skilld at b9c39cb. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub last week.

Activeupdated last week

README badge

README badge for skilld-dev/vue-ecosystem-skills/unhead-vue-skilld