Commit Graph

60 Commits

Author SHA1 Message Date
melkeydev 61b2838afb updating cursor plugin requirements 2026-03-12 14:10:55 -07:00
John Lindquist 8e3350454c feat: prompt scoring improvements, compaction re-injection, validation dedup, strip droppedByCap from context; bump to 0.18.0
- Add dominant-topic suppression (top score >= 600 filters scores < 50)
- Add project-context boost (+3 for VERCEL_PLUGIN_LIKELY_SKILLS skills)
- Add lexical fallback floor (reject raw score < 20)
- Add compaction re-injection for priority >= 7 skills (VERCEL_PLUGIN_CONTEXT_COMPACTED)
- Add validation rule dedup tracking (ruleId + filePath on violations)
- Strip droppedByCap from injected HTML comments (kept in debug logs)
- Fix ncc/SKILL.md and next-forge/SKILL.md YAML frontmatter
- Add startup diagnostic for broken skill frontmatter
2026-03-11 19:01:59 -06:00
John Lindquist b7e9b1b053 feat: merge upstream telemetry + Cursor compat, fix tests and dedup migration; bump to 0.17.0 2026-03-11 16:12:55 -06:00
John Lindquist 7a124e6561 Add sitemap field to skill metadata: parse metadata.sitemap in skill-map-frontmatter.mts, add sitemap to SkillConfig interface and KNOWN_KEYS, render sitemap URLs in buildDocsBlock() alongside doc links, include sitemap in generated manifest, and add sitemap URLs to 35 SKILL.md files for domains that have sitemap.xml. Also fix 15 broken doc URLs across 14 skills (vercel.com/docs path changes, anthropic docs, stripe, descope, flags-sdk, ai-sdk). Bump to 0.16.1. 2026-03-10 14:31:40 -06:00
John Lindquist 5dffded3d5 Replace skill body injection with Skill tool invocation; bump to 0.16.0
Instead of injecting full SKILL.md bodies as additionalContext, hooks now
inject "You must run the Skill(<name>) tool." — leveraging the conventional
Skill tool mechanism for context loading.
2026-03-10 12:46:54 -06:00
John Lindquist 5948eb1497 Scan every skills/*/SKILL.md file for documentation URLs, HTTP-check each one for 404s, and replace broken links with verified live alternatives. Broken URLs found: vercel.com/docs/marketplace → /docs/integrations, vercel.com/docs/marketplace/sign-in-with-vercel → /docs/sign-in-with-vercel, vercel.com/docs/functions/middleware → /docs/routing-middleware, vercel.com/docs/getting-started → /docs/getting-started-with-vercel, vercel.com/docs/infrastructure/runtime-cache → /docs/runtime-cache, vercel.com/docs/content → /docs/solutions/cms, vercel.com/docs/queues/api-reference → /docs/queues/api, vercel.com/docs/security/secure-backend-access/oidc-federation → /docs/oidc, vercel.com/docs/workflow/flags → /docs/feature-flags, flags-sdk.dev/docs/upgrade-guide → github.com/vercel/flags upgrade-to-v4.md, ai-sdk.dev/docs/reference/types/ui-message → /docs/reference/ai-sdk-core/ui-message, docs.anthropic.com/en/docs/claude-code/agent-tool-use → /sub-agents, docs.descope.com/sdks/nextjs → /getting-started/nextjs, docs.stripe.com/libraries/node → /sdks, vercel.com/blog/ncc → github.com/vercel/ncc. Rebuild manifest. Bump to 0.15.1. 2026-03-10 12:32:09 -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 0c49abc547 fix(skills): quote YAML validate patterns ending with colon to fix js-yaml parse errors; bump to 0.14.1 2026-03-09 16:38:11 -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 f15a7d6889 feat(eval): ai-elements validate rules, broader workflow promptSignals, wider chat pathPatterns; bump to 0.13.0
- ai-elements: add PostToolUse validate rules catching raw part.text rendering,
  react-markdown, and dangerouslySetInnerHTML — guides agent to use MessageResponse
- ai-elements: add *chat* and *message* wildcard pathPatterns (catches flight-chat.tsx etc.)
- workflow: add 8 phrases for reliability language ("individually reliable",
  "retry on transient", "transient failures", etc.)
- workflow: add 7 allOf pairs ([retry, transient], [reliable, retry], [sandbox, reliable], etc.)
2026-03-09 15:17:38 -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 f035d9afb3 fix(inject): strip YAML frontmatter from skill bodies before injection; bump to 0.11.1
Skill frontmatter (pathPatterns, bashPatterns, promptSignals, etc.)
was being injected alongside the skill body, wasting token budget on
metadata only useful for hook matching. Now uses extractFrontmatter()
to emit only the markdown body.
2026-03-09 13:43:45 -06:00
John Lindquist 7ac8edfb8f feat(skills): aggressive prompt signals for workflow/sandbox, "check the docs" directives across 8 skills; bump to 0.11.0
- workflow: add ~60 new promptSignal phrases for reliability language
  (survive page reload, fault-tolerant, retry on failure, session
  persistence, reconnect, durable chat/agent), human-in-the-loop
  patterns (approval, pause until, wait for), and pipeline vocabulary.
  Add ~25 new allOf pairs and 12 new anyOf terms.

- vercel-sandbox: add promptSignals from scratch (had none). 33 phrases
  covering isolated execution, sandbox environments, code safety,
  FFmpeg/media processing, code playgrounds, and tutor patterns.
  27 allOf pairs, 8 anyOf terms, noneOf excludes iframe/codesandbox.

- Add "CRITICAL — your training data is outdated" blockquote at the top
  of 8 fast-moving skill bodies (workflow, ai-sdk, vercel-sandbox,
  ai-gateway, chat-sdk, vercel-flags, vercel-queues, ai-elements)
  directing agents to fetch docs before writing code.

Eval results that motivated these changes:
- content-pipeline: 9/10 (workflow triggered, correct WDK patterns)
- customer-support: 3/10 → workflow never injected (now scores 50)
- code-sandbox-tutor: 1/10 → sandbox never injected (now scores 80)
2026-03-09 13:16:16 -06:00
John Lindquist 300488ebf3 fix(workflow): add explicit --no-src-dir guidance for create-next-app, update golden fixtures; bump to 0.10.1 2026-03-09 12:55:59 -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 ff965cc377 fix(skills): remove styled-jsx, regenerate catalog, add investigation-mode skill, build-from-skills templates; bump to 0.9.10 2026-03-09 11:38:08 -06:00
John Lindquist 81a6da32f7 fix(ai-sdk): add validate rules for direct openai() model bypass, dall-e-3, and experimental_generateImage; bump to 0.9.9 2026-03-09 08:10:50 -06:00
John Lindquist a43cb60a64 fix(skills): stronger outdated model warnings with "your knowledge is outdated" language, make AI Elements mandatory for AI text rendering; bump to 0.9.8 2026-03-09 07:59:56 -06:00
John Lindquist 2ca648a62f fix(ai-sdk): add PostToolUse validate rules for outdated image models, placeholder images, and removed generateObject; bump to 0.9.7 2026-03-09 00:41:53 -06:00
John Lindquist 60168d8c0a fix(skills): update image generation to use AI Gateway with gemini-3.1-flash-image-preview default, remove incorrect "gateway doesn't support image gen" guidance; bump to 0.9.6 2026-03-09 00:36:41 -06:00
John Lindquist dbb91611fb fix(skills): broaden workflow promptSignals for natural language (pipeline/stream/multi-step), add image gen capabilities table to ai-sdk; bump to 0.9.5 2026-03-09 00:17:14 -06:00
John Lindquist 38c01a85b1 fix(skills): update image generation to use AI Gateway with gemini-3.1-flash-image-preview default, remove incorrect "gateway doesn't support image gen" guidance; bump to 0.9.4 2026-03-08 23:49:54 -06:00
John Lindquist 569bfcb0ab fix(skills): complete defineHook 3-piece pattern with token emission and resume route, warn against removed generateObject; bump to 0.9.3 2026-03-08 23:33:46 -06:00
John Lindquist 9741bdfd6f fix(skills): add MessageResponse as universal markdown renderer for AI text in ai-elements, ai-sdk, and workflow skills; bump to 0.9.2 2026-03-08 22:31:09 -06:00
John Lindquist 0e29e4caea fix(workflow): add mandatory env setup for AI Gateway OIDC, document getStepMetadata retryCount undefined on first attempt; bump to 0.9.1 2026-03-08 21:27:52 -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 43fec91f36 fix(workflow): document canonical project structure for src/ vs no-src, fix @/workflows import path guidance; bump to 0.8.3 2026-03-08 19:46:35 -06:00
John Lindquist c8e1da3760 fix(ai-sdk): refine markdown rendering guidance to focus on AI Elements Message component; bump to 0.8.2 2026-03-08 18:33:30 -06:00
John Lindquist 6e9a0640d3 fix(skills): strengthen skills from eval feedback — markdown rendering warning in ai-sdk, sandbox/withWorkflow/peer-deps in workflow, mandatory browser verify language; bump to 0.8.1 2026-03-08 18:04:42 -06:00
John Lindquist 2d53cbe2bf feat(hooks): bump skill cap from 3 to 5, add shadcn create-next-app nudge; bump to 0.8.0 2026-03-08 17:26:11 -06:00
John Lindquist 5110bb6529 fix(skills): add flags importPatterns, model slug callout in ai-sdk; bump to 0.7.3 2026-03-08 14:17:05 -06:00
John Lindquist a449bd36c2 fix(skills): rewrite workflow SKILL.md with real WDK API, tighten shadcn patterns; bump to 0.7.2 2026-03-08 14:08:39 -06:00
John Lindquist 77f3f2c4eb fix(workflow): update golden snapshots for broadened workflow patterns; bump to 0.7.1 2026-03-08 10:38:58 -06:00
John Lindquist 004137663e feat(skills): update 29 skill docs, add eval skill, update validate tests; bump to 0.7.0
Refine SKILL.md content across 29 skills based on live eval findings from 16
benchmark sessions. Add .claude/skills/vercel-plugin-eval/ for running real-world
plugin eval sessions with debug log monitoring. Update posttooluse-validate and
validate-rules tests to match refined skill content.
2026-03-08 09:30:36 -06:00
John Lindquist 08ee18d51d feat(hooks): atomic per-skill claim dedup, fix race condition and UserPromptSubmit sharing; bump to 0.6.0
Parallel PreToolUse hooks were racing on the same seen-skills file, causing 2-6x
duplicate injections. UserPromptSubmit hook didn't share dedup state at all.

Fix by implementing atomic per-skill claim files (Oracle session: fix-dedup-race-condition-plan):

1. In hooks/src/hook-env.mts, add tryClaimSessionKey(sessionId, kind, key) using
   openSync(path, 'wx') for atomic exclusive create. Add listSessionKeys() to read
   claim dir, syncSessionFileFromClaims() to derive the txt snapshot, and
   removeSessionClaimDir() for cleanup. Claim files live in
   <tmpdir>/vercel-plugin-<sessionId>-seen-skills.d/<skill-name>.

2. In hooks/src/patterns.mts, add mergeSeenSkillStates(...values) to union env var,
   session file, and claim dir state. Add serializeSeenSkills(set) helper.

3. In hooks/src/pretooluse-skill-inject.mts, load merged state from env+file+claims.
   Before injecting each skill, call tryClaimSessionKey — first process wins, others
   get EEXIST and skip. Use same claim path for once-only keys (agent-browser warning,
   vercel-env-help). Pass sessionId through InjectOptions.

4. In hooks/src/user-prompt-submit-skill-inject.mts, preserve sessionId from parsed
   input, load merged seen state, pass sessionId to injection flow so it uses the
   shared claim backend. Skills injected via promptSignals now visible to PreToolUse.

5. In hooks/src/session-end-cleanup.mts, add rmSync deletion of claim directories.

6. Update CLAUDE.md dedup contract to document atomic claim mechanism.
7. Bump .plugin/plugin.json to 0.6.0, rebuild.
2026-03-07 17:19:25 -07: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 cbf4ed8a3e revert(hooks): remove temp file dedup, restore pure env-var dedup via CLAUDE_ENV_FILE; bump to 0.5.5
The 0.5.4 release added session-scoped temp files for dedup persistence, but this
was wrong — CLAUDE_ENV_FILE env vars ARE propagated to hook subprocesses by Claude
Code. The temp file approach littered tmpdir with hundreds of small files.

Revert to the original env-var-only mechanism:

1. Remove readSessionFile/writeSessionFile/dedupFilePath from hooks/src/hook-env.mts
2. Remove all writeSessionFile calls from pretooluse-skill-inject.mts — revert to
   pure process.env.VERCEL_PLUGIN_SEEN_SKILLS = appendSeenSkill(...) pattern
3. Remove sessionId from InjectOptions and the injectSkills call site
4. Remove sessionId from posttooluse-validate.mts ParsedInput — revert
   isAlreadyValidated/markValidated to pure env-var signatures
5. Revert all test expectations back to "env-var" and "memory-only" strategies
6. Restore CLAUDE.md dedup contract to env-var-only documentation
2026-03-07 14:39:08 -07:00
John Lindquist c107aec73d fix(hooks): persist skill dedup across hook invocations via session-scoped temp files; bump to 0.5.4
Skill dedup is completely broken because CLAUDE_ENV_FILE vars are only available to Bash
tool commands, not hook subprocesses. Each PreToolUse invocation starts a fresh Node.js
process that never sees VERCEL_PLUGIN_SEEN_SKILLS.

To fix this:

1. In hooks/src/hook-env.mts, add readSessionFile(sessionId, kind) and
   writeSessionFile(sessionId, kind, value) helpers that read/write
   /tmp/vercel-plugin-<sessionId>-<kind>.txt for persistent dedup state.

2. In hooks/src/pretooluse-skill-inject.mts, read seen skills from the session file
   at startup using readSessionFile(sessionId, "seen-skills"). Add a persistSeen()
   closure inside injectSkills() that calls both appendSeenSkill and writeSessionFile.
   Replace all process.env.VERCEL_PLUGIN_SEEN_SKILLS = appendSeenSkill(...) calls with
   persistSeen() or inline writeSessionFile calls. Add "file" as the primary dedup
   strategy when session_id is present, falling back to "env-var" then "memory-only".
   Pass sessionId through InjectOptions to injectSkills().

3. In hooks/src/posttooluse-validate.mts, add sessionId to ParsedInput and extract it
   from input.session_id in parseInput(). Pass sessionId to isAlreadyValidated() and
   markValidated(), which should read/write via readSessionFile/writeSessionFile for
   the "validated-files" kind.

4. Update tests: pretooluse-skill-inject.test.ts — rename "no env var" test to expect
   file-based dedup persistence, update strategy assertions from "env-var" to "file",
   use omitSessionId for memory-only test. subagent-fresh-env.test.ts — use a fresh
   session ID for subagent calls, update strategy expectations to "file".
   session-timeline-subagent.test.ts — add sessionId option to runHookEnv, use a
   different session ID for the subagent call.

5. Update CLAUDE.md dedup contract section to document file-based mechanism.

6. Bump .plugin/plugin.json version to 0.5.4, run bun run build.
2026-03-07 14:23:09 -07:00
John Lindquist c860d07cb2 fix(nextjs): remove broken .claude dir backup/restore scaffolding pattern; bump to 0.5.3 2026-03-07 13:48:10 -07:00
John Lindquist 365a710e67 feat(hooks): add prompt analysis, enhance validate/frontmatter hooks, expand test coverage; bump to 0.5.2 2026-03-07 13:09:28 -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 86dcaa8600 fix(tests): align fuzz and validate tests with skill-map validate field; bump to 0.5.0 2026-03-07 11:18:54 -07: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 f2b67166eb chore: bump plugin version to 0.4.1 2026-03-06 13:19:27 -07:00
John Lindquist 5a0591c292 feat(hooks): convert hooks to TypeScript with SDK type-checking
Hook source now lives in hooks/src/*.mts and compiles to hooks/*.mjs via tsc.
The formatOutput() return type is checked against SyncHookJSONOutput from
@anthropic-ai/claude-agent-sdk, preventing unknown fields in hookSpecificOutput
that Claude Code's strict Zod validation would silently reject.

Root cause: skillInjection metadata was a sibling key in hookSpecificOutput,
which Claude Code rejected as "Hook JSON output validation failed: Invalid input".
All skill injections were silently discarded. Now skillInjection metadata is
embedded as an HTML comment inside additionalContext.

- Add hooks/src/*.mts (TypeScript source for all 6 hook modules)
- Add hooks/tsconfig.json (strict, NodeNext, compiles .mts → .mjs)
- Add build:hooks script and pre-commit hook for auto-compilation
- Install @anthropic-ai/claude-agent-sdk as devDependency for types
- Bump plugin version to 0.4.0
2026-03-06 12:48:39 -07:00
John Lindquist 924f0112f0 chore: bump plugin version to 0.3.7 2026-03-06 12:00:08 -07:00
John Lindquist 951992bdc5 chore: bump plugin version to 0.3.6 2026-03-06 11:58:49 -07:00
John Lindquist ac0e7c84e1 chore: bump plugin version to 0.3.5
Add explain CLI, snapshot tests, and consolidated test fixtures.
2026-03-06 11:57:04 -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