summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMingchung Xia <mingchung.xia@gmail.com>2026-02-25 17:08:46 -0800
committerMingchung Xia <mingchung.xia@gmail.com>2026-02-25 17:08:46 -0800
commit4dd892793a590ee96a5ad2ae9947f45ef4c2f139 (patch)
treec5dcbae6525ee85a5c369835ed7b523d20123a49
parentea2cfa5f98facaa658bff9c24fbe49e9368f28c4 (diff)
feat(vercel-cost-optimization): add AGENTS.md, metadata.json, README.mdmingchungx/vercel-cost-optimization
Add standard companion files to match repo conventions: - AGENTS.md symlinked to SKILL.md - metadata.json with version, org, abstract, and references - README.md with structure overview, workflow, and prerequisites Rebuild zip to include new files. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
-rw-r--r--skills/vercel-cost-optimization.zipbin36270 -> 42071 bytes
l---------skills/vercel-cost-optimization/AGENTS.md1
-rw-r--r--skills/vercel-cost-optimization/README.md43
-rw-r--r--skills/vercel-cost-optimization/metadata.json14
4 files changed, 58 insertions, 0 deletions
diff --git a/skills/vercel-cost-optimization.zip b/skills/vercel-cost-optimization.zip
index e6ba534..df163b0 100644
--- a/skills/vercel-cost-optimization.zip
+++ b/skills/vercel-cost-optimization.zip
Binary files differ
diff --git a/skills/vercel-cost-optimization/AGENTS.md b/skills/vercel-cost-optimization/AGENTS.md
new file mode 120000
index 0000000..d69512c
--- /dev/null
+++ b/skills/vercel-cost-optimization/AGENTS.md
@@ -0,0 +1 @@
+SKILL.md \ No newline at end of file
diff --git a/skills/vercel-cost-optimization/README.md b/skills/vercel-cost-optimization/README.md
new file mode 100644
index 0000000..346093e
--- /dev/null
+++ b/skills/vercel-cost-optimization/README.md
@@ -0,0 +1,43 @@
+# Vercel Cost Optimization
+
+Analyze Vercel billing data, identify cost drivers, map them to your code, and get scored optimization recommendations.
+
+## Structure
+
+- `scripts/` - Automation scripts
+ - `get-usage.sh` - Wraps `vercel usage --format json` for billing data
+ - `detect-stack.sh` - Detects framework, version, ORM, and config
+- `resources/` - Reference documents (read on-demand by the agent)
+ - `billing-service-mapping.md` - Maps billing line items to code investigation steps
+ - `optimization-patterns.md` - 22 patterns with IDs, version gating, and code examples
+ - `version-gating.md` - Next.js 13/14/15 feature availability matrix
+ - `stack-specific-advice.md` - Prisma, Drizzle, Supabase, tRPC advice
+ - `scoring-guide.md` - Recommendation scoring formula
+- `metadata.json` - Document metadata (version, organization, abstract)
+- __`SKILL.md`__ - Skill definition with 6-step workflow
+
+## How It Works
+
+1. **Collect billing data** — Runs `get-usage.sh` to pull Vercel usage as JSON
+2. **Detect project stack** — Runs `detect-stack.sh` to identify framework, version, ORM
+3. **Map costs to code** — Investigates top cost drivers using grep/find commands
+4. **Identify optimizations** — Matches applicable patterns filtered by version
+5. **Score and rank** — `score = savings × effort_multiplier × confidence` (threshold $5/mo)
+6. **Present report** — Structured output with cost breakdown, recommendations, and config checklist
+
+## Prerequisites
+
+- Vercel CLI installed and authenticated (`npm i -g vercel && vercel login`)
+- Project linked to Vercel (`vercel link`)
+- `jq` recommended for reliable JSON parsing (optional, script falls back to grep/sed)
+
+## Cross-References
+
+References 9 rules from `react-best-practices` by name:
+`async-parallel`, `server-parallel-fetching`, `server-cache-react`, `server-cache-lru`,
+`async-suspense-boundaries`, `bundle-dynamic-imports`, `bundle-barrel-imports`,
+`bundle-defer-third-party`, `server-after-nonblocking`
+
+## Acknowledgments
+
+Created by Vercel Engineering. Optimization knowledge based on patterns from internal tooling.
diff --git a/skills/vercel-cost-optimization/metadata.json b/skills/vercel-cost-optimization/metadata.json
new file mode 100644
index 0000000..6fccc06
--- /dev/null
+++ b/skills/vercel-cost-optimization/metadata.json
@@ -0,0 +1,14 @@
+{
+ "version": "1.0.0",
+ "organization": "Vercel Engineering",
+ "date": "February 2026",
+ "abstract": "Analyze Vercel billing data, identify primary cost drivers, map them to your code, and provide scored optimization recommendations. Uses a 6-step workflow: collect billing → detect stack → map costs to code → identify optimizations → score/rank → present report. Covers Function Invocations, Duration, Edge Requests, Image Optimization, Bandwidth, ISR/Data Cache, Cron, and Web Analytics.",
+ "references": [
+ "https://vercel.com/docs/pricing",
+ "https://vercel.com/docs/cli/usage",
+ "https://nextjs.org/docs",
+ "https://vercel.com/docs/functions/fluid-compute",
+ "https://vercel.com/docs/image-optimization",
+ "https://vercel.com/docs/cron-jobs"
+ ]
+}