Commit Graph

21 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
melkeydev fd61d00d91 removing setup hook that doesnt exist 2026-03-11 14:11:14 -07:00
melkeydev 55eeae089f adding telemetry 2026-03-11 10:46:51 -07:00
melkeydev c7a13ac307 adding telemetry 2026-03-11 09:23:07 -07:00
melkeydev 0493dbcd70 adding telemetry 2026-03-10 22:04:10 -07: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 1e0fc2467c feat(hooks): wire subagent launch bootstrap
Connect SubagentStart to pending launch records so prompt-signal matches
can be merged into likely skills before context assembly.
SessionEnd now cleans hashed pending-launch temp directories and the
hook registry observes Agent tool launches.

Verified: node --input-type=module -e "import { build } from 'tsup'; await build({ entry: ['hooks/src/subagent-start-bootstrap.mts','hooks/src/session-end-cleanup.mts'], format: ['esm'], outDir: 'hooks', outExtension: () => ({ js: '.mjs' }), bundle: false, splitting: false, sourcemap: false, dts: false, clean: false, target: 'node20' });"
Verified: bun test tests/subagent-start-context.test.ts tests/session-end-cleanup.test.ts
Swarm-Agent: codex-wiring
2026-03-09 16:30:02 -06:00
John Lindquist 92dbe3ae02 feat(hooks): add SubagentStart/SubagentStop hooks for subagent skill injection; bump to 0.14.0
- SubagentStart bootstrap hook injects project context (likely skills, summaries) into spawned subagents
  with budget scaling by agent type (minimal for Explore/Plan, standard for general-purpose)
- SubagentStop sync hook writes agent metadata to a session-scoped JSONL ledger for observability
- SessionEnd cleanup extended to remove subagent ledger files
- Updated ai-elements/nextjs skills, benchmark-agents and eval skill definitions
2026-03-09 15:52:56 -06:00
John Lindquist 5d548e5be8 fix(security): address audit findings — path traversal, brace expansion, injection escaping, profiler hardening; bump to 0.12.0
- Validate sessionId in dedupClaimDirPath() to prevent path traversal (HIGH)
- Add brace expansion pre-pass in globToRegex for {ts,js,mjs} patterns (HIGH)
- Escape --> sequences in HTML comment metadata blocks (MEDIUM)
- Harden checkVercelCli/checkAgentBrowser with 3s timeouts, suggest latest version (MEDIUM)
- Replace silent catch {} blocks with debug logging (LOW)
- Add semver-aware version comparison (LOW)
- Update golden snapshots and fix invocationId sharing
2026-03-09 14:18:43 -06:00
John Lindquist 23e6a56461 feat(hooks): add SessionEnd cleanup hook, update docs and version; bump to 0.5.6
Add session-end-cleanup.mts that deletes temp dedup files when session ends:
1. Create hooks/src/session-end-cleanup.mts — reads session_id from stdin JSON,
   deletes tmpdir/vercel-plugin-<sessionId>-seen-skills.txt and validated-files.txt
2. Register SessionEnd hook in hooks/hooks.json
3. Add entry point to hooks/tsup.config.ts
4. Update CLAUDE.md dedup contract to document file-based persistence + cleanup
5. Bump .plugin/plugin.json to 0.5.6, rebuild manifest
2026-03-07 14:59:22 -07:00
John Lindquist ff251ab018 refactor(hooks): move audit log to ~/.claude/projects dir; add validate hooks, prompt patterns, benchmark suite; bump to 0.5.1 2026-03-07 12:31:10 -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 ba2aec03bb refactor(hooks): convert shell scripts to TypeScript
Convert inject-claude-md.sh and session-start-seen-skills.sh to .mts
source with compiled .mjs output. All hooks are now TypeScript.
Update hooks.json to invoke with node instead of bash.
2026-03-06 12:59:48 -07:00
John Lindquist a5b9f7320a chore: bump plugin version to 0.3.2 2026-03-06 09:48:04 -07:00
John Lindquist 8adc0eabdb feat(hooks): bootstrap seen-skills file on SessionStart
SessionStart now creates a per-session seen-skills text file and exports
VERCEL_PLUGIN_SEEN_SKILLS through CLAUDE_ENV_FILE before PreToolUse runs.
This enables env-file dedup bootstrap without altering existing PreToolUse hook wiring.

Verified: bun test tests/session-start-seen-skills.test.ts
Verified: bun test tests/pretooluse-skill-inject.test.ts -t "hooks.json PreToolUse config"
Swarm-Agent: session-start-hook-bootstrap
2026-03-05 20:21:58 -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 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
John Lindquist 211611ade6 docs(skills,commands): expand command guides, skill docs, and validation logic
Add detailed command conventions, enrich deploy/env/marketplace/status
command docs, strengthen validation script with CLI reference tooling,
and expand skill documentation for marketplace, observability, API,
CLI, and storage skills. Update ecosystem graph and verification checklist.
2026-03-04 08:58:53 -07:00
John Lindquist 2a56636bbe Initial commit: vercel-plugin project setup 2026-03-03 15:13:06 -07:00