/codebase-index
Generate a pre-computed component index from a design system codebase — YAML infrastructure files containing a component inventory, relationship graph, and summary statistics that AI agents and MCP servers consume. This produces machine-readable index files in .ai/index/, NOT a
$ npx -y skills add murphytrueman/design-system-ops --skill codebase-index --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.
- You can call itInvoke it directly when you want it.
- Slash command
/codebase-index
Context preview
The summary Claude sees to decide when to auto-load this skill.
Generate a pre-computed component index from a design system codebase — YAML infrastructure files containing a component inventory, relationship graph, and summary statistics that AI agents and MCP servers consume. This produces machine-readable index files in .ai/index/, NOT a
SKILL.md
codebase-index.SKILL.mdname: codebase-index
description: "Generate a pre-computed component index from a design system codebase — YAML infrastructure files containing a component inventory, relationship graph, and summary statistics that AI agents and MCP servers consume. This produces machine-readable index files in .ai/index/, NOT a health report or quality assessment. Trigger when someone says: index my codebase, build a relationship graph, create a component map, codebase index, what depends on what, dependency graph, map component relationships, or anything about producing queryable infrastructure files for AI agents or developer tooling. Do NOT trigger for component health assessments, quality scores, or audit reports — use component-audit for those."
references:
- ../../knowledge-notes/ai-readiness.md
- ../../knowledge-notes/component-governance.md
Codebase index
A skill for generating a pre-computed, machine-readable index of a design system's codebase. The index contains three pieces: a component inventory, a relationship graph, and summary statistics. Together they form a queryable map that eliminates the need for AI agents or developers to explore the codebase from scratch every time they need to understand the system.
Context
When an AI agent needs to work with a design system codebase, it has two options: explore or navigate. Exploration means scanning directories, grepping for imports, reading files one by one. Navigation means loading a pre-computed index and reasoning over cached data.
The difference matters. Exploration is slow, incomplete, and non-deterministic. An agent scanning `src/components` might miss components in `src/layouts`, `src/pages`, or utility directories that don't follow naming conventions. It might report a deeply-nested component as "unused" because it can't trace the dependency chain. It might recreate an existing component because it didn't find it.
A pre-computed index front-loads this cost. The agent loads the index once — typically a few thousand tokens — and gets a complete picture of what exists, where things live, and how they relate. Follow-up questions become cheap because the agent reasons over cached data instead of triggering new file reads.
This skill generates that index. Run it after adding or removing components, and commit the output alongside the code.
---
Configuration
Before producing output, check for a `.ds-ops-config.yml` file in the project root. If present, load:
- `system.framework` — pre-selects framework detection (React, Vue, Svelte, Astro, Angular, etc.)
- `system.component_paths` — overrides default component directory scanning
- `system.category_model` — atomic design, functional, or custom categorisation
- `integrations.*` — enables auto-pull for component data
- `recurring.*` — enables comparison with previous index
Auto-pull integrations
If integrations are configured in `.ds-ops-config.yml`, pull data automatically:
**Figma MCP** (`integrations.figma.enabled: true`):
- Read the published library from `integrations.figma.file_key`
- Cross-reference the Figma component inventory against the code inventory to detect components that exist in design but not in code (or vice versa)
- Pull description status per component to populate the metadata coverage field
**Storybook** (`integrations.storybook.enabled: true`):
- Fetch the story index from `integrations.storybook.url/index.json`
- Extract component list and documentation status
- Use as a secondary source for component discovery
**GitHub** (`integrations.github.enabled: true`):
- Use `gh api search/code` to count import references across consuming repositories
- Pull PR activity for recency signals
If an integration fails, log it and proceed with manual scanning.
---
Step 1: Detect the framework and structure
Scan the project root to determine:
- **Framework**: React (JSX/TSX), Vue (SFC), Svelte, Astro, Angular, Web Components, or mixed
- **Component directories**: Where components live — scan common locations: `src/components/`, `src/lib/`, `components/`, `packages/`, and any paths in `tsconfig.json` or framework config
- **Category model**: How components are organised — atomic design (`atoms/`, `molecules/`, `organisms/`), functional (`forms/`, `navigation/`, `feedback/`), flat, or monorepo packages
- **Styling approach**: CSS modules, CSS-in-JS, Tailwind, SCSS, or design tokens — this determines how to trace token dependencies
Ask for or confirm (skip questions already answered by config or detection):
- The component source root if auto-detection finds multiple candidates
- Whether there are components in non-standard locations (e.g., a shared `utils/` directory with reusable UI primitives)
- Whether to include internal/private components in the index (underscore-prefixed, `internal/` directories, components not re-exported from barrel files)
**Framework detection rules:**
| Signal | Framework | |---|---| | `.jsx` / `.tsx` files with JSX returns | React | | `.vue` files with `<template>` blocks | Vue | | `.svelte` files | Svelte | | `.astro` files | Astro | | `.component.ts` with `@Component` decorator | Angular | | `customElements.define()` | Web Components | | Mixed signals | Ask the user |
Step 2: Scan and build the component inventory
For every component file found, extract:
- **Name**: The component's exported name
- **Path**: Relative path from project root
- **Category**: Based on the category model (atom, molecule, organism, etc.) or functional category (navigation, form, feedback, layout, data display)
- **Metadata status**: Whether the component has structured metadata (a `.metadata.ts`, `.metadata.json`, description in Storybook, JSDoc/TSDoc block, or Figma description)
- **Export type**: Default export, named export, or re-exported through a barrel file
**What counts as a component:**
- Files that export a renderable element (JSX, template, render function)
- Files explicitly registered in a component index, barrel fi
Read more
name: codebase-index description: "Generate a pre-computed component index from a design system codebase — YAML infrastructure files containing a component inventory, relationship graph, and summary statistics that AI agents and MCP servers consume. This produces machine-readable index files in .ai/index/, NOT a health report or quality assessment. Trigger when someone says: index my codebase, build a relationship graph, create a component map, codebase index, what depends on what, dependency graph, map component relationships, or anything about producing queryable infrastructure files for AI agents or developer tooling. Do NOT trigger for component health assessments, quality scores, or audit reports — use component-audit for those." references: - ../../knowledge-notes/ai-readiness.md - ../../knowledge-notes/component-governance.md
Codebase index
A skill for generating a pre-computed, machine-readable index of a design system's codebase. The index contains three pieces: a component inventory, a relationship graph, and summary statistics. Together they form a queryable map that eliminates the need for AI agents or developers to explore the codebase from scratch every time they need to understand the system.
Context
When an AI agent needs to work with a design system codebase, it has two options: explore or navigate. Exploration means scanning directories, grepping for imports, reading files one by one. Navigation means loading a pre-computed index and reasoning over cached data.
The difference matters. Exploration is slow, incomplete, and non-deterministic. An agent scanning `src/components` might miss components in `src/layouts`, `src/pages`, or utility directories that don't follow naming conventions. It might report a deeply-nested component as "unused" because it can't trace the dependency chain. It might recreate an existing component because it didn't find it.
A pre-computed index front-loads this cost. The agent loads the index once — typically a few thousand tokens — and gets a complete picture of what exists, where things live, and how they relate. Follow-up questions become cheap because the agent reasons over cached data instead of triggering new file reads.
This skill generates that index. Run it after adding or removing components, and commit the output alongside the code.
---
Configuration
Before producing output, check for a `.ds-ops-config.yml` file in the project root. If present, load:
- `system.framework` — pre-selects framework detection (React, Vue, Svelte, Astro, Angular, etc.)
- `system.component_paths` — overrides default component directory scanning
- `system.category_model` — atomic design, functional, or custom categorisation
- `integrations.*` — enables auto-pull for component data
- `recurring.*` — enables comparison with previous index
Auto-pull integrations
If integrations are configured in `.ds-ops-config.yml`, pull data automatically:
**Figma MCP** (`integrations.figma.enabled: true`):
- Read the published library from `integrations.figma.file_key`
- Cross-reference the Figma component inventory against the code inventory to detect components that exist in design but not in code (or vice versa)
- Pull description status per component to populate the metadata coverage field
**Storybook** (`integrations.storybook.enabled: true`):
- Fetch the story index from `integrations.storybook.url/index.json`
- Extract component list and documentation status
- Use as a secondary source for component discovery
**GitHub** (`integrations.github.enabled: true`):
- Use `gh api search/code` to count import references across consuming repositories
- Pull PR activity for recency signals
If an integration fails, log it and proceed with manual scanning.
---
Step 1: Detect the framework and structure
Scan the project root to determine:
- **Framework**: React (JSX/TSX), Vue (SFC), Svelte, Astro, Angular, Web Components, or mixed
- **Component directories**: Where components live — scan common locations: `src/components/`, `src/lib/`, `components/`, `packages/`, and any paths in `tsconfig.json` or framework config
- **Category model**: How components are organised — atomic design (`atoms/`, `molecules/`, `organisms/`), functional (`forms/`, `navigation/`, `feedback/`), flat, or monorepo packages
- **Styling approach**: CSS modules, CSS-in-JS, Tailwind, SCSS, or design tokens — this determines how to trace token dependencies
Ask for or confirm (skip questions already answered by config or detection):
- The component source root if auto-detection finds multiple candidates
- Whether there are components in non-standard locations (e.g., a shared `utils/` directory with reusable UI primitives)
- Whether to include internal/private components in the index (underscore-prefixed, `internal/` directories, components not re-exported from barrel files)
**Framework detection rules:**
| Signal | Framework | |---|---| | `.jsx` / `.tsx` files with JSX returns | React | | `.vue` files with `<template>` blocks | Vue | | `.svelte` files | Svelte | | `.astro` files | Astro | | `.component.ts` with `@Component` decorator | Angular | | `customElements.define()` | Web Components | | Mixed signals | Ask the user |
Step 2: Scan and build the component inventory
For every component file found, extract:
- **Name**: The component's exported name
- **Path**: Relative path from project root
- **Category**: Based on the category model (atom, molecule, organism, etc.) or functional category (navigation, form, feedback, layout, data display)
- **Metadata status**: Whether the component has structured metadata (a `.metadata.ts`, `.metadata.json`, description in Storybook, JSDoc/TSDoc block, or Figma description)
- **Export type**: Default export, named export, or re-exported through a barrel file
**What counts as a component:**
- Files that export a renderable element (JSX, template, render function)
- Files explicitly registered in a component index, barrel fi
Showing the first part of this file.
Claude Code skills for the work that keeps a design system alive.
Repo: murphytrueman/design-system-ops
Other skills on design-system-ops.
- /accessibility-per-component
Run an accessibility audit on a specific design system component. Trigger when someone says: accessibility check, a11y audit, WCAG compliance, is this accessible, check accessibility, does this meet WCAG, screen reader support, keyboard navigation check, or anything about
Open skill - /adoption-report
Produce a design system adoption report separating coverage from actual adoption, with trend direction and risk flags. Trigger when someone says: adoption report, how much is the system being used, usage metrics, adoption status, coverage report, which teams are using the
Open skill - /ai-component-description
Generate AI-optimised text descriptions for components, formatted for Figma's MCP server and LLM consumption. This produces prose descriptions in a six-section format (purpose, props, anti-patterns, composition, accessibility, examples), NOT JSON schemas or structured data
Open skill - /backlog-generator
Transform audit findings into sprint-ready work items with effort estimates, acceptance criteria, and stakeholder-friendly rationale. This converts existing findings into tickets, NOT the process for contributing new components to the system. Trigger when someone says: generate
Open skill - /change-communication
Produce a communication package for a design system change — release notes, migration guide, and team announcement. This produces communication artefacts for changes that have already been decided, NOT the deprecation lifecycle itself. Trigger when someone says: communicate this
Open skill - /cicd-integration
Generate CI/CD pipeline configurations that automate design system quality checks — token validation, component linting, visual regression, accessibility scanning, and release gating. Produces ready-to-use pipeline files for GitHub Actions, GitLab CI, CircleCI, or Bitbucket
Open skill

