vercel / vercel/vercel-plugin

Narrow overly-broad pathPatterns in several skill manifests (+ optional test-file guard)

Open
#63 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
287
Forks
58
Avg merge
1d 1h
Merged PRs (30d)
17

Description

Summary

Several skills in vercel-plugin auto-trigger on files they shouldn't match, causing spurious skill activations in large monorepos. I've been running a local patch that narrows these patterns and wanted to propose the same narrowing upstream.

Motivation

In a multi-app Next.js monorepo, I've observed the following false-positive triggers:

  • react-best-practices firing on *.test.tsx files (tests shouldn't need the same review pass)
  • deployments-cicd firing on every .github/workflows/*.yml (most workflows aren't deployment-related)
  • vercel-agent firing on any workflow file with deploy or preview in the name
  • vercel-storage firing on every file under supabase/**
  • bootstrap firing on every README* and package.json
  • next-upgrade firing on every package.json
  • workflow firing on anything matching *workflow* anywhere in the repo

Suggested skill-manifest.json narrowing

 "vercel-agent":
   "pathPatterns": [
     ".github/workflows/vercel*.yml",
-    ".github/workflows/vercel*.yaml",
-    ".github/workflows/deploy*.yml",
-    ".github/workflows/deploy*.yaml",
-    ".github/workflows/preview*.yml",
-    ".github/workflows/preview*.yaml"
+    ".github/workflows/vercel*.yaml"
   ]

 "deployments-cicd":
   "pathPatterns": [
-    ".github/workflows/*.yml",
-    ".github/workflows/*.yaml",
     ".gitlab-ci.yml", "bitbucket-pipelines.yml", "vercel.json", "apps/*/vercel.json"
   ]

 "vercel-storage":
   "pathPatterns": [
     ...
-    "supabase/**",
     "lib/supabase.*", ...
   ]

 "bootstrap":
   "pathPatterns": [
     ".env.example", ".env.sample", ".env.template",
-    "README*",
-    "docs/**/setup*",
-    "package.json",
     "drizzle.config.*", ...
   ]

 "workflow":
   "pathPatterns": [
     "lib/workflow/**", "src/lib/workflow/**",
-    "workflows/**",
     "lib/workflow.*", "src/lib/workflow.*", "workflow.*",
-    "*workflow*",
-    "*workflow*/**",
     ...
   ]

 "next-upgrade":
   "pathPatterns": [
-    "next.config.*", "package.json"
+    "next.config.*"
   ]

 "next-forge":
   "pathPatterns": [
     ...
-    "biome.jsonc", "**/keys.ts", "**/env.ts", "**/proxy.ts"
   ]

Optional: test-file guard in hooks/src/patterns.mts

A pragmatic addition is a single-line guard that skips path-based matching on test files:

if (filePath && /\.(test|spec)\.[a-zA-Z0-9]+$/.test(filePath)) return null;

Narrow by design — doesn't affect import-based matching, so skills still trigger when a test legitimately imports the framework. A schema-pure alternative would be adding an excludePathPatterns field to each skill manifest. Happy to prototype either.

Known-remaining patterns I didn't touch (flagging for maintainer review)

  • next-forge.pathPatterns contains pnpm-workspace.yaml — matches any pnpm monorepo, not just next-forge projects
  • workflow.importPatterns contains bare 'workflow' and '*workflow*' — matches any from "workflow" import

Happy to PR

Let me know the preferred direction (narrowed patterns, test-file guard, schema change, or some combination) and I can open a PR against whichever approach you'd prefer.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with skill-manifest.json and compare the listed pathPatterns against the false-positive cases in the issue. Then read hooks/src/patterns.mts to evaluate the optional test-file guard, and check the existing pattern-matching tests if present. Done means the chosen approach is agreed, the unintended matches are narrowed without breaking intended triggers, and coverage verifies the behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.