/nostics:add-diagnosticfrom nostics
Adds a new diagnostic code following defineDiagnostics() conventions. Guides through picking prefix, area, and next free number, then writing the entry.
Ships in nostics. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Find the catalog: grep defineDiagnostics. If there are many, pick by area.
Pick the code: PREFIX_XNNNN. PREFIX is the project name in uppercase (NUXT, I18N). X is the area: B build, R runtime, C config, D deprecation. NNNN is the next free number. Never rename or reuse a published code.
Add the entry:
LIB_R0001: {
why: (p: { hook: string }) => `${p.hook}() must run at the top of setup().`, // required
fix: 'Move the call into setup() or a composable it calls.', // add when the fix is known
docs: 'https://example.com/custom', // optional: overrides docsBase, `false` opts out
},
why says what is wrong, fix says what to do: do not repeat text between them. Params of why and fix are merged and required at the call site. cause and sources go at the call site, not in the definition.
Call it: diagnostics.LIB_R0001({ hook }) reports, throw diagnostics.LIB_R0001({ hook, cause: err }) reports and raises. To check a caught error: diagnostics.LIB_R0001.is(err).
More details: the nostics skill.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
2 skills in this plugin
npx claudepluginhub vercel-labs/nostics --plugin nosticsOther plugins' skills for the same job