Skip to main content

Add Content Tab Skill Design

Overview​

A new Claude Code slash command /add-content-tab for the content team to create or edit content.md files in existing folder-based component or pattern documentation pages. This provides a dedicated workflow for the content team, who operates independently from the design team.

Goals​

  • Content team can run /add-content-tab <ComponentOrPatternName> to create a content.md with a structured template
  • Works for both components (docs/components/<name>/) and patterns (docs/patterns/<name>/)
  • Only works with folder-based docs (single-file .md components are out of scope)
  • If content.md already exists, opens it for editing instead of overwriting
  • Template follows the agreed conventions: Do/Don't sections, examples table, optional theme-based structure

Non-Goals​

  • No migration of single-file components to folder-based (handled separately)
  • No splitting content.md into multiple files per usage/intent (single file with theme sections is the standard)
  • No Figma integration (content guidelines are written manually)

Section 1: Skill File​

Location​

.claude/commands/add-content-tab.md

This follows the same convention as existing skills (generate-component-doc.md, generate-pattern-doc.md).

Input​

  • $ARGUMENTS — expects: <ComponentOrPatternName>
  • Accepts kebab-case (info-card), PascalCase (InfoCard), or lowercase (infocard)

Behavior​

Step 1: Derive name variants

From the input name, derive:

  • kebab: info-card (folder name)
  • pascal: InfoCard (display title)

Step 2: Locate the doc folder

Search in order:

  1. docs/components/<kebab>/index.md — if found, it's a component
  2. docs/patterns/<kebab>/index.md — if found, it's a pattern

If neither exists, report an error:

"No folder-based component or pattern found for <name>. This command only works with folder-based docs (those with an index.md). Run /generate-component-doc or /generate-pattern-doc first."

Step 3: Check if content.md already exists

  • If content.md exists in the folder → read it, inform the user it already exists, and ask what they'd like to update
  • If content.md does not exist → proceed to create it

Step 4: Ask template question

Ask the user:

"Does this component have multiple intents or usages that need separate content rules (e.g., InfoCard with information/warning/error intents, or Snackbar with success/loading states)?"

  • Yes → theme-based template with sections per intent
  • No → flat template with single Do/Don't

Step 5: Create content.md

Write the file using the chosen template (see Section 2 below).

Step 6: Wire the content tab into index.md

Read index.md in the folder. If it contains <ComponentDocTabs> but no <TabContent tab="content">, add it:

<TabContent tab="content">
</TabContent>

Insert it after <TabContent tab="accessibility"> and before <TabContent tab="status"> (following TAB_CONFIG order).

If index.md already has <TabContent tab="content">, skip this step.

Step 7: Report results

Print:

  • Path to the created/existing content.md
  • Which template was used (flat or theme-based)
  • Reminder: "Edit the file to add your content guidelines. Use Claude Code to help structure and write them."

Section 2: Templates​

Flat Template (single usage components)​

Used when guidelines apply uniformly to all usages of the component.

## Content Guidelines

<!-- Voice, tone, and purpose for {PascalName} content. -->

## Do

- ...

## Don't

- ...

## Examples

| Context | Good | Bad |
|---------|------|-----|
| ... | ... | ... |

Theme-Based Template (multiple intents/usages)​

Used when rules differ per intent or usage (e.g., InfoCard information vs error, Snackbar success vs loading).

## Content Guidelines

<!-- Voice, tone, and purpose for {PascalName} content. -->

## {Intent/Usage 1}

### Do

- ...

### Don't

- ...

## {Intent/Usage 2}

### Do

- ...

### Don't

- ...

## Examples

| Context | Intent/Usage | Good | Bad |
|---------|--------------|------|-----|
| ... | ... | ... | ... |

Design Decisions: Single File With Themes​

All content guidelines live in one content.md per component/pattern, regardless of complexity. Rationale:

  1. AI reads the full rule set at once — when content team uses Claude Code, having all intents in one file gives Claude full context for writing guidelines
  2. Cross-intent consistency — seeing all intents together prevents guideline drift
  3. No architecture changes needed — the plugin, AutoDocTabs, and webpack includes already support a single content.md
  4. Theme sections handle complexity well — even InfoCard with 3 intents stays under 150 lines of content guidelines

If a file ever exceeds ~300 lines, that's the signal to revisit. But content guidelines rarely reach that length.


Section 3: Validation & Error Handling​

ScenarioBehavior
No folder foundError message pointing to /generate-component-doc or /generate-pattern-doc
content.md already existsRead it, inform user, ask what to update
Single-file component (e.g., modal.md)Error: "This is a single-file component. Convert to folder-based first."
No index.md in folderError: "Folder exists but has no index.md. Run the generate command first."
index.md missing <ComponentDocTabs>Still create content.md (AutoDocTabs picks it up from the plugin manifest automatically)

Section 4: Files to Create/Modify​

FileActionPurpose
.claude/commands/add-content-tab.mdCreateThe slash command skill

No changes to existing infrastructure — the plugin already scans for content.md, AutoDocTabs already lazy-loads it, TAB_CONFIG already includes content, and docusaurus.config.ts already excludes tab files from indexing.