@revealui/harnesses 0.1.0 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/content/index.ts","../src/content/definitions/agents/builder.ts","../src/content/definitions/agents/docs-sync.ts","../src/content/definitions/agents/gate-runner.ts","../src/content/definitions/agents/linter.ts","../src/content/definitions/agents/security-reviewer.ts","../src/content/definitions/agents/tester.ts","../src/content/definitions/agents/index.ts","../src/content/definitions/commands/audit.ts","../src/content/definitions/commands/gate.ts","../src/content/definitions/commands/new-package.ts","../src/content/definitions/commands/stripe-best-practices.ts","../src/content/definitions/commands/index.ts","../src/content/definitions/preambles/index.ts","../src/content/definitions/rules/agent-dispatch.ts","../src/content/definitions/rules/biome.ts","../src/content/definitions/rules/code-analysis-policy.ts","../src/content/definitions/rules/database.ts","../src/content/definitions/rules/monorepo.ts","../src/content/definitions/rules/parameterization.ts","../src/content/definitions/rules/skills-usage.ts","../src/content/definitions/rules/tailwind.ts","../src/content/definitions/rules/unused-declarations.ts","../src/content/definitions/rules/index.ts","../src/content/definitions/skills/db-migrate.ts","../src/content/definitions/skills/preflight.ts","../src/content/definitions/skills/revealui-conventions.ts","../src/content/definitions/skills/revealui-db.ts","../src/content/definitions/skills/revealui-debugging.ts","../src/content/definitions/skills/revealui-review.ts","../src/content/definitions/skills/revealui-safety.ts","../src/content/definitions/skills/revealui-tdd.ts","../src/content/definitions/skills/revealui-testing.ts","../src/content/definitions/skills/tailwind-4-docs.ts","../src/content/definitions/skills/index.ts","../src/content/definitions/index.ts","../src/content/resolvers/environment.ts","../src/content/resolvers/project.ts","../src/content/resolvers/index.ts","../src/content/generators/claude.ts","../src/content/generators/cursor.ts","../src/content/generators/index.ts","../src/content/schemas/manifest.ts","../src/content/schemas/agent.ts","../src/content/schemas/command.ts","../src/content/schemas/preamble.ts","../src/content/schemas/rule.ts","../src/content/schemas/skill.ts"],"sourcesContent":["/**\n * @revealui/harnesses/content — Canonical Content Layer\n *\n * Tool-agnostic definitions for AI guidance content (rules, commands, agents, skills).\n * Generators produce tool-specific output (Claude Code, Cursor, etc.) from canonical definitions.\n *\n * @example\n * ```ts\n * import { buildManifest, validateManifest, generateContent, diffContent } from '@revealui/harnesses/content';\n *\n * const manifest = buildManifest();\n * const validation = validateManifest(manifest);\n * const files = generateContent('claude-code', manifest, { projectRoot: '/path/to/project' });\n * ```\n */\n\nimport { readFileSync } from 'node:fs';\nimport { join, resolve } from 'node:path';\nimport { buildManifest } from './definitions/index.js';\nimport { getGenerator, listGenerators } from './generators/index.js';\nimport type { DiffEntry, GeneratedFile } from './generators/types.js';\nimport type { ResolverContext } from './resolvers/types.js';\nimport { type Manifest, ManifestSchema } from './schemas/manifest.js';\n\nexport { buildManifest } from './definitions/index.js';\nexport { getGenerator, listGenerators, registerGenerator } from './generators/index.js';\nexport type { ContentGenerator, DiffEntry, GeneratedFile } from './generators/types.js';\nexport { listResolvers, registerResolver, resolveTemplate } from './resolvers/index.js';\nexport type { ResolverContext, ResolverFn } from './resolvers/types.js';\n// Re-export everything consumers need\nexport type { Agent, Command, Manifest, PreambleTier, Rule, Skill } from './schemas/index.js';\nexport {\n AgentSchema,\n CommandSchema,\n ManifestSchema,\n PreambleTierSchema,\n RuleSchema,\n SkillSchema,\n} from './schemas/index.js';\n\nexport interface ValidationResult {\n valid: boolean;\n errors: string[];\n}\n\nexport interface ContentSummary {\n rules: number;\n commands: number;\n agents: number;\n skills: number;\n preambles: number;\n total: number;\n}\n\n/** Validate a manifest object against the Zod schema. */\nexport function validateManifest(manifest: unknown): ValidationResult {\n const result = ManifestSchema.safeParse(manifest);\n if (result.success) {\n return { valid: true, errors: [] };\n }\n return {\n valid: false,\n errors: result.error.issues.map((issue) => `${issue.path.join('.')}: ${issue.message}`),\n };\n}\n\n/** Generate content files for a specific generator. */\nexport function generateContent(\n generatorId: string,\n manifest: Manifest,\n ctx: ResolverContext,\n): GeneratedFile[] {\n const generator = getGenerator(generatorId);\n if (!generator) {\n throw new Error(\n `Unknown generator \"${generatorId}\". Available: ${listGenerators().join(', ')}`,\n );\n }\n return generator.generateAll(manifest, ctx);\n}\n\n/** Compare generated content against existing files on disk. */\nexport function diffContent(\n generatorId: string,\n manifest: Manifest,\n ctx: ResolverContext,\n projectRoot: string,\n): DiffEntry[] {\n const files = generateContent(generatorId, manifest, ctx);\n const entries: DiffEntry[] = [];\n\n for (const file of files) {\n const absolutePath = resolve(join(projectRoot, file.relativePath));\n let actual: string | undefined;\n try {\n actual = readFileSync(absolutePath, 'utf-8');\n } catch {\n // File doesn't exist\n }\n\n if (actual === undefined) {\n entries.push({ relativePath: file.relativePath, status: 'added', expected: file.content });\n } else if (actual === file.content) {\n entries.push({ relativePath: file.relativePath, status: 'unchanged' });\n } else {\n entries.push({\n relativePath: file.relativePath,\n status: 'modified',\n expected: file.content,\n actual,\n });\n }\n }\n\n return entries;\n}\n\n/** Get a summary of all content in the manifest. */\nexport function listContent(manifest?: Manifest): ContentSummary {\n const m = manifest ?? buildManifest();\n return {\n rules: m.rules.length,\n commands: m.commands.length,\n agents: m.agents.length,\n skills: m.skills.length,\n preambles: m.preambles.length,\n total: m.rules.length + m.commands.length + m.agents.length + m.skills.length,\n };\n}\n","import type { Agent } from '../../schemas/agent.js';\n\nexport const builderAgent: Agent = {\n id: 'builder',\n tier: 'oss',\n name: 'Builder',\n description: 'Builds and typechecks packages in isolation',\n isolation: 'worktree',\n tools: [],\n content: `You are a build agent for the RevealUI monorepo.\n\n## Setup\nRun \\`pnpm install\\` first to establish symlinks in this worktree.\n\n## Tasks\n- Build specified package(s): \\`pnpm --filter <package> build\\`\n- Typecheck specified package(s): \\`pnpm --filter <package> typecheck\\`\n- Full build: \\`pnpm build\\`\n- Full typecheck: \\`pnpm typecheck:all\\`\n\n## Rules\n- Report errors clearly with file paths and line numbers\n- Do NOT modify source code — only build and report\n- If a build fails, identify the root cause and report it`,\n};\n","import type { Agent } from '../../schemas/agent.js';\n\nexport const docsSyncAgent: Agent = {\n id: 'docs-sync',\n tier: 'pro',\n name: 'Docs Sync',\n description: 'Checks documentation freshness against code changes to prevent doc drift',\n isolation: 'worktree',\n tools: [],\n content: `You are a documentation sync checker for the RevealUI monorepo.\n\n## Purpose\n\nDetect documentation drift — places where code has changed but docs haven't been updated.\n\n## Checks\n\n### 1. API Route ↔ OpenAPI Spec\n- Compare \\`apps/api/src/routes/\\` route handlers against \\`packages/openapi/\\` spec\n- Flag routes that exist in code but not in spec (or vice versa)\n- Check that request/response schemas match \\`@revealui/contracts\\`\n\n### 2. Package Exports ↔ Docs Site\n- Compare \\`packages/*/src/index.ts\\` exports against \\`apps/docs/\\` documentation\n- Flag exported functions/types that have no corresponding doc page\n- Check that documented APIs still exist in the package\n\n### 3. CLI Commands ↔ CLI Docs\n- Compare \\`packages/cli/src/\\` commands against docs site CLI reference\n- Flag undocumented commands or removed commands still in docs\n\n### 4. Collection Fields ↔ CMS Docs\n- Compare \\`apps/cms/src/collections/\\` field definitions against any collection docs\n- Flag field additions/removals not reflected in documentation\n\n### 5. Environment Variables\n- Compare env vars used in code (\\`process.env.*\\`, \\`config.*\\`) against:\n - \\`.env.example\\` files\n - Setup documentation\n - Deployment docs\n\n### 6. CLAUDE.md Accuracy\n- Verify package counts, table counts, and other metrics in CLAUDE.md\n- Check that listed commands still work\n- Verify port numbers match actual app configs\n\n## Output Format\n\nReport findings as a table:\n\n| Priority | Area | Issue | File(s) |\n|----------|------|-------|---------|\n| HIGH | API routes | POST /api/tickets not in OpenAPI spec | apps/api/src/routes/tickets.ts |\n| MEDIUM | Package exports | \\`createSession\\` exported but undocumented | packages/auth/src/index.ts |\n\n## Rules\n- Do NOT modify any files — report only\n- Focus on high-priority drift (new features, changed APIs)\n- Ignore internal/private APIs not intended for external docs\n- Check git log for recently changed files to prioritise review`,\n};\n","import type { Agent } from '../../schemas/agent.js';\n\nexport const gateRunnerAgent: Agent = {\n id: 'gate-runner',\n tier: 'pro',\n name: 'Gate Runner',\n description: 'Runs the full CI gate in isolation',\n isolation: 'worktree',\n tools: [],\n content: `You are a CI gate agent for the RevealUI monorepo.\n\n## Setup\nRun \\`pnpm install\\` first to establish symlinks in this worktree.\n\n## Tasks\n- Full gate: \\`pnpm gate\\`\n- Quick gate (phase 1 only): \\`pnpm gate:quick\\`\n- Gate without build: \\`pnpm gate --no-build\\`\n\n## Gate Phases\n1. **Quality** (parallel): Biome lint (hard fail), audits (warn)\n2. **Type checking** (serial): \\`pnpm -r typecheck\\` across all packages\n3. **Test + Build** (parallel): Vitest (warn), turbo build (hard fail)\n\n## Rules\n- Report which phase failed and the specific error(s)\n- Biome, typecheck, and build are hard failures — must be fixed\n- Tests are warn-only — report but don't block\n- Do NOT modify source code — only run the gate and report`,\n};\n","import type { Agent } from '../../schemas/agent.js';\n\nexport const linterAgent: Agent = {\n id: 'linter',\n tier: 'oss',\n name: 'Linter',\n description: 'Lint and format code in isolation',\n isolation: 'worktree',\n tools: [],\n content: `You are a lint/format agent for the RevealUI monorepo.\n\n## Setup\nRun \\`pnpm install\\` first to establish symlinks in this worktree.\n\n## Tasks\n- Biome check: \\`biome check .\\`\n- Biome fix: \\`biome check --write .\\`\n- Full lint: \\`pnpm lint\\`\n- Auto-fix: \\`pnpm lint:fix\\`\n- Format: \\`pnpm format\\`\n\n## Rules\n- Biome is the sole linter — fix all Biome errors\n- Follow the unused declarations policy in \\`.claude/rules/unused-declarations.md\\`\n- Report remaining warnings that cannot be auto-fixed\n- Do NOT suppress lint rules without justification`,\n};\n","import type { Agent } from '../../schemas/agent.js';\n\nexport const securityReviewerAgent: Agent = {\n id: 'security-reviewer',\n tier: 'pro',\n name: 'Security Reviewer',\n description: 'Reviews code for security vulnerabilities, hardcoded secrets, and auth issues',\n isolation: 'worktree',\n tools: [],\n content: `You are a security reviewer for the RevealUI monorepo (Business Operating System Software).\n\n## Scope\n\nAudit the codebase for security issues across these categories:\n\n### 1. Hardcoded Secrets\n- API keys, tokens, passwords in source code (not .env files)\n- Credentials in test fixtures that look production-like\n- Base64-encoded secrets or obfuscated credentials\n\n### 2. Auth & Session Security\n- Session cookie configuration (httpOnly, secure, sameSite, domain)\n- Password hashing (must use bcrypt, never plaintext)\n- Rate limiting on auth endpoints\n- Brute force protection bypass paths\n\n### 3. Input Validation\n- SQL injection via raw queries (should use Drizzle ORM parameterised queries)\n- XSS in rendered content (especially Lexical rich text output)\n- Path traversal in file upload/serve paths\n- SSRF in user-provided URLs\n\n### 4. RBAC/ABAC Policy\n- Missing access control checks on API routes\n- Privilege escalation paths (user → admin)\n- Tenant isolation (multi-site data leakage)\n\n### 5. CSP & Headers\n- Content-Security-Policy completeness\n- CORS misconfiguration (check allowed origins)\n- Missing security headers (HSTS, X-Frame-Options, etc.)\n\n### 6. Dependency Security\n- Known vulnerabilities in direct dependencies\n- Supabase boundary violations (imports outside permitted paths)\n\n## Architecture Context\n\n- **Auth**: Session-only (no JWT). \\`revealui-session\\` cookie across \\`.revealui.com\\`.\n- **Dual-DB**: NeonDB (REST content) + Supabase (vectors/auth). Strict import boundary.\n- **Tiers**: free, pro, max, enterprise. License checks via \\`isLicensed()\\`.\n- **API**: Hono on port 3004. CMS calls API cross-origin (CORS configured).\n\n## Rules\n- Use AST-based analysis over regex for code-shape checks (see .claude/rules/code-analysis-policy.md)\n- Report findings with severity (critical/high/medium/low), file path, and line number\n- Suggest specific fixes, not just descriptions\n- Do NOT modify source code — report only\n- Prioritise critical and high severity findings`,\n};\n","import type { Agent } from '../../schemas/agent.js';\n\nexport const testerAgent: Agent = {\n id: 'tester',\n tier: 'oss',\n name: 'Tester',\n description: 'Runs tests for packages in isolation',\n isolation: 'worktree',\n tools: [],\n content: `You are a test agent for the RevealUI monorepo.\n\n## Setup\nRun \\`pnpm install\\` first to establish symlinks in this worktree.\n\n## Tasks\n- Test specified package(s): \\`pnpm --filter <package> test\\`\n- Test with coverage: \\`pnpm --filter <package> test:coverage\\`\n- Full test suite: \\`pnpm test\\`\n- Integration tests: \\`pnpm test:integration\\`\n\n## Rules\n- Report test failures with file paths, test names, and error messages\n- Do NOT modify source code — only test and report\n- If tests fail, identify the root cause and suggest fixes\n- Report coverage numbers when running with coverage`,\n};\n","import type { Agent } from '../../schemas/agent.js';\nimport { builderAgent } from './builder.js';\nimport { docsSyncAgent } from './docs-sync.js';\nimport { gateRunnerAgent } from './gate-runner.js';\nimport { linterAgent } from './linter.js';\nimport { securityReviewerAgent } from './security-reviewer.js';\nimport { testerAgent } from './tester.js';\n\nexport const agents: Agent[] = [\n builderAgent,\n docsSyncAgent,\n gateRunnerAgent,\n linterAgent,\n securityReviewerAgent,\n testerAgent,\n];\n","import type { Command } from '../../schemas/command.js';\n\nexport const auditCommand: Command = {\n id: 'audit',\n tier: 'oss',\n name: 'Audit',\n description:\n 'Audit the codebase for avoidable `any` types and production console statements. Use when asked to check code quality, before a release, or after a large refactor.',\n disableModelInvocation: false,\n content: `Run code quality audits on the RevealUI monorepo.\n\nExecute these audit commands in sequence:\n\n1. \\`pnpm audit:any\\` — Find avoidable \\`any\\` types across the codebase\n2. \\`pnpm audit:console\\` — Find production \\`console.*\\` statements that should use the logger\n\nReport findings as a summary table with package name and count. If issues are found, suggest fixes.\n\nTarget: 0 avoidable \\`any\\` types, 0 production console statements.`,\n};\n","import type { Command } from '../../schemas/command.js';\n\nexport const gateCommand: Command = {\n id: 'gate',\n tier: 'oss',\n name: 'Gate',\n description:\n 'Run the full CI gate (Biome lint, typecheck, Vitest, turbo build) before pushing. Only invoke when explicitly asked to run the gate or verify before a push.',\n disableModelInvocation: true,\n content: `Run the CI gate to validate the monorepo before pushing.\n\nExecute \\`pnpm gate\\` in the RevealUI monorepo root. This runs the full CI pipeline:\n1. Biome lint check\n2. TypeScript type checking across all packages\n3. Vitest test suite\n4. Turbo build\n\nIf the full gate takes too long, run \\`pnpm gate:quick\\` for phase 1 only (lint + typecheck).\n\nReport any failures with the specific package and error details.`,\n};\n","import type { Command } from '../../schemas/command.js';\n\nexport const newPackageCommand: Command = {\n id: 'new-package',\n tier: 'oss',\n name: 'New Package',\n description:\n 'Scaffold a new @revealui/* package with package.json, tsconfig.json, tsup.config.ts, and src/index.ts. Only invoke when explicitly asked to create a new package.',\n disableModelInvocation: true,\n argumentHint: '<package-name>',\n content: `Scaffold a new package in the RevealUI monorepo.\n\nArguments: $ARGUMENTS (package name, e.g., \"analytics\")\n\nCreate the following structure at \\`packages/<name>/\\`:\n\n1. \\`package.json\\` with:\n - name: \\`@revealui/<name>\\`\n - version: \\`0.1.0\\`\n - type: \\`module\\`\n - exports, main, types pointing to \\`dist/\\`\n - scripts: build, dev, lint, test, typecheck\n - publishConfig.access: \\`public\\` (or \\`\"private\": true\\` for Pro packages)\n - engines.node: \\`>=24.13.0\\`\n\n2. \\`tsconfig.json\\` extending \\`@revealui/dev/tsconfig\\`\n\n3. \\`tsup.config.ts\\` with entry \\`src/index.ts\\`, dts, format esm\n\n4. \\`src/index.ts\\` with a placeholder export\n\n5. \\`README.md\\` with package name and description\n\nAfter scaffolding, remind the user to:\n- Run \\`pnpm install\\` to link the new package\n- Add \\`workspace:*\\` references from consuming packages\n- Create a changeset with \\`pnpm changeset\\``,\n};\n","import type { Command } from '../../schemas/command.js';\n\nexport const stripeBestPracticesCommand: Command = {\n id: 'stripe-best-practices',\n tier: 'pro',\n name: 'Stripe Best Practices',\n description:\n 'Apply when working on Stripe billing, payments, webhooks, subscriptions, or checkout flows (apps/api/src/routes/billing.ts, packages/services).',\n disableModelInvocation: false,\n content: `Apply Stripe best practices when implementing or reviewing payment code in this project:\n\n## Webhook Handling\n- Always verify webhook signatures using \\`stripe.webhooks.constructEvent()\\` with the raw request body (never parsed JSON)\n- Use idempotency keys for all mutating API calls (charges, subscriptions, refunds)\n- Return 200 immediately after signature verification; process asynchronously if needed\n- Handle all relevant events: \\`checkout.session.completed\\`, \\`customer.subscription.deleted\\`, \\`customer.subscription.updated\\`, \\`invoice.payment_failed\\`\n\n## Subscription Management\n- Store \\`customer.id\\`, \\`subscription.id\\`, and \\`subscription.status\\` in your DB — not just price/product IDs\n- Use \\`subscription.status\\` to gate access: only \\`active\\` and \\`trialing\\` grant access\n- Handle \\`past_due\\` gracefully — show dunning UI, don't immediately revoke access\n- Use \\`cancel_at_period_end: true\\` for user-initiated cancellations (preserves access until period end)\n\n## Checkout & Billing Portal\n- Use \\`metadata\\` on checkout sessions to pass internal IDs (userId, planId) through to webhooks\n- Always set \\`client_reference_id\\` to your internal user ID\n- Use Stripe Billing Portal for plan changes and cancellations — don't build your own\n\n## Security\n- Never log full Stripe objects — they may contain PII\n- Never expose secret keys client-side; all Stripe API calls must be server-side\n- Use restricted API keys scoped to minimum permissions for each service\n- Validate that webhook events reference resources owned by your users before acting\n\n## Error Handling\n- Retry on \\`rate_limit_error\\` and network errors with exponential backoff\n- On \\`card_error\\` and \\`invalid_request_error\\`, surface Stripe's \\`message\\` to the user (it's user-safe)\n- Log \\`stripe_error\\` codes for debugging; never expose raw error objects to clients\n\n## RevealUI-Specific\n- Webhook endpoint: \\`apps/cms\\` at \\`/api/webhooks/stripe\\` (NOT the API endpoint)\n- Stripe service: \\`packages/services/src/stripe/\\`\n- Billing routes: \\`apps/api/src/routes/billing.ts\\`\n- Price IDs are managed via \\`pnpm stripe:seed\\` — see \\`scripts/setup/seed-stripe.ts\\``,\n};\n","import type { Command } from '../../schemas/command.js';\nimport { auditCommand } from './audit.js';\nimport { gateCommand } from './gate.js';\nimport { newPackageCommand } from './new-package.js';\nimport { stripeBestPracticesCommand } from './stripe-best-practices.js';\n\nexport const commands: Command[] = [\n auditCommand,\n gateCommand,\n newPackageCommand,\n stripeBestPracticesCommand,\n];\n","import type { PreambleTier } from '../../schemas/preamble.js';\n\nexport const preambles: PreambleTier[] = [\n {\n tier: 1,\n name: 'Identity',\n description: 'Always injected — core project identity and structure',\n ruleIds: ['monorepo'],\n },\n {\n tier: 2,\n name: 'Architecture',\n description: 'Project-wide technical context — database, styling, formatting, config patterns',\n ruleIds: ['database', 'biome', 'tailwind', 'parameterization'],\n },\n {\n tier: 3,\n name: 'Domain',\n description: 'Feature-area specific policies — analysis standards, code hygiene',\n ruleIds: ['code-analysis-policy', 'unused-declarations'],\n },\n {\n tier: 4,\n name: 'Task',\n description: 'Injected per-operation — skill routing, agent dispatch',\n ruleIds: ['skills-usage', 'agent-dispatch'],\n },\n];\n","import type { Rule } from '../../schemas/rule.js';\n\nexport const agentDispatchRule: Rule = {\n id: 'agent-dispatch',\n tier: 'pro',\n name: 'Agent Profile Dispatch',\n description: 'When to spawn specialized agent profiles from .claude/agents/',\n scope: 'project',\n preambleTier: 4,\n tags: ['agents', 'coordination'],\n content: `# Agent Profile Dispatch\n\nProfiles live in \\`.claude/agents/\\`. Spawn them via the Agent tool when a task is\ntoo large or specialized for the current session.\n\n## Profiles\n\n| Profile | When to spawn |\n|---------|--------------|\n| \\`gate-runner\\` | Running the full CI gate (\\`pnpm gate\\`), verifying the repo is clean before a push or release |\n| \\`security-reviewer\\` | Auditing auth flows, reviewing security-sensitive PRs, checking new API routes for vulnerabilities |\n| \\`builder\\` | Large feature implementation spanning multiple packages that would pollute the current session context |\n| \\`tester\\` | Writing test suites, achieving coverage targets, fixing batches of failing tests |\n| \\`docs-sync\\` | Updating public docs, syncing API reference, writing changelogs, keeping MASTER_PLAN in sync |\n| \\`linter\\` | Bulk lint fixes, unused declaration sweeps, \\`any\\` type removal, Biome cleanup across the monorepo |\n\n## Rules\n\n1. Don't spawn a profile for work that takes under 15 minutes in the current session.\n2. Check the workboard before spawning — another agent may already own that area.\n3. Always give spawned agents:\n - Current phase from \\`~/projects/revealui-jv/docs/MASTER_PLAN.md\\`\n - Relevant workboard state\n - The specific task and acceptance criteria\n4. Spawned agents report findings back to the parent. Only the parent updates MASTER_PLAN.md.\n5. Spawned agents must not create plan files outside MASTER_PLAN.md (see \\`planning.md\\`).`,\n};\n","import type { Rule } from '../../schemas/rule.js';\n\nexport const biomeRule: Rule = {\n id: 'biome',\n tier: 'oss',\n name: 'Biome Conventions',\n description: 'Biome 2 linter/formatter rules and suppression protocol',\n scope: 'project',\n preambleTier: 2,\n tags: ['lint', 'format', 'quality'],\n content: `# Biome Conventions\n\n## Overview\n\nBiome 2 is the sole linter and formatter for this monorepo.\n\n## Commands\n\n- \\`pnpm lint\\` — check all files with Biome (\\`biome check .\\`)\n- \\`pnpm format\\` — format all files with Biome (\\`biome format --write .\\`)\n- \\`pnpm lint:fix\\` — auto-fix with Biome (\\`biome check --write .\\`)\n- \\`biome check .\\` — lint + format check (per-package)\n- \\`biome check --write .\\` — auto-fix (used by lint-staged)\n\n## Lint-Staged\n\nPre-commit hook runs \\`biome check --write\\` on staged \\`*.{ts,tsx,js,jsx}\\` files via Husky + lint-staged.\n\n## Key Rules\n\n- No unused variables or imports (auto-removed on format)\n- No \\`console.*\\` in production code (use \\`@revealui/utils\\` logger instead)\n- No \\`any\\` types (use \\`unknown\\` + type guards)\n- Consistent import ordering (auto-sorted)\n- Single quotes for strings\n- Trailing commas\n- Semicolons always\n- 2-space indentation (tabs in Biome config, spaces in output)\n\n## Suppressing Rules\n\n- Use \\`// biome-ignore <rule>: <reason>\\` for specific lines\n- Avoid blanket suppressions — prefer fixing the code\n- Document why a suppression is needed in the comment\n\n## Unused Variables — Special Protocol\n\n**Before suppressing any unused variable or import warning, read \\`.claude/rules/unused-declarations.md\\`.**\n\nThe mandatory decision tree there must be followed. Unused declarations frequently indicate incomplete implementations that need to be finished, not suppressed. Silencing the warning without completing the code creates permanent dead stubs.\n\nTL;DR: implement first, suppress only as a last resort.`,\n};\n","import type { Rule } from '../../schemas/rule.js';\n\nexport const codeAnalysisPolicyRule: Rule = {\n id: 'code-analysis-policy',\n tier: 'oss',\n name: 'Code Analysis Policy',\n description: 'Prefer AST-based analysis over regex for security and architecture checks',\n scope: 'project',\n preambleTier: 3,\n tags: ['security', 'analysis'],\n content: `# Code Analysis Policy\n\nUse AST-based or structural analysis for code-policy and security checks whenever the rule depends on syntax, identifiers, or code shape.\n\n## Prefer AST-Based Analysis For\n\n- security gate checks over application code\n- architecture and boundary rules\n- auth/password handling checks\n- response/body serialization checks\n- import-policy enforcement beyond simple path inventory\n\n## Regex Is Acceptable Only For\n\n- broad inventory scans over raw text\n- committed secret patterns\n- literal token/URL/key detection\n- quick warning-level heuristics that are explicitly marked approximate\n\n## Do Not Use Regex As Source Of Truth For\n\n- whether a value is stored in plaintext\n- whether a secret is hardcoded in executable code\n- whether a boundary rule is violated by code structure\n- whether a security-sensitive value reaches a sink\n\n## Working Rule\n\nIf a check can be expressed against the TypeScript/JavaScript AST with reasonable effort, use AST analysis first.\n\nIf regex is still used:\n\n- document it as heuristic-only\n- keep it warning-level unless independently verified\n- add a follow-up to migrate it to AST/structural analysis`,\n};\n","import type { Rule } from '../../schemas/rule.js';\n\nexport const databaseRule: Rule = {\n id: 'database',\n tier: 'oss',\n name: 'Database Conventions',\n description: 'Dual-database architecture (NeonDB + Supabase) boundaries and query patterns',\n scope: 'project',\n preambleTier: 2,\n tags: ['database', 'architecture', 'drizzle'],\n content: `# Database Conventions\n\n## Dual-Database Architecture\n\nRevealUI uses **two databases with strictly separated responsibilities**:\n\n| Database | Client | Purpose |\n|----------|--------|---------|\n| **NeonDB** (PostgreSQL) | \\`@neondatabase/serverless\\` | REST content: collections, users, sessions, orders, products |\n| **Supabase** | \\`@supabase/supabase-js\\` | Vector embeddings, real-time auth, AI memory storage |\n\n## Boundary Rule\n\n**\\`@supabase/supabase-js\\` must only be imported inside designated vector/auth modules:**\n\n### Allowed paths for Supabase imports\n- \\`packages/db/src/vector/\\` — vector schema and queries\n- \\`packages/db/src/auth/\\` — Supabase auth helpers\n- \\`packages/auth/src/\\` — authentication implementation\n- \\`packages/ai/src/\\` — AI memory and embedding storage\n- \\`packages/services/src/supabase/\\` — Supabase service integrations\n- \\`apps/*/src/lib/supabase/\\` — app-level Supabase utilities\n\n### Forbidden: Supabase imports in\n- \\`packages/core/\\` — CMS engine must be DB-agnostic\n- \\`packages/contracts/\\` — contracts are schema-only\n- \\`packages/config/\\` — config must not hardcode DB client\n- \\`apps/cms/src/collections/\\` — collection hooks use Drizzle/Neon only\n- \\`apps/cms/src/routes/\\` — REST routes use Neon only\n\n## Schema Organization\n\n\\`\\`\\`\npackages/db/src/schema/\n├── accounts.ts # NeonDB: user accounts\n├── agents.ts # NeonDB: AI agent definitions\n├── api-keys.ts # NeonDB: API key management\n├── cms.ts # NeonDB: CMS collections, media\n├── gdpr.ts # NeonDB: GDPR consent, deletion\n├── licenses.ts # NeonDB: license keys, tiers\n├── pages.ts # NeonDB: pages, navigation\n├── sites.ts # NeonDB: multi-tenant sites\n├── tickets.ts # NeonDB: support tickets\n├── users.ts # NeonDB: user management, sessions\n├── vector.ts # Supabase: embeddings, AI memory\n├── rest.ts # NeonDB: REST schema barrel\n├── index.ts # Combined schema export\n└── ... # 30+ schema files total\n\\`\\`\\`\n\n## Query Patterns\n\n### NeonDB (Drizzle ORM)\n\\`\\`\\`ts\nimport { db } from '@revealui/db'\nimport { posts } from '@revealui/db/schema'\n\nconst results = await db.select().from(posts).where(eq(posts.status, 'published'))\n\\`\\`\\`\n\n### Supabase (vector/auth only)\n\\`\\`\\`ts\n// Only in designated modules (packages/db/src/vector/, packages/ai/src/)\nimport { createSupabaseClient } from '@revealui/db/vector'\n\nconst { data } = await supabase.rpc('match_documents', { query_embedding: embedding })\n\\`\\`\\`\n\n## Enforcement\n\nThe \\`pnpm validate:structure\\` script checks for Supabase imports outside permitted paths.\nCI runs this as part of phase 1 (warn-only — violations are flagged but don't block builds).\n\nTo check locally:\n\\`\\`\\`bash\npnpm validate:structure\n\\`\\`\\`\n\n## Migration Guidance\n\nWhen adding new features:\n1. **Content/REST data** → add to \\`packages/db/src/schema/\\` + use Drizzle\n2. **AI/vector data** → add to \\`packages/db/src/vector/\\` + use Supabase client\n3. **Never mix** both DB clients in the same module`,\n};\n","import type { Rule } from '../../schemas/rule.js';\n\nexport const monorepoRule: Rule = {\n id: 'monorepo',\n tier: 'oss',\n name: 'Monorepo Conventions',\n description: 'pnpm workspace, Turborepo, package structure, and publishing conventions',\n scope: 'project',\n preambleTier: 1,\n tags: ['monorepo', 'pnpm', 'turborepo'],\n content: `# Monorepo Conventions\n\n## Structure\n- Apps live in \\`apps/\\` — deployable services (Next.js, Hono, Vite)\n- Packages live in \\`packages/\\` — shared libraries consumed by apps\n- Scripts live in \\`scripts/\\` — CLI tools, automation, CI gates\n\n## Package Manager\n- pnpm 10 with workspace protocol\n- Internal deps use \\`workspace:*\\` (never hardcoded versions)\n- Run \\`pnpm install:clean\\` (suppresses Node deprecation warnings)\n- \\`preinstall\\` script enforces pnpm-only (\\`npx only-allow pnpm\\`)\n\n## Turborepo\n- \\`turbo run build --parallel\\` for parallel builds\n- \\`turbo run test --concurrency=15\\` for parallel tests\n- Package-level \\`turbo.json\\` for task overrides (rare)\n- Cache stored in \\`.turbo/\\` (gitignored)\n\n## Package Conventions\n- Every package has: \\`build\\`, \\`dev\\`, \\`lint\\`, \\`test\\`, \\`typecheck\\` scripts\n- Build output goes to \\`dist/\\` via tsup\n- Source in \\`src/\\`, tests in \\`src/__tests__/\\` or \\`__tests__/\\`\n- Entry point: \\`src/index.ts\\` → \\`dist/index.js\\`\n- Use \\`exports\\` field in package.json for subpath exports\n- Include \\`files: [\"dist\", \"README.md\"]\\` for publishing\n\n## Dependency Rules\n- Use \\`syncpack\\` for version alignment (\\`pnpm deps:check\\`, \\`pnpm deps:fix\\`)\n- Use \\`catalog:\\` for shared devDependencies (e.g., \\`\"zod\": \"catalog:\"\\`)\n- pnpm overrides in root package.json for security patches\n- \\`onlyBuiltDependencies\\` whitelist for native modules\n\n## CI Gate\n- \\`pnpm gate\\` runs the full CI pipeline locally: lint → typecheck → test → build\n- \\`pnpm gate:quick\\` runs phase 1 only (fast feedback)\n- Must pass before pushing (enforced by Husky pre-push hook)\n\n## Adding a New Package\n1. Create \\`packages/<name>/\\` with package.json, tsconfig.json, tsup.config.ts\n2. Name: \\`@revealui/<name>\\`\n3. Add \\`workspace:*\\` references from consuming packages\n4. Register in turbo pipeline (automatic via conventions)\n5. Add to CI if needed\n\n## Publishing\n- OSS packages: \\`publishConfig.access: \"public\"\\`, MIT license\n- Pro packages: \\`publishConfig.access: \"public\"\\`, commercial license (source-available on npm)\n- Use changesets for versioning: \\`pnpm changeset\\` → \\`pnpm changeset:version\\` → \\`pnpm changeset:publish\\`\n\n## Import Conventions\n- Use package names (\\`@revealui/core\\`) not relative paths between packages\n- Use \\`~/\\` alias within apps (maps to \\`src/*\\`)\n- Use ES Modules (\\`import\\`/\\`export\\`) everywhere`,\n};\n","import type { Rule } from '../../schemas/rule.js';\n\nexport const parameterizationRule: Rule = {\n id: 'parameterization',\n tier: 'oss',\n name: 'Parameterization Conventions',\n description: 'Never hardcode config values — extract, type, default, and make overridable',\n scope: 'project',\n preambleTier: 2,\n tags: ['config', 'patterns'],\n content: `# Parameterization Conventions\n\n## Core Rule\n\n**Never hardcode configuration values inline.** All tunable constants (TTLs, limits, lengths, thresholds, intervals) must be:\n\n1. **Extracted** into a named config object or constant at module scope\n2. **Typed** with an explicit interface\n3. **Defaulted** with sensible production values\n4. **Overridable** via an exported \\`configure*()\\` function or constructor parameter\n\n## Pattern\n\n\\`\\`\\`ts\nexport interface ModuleConfig {\n /** TTL in milliseconds (default: 5 minutes) */\n ttlMs: number\n /** Max entries before forced cleanup (default: 10_000) */\n maxEntries: number\n}\n\nconst DEFAULT_CONFIG: ModuleConfig = {\n ttlMs: 5 * 60 * 1000,\n maxEntries: 10_000,\n}\n\nlet config: ModuleConfig = { ...DEFAULT_CONFIG }\n\nexport function configureModule(overrides: Partial<ModuleConfig>): void {\n config = { ...DEFAULT_CONFIG, ...overrides }\n}\n\\`\\`\\`\n\n## Why\n\n- Tests need fast TTLs and small limits\n- Deployments may need different thresholds than development\n- \\`Math.random()\\` is not cryptographically secure — use \\`crypto.randomInt()\\` for security-sensitive values (OTPs, tokens, nonces)\n\n## Applies To\n\n- Rate limit windows and thresholds\n- Cache TTLs and max sizes\n- OTP/token lengths and expiry times\n- Retry counts and backoff intervals\n- Batch sizes and concurrency limits\n\n## Does NOT Apply To\n\n- Structural constants (HTTP status codes, header names, URL paths)\n- Type discriminants and enum values\n- Schema definitions (use contracts)`,\n};\n","import type { Rule } from '../../schemas/rule.js';\n\nexport const skillsUsageRule: Rule = {\n id: 'skills-usage',\n tier: 'pro',\n name: 'Skill Auto-Use Guidelines',\n description: 'When to proactively invoke skills vs wait for explicit user request',\n scope: 'project',\n preambleTier: 4,\n tags: ['skills', 'automation'],\n content: `# Skill Auto-Use Guidelines\n\nWhen the Skill tool is available, proactively invoke the following skills in these situations:\n\n## Always invoke automatically (no user prompt needed)\n\n- \\`/vercel-react-best-practices\\` — before completing any PR that touches React components or hooks\n- \\`/stripe-best-practices\\` — any time you write or modify billing, payment, webhook, or Stripe code\n- \\`/next-best-practices\\` — when implementing features in apps/cms or apps/marketing\n- \\`/next-cache-components\\` — when adding 'use cache', cache profiles, or PPR to a Next.js route\n- \\`/vercel-composition-patterns\\` — when adding new components to @revealui/presentation\n- \\`/web-design-guidelines\\` — when asked to review a UI, page, or component for quality\n- \\`/review\\` — when the user asks for a code review, asks to \"check\" or \"look at\" code\n- \\`/add-tests\\` — when the user asks to write tests or add coverage for a specific file\n- \\`/audit\\` — before any release or after a large refactor touching multiple packages\n- \\`/turborepo\\` — when modifying turbo.json, pipeline configuration, or monorepo task dependencies\n\n## Only invoke on explicit user request (disable-model-invocation: true)\n\n- \\`/gate\\` — user must explicitly ask to run the gate\n- \\`/sync-lts\\` — user must explicitly ask to sync or backup\n- \\`/new-package\\` — user must explicitly ask to scaffold a package\n- \\`/new-professional-project\\` — user must explicitly ask to create a project\n- \\`/vercel-deploy\\` — user must explicitly ask to deploy\n- \\`/deploy-check\\` — user must explicitly ask for pre-deploy check\n- \\`/db-migrate\\` — user must explicitly ask to create or apply database migrations\n- \\`/preflight\\` — user must explicitly ask to run the preflight checklist\n\n## When in doubt\n\nIf a skill's description matches the current task, prefer invoking it over not invoking it.\nThe overhead of loading a skill is low; missing relevant guidance has higher cost.`,\n};\n","import type { Rule } from '../../schemas/rule.js';\n\nexport const tailwindRule: Rule = {\n id: 'tailwind',\n tier: 'oss',\n name: 'Tailwind CSS v4 Conventions',\n description: 'Tailwind v4 syntax rules, v3→v4 migration gotchas, and shared config patterns',\n scope: 'project',\n preambleTier: 2,\n tags: ['css', 'tailwind', 'styling'],\n content: `# Tailwind CSS v4 Conventions\n\n## Version\n\nRevealUI uses **Tailwind CSS v4** (\\`^4.1.18\\`). All new code must use v4 patterns.\n\n## Current State\n\nThe shared config in \\`packages/dev/src/tailwind/\\` uses a **v3 compatibility pattern** (JS config file + JS plugins). This works because Tailwind v4 auto-detects \\`tailwind.config.ts\\` and falls back to v3 behavior. Migration to native v4 CSS config is deferred to Phase 2.\n\n## v4 Gotchas (Must Know)\n\n### Import Syntax\n\\`\\`\\`css\n/* CORRECT (v4) */\n@import \"tailwindcss\";\n\n/* WRONG (v3 — deprecated) */\n@tailwind base;\n@tailwind components;\n@tailwind utilities;\n\\`\\`\\`\n\n### Custom Utilities\n\\`\\`\\`css\n/* CORRECT (v4) */\n@utility my-util {\n /* styles */\n}\n\n/* WRONG (v3) */\n@layer utilities {\n .my-util { /* styles */ }\n}\n@layer components {\n .my-component { /* styles */ }\n}\n\\`\\`\\`\n\n### CSS Variable Syntax\n\\`\\`\\`html\n<!-- CORRECT (v4) — parentheses -->\n<div class=\"bg-(--brand-color)\">\n\n<!-- WRONG (v3) — square brackets -->\n<div class=\"bg-[--brand-color]\">\n\\`\\`\\`\n\n### Important Modifier\n\\`\\`\\`html\n<!-- CORRECT (v4) — at the end -->\n<div class=\"bg-red-500!\">\n\n<!-- WRONG (v3) — at the start -->\n<div class=\"bg-!red-500\">\n\\`\\`\\`\n\n### Default Behavior Changes\n- **Border/ring color**: now \\`currentColor\\` (was \\`gray-200\\` in v3)\n- **Ring width**: default is \\`1px\\` (was \\`3px\\` in v3)\n- **\\`hover:\\`**: only applies on devices that support hover (no-touch)\n- **Stacked variants**: apply left-to-right (reversed from v3)\n- **\\`space-*\\` / \\`divide-*\\`**: selectors changed — prefer \\`gap\\` with flex/grid\n\n### Transform Utilities\n\\`\\`\\`html\n<!-- CORRECT (v4) -->\n<div class=\"scale-none rotate-none translate-none\">\n\n<!-- WRONG (v3) -->\n<div class=\"transform-none\">\n\\`\\`\\`\n\n### Prefix Syntax\n\\`\\`\\`css\n/* v4 prefix */\n@import \"tailwindcss\" prefix(tw);\n/* Classes use tw:bg-red-500 */\n\\`\\`\\`\n\n### CSS Modules / Component Styles\nUse \\`@reference\\` to access theme variables in CSS modules or component \\`<style>\\` blocks.\n\n### PostCSS Plugin\n\\`\\`\\`js\n// v4 — new package name\n{ plugins: { '@tailwindcss/postcss': {} } }\n\n// v3 — old (still works but deprecated)\n{ plugins: { tailwindcss: {} } }\n\\`\\`\\`\n\n### Vite Plugin (preferred over PostCSS for Vite apps)\n\\`\\`\\`js\nimport tailwindcss from '@tailwindcss/vite'\nexport default { plugins: [tailwindcss()] }\n\\`\\`\\`\n\n## Theme Configuration (v4 native)\n\nIn v4, theme tokens go in CSS, not JS:\n\n\\`\\`\\`css\n@import \"tailwindcss\";\n\n@theme {\n --color-brand: #ea580c;\n --font-sans: \"Inter\", sans-serif;\n --breakpoint-xs: 475px;\n --breakpoint-3xl: 1920px;\n}\n\\`\\`\\`\n\n## RevealUI Shared Config\n\n| File | Purpose |\n|------|---------|\n| \\`packages/dev/src/tailwind/tailwind.config.ts\\` | Shared v3-compat config (fonts, plugins, screens) |\n| \\`packages/dev/src/tailwind/create-config.ts\\` | Helper to merge shared + app configs |\n| \\`packages/dev/src/tailwind/postcss.config.ts\\` | PostCSS config with \\`@tailwindcss/postcss\\` |\n| \\`packages/dev/src/tailwind/styles.css\\` | Base CSS (\\`@import \"tailwindcss\"\\`) |\n\n### Consumer Pattern (current — v3 compat)\n\\`\\`\\`ts\n// apps/cms/tailwind.config.ts\nimport { createTailwindConfig } from 'dev/tailwind/create-config'\nexport default createTailwindConfig({\n content: ['./src/**/*.{ts,tsx}'],\n // app-specific overrides\n})\n\\`\\`\\`\n\n## Rules for New Code\n\n1. **Never use \\`@tailwind\\` directives** — use \\`@import \"tailwindcss\"\\` instead\n2. **Never use \\`@layer utilities\\` or \\`@layer components\\`** for custom utilities — use \\`@utility\\`\n3. **Use \\`bg-(--var)\\` syntax** for CSS variables, not \\`bg-[--var]\\`\n4. **Important goes at the end**: \\`bg-red-500!\\` not \\`!bg-red-500\\`\n5. **Prefer \\`gap\\`** over \\`space-*\\` / \\`divide-*\\` for spacing in flex/grid\n6. **No \\`transform-none\\`** — use \\`scale-none\\`, \\`rotate-none\\`, \\`translate-none\\`\n7. **Don't add new v3 JS plugins** — if a v4 CSS equivalent exists, use that\n8. **Content paths are auto-detected** in v4 — only add manual paths for edge cases`,\n};\n","import type { Rule } from '../../schemas/rule.js';\n\nexport const unusedDeclarationsRule: Rule = {\n id: 'unused-declarations',\n tier: 'oss',\n name: 'Unused Declarations Policy',\n description:\n 'Never suppress unused warnings without determining if code is incomplete — implement first',\n scope: 'project',\n preambleTier: 3,\n tags: ['lint', 'quality', 'policy'],\n content: `# Unused Declarations Policy\n\n## Core Rule\n\n**NEVER suppress an unused variable/import warning without first determining if the code is incomplete.**\n\nUnused declarations in this codebase frequently signal incomplete implementations — stubs, scaffolded functions, planned integrations — not dead code. Suppressing the warning without completing the code leads to permanent placeholders that silently rot.\n\n---\n\n## Mandatory Decision Tree\n\nWhen you encounter an \\`no-unused-vars\\`, \\`noUnusedVariables\\`, or \\`noUnusedFunctionParameters\\` warning, you MUST follow this decision tree **before taking any action**:\n\n\\`\\`\\`\n1. Is the declaration a stub or placeholder?\n └─ Signs: empty function body, \\`// TODO\\`, \\`throw new Error('not implemented')\\`,\n adjacent commented-out code, file has <10 lines of real logic,\n variable name matches a feature that exists elsewhere in the codebase\n └─ Action: IMPLEMENT the missing functionality. Do not suppress.\n\n2. Is the declaration an intentionally-created side-effect resource?\n └─ Signs: infrastructure-as-code (Pulumi/CDK), event listener registration,\n DB migration runner, resource that must exist but isn't referenced\n └─ Action: Rename with \\`_\\` prefix to signal intentional non-use.\n Add a comment explaining WHY it exists.\n\n3. Is the import used only as a type (TypeScript)?\n └─ Signs: import is from a types package, used only in \\`type X = ...\\` expressions\n └─ Action: Change to \\`import type { ... }\\` — Biome will no longer flag it.\n\n4. Is the parameter required by a callback signature you don't control?\n └─ Signs: Express/Hono middleware \\`(req, res, next)\\`, event handler \\`(event, context)\\`,\n interface implementation where all params are mandated\n └─ Action: Prefix with \\`_\\` (e.g. \\`_req\\`, \\`_event\\`). Add a comment if non-obvious.\n\n5. Is it genuinely dead code with no planned use?\n └─ Signs: feature was removed, import was replaced, duplicate of another symbol\n └─ Action: DELETE the declaration entirely. Per the Legacy Code Removal Policy,\n no grace periods — remove it and all call sites in the same change.\n\\`\\`\\`\n\n---\n\n## What \"Implement\" Means\n\nWhen you determine a declaration is incomplete (case 1), the required steps are:\n\n1. **Search the codebase** for related implementations, types, interfaces, and tests that reveal intent.\n2. **Check the plan file** at \\`~/.claude/plans/\\` for any documented phase covering this feature.\n3. **Check for contracts** in \\`packages/contracts/src/\\` — the schema often describes the expected behavior.\n4. **Implement the function/class/module** based on what the surrounding code expects.\n5. **Run \\`pnpm gate:quick\\`** after implementing to verify no new errors were introduced.\n\nDo NOT:\n- Add \\`// biome-ignore lint/correctness/noUnusedVariables: TODO implement\\`\n- Rename to \\`_variable\\` just to silence the warning when the variable should be used\n- Delete a stub that represents planned functionality without implementing it first\n\n---\n\n## Examples\n\n### Wrong — suppressing an incomplete stub\n\\`\\`\\`ts\n// biome-ignore lint/correctness/noUnusedVariables: TODO\nconst semanticMemory = new SemanticMemory()\n\\`\\`\\`\n\n### Right — implement it\n\\`\\`\\`ts\nconst semanticMemory = new SemanticMemory()\nawait semanticMemory.store('key', content, embedding)\n\\`\\`\\`\n\n---\n\n### Wrong — deleting a planned integration\n\\`\\`\\`ts\n// Was: import { ProceduralMemory } from './procedural-memory.js'\n// Deleted because \"unused\"\n\\`\\`\\`\n\n### Right — implement the module it was waiting for\n\\`\\`\\`ts\n// packages/ai/src/memory/memory/procedural-memory.ts\nexport class ProceduralMemory { ... }\n// Then use it where the original import was\n\\`\\`\\`\n\n---\n\n### Wrong — renaming away the signal\n\\`\\`\\`ts\n// Original: const routeTableAssoc = new aws.ec2.RouteTableAssociation(...)\n// \"Fixed\": const _routeTableAssoc = new aws.ec2.RouteTableAssociation(...)\n// No comment explaining why\n\\`\\`\\`\n\n### Right — rename AND document\n\\`\\`\\`ts\n// Route table association must exist for subnet routing to function.\n// The variable is not referenced after creation; AWS manages the association.\nconst _routeTableAssoc = new aws.ec2.RouteTableAssociation(...)\n\\`\\`\\`\n\n---\n\n## Verification Step After Any Lint Fix\n\nAfter resolving any unused declaration warning, run:\n\n\\`\\`\\`bash\n# Confirm the fix compiles\npnpm --filter <package> typecheck\n\n# Confirm Biome is clean on the changed file\nnode_modules/.bin/biome check <file>\n\n# If the declaration was a stub that you implemented, run the tests\npnpm --filter <package> test\n\\`\\`\\`\n\nNever move to the next task without completing this verification.\n\n---\n\n## Relationship to Gate Verification Rule\n\nThis policy works in conjunction with the gate verification rule: complete the implementation → verify with lint/type/test → then move on. The gate catches regressions; this policy prevents incomplete code from silently accumulating.`,\n};\n","import type { Rule } from '../../schemas/rule.js';\nimport { agentDispatchRule } from './agent-dispatch.js';\nimport { biomeRule } from './biome.js';\nimport { codeAnalysisPolicyRule } from './code-analysis-policy.js';\nimport { databaseRule } from './database.js';\nimport { monorepoRule } from './monorepo.js';\nimport { parameterizationRule } from './parameterization.js';\nimport { skillsUsageRule } from './skills-usage.js';\nimport { tailwindRule } from './tailwind.js';\nimport { unusedDeclarationsRule } from './unused-declarations.js';\n\nexport const rules: Rule[] = [\n agentDispatchRule,\n biomeRule,\n codeAnalysisPolicyRule,\n databaseRule,\n monorepoRule,\n parameterizationRule,\n skillsUsageRule,\n tailwindRule,\n unusedDeclarationsRule,\n];\n","import type { Skill } from '../../schemas/skill.js';\n\nexport const dbMigrateSkill: Skill = {\n id: 'db-migrate',\n tier: 'pro',\n name: 'Database Migration',\n description:\n 'Create and apply Drizzle ORM migrations with dual-DB boundary checks (NeonDB vs Supabase)',\n disableModelInvocation: true,\n skipFrontmatter: false,\n filePatterns: [],\n bashPatterns: [],\n references: {},\n content: `# Database Migration Workflow\n\nGuide for creating and applying Drizzle ORM migrations in the RevealUI dual-database architecture.\n\n## Pre-Flight Checks\n\nBefore creating a migration:\n\n1. **Identify the target database**:\n - **NeonDB** (REST content): users, sessions, collections, products, orders, licenses, pages, sites, tickets, agents, api-keys, GDPR\n - **Supabase** (vectors/auth): embeddings, AI memory storage, real-time auth\n - If unsure, check \\`packages/db/src/schema/rest.ts\\` (NeonDB) vs \\`packages/db/src/schema/vector.ts\\` (Supabase)\n\n2. **Check existing schema** for conflicts:\n \\`\\`\\`bash\n # View current schema files\n ls packages/db/src/schema/\n\n # Check for table name conflicts\n grep -r \"export const.*pgTable\" packages/db/src/schema/\n \\`\\`\\`\n\n3. **Verify contracts alignment** — new tables/columns should have corresponding Zod schemas:\n \\`\\`\\`bash\n ls packages/contracts/src/\n \\`\\`\\`\n\n## Migration Steps\n\n### Step 1: Modify Schema\n\nEdit the appropriate schema file in \\`packages/db/src/schema/\\`:\n\n- Follow existing patterns (see adjacent schema files)\n- Use Drizzle's \\`pgTable\\`, column types, and relations\n- Add indexes for frequently queried columns\n- Add \\`createdAt\\`/\\`updatedAt\\` timestamps with defaults\n\n### Step 2: Generate Migration\n\n\\`\\`\\`bash\ncd packages/db\npnpm drizzle-kit generate\n\\`\\`\\`\n\nReview the generated SQL in \\`packages/db/drizzle/\\` — check for:\n- Destructive changes (DROP TABLE, DROP COLUMN)\n- Data loss risks (column type changes without USING clause)\n- Missing indexes on foreign keys\n\n### Step 3: Apply Migration (Development Only)\n\n\\`\\`\\`bash\n# Development database ONLY — never production\npnpm db:migrate\n\\`\\`\\`\n\n**NEVER run \\`drizzle-kit push\\`** — always use \\`drizzle-kit migrate\\` (the PreToolUse hook blocks \\`push\\`).\n\n### Step 4: Verify\n\n\\`\\`\\`bash\n# Typecheck the db package\npnpm --filter @revealui/db typecheck\n\n# Run db tests\npnpm --filter @revealui/db test\n\n# If schema changes affect contracts, update and test those too\npnpm --filter @revealui/contracts typecheck\npnpm --filter @revealui/contracts test\n\\`\\`\\`\n\n### Step 5: Update Contracts (if needed)\n\nIf you added new tables or columns that are exposed via the API:\n\n1. Add/update Zod schema in \\`packages/contracts/src/\\`\n2. Export from \\`packages/contracts/src/index.ts\\`\n3. Update any API routes that use the new schema\n\n## Dual-DB Boundary Rules\n\n| If your change touches... | Put it in... | Client |\n|---------------------------|-------------|--------|\n| Content, users, sessions, products, orders | \\`packages/db/src/schema/\\` (NeonDB barrel) | Drizzle ORM |\n| Vector embeddings, AI memory | \\`packages/db/src/schema/vector.ts\\` | Supabase client |\n| Real-time auth helpers | \\`packages/db/src/auth/\\` | Supabase client |\n\n**Never mix** NeonDB and Supabase operations in the same module.\n\n## Rollback\n\nIf a migration needs to be reverted:\n\n1. Create a new migration that undoes the changes (Drizzle doesn't have built-in rollback)\n2. Never manually edit the migration journal (\\`_journal.json\\`)\n3. Document the rollback reason in the migration file comment`,\n};\n","import type { Skill } from '../../schemas/skill.js';\n\nexport const preflightSkill: Skill = {\n id: 'preflight',\n tier: 'oss',\n name: 'Preflight Check',\n description:\n 'Run the 15-check pre-launch preflight and interpret results with context-aware fix suggestions',\n disableModelInvocation: true,\n skipFrontmatter: false,\n filePatterns: [],\n bashPatterns: [],\n references: {},\n content: `# Preflight Check\n\nRun the full pre-launch preflight checklist and interpret results.\n\n## Run\n\n\\`\\`\\`bash\npnpm preflight\n\\`\\`\\`\n\nThis runs 15 checks covering lint, types, tests, build, security, and structure.\n\n## Interpreting Results\n\n### Hard Failures (must fix before launch)\n\n| Check | What It Means | Common Fix |\n|-------|--------------|------------|\n| **Biome lint** | Code style or correctness violation | \\`pnpm lint:fix\\` then review remaining |\n| **TypeScript** | Type errors across workspaces | \\`pnpm typecheck:all\\` to see full list |\n| **Build** | Compilation failure in one or more packages | Check \\`dist/\\` output, tsup config |\n| **Tests** | Unit/integration test failures | \\`pnpm test\\` to see which tests fail |\n\n### Warn-Only (should fix, won't block)\n\n| Check | What It Means | Common Fix |\n|-------|--------------|------------|\n| **\\`any\\` audit** | Avoidable \\`any\\` types found | \\`pnpm audit:any\\` — use \\`unknown\\` + type guards |\n| **Console audit** | \\`console.*\\` in production code | \\`pnpm audit:console\\` — use \\`@revealui/utils\\` logger |\n| **Structure** | Supabase boundary violations or package issues | \\`pnpm validate:structure\\` |\n| **Security** | CSP, CORS, or header issues | Check \\`packages/security/\\` |\n| **Dependencies** | Version mismatches across workspaces | \\`pnpm deps:check\\` then \\`pnpm deps:fix\\` |\n\n## After Preflight\n\nIf all hard checks pass:\n\n1. Run \\`pnpm gate\\` for the full CI gate (superset of preflight)\n2. Check for uncommitted changes: \\`git status\\`\n3. Review the deployment checklist: \\`/deploy-check\\`\n\nIf checks fail, fix in priority order:\n1. Build failures (blocks everything)\n2. Type errors (blocks CI)\n3. Test failures (blocks confidence)\n4. Lint issues (blocks merge)\n5. Warn-only items (fix before release)`,\n};\n","import type { Skill } from '../../schemas/skill.js';\n\nexport const revealuiConventionsSkill: Skill = {\n id: 'revealui-conventions',\n tier: 'oss',\n name: 'RevealUI Conventions',\n description:\n 'RevealUI coding conventions for any code task — writing, editing, reviewing, creating,\\nfixing, refactoring, changing, adding, or updating TypeScript, React, CSS, or config files.\\nCovers TypeScript strict mode, ES Modules, Biome formatting, Tailwind v4 syntax,\\nconventional commits, monorepo workspace protocol, feature gating, parameterization,\\nand unused declaration policy.',\n disableModelInvocation: false,\n skipFrontmatter: false,\n filePatterns: [],\n bashPatterns: [],\n references: {},\n content: `# RevealUI Conventions\n\nFollow these conventions for ALL code in the RevealUI monorepo.\n\n## TypeScript\n\n- Always use strict mode (\\`strict: true\\` in tsconfig)\n- Use ES Modules (\\`import\\`/\\`export\\`), never CommonJS (\\`require\\`)\n- Prefer \\`interface\\` over \\`type\\` for object shapes (unless union/intersection needed)\n- Use explicit return types on exported functions\n- Avoid \\`any\\` — use \\`unknown\\` and narrow with type guards\n- Use \\`as const\\` for literal objects and arrays when appropriate\n- Prefer \\`satisfies\\` over \\`as\\` for type assertions when possible\n- Use optional chaining (\\`?.\\`) and nullish coalescing (\\`??\\`) over manual checks\n- Async/await over \\`.then()\\` chains\n\n## Git\n\n### Commit Messages\n- Use conventional commits: \\`type(scope): description\\`\n- Types: feat, fix, refactor, docs, test, chore, ci, perf\n- Scope is optional, use package name for monorepos (e.g., \\`feat(core): add parser\\`)\n- Description in imperative mood, lowercase, no period\n- Keep subject line under 72 characters\n\n### Branch Naming\n- Feature: \\`feat/<short-description>\\`\n- Bugfix: \\`fix/<short-description>\\`\n- Chore: \\`chore/<short-description>\\`\n\n### Identity\n- RevealUI Studio <founder@revealui.com>\n\n## Monorepo\n\n### Structure\n- Apps live in \\`apps/\\` — deployable services (Next.js, Hono, Vite)\n- Packages live in \\`packages/\\` — shared libraries consumed by apps\n- Scripts live in \\`scripts/\\` — CLI tools, automation, CI gates\n\n### Package Manager\n- pnpm 10 with workspace protocol\n- Internal deps use \\`workspace:*\\` (never hardcoded versions)\n- Run \\`pnpm install:clean\\` (suppresses Node deprecation warnings)\n- \\`preinstall\\` script enforces pnpm-only (\\`npx only-allow pnpm\\`)\n\n### Turborepo\n- \\`turbo run build --parallel\\` for parallel builds\n- \\`turbo run test --concurrency=15\\` for parallel tests\n- Package-level \\`turbo.json\\` for task overrides (rare)\n- Cache stored in \\`.turbo/\\` (gitignored)\n\n### Package Conventions\n- Every package has: \\`build\\`, \\`dev\\`, \\`lint\\`, \\`test\\`, \\`typecheck\\` scripts\n- Build output goes to \\`dist/\\` via tsup\n- Source in \\`src/\\`, tests in \\`src/__tests__/\\` or \\`__tests__/\\`\n- Entry point: \\`src/index.ts\\` → \\`dist/index.js\\`\n- Use \\`exports\\` field in package.json for subpath exports\n- Include \\`files: [\"dist\", \"README.md\"]\\` for publishing\n\n### Dependency Rules\n- Use \\`syncpack\\` for version alignment (\\`pnpm deps:check\\`, \\`pnpm deps:fix\\`)\n- Use \\`catalog:\\` for shared devDependencies (e.g., \\`\"zod\": \"catalog:\"\\`)\n- pnpm overrides in root package.json for security patches\n\n### CI Gate\n- \\`pnpm gate\\` runs the full CI pipeline locally: lint → typecheck → test → build\n- \\`pnpm gate:quick\\` runs phase 1 only (fast feedback)\n- Must pass before pushing (enforced by Husky pre-push hook)\n\n### Adding a New Package\n1. Create \\`packages/<name>/\\` with package.json, tsconfig.json, tsup.config.ts\n2. Name: \\`@revealui/<name>\\`\n3. Add \\`workspace:*\\` references from consuming packages\n4. Register in turbo pipeline (automatic via conventions)\n\n### Publishing\n- OSS packages: \\`publishConfig.access: \"public\"\\`, MIT license\n- Pro packages: \\`\"private\": true\\` (not published to npm)\n- Use changesets for versioning: \\`pnpm changeset\\` → \\`pnpm changeset:version\\` → \\`pnpm changeset:publish\\`\n\n### Import Conventions\n- Use package names (\\`@revealui/core\\`) not relative paths between packages\n- Use \\`~/\\` alias within apps (maps to \\`src/*\\`)\n- Use ES Modules (\\`import\\`/\\`export\\`) everywhere\n\n## Biome\n\nBiome 2 is the sole linter and formatter for this monorepo.\n\n### Commands\n- \\`pnpm lint\\` — check all files (\\`biome check .\\`)\n- \\`pnpm format\\` — format all files (\\`biome format --write .\\`)\n- \\`pnpm lint:fix\\` — auto-fix (\\`biome check --write .\\`)\n\n### Key Rules\n- No unused variables or imports (auto-removed on format)\n- No \\`console.*\\` in production code (use \\`@revealui/utils\\` logger)\n- No \\`any\\` types (use \\`unknown\\` + type guards)\n- Consistent import ordering (auto-sorted)\n- Single quotes for strings\n- Trailing commas\n- Semicolons always\n- 2-space indentation\n\n### Suppressing Rules\n- Use \\`// biome-ignore <rule>: <reason>\\` for specific lines\n- Avoid blanket suppressions — prefer fixing the code\n- Document why a suppression is needed\n\n## Tailwind v4\n\nRevealUI uses **Tailwind CSS v4** (\\`^4.1.18\\`). Key syntax changes from v3:\n\n### Must-Know Gotchas\n\n\\`\\`\\`css\n/* CORRECT (v4) */\n@import \"tailwindcss\";\n\n/* WRONG (v3) */\n@tailwind base;\n@tailwind components;\n@tailwind utilities;\n\\`\\`\\`\n\n\\`\\`\\`css\n/* CORRECT (v4) */\n@utility my-util { /* styles */ }\n\n/* WRONG (v3) */\n@layer utilities { .my-util { /* styles */ } }\n\\`\\`\\`\n\n\\`\\`\\`html\n<!-- CORRECT (v4) — parentheses for CSS vars -->\n<div class=\"bg-(--brand-color)\">\n\n<!-- WRONG (v3) — square brackets -->\n<div class=\"bg-[--brand-color]\">\n\\`\\`\\`\n\n\\`\\`\\`html\n<!-- CORRECT (v4) — important at the end -->\n<div class=\"bg-red-500!\">\n\n<!-- WRONG (v3) — important at the start -->\n<div class=\"bg-!red-500\">\n\\`\\`\\`\n\n### Rules for New Code\n1. Never use \\`@tailwind\\` directives — use \\`@import \"tailwindcss\"\\`\n2. Never use \\`@layer utilities\\` or \\`@layer components\\` — use \\`@utility\\`\n3. Use \\`bg-(--var)\\` syntax for CSS variables, not \\`bg-[--var]\\`\n4. Important goes at the end: \\`bg-red-500!\\` not \\`!bg-red-500\\`\n5. Prefer \\`gap\\` over \\`space-*\\` / \\`divide-*\\` for spacing in flex/grid\n6. No \\`transform-none\\` — use \\`scale-none\\`, \\`rotate-none\\`, \\`translate-none\\`\n\n## Parameterization\n\n**Never hardcode configuration values inline.** All tunable constants (TTLs, limits, lengths, thresholds, intervals) must be:\n\n1. **Extracted** into a named config object or constant at module scope\n2. **Typed** with an explicit interface\n3. **Defaulted** with sensible production values\n4. **Overridable** via an exported \\`configure*()\\` function or constructor parameter\n\n### Pattern\n\n\\`\\`\\`ts\nexport interface ModuleConfig {\n /** TTL in milliseconds (default: 5 minutes) */\n ttlMs: number\n /** Max entries before forced cleanup (default: 10_000) */\n maxEntries: number\n}\n\nconst DEFAULT_CONFIG: ModuleConfig = {\n ttlMs: 5 * 60 * 1000,\n maxEntries: 10_000,\n}\n\nlet config: ModuleConfig = { ...DEFAULT_CONFIG }\n\nexport function configureModule(overrides: Partial<ModuleConfig>): void {\n config = { ...DEFAULT_CONFIG, ...overrides }\n}\n\\`\\`\\`\n\n### Applies To\n- Rate limit windows and thresholds\n- Cache TTLs and max sizes\n- OTP/token lengths and expiry times\n- Retry counts and backoff intervals\n- Batch sizes and concurrency limits\n\n### Does NOT Apply To\n- Structural constants (HTTP status codes, header names, URL paths)\n- Type discriminants and enum values\n- Schema definitions (use contracts)\n\n## Unused Declarations\n\n**NEVER suppress an unused variable/import warning without first determining if the code is incomplete.**\n\n### Mandatory Decision Tree\n\n\\`\\`\\`\n1. Stub or placeholder?\n → IMPLEMENT the missing functionality. Do not suppress.\n\n2. Intentional side-effect resource?\n → Rename with \\`_\\` prefix. Add a comment explaining WHY.\n\n3. Type-only import?\n → Change to \\`import type { ... }\\`.\n\n4. Required callback parameter?\n → Prefix with \\`_\\` (e.g. \\`_req\\`). Comment if non-obvious.\n\n5. Genuinely dead code?\n → DELETE entirely. No grace periods.\n\\`\\`\\`\n\n### Verification After Any Lint Fix\n\n\\`\\`\\`bash\npnpm --filter <package> typecheck\nnode_modules/.bin/biome check <file>\npnpm --filter <package> test # if you implemented a stub\n\\`\\`\\`\n\n## Feature Gating\n\n### Tier Model\n\n| Tier | Code String | Distribution |\n|------|-------------|-------------|\n| Free | \\`'free'\\` | MIT, open source |\n| Pro | \\`'pro'\\` | Source-available, commercially licensed |\n| Max | \\`'max'\\` | Extended Pro features |\n| Enterprise (Forge) | \\`'enterprise'\\` | White-label, multi-tenant, self-hosted |\n\n### Runtime Checks\n\n\\`\\`\\`ts\nimport { isLicensed, isFeatureEnabled } from '@revealui/core'\n\nif (isLicensed('pro')) { /* Pro+ feature */ }\nif (isFeatureEnabled('ai')) { /* AI feature (requires Pro) */ }\n\\`\\`\\`\n\n### Package Boundaries\n- **OSS**: \\`@revealui/core\\`, \\`contracts\\`, \\`db\\`, \\`auth\\`, \\`presentation\\`, \\`router\\`, \\`config\\`, \\`utils\\`, \\`cli\\`, \\`setup\\`, \\`sync\\`, \\`dev\\`, \\`test\\`\n- **Pro**: \\`@revealui/ai\\`, \\`mcp\\`, \\`editors\\`, \\`services\\`, \\`harnesses\\`\n\n### Rules\n1. OSS packages must never import from Pro packages\n2. Pro packages may import from OSS packages\n3. Public tests must not hard-require Pro package source paths\n4. Feature gates use \\`isLicensed()\\` / \\`isFeatureEnabled()\\`, not environment variables`,\n};\n","import type { Skill } from '../../schemas/skill.js';\n\nexport const revealuiDbSkill: Skill = {\n id: 'revealui-db',\n tier: 'pro',\n name: 'RevealUI Database',\n description:\n 'RevealUI database conventions for any task involving database, schema, query, migration,\\nDrizzle ORM, Supabase, NeonDB, PostgreSQL, vectors, embeddings, or data modeling.\\nEnforces dual-database architecture boundaries and import restrictions.',\n disableModelInvocation: false,\n skipFrontmatter: false,\n filePatterns: [],\n bashPatterns: [],\n references: {},\n content: `# Database Conventions\n\n## Dual-Database Architecture\n\nRevealUI uses **two databases with strictly separated responsibilities**:\n\n| Database | Client | Purpose |\n|----------|--------|---------|\n| **NeonDB** (PostgreSQL) | \\`@neondatabase/serverless\\` | REST content: collections, users, sessions, orders, products |\n| **Supabase** | \\`@supabase/supabase-js\\` | Vector embeddings, real-time auth, AI memory storage |\n\n## Boundary Rule\n\n**\\`@supabase/supabase-js\\` must only be imported inside designated vector/auth modules:**\n\n### Allowed paths for Supabase imports\n- \\`packages/db/src/vector/\\` — vector schema and queries\n- \\`packages/db/src/auth/\\` — Supabase auth helpers\n- \\`packages/auth/src/\\` — authentication implementation\n- \\`packages/ai/src/\\` — AI memory and embedding storage\n- \\`packages/services/src/supabase/\\` — Supabase service integrations\n- \\`apps/*/src/lib/supabase/\\` — app-level Supabase utilities\n\n### Forbidden: Supabase imports in\n- \\`packages/core/\\` — CMS engine must be DB-agnostic\n- \\`packages/contracts/\\` — contracts are schema-only\n- \\`packages/config/\\` — config must not hardcode DB client\n- \\`apps/cms/src/collections/\\` — collection hooks use Drizzle/Neon only\n- \\`apps/cms/src/routes/\\` — REST routes use Neon only\n\n## Schema Organization\n\n\\`\\`\\`\npackages/db/src/schema/\n├── collections/ # NeonDB: content collections\n├── users/ # NeonDB: user management\n├── commerce/ # NeonDB: products, orders, pricing\n├── sessions/ # NeonDB: auth sessions\n├── vector/ # Supabase: embeddings, similarity search\n└── auth/ # Supabase: auth state\n\\`\\`\\`\n\n## Query Patterns\n\n### NeonDB (Drizzle ORM)\n\\`\\`\\`ts\nimport { db } from '@revealui/db'\nimport { posts } from '@revealui/db/schema'\n\nconst results = await db.select().from(posts).where(eq(posts.status, 'published'))\n\\`\\`\\`\n\n### Supabase (vector/auth only)\n\\`\\`\\`ts\n// Only in designated modules (packages/db/src/vector/, packages/ai/src/)\nimport { createSupabaseClient } from '@revealui/db/vector'\n\nconst { data } = await supabase.rpc('match_documents', { query_embedding: embedding })\n\\`\\`\\`\n\n## Enforcement\n\nThe \\`pnpm validate:structure\\` script checks for Supabase imports outside permitted paths.\nCI runs this as part of phase 1 (warn-only — violations are flagged but don't block builds).\n\nTo check locally:\n\\`\\`\\`bash\npnpm validate:structure\n\\`\\`\\`\n\n## Migration Guidance\n\nWhen adding new features:\n1. **Content/REST data** → add to \\`packages/db/src/schema/\\` + use Drizzle\n2. **AI/vector data** → add to \\`packages/db/src/vector/\\` + use Supabase client\n3. **Never mix** both DB clients in the same module`,\n};\n","import type { Skill } from '../../schemas/skill.js';\n\nexport const revealuiDebuggingSkill: Skill = {\n id: 'revealui-debugging',\n tier: 'pro',\n name: 'RevealUI Debugging',\n description:\n 'Systematic debugging workflow for RevealUI. Use when encountering any bug, test failure,\\nunexpected behavior, error, or broken functionality. Prevents shotgun debugging.',\n disableModelInvocation: false,\n skipFrontmatter: false,\n filePatterns: [],\n bashPatterns: [],\n references: {},\n content: `# RevealUI Debugging Workflow\n\nWhen something breaks, follow this process. Do not skip steps.\n\n## The Process\n\n### 1. Reproduce\n\n- Get the exact error message, stack trace, or unexpected output\n- Find the minimal reproduction case\n- Confirm it reproduces consistently (not flaky)\n- If it only fails under \\`turbo run test\\`, see \\`$revealui-testing\\` for concurrency triage\n\n### 2. Hypothesize\n\n- Form ONE specific hypothesis about the root cause\n- Write it down before changing any code\n- Base it on evidence (error message, stack trace, git blame), not intuition\n\n### 3. Validate\n\n- Design a test or check that confirms/refutes your hypothesis\n- Run it\n- If refuted, form a new hypothesis — do not stack unrelated fixes\n\n### 4. Fix Narrowly\n\n- Change the minimum code to fix the root cause\n- Do not refactor surrounding code\n- Do not fix adjacent issues you noticed along the way (file them separately)\n\n### 5. Verify\n\n- Run the original failing test/scenario\n- Run \\`pnpm --filter <package> test\\` to check for regressions\n- Run \\`npx biome check --write <file>\\` on changed files\n\n### 6. Commit\n\n- One commit for the fix\n- Format: \\`fix(scope): description of what was broken\\`\n\n## Anti-Patterns\n\n- Changing multiple things at once (\"shotgun debugging\")\n- Fixing symptoms instead of root causes\n- Adding try/catch blocks to silence errors\n- Increasing timeouts to hide race conditions\n- Reverting to \"known good\" without understanding what broke\n- Asking \"does this fix it?\" without a hypothesis\n\n## Common RevealUI Debugging Paths\n\n| Symptom | First Check |\n|---------|------------|\n| Import error | Package built? \\`pnpm --filter <pkg> build\\` |\n| Type error across packages | \\`pnpm typecheck:all\\` — check \\`workspace:*\\` versions |\n| Test passes alone, fails in gate | Concurrency pressure — see \\`$revealui-testing\\` |\n| Supabase error in unexpected path | Import boundary violation — see \\`$revealui-db\\` |\n| Biome error after edit | Run \\`npx biome check --write <file>\\` |`,\n};\n","import type { Skill } from '../../schemas/skill.js';\n\nexport const revealuiReviewSkill: Skill = {\n id: 'revealui-review',\n tier: 'pro',\n name: 'RevealUI Code Review',\n description:\n 'Code review checklist for RevealUI. Use when reviewing code, completing a feature,\\nchecking quality, or before committing. Invoke explicitly with $revealui-review.',\n disableModelInvocation: true,\n skipFrontmatter: false,\n filePatterns: [],\n bashPatterns: [],\n references: {},\n content: `# RevealUI Code Review\n\nRun this checklist before committing or claiming work is complete.\n\n## Automated Checks\n\nRun each command and confirm clean output:\n\n\\`\\`\\`bash\n# 1. Biome lint + format\npnpm lint\n\n# 2. TypeScript — all packages\npnpm typecheck:all\n\n# 3. Tests — affected packages\npnpm --filter <package> test\n\n# 4. Quick gate (lint + typecheck + structure)\npnpm gate:quick\n\\`\\`\\`\n\n## Manual Checks\n\n### Type Safety\n- [ ] No \\`any\\` types (use \\`unknown\\` + type guards)\n- [ ] No \\`as\\` casts where \\`satisfies\\` works\n- [ ] Exported functions have explicit return types\n- [ ] \\`import type\\` used for type-only imports\n\n### Code Quality\n- [ ] No \\`console.*\\` in production code (use \\`@revealui/utils\\` logger)\n- [ ] No hardcoded config values (use parameterization pattern)\n- [ ] No unused variables/imports (follow decision tree if flagged)\n- [ ] Single responsibility — each file does one thing\n\n### Architecture\n- [ ] No Supabase imports outside permitted paths\n- [ ] No cross-package relative imports (use \\`@revealui/<name>\\`)\n- [ ] Internal deps use \\`workspace:*\\`\n- [ ] OSS packages don't import from Pro packages\n\n### Tailwind v4\n- [ ] \\`bg-(--var)\\` not \\`bg-[--var]\\` for CSS variables\n- [ ] \\`bg-red-500!\\` not \\`!bg-red-500\\` for important\n- [ ] \\`@import \"tailwindcss\"\\` not \\`@tailwind\\`\n- [ ] \\`@utility\\` not \\`@layer utilities\\`\n- [ ] \\`gap\\` preferred over \\`space-*\\`\n\n### Git\n- [ ] Conventional commit: \\`type(scope): description\\`\n- [ ] Subject under 72 characters, imperative mood\n- [ ] Identity: RevealUI Studio <founder@revealui.com>\n- [ ] No secrets in committed files`,\n};\n","import type { Skill } from '../../schemas/skill.js';\n\nexport const revealuiSafetySkill: Skill = {\n id: 'revealui-safety',\n tier: 'oss',\n name: 'RevealUI Safety',\n description:\n 'RevealUI safety guardrails for any code task — editing, writing, creating, fixing,\\nrefactoring, changing, adding, updating, or removing files. Protects credentials,\\nenforces import boundaries, ensures code quality, and verifies work before completion.',\n disableModelInvocation: false,\n skipFrontmatter: false,\n filePatterns: [],\n bashPatterns: [],\n references: {},\n content: `# RevealUI Safety\n\nFollow these rules for ALL code changes in the RevealUI monorepo.\n\n## Protected Files — Ask Before Editing\n\n- \\`.env*\\` files (\\`.env\\`, \\`.env.local\\`, \\`.env.production\\`, etc.)\n- Lock files: \\`pnpm-lock.yaml\\`, \\`package-lock.json\\`, \\`yarn.lock\\`\n- Database schema files in \\`packages/db/src/schema/\\` — changes require migration planning\n\n## Protected Paths — Never Edit\n\n- \\`/mnt/c/\\`, \\`/mnt/e/\\` — Windows mounts (read-only)\n- System/credential directories: \\`/etc/\\`, \\`~/.ssh/\\`, \\`~/.gnupg/\\`, \\`~/.aws/\\`\n\n## Import Boundaries\n\n\\`@supabase/supabase-js\\` is ONLY allowed in:\n\n- \\`packages/db/src/vector/\\`, \\`packages/db/src/auth/\\`\n- \\`packages/auth/src/\\`, \\`packages/ai/src/\\`\n- \\`packages/services/src/supabase/\\`\n- \\`apps/*/src/lib/supabase/\\`\n\nFORBIDDEN in: \\`packages/core/\\`, \\`packages/contracts/\\`, \\`packages/config/\\`, \\`apps/cms/src/collections/\\`, \\`apps/cms/src/routes/\\`\n\n## Code Quality\n\n- Never use \\`any\\` — use \\`unknown\\` + type guards\n- Never add \\`console.*\\` in production code — use \\`@revealui/utils\\` logger\n- Never hardcode API keys, tokens, passwords, or secrets\n- Use \\`crypto.randomInt()\\` for security-sensitive values, not \\`Math.random()\\`\n\n## Static Analysis\n\n- For security and architecture validation scripts, prefer AST-based analysis over regex when the rule depends on syntax or code shape\n- Use regex only for heuristic inventory scans (for example obvious secret patterns), not as the source of truth for code-security conclusions\n\n## After Every Edit\n\nRun \\`npx biome check --write <file>\\` on each file you edit before moving on.\n\n## Before Claiming Done\n\n1. Run \\`pnpm gate:quick\\` and confirm no new errors\n2. Review \\`git diff\\` for unintended changes\n3. Ensure conventional commit format: \\`type(scope): description\\`\n4. Git identity: RevealUI Studio <founder@revealui.com>\n\n## Known Limitation\n\nThese rules are advisory. Unlike Claude Code (which enforces via lifecycle hooks), Codex has no hook system. If working on sensitive files, explicitly invoke \\`$revealui-safety\\` to load these rules.`,\n};\n","import type { Skill } from '../../schemas/skill.js';\n\nexport const revealuiTddSkill: Skill = {\n id: 'revealui-tdd',\n tier: 'pro',\n name: 'RevealUI TDD',\n description:\n 'Test-driven development workflow for RevealUI. Use when implementing any feature,\\nfixing bugs, adding functionality, or writing new code. Enforces write-test-first,\\nred-green-refactor cycle. Works with Vitest and React Testing Library.',\n disableModelInvocation: false,\n skipFrontmatter: false,\n filePatterns: [],\n bashPatterns: [],\n references: {},\n content: `# RevealUI TDD Workflow\n\nFollow this cycle for every code change. No exceptions.\n\n## The Cycle\n\n1. **Write a failing test** — describe the expected behavior\n2. **Run it** — confirm it fails for the right reason\n3. **Write minimal implementation** — just enough to pass\n4. **Run it** — confirm it passes\n5. **Refactor** — clean up, then run tests again\n6. **Commit** — one commit per cycle\n\n## Commands\n\n\\`\\`\\`bash\n# Run tests for a specific package\npnpm --filter @revealui/<package> test\n\n# Run a specific test file\npnpm --filter @revealui/<package> test -- <file>\n\n# Run with coverage\npnpm --filter @revealui/<package> test -- --coverage\n\\`\\`\\`\n\n## Test File Conventions\n\n- Unit/integration: \\`*.test.ts\\` in \\`src/__tests__/\\` or adjacent to source\n- E2E: \\`*.e2e.ts\\` in \\`packages/test/\\`\n- Use \\`@revealui/test\\` for shared fixtures, mocks, and utilities\n\n## What to Test\n\n- Public API surface of each module\n- Error paths and edge cases\n- Integration points between packages\n\n## What NOT to Test\n\n- Private implementation details\n- Third-party library internals\n- Type-only code (interfaces, type aliases)\n\n## Repo-Specific Patterns\n\nFor concurrency tuning, flaky test triage, and Pro/OSS test boundaries, see the \\`$revealui-testing\\` skill.\n\n## Anti-Patterns\n\n- Writing implementation before the test\n- Writing tests that pass immediately (test must fail first)\n- Testing implementation details instead of behavior\n- Skipping the refactor step\n- Large commits with multiple features`,\n};\n","import type { Skill } from '../../schemas/skill.js';\n\nexport const revealuiTestingSkill: Skill = {\n id: 'revealui-testing',\n tier: 'oss',\n name: 'RevealUI Testing',\n description:\n 'RevealUI monorepo testing rules and failure-triage guidance. Use when changing tests,\\nfixing flaky suites, adjusting Vitest config, debugging Turbo test failures, handling\\nReact Testing Library warnings, or deciding between scoped timeouts, worker limits,\\nand test refactors in this repo.',\n disableModelInvocation: false,\n skipFrontmatter: false,\n filePatterns: [],\n bashPatterns: [],\n references: {},\n content: `# RevealUI Testing\n\nUse this skill after the generic \\`vitest\\` and \\`react-testing-library\\` skills when the work is specific to this monorepo.\n\n## Use This For\n\n- \\`pnpm test\\` or \\`pnpm gate --phase=3 --no-build\\` failures\n- Turbo fan-out flakiness that does not reproduce in isolated package runs\n- Vitest worker/concurrency tuning in \\`packages/*\\` or \\`apps/*\\`\n- React Testing Library \\`act(...)\\` warnings in this repo\n- optional Pro package boundaries in tests\n- deciding whether a failure is a real regression, test debt, or runner pressure\n\n## Repo Rules\n\n### 1. Prefer Narrow Fixes\n\nDefault order:\n\n1. fix the test or component contract if behavior is actually wrong\n2. fix stale selectors, bad async assertions, or missing \\`await\\`\n3. add a scoped timeout to the single slow test or suite\n4. cap workers for the package if the failure only happens under Turbo fan-out\n5. only then consider broader runner changes\n\nDo not raise global Vitest timeouts just to get green runs.\n\n### 2. Treat \\u201cPasses Alone, Fails Under Turbo\\u201d as Concurrency Pressure First\n\nIf a package passes in isolation but flakes during \\`turbo run test\\`, assume resource pressure before assuming product logic broke.\n\nPreferred fix order:\n\n- specific test timeout for known cold imports or expensive setup\n- package-level \\`fileParallelism: false\\` and \\`maxWorkers: 1\\` for packages with heavy imports, database mocks, or expensive startup\n- lower Turbo concurrency in the gate if the machine is getting killed or saturated\n\nThis repo already needed that pattern in packages like \\`packages/test\\` and \\`packages/db\\`.\n\n### 3. Package-Level Vitest Caps Are Acceptable Here\n\nIf a package repeatedly flakes only under monorepo fan-out, it is acceptable to cap that package\\u2019s internal Vitest concurrency.\n\nTypical pattern:\n\n\\`\\`\\`ts\ntest: {\n fileParallelism: false,\n maxWorkers: 1,\n}\n\\`\\`\\`\n\nUse this for:\n\n- import-smoke suites\n- packages with heavy module initialization\n- DB/client/process orchestration tests\n\nDo not apply it repo-wide by default.\n\n### 4. Fix \\`act(...)\\` Warnings, Don\\u2019t Ignore Them\n\nCommon fixes in this repo:\n\n- use \\`await user.click(...)\\` instead of \\`fireEvent.click(...)\\` when the interaction is user-level\n- use \\`findBy*\\` or \\`waitFor\\` when the click triggers async state\n- assert on the post-update UI state, not just the callback\n- wrap hook state updates in \\`act(...)\\` only when there is no better user-facing path\n\nIf a warning remains, explain why the pattern is intentional before adding an ignore.\n\n### 5. Prefer \\`userEvent\\`, Use \\`fireEvent\\` Sparingly\n\nDefault to \\`@testing-library/user-event\\` for:\n\n- clicks\n- typing\n- keyboard navigation\n- focus/blur behavior\n\nKeep \\`fireEvent\\` for narrow low-level cases like synthetic events or very small DOM-only transitions.\n\n### 6. Optional Pro Packages Must Stay Optional in Public Tests\n\nPublic repo tests must not hard-require private sibling source trees or Pro package source paths.\n\nAllowed patterns:\n\n- dynamic import with graceful skip/fallback\n- separate Pro-only test config/suite\n- package docs that clearly mark Pro-only flows\n\nDisallowed patterns:\n\n- static imports to missing Pro source\n- default OSS test runs that silently depend on adjacent private repos\n\n### 7. Keep OSS and Pro Test Surfaces Honest\n\nIf a test is Pro-only:\n\n- move it into a Pro-specific directory or config\n- exclude it from default OSS test runs\n- do not leave it mixed into the default suite with hidden assumptions\n\n### 8. Distinguish Noise from Failure\n\nNot all stderr is actionable failure in this repo.\n\nUsually acceptable:\n\n- intentional error-path logs in tests exercising failure branches\n- expected jsdom limitations\n- known parser warnings from fixture-driven negative tests\n\nActionable:\n\n- \\`act(...)\\` warnings\n- \\`MaxListenersExceededWarning\\`\n- timeouts that only vanish with broad global increases\n- tests that only pass because of local private package availability\n\n## Working Pattern\n\nWhen triaging a red test lane:\n\n1. rerun the failing package or file directly\n2. decide whether it is reproducible in isolation\n3. if yes, fix the test/component/implementation\n4. if no, treat it as concurrency pressure and tune narrowly\n5. rerun the package\n6. rerun the gate phase that exposed it\n\nDo not keep stacking unrelated fixes without re-verifying the exact failing lane.\n\n## Gate-Specific Guidance\n\n- \\`pnpm gate --phase=3 --no-build\\` is the fastest useful repro for test/build instability\n- if a gate hang appears, inspect shared process helpers before changing many tests\n- Turbo warnings about missing outputs are configuration debt, not test correctness\n- a warning-level test check in the gate still deserves cleanup if it hides real regressions\n\n## What Not To Do\n\n- don\\u2019t inflate all test timeouts\n- don\\u2019t disable assertions just to remove flakes\n- don\\u2019t mix Pro-only tests back into OSS-default suites\n- don\\u2019t silence \\`act(...)\\` or listener warnings when the underlying fix is small\n- don\\u2019t assume a package is stable because it passed alone once`,\n};\n","import type { Skill } from '../../schemas/skill.js';\n\nexport const tailwind4DocsSkill: Skill = {\n id: 'tailwind-4-docs',\n tier: 'oss',\n name: 'Tailwind CSS v4 Documentation',\n description:\n 'Agent-optimized access to Tailwind CSS v4 documentation for answering questions, selecting utilities/variants, configuring Tailwind v4, and avoiding v3→v4 migration pitfalls.',\n disableModelInvocation: false,\n skipFrontmatter: true,\n filePatterns: [],\n bashPatterns: [],\n references: {\n gotchas: `# Tailwind CSS v4 Gotchas (Quick Scan)\n\n- Browser support is modern-only: Safari 16.4+, Chrome 111+, Firefox 128+.\n- PostCSS plugin moved to \\`@tailwindcss/postcss\\`.\n- CLI moved to \\`@tailwindcss/cli\\`.\n- Vite plugin \\`@tailwindcss/vite\\` is recommended.\n- Import Tailwind with \\`@import \"tailwindcss\";\\` (no \\`@tailwind\\` directives).\n- Prefix syntax is \\`@import \"tailwindcss\" prefix(tw);\\` and classes use \\`tw:\\` at the start.\n- Important modifier goes at the end: \\`bg-red-500!\\`.\n- Utility renames and removals: see \\`references/docs/upgrade-guide.mdx\\` for the full list.\n- Default border and ring color now use \\`currentColor\\`; ring width default is 1px.\n- \\`space-*\\` and \\`divide-*\\` selectors changed; use flex/grid with \\`gap\\` if layouts break.\n- Custom utilities should use \\`@utility\\` instead of \\`@layer utilities\\` or \\`@layer components\\`.\n- Stacked variants apply left-to-right (reverse order from v3).\n- Arbitrary CSS variable syntax is \\`bg-(--brand-color)\\` (not \\`bg-[--brand-color]\\`).\n- Transform reset uses \\`scale-none\\`, \\`rotate-none\\`, \\`translate-none\\` (not \\`transform-none\\`).\n- \\`hover:\\` now only applies on devices that support hover; override if needed.\n- CSS modules and component \\`<style>\\` blocks need \\`@reference\\` to access theme vars.`,\n },\n content: `# Tailwind CSS v4 Documentation Skill\n\n## Purpose\n\nAgent-optimized access to Tailwind CSS v4 documentation for answering questions, selecting utilities/variants, configuring Tailwind v4, and avoiding v3→v4 migration pitfalls.\n\n## Quick Start\n\n1. Check if docs snapshot exists: \\`references/docs/\\` should contain ~194 MDX files\n2. If missing or stale, initialize: \\`python3 scripts/sync_tailwind_docs.py --accept-docs-license\\`\n3. Identify the topic category from \\`references/docs-index.tsx\\`\n4. Load the relevant MDX file from \\`references/docs/\\`\n5. Always cross-check against \\`references/gotchas.md\\` for breaking changes\n\n## References\n\n| Path | Description |\n|------|-------------|\n| \\`references/docs/\\` | Generated MDX docs snapshot (gitignored) |\n| \\`references/docs-index.tsx\\` | Category and slug mapping (gitignored) |\n| \\`references/docs-source.txt\\` | Upstream repo, commit, and date (gitignored) |\n| \\`references/gotchas.md\\` | v4 migration pitfalls and breaking changes (committed) |\n\n## MDX Handling\n\n- Treat \\`export const\\` statements as metadata\n- Treat JSX callouts (\\`<TipInfo>\\`, \\`<TipBad>\\`, \\`<TipGood>\\`) as guidance\n- Code blocks contain working examples\n\n## Common Entry Points\n\n| Topic | File |\n|-------|------|\n| Migration from v3 | \\`upgrade-guide.mdx\\` |\n| Configuration | \\`adding-custom-styles.mdx\\` |\n| Theme | \\`theme.mdx\\` |\n| Dark mode | \\`dark-mode.mdx\\` |\n| Responsive | \\`responsive-design.mdx\\` |\n| Hover/focus/state | \\`hover-focus-and-other-states.mdx\\` |\n\n## Sync Command\n\n\\`\\`\\`bash\npython3 .claude/skills/tailwind-4-docs/scripts/sync_tailwind_docs.py --accept-docs-license\n\\`\\`\\`\n\nBased on [Lombiq/Tailwind-Agent-Skills](https://github.com/Lombiq/Tailwind-Agent-Skills) (BSD-3-Clause).`,\n};\n","import type { Skill } from '../../schemas/skill.js';\nimport { dbMigrateSkill } from './db-migrate.js';\nimport { preflightSkill } from './preflight.js';\nimport { revealuiConventionsSkill } from './revealui-conventions.js';\nimport { revealuiDbSkill } from './revealui-db.js';\nimport { revealuiDebuggingSkill } from './revealui-debugging.js';\nimport { revealuiReviewSkill } from './revealui-review.js';\nimport { revealuiSafetySkill } from './revealui-safety.js';\nimport { revealuiTddSkill } from './revealui-tdd.js';\nimport { revealuiTestingSkill } from './revealui-testing.js';\nimport { tailwind4DocsSkill } from './tailwind-4-docs.js';\n\nexport const skills: Skill[] = [\n dbMigrateSkill,\n preflightSkill,\n revealuiConventionsSkill,\n revealuiDbSkill,\n revealuiDebuggingSkill,\n revealuiReviewSkill,\n revealuiSafetySkill,\n revealuiTddSkill,\n revealuiTestingSkill,\n tailwind4DocsSkill,\n];\n","import type { Manifest } from '../schemas/manifest.js';\nimport { agents } from './agents/index.js';\nimport { commands } from './commands/index.js';\nimport { preambles } from './preambles/index.js';\nimport { rules } from './rules/index.js';\nimport { skills } from './skills/index.js';\n\n/** Build a complete manifest from all canonical definitions. */\nexport function buildManifest(): Manifest {\n return {\n version: 1,\n generatedAt: new Date().toISOString(),\n rules,\n commands,\n agents,\n skills,\n preambles,\n };\n}\n\nexport { agents, commands, preambles, rules, skills };\n","import type { ResolverFn } from './types.js';\n\nexport const NODE_VERSION: ResolverFn = (ctx) => ctx.nodeVersion ?? '24';\n\nexport const PACKAGE_MANAGER: ResolverFn = (ctx) => ctx.packageManager ?? 'pnpm 10';\n\nexport const STACK: ResolverFn = () =>\n 'React 19, Next.js 16, Node 24, TypeScript 5.9, Drizzle ORM, Hono, Tailwind v4';\n","import type { ResolverFn } from './types.js';\n\nexport const PROJECT_NAME: ResolverFn = (ctx) => ctx.projectName ?? 'RevealUI';\n\nexport const PHASE: ResolverFn = (ctx) => ctx.phase ?? 'Phase 3 — Launch Preparation';\n\nexport const BRANCH_PIPELINE: ResolverFn = () => 'feature/* → develop → test → main (production)';\n\nexport const LICENSE_TIERS: ResolverFn = () => 'free | pro | max | enterprise';\n","import * as environment from './environment.js';\nimport * as project from './project.js';\nimport type { ResolverContext, ResolverFn } from './types.js';\n\nexport type { ResolverContext, ResolverFn } from './types.js';\n\nconst registry = new Map<string, ResolverFn>([\n ['PROJECT_NAME', project.PROJECT_NAME],\n ['PHASE', project.PHASE],\n ['BRANCH_PIPELINE', project.BRANCH_PIPELINE],\n ['LICENSE_TIERS', project.LICENSE_TIERS],\n ['NODE_VERSION', environment.NODE_VERSION],\n ['PACKAGE_MANAGER', environment.PACKAGE_MANAGER],\n ['STACK', environment.STACK],\n]);\n\n/** Register a custom resolver. Overwrites existing entries with the same key. */\nexport function registerResolver(key: string, fn: ResolverFn): void {\n registry.set(key, fn);\n}\n\n/** Resolve all `{{PLACEHOLDER}}` markers in a string using the resolver registry. */\nexport function resolveTemplate(template: string, ctx: ResolverContext): string {\n return template.replace(/\\{\\{(\\w+)\\}\\}/g, (_match, key: string) => {\n const fn = registry.get(key);\n return fn ? fn(ctx) : `{{${key}}}`;\n });\n}\n\n/** List all registered resolver keys. */\nexport function listResolvers(): string[] {\n return [...registry.keys()];\n}\n","import { resolveTemplate } from '../resolvers/index.js';\nimport type { ResolverContext } from '../resolvers/types.js';\nimport type { Agent, Command, Manifest, Rule, Skill } from '../schemas/index.js';\nimport type { ContentGenerator, GeneratedFile } from './types.js';\n\n/** Build YAML frontmatter from key-value pairs. Only includes defined values. */\nfunction buildFrontmatter(fields: Record<string, string | boolean | undefined>): string {\n const lines: string[] = ['---'];\n for (const [key, value] of Object.entries(fields)) {\n if (value === undefined) continue;\n if (typeof value === 'boolean') {\n lines.push(`${key}: ${value}`);\n } else if (value.includes('\\n')) {\n lines.push(`${key}: |`);\n for (const line of value.split('\\n')) {\n lines.push(` ${line}`);\n }\n } else {\n lines.push(`${key}: ${value}`);\n }\n }\n lines.push('---');\n return lines.join('\\n');\n}\n\nexport class ClaudeCodeGenerator implements ContentGenerator {\n readonly id = 'claude-code';\n readonly outputDir = '.claude';\n\n generateRule(rule: Rule, ctx: ResolverContext): GeneratedFile[] {\n const content = resolveTemplate(rule.content, ctx);\n return [\n {\n relativePath: `.claude/rules/${rule.id}.md`,\n content: `${content}\\n`,\n },\n ];\n }\n\n generateCommand(cmd: Command, ctx: ResolverContext): GeneratedFile[] {\n const content = resolveTemplate(cmd.content, ctx);\n const frontmatter = buildFrontmatter({\n description: cmd.description,\n 'disable-model-invocation': cmd.disableModelInvocation || undefined,\n 'argument-hint': cmd.argumentHint,\n });\n return [\n {\n relativePath: `.claude/commands/${cmd.id}.md`,\n content: `${frontmatter}\\n\\n${content}\\n`,\n },\n ];\n }\n\n generateAgent(agent: Agent, ctx: ResolverContext): GeneratedFile[] {\n const content = resolveTemplate(agent.content, ctx);\n const frontmatter = buildFrontmatter({\n name: agent.id,\n description: agent.description,\n isolation: agent.isolation === 'none' ? undefined : agent.isolation,\n });\n return [\n {\n relativePath: `.claude/agents/${agent.id}.md`,\n content: `${frontmatter}\\n\\n${content}\\n`,\n },\n ];\n }\n\n generateSkill(skill: Skill, ctx: ResolverContext): GeneratedFile[] {\n const content = resolveTemplate(skill.content, ctx);\n const files: GeneratedFile[] = [];\n\n if (skill.skipFrontmatter) {\n files.push({\n relativePath: `.claude/skills/${skill.id}/SKILL.md`,\n content: `${content}\\n`,\n });\n } else {\n const frontmatter = buildFrontmatter({\n name: skill.id,\n description: skill.description,\n 'disable-model-invocation': skill.disableModelInvocation || undefined,\n });\n\n files.push({\n relativePath: `.claude/skills/${skill.id}/SKILL.md`,\n content: `${frontmatter}\\n\\n${content}\\n`,\n });\n }\n\n for (const [name, refContent] of Object.entries(skill.references)) {\n files.push({\n relativePath: `.claude/skills/${skill.id}/references/${name}.md`,\n content: `${resolveTemplate(refContent, ctx)}\\n`,\n });\n }\n\n return files;\n }\n\n generateAll(manifest: Manifest, ctx: ResolverContext): GeneratedFile[] {\n const files: GeneratedFile[] = [];\n\n for (const rule of manifest.rules) {\n files.push(...this.generateRule(rule, ctx));\n }\n for (const cmd of manifest.commands) {\n files.push(...this.generateCommand(cmd, ctx));\n }\n for (const agent of manifest.agents) {\n files.push(...this.generateAgent(agent, ctx));\n }\n for (const skill of manifest.skills) {\n files.push(...this.generateSkill(skill, ctx));\n }\n\n return files;\n }\n}\n","import { resolveTemplate } from '../resolvers/index.js';\nimport type { ResolverContext } from '../resolvers/types.js';\nimport type { Agent, Command, Manifest, Rule, Skill } from '../schemas/index.js';\nimport type { ContentGenerator, GeneratedFile } from './types.js';\n\n/**\n * Cursor generator stub.\n *\n * Cursor uses `.cursor/rules/*.mdc` files with a simpler format.\n * Full implementation deferred — this produces basic `.mdc` output\n * for rules only. Commands, agents, and skills have no Cursor equivalent yet.\n */\nexport class CursorGenerator implements ContentGenerator {\n readonly id = 'cursor';\n readonly outputDir = '.cursor';\n\n generateRule(rule: Rule, ctx: ResolverContext): GeneratedFile[] {\n const content = resolveTemplate(rule.content, ctx);\n return [\n {\n relativePath: `.cursor/rules/${rule.id}.mdc`,\n content: `---\\ndescription: ${rule.description}\\n---\\n\\n${content}\\n`,\n },\n ];\n }\n\n generateCommand(_cmd: Command, _ctx: ResolverContext): GeneratedFile[] {\n return [];\n }\n\n generateAgent(_agent: Agent, _ctx: ResolverContext): GeneratedFile[] {\n return [];\n }\n\n generateSkill(_skill: Skill, _ctx: ResolverContext): GeneratedFile[] {\n return [];\n }\n\n generateAll(manifest: Manifest, ctx: ResolverContext): GeneratedFile[] {\n const files: GeneratedFile[] = [];\n for (const rule of manifest.rules) {\n files.push(...this.generateRule(rule, ctx));\n }\n return files;\n }\n}\n","import { ClaudeCodeGenerator } from './claude.js';\nimport { CursorGenerator } from './cursor.js';\nimport type { ContentGenerator } from './types.js';\n\nexport { ClaudeCodeGenerator } from './claude.js';\nexport { CursorGenerator } from './cursor.js';\nexport type { ContentGenerator, DiffEntry, GeneratedFile } from './types.js';\n\nconst generators = new Map<string, ContentGenerator>([\n ['claude-code', new ClaudeCodeGenerator()],\n ['cursor', new CursorGenerator()],\n]);\n\n/** Get a generator by ID. */\nexport function getGenerator(id: string): ContentGenerator | undefined {\n return generators.get(id);\n}\n\n/** Register a custom generator. */\nexport function registerGenerator(generator: ContentGenerator): void {\n generators.set(generator.id, generator);\n}\n\n/** List all registered generator IDs. */\nexport function listGenerators(): string[] {\n return [...generators.keys()];\n}\n","import { z } from 'zod';\nimport { AgentSchema } from './agent.js';\nimport { CommandSchema } from './command.js';\nimport { PreambleTierSchema } from './preamble.js';\nimport { RuleSchema } from './rule.js';\nimport { SkillSchema } from './skill.js';\n\nexport const ManifestSchema = z.object({\n version: z.literal(1),\n generatedAt: z.string().datetime(),\n rules: z.array(RuleSchema),\n commands: z.array(CommandSchema),\n agents: z.array(AgentSchema),\n skills: z.array(SkillSchema),\n preambles: z.array(PreambleTierSchema),\n});\n\nexport type Manifest = z.infer<typeof ManifestSchema>;\n","import { z } from 'zod';\n\nexport const AgentSchema = z.object({\n id: z.string().min(1),\n name: z.string().min(1),\n description: z.string().min(1),\n tier: z.enum(['oss', 'pro']).default('oss'),\n isolation: z.enum(['worktree', 'none']).default('none'),\n tools: z.array(z.string()).default([]),\n content: z.string().min(1),\n});\n\nexport type Agent = z.infer<typeof AgentSchema>;\n","import { z } from 'zod';\n\nexport const CommandSchema = z.object({\n id: z.string().min(1),\n name: z.string().min(1),\n description: z.string().min(1),\n tier: z.enum(['oss', 'pro']).default('oss'),\n disableModelInvocation: z.boolean().default(false),\n argumentHint: z.string().optional(),\n content: z.string().min(1),\n});\n\nexport type Command = z.infer<typeof CommandSchema>;\n","import { z } from 'zod';\n\nexport const PreambleTierSchema = z.object({\n tier: z.number().int().min(1).max(4),\n name: z.string().min(1),\n description: z.string().min(1),\n ruleIds: z.array(z.string()),\n});\n\nexport type PreambleTier = z.infer<typeof PreambleTierSchema>;\n","import { z } from 'zod';\n\nexport const RuleSchema = z.object({\n id: z.string().min(1),\n name: z.string().min(1),\n description: z.string().min(1),\n scope: z.enum(['global', 'project']),\n preambleTier: z.number().int().min(1).max(4).default(2),\n tier: z.enum(['oss', 'pro']).default('oss'),\n tags: z.array(z.string()).default([]),\n content: z.string().min(1),\n});\n\nexport type Rule = z.infer<typeof RuleSchema>;\n","import { z } from 'zod';\n\nexport const SkillSchema = z.object({\n id: z.string().min(1),\n name: z.string().min(1),\n description: z.string().min(1),\n tier: z.enum(['oss', 'pro']).default('oss'),\n disableModelInvocation: z.boolean().default(false),\n /** When true, the generator omits YAML frontmatter — the content IS the entire file. */\n skipFrontmatter: z.boolean().default(false),\n filePatterns: z.array(z.string()).default([]),\n bashPatterns: z.array(z.string()).default([]),\n references: z.record(z.string(), z.string()).default({}),\n content: z.string().min(1),\n});\n\nexport type Skill = z.infer<typeof SkillSchema>;\n"],"mappings":";AAgBA,SAAS,oBAAoB;AAC7B,SAAS,MAAM,eAAe;;;ACfvB,IAAM,eAAsB;AAAA,EACjC,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,MAAM;AAAA,EACN,aAAa;AAAA,EACb,WAAW;AAAA,EACX,OAAO,CAAC;AAAA,EACR,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAeX;;;ACtBO,IAAM,gBAAuB;AAAA,EAClC,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,MAAM;AAAA,EACN,aAAa;AAAA,EACb,WAAW;AAAA,EACX,OAAO,CAAC;AAAA,EACR,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;A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