home / skills / levnikolaevich / claude-code-skills / ln-114-frontend-docs-creator

ln-114-frontend-docs-creator skill

/ln-114-frontend-docs-creator

This skill generates design_guidelines.md for frontend projects, ensuring WCAG, design system coverage, and token extraction from the context store.

npx playbooks add skill levnikolaevich/claude-code-skills --skill ln-114-frontend-docs-creator

Review the files below or copy the command above to add this skill to your agents.

Files (4)
SKILL.md
3.7 KB
---
name: ln-114-frontend-docs-creator
description: Creates design_guidelines.md for frontend projects. L3 Worker invoked CONDITIONALLY when hasFrontend detected.
---

> **Paths:** File paths (`shared/`, `references/`, `../ln-*`) are relative to skills repo root. If not found at CWD, locate this SKILL.md directory and go up one level for repo root.

# Frontend Documentation Creator

L3 Worker that creates design_guidelines.md. CONDITIONAL - only invoked when project has frontend.

## Purpose & Scope
- Creates design_guidelines.md (if hasFrontend)
- Receives Context Store from ln-110-project-docs-coordinator
- WCAG 2.1 Level AA accessibility compliance
- Design system documentation
- Never gathers context itself; uses coordinator input

## Invocation (who/when)
- **ln-110-project-docs-coordinator:** CONDITIONALLY invoked when:
  - `hasFrontend=true` (react, vue, angular, svelte detected)
- Never called directly by users

## Inputs
From coordinator:
- `contextStore`: Context Store with frontend-specific data
  - DESIGN_SYSTEM (Material-UI, Ant Design, custom)
  - COLOR_PALETTE (primary, secondary, accent)
  - TYPOGRAPHY (font families, sizes, weights)
  - COMPONENT_LIBRARY (detected components)
- `targetDir`: Project root directory
- `flags`: { hasFrontend }

## Documents Created (1, conditional)

| File | Condition | Questions | Auto-Discovery |
|------|-----------|-----------|----------------|
| docs/project/design_guidelines.md | hasFrontend | Q43-Q45 | Low |

## Workflow

### Phase 1: Check Conditions
1. Parse flags from coordinator
2. If `!hasFrontend`: return early with empty result

### Phase 2: Create Document
1. Check if file exists (idempotent)
2. If exists: skip with log
3. If not exists:
   - Copy template
   - Replace placeholders with Context Store values
   - Populate design system section
   - Mark `[TBD: X]` for missing data

### Phase 3: Self-Validate
1. Check SCOPE tag
2. Validate sections:
   - Design System (component library)
   - Typography (font families, sizes)
   - Colors (hex codes, semantic colors)
3. Check WCAG 2.1 references
4. Check Maintenance section

### Phase 4: Return Status
```json
{
  "created": ["docs/project/design_guidelines.md"],
  "skipped": [],
  "tbd_count": 1,
  "validation": "OK"
}
```

## Critical Notes

### Core Rules
- **Conditional:** Skip entirely if no frontend detected
- **WCAG compliance:** Document must reference accessibility standards
- **Design tokens:** Extract from CSS variables, tailwind config, or theme files
- **Idempotent:** Never overwrite existing files

### NO_CODE_EXAMPLES Rule (MANDATORY)
Design guidelines document **visual standards**, NOT code:
- **FORBIDDEN:** CSS code blocks, component implementations
- **ALLOWED:** Tables (colors, typography), design tokens, Figma links
- **INSTEAD OF CODE:** "See [Component Library](link)" or "See src/components/Button.tsx"

### Stack Adaptation Rule (MANDATORY)
- Link to correct component library docs (MUI for React, Vuetify for Vue)
- Reference framework-specific patterns (React hooks, Vue composition API)
- Never mix stack references (no React examples in Vue project)

### Format Priority (MANDATORY)
Tables (colors, typography, spacing) > Lists (component inventory) > Text

## Definition of Done
- Condition checked (hasFrontend)
- Document created if applicable
- Design system, typography, colors documented
- WCAG references included
- **Actuality verified:** all document facts match current code (paths, functions, APIs, configs exist and are accurate)
- Status returned to coordinator

## Reference Files
- Templates: `references/templates/design_guidelines_template.md`
- Questions: `references/questions_frontend.md` (Q43-Q45)

---
**Version:** 1.1.0
**Last Updated:** 2025-01-12

Overview

This skill creates a project design_guidelines.md for frontend projects when a frontend is detected. It synthesizes design system details, typography, color tokens, and WCAG 2.1 Level AA guidance into a single, idempotent document using coordinator-supplied context. The skill never gathers context itself and runs only under conditional invocation.

How this skill works

When invoked with hasFrontend=true, the skill checks for an existing docs/project/design_guidelines.md and skips creation if present. If missing, it populates a template with values from the coordinator context store (design system, color palette, typography, component library), inserts tables for tokens and semantic colors, and marks any missing data with [TBD: X]. It then validates presence of key sections and accessibility references before returning status summary.

When to use it

  • Run automatically when the project coordinator detects a frontend (React, Vue, Angular, Svelte).
  • When you need a single-source design guidelines document for designers and frontend engineers.
  • During initial project setup or when design system details are first discovered.
  • As part of release gating to ensure WCAG 2.1 Level AA considerations are documented.
  • When you want an idempotent creation step that never overwrites existing docs.

Best practices

  • Provide complete contextStore inputs (DESIGN_SYSTEM, COLOR_PALETTE, TYPOGRAPHY, COMPONENT_LIBRARY) from the coordinator to minimize TBDs.
  • Keep design tokens in CSS variables, Tailwind config, or theme files so the skill can extract accurate values.
  • Link to the canonical component library docs (MUI, Ant Design, Vuetify) rather than including implementation code.
  • Maintain the generated file in docs/project and update source tokens when visual styles change.
  • Treat the document as living: update coordinator inputs and rerun the coordinator to refresh content.

Example use cases

  • Create design_guidelines.md when bootstrapping a React app that uses Material-UI and a defined color palette.
  • Document typography, spacing, and semantic color tokens for a new Vue project using Vuetify.
  • Generate an accessibility-focused design guidelines page to satisfy WCAG 2.1 AA checks in a release pipeline.
  • Populate design system references and Figma links for a Svelte project where designers and devs share tokens.
  • Run as part of project docs coordination to ensure a consistent design baseline across multiple repos.

FAQ

Will this skill overwrite an existing design_guidelines.md?

No. The skill is idempotent and will skip creation if the file already exists.

Does the skill collect frontend details from the repo?

No. It uses the coordinator-provided contextStore and will mark missing values as [TBD: X].