Files
John Lindquist 66ea38ab23 refactor: replace bundled skills with engine/ rules + registry resolution
This is a fundamental architectural shift: the plugin no longer ships
skill content. Instead it ships a rules engine (engine/*.md) that
defines WHEN to load skills, and relies on the npx skills registry
(skills.sh/vercel, skills.sh/vercel-labs) to provide WHAT skills say.

## What changed

### New: engine/ directory (40 human-editable rule files)
Each file is a markdown document with YAML frontmatter containing:
- pathPatterns, bashPatterns, importPatterns (file/command matching)
- promptSignals (user prompt scoring: phrases, allOf, anyOf, noneOf)
- validate rules (PostToolUse file validation with severity levels)
- chainTo rules (conditional skill chaining with skipIfFileContains)
- retrieval metadata (aliases, intents, entities for discovery)
- priority, docs URLs, sitemap URLs
- registry source (e.g. "vercel/vercel-skills")

The markdown body serves as a summary fallback when the full skill
content isn't cached locally.

### New: scripts/build-manifest.ts (rewritten)
Now reads engine/*.md instead of skills/*/SKILL.md. Compiles
glob→regex at build time and outputs generated/skill-rules.json.
No dependency on VERCEL_PLUGIN_SKILLS_DIR or local skill sources.

### New: test infrastructure
- tests/helpers/mock-skill-cache.ts — generates a temp
  ~/.vercel-plugin/skills/ directory with stub SKILL.md files
  derived from skill-rules.json for test use
- tests/helpers/preload-mock-cache.ts — bun test preload that
  sets VERCEL_PLUGIN_HOME_DIR before any test runs
- bunfig.toml updated with preload

### Removed: skills/ directory (all 40 bundled skills)
The plugin no longer ships skill bodies. At runtime, hooks resolve
skill content from:
1. ~/.vercel-plugin/projects/<hash>/.skills/ (project cache)
2. ~/.vercel-plugin/skills/ (global cache, populated by npx skills)
3. generated/skill-rules.json (metadata-only fallback)

### Removed: 13 test files
Tests that validated build-time skills/ scanning, SKILL.md
frontmatter parsing, snapshot generation, and other behaviors
tied to bundled skills. The remaining 1383 tests pass.

## Architecture going forward

The decoupling is complete:
- engine/*.md = routing rules (owned by plugin, human-editable)
- npx skills = content delivery (owned by Vercel skills team)
- ~/.vercel-plugin/ = runtime cache (populated on first session)
- generated/skill-rules.json = compiled rules (build artifact)

Skills not yet published to the registry will match via the rules
engine but inject only their summary text and docs/sitemap URL
until the Vercel team publishes them.
2026-04-02 00:23:45 -06:00

1.2 KiB

name, priority, docs, sitemap, pathPatterns, chainTo, retrieval
name priority docs sitemap pathPatterns chainTo retrieval
json-render 4 https://nextjs.org/docs/app/api-reference/file-conventions/route https://nextjs.org/sitemap.xml
components/chat/**
components/chat-*.tsx
components/chat-*.ts
src/components/chat/**
src/components/chat-*.tsx
src/components/chat-*.ts
components/message*.tsx
src/components/message*.tsx
pattern targetSkill message
message.content\b|tool-invocation ai-sdk Deprecated UIMessage v5 rendering pattern (message.content / tool-invocation) — loading AI SDK v6 guidance for message.parts migration.
pattern targetSkill message
react-markdown|ReactMarkdown|dangerouslySetInnerHTML ai-elements Manual markdown rendering of AI content detected — loading AI Elements for streaming-aware, safe AI message rendering.
aliases intents entities
chat rendering
ai response display
message parts
tool call ui
render chat messages
display tool calls
show streaming response
format ai output
UIMessage
tool call
streaming
message parts

Guidance for json-render. Install from registry for full content.