Skip to content

Commit 75e72e3

Browse files
authored
Merge pull request #47 from vercel/0.40.0-hook-reduction
Remove Prompt, Bash telemetry and Hook Injection
2 parents 0260dd8 + f475300 commit 75e72e3

85 files changed

Lines changed: 730 additions & 24677 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude-plugin/plugin.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "vercel",
3-
"version": "0.32.7",
2+
"name": "vercel-plugin",
3+
"version": "0.40.0",
44
"description": "Build and deploy web apps and agents",
55
"author": {
66
"name": "Vercel",

.cursor-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vercel",
3-
"version": "0.32.5",
3+
"version": "0.40.0",
44
"description": "Build and deploy web apps and agents",
55
"author": {
66
"name": "Vercel",

.plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vercel-plugin",
3-
"version": "0.32.7",
3+
"version": "0.40.0",
44
"description": "Comprehensive Vercel ecosystem plugin — relational knowledge graph, skills for every major product, specialized agents, and Vercel conventions. Turns any AI agent into a Vercel expert.",
55
"author": {
66
"name": "Vercel",

CLAUDE.md

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,6 @@ All hooks are registered in `hooks/hooks.json` and run via `node "${CLAUDE_PLUGI
3030
| SessionStart | `session-start-seen-skills.mjs` | `startup\|resume\|clear\|compact` ||
3131
| SessionStart | `session-start-profiler.mjs` | `startup\|resume\|clear\|compact` ||
3232
| SessionStart | `inject-claude-md.mjs` | `startup\|resume\|clear\|compact` ||
33-
| PreToolUse | `pretooluse-skill-inject.mjs` | `Read\|Edit\|Write\|Bash` | 5s |
34-
| UserPromptSubmit | `user-prompt-submit-skill-inject.mjs` | (all prompts) | 5s |
35-
| PostToolUse | `posttooluse-shadcn-font-fix.mjs` | `Bash` | 5s |
36-
| PostToolUse | `posttooluse-validate.mjs` | `Write\|Edit` | 5s |
3733
| SessionEnd | `session-end-cleanup.mjs` |||
3834

3935
### Hook Source Files (`hooks/src/*.mts`)
@@ -42,13 +38,9 @@ Source lives in `hooks/src/*.mts` (TypeScript) and compiles to `hooks/*.mjs` (ES
4238

4339
**Entry-point hooks** (wired in hooks.json):
4440
- `session-start-seen-skills.mts` — initializes `VERCEL_PLUGIN_SEEN_SKILLS=""` in `CLAUDE_ENV_FILE`
45-
- `session-start-profiler.mts` — scans config files + package deps → sets `VERCEL_PLUGIN_LIKELY_SKILLS` (+5 priority boost); detects greenfield mode
46-
- `inject-claude-md.mts` — outputs `vercel.md` ecosystem graph (52KB) as SessionStart additionalContext
47-
- `pretooluse-skill-inject.mts` — main injection engine: pattern matching → ranking → dedup → budget enforcement (max 3 skills, 18KB)
48-
- `user-prompt-submit-skill-inject.mts` — prompt signal scoring engine (max 2 skills, 8KB budget)
49-
- `posttooluse-validate.mts` — runs skill-defined validation rules on written/edited files
50-
- `posttooluse-shadcn-font-fix.mjs` — fixes shadcn font loading issues (standalone, no .mts source)
51-
- `session-end-cleanup.mts` — deletes temp dedup + validation files
41+
- `session-start-profiler.mts` — activates only for greenfield directories or detected Vercel/Next.js projects, then scans config files + package deps → sets `VERCEL_PLUGIN_LIKELY_SKILLS` (+5 priority boost)
42+
- `inject-claude-md.mts` — outputs the thin session-start Vercel context plus knowledge update guidance for that same activation set
43+
- `session-end-cleanup.mts` — deletes session-scoped temp files
5244

5345
**Library modules** (imported by entry-point hooks):
5446
- `hook-env.mts` — shared runtime helpers (env parsing, path resolution)
@@ -61,11 +53,11 @@ Source lives in `hooks/src/*.mts` (TypeScript) and compiles to `hooks/*.mjs` (ES
6153

6254
### Skill Injection Flow
6355

64-
1. **SessionStart**: Profiler scans project → sets `VERCEL_PLUGIN_LIKELY_SKILLS`
56+
1. **SessionStart**: For greenfield directories or detected Vercel/Next.js projects, the profiler scans the project → sets `VERCEL_PLUGIN_LIKELY_SKILLS`
6557
2. **PreToolUse** (on Read/Edit/Write/Bash): Match file paths (glob), bash commands (regex), imports (regex+flags) → apply vercel.json routing → apply profiler boost → rank by priority → dedup → inject up to 3 skills within 18KB budget
6658
3. **UserPromptSubmit**: Score prompt text against `promptSignals` (phrases/allOf/anyOf/noneOf) → inject up to 2 skills within 8KB budget
6759
- **3b. Lexical fallback** (when `VERCEL_PLUGIN_LEXICAL_PROMPT=on`): If phrase/allOf/anyOf scoring yields no matches above `minScore`, re-score using a lexical stemmer that normalizes prompt tokens before comparison — catches natural phrasing that exact-substring matching misses
68-
4. **PostToolUse** (on Write/Edit): Match written file to skills → run `validate` rules → return fix instructions on error
60+
4. **SessionEnd**: Clean up session-scoped temp files
6961

7062
Special triggers in PreToolUse:
7163
- **TSX review**: After N `.tsx` edits (default 3), injects `react-best-practices`
@@ -154,7 +146,7 @@ Heading extraction is case-insensitive and captures everything from the heading
154146

155147
32 test files across `tests/`. Key categories:
156148

157-
- **Hook integration**: `pretooluse-skill-inject`, `user-prompt-submit`, `posttooluse-validate`, `session-start-profiler`, `session-start-seen-skills`
149+
- **Hook integration**: `session-start-profiler`, `session-start-seen-skills`
158150
- **Pattern matching**: `patterns`, `fuzz-glob`, `fuzz-yaml`, `prompt-signals`, `prompt-analysis`
159151
- **Snapshots**: `snapshot-runner` (golden snapshots of skill injection metadata per vercel.json fixture), `snapshots` (snapshot assertions)
160152
- **Validation**: `validate`, `validate-rules`, `build-skill-map`

README.md

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@
2222
npx plugins add vercel/vercel-plugin
2323
```
2424

25-
That's it. The plugin activates automatically — no setup, no commands to learn. Just build.
25+
That's it. The plugin installs Vercel context, skills, and a lightweight default hook profile.
2626

2727
## What It Does
2828

29-
This plugin pre-loads AI agents with a **relational knowledge graph** of the entire Vercel ecosystem — every product, library, CLI, API, and service — showing how they relate, when to use each, and providing deep guidance through bundled skills.
29+
This plugin gives AI agents a **relational knowledge graph** of the Vercel ecosystem plus a bundled skill library covering products, libraries, CLI, APIs, and workflows.
3030

3131
## How Do I Use This?
3232

33-
After installing, there's nothing to learn — all Vercel guidance happens automatically. The plugin detects what you're working on from your tool calls, file paths, and project config, then injects the right expertise at the right time. Just use your AI agent as you normally would and the plugin handles the rest.
33+
After installing, the plugin keeps automatic behavior lightweight. Session-start activation now only kicks in for empty directories and detected Vercel/Next.js projects, and Vercel skills are no longer auto-injected on every tool call or every prompt by default. The default post-tool path is now observer-only. The skills remain available for direct use, and the repo still keeps the injection engine for targeted or future opt-in workflows.
3434

3535
## Components
3636

@@ -94,14 +94,12 @@ A text-form relational graph covering:
9494

9595
Lifecycle hooks that run automatically during your session:
9696

97-
- **Session start context injection** — Injects `vercel.md` (ecosystem graph + conventions) into every session
98-
- **Session start repo profiler** — Scans config files and dependencies to pre-prime skill matching for faster first tool call
99-
- **Pre-tool-use skill injection** — Matches tool calls to skills and injects relevant guidance with dedup
100-
- **Pre-write/edit validation** — Catches deprecated patterns before they're written (sunset packages, old API names, renamed files)
97+
- **Session start context injection** — Injects a thin Vercel session context plus the knowledge-update guidance for empty directories and detected Vercel/Next.js projects
98+
- **Session start repo profiler** — Scans config files and dependencies to set likely-skill hints, but only after that same activation check passes
10199

102100
## Usage
103101

104-
After installing, skills and context are injected automatically. You can also invoke skills directly via slash commands:
102+
After installing, session context is injected automatically only for empty directories and detected Vercel/Next.js projects. Vercel skills are available on demand, and you can invoke them directly via slash commands:
105103

106104
```
107105
/vercel-plugin:nextjs
@@ -111,31 +109,25 @@ After installing, skills and context are injected automatically. You can also in
111109

112110
## Telemetry
113111

114-
The plugin has two separate telemetry controls:
115-
116-
- `~/.claude/vercel-plugin-telemetry-preference` controls prompt text only.
117-
- `VERCEL_PLUGIN_TELEMETRY=off` disables all telemetry.
112+
Prompt text and bash/tool-call telemetry are not collected.
118113

119114
Behavior:
120115

121-
- `echo 'enabled' > ~/.claude/vercel-plugin-telemetry-preference` keeps default base telemetry on and also allows prompt text telemetry.
122-
- `echo 'disabled' > ~/.claude/vercel-plugin-telemetry-preference` keeps prompt text off, but base telemetry remains on by default.
123-
- `VERCEL_PLUGIN_TELEMETRY=off` disables all telemetry, including prompt text, session metadata, tool names, and skill-injection telemetry.
116+
- Unset `VERCEL_PLUGIN_TELEMETRY`: default DAU-only telemetry. Sends a once-per-day `dau:active_today` phone-home.
117+
- `VERCEL_PLUGIN_TELEMETRY=off`: disables all telemetry, including the default DAU-only session-start event.
124118

125-
Where to set `VERCEL_PLUGIN_TELEMETRY=off`:
119+
Where to set `VERCEL_PLUGIN_TELEMETRY`:
126120

127121
- macOS / Linux: add it to the shell profile for the environment that launches your agent, such as `~/.zshrc`, `~/.bashrc`, `~/.bash_profile`, or `~/.config/fish/config.fish`, then restart that terminal or app session.
128122
- Windows: set it in the PowerShell environment that launches your agent, add it to your PowerShell profile (`$PROFILE`), or set it as a persistent user environment variable.
129123

130124
Examples:
131125

132126
```bash
133-
echo 'disabled' > ~/.claude/vercel-plugin-telemetry-preference
134127
export VERCEL_PLUGIN_TELEMETRY=off
135128
```
136129

137130
```powershell
138-
$env:VERCEL_PLUGIN_TELEMETRY = "off"
139131
setx VERCEL_PLUGIN_TELEMETRY off
140132
```
141133

0 commit comments

Comments
 (0)