@revealui/harnesses 0.1.8 → 0.1.9
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.
- package/README.md +6 -6
- package/dist/{chunk-DGUM43GV.js → chunk-3RG5ZIWI.js} +0 -1
- package/dist/{chunk-DGQ5OB6L.js → chunk-ANX4L2PF.js} +273 -2
- package/dist/{chunk-4F4ANKIZ.js → chunk-Y4FFO3TO.js} +27 -7
- package/dist/{chunk-6E2BKO6U.js → chunk-YYAYTCRM.js} +1330 -354
- package/dist/{chunk-PROC6EJC.js → chunk-ZNIQELKZ.js} +185 -341
- package/dist/cli.js +5 -6
- package/dist/content/index.d.ts +1 -1
- package/dist/content/index.js +2 -3
- package/dist/index-w5ashbfb.d.ts +266 -0
- package/dist/index.d.ts +539 -85
- package/dist/index.js +34 -11
- package/dist/storage/index.d.ts +1 -170
- package/dist/storage/index.js +2 -3
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.js +0 -1
- package/dist/workboard/index.d.ts +26 -14
- package/dist/workboard/index.js +2 -3
- package/package.json +23 -6
- package/dist/chunk-4F4ANKIZ.js.map +0 -1
- package/dist/chunk-6E2BKO6U.js.map +0 -1
- package/dist/chunk-DGQ5OB6L.js.map +0 -1
- package/dist/chunk-DGUM43GV.js.map +0 -1
- package/dist/chunk-PROC6EJC.js.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/content/index.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/storage/index.js.map +0 -1
- package/dist/types/index.js.map +0 -1
- package/dist/workboard/index.js.map +0 -1
|
@@ -23,7 +23,7 @@ Run \`pnpm install\` first to establish symlinks in this worktree.
|
|
|
23
23
|
|
|
24
24
|
## Rules
|
|
25
25
|
- Report errors clearly with file paths and line numbers
|
|
26
|
-
- Do NOT modify source code
|
|
26
|
+
- Do NOT modify source code - only build and report
|
|
27
27
|
- If a build fails, identify the root cause and report it`
|
|
28
28
|
};
|
|
29
29
|
|
|
@@ -39,7 +39,7 @@ var docsSyncAgent = {
|
|
|
39
39
|
|
|
40
40
|
## Purpose
|
|
41
41
|
|
|
42
|
-
Detect documentation drift
|
|
42
|
+
Detect documentation drift - places where code has changed but docs haven't been updated.
|
|
43
43
|
|
|
44
44
|
## Checks
|
|
45
45
|
|
|
@@ -57,7 +57,7 @@ Detect documentation drift \u2014 places where code has changed but docs haven't
|
|
|
57
57
|
- Compare \`packages/cli/src/\` commands against docs site CLI reference
|
|
58
58
|
- Flag undocumented commands or removed commands still in docs
|
|
59
59
|
|
|
60
|
-
### 4. Collection Fields \u2194
|
|
60
|
+
### 4. Collection Fields \u2194 admin Docs
|
|
61
61
|
- Compare \`apps/admin/src/collections/\` field definitions against any collection docs
|
|
62
62
|
- Flag field additions/removals not reflected in documentation
|
|
63
63
|
|
|
@@ -82,7 +82,7 @@ Report findings as a table:
|
|
|
82
82
|
| MEDIUM | Package exports | \`createSession\` exported but undocumented | packages/auth/src/index.ts |
|
|
83
83
|
|
|
84
84
|
## Rules
|
|
85
|
-
- Do NOT modify any files
|
|
85
|
+
- Do NOT modify any files - report only
|
|
86
86
|
- Focus on high-priority drift (new features, changed APIs)
|
|
87
87
|
- Ignore internal/private APIs not intended for external docs
|
|
88
88
|
- Check git log for recently changed files to prioritise review`
|
|
@@ -113,9 +113,9 @@ Run \`pnpm install\` first to establish symlinks in this worktree.
|
|
|
113
113
|
|
|
114
114
|
## Rules
|
|
115
115
|
- Report which phase failed and the specific error(s)
|
|
116
|
-
- Biome, typecheck, and build are hard failures
|
|
117
|
-
- Tests are warn-only
|
|
118
|
-
- Do NOT modify source code
|
|
116
|
+
- Biome, typecheck, and build are hard failures - must be fixed
|
|
117
|
+
- Tests are warn-only - report but don't block
|
|
118
|
+
- Do NOT modify source code - only run the gate and report`
|
|
119
119
|
};
|
|
120
120
|
|
|
121
121
|
// src/content/definitions/agents/linter.ts
|
|
@@ -139,7 +139,7 @@ Run \`pnpm install\` first to establish symlinks in this worktree.
|
|
|
139
139
|
- Format: \`pnpm format\`
|
|
140
140
|
|
|
141
141
|
## Rules
|
|
142
|
-
- Biome is the sole linter
|
|
142
|
+
- Biome is the sole linter - fix all Biome errors
|
|
143
143
|
- Follow the unused declarations policy in \`.claude/rules/unused-declarations.md\`
|
|
144
144
|
- Report remaining warnings that cannot be auto-fixed
|
|
145
145
|
- Do NOT suppress lint rules without justification`
|
|
@@ -195,13 +195,13 @@ Audit the codebase for security issues across these categories:
|
|
|
195
195
|
- **Auth**: Session-only (no JWT). \`revealui-session\` cookie across \`.revealui.com\`.
|
|
196
196
|
- **Dual-DB**: NeonDB (REST content) + Supabase (vectors/auth). Strict import boundary.
|
|
197
197
|
- **Tiers**: free, pro, max, enterprise. License checks via \`isLicensed()\`.
|
|
198
|
-
- **API**: Hono on port 3004.
|
|
198
|
+
- **API**: Hono on port 3004. admin calls API cross-origin (CORS configured).
|
|
199
199
|
|
|
200
200
|
## Rules
|
|
201
201
|
- Use AST-based analysis over regex for code-shape checks (see .claude/rules/code-analysis-policy.md)
|
|
202
202
|
- Report findings with severity (critical/high/medium/low), file path, and line number
|
|
203
203
|
- Suggest specific fixes, not just descriptions
|
|
204
|
-
- Do NOT modify source code
|
|
204
|
+
- Do NOT modify source code - report only
|
|
205
205
|
- Prioritise critical and high severity findings`
|
|
206
206
|
};
|
|
207
207
|
|
|
@@ -226,7 +226,7 @@ Run \`pnpm install\` first to establish symlinks in this worktree.
|
|
|
226
226
|
|
|
227
227
|
## Rules
|
|
228
228
|
- Report test failures with file paths, test names, and error messages
|
|
229
|
-
- Do NOT modify source code
|
|
229
|
+
- Do NOT modify source code - only test and report
|
|
230
230
|
- If tests fail, identify the root cause and suggest fixes
|
|
231
231
|
- Report coverage numbers when running with coverage`
|
|
232
232
|
};
|
|
@@ -252,8 +252,8 @@ var auditCommand = {
|
|
|
252
252
|
|
|
253
253
|
Execute these audit commands in sequence:
|
|
254
254
|
|
|
255
|
-
1. \`pnpm audit:any\`
|
|
256
|
-
2. \`pnpm audit:console\`
|
|
255
|
+
1. \`pnpm audit:any\` - Find avoidable \`any\` types across the codebase
|
|
256
|
+
2. \`pnpm audit:console\` - Find production \`console.*\` statements that should use the logger
|
|
257
257
|
|
|
258
258
|
Report findings as a summary table with package name and count. If issues are found, suggest fixes.
|
|
259
259
|
|
|
@@ -333,18 +333,18 @@ var stripeBestPracticesCommand = {
|
|
|
333
333
|
- Handle all relevant events: \`checkout.session.completed\`, \`customer.subscription.deleted\`, \`customer.subscription.updated\`, \`invoice.payment_failed\`
|
|
334
334
|
|
|
335
335
|
## Subscription Management
|
|
336
|
-
- Store \`customer.id\`, \`subscription.id\`, and \`subscription.status\` in your DB
|
|
336
|
+
- Store \`customer.id\`, \`subscription.id\`, and \`subscription.status\` in your DB - not just price/product IDs
|
|
337
337
|
- Use \`subscription.status\` to gate access: only \`active\` and \`trialing\` grant access
|
|
338
|
-
- Handle \`past_due\` gracefully
|
|
338
|
+
- Handle \`past_due\` gracefully - show dunning UI, don't immediately revoke access
|
|
339
339
|
- Use \`cancel_at_period_end: true\` for user-initiated cancellations (preserves access until period end)
|
|
340
340
|
|
|
341
341
|
## Checkout & Billing Portal
|
|
342
342
|
- Use \`metadata\` on checkout sessions to pass internal IDs (userId, planId) through to webhooks
|
|
343
343
|
- Always set \`client_reference_id\` to your internal user ID
|
|
344
|
-
- Use Stripe Billing Portal for plan changes and cancellations
|
|
344
|
+
- Use Stripe Billing Portal for plan changes and cancellations - don't build your own
|
|
345
345
|
|
|
346
346
|
## Security
|
|
347
|
-
- Never log full Stripe objects
|
|
347
|
+
- Never log full Stripe objects - they may contain PII
|
|
348
348
|
- Never expose secret keys client-side; all Stripe API calls must be server-side
|
|
349
349
|
- Use restricted API keys scoped to minimum permissions for each service
|
|
350
350
|
- Validate that webhook events reference resources owned by your users before acting
|
|
@@ -358,7 +358,7 @@ var stripeBestPracticesCommand = {
|
|
|
358
358
|
- Webhook endpoint: \`apps/admin\` at \`/api/webhooks/stripe\` (NOT the API endpoint)
|
|
359
359
|
- Stripe service: \`packages/services/src/stripe/\`
|
|
360
360
|
- Billing routes: \`apps/api/src/routes/billing.ts\`
|
|
361
|
-
- Price IDs are managed via \`pnpm stripe:seed\`
|
|
361
|
+
- Price IDs are managed via \`pnpm stripe:seed\` - see \`scripts/setup/seed-stripe.ts\``
|
|
362
362
|
};
|
|
363
363
|
|
|
364
364
|
// src/content/definitions/commands/index.ts
|
|
@@ -374,25 +374,25 @@ var preambles = [
|
|
|
374
374
|
{
|
|
375
375
|
tier: 1,
|
|
376
376
|
name: "Identity",
|
|
377
|
-
description: "Always injected
|
|
377
|
+
description: "Always injected - core project identity and structure",
|
|
378
378
|
ruleIds: ["monorepo"]
|
|
379
379
|
},
|
|
380
380
|
{
|
|
381
381
|
tier: 2,
|
|
382
382
|
name: "Architecture",
|
|
383
|
-
description: "Project-wide technical context
|
|
383
|
+
description: "Project-wide technical context - database, styling, formatting, config patterns",
|
|
384
384
|
ruleIds: ["database", "biome", "tailwind", "parameterization"]
|
|
385
385
|
},
|
|
386
386
|
{
|
|
387
387
|
tier: 3,
|
|
388
388
|
name: "Domain",
|
|
389
|
-
description: "Feature-area specific policies
|
|
389
|
+
description: "Feature-area specific policies - analysis standards, code hygiene",
|
|
390
390
|
ruleIds: ["code-analysis-policy", "unused-declarations"]
|
|
391
391
|
},
|
|
392
392
|
{
|
|
393
393
|
tier: 4,
|
|
394
394
|
name: "Task",
|
|
395
|
-
description: "Injected per-operation
|
|
395
|
+
description: "Injected per-operation - skill routing, agent dispatch",
|
|
396
396
|
ruleIds: ["skills-usage", "agent-dispatch"]
|
|
397
397
|
}
|
|
398
398
|
];
|
|
@@ -425,7 +425,7 @@ too large or specialized for the current session.
|
|
|
425
425
|
## Rules
|
|
426
426
|
|
|
427
427
|
1. Don't spawn a profile for work that takes under 15 minutes in the current session.
|
|
428
|
-
2. Check the workboard before spawning
|
|
428
|
+
2. Check the workboard before spawning - another agent may already own that area.
|
|
429
429
|
3. Always give spawned agents:
|
|
430
430
|
- Current phase from \`~/projects/revealui-jv/docs/MASTER_PLAN.md\`
|
|
431
431
|
- Relevant workboard state
|
|
@@ -451,11 +451,11 @@ Biome 2 is the sole linter and formatter for this monorepo.
|
|
|
451
451
|
|
|
452
452
|
## Commands
|
|
453
453
|
|
|
454
|
-
- \`pnpm lint\`
|
|
455
|
-
- \`pnpm format\`
|
|
456
|
-
- \`pnpm lint:fix\`
|
|
457
|
-
- \`biome check .\`
|
|
458
|
-
- \`biome check --write .\`
|
|
454
|
+
- \`pnpm lint\` - check all files with Biome (\`biome check .\`)
|
|
455
|
+
- \`pnpm format\` - format all files with Biome (\`biome format --write .\`)
|
|
456
|
+
- \`pnpm lint:fix\` - auto-fix with Biome (\`biome check --write .\`)
|
|
457
|
+
- \`biome check .\` - lint + format check (per-package)
|
|
458
|
+
- \`biome check --write .\` - auto-fix (used by lint-staged)
|
|
459
459
|
|
|
460
460
|
## Lint-Staged
|
|
461
461
|
|
|
@@ -475,10 +475,10 @@ Pre-commit hook runs \`biome check --write\` on staged \`*.{ts,tsx,js,jsx}\` fil
|
|
|
475
475
|
## Suppressing Rules
|
|
476
476
|
|
|
477
477
|
- Use \`// biome-ignore <rule>: <reason>\` for specific lines
|
|
478
|
-
- Avoid blanket suppressions
|
|
478
|
+
- Avoid blanket suppressions - prefer fixing the code
|
|
479
479
|
- Document why a suppression is needed in the comment
|
|
480
480
|
|
|
481
|
-
## Unused Variables
|
|
481
|
+
## Unused Variables - Special Protocol
|
|
482
482
|
|
|
483
483
|
**Before suppressing any unused variable or import warning, read \`.claude/rules/unused-declarations.md\`.**
|
|
484
484
|
|
|
@@ -558,19 +558,19 @@ RevealUI uses **two databases with strictly separated responsibilities**:
|
|
|
558
558
|
**\`@supabase/supabase-js\` must only be imported inside designated vector/auth modules:**
|
|
559
559
|
|
|
560
560
|
### Allowed paths for Supabase imports
|
|
561
|
-
- \`packages/db/src/vector/\`
|
|
562
|
-
- \`packages/db/src/auth/\`
|
|
563
|
-
- \`packages/auth/src/\`
|
|
564
|
-
- \`packages/ai/src/\`
|
|
565
|
-
- \`packages/services/src/supabase/\`
|
|
566
|
-
- \`apps/*/src/lib/supabase/\`
|
|
561
|
+
- \`packages/db/src/vector/\` - vector schema and queries
|
|
562
|
+
- \`packages/db/src/auth/\` - Supabase auth helpers
|
|
563
|
+
- \`packages/auth/src/\` - authentication implementation
|
|
564
|
+
- \`packages/ai/src/\` - AI memory and embedding storage
|
|
565
|
+
- \`packages/services/src/supabase/\` - Supabase service integrations
|
|
566
|
+
- \`apps/*/src/lib/supabase/\` - app-level Supabase utilities
|
|
567
567
|
|
|
568
568
|
### Forbidden: Supabase imports in
|
|
569
|
-
- \`packages/core/\`
|
|
570
|
-
- \`packages/contracts/\`
|
|
571
|
-
- \`packages/config/\`
|
|
572
|
-
- \`apps/admin/src/collections/\`
|
|
573
|
-
- \`apps/admin/src/routes/\`
|
|
569
|
+
- \`packages/core/\` - admin engine must be DB-agnostic
|
|
570
|
+
- \`packages/contracts/\` - contracts are schema-only
|
|
571
|
+
- \`packages/config/\` - config must not hardcode DB client
|
|
572
|
+
- \`apps/admin/src/collections/\` - collection hooks use Drizzle/Neon only
|
|
573
|
+
- \`apps/admin/src/routes/\` - REST routes use Neon only
|
|
574
574
|
|
|
575
575
|
## Schema Organization
|
|
576
576
|
|
|
@@ -579,7 +579,7 @@ packages/db/src/schema/
|
|
|
579
579
|
\u251C\u2500\u2500 accounts.ts # NeonDB: user accounts
|
|
580
580
|
\u251C\u2500\u2500 agents.ts # NeonDB: AI agent definitions
|
|
581
581
|
\u251C\u2500\u2500 api-keys.ts # NeonDB: API key management
|
|
582
|
-
\u251C\u2500\u2500
|
|
582
|
+
\u251C\u2500\u2500 admin.ts # NeonDB: admin collections, media
|
|
583
583
|
\u251C\u2500\u2500 gdpr.ts # NeonDB: GDPR consent, deletion
|
|
584
584
|
\u251C\u2500\u2500 licenses.ts # NeonDB: license keys, tiers
|
|
585
585
|
\u251C\u2500\u2500 pages.ts # NeonDB: pages, navigation
|
|
@@ -613,7 +613,7 @@ const { data } = await supabase.rpc('match_documents', { query_embedding: embedd
|
|
|
613
613
|
## Enforcement
|
|
614
614
|
|
|
615
615
|
The \`pnpm validate:structure\` script checks for Supabase imports outside permitted paths.
|
|
616
|
-
CI runs this as part of phase 1 (warn-only
|
|
616
|
+
CI runs this as part of phase 1 (warn-only - violations are flagged but don't block builds).
|
|
617
617
|
|
|
618
618
|
To check locally:
|
|
619
619
|
\`\`\`bash
|
|
@@ -640,9 +640,9 @@ var monorepoRule = {
|
|
|
640
640
|
content: `# Monorepo Conventions
|
|
641
641
|
|
|
642
642
|
## Structure
|
|
643
|
-
- Apps live in \`apps/\`
|
|
644
|
-
- Packages live in \`packages/\`
|
|
645
|
-
- Scripts live in \`scripts/\`
|
|
643
|
+
- Apps live in \`apps/\` - deployable services (Next.js, Hono, Vite)
|
|
644
|
+
- Packages live in \`packages/\` - shared libraries consumed by apps
|
|
645
|
+
- Scripts live in \`scripts/\` - CLI tools, automation, CI gates
|
|
646
646
|
|
|
647
647
|
## Package Manager
|
|
648
648
|
- pnpm 10 with workspace protocol
|
|
@@ -698,7 +698,7 @@ var parameterizationRule = {
|
|
|
698
698
|
id: "parameterization",
|
|
699
699
|
tier: "oss",
|
|
700
700
|
name: "Parameterization Conventions",
|
|
701
|
-
description: "Never hardcode config values
|
|
701
|
+
description: "Never hardcode config values - extract, type, default, and make overridable",
|
|
702
702
|
scope: "project",
|
|
703
703
|
preambleTier: 2,
|
|
704
704
|
tags: ["config", "patterns"],
|
|
@@ -739,7 +739,7 @@ export function configureModule(overrides: Partial<ModuleConfig>): void {
|
|
|
739
739
|
|
|
740
740
|
- Tests need fast TTLs and small limits
|
|
741
741
|
- Deployments may need different thresholds than development
|
|
742
|
-
- \`Math.random()\` is not cryptographically secure
|
|
742
|
+
- \`Math.random()\` is not cryptographically secure - use \`crypto.randomInt()\` for security-sensitive values (OTPs, tokens, nonces)
|
|
743
743
|
|
|
744
744
|
## Applies To
|
|
745
745
|
|
|
@@ -771,27 +771,27 @@ When the Skill tool is available, proactively invoke the following skills in the
|
|
|
771
771
|
|
|
772
772
|
## Always invoke automatically (no user prompt needed)
|
|
773
773
|
|
|
774
|
-
- \`/vercel-react-best-practices\`
|
|
775
|
-
- \`/stripe-best-practices\`
|
|
776
|
-
- \`/next-best-practices\`
|
|
777
|
-
- \`/next-cache-components\`
|
|
778
|
-
- \`/vercel-composition-patterns\`
|
|
779
|
-
- \`/web-design-guidelines\`
|
|
780
|
-
- \`/review\`
|
|
781
|
-
- \`/add-tests\`
|
|
782
|
-
- \`/audit\`
|
|
783
|
-
- \`/turborepo\`
|
|
774
|
+
- \`/vercel-react-best-practices\` - before completing any PR that touches React components or hooks
|
|
775
|
+
- \`/stripe-best-practices\` - any time you write or modify billing, payment, webhook, or Stripe code
|
|
776
|
+
- \`/next-best-practices\` - when implementing features in apps/admin or apps/marketing
|
|
777
|
+
- \`/next-cache-components\` - when adding 'use cache', cache profiles, or PPR to a Next.js route
|
|
778
|
+
- \`/vercel-composition-patterns\` - when adding new components to @revealui/presentation
|
|
779
|
+
- \`/web-design-guidelines\` - when asked to review a UI, page, or component for quality
|
|
780
|
+
- \`/review\` - when the user asks for a code review, asks to "check" or "look at" code
|
|
781
|
+
- \`/add-tests\` - when the user asks to write tests or add coverage for a specific file
|
|
782
|
+
- \`/audit\` - before any release or after a large refactor touching multiple packages
|
|
783
|
+
- \`/turborepo\` - when modifying turbo.json, pipeline configuration, or monorepo task dependencies
|
|
784
784
|
|
|
785
785
|
## Only invoke on explicit user request (disable-model-invocation: true)
|
|
786
786
|
|
|
787
|
-
- \`/gate\`
|
|
788
|
-
- \`/sync-lts\`
|
|
789
|
-
- \`/new-package\`
|
|
790
|
-
- \`/new-professional-project\`
|
|
791
|
-
- \`/vercel-deploy\`
|
|
792
|
-
- \`/deploy-check\`
|
|
793
|
-
- \`/db-migrate\`
|
|
794
|
-
- \`/preflight\`
|
|
787
|
+
- \`/gate\` - user must explicitly ask to run the gate
|
|
788
|
+
- \`/sync-lts\` - user must explicitly ask to sync or backup
|
|
789
|
+
- \`/new-package\` - user must explicitly ask to scaffold a package
|
|
790
|
+
- \`/new-professional-project\` - user must explicitly ask to create a project
|
|
791
|
+
- \`/vercel-deploy\` - user must explicitly ask to deploy
|
|
792
|
+
- \`/deploy-check\` - user must explicitly ask for pre-deploy check
|
|
793
|
+
- \`/db-migrate\` - user must explicitly ask to create or apply database migrations
|
|
794
|
+
- \`/preflight\` - user must explicitly ask to run the preflight checklist
|
|
795
795
|
|
|
796
796
|
## When in doubt
|
|
797
797
|
|
|
@@ -825,7 +825,7 @@ The shared config in \`packages/dev/src/tailwind/\` uses a **v3 compatibility pa
|
|
|
825
825
|
/* CORRECT (v4) */
|
|
826
826
|
@import "tailwindcss";
|
|
827
827
|
|
|
828
|
-
/* WRONG (v3
|
|
828
|
+
/* WRONG (v3 - deprecated) */
|
|
829
829
|
@tailwind base;
|
|
830
830
|
@tailwind components;
|
|
831
831
|
@tailwind utilities;
|
|
@@ -849,19 +849,19 @@ The shared config in \`packages/dev/src/tailwind/\` uses a **v3 compatibility pa
|
|
|
849
849
|
|
|
850
850
|
### CSS Variable Syntax
|
|
851
851
|
\`\`\`html
|
|
852
|
-
<!-- CORRECT (v4)
|
|
852
|
+
<!-- CORRECT (v4) - parentheses -->
|
|
853
853
|
<div class="bg-(--brand-color)">
|
|
854
854
|
|
|
855
|
-
<!-- WRONG (v3)
|
|
855
|
+
<!-- WRONG (v3) - square brackets -->
|
|
856
856
|
<div class="bg-[--brand-color]">
|
|
857
857
|
\`\`\`
|
|
858
858
|
|
|
859
859
|
### Important Modifier
|
|
860
860
|
\`\`\`html
|
|
861
|
-
<!-- CORRECT (v4)
|
|
861
|
+
<!-- CORRECT (v4) - at the end -->
|
|
862
862
|
<div class="bg-red-500!">
|
|
863
863
|
|
|
864
|
-
<!-- WRONG (v3)
|
|
864
|
+
<!-- WRONG (v3) - at the start -->
|
|
865
865
|
<div class="bg-!red-500">
|
|
866
866
|
\`\`\`
|
|
867
867
|
|
|
@@ -870,7 +870,7 @@ The shared config in \`packages/dev/src/tailwind/\` uses a **v3 compatibility pa
|
|
|
870
870
|
- **Ring width**: default is \`1px\` (was \`3px\` in v3)
|
|
871
871
|
- **\`hover:\`**: only applies on devices that support hover (no-touch)
|
|
872
872
|
- **Stacked variants**: apply left-to-right (reversed from v3)
|
|
873
|
-
- **\`space-*\` / \`divide-*\`**: selectors changed
|
|
873
|
+
- **\`space-*\` / \`divide-*\`**: selectors changed - prefer \`gap\` with flex/grid
|
|
874
874
|
|
|
875
875
|
### Transform Utilities
|
|
876
876
|
\`\`\`html
|
|
@@ -893,10 +893,10 @@ Use \`@reference\` to access theme variables in CSS modules or component \`<styl
|
|
|
893
893
|
|
|
894
894
|
### PostCSS Plugin
|
|
895
895
|
\`\`\`js
|
|
896
|
-
// v4
|
|
896
|
+
// v4 - new package name
|
|
897
897
|
{ plugins: { '@tailwindcss/postcss': {} } }
|
|
898
898
|
|
|
899
|
-
// v3
|
|
899
|
+
// v3 - old (still works but deprecated)
|
|
900
900
|
{ plugins: { tailwindcss: {} } }
|
|
901
901
|
\`\`\`
|
|
902
902
|
|
|
@@ -930,10 +930,10 @@ In v4, theme tokens go in CSS, not JS:
|
|
|
930
930
|
| \`packages/dev/src/tailwind/postcss.config.ts\` | PostCSS config with \`@tailwindcss/postcss\` |
|
|
931
931
|
| \`packages/dev/src/tailwind/styles.css\` | Base CSS (\`@import "tailwindcss"\`) |
|
|
932
932
|
|
|
933
|
-
### Consumer Pattern (current
|
|
933
|
+
### Consumer Pattern (current - v3 compat)
|
|
934
934
|
\`\`\`ts
|
|
935
935
|
// apps/admin/tailwind.config.ts
|
|
936
|
-
import { createTailwindConfig } from 'dev/tailwind/create-config'
|
|
936
|
+
import { createTailwindConfig } from '@revealui/dev/tailwind/create-config'
|
|
937
937
|
export default createTailwindConfig({
|
|
938
938
|
content: ['./src/**/*.{ts,tsx}'],
|
|
939
939
|
// app-specific overrides
|
|
@@ -942,14 +942,14 @@ export default createTailwindConfig({
|
|
|
942
942
|
|
|
943
943
|
## Rules for New Code
|
|
944
944
|
|
|
945
|
-
1. **Never use \`@tailwind\` directives**
|
|
946
|
-
2. **Never use \`@layer utilities\` or \`@layer components\`** for custom utilities
|
|
945
|
+
1. **Never use \`@tailwind\` directives** - use \`@import "tailwindcss"\` instead
|
|
946
|
+
2. **Never use \`@layer utilities\` or \`@layer components\`** for custom utilities - use \`@utility\`
|
|
947
947
|
3. **Use \`bg-(--var)\` syntax** for CSS variables, not \`bg-[--var]\`
|
|
948
948
|
4. **Important goes at the end**: \`bg-red-500!\` not \`!bg-red-500\`
|
|
949
949
|
5. **Prefer \`gap\`** over \`space-*\` / \`divide-*\` for spacing in flex/grid
|
|
950
|
-
6. **No \`transform-none\`**
|
|
951
|
-
7. **Don't add new v3 JS plugins**
|
|
952
|
-
8. **Content paths are auto-detected** in v4
|
|
950
|
+
6. **No \`transform-none\`** - use \`scale-none\`, \`rotate-none\`, \`translate-none\`
|
|
951
|
+
7. **Don't add new v3 JS plugins** - if a v4 CSS equivalent exists, use that
|
|
952
|
+
8. **Content paths are auto-detected** in v4 - only add manual paths for edge cases`
|
|
953
953
|
};
|
|
954
954
|
|
|
955
955
|
// src/content/definitions/rules/unused-declarations.ts
|
|
@@ -957,7 +957,7 @@ var unusedDeclarationsRule = {
|
|
|
957
957
|
id: "unused-declarations",
|
|
958
958
|
tier: "oss",
|
|
959
959
|
name: "Unused Declarations Policy",
|
|
960
|
-
description: "Never suppress unused warnings without determining if code is incomplete
|
|
960
|
+
description: "Never suppress unused warnings without determining if code is incomplete - implement first",
|
|
961
961
|
scope: "project",
|
|
962
962
|
preambleTier: 3,
|
|
963
963
|
tags: ["lint", "quality", "policy"],
|
|
@@ -967,7 +967,7 @@ var unusedDeclarationsRule = {
|
|
|
967
967
|
|
|
968
968
|
**NEVER suppress an unused variable/import warning without first determining if the code is incomplete.**
|
|
969
969
|
|
|
970
|
-
Unused declarations in this codebase frequently signal incomplete implementations
|
|
970
|
+
Unused 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.
|
|
971
971
|
|
|
972
972
|
---
|
|
973
973
|
|
|
@@ -990,7 +990,7 @@ When you encounter an \`no-unused-vars\`, \`noUnusedVariables\`, or \`noUnusedFu
|
|
|
990
990
|
|
|
991
991
|
3. Is the import used only as a type (TypeScript)?
|
|
992
992
|
\u2514\u2500 Signs: import is from a types package, used only in \`type X = ...\` expressions
|
|
993
|
-
\u2514\u2500 Action: Change to \`import type { ... }\`
|
|
993
|
+
\u2514\u2500 Action: Change to \`import type { ... }\` - Biome will no longer flag it.
|
|
994
994
|
|
|
995
995
|
4. Is the parameter required by a callback signature you don't control?
|
|
996
996
|
\u2514\u2500 Signs: Express/Hono middleware \`(req, res, next)\`, event handler \`(event, context)\`,
|
|
@@ -1000,7 +1000,7 @@ When you encounter an \`no-unused-vars\`, \`noUnusedVariables\`, or \`noUnusedFu
|
|
|
1000
1000
|
5. Is it genuinely dead code with no planned use?
|
|
1001
1001
|
\u2514\u2500 Signs: feature was removed, import was replaced, duplicate of another symbol
|
|
1002
1002
|
\u2514\u2500 Action: DELETE the declaration entirely. Per the Legacy Code Removal Policy,
|
|
1003
|
-
no grace periods
|
|
1003
|
+
no grace periods - remove it and all call sites in the same change.
|
|
1004
1004
|
\`\`\`
|
|
1005
1005
|
|
|
1006
1006
|
---
|
|
@@ -1011,7 +1011,7 @@ When you determine a declaration is incomplete (case 1), the required steps are:
|
|
|
1011
1011
|
|
|
1012
1012
|
1. **Search the codebase** for related implementations, types, interfaces, and tests that reveal intent.
|
|
1013
1013
|
2. **Check the plan file** at \`~/.claude/plans/\` for any documented phase covering this feature.
|
|
1014
|
-
3. **Check for contracts** in \`packages/contracts/src/\`
|
|
1014
|
+
3. **Check for contracts** in \`packages/contracts/src/\` - the schema often describes the expected behavior.
|
|
1015
1015
|
4. **Implement the function/class/module** based on what the surrounding code expects.
|
|
1016
1016
|
5. **Run \`pnpm gate:quick\`** after implementing to verify no new errors were introduced.
|
|
1017
1017
|
|
|
@@ -1024,13 +1024,13 @@ Do NOT:
|
|
|
1024
1024
|
|
|
1025
1025
|
## Examples
|
|
1026
1026
|
|
|
1027
|
-
### Wrong
|
|
1027
|
+
### Wrong - suppressing an incomplete stub
|
|
1028
1028
|
\`\`\`ts
|
|
1029
1029
|
// biome-ignore lint/correctness/noUnusedVariables: TODO
|
|
1030
1030
|
const semanticMemory = new SemanticMemory()
|
|
1031
1031
|
\`\`\`
|
|
1032
1032
|
|
|
1033
|
-
### Right
|
|
1033
|
+
### Right - implement it
|
|
1034
1034
|
\`\`\`ts
|
|
1035
1035
|
const semanticMemory = new SemanticMemory()
|
|
1036
1036
|
await semanticMemory.store('key', content, embedding)
|
|
@@ -1038,13 +1038,13 @@ await semanticMemory.store('key', content, embedding)
|
|
|
1038
1038
|
|
|
1039
1039
|
---
|
|
1040
1040
|
|
|
1041
|
-
### Wrong
|
|
1041
|
+
### Wrong - deleting a planned integration
|
|
1042
1042
|
\`\`\`ts
|
|
1043
1043
|
// Was: import { ProceduralMemory } from './procedural-memory.js'
|
|
1044
1044
|
// Deleted because "unused"
|
|
1045
1045
|
\`\`\`
|
|
1046
1046
|
|
|
1047
|
-
### Right
|
|
1047
|
+
### Right - implement the module it was waiting for
|
|
1048
1048
|
\`\`\`ts
|
|
1049
1049
|
// packages/ai/src/memory/memory/procedural-memory.ts
|
|
1050
1050
|
export class ProceduralMemory { ... }
|
|
@@ -1053,14 +1053,14 @@ export class ProceduralMemory { ... }
|
|
|
1053
1053
|
|
|
1054
1054
|
---
|
|
1055
1055
|
|
|
1056
|
-
### Wrong
|
|
1056
|
+
### Wrong - renaming away the signal
|
|
1057
1057
|
\`\`\`ts
|
|
1058
1058
|
// Original: const routeTableAssoc = new aws.ec2.RouteTableAssociation(...)
|
|
1059
1059
|
// "Fixed": const _routeTableAssoc = new aws.ec2.RouteTableAssociation(...)
|
|
1060
1060
|
// No comment explaining why
|
|
1061
1061
|
\`\`\`
|
|
1062
1062
|
|
|
1063
|
-
### Right
|
|
1063
|
+
### Right - rename AND document
|
|
1064
1064
|
\`\`\`ts
|
|
1065
1065
|
// Route table association must exist for subnet routing to function.
|
|
1066
1066
|
// The variable is not referenced after creation; AWS manages the association.
|
|
@@ -1139,7 +1139,7 @@ Before creating a migration:
|
|
|
1139
1139
|
grep -r "export const.*pgTable" packages/db/src/schema/
|
|
1140
1140
|
\`\`\`
|
|
1141
1141
|
|
|
1142
|
-
3. **Verify contracts alignment**
|
|
1142
|
+
3. **Verify contracts alignment** - new tables/columns should have corresponding Zod schemas:
|
|
1143
1143
|
\`\`\`bash
|
|
1144
1144
|
ls packages/contracts/src/
|
|
1145
1145
|
\`\`\`
|
|
@@ -1162,7 +1162,7 @@ cd packages/db
|
|
|
1162
1162
|
pnpm drizzle-kit generate
|
|
1163
1163
|
\`\`\`
|
|
1164
1164
|
|
|
1165
|
-
Review the generated SQL in \`packages/db/drizzle/\`
|
|
1165
|
+
Review the generated SQL in \`packages/db/drizzle/\` - check for:
|
|
1166
1166
|
- Destructive changes (DROP TABLE, DROP COLUMN)
|
|
1167
1167
|
- Data loss risks (column type changes without USING clause)
|
|
1168
1168
|
- Missing indexes on foreign keys
|
|
@@ -1170,11 +1170,11 @@ Review the generated SQL in \`packages/db/drizzle/\` \u2014 check for:
|
|
|
1170
1170
|
### Step 3: Apply Migration (Development Only)
|
|
1171
1171
|
|
|
1172
1172
|
\`\`\`bash
|
|
1173
|
-
# Development database ONLY
|
|
1173
|
+
# Development database ONLY - never production
|
|
1174
1174
|
pnpm db:migrate
|
|
1175
1175
|
\`\`\`
|
|
1176
1176
|
|
|
1177
|
-
**NEVER run \`drizzle-kit push\`**
|
|
1177
|
+
**NEVER run \`drizzle-kit push\`** - always use \`drizzle-kit migrate\` (the PreToolUse hook blocks \`push\`).
|
|
1178
1178
|
|
|
1179
1179
|
### Step 4: Verify
|
|
1180
1180
|
|
|
@@ -1255,8 +1255,8 @@ This runs 15 checks covering lint, types, tests, build, security, and structure.
|
|
|
1255
1255
|
|
|
1256
1256
|
| Check | What It Means | Common Fix |
|
|
1257
1257
|
|-------|--------------|------------|
|
|
1258
|
-
| **\`any\` audit** | Avoidable \`any\` types found | \`pnpm audit:any\`
|
|
1259
|
-
| **Console audit** | \`console.*\` in production code | \`pnpm audit:console\`
|
|
1258
|
+
| **\`any\` audit** | Avoidable \`any\` types found | \`pnpm audit:any\` - use \`unknown\` + type guards |
|
|
1259
|
+
| **Console audit** | \`console.*\` in production code | \`pnpm audit:console\` - use \`@revealui/utils\` logger |
|
|
1260
1260
|
| **Structure** | Supabase boundary violations or package issues | \`pnpm validate:structure\` |
|
|
1261
1261
|
| **Security** | CSP, CORS, or header issues | Check \`packages/security/\` |
|
|
1262
1262
|
| **Dependencies** | Version mismatches across workspaces | \`pnpm deps:check\` then \`pnpm deps:fix\` |
|
|
@@ -1282,7 +1282,7 @@ var revealuiConventionsSkill = {
|
|
|
1282
1282
|
id: "revealui-conventions",
|
|
1283
1283
|
tier: "oss",
|
|
1284
1284
|
name: "RevealUI Conventions",
|
|
1285
|
-
description: "RevealUI coding conventions for any code task
|
|
1285
|
+
description: "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.",
|
|
1286
1286
|
disableModelInvocation: false,
|
|
1287
1287
|
skipFrontmatter: false,
|
|
1288
1288
|
filePatterns: [],
|
|
@@ -1298,7 +1298,7 @@ Follow these conventions for ALL code in the RevealUI monorepo.
|
|
|
1298
1298
|
- Use ES Modules (\`import\`/\`export\`), never CommonJS (\`require\`)
|
|
1299
1299
|
- Prefer \`interface\` over \`type\` for object shapes (unless union/intersection needed)
|
|
1300
1300
|
- Use explicit return types on exported functions
|
|
1301
|
-
- Avoid \`any\`
|
|
1301
|
+
- Avoid \`any\` - use \`unknown\` and narrow with type guards
|
|
1302
1302
|
- Use \`as const\` for literal objects and arrays when appropriate
|
|
1303
1303
|
- Prefer \`satisfies\` over \`as\` for type assertions when possible
|
|
1304
1304
|
- Use optional chaining (\`?.\`) and nullish coalescing (\`??\`) over manual checks
|
|
@@ -1324,9 +1324,9 @@ Follow these conventions for ALL code in the RevealUI monorepo.
|
|
|
1324
1324
|
## Monorepo
|
|
1325
1325
|
|
|
1326
1326
|
### Structure
|
|
1327
|
-
- Apps live in \`apps/\`
|
|
1328
|
-
- Packages live in \`packages/\`
|
|
1329
|
-
- Scripts live in \`scripts/\`
|
|
1327
|
+
- Apps live in \`apps/\` - deployable services (Next.js, Hono, Vite)
|
|
1328
|
+
- Packages live in \`packages/\` - shared libraries consumed by apps
|
|
1329
|
+
- Scripts live in \`scripts/\` - CLI tools, automation, CI gates
|
|
1330
1330
|
|
|
1331
1331
|
### Package Manager
|
|
1332
1332
|
- pnpm 10 with workspace protocol
|
|
@@ -1379,9 +1379,9 @@ Follow these conventions for ALL code in the RevealUI monorepo.
|
|
|
1379
1379
|
Biome 2 is the sole linter and formatter for this monorepo.
|
|
1380
1380
|
|
|
1381
1381
|
### Commands
|
|
1382
|
-
- \`pnpm lint\`
|
|
1383
|
-
- \`pnpm format\`
|
|
1384
|
-
- \`pnpm lint:fix\`
|
|
1382
|
+
- \`pnpm lint\` - check all files (\`biome check .\`)
|
|
1383
|
+
- \`pnpm format\` - format all files (\`biome format --write .\`)
|
|
1384
|
+
- \`pnpm lint:fix\` - auto-fix (\`biome check --write .\`)
|
|
1385
1385
|
|
|
1386
1386
|
### Key Rules
|
|
1387
1387
|
- No unused variables or imports (auto-removed on format)
|
|
@@ -1395,7 +1395,7 @@ Biome 2 is the sole linter and formatter for this monorepo.
|
|
|
1395
1395
|
|
|
1396
1396
|
### Suppressing Rules
|
|
1397
1397
|
- Use \`// biome-ignore <rule>: <reason>\` for specific lines
|
|
1398
|
-
- Avoid blanket suppressions
|
|
1398
|
+
- Avoid blanket suppressions - prefer fixing the code
|
|
1399
1399
|
- Document why a suppression is needed
|
|
1400
1400
|
|
|
1401
1401
|
## Tailwind v4
|
|
@@ -1423,28 +1423,28 @@ RevealUI uses **Tailwind CSS v4** (\`^4.1.18\`). Key syntax changes from v3:
|
|
|
1423
1423
|
\`\`\`
|
|
1424
1424
|
|
|
1425
1425
|
\`\`\`html
|
|
1426
|
-
<!-- CORRECT (v4)
|
|
1426
|
+
<!-- CORRECT (v4) - parentheses for CSS vars -->
|
|
1427
1427
|
<div class="bg-(--brand-color)">
|
|
1428
1428
|
|
|
1429
|
-
<!-- WRONG (v3)
|
|
1429
|
+
<!-- WRONG (v3) - square brackets -->
|
|
1430
1430
|
<div class="bg-[--brand-color]">
|
|
1431
1431
|
\`\`\`
|
|
1432
1432
|
|
|
1433
1433
|
\`\`\`html
|
|
1434
|
-
<!-- CORRECT (v4)
|
|
1434
|
+
<!-- CORRECT (v4) - important at the end -->
|
|
1435
1435
|
<div class="bg-red-500!">
|
|
1436
1436
|
|
|
1437
|
-
<!-- WRONG (v3)
|
|
1437
|
+
<!-- WRONG (v3) - important at the start -->
|
|
1438
1438
|
<div class="bg-!red-500">
|
|
1439
1439
|
\`\`\`
|
|
1440
1440
|
|
|
1441
1441
|
### Rules for New Code
|
|
1442
|
-
1. Never use \`@tailwind\` directives
|
|
1443
|
-
2. Never use \`@layer utilities\` or \`@layer components\`
|
|
1442
|
+
1. Never use \`@tailwind\` directives - use \`@import "tailwindcss"\`
|
|
1443
|
+
2. Never use \`@layer utilities\` or \`@layer components\` - use \`@utility\`
|
|
1444
1444
|
3. Use \`bg-(--var)\` syntax for CSS variables, not \`bg-[--var]\`
|
|
1445
1445
|
4. Important goes at the end: \`bg-red-500!\` not \`!bg-red-500\`
|
|
1446
1446
|
5. Prefer \`gap\` over \`space-*\` / \`divide-*\` for spacing in flex/grid
|
|
1447
|
-
6. No \`transform-none\`
|
|
1447
|
+
6. No \`transform-none\` - use \`scale-none\`, \`rotate-none\`, \`translate-none\`
|
|
1448
1448
|
|
|
1449
1449
|
## Parameterization
|
|
1450
1450
|
|
|
@@ -1578,19 +1578,19 @@ RevealUI uses **two databases with strictly separated responsibilities**:
|
|
|
1578
1578
|
**\`@supabase/supabase-js\` must only be imported inside designated vector/auth modules:**
|
|
1579
1579
|
|
|
1580
1580
|
### Allowed paths for Supabase imports
|
|
1581
|
-
- \`packages/db/src/vector/\`
|
|
1582
|
-
- \`packages/db/src/auth/\`
|
|
1583
|
-
- \`packages/auth/src/\`
|
|
1584
|
-
- \`packages/ai/src/\`
|
|
1585
|
-
- \`packages/services/src/supabase/\`
|
|
1586
|
-
- \`apps/*/src/lib/supabase/\`
|
|
1581
|
+
- \`packages/db/src/vector/\` - vector schema and queries
|
|
1582
|
+
- \`packages/db/src/auth/\` - Supabase auth helpers
|
|
1583
|
+
- \`packages/auth/src/\` - authentication implementation
|
|
1584
|
+
- \`packages/ai/src/\` - AI memory and embedding storage
|
|
1585
|
+
- \`packages/services/src/supabase/\` - Supabase service integrations
|
|
1586
|
+
- \`apps/*/src/lib/supabase/\` - app-level Supabase utilities
|
|
1587
1587
|
|
|
1588
1588
|
### Forbidden: Supabase imports in
|
|
1589
|
-
- \`packages/core/\`
|
|
1590
|
-
- \`packages/contracts/\`
|
|
1591
|
-
- \`packages/config/\`
|
|
1592
|
-
- \`apps/admin/src/collections/\`
|
|
1593
|
-
- \`apps/admin/src/routes/\`
|
|
1589
|
+
- \`packages/core/\` - admin engine must be DB-agnostic
|
|
1590
|
+
- \`packages/contracts/\` - contracts are schema-only
|
|
1591
|
+
- \`packages/config/\` - config must not hardcode DB client
|
|
1592
|
+
- \`apps/admin/src/collections/\` - collection hooks use Drizzle/Neon only
|
|
1593
|
+
- \`apps/admin/src/routes/\` - REST routes use Neon only
|
|
1594
1594
|
|
|
1595
1595
|
## Schema Organization
|
|
1596
1596
|
|
|
@@ -1625,7 +1625,7 @@ const { data } = await supabase.rpc('match_documents', { query_embedding: embedd
|
|
|
1625
1625
|
## Enforcement
|
|
1626
1626
|
|
|
1627
1627
|
The \`pnpm validate:structure\` script checks for Supabase imports outside permitted paths.
|
|
1628
|
-
CI runs this as part of phase 1 (warn-only
|
|
1628
|
+
CI runs this as part of phase 1 (warn-only - violations are flagged but don't block builds).
|
|
1629
1629
|
|
|
1630
1630
|
To check locally:
|
|
1631
1631
|
\`\`\`bash
|
|
@@ -1674,7 +1674,7 @@ When something breaks, follow this process. Do not skip steps.
|
|
|
1674
1674
|
|
|
1675
1675
|
- Design a test or check that confirms/refutes your hypothesis
|
|
1676
1676
|
- Run it
|
|
1677
|
-
- If refuted, form a new hypothesis
|
|
1677
|
+
- If refuted, form a new hypothesis - do not stack unrelated fixes
|
|
1678
1678
|
|
|
1679
1679
|
### 4. Fix Narrowly
|
|
1680
1680
|
|
|
@@ -1707,9 +1707,9 @@ When something breaks, follow this process. Do not skip steps.
|
|
|
1707
1707
|
| Symptom | First Check |
|
|
1708
1708
|
|---------|------------|
|
|
1709
1709
|
| Import error | Package built? \`pnpm --filter <pkg> build\` |
|
|
1710
|
-
| Type error across packages | \`pnpm typecheck:all\`
|
|
1711
|
-
| Test passes alone, fails in gate | Concurrency pressure
|
|
1712
|
-
| Supabase error in unexpected path | Import boundary violation
|
|
1710
|
+
| Type error across packages | \`pnpm typecheck:all\` - check \`workspace:*\` versions |
|
|
1711
|
+
| Test passes alone, fails in gate | Concurrency pressure - see \`$revealui-testing\` |
|
|
1712
|
+
| Supabase error in unexpected path | Import boundary violation - see \`$revealui-db\` |
|
|
1713
1713
|
| Biome error after edit | Run \`npx biome check --write <file>\` |`
|
|
1714
1714
|
};
|
|
1715
1715
|
|
|
@@ -1736,10 +1736,10 @@ Run each command and confirm clean output:
|
|
|
1736
1736
|
# 1. Biome lint + format
|
|
1737
1737
|
pnpm lint
|
|
1738
1738
|
|
|
1739
|
-
# 2. TypeScript
|
|
1739
|
+
# 2. TypeScript - all packages
|
|
1740
1740
|
pnpm typecheck:all
|
|
1741
1741
|
|
|
1742
|
-
# 3. Tests
|
|
1742
|
+
# 3. Tests - affected packages
|
|
1743
1743
|
pnpm --filter <package> test
|
|
1744
1744
|
|
|
1745
1745
|
# 4. Quick gate (lint + typecheck + structure)
|
|
@@ -1758,7 +1758,7 @@ pnpm gate:quick
|
|
|
1758
1758
|
- [ ] No \`console.*\` in production code (use \`@revealui/utils\` logger)
|
|
1759
1759
|
- [ ] No hardcoded config values (use parameterization pattern)
|
|
1760
1760
|
- [ ] No unused variables/imports (follow decision tree if flagged)
|
|
1761
|
-
- [ ] Single responsibility
|
|
1761
|
+
- [ ] Single responsibility - each file does one thing
|
|
1762
1762
|
|
|
1763
1763
|
### Architecture
|
|
1764
1764
|
- [ ] No Supabase imports outside permitted paths
|
|
@@ -1785,7 +1785,7 @@ var revealuiSafetySkill = {
|
|
|
1785
1785
|
id: "revealui-safety",
|
|
1786
1786
|
tier: "oss",
|
|
1787
1787
|
name: "RevealUI Safety",
|
|
1788
|
-
description: "RevealUI safety guardrails for any code task
|
|
1788
|
+
description: "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.",
|
|
1789
1789
|
disableModelInvocation: false,
|
|
1790
1790
|
skipFrontmatter: false,
|
|
1791
1791
|
filePatterns: [],
|
|
@@ -1795,15 +1795,15 @@ var revealuiSafetySkill = {
|
|
|
1795
1795
|
|
|
1796
1796
|
Follow these rules for ALL code changes in the RevealUI monorepo.
|
|
1797
1797
|
|
|
1798
|
-
## Protected Files
|
|
1798
|
+
## Protected Files - Ask Before Editing
|
|
1799
1799
|
|
|
1800
1800
|
- \`.env*\` files (\`.env\`, \`.env.local\`, \`.env.production\`, etc.)
|
|
1801
1801
|
- Lock files: \`pnpm-lock.yaml\`, \`package-lock.json\`, \`yarn.lock\`
|
|
1802
|
-
- Database schema files in \`packages/db/src/schema/\`
|
|
1802
|
+
- Database schema files in \`packages/db/src/schema/\` - changes require migration planning
|
|
1803
1803
|
|
|
1804
|
-
## Protected Paths
|
|
1804
|
+
## Protected Paths - Never Edit
|
|
1805
1805
|
|
|
1806
|
-
- \`/mnt/c/\`, \`/mnt/e/\`
|
|
1806
|
+
- \`/mnt/c/\`, \`/mnt/e/\` - Windows mounts (read-only)
|
|
1807
1807
|
- System/credential directories: \`/etc/\`, \`~/.ssh/\`, \`~/.gnupg/\`, \`~/.aws/\`
|
|
1808
1808
|
|
|
1809
1809
|
## Import Boundaries
|
|
@@ -1819,8 +1819,8 @@ FORBIDDEN in: \`packages/core/\`, \`packages/contracts/\`, \`packages/config/\`,
|
|
|
1819
1819
|
|
|
1820
1820
|
## Code Quality
|
|
1821
1821
|
|
|
1822
|
-
- Never use \`any\`
|
|
1823
|
-
- Never add \`console.*\` in production code
|
|
1822
|
+
- Never use \`any\` - use \`unknown\` + type guards
|
|
1823
|
+
- Never add \`console.*\` in production code - use \`@revealui/utils\` logger
|
|
1824
1824
|
- Never hardcode API keys, tokens, passwords, or secrets
|
|
1825
1825
|
- Use \`crypto.randomInt()\` for security-sensitive values, not \`Math.random()\`
|
|
1826
1826
|
|
|
@@ -1862,12 +1862,12 @@ Follow this cycle for every code change. No exceptions.
|
|
|
1862
1862
|
|
|
1863
1863
|
## The Cycle
|
|
1864
1864
|
|
|
1865
|
-
1. **Write a failing test**
|
|
1866
|
-
2. **Run it**
|
|
1867
|
-
3. **Write minimal implementation**
|
|
1868
|
-
4. **Run it**
|
|
1869
|
-
5. **Refactor**
|
|
1870
|
-
6. **Commit**
|
|
1865
|
+
1. **Write a failing test** - describe the expected behavior
|
|
1866
|
+
2. **Run it** - confirm it fails for the right reason
|
|
1867
|
+
3. **Write minimal implementation** - just enough to pass
|
|
1868
|
+
4. **Run it** - confirm it passes
|
|
1869
|
+
5. **Refactor** - clean up, then run tests again
|
|
1870
|
+
6. **Commit** - one commit per cycle
|
|
1871
1871
|
|
|
1872
1872
|
## Commands
|
|
1873
1873
|
|
|
@@ -2181,197 +2181,8 @@ function buildManifest() {
|
|
|
2181
2181
|
};
|
|
2182
2182
|
}
|
|
2183
2183
|
|
|
2184
|
-
// src/content/resolvers/environment.ts
|
|
2185
|
-
var NODE_VERSION = (ctx) => ctx.nodeVersion ?? "24";
|
|
2186
|
-
var PACKAGE_MANAGER = (ctx) => ctx.packageManager ?? "pnpm 10";
|
|
2187
|
-
var STACK = () => "React 19, Next.js 16, Node 24, TypeScript 5.9, Drizzle ORM, Hono, Tailwind v4";
|
|
2188
|
-
|
|
2189
|
-
// src/content/resolvers/project.ts
|
|
2190
|
-
var PROJECT_NAME = (ctx) => ctx.projectName ?? "RevealUI";
|
|
2191
|
-
var PHASE = (ctx) => ctx.phase ?? "Phase 3 \u2014 Launch Preparation";
|
|
2192
|
-
var BRANCH_PIPELINE = () => "feature/* \u2192 develop \u2192 test \u2192 main (production)";
|
|
2193
|
-
var LICENSE_TIERS = () => "free | pro | max | enterprise";
|
|
2194
|
-
|
|
2195
|
-
// src/content/resolvers/index.ts
|
|
2196
|
-
var registry = /* @__PURE__ */ new Map([
|
|
2197
|
-
["PROJECT_NAME", PROJECT_NAME],
|
|
2198
|
-
["PHASE", PHASE],
|
|
2199
|
-
["BRANCH_PIPELINE", BRANCH_PIPELINE],
|
|
2200
|
-
["LICENSE_TIERS", LICENSE_TIERS],
|
|
2201
|
-
["NODE_VERSION", NODE_VERSION],
|
|
2202
|
-
["PACKAGE_MANAGER", PACKAGE_MANAGER],
|
|
2203
|
-
["STACK", STACK]
|
|
2204
|
-
]);
|
|
2205
|
-
function registerResolver(key, fn) {
|
|
2206
|
-
registry.set(key, fn);
|
|
2207
|
-
}
|
|
2208
|
-
function resolveTemplate(template, ctx) {
|
|
2209
|
-
return template.replace(/\{\{(\w+)\}\}/g, (_match, key) => {
|
|
2210
|
-
const fn = registry.get(key);
|
|
2211
|
-
return fn ? fn(ctx) : `{{${key}}}`;
|
|
2212
|
-
});
|
|
2213
|
-
}
|
|
2214
|
-
function listResolvers() {
|
|
2215
|
-
return [...registry.keys()];
|
|
2216
|
-
}
|
|
2217
|
-
|
|
2218
|
-
// src/content/generators/claude.ts
|
|
2219
|
-
function buildFrontmatter(fields) {
|
|
2220
|
-
const lines = ["---"];
|
|
2221
|
-
for (const [key, value] of Object.entries(fields)) {
|
|
2222
|
-
if (value === void 0) continue;
|
|
2223
|
-
if (typeof value === "boolean") {
|
|
2224
|
-
lines.push(`${key}: ${value}`);
|
|
2225
|
-
} else if (value.includes("\n")) {
|
|
2226
|
-
lines.push(`${key}: |`);
|
|
2227
|
-
for (const line of value.split("\n")) {
|
|
2228
|
-
lines.push(` ${line}`);
|
|
2229
|
-
}
|
|
2230
|
-
} else {
|
|
2231
|
-
lines.push(`${key}: ${value}`);
|
|
2232
|
-
}
|
|
2233
|
-
}
|
|
2234
|
-
lines.push("---");
|
|
2235
|
-
return lines.join("\n");
|
|
2236
|
-
}
|
|
2237
|
-
var ClaudeCodeGenerator = class {
|
|
2238
|
-
id = "claude-code";
|
|
2239
|
-
outputDir = ".claude";
|
|
2240
|
-
generateRule(rule, ctx) {
|
|
2241
|
-
const content = resolveTemplate(rule.content, ctx);
|
|
2242
|
-
return [
|
|
2243
|
-
{
|
|
2244
|
-
relativePath: `.claude/rules/${rule.id}.md`,
|
|
2245
|
-
content: `${content}
|
|
2246
|
-
`
|
|
2247
|
-
}
|
|
2248
|
-
];
|
|
2249
|
-
}
|
|
2250
|
-
generateCommand(cmd, ctx) {
|
|
2251
|
-
const content = resolveTemplate(cmd.content, ctx);
|
|
2252
|
-
const frontmatter = buildFrontmatter({
|
|
2253
|
-
description: cmd.description,
|
|
2254
|
-
"disable-model-invocation": cmd.disableModelInvocation || void 0,
|
|
2255
|
-
"argument-hint": cmd.argumentHint
|
|
2256
|
-
});
|
|
2257
|
-
return [
|
|
2258
|
-
{
|
|
2259
|
-
relativePath: `.claude/commands/${cmd.id}.md`,
|
|
2260
|
-
content: `${frontmatter}
|
|
2261
|
-
|
|
2262
|
-
${content}
|
|
2263
|
-
`
|
|
2264
|
-
}
|
|
2265
|
-
];
|
|
2266
|
-
}
|
|
2267
|
-
generateAgent(agent, ctx) {
|
|
2268
|
-
const content = resolveTemplate(agent.content, ctx);
|
|
2269
|
-
const frontmatter = buildFrontmatter({
|
|
2270
|
-
name: agent.id,
|
|
2271
|
-
description: agent.description,
|
|
2272
|
-
isolation: agent.isolation === "none" ? void 0 : agent.isolation
|
|
2273
|
-
});
|
|
2274
|
-
return [
|
|
2275
|
-
{
|
|
2276
|
-
relativePath: `.claude/agents/${agent.id}.md`,
|
|
2277
|
-
content: `${frontmatter}
|
|
2278
|
-
|
|
2279
|
-
${content}
|
|
2280
|
-
`
|
|
2281
|
-
}
|
|
2282
|
-
];
|
|
2283
|
-
}
|
|
2284
|
-
generateSkill(skill, ctx) {
|
|
2285
|
-
const content = resolveTemplate(skill.content, ctx);
|
|
2286
|
-
const files = [];
|
|
2287
|
-
if (skill.skipFrontmatter) {
|
|
2288
|
-
files.push({
|
|
2289
|
-
relativePath: `.claude/skills/${skill.id}/SKILL.md`,
|
|
2290
|
-
content: `${content}
|
|
2291
|
-
`
|
|
2292
|
-
});
|
|
2293
|
-
} else {
|
|
2294
|
-
const frontmatter = buildFrontmatter({
|
|
2295
|
-
name: skill.id,
|
|
2296
|
-
description: skill.description,
|
|
2297
|
-
"disable-model-invocation": skill.disableModelInvocation || void 0
|
|
2298
|
-
});
|
|
2299
|
-
files.push({
|
|
2300
|
-
relativePath: `.claude/skills/${skill.id}/SKILL.md`,
|
|
2301
|
-
content: `${frontmatter}
|
|
2302
|
-
|
|
2303
|
-
${content}
|
|
2304
|
-
`
|
|
2305
|
-
});
|
|
2306
|
-
}
|
|
2307
|
-
for (const [name, refContent] of Object.entries(skill.references)) {
|
|
2308
|
-
files.push({
|
|
2309
|
-
relativePath: `.claude/skills/${skill.id}/references/${name}.md`,
|
|
2310
|
-
content: `${resolveTemplate(refContent, ctx)}
|
|
2311
|
-
`
|
|
2312
|
-
});
|
|
2313
|
-
}
|
|
2314
|
-
return files;
|
|
2315
|
-
}
|
|
2316
|
-
generateAll(manifest, ctx) {
|
|
2317
|
-
const files = [];
|
|
2318
|
-
for (const rule of manifest.rules) {
|
|
2319
|
-
files.push(...this.generateRule(rule, ctx));
|
|
2320
|
-
}
|
|
2321
|
-
for (const cmd of manifest.commands) {
|
|
2322
|
-
files.push(...this.generateCommand(cmd, ctx));
|
|
2323
|
-
}
|
|
2324
|
-
for (const agent of manifest.agents) {
|
|
2325
|
-
files.push(...this.generateAgent(agent, ctx));
|
|
2326
|
-
}
|
|
2327
|
-
for (const skill of manifest.skills) {
|
|
2328
|
-
files.push(...this.generateSkill(skill, ctx));
|
|
2329
|
-
}
|
|
2330
|
-
return files;
|
|
2331
|
-
}
|
|
2332
|
-
};
|
|
2333
|
-
|
|
2334
|
-
// src/content/generators/cursor.ts
|
|
2335
|
-
var CursorGenerator = class {
|
|
2336
|
-
id = "cursor";
|
|
2337
|
-
outputDir = ".cursor";
|
|
2338
|
-
generateRule(rule, ctx) {
|
|
2339
|
-
const content = resolveTemplate(rule.content, ctx);
|
|
2340
|
-
return [
|
|
2341
|
-
{
|
|
2342
|
-
relativePath: `.cursor/rules/${rule.id}.mdc`,
|
|
2343
|
-
content: `---
|
|
2344
|
-
description: ${rule.description}
|
|
2345
|
-
---
|
|
2346
|
-
|
|
2347
|
-
${content}
|
|
2348
|
-
`
|
|
2349
|
-
}
|
|
2350
|
-
];
|
|
2351
|
-
}
|
|
2352
|
-
generateCommand(_cmd, _ctx) {
|
|
2353
|
-
return [];
|
|
2354
|
-
}
|
|
2355
|
-
generateAgent(_agent, _ctx) {
|
|
2356
|
-
return [];
|
|
2357
|
-
}
|
|
2358
|
-
generateSkill(_skill, _ctx) {
|
|
2359
|
-
return [];
|
|
2360
|
-
}
|
|
2361
|
-
generateAll(manifest, ctx) {
|
|
2362
|
-
const files = [];
|
|
2363
|
-
for (const rule of manifest.rules) {
|
|
2364
|
-
files.push(...this.generateRule(rule, ctx));
|
|
2365
|
-
}
|
|
2366
|
-
return files;
|
|
2367
|
-
}
|
|
2368
|
-
};
|
|
2369
|
-
|
|
2370
2184
|
// src/content/generators/index.ts
|
|
2371
|
-
var generators = /* @__PURE__ */ new Map(
|
|
2372
|
-
["claude-code", new ClaudeCodeGenerator()],
|
|
2373
|
-
["cursor", new CursorGenerator()]
|
|
2374
|
-
]);
|
|
2185
|
+
var generators = /* @__PURE__ */ new Map();
|
|
2375
2186
|
function getGenerator(id) {
|
|
2376
2187
|
return generators.get(id);
|
|
2377
2188
|
}
|
|
@@ -2439,7 +2250,7 @@ var SkillSchema = z5.object({
|
|
|
2439
2250
|
description: z5.string().min(1),
|
|
2440
2251
|
tier: z5.enum(["oss", "pro"]).default("oss"),
|
|
2441
2252
|
disableModelInvocation: z5.boolean().default(false),
|
|
2442
|
-
/** When true, the generator omits YAML frontmatter
|
|
2253
|
+
/** When true, the generator omits YAML frontmatter - the content IS the entire file. */
|
|
2443
2254
|
skipFrontmatter: z5.boolean().default(false),
|
|
2444
2255
|
filePatterns: z5.array(z5.string()).default([]),
|
|
2445
2256
|
bashPatterns: z5.array(z5.string()).default([]),
|
|
@@ -2458,6 +2269,40 @@ var ManifestSchema = z6.object({
|
|
|
2458
2269
|
preambles: z6.array(PreambleTierSchema)
|
|
2459
2270
|
});
|
|
2460
2271
|
|
|
2272
|
+
// src/content/resolvers/environment.ts
|
|
2273
|
+
var NODE_VERSION = (ctx) => ctx.nodeVersion ?? "24";
|
|
2274
|
+
var PACKAGE_MANAGER = (ctx) => ctx.packageManager ?? "pnpm 10";
|
|
2275
|
+
var STACK = () => "React 19, Next.js 16, Node 24, TypeScript 5.9, Drizzle ORM, Hono, Tailwind v4";
|
|
2276
|
+
|
|
2277
|
+
// src/content/resolvers/project.ts
|
|
2278
|
+
var PROJECT_NAME = (ctx) => ctx.projectName ?? "RevealUI";
|
|
2279
|
+
var PHASE = (ctx) => ctx.phase ?? "Phase 3 - Launch Preparation";
|
|
2280
|
+
var BRANCH_PIPELINE = () => "feature/* \u2192 develop \u2192 test \u2192 main (production)";
|
|
2281
|
+
var LICENSE_TIERS = () => "free | pro | max | enterprise";
|
|
2282
|
+
|
|
2283
|
+
// src/content/resolvers/index.ts
|
|
2284
|
+
var registry = /* @__PURE__ */ new Map([
|
|
2285
|
+
["PROJECT_NAME", PROJECT_NAME],
|
|
2286
|
+
["PHASE", PHASE],
|
|
2287
|
+
["BRANCH_PIPELINE", BRANCH_PIPELINE],
|
|
2288
|
+
["LICENSE_TIERS", LICENSE_TIERS],
|
|
2289
|
+
["NODE_VERSION", NODE_VERSION],
|
|
2290
|
+
["PACKAGE_MANAGER", PACKAGE_MANAGER],
|
|
2291
|
+
["STACK", STACK]
|
|
2292
|
+
]);
|
|
2293
|
+
function registerResolver(key, fn) {
|
|
2294
|
+
registry.set(key, fn);
|
|
2295
|
+
}
|
|
2296
|
+
function resolveTemplate(template, ctx) {
|
|
2297
|
+
return template.replace(/\{\{(\w+)\}\}/g, (_match, key) => {
|
|
2298
|
+
const fn = registry.get(key);
|
|
2299
|
+
return fn ? fn(ctx) : `{{${key}}}`;
|
|
2300
|
+
});
|
|
2301
|
+
}
|
|
2302
|
+
function listResolvers() {
|
|
2303
|
+
return [...registry.keys()];
|
|
2304
|
+
}
|
|
2305
|
+
|
|
2461
2306
|
// src/content/index.ts
|
|
2462
2307
|
function validateManifest(manifest) {
|
|
2463
2308
|
const result = ManifestSchema.safeParse(manifest);
|
|
@@ -2517,9 +2362,6 @@ function listContent(manifest) {
|
|
|
2517
2362
|
|
|
2518
2363
|
export {
|
|
2519
2364
|
buildManifest,
|
|
2520
|
-
registerResolver,
|
|
2521
|
-
resolveTemplate,
|
|
2522
|
-
listResolvers,
|
|
2523
2365
|
getGenerator,
|
|
2524
2366
|
registerGenerator,
|
|
2525
2367
|
listGenerators,
|
|
@@ -2529,9 +2371,11 @@ export {
|
|
|
2529
2371
|
RuleSchema,
|
|
2530
2372
|
SkillSchema,
|
|
2531
2373
|
ManifestSchema,
|
|
2374
|
+
registerResolver,
|
|
2375
|
+
resolveTemplate,
|
|
2376
|
+
listResolvers,
|
|
2532
2377
|
validateManifest,
|
|
2533
2378
|
generateContent,
|
|
2534
2379
|
diffContent,
|
|
2535
2380
|
listContent
|
|
2536
2381
|
};
|
|
2537
|
-
//# sourceMappingURL=chunk-PROC6EJC.js.map
|