# AGENTS.md — Rekodo

Guidance for AI coding agents working with **Rekodo** (both when building apps using `@rekodo/react` and when contributing to this monorepo).

---

## What is Rekodo?

**Rekodo** is a presentational, audio-first React component library shaped by vinyl kissaten, late-night cassette culture, and underground live houses. Built on React 18/19, accessible custom React primitives (`@radix-ui/react-slot` for `Button` polymorphism), Tailwind CSS v4, and `tailwind-variants`.

- **Package name:** `@rekodo/react` (and future `@rekodo/react-native`)
- **Styles entry:** `@rekodo/react/styles.css`
- **Audio & media model:** Core audio primitives (`CassettePlayer`, `Vinyl`, `Waveform`, `Equalizer`, `Tracklist`, `Lyrics`, `Knob`) are 100% presentational & engine-agnostic — they accept controlled props (`isPlaying`, `progress`, `currentTime`, `onPlayPause`, `onSeek`) and never bundle an audio engine. Higher-level decks (`AudioPlayer`, `VideoPlayer`) also support optional standalone HTML5 `<audio>` / `<video>` playback when `src` is provided (`VideoPlayer` also supports full controlled mode).

---

## Using `@rekodo/react` in an App

### 1. Install & Import
```bash
bun add @rekodo/react
# or: npm install @rekodo/react
```

Import the stylesheet once at your app entry point:
```tsx
import "@rekodo/react/styles.css";
import { CassettePlayer, Waveform, Setlist } from "@rekodo/react";
```

### 2. Core Rules for Agents Generating UI
- **Always import `"@rekodo/react/styles.css"`** (or the theme tokens) so `--rkd-*` CSS variables and `@keyframes rkd-eq-bar` work.
- **Keep components controlled & engine-agnostic:** Wire `isPlaying`, `progress` (`0..1`), `duration` (seconds), `currentTime` (seconds), and callbacks (`onPlayPause`, `onSeek`, `onSelectTrack`) to the user's audio engine (HTML5 `<audio>`, Howler.js, Tone.js, or Web Audio API).
- **Respect the color restraint rule (see `DESIGN.md`):**
  - Default to a **monochrome dark canvas** (`bg-black`, `bg-zinc-950`, `border-zinc-800/80`, `text-white` / `text-zinc-400`) with a **single restrained accent** (`accent="violet"`).
  - **Do NOT mix `rose` (red) and `violet` together** on the same screen unless the user explicitly asks for a gig-poster red accent. When using `ChannelRow`, `ReactionBar`, or `Badge` in lists, prefer `zinc` + `violet` over rainbow multi-color rows.
- **Prefer real Rekodo primitives over raw divs:**
  - Audio & media playback: `CassettePlayer`, `Vinyl`, `AudioPlayer`, `VideoPlayer`, `Waveform`, `Equalizer`, `Tracklist`, `Lyrics`, `Knob`, `Slider` (`variant="fader"`).
  - Live shows & physical releases: `Setlist`, `Discography`, `AlbumArt` (`variant="sleeve" | "jewel" | "poster"`), `ZineCard`, `PosterFrame`, `PosterHeader`, `PosterField`.
  - Artist pages & navigation: `NavRibbon`, `ChannelList` + `ChannelRow`, `Breadcrumb` (`variant="station" | "alley"`), `StageRuler`, `ReactionBar`.
  - Standard UI: `Button`, `Badge`, `Card`, `Tabs`, `Accordion`, `Dialog`, `Drawer`, `DropdownMenu`, `Input`, `Textarea`, `Select`, `Switch`, `Table`, `Toaster` / `toast`, `Tooltip`, `Avatar` / `AvatarGroup`, `Kbd`, `EmptyState`, `FileUpload`, `Alert`, `Backdrop`.

### 3. Available AI Documentation Endpoints
When hosted on the docs site:
- `/llms.txt` — Compact index of all docs and 41 components.
- `/llms-full.txt` — Complete single-file Markdown documentation with usage examples, theme tokens, and prop tables.
- `/DESIGN.md` — Visual design system, tokens, typography, and aesthetic rules.
- `/AGENTS.md` — This file.
- `/docs/agent-skills` — Portable Agent Skill guide (`skills/rekodo/SKILL.md`).

---

## Contributing to This Monorepo

### Structure
- `packages/react/` — Core React component library (`@rekodo/react`) (`src/components/*`, `src/theme/tokens.css`, `src/index.ts`).
- `apps/docs/` — Astro + React interactive docs site (`@rekodo/docs`) (`src/pages/docs/*.astro`, `src/components/demos/*`).
- `skills/rekodo/` — Portable Agent Skill (`SKILL.md` + references).
- `scripts/generate-llms.ts` — Generates `apps/docs/public/llms.txt` and `llms-full.txt` from docs pages.

### Commands
```bash
bun install                  # Install workspace dependencies
bun run dev                  # Start docs site (Astro dev server)
bun run build                # Build packages/react (tsup)
bun run build:all            # Build library + docs site (regenerates llms.txt)
bun run typecheck            # Typecheck all workspaces
bun run generate:llms        # Regenerate llms.txt & llms-full.txt
```

### Adding a New Component
1. Create `packages/react/src/components/<name>/` with component implementation and `index.ts`.
2. Export it from `packages/react/src/index.ts`.
3. Add a demo in `apps/docs/src/components/demos/` and a doc page in `apps/docs/src/pages/docs/<name>.astro` (with `usageCode` and `props` array so `generate-llms.ts` indexes it automatically).
4. Run `bun run generate:llms`, `bun run build:all`, and `bun run typecheck`.
