add-diagnostic

oleh vercel

Tambahkan kode diagnostik baru sesuai dengan konvensi defineDiagnostics() dari nostics

npx skills add https://github.com/vercel-labs/nostics --skill add-diagnostic

Add a New Diagnostic Code

  1. Find the catalog. Grep for defineDiagnostics to locate the codes object the new entry belongs in. With several catalogs, pick by area.
  2. Pick the code. PREFIX_XNNNN: PREFIX is the project name uppercased (NUXT, I18N); X is the area letter (B build, R runtime, C config, D deprecation); NNNN is the next free number. Read existing codes to choose. Never rename or reuse a published code.
  3. Add the entry:
LIB_R0001: {
  why: (p: { hook: string }) => `${p.hook}() must run at the top of setup().`, // string or typed fn; becomes Error.message (required)
  fix: 'Move the call into setup() or a composable it calls.', // optional, but add whenever the fix is known
  docs: 'https://example.com/custom', // optional: overrides docsBase, or `false` to opt out
},
  • why is the only required field. Params from why and fix are intersected and required at the call site.
  • Runtime fields (cause, sources) are passed at the call site, never in the definition.
  1. Call it: diagnostics.LIB_R0001({ hook }) to report, throw diagnostics.LIB_R0001({ hook, cause: err }) to raise. Both run the reporters.

Full API and reporter/formatter/plugin details: the nostics skill.

Lebih banyak skill dari vercel

benchmark-sandbox
vercel
Jalankan skenario evaluasi vercel-plugin di Vercel Sandbox, bukan di panel WezTerm lokal. Menyediakan microVM sementara dengan Claude Code + plugin yang sudah terinstal sebelumnya,…
official
emil-design-eng
vercel
Skill ini mengodekan filosofi Emil Kowalski tentang polesan UI, desain komponen, keputusan animasi, dan detail tak terlihat yang membuat perangkat lunak terasa hebat.
official
vercel-react-best-practices
vercel
Panduan optimasi performa React dan Next.js dari Vercel Engineering. Skill ini harus digunakan saat menulis, meninjau, atau merefaktor kode React/Next.js…
official
vercel-react-best-practices
vercel
Panduan optimasi performa React dan Next.js dari Vercel Engineering. Skill ini harus digunakan saat menulis, meninjau, atau merefaktor kode React/Next.js…
official
write-guide
vercel
Hasilkan panduan teknis yang mengajarkan kasus penggunaan dunia nyata melalui contoh-contoh progresif. Konsep diperkenalkan hanya saat pembaca membutuhkannya.
official
release
vercel
Release vercel-plugin — jalankan gates, naikkan versi, hasilkan artefak, commit, dan push. Gunakan saat diminta untuk "release", "ship", "bump and push", atau "cut a release".
official
deepsec
vercel
Jalankan DeepSec terhadap pemeriksaan proyek Vercel dari dev3000. Gunakan untuk pengaturan DeepSec satu klik, bootstrap konteks proyek, pemrosesan awal terbatas, dan…
official
backport-pr
vercel
Melakukan backport pull request Next.js yang sudah digabung dari canary ke cabang rilis sebelumnya seperti next-16-2. Gunakan saat pengguna meminta untuk backport, cherry-pick, atau membuka…
official