# Skills

Each subdirectory here is one **skill** — an artifact-shape recipe the agent can load for a session. A skill declares *what* it produces (slide deck, landing page, mobile prototype, dashboard, …), *how* it wants the design system and craft rules applied, and *what* outputs it expects from Figma.

## Schema

A skill is a directory containing a single `SKILL.md` file with YAML frontmatter followed by a Markdown body. The body is injected verbatim into the system prompt when the skill is active.

```yaml
---
name: Pitch Deck
description: Investor-facing pitch deck, 8–12 slides on a 16:9 fixed canvas.
triggers:
  - pitch deck
  - investor deck
cd:
  mode: deck
  platform: figma-fixed-canvas
  scenario: fundraising
  preview: figma_frames
  fidelity: high
  speaker_notes: true
  animations: false
  design_system:
    requires: true
    sections: [palette, type, spacing]
  craft:
    requires: [typography, typography-hierarchy-editorial, color, anti-ai-slop]
  outputs:
    primary: figma_frames
    capabilities_required: [figma_execute, figma_image]
  default_for: [pitch-deck]
  example_prompt: "8-slide pitch deck for a B2B SaaS, investor audience"
---

Body goes here — project-specific guidance the agent reads on top of
the system prompt. Use this to codify the slide rhythm, mandatory
sections, anti-patterns for this artifact shape, etc.
```

## Fields

- `name` (required) — human label.
- `description` (required) — one-line summary.
- `triggers` — phrases that suggest this skill.
- `cd.mode` — artifact mode: `deck` / `page` / `mobile` / `dashboard` / `editorial` / `other`.
- `cd.platform` — delivery surface (e.g. `figma-fixed-canvas`, `figma-responsive`).
- `cd.scenario`, `cd.preview`, `cd.fidelity`, `cd.speaker_notes`, `cd.animations`, `cd.featured`, `cd.example_prompt` — metadata used by the launcher.
- `cd.design_system.requires` — whether a bound DS is mandatory.
- `cd.design_system.sections` — which DS sections to foreground.
- `cd.craft.requires` — subset of `craft/` slugs to inject under this skill. Overrides the always-on `DEFAULT_CRAFT`.
- `cd.outputs.primary`, `cd.outputs.capabilities_required` — what the skill produces and which tools it needs live.
- `cd.default_for` — artifact kinds this skill is the default for.
- `cd.upstream` — upstream/umbrella skills.
- `cd.inputs`, `cd.parameters` — declared inputs and knobs (documentation-only today).

## Loader

`src/skills.ts` ships `listSkills()` and `loadSkill(slug)`. The parser handles the subset of YAML used in this schema: nested 2-space-indented mappings, inline `[a, b, c]` arrays, and block `- item` sequences.

## Ports from open-design

The schema and slot architecture are ported from nexu-io/open-design (Apache-2.0). See `/NOTICE` for attribution.
