Skip to content

chore(docs): consolidate agent instructions under CLAUDE.md - #71

Merged
pras75299 merged 2 commits into
mainfrom
chore/a1-a2-agent-docs
May 31, 2026
Merged

pras75299 merged 2 commits into
mainfrom
chore/a1-a2-agent-docs

Conversation

@pras75299

@pras75299 pras75299 commented May 31, 2026 •

Copy link
Copy Markdown
Owner

Type

  • New component / block (registry)
  • CLI change (init / add / list / info / doctor / search / shadcn JSON)
  • Docs site (apps/www)
  • Build / scripts / CI
  • Bug fix
  • Refactor / chore

Summary

Implements backlog A5 / ADR 0005: splits the 3,829-line registry/demos.tsx monolith into per-slug demo.tsx fragments assembled at build time, eliminating the last high-conflict shared registry file for new components.

Deleted

  • registry/demos.tsx

New layout

Path Role
registry/demos/shared.tsx Shared imports, helpers, types — preamble for assembled output
registry/demos/demo-key-order.json Stable ordering of 84 componentDemos keys
registry/{slug}/demo.tsx Per-component demo entries (export const demoEntries = { … })
registry/blocks/hero/{slug}/demo.tsx Hero block demos (8 fragments)

Build pipeline

  • scripts/assemble-demos.ts — globs registry/**/demo.tsx, merges demoEntries bodies in demo-key-order.json order, emits full componentDemos map
  • scripts/build-registry.ts — renderDemosConfig() calls assembleDemosSource() instead of reading a single monolith file
  • scripts/split-demos.mjs — one-time codemod that produced the split (kept for history/re-runs)

Regression gate: assembled output must match generated apps/www/config/demos.tsx byte-for-byte (banner stripped). Parser handles quoted/bare keys, section comments, and comma-split at brace/paren/bracket depth 0 (commas inside JSX text do not split entries).

Contributor workflow updates: CLAUDE.md, .claude/skills/add-component/SKILL.md, scripts/scaffold-component.mjs, and .cursor/rules/coderabbit-review-patterns.mdc now point at registry/{slug}/demo.tsx + demo-key-order.json.

Output guarantee: no diff in registry.json or apps/www/public/registry/* — demos refactor only affects docs preview assembly.

Screenshots / video (UI changes only)

N/A — structural refactor only. Docs previews should render identically; no component source or visual behavior changes.

Test plan

  • pnpm test — turbo: @uniqueui/registry-schema, @uniqueui/cli-core, www, uniqueui-cli
  • pnpm build:registry — succeeds; regenerates apps/www/config/demos.tsx from fragments
  • pnpm --filter uniqueui-cli build — not run; no CLI package changes
  • Manually verified in apps/www dev server — not run (byte-identical assembly is the gate)

Additional checks

  • pnpm test:repo — 48 passed (assemble-demos 2 tests: byte parity with generated demos + all keys in demo-key-order.json)
  • apps/www component-sync.test.ts — updated to assert assembleDemosSource() matches generated config/demos.tsx
  • registry.json — zero diff vs main (confirmed)

New component checklist

Skip — no new components. Updated workflow for future PRs:

  1. Add demo entries to registry/{slug}/demo.tsx (or registry/blocks/hero/{slug}/demo.tsx for hero blocks)
  2. Append new demo key(s) to registry/demos/demo-key-order.json
  3. Put shared imports/helpers in registry/demos/shared.tsx only when reused across demos
  4. Run pnpm build:registry — do not edit apps/www/config/demos.tsx by hand

Related issues

Implements A5 from backlogs.md (split registry/demos.tsx). Follow-up called out in docs/adr/0003-fold-metadata-into-slug-manifests.md.

Not in this PR: changelogs monolith split (changelogs.json → per-slug manifest field); optional per-slug default export shape (fragments use demoEntries map for multi-key slugs like scenario demoKeys).

Commits (1)

Commit Message
cef648b ref(registry): split demos monolith into per-slug demo.tsx fragments

Summary by CodeRabbit

  • Chores

    • Consolidated agent instruction documentation files to reference a canonical source, reducing duplication and improving maintainability.
    • Updated CI/CD pipeline to validate instruction file consistency.
  • Tests

    • Added validation tests to ensure agent instruction files remain synchronized with the canonical reference.

@vercel

vercel Bot commented May 31, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
uniqueui-platform Ready Ready Preview, Comment May 31, 2026 1:50pm

@coderabbitai

coderabbitai Bot commented May 31, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@pras75299, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 24 minutes and 17 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9ac27875-dfa3-4024-9744-f561ef42b00d

📥 Commits

Reviewing files that changed from the base of the PR and between 8112e14 and c579fca.

📒 Files selected for processing (4)
  • .cursor/rules/coderabbit-review-patterns.mdc
  • CLAUDE.md
  • scripts/check-agent-docs-drift.mjs
  • scripts/check-agent-docs-drift.test.ts
📝 Walkthrough

Walkthrough

PR consolidates scattered agent-instruction rules into a single canonical source in CLAUDE.md by replacing detailed agent configs across five files with thin pointers, then enforces pointer synchronization via a new Node-based drift checker integrated into CI and test pipelines.

Changes

Agent Instruction Centralization

Layer / File(s) Summary
Drift detection policy and validation system
scripts/check-agent-docs-drift.mjs, scripts/check-agent-docs-drift.test.ts
New Node CLI enforces that pointer files (.cursorrules, .windsurfrules, AGENTS.md, GEMINI.md) remain aligned with CLAUDE.md. Defines policy constants for allowed files, maximum non-empty line count, canonical reference pattern, and stale-duplicate detection regexes; validates each pointer file and ensures all pointers are byte-identical.
Consolidated agent instruction pointers and canonical content
.cursorrules, .windsurfrules, AGENTS.md, GEMINI.md, CLAUDE.md
Four agent-config files replaced with brief pointers to CLAUDE.md as canonical source; removes duplicate MCP tool and workflow guidance previously embedded in each. CLAUDE.md expanded with structural-context guidance, clarified when to use graph tools vs. Grep/Glob/Read, documented limited-data tool availability, and updated the Key Tools reference table.
CI and npm script integration
.github/workflows/ci.yml, package.json
New check:agent-docs npm script runs the drift checker; test-and-lint CI job gains a step to run the checker after the CLI build; test:repo script now includes the drift test alongside existing repository checks.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 Scattered rules once lived alone,
Each file a kingdom of its own.
Now pointers point to CLAUDE, true,
And drift detection keeps them glued!
One source to rule them all—phew! 🎉

🚥 Pre-merge checks | ✅ 2 | ❌ 3

❌ Failed checks (3 warnings)

Check name Status Explanation Resolution
Title check ⚠️ Warning The PR title mentions consolidating agent instructions under CLAUDE.md, but the actual changeset is about splitting the registry/demos.tsx monolith into per-slug fragments and updating the build pipeline. Update the PR title to accurately reflect the main change: 'ref(registry): split demos monolith into per-slug demo.tsx fragments' or similar, matching the actual diff content.
Description check ⚠️ Warning The PR description is about splitting registry/demos.tsx monolith into per-slug fragments (backlog A5/ADR 0005), but the PR title and raw_summary indicate the actual changes are consolidating agent instruction files under CLAUDE.md. There is a critical mismatch between title and content. Align the PR description with the actual changeset. Either revert to the correct demos-splitting description, or confirm if this is truly an agent-docs consolidation PR and update all sections accordingly.
Docstring Coverage ⚠️ Warning Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/a1-a2-agent-docs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@pras75299
pras75299 merged commit 882cf02 into main May 31, 2026
12 checks passed

This branch was successfully deployed

1 active deployment
Preview — c579fcaa Deployed May 31, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant