Skip to content
Back to skills

Add Diagnostic

ASecurity

Add a new diagnostic code following the defineDiagnostics()

  • 16 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 5, 2026
toolsapi

Works with

  • api

Security analysis

A100/100

Scanned September 21, 2026

npx -y skills add pleaseai/claude-code-plugins --skill add-diagnostic --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Add Diagnostic?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Add Diagnostic
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/pleaseai-add-diagnostic-claude-code-plugins/badge)](https://www.skillsdirectory.com/skills/pleaseai-add-diagnostic-claude-code-plugins)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: add-diagnostic
description: Add a new diagnostic code following the defineDiagnostics()
  conventions from nostics
license: MIT
---
# 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:**

```ts
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.

4. **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.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…