Component Api Validator logo

Component Api Validator

Community
murphytrueman
component-api-validator

Audit prop APIs across a component library: naming consistency, boolean/default patterns, type coverage, exported types, breaking changes between versions. Trigger: component API audit, are our props consistent, prop naming review. For semver calls use version-bump-advisor.

Overview

Publishermurphytrueman
Repositorydesign-system-ops
Skill namecomponent-api-validator
Stars
211
Forks
7
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by murphytrueman on GitHub. Read the source before you install it.

Installation

Install the Component Api Validator AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/murphytrueman/design-system-ops/tree/main/skills/component-api-validator
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/murphytrueman/design-system-ops.git /tmp/design-system-ops
mkdir -p .claude/skills
cp -r /tmp/design-system-ops/skills/component-api-validator .claude/skills/component-api-validator
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Component Api Validator in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Component Api Validator on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Component Api Validator is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Component API validator

A skill for auditing the public API surface of a component library — prop naming consistency, type coverage, default value patterns, breaking change detection, and alignment with the design-to-code contract. Treats the component API as infrastructure: the public contract that consuming teams depend on.

Before you begin: verify references

Confirm that every path in this skill's frontmatter references: exists relative to this SKILL.md. If any is missing, stop: the install is incomplete, usually because a flattening installer (for example npx skills install) dropped the repo-root knowledge-notes/ directory. Tell the user to reinstall by a method in 1-INSTALL.md and run verify-install.sh from the install root. Proceed without the references only if the user explicitly says to, and then say in the output that it was produced without the pack's reference material.

Context

A component library's most important output is not its visual rendering — it is its API. The props, types, defaults, and composition patterns form a contract with every consuming team. When that contract is inconsistent (some components use variant, others use type, others use appearance for the same concept), unclear (prop types are any or undocumented), or unstable (breaking changes ship without versioning), consuming teams lose trust. And when trust erodes, teams start wrapping system components in local abstractions, which is the beginning of drift.

API validation is not about enforcing a single naming convention. It is about detecting where the library's public surface is working against the teams consuming it. A library where every component follows the same patterns for sizing, variants, event handlers, and composition is a library that teams can learn once and apply everywhere. A library where each component invents its own conventions is a library that requires re-learning for every component.

This skill evaluates the API surface as a whole — not one component at a time, but the patterns that emerge across the library. Individual component reviews are useful but miss the cross-library inconsistencies that frustrate consumers most.

Do NOT use this skill for: deciding the semver bump for a release (use version-bump-advisor) or checking one component against its design spec (use design-to-code-check).


Configuration

If .ds-ops-config.yml exists, follow the configuration-and-recurring knowledge note (../../knowledge-notes/configuration-and-recurring.md) for loading, integration fallbacks and recurring runs. This skill reads:

  • system.framework — determines the prop extraction method
  • system.styling — styling approach
  • severity.api_* — overrides for API finding severity
  • integrations.github — component source (see below)
  • integrations.storybook — prop metadata (see below)

Auto-pull integrations

GitHub (integrations.github.enabled: true):

  • Pull component source files from the configured repository if there's no local checkout

Storybook (integrations.storybook.enabled: true):

  • Extract argTypes metadata for structured prop information
  • Cross-reference Storybook's prop documentation with source code types

Figma (integrations.figma.enabled: true):

  • Pull component property definitions from Figma
  • Cross-reference Figma properties against code props for design-to-code alignment

Step 1: Gather component sources

Read before asking. package.json gives the package name, version, exports, main and types; the entry point gives the public component list; tsconfig.json or the presence of .d.ts, PropTypes or JSDoc gives the typing approach; the framework shows in the dependencies. Confirm what you found in one line and ask only for:

  1. Previous version source (optional) — for breaking change comparison. Prefer the published type declarations of the previous release (npm pack <pkg>@<prev> and read its .d.ts files, or an api-extractor report); a git tag or release branch works if nothing was published
  2. Deliberate exceptions — legacy names kept for compatibility, so they're reported as accepted rather than as deviations

If no component source is in reach (no path, no checkout, no package to unpack), stop and ask for one; an API audit of described components produces guesses.

Step 2: Extract API surface

For each component in the source path:

  1. Identify exported components — components that are part of the public API (exported from index files or package entry points)
  2. Extract props/attributes with the tool that fits, and hand-parse only when none does. Tool output is complete and consistent; a hand read of forty interfaces is neither.
    • React with TypeScript: react-docgen-typescript (npx react-docgen-typescript or its API) gives name, type, required, default and description per prop from the interfaces. Storybook argTypes (from integrations.storybook) are the same data if the docs addon is set up.
    • Vue: vue-component-meta for <script setup> and defineProps; fall back to reading defineProps by hand.
    • Web Components: the Custom Elements Manifest (npx custom-elements-manifest analyze, or an existing custom-elements.json) lists attributes, properties, events, slots and CSS custom properties; it is the standard, so read it rather than re-deriving it.
    • Svelte: exported let declarations, events, slots (read by hand; note that in the Scope block).
    • Untyped or PropTypes-only React: read PropTypes and JSDoc; record every prop with no type as untyped.
  3. For each prop, capture:
    • Name
    • Type (specific type or any/unknown/untyped)
    • Required or optional
    • Default value (if any)
    • Description (from JSDoc, TSDoc, or inline comment)
  4. Identify composition patterns:
    • Does the component accept children/slots?
    • Does it forward refs?
    • Does it spread remaining props to a root element?
    • Does it accept render props or scoped slots?

Step 3: Assess cross-library consistency

This is the core of the skill. Evaluate patterns across the entire library, not within individual components.

3a. Prop naming consistency

Look for the same concept implemented with different names across components:

ConceptConsistent patternInconsistent examples
Visual variantAll use variantSome use variant, others type, others appearance, others kind
SizeAll use sizeSome use size, others scale, others dimension
Disabled stateAll use disabledSome use disabled, others isDisabled
Loading stateAll use loadingSome use loading, others isLoading, others pending
Event handlersAll use onActionSome use onChange, others handleChange, others onValueChange
Colour/intentAll use intentSome use intent, others color, others severity, others status

For each inconsistency, report:

  • The concept
  • Which convention is most common (the likely "correct" one)
  • Which components deviate
  • Suggested normalisation

3b. Boolean prop patterns

Boolean props are a common source of API inconsistency:

  1. Prefix convention — does the library use isDisabled or disabled? Pick one, flag deviations.
  2. Negative booleans — the working convention is that a boolean prop defaults to false, so the common case needs no prop. hideLabel is the right shape when labels usually show; showLabel defaulting to true forces showLabel={false} at every call site that hides one. Flag a boolean whose default is true, and flag a library that uses both forms for the same concept (hideLabel on one component, showLabel on another). Don't flag a negative name on its own.
  3. Boolean vs. enum — a prop that started as boolean (compact) but should be an enum (density: 'compact' | 'default' | 'comfortable'). Flag booleans that limit future extensibility.

3c. Default value patterns

  1. Presence — do all optional props have explicit defaults? Missing defaults are implicit API decisions.
  2. Consistency — does size default to 'medium' in some components and 'md' in others?
  3. Sensible defaults — does variant default to the most common use case? Flag surprising defaults.

3d. Type coverage

  1. TypeScript/PropTypes completeness — what percentage of props have explicit types?
  2. Specificity — are types specific ('sm' | 'md' | 'lg') or vague (string)?
  3. Exported types — are component prop types exported for consumers who need them?
  4. Generic patterns — if some components use generics (e.g., Select<T>), are they consistently applied?

3e. Event handler patterns

  1. Naming convention — onChange vs onValueChange vs handleChange. Identify the library's convention and flag deviations.
  2. Callback signature — do event handlers pass the event, the value, or both? Is this consistent?
  3. Controlled vs. uncontrolled — if the library supports controlled components, is the pattern consistent (value/onChange vs defaultValue)?

3f. Composition patterns

  1. Children vs. render props — is the composition model consistent across components?
  2. Ref forwarding — do all interactive components forward refs?
  3. Prop spreading — do components spread remaining props? Is this consistent?
  4. Slot naming (Vue/Web Components) — are slot names consistent across components?

Step 4: Breaking change detection

If a previous version is available, compare the published type declarations of both versions, not the source. Source can differ from what shipped, and declarations show the whole public surface. Diff the package exports (components, hooks, types, utilities) as well as props — a removed export breaks consumers just as surely as a removed prop.

  1. Removed exports and props — anything in the previous version's declarations that is gone
  2. Renamed props — report these as a removal plus an addition, then check whether a deprecated alias for the old name still exists. Without an alias, it is breaking; don't guess at renames from type similarity
  3. Type narrowing — prop type changed from wider to narrower (string → 'a' | 'b')
  4. Default value changes — default changed in a way that alters existing behaviour
  5. Required prop additions — new props that are required (existing consumers will break)
  6. Behavioural changes — same prop name but different behaviour (hardest to detect — flag for manual review)

Classify each:

  • Breaking — consuming code will fail at compile time or behave differently at runtime
  • Potentially breaking — may break depending on usage pattern (flag for review)
  • Non-breaking — addition only, existing code unaffected

Step 5: Design-to-code contract alignment (only with a design source)

Only when a Figma library or exported spec is in reach. Otherwise write "skipped: no design source" under Scope and move on; don't infer design variants from prop names. With a source, cross-reference the API surface against the design-to-code contract:

  1. Prop coverage vs. design spec — does every design variant have a corresponding prop? Are there props with no design equivalent (engineering-added functionality)?
  2. State coverage — does the API support every prop-driven state in the spec (disabled, loading, error, selected)? Hover, focus, and active are CSS/interaction states, not props — don't flag them as missing props
  3. Token alignment — do any props accept raw values (colours, spacing) that should reference tokens?
  4. Accessibility props — are aria-* attributes passed through to the underlying element? Do icon-only variants require an accessible label (e.g. a required aria-label or label prop in the type for the icon-only case)? A consumer-settable role prop is not required, and usually a smell

Step 6: Produce the validation report

# Component API Validation Report

[Headline sentence: the most important API problem and how widespread it is]

## Executive Summary
[Library name, component count, framework, TypeScript coverage, headline findings]

## API Inventory
| Component | Props | Typed | Required | Optional | Defaults | Description coverage |
|-----------|-------|-------|----------|----------|----------|---------------------|
[One row per component]

## Cross-Library Consistency

### Prop Naming
[Table of concept → dominant convention → deviations → ✅ PASS / ⚠️ WARN / ❌ FAIL per pattern]
[Counts, e.g. "14 of 19 components use `variant`; 4 use `type`; 1 uses `appearance`" (illustrative)]

### Boolean Patterns
[Findings: negative booleans, boolean-should-be-enum, prefix inconsistency]

### Default Values
[Findings: missing defaults, inconsistent defaults]

### Type Coverage
[Overall: X of Y props explicitly typed]
[Breakdown: full TypeScript / JSDoc / PropTypes / untyped per component]

### Event Handlers
[Convention identified, deviations listed]

### Composition Patterns
[Ref forwarding coverage, children vs render props consistency, slot naming]

## Breaking Change Analysis
[If previous version available]
| Change | Component | Prop | Type | Impact |
|--------|-----------|------|------|--------|
[One row per change]

## Design-to-Code Contract
[Findings: design variants without props, props without design equivalents, missing state coverage]

## Findings Summary
| ID | Severity | Component | Prop | Evidence | Finding | Remediation |
|---|---|---|---|---|---|---|
| AV-01 | 🟠 High | Badge | `type` | `src/components/Badge/Badge.tsx:12` | 14 of 19 components use `variant`; Badge uses `type` for the same concept | Rename to `variant`, keep `type` as a deprecated alias for one minor |

Severity: 🔴 Critical for a breaking change that shipped without a major, or `any`/untyped on a public prop of an interactive component; 🟠 High for one concept named two ways across the library, a missing exported prop type, or a required prop with no description; 🟡 Medium for inconsistent defaults, missing descriptions, or a boolean that should be an enum; ⚪ Low for style (prefix conventions, slot naming). Evidence is the file and line of the prop's declaration, or the `.d.ts` line when comparing versions.

## Prioritised Recommendations
[Grouped: 🔴 Critical (breaking/type safety) → 🟠 High (consistency) → 🟡 Medium (documentation) → ⚪ Low (style)]

**Scope**
- **Inspected:** [source paths, entry points, declaration files, previous version compared against]
- **Not inspected:** [components not exported from the entry point, runtime behaviour, packages out of reach]
- **How "none found" was checked:** [e.g. "no breaking changes" — both versions' `.d.ts` exports were diffed and the diff did pick up the props added in this release]
- **Assumptions:** [e.g. the entry point defines the public API]

If any of these inconsistencies are deliberate (a legacy name kept for compatibility, a convention you've chosen on purpose), tell me and I'll treat them as accepted in future runs.

Quality checks

Before delivering the report, verify:

  1. Every exported component is included — no components skipped
  2. Cross-library patterns are identified — the report doesn't just list individual component issues but identifies library-wide patterns
  3. Consistency is counted, not scored — not "some props are inconsistent" or a percentage rating, but "14 of 19 components use variant, 4 use type, 1 uses appearance"
  4. Breaking changes are correctly classified — removals are breaking, additions are non-breaking, type changes depend on direction
  5. Fix suggestions include the specific rename or type change — not "make this consistent" but "rename type to variant in AlertDialog, Badge, Toast"
  6. TypeScript type coverage is measured per-component — not just a library-wide average
  7. Findings reference specific component and prop names with a file and line — never "some components have inconsistent naming"
  8. Props came from tooling where a tool exists (docgen, component-meta, a Custom Elements Manifest), and the Scope block names which

Small-system note

For libraries with fewer than 10 components: run the same analysis but present as a single consolidated view. Every finding gets individual attention. Consistency is easier to achieve in a small library — the bar should be 100% consistency, not "mostly consistent."

Frequently asked questions

What does the Component Api Validator AI skill do?

Audit prop APIs across a component library: naming consistency, boolean/default patterns, type coverage, exported types, breaking changes between versions. Trigger: component API audit, are our props consistent, prop naming review. For semver calls use version-bump-advisor.

Why use Component Api Validator on TypingMind?

Because you install it once and use it with any model. Component Api Validator is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Component Api Validator in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/murphytrueman/design-system-ops/tree/main/skills/component-api-validator. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Component Api Validator?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Component Api Validator?

As many as you like. As long as a model supports skills, you can use Component Api Validator with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Component Api Validator AI skill free?

Yes. It is published on GitHub by murphytrueman under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇