create-component-docs

Generate comprehensive component documentation (architecture, API, examples, known issues). Works with React, Vue, Angular, and Web Components. | Genera documentación completa de componentes (arquitectura, API, ejemplos, issues conocidos). Compatible con React, Vue, Angular y Web Components.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "create-component-docs" with this command: npx skills add jrodrigopuca/skills/jrodrigopuca-skills-create-component-docs

Component Documentation Generator

Generate structured documentation for UI components across frameworks.

Overview

This skill guides the creation of component documentation by providing:

  • Structure templates for consistent documentation
  • API/Props table format compatible with TypeScript and PropTypes
  • Architecture diagrams using Mermaid syntax
  • Known issues format with severity classification
  • Usage examples from basic to advanced

This skill references official documentation instead of duplicating content. See external links for framework-specific details.

Prerequisites

  • Access to component source code
  • Understanding of component's purpose and usage
  • Optional: TypeScript types or PropTypes definitions
  • Optional: Existing tests or Storybook stories

Instructions

1. Identify Component Type

Before documenting, classify the component:

TypeCharacteristicsDocumentation Focus
PresentationalNo state, receives props, renders UIProps, variants, styling
ContainerManages state, data fetchingState flow, side effects
CompositeCombines multiple componentsInternal structure, slots
UtilityHooks, HOCs, render propsAPI, return values, usage patterns

Quick checklist:

  • Has internal state? → Document state management
  • Accepts children/slots? → Document composition API
  • Triggers events/callbacks? → Document event interface
  • Has side effects? → Document lifecycle and cleanup
  • Depends on context/providers? → Document dependencies

2. Document the API/Props

Use the standard props table format:

## Props

| Prop       | Type                          | Default     | Required | Description            |
| ---------- | ----------------------------- | ----------- | -------- | ---------------------- |
| `variant`  | `'primary' \| 'secondary'`    | `'primary'` | No       | Visual style variant   |
| `onClick`  | `(event: MouseEvent) => void` | -           | Yes      | Click handler callback |
| `children` | `ReactNode`                   | -           | Yes      | Content to render      |
| `disabled` | `boolean`                     | `false`     | No       | Disables interaction   |

For TypeScript projects, link to types:

See [ButtonProps](../types/button.ts#L12-L25) for complete type definition.

For events/callbacks:

## Events

| Event      | Payload                             | Description                |
| ---------- | ----------------------------------- | -------------------------- |
| `onChange` | `{ value: string, valid: boolean }` | Emitted on input change    |
| `onSubmit` | `FormData`                          | Emitted on form submission |

Official documentation:

3. Map Component Architecture

Document internal structure using Mermaid diagrams:

Component hierarchy:

## Architecture

​`mermaid
graph TD
    A[DataTable] --> B[TableHeader]
    A --> C[TableBody]
    A --> D[TableFooter]
    C --> E[TableRow]
    E --> F[TableCell]
    A --> G[Pagination]
​`

State flow (for stateful components):

## State Flow

​`mermaid
stateDiagram-v2
    [*] --> Idle
    Idle --> Loading: fetch()
    Loading --> Success: data received
    Loading --> Error: request failed
    Success --> Idle: reset()
    Error --> Loading: retry()
​`

Official documentation:

4. Document Interactions

Describe how the component interacts with:

External dependencies:

## Dependencies

| Dependency              | Purpose               | Required |
| ----------------------- | --------------------- | -------- |
| `ThemeContext`          | Provides color tokens | Yes      |
| `useTranslation`        | i18n support          | No       |
| `@tanstack/react-query` | Data fetching         | Yes      |

Lifecycle events:

## Lifecycle

1. **Mount:** Registers event listeners, fetches initial data
2. **Update:** Re-renders on prop/state change, debounces API calls
3. **Unmount:** Cleans up listeners, cancels pending requests

5. Record Known Issues

Document limitations and edge cases:

## Known Issues

| Issue                           | Severity  | Workaround           | Status       |
| ------------------------------- | --------- | -------------------- | ------------ |
| Flickers on rapid re-render     | 🟡 Medium | Use `memo()` wrapper | Open         |
| Doesn't support RTL layout      | 🟢 Low    | Apply manual CSS     | Planned v2.1 |
| Memory leak with large datasets | 🔴 High   | Limit to 1000 items  | In Progress  |

Severity levels:

  • 🔴 High: Causes crashes, data loss, or security issues
  • 🟡 Medium: Degrades UX but has workaround
  • 🟢 Low: Minor inconvenience, cosmetic issues

6. Add Usage Examples

Provide examples from basic to advanced:

## Examples

### Basic Usage

​`tsx
<Button variant="primary" onClick={handleClick}>
  Click me
</Button>
​`

### With Loading State

​```tsx
<Button
variant="primary"
loading={isSubmitting}
disabled={!isValid}
onClick={handleSubmit}

> {isSubmitting ? 'Saving...' : 'Save'}
> </Button>
> ​```

### Composition with Icons

​`tsx
<Button variant="secondary">
  <Icon name="download" />
  <span>Download Report</span>
</Button>
​`

For complex components, link to Storybook:

See [Storybook](https://your-storybook.com/?path=/docs/components-button) for interactive examples.

Quick Reference

SectionWhen to IncludePriority
Props/APIAlways🔴 Required
ExamplesAlways🔴 Required
ArchitectureComposite components🟡 Recommended
State FlowStateful components🟡 Recommended
DependenciesHas external deps🟡 Recommended
Known IssuesHas limitations🟢 If applicable
LifecycleComplex side effects🟢 If applicable

External Resources

Framework documentation:

Documentation tools:

  • Storybook - Interactive component documentation
  • JSDoc - API documentation from comments
  • TypeDoc - TypeScript documentation generator

Diagrams:


See references/templates.md for copy-paste ready templates.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

using-jsdoc

No summary provided by upstream source.

Repository SourceNeeds Review
General

using-commit

No summary provided by upstream source.

Repository SourceNeeds Review
General

build-report

No summary provided by upstream source.

Repository SourceNeeds Review