Commit Graph

23 Commits

Author SHA1 Message Date
John Lindquist 8e24d0694a feat: add chainTo skill chaining, prompt signals, validation upgrades, and dedup reset on context clear
Add a chainTo frontmatter field to skills that triggers follow-up skill injection
when PostToolUse file contents match regex patterns. Add upgradeToSkill/upgradeWhy
fields to validation rules so validate errors can recommend loading a specific skill.
Register posttooluse-bash-chain.mjs in hooks.json. Add ChainToRule interface to
patterns.mts and skill-map-frontmatter.mts, with parseChainToRules() parser. Add
duplicate-key detection to the YAML parser. Reset dedup claim dir and session file
on clear/compact events in session-start-seen-skills so skills re-inject into fresh
context windows.

Add chainTo rules to: agent-browser-verify, agent-browser, ai-elements, ai-gateway,
ai-generation-persistence, ai-sdk, auth, bootstrap, chat-sdk, cms, cron-jobs,
deployments-cicd, email, env-vars, geist, investigation-mode, json-render,
marketplace, micro, ncc, next-forge, nextjs, observability, payments,
react-best-practices, routing-middleware, runtime-cache, satori, shadcn,
sign-in-with-vercel, swr, turbopack, turborepo, v0-dev, vercel-agent, vercel-api,
vercel-cli, vercel-firewall, vercel-flags, vercel-functions, vercel-queues,
vercel-sandbox, vercel-storage, verification, workflow. Add upgradeToSkill to
ai-elements and ai-sdk validate rules. Expand ai-sdk validate messages with
Run Skill() hints. Update nextjs, vercel-storage, runtime-cache, workflow, turborepo
skill bodies.

Add new skills: geistdocs (Geist design system docs), zzz-test-meta-name-mask
(test fixture). Add skills/_chain-audit.md chain coverage audit doc.

Delete .claude-plugin/marketplace.json, .claude-plugin/plugin.json (deprecated),
skills/edge-runtime/SKILL.md (consolidated into vercel-functions).

Add tests: posttooluse-chain.test.ts (4699 lines, chain injection e2e),
ai-sdk-companion.test.ts (181 lines). Expand build-skill-map.test.ts (+335 lines),
validate-rules.test.ts (+936 lines), session-start-seen-skills.test.ts (+74 lines),
skill-map-frontmatter.test.ts (+50 lines), verification-skill.test.ts (+20 lines).

Update build-manifest.ts to emit chainTo rules and upgradeToSkill fields. Rebuild
generated/skill-manifest.json, generated/skill-catalog.md, generated/build-from-skills.manifest.json.
Rebuild all compiled hooks/*.mjs. Update CLAUDE.md lexical prompt default to on.
Update vercel.md ecosystem graph, docs, and cli-reference.
2026-03-11 15:18:35 -06:00
John Lindquist d5b5ef47f7 Replace skill body injection with Skill tool invocation instructions
Instead of injecting the full SKILL.md body as additionalContext, inject
"You must run the Skill(<name>) tool." — a more conventional way of
telling the agent to use the Skill tool for context loading.
2026-03-10 12:46:11 -06:00
John Lindquist b8b233995c feat(skills): broaden trigger patterns for 7 under-injected skills based on eval findings; add next-forge skill; bump to 0.15.0
Eval analysis of 9 real sessions showed 10 skills never triggering despite being
requested. Root causes: pathPatterns too narrow (agents write to lib/email-template.tsx
not emails/), promptSignals containing regex instead of plain text (vercel-sandbox),
and missing promptSignals entirely (v0-dev, vercel-firewall).

Skills updated: email, vercel-queues, edge-runtime, vercel-firewall, chat-sdk,
v0-dev, vercel-sandbox. New skill: next-forge (bootstrap detection).
2026-03-09 17:56:23 -06:00
John Lindquist 5ce557a33e feat(skills): add ai-generation-persistence and verification skills; bump to 0.10.0
New ai-generation-persistence skill (priority 6) injects guidance for treating
AI generations as first-class persistent resources — unique IDs, addressable
URLs, database/Blob storage, cost tracking, and generate-then-redirect UX
patterns. Triggers on AI SDK imports and broad prompt signals.

New verification skill added. Updated ecosystem graph, catalog, manifest,
fixtures, and snapshots.
2026-03-09 12:23:19 -06:00
John Lindquist 2cbc3d45de fix(skills): remove styled-jsx skill in favor of shadcn/tailwind
styled-jsx is no longer recommended — all CSS-in-JS guidance should
point to shadcn/tailwind and existing solutions instead.
2026-03-09 11:08:23 -06:00
John Lindquist 0d404c0b8b fix(skills): allow plain "provider/model" strings as primary gateway syntax
Plain "provider/model" strings (e.g., model: "openai/gpt-5.4") route
through AI Gateway automatically — the gateway() wrapper is optional and
only needed for providerOptions.gateway (routing, failover, tags). Updated
vercel.md, ai-sdk, and ai-gateway skills to match official Vercel docs.
2026-03-09 11:03:25 -06:00
John Lindquist 62f6718d31 feat(skills): remove streamdown skill, expand ai-elements, update profiler and pretool hook, update tests; bump to 0.9.0 2026-03-08 19:50:24 -06:00
John Lindquist 86a57328ec docs(vercel): add UI design defaults
Add a new UI Design Defaults subsection under Conventions so the repo guidance
states the default design system, mode, token, typography, and composition
choices for application UI.

Verified: node -e "const fs=require('fs'); const text=fs.readFileSync('vercel.md','utf8'); const marker='### UI Design Defaults\n\n- For application UI, default to **shadcn/ui + Geist**.'; if(!text.includes(marker)) throw new Error('missing UI Design Defaults section'); const ui=text.indexOf('### UI Design Defaults'); const next=text.indexOf('### Next.js 16'); if(ui===-1||next===-1||ui>next) throw new Error('section not before Next.js 16'); console.log('verified vercel.md UI Design Defaults ordering');"\nHow to test: open vercel.md and confirm the new subsection appears directly before `### Next.js 16`.\nSwarm-Agent: codex-vercel-md
2026-03-08 11:37:44 -06:00
John Lindquist 7cf4462cea Add new skills, tests, and fixtures; bump to 0.4.3 2026-03-06 23:01:38 -07:00
John Lindquist cd5f369dcb Add new skills, typecheck gate, remove arg/ms/serve skills, bump to 0.4.2
- Add 8 new skills: edge-runtime, geist, micro, ncc, satori, streamdown, styled-jsx, swr
- Remove arg, ms, serve skills (standalone utilities, not relevant to shipping apps on Vercel)
- Add typecheck script and wire into `bun run test` and pre-commit hook
- Fix StdioOptions type error in session-start-profiler
- Add hook-env module and posttooluse-shadcn-font-fix hook
- Refactor skill-map-frontmatter, patterns, pretooluse-skill-inject
- Update generated catalog and manifest (42 skills)
- Add .gitignore with .DS_Store
2026-03-06 19:04:25 -07:00
John Lindquist c082f8112e Add auth, cms, email, and payments skills. Update skill catalog and manifest with new entries. Expand observability and vercel-storage SKILL.md content. Update tests (snapshots, patterns, build-skill-map, vercel-config, subagent-fresh-env, redaction) and fixtures (consolidated-payloads, golden-edit/write-middleware, pattern-fixtures). Improve scripts/validate.ts and scripts/explain.ts with enhanced validation and CLI explain logic. Remove deprecated README.txt and remove Inngest skill references from marketplace SKILL.md, vercel.md, skill-catalog.md, and skill-manifest.json — Vercel now uses Workflow DevKit instead. 2026-03-06 13:49:46 -07:00
John Lindquist b725f5308e refactor(hooks): switch to tsup, remove compiled/ intermediate dir
- Replace tsc+cp+rm pipeline with tsup (7ms builds, no intermediate dir)
- tsup compiles hooks/src/*.mts directly to hooks/*.mjs
- tsconfig.json retained for type-checking only (noEmit)
- Remove all .sh references from tests, docs, and hooks.json
- Fix glob pattern test to handle tsup's output format
2026-03-06 13:08:58 -07:00
John Lindquist 5dfbdec117 fix(skills): reference bootstrap and refresh catalogs
Bootstrap was present as a skill directory but missing from graph references, causing orphan-skill and stale catalog validation failures.
Removed the stale fake-orphan test skill directory from the workspace and regenerated generated artifacts so catalog/manifest reflect current skills.

Verified: bun run scripts/build-manifest.ts
Verified: bun test tests/validate.test.ts
Verified: bun run scripts/validate.ts
Swarm-Agent: codex-fix-tests
2026-03-06 11:45:15 -07:00
John Lindquist 50c2b61ad2 chore: bump plugin version to 0.3.4
- Add greenfield project detection to session-start profiler
- Add profiler boost (+5 priority) for likely skills in PreToolUse
- Remove zzz-test-redos-pattern test skill
- Update golden fixtures and snapshots
- Add agent-browser to ecosystem graph
- Add new golden fixture tests
2026-03-06 10:36:58 -07:00
John Lindquist f838270eac refactor(hooks): extract shared patterns module and add validation
Extract glob-to-regex and seen-skills file utilities into hooks/patterns.mjs
for reuse across the PreToolUse hook and validation script. Add
validateSkillMap to skill-map-frontmatter.mjs. Expand plugin tags for
chat-sdk/bot variants. Comprehensive tests for all new modules.
2026-03-05 20:45:14 -07:00
John Lindquist 138090762e Migrate skill triggers from skill-map.json to SKILL.md frontmatter
Replace centralized skill-map.json with frontmatter-based triggers in
each SKILL.md. Add hooks/skill-map-frontmatter.mjs to parse triggers
at runtime. Update validation, tests, and hook logic accordingly.
2026-03-05 15:35:05 -07:00
John Lindquist 753292ffd6 Create three new Vercel skills (cron-jobs, deployments-cicd, env-vars) with SKILL.md files covering setup, CLI commands, and gotchas. Harden the PreToolUse hook (hooks/pretooluse-skill-inject.mjs) by wrapping output in hookSpecificOutput, adding atomic file writes with renameSync, supporting VERCEL_PLUGIN_DEBUG env var alongside VERCEL_PLUGIN_HOOK_DEBUG, and using a safeNow() shim for performance.now compatibility. Expand skill-map.json with new trigger patterns for the added skills and broader coverage for existing ones. Rewrite and expand tests/pretooluse-skill-inject.test.ts to cover the new hook behavior, atomic writes, debug output, and deduplication logic. Add hooks/HOOKS.md documenting the hook architecture. Update vercel.md with new skill references. Add README.txt and vercel.txt with project overview and Vercel platform reference docs. Add .claude/settings.json for project-level Claude settings. 2026-03-05 08:05:14 -07:00
John Lindquist 5b43dbe07f fix: close plugin gaps found during Linear clone build session
- proxy.ts location: document that --src-dir requires src/proxy.ts not root
- @ai-sdk/react: document as required separate install for useChat hooks
- maxSteps removal: replace with stopWhen/stepCountIs across all docs
- toDataStreamResponse: fix remaining v5 references to toUIMessageStreamResponse
- Neon lazy init: add build-time safe pattern (neon() crashes without DATABASE_URL)
- drizzle-kit: document that it doesn't auto-load .env.local
- Marketplace CLI: document AI agent term-acceptance blocker
- Clerk: add org flow gotchas (redirect loop, missing env vars, proxy location)
2026-03-04 18:56:33 -07:00
John Lindquist dab39f5bb6 Add three new skills (ai-elements, shadcn, json-render) and make OIDC the documented default auth for AI Gateway across the plugin.
Create skills/ai-elements/SKILL.md covering the AI Elements component library — 40+ React components for AI chat UIs (Message, Conversation, Tool, Reasoning, CodeBlock, PromptInput) built as a custom shadcn/ui registry. Document installation via `npx ai-elements`, integration with AI SDK v6 useChat/UIMessage parts, server-side patterns (convertToModelMessages async + toUIMessageStreamResponse), and the DefaultChatTransport client pattern.

Create skills/shadcn/SKILL.md covering shadcn/ui — CLI commands (init, add, build, search, migrate), components.json configuration, namespaced custom registries (@v0, @acme), CSS variable theming with oklch, dark mode setup, the cn() utility, TooltipProvider requirement, RTL support, and framework compatibility (Next.js, Vite, Remix, Astro, Laravel).

Create skills/json-render/SKILL.md covering AI chat response rendering — the UIMessage parts format (text, tool-*, reasoning, step-start), manual rendering patterns for custom chat UIs without AI Elements, ToolResultCard patterns for structured tool output display instead of raw JSON, and the 5 most common v6 rendering mistakes (raw JSON from message.content, tool JSON blobs, convertToModelMessages not awaited, toDataStreamResponse vs toUIMessageStreamResponse, v5 useChat API pattern).

In skills/ai-gateway/SKILL.md, add a full "Authentication (OIDC — Default)" section documenting: VERCEL_OIDC_TOKEN provisioned by `vercel env pull`, @vercel/oidc reading the token automatically, ~24h expiry with re-pull for local dev, auto-refresh on Vercel deployments, AI_GATEWAY_API_KEY as manual alternative, and the auth priority order (API key first, then OIDC fallback).

In skills/ai-sdk/SKILL.md, update the setup section to document OIDC as default auth flow (vercel link → enable gateway → vercel env pull → OIDC token auto-provisioned), rewrite the UI Hooks section with both AI Elements (recommended) and manual rendering patterns showing v6 API changes (DefaultChatTransport, sendMessage, status, message.parts), update Key Patterns to include OIDC, AI Elements, and server-side v6 patterns, and expand the migration section with useChat transport, sendMessage, toUIMessageStreamResponse, and message.parts entries.

In vercel.md ecosystem graph: add AI Elements product entry under AI SDK UI Layer with component list and shadcn dependency, add shadcn/ui product entry under Frameworks with CLI commands and registry system, add OIDC Authentication subsection under AI Gateway with token flow, add AI Elements and custom rendering rows to AI Features decision matrix, update "Build an AI Chatbot" workflow with OIDC steps and AI Elements, add 6 new migration table entries (useChat transport, sendMessage, toUIMessageStreamResponse, message.parts, manual API keys → OIDC), and update AI SDK v6 conventions with OIDC-first auth, AI Elements recommendation, and server/client v6 patterns.

In hooks/skill-map.json, add trigger entries for all 3 new skills: ai-elements (components/ai-elements/**, npx ai-elements, shadcn registry URL patterns), shadcn (components.json, components/ui/**, npx shadcn patterns), json-render (components/chat**, components/message*, chat sidebar patterns).

Run the validator (bun run scripts/validate.ts --coverage skip) to confirm all 8 checks pass with 24 skills, 0 orphans, and all skill-map entries valid.
2026-03-04 13:30:50 -07:00
John Lindquist 39940f6acb fix: update model IDs to latest and remove PreToolUse hook
- Remove PreToolUse hook entirely (gateway preference belongs in
  SessionStart conventions, not per-write checks)
- Fix model ID format: use dots not dashes (claude-sonnet-4.6,
  claude-opus-4.6, claude-haiku-4.5)
- Update to latest flagship models from AI Gateway catalog:
  OpenAI: gpt-5.2 (was gpt-5-mini), gpt-5.3-codex, gpt-5-nano
  Anthropic: claude-sonnet-4.6, claude-opus-4.6
  Google: gemini-3-flash (was gemini-2.5-flash),
          gemini-3.1-pro-preview (was gemini-2.5-pro)
- Update providers reference table with current model lineup
2026-03-04 12:24:22 -07:00
John Lindquist ef3a7bbfb6 feat: enforce AI Gateway as default over direct provider SDKs
Addresses a gap where the plugin allowed agents to use direct provider
SDKs (@ai-sdk/anthropic, @ai-sdk/openai) with manual API keys instead
of routing through Vercel AI Gateway, which provides auto-provisioned
credentials, failover, cost tracking, and observability.

Changes:
- PreToolUse hook: add 3 new checks (10-12) for AI Gateway preference,
  deprecated generateObject/streamObject, and provider API key env vars
- vercel.md: update AI Features decision matrix to make AI Gateway the
  default row, add AI project bootstrap workflow, update Conventions to
  lead with gateway-first and vercel-link-first guidance
- ai-sdk SKILL.md: rewrite Installation, add Setup for AI Projects
  section, update all code examples to use gateway() instead of direct
  provider imports, update Key Patterns to prioritize gateway
2026-03-04 11:20:08 -07:00
John Lindquist 4c9cc93665 fix: update generateObject/streamObject to AI SDK v6 Output.object() API
generateObject and streamObject are deprecated in AI SDK v6. Replace all
usage and documentation with generateText/streamText + Output.object().

Also:
- Expand migration tables with CoreMessage, Experimental_Agent deprecations
- Simplify validator to check metadata only (components discovered from dirs)
- Add date to vercel.md header
2026-03-04 11:07:22 -07:00
John Lindquist 909db57f41 feat: inject vercel.md via SessionStart hook instead of CLAUDE.md
Plugins don't support CLAUDE.md natively. Rename CLAUDE.md to vercel.md
and add a SessionStart hook that cats it into the session context.
2026-03-04 10:45:53 -07:00