Skip to content

feat(design): add agent-consumable design surface#336

Open
bntvllnt wants to merge 7 commits into
mainfrom
feat/issue-250-design-surface
Open

feat(design): add agent-consumable design surface#336
bntvllnt wants to merge 7 commits into
mainfrom
feat/issue-250-design-surface

Conversation

@bntvllnt
Copy link
Copy Markdown
Collaborator

@bntvllnt bntvllnt commented May 12, 2026

Summary

  • Added packages/design/tokens.json with schema/docs and mirrored it at /r/design.json.
  • Added /design and /design.txt to expose the root design guide through the registry site, with TOC, metadata, sitemap, nav/footer, and llms integration.
  • Added Storybook design-token docs and design-rule references in AGENTS, CONTRIBUTING, and the PR template.
  • Fixed MDX markdown rendering so GitHub-flavored pipe tables render as real accessible <table> markup on /design, with regression coverage.
  • Declared the MDX/GFM runtime dependencies in package and registry metadata so copy-paste mdx-content consumers install the packages it imports.

Closes #250

Current Head / Validation Evidence

  • Current PR head for review: e457eaa35ec758074f4151c9844c7a6b820b3109.
  • This body refresh is metadata-only; no code changed after that head.
  • Live GitHub status check rollup at body refresh: terminal/green, 13 checks observed.
  • Current-head diff includes the GFM regression test for packages/ui/src/components/mdx-content/mdx-content.test.tsx, which renders a pipe table and verifies accessible table, columnheader, and cell roles.
  • Current-head diff includes remarkPlugins={markdownPlugins} on both package and registry MDXContent render paths so GitHub-flavored pipe tables render as tables rather than paragraph text.

Dependency Tradeoff Note

  • Runtime need: remark-gfm is imported by the shipped MDXContent runtime path in @vllnt/ui, so consumers need it installed when they use the component outside this monorepo; the registry mdx-content item also declares the package and MDX/markdown runtime dependencies for copy-paste installs.
  • Bundle/runtime impact: the added runtime surface is limited to the GFM parser plugin used by ReactMarkdown in MDXContent; it does not add a global app dependency path beyond consumers that render MDX/markdown content.
  • Maintenance surface: this keeps dependency metadata aligned with actual imports and adds one locked markdown plugin dependency to track with the existing MDX/ReactMarkdown stack.
  • Security posture: remark-gfm is a mature, lockfile-pinned markdown parsing plugin with no required network or filesystem access in this usage; it stays covered by normal dependency review/scanning and the existing markdown-rendering trust boundary.

Design Deviations

None.

@bntvllnt bntvllnt added documentation Improvements or additions to documentation enhancement New feature or request ai-agents AI agent discoverability (llms.txt, structured data, MCP) discoverability Site/library discoverability labels May 12, 2026
@bntvllnt bntvllnt self-assigned this May 12, 2026
Copy link
Copy Markdown
Collaborator Author

@bntvllnt bntvllnt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review verdict: BLOCKING

I found one release-blocking rendering issue in the new /design page.

Finding:

  • apps/registry/app/design/page.tsx:118 — DESIGN.md is rendered through MDXContent without GFM/table support. The built /design page renders the Markdown pipe tables as literal paragraph text (verified in apps/registry/.next/server/app/design.html), so the brand attributes, semantic tokens, typography, spacing, radius, elevation, component patterns, and anti-pattern tables are not actually usable on the public design guide. Since this PR is explicitly adding the human/agent-consumable design surface, the route needs to render DESIGN.md tables correctly before ship. Use a renderer path with remark-gfm/table support or otherwise map tables to proper HTML.

Validation evidence:

  • Head verified: 7183127 (matches task head).
  • git diff --check origin/main...HEAD: PASS.
  • pnpm install --frozen-lockfile --offline: PASS after initial missing node_modules.
  • pnpm -F @vllnt/ui-registry exec tsc --noEmit: PASS.
  • pnpm -F @vllnt/ui exec tsc --noEmit --project tsconfig.build.json: PASS.
  • Targeted registry eslint command from PR body: PASS.
  • pnpm -F @vllnt/ui-registry build: PASS and generated /design static output.
  • ReactMarkdown table probe without remark-gfm rendered a pipe table as a paragraph; generated .next/server/app/design.html contains literal "| Attribute | Value |" inside a

    .

  • Remote gh checks for PR #336 are green (Quality Gates, issue-link gate, Verify Stories, Storybook/visual, Vercel previews).

Note: GitHub rejected formal REQUEST_CHANGES because the authenticated account owns this PR, so this COMMENT review carries the blocking verdict.

accessibility, and component composition across the library.
</p>
</div>
<MDXContent
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DESIGN.md contains multiple pipe tables, but MDXContent currently falls back to react-markdown without remark-gfm; I verified the production build emits those tables as literal paragraph text (for example .next/server/app/design.html contains | Attribute | Value | inside a <p>). Because this PR is adding /design as the public human/agent-consumable design surface, this makes large parts of the guide (brand attributes, tokens, typography, spacing, anti-patterns) unreadable. Please render this route with GFM/table support (or map tables explicitly) before ship.

Copy link
Copy Markdown
Collaborator Author

@bntvllnt bntvllnt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review verdict: VERIFIED CLEAN for source remediation; external status remains blocking

I re-reviewed PR #336 at head d89952d after the GFM table and dependency-metadata follow-up.

Verified clean:

  • Original /design table blocker is fixed. Both MDXContent render paths import remark-gfm and pass it to ReactMarkdown via remarkPlugins:
    • packages/ui/src/components/mdx-content/mdx-content.tsx:5,139,210-223
    • apps/registry/registry/default/mdx-content/mdx-content.tsx:5,139,210-223
  • Regression coverage is present: packages/ui/src/components/mdx-content/mdx-content.test.tsx:7-24 renders a GFM pipe table and asserts table/columnheader/cell roles.
  • Dependency metadata follow-up is fixed:
    • packages/ui/package.json:145-146 declares react-markdown and remark-gfm in runtime dependencies.
    • apps/registry/registry.json:2293-2298 declares @vllnt/ui, @mdx-js/mdx, react-markdown, and remark-gfm for the mdx-content registry item.
    • pnpm-lock.yaml importer metadata includes remark-gfm under packages/ui dependencies.
  • PR body matches the current head and includes the dependency follow-up, refreshed validation, and the remaining Vercel caveat.

Validation run in a fresh review clone:

  • Head verified: d89952d.
  • gh pr checks: all GitHub/CodeQL/storybook/visual/quality checks pass except Vercel - ui.vllnt.ai, which is canceled from Vercel Dashboard.
  • git diff --check origin/main...HEAD: PASS.
  • pnpm install --frozen-lockfile --offline: PASS.
  • pnpm -F @vllnt/ui exec vitest run src/components/mdx-content/mdx-content.test.tsx: PASS (1 file, 1 test).
  • pnpm -F @vllnt/ui exec eslint src/components/mdx-content/mdx-content.tsx src/components/mdx-content/mdx-content.test.tsx: PASS.
  • pnpm -F @vllnt/ui exec tsc --noEmit --project tsconfig.build.json: PASS.
  • pnpm -F @vllnt/ui-registry exec eslint app/design/page.tsx app/design.txt/route.ts app/r/design.json/route.ts app/llms.txt/route.ts app/llms-full.txt/route.ts app/sitemap.ts components/header/header.tsx components/footer/footer.tsx lib/design-guide.ts --no-warn-ignored: PASS.
  • pnpm -F @vllnt/ui-registry exec tsc --noEmit: PASS.
  • pnpm -F @vllnt/ui-registry build: PASS; apps/registry/.next/server/app/design.html exists, contains , and does not contain the literal pipe-table text "| Attribute | Value |".

    Remaining blocker:

    • Non-code external: Vercel - ui.vllnt.ai is canceled/failed from the Vercel Dashboard. I found no remaining code blockers in the table/dependency remediation. This should be cleared or explicitly accepted before merge.

    Note: GitHub normally rejects formal APPROVE/REQUEST_CHANGES for this authenticated account on self-authored PRs, so this COMMENT review carries the review verdict.

Copy link
Copy Markdown
Collaborator Author

@bntvllnt bntvllnt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bntvllnt Review verdict: APPROVE recommended for reviewer triage — stale Vercel waived by PM decision

Head reviewed: d89952d8556ade303c6c63a22efd83202676f431

I re-checked the current status against the PM waiver in pm-decision.md: all GitHub Actions/code checks are green and Vercel – storybook is SUCCESS. The remaining Vercel – ui.vllnt.ai: FAILURE matches the accepted stale external UI preview status for reviewer triage only.

No new source-level blockers found beyond the prior current-head clean review. This is not merge/release approval and does not weaken branch protection; it only records that the stale UI preview status is waived for review triage under the PM decision.

@vllnt-pilot vllnt-pilot Bot had a problem deploying to Preview · pr-336-storybook May 18, 2026 17:15 Failure
@vllnt-pilot vllnt-pilot Bot had a problem deploying to Preview · pr-336-storybook May 18, 2026 17:21 Failure
@vllnt-pilot
Copy link
Copy Markdown

vllnt-pilot Bot commented May 18, 2026

Preview ready · Updated 2026-05-20T15:48:05Z

Service Status Preview
ui-registry Ready https://pr-336-ui-registry.preview.vllnt.ai
Inspect
  • Tailnet-only by default (not reachable from public internet)
  • Cert: real Let's Encrypt wildcard
  • Reply with /clean to destroy this preview now

@vllnt vllnt deleted a comment from vllnt-pilot Bot May 18, 2026
@vllnt vllnt deleted a comment from vercel Bot May 18, 2026
…r build context

The /design.txt static export failed in CI because DESIGN.md was never
copied into the Docker build context. Two surgical fixes:

1. Dockerfile: add `COPY DESIGN.md ./` so it is available during
   `RUN pnpm --filter @vllnt/ui-registry build`.
2. design-guide.ts: prepend a fileURLToPath-anchored candidate so
   path resolution is CWD-independent for any future invocation context.
bntvllnt

This comment was marked as outdated.

Copy link
Copy Markdown
Collaborator Author

@bntvllnt bntvllnt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review outcome: APPROVE recommended for human/manual approval.

I re-reviewed the prior metadata-only blocker on the live PR head e457eaa35ec758074f4151c9844c7a6b820b3109.

BLOCKING

  • None.

VERIFIED CLEAN

  • Live PR head still equals e457eaa35ec758074f4151c9844c7a6b820b3109; PR is OPEN, non-draft, MERGEABLE / CLEAN.
  • Prior R3 blocker is remediated: the PR body now cites the current head and no longer contains the stale earlier-head validation references 71831272d4fe817465186b3c32873c12884281ca, e828be4fbd02872fb305ccd3cb6426b612c6897e, or d89952d8556ade303c6c63a22efd83202676f431.
  • Prior dependency-policy gap is remediated: the PR body now includes a remark-gfm dependency tradeoff note covering runtime need, bundle/runtime impact, maintenance surface, and security posture.
  • Current check rollup is terminal green: 13 checks observed, no pending/failing checks.

VALIDATION

  • Re-fetched live PR metadata and reviews from GitHub immediately before this review.
  • Verified current-head/body remediation against AGENTS.md R3/R5/dependency-note requirements and docs/agents/RULES.md R3/R5/R6/out-of-scope dependency policy.
  • This pass is metadata-only. I did not mutate code, merge, publish, or release. Final GitHub approval remains reserved for bntvllnt.

@bntvllnt
Copy link
Copy Markdown
Collaborator Author

Review — 1 blocking process finding

BLOCKING

  • R3/R5/R4 — PR body is empty
    • Evidence: PR feat(design): add agent-consumable design surface #336 currently has no body content at HEAD e457eaa.
    • Why it matters: this repo's review gates require the PR body to match the current HEAD, link the backing issue, include concrete validation/manual UI evidence for UI-facing changes, list intentional design deviations, and explain any new dependency tradeoff. This PR adds a public /design page, /design.txt, /r/design.json, design tokens/schema, Storybook design-token docs, and a new remark-gfm dependency, but none of that is documented in the PR body.
    • Fix: refresh the PR body before re-requesting review. Include the linked issue (Related to #250 / Closes #250 or equivalent), summary, validation commands/status at this HEAD, manual/visual evidence for the new design surface, design-deviation status, and the remark-gfm dependency tradeoff.

WARN

  • W1 — token schema is only a shallow guard
    • Evidence: packages/design/tokens.schema.json validates only top-level token groups as generic objects.
    • Why it matters: this is acceptable as a first published contract if intentional, but the docs call the JSON/schema machine-readable. Consumers cannot currently validate semantic color token shape, typography scale entries, spacing/radius/motion keys, or required cssVariable/light/dark/role fields.
    • Suggested next step: either tighten the nested schema in this PR or explicitly call out that the schema is v0/top-level-only and track the nested contract follow-up.

VERIFIED CLEAN

  • Reviewed all 24 changed files against origin/main...HEAD at e457eaa35ec758074f4151c9844c7a6b820b3109.
  • The new GFM rendering path has a focused test and passed locally.
  • @vllnt/ui lint and build/type paths used by the changed package passed locally.
  • GitHub checks are green for this head.

VALIDATION

  • Ran: pnpm install --frozen-lockfile
  • Ran: pnpm -F @vllnt/ui exec vitest run src/components/mdx-content/mdx-content.test.tsx — pass
  • Ran: pnpm -F @vllnt/ui exec tsc --noEmit --project tsconfig.build.json — pass
  • Ran: pnpm --filter @vllnt/ui-registry build — pass; build emitted an existing-style Next workspace-root/NFT warning, no failure
  • Ran: pnpm -F @vllnt/ui lint — pass
  • Checked: gh pr checks 336 --repo vllnt/ui --watch=false — all reported checks pass

Requesting changes for the missing PR-body gate. Once the body is refreshed with issue link, validation/evidence, design deviation status, and dependency tradeoff, the code itself looks close.

Copy link
Copy Markdown
Collaborator Author

@bntvllnt bntvllnt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review — 1 finding (1 blocking, 0 warn)

Note: GitHub rejected REQUEST_CHANGES because the authenticated account is the PR author, so I am publishing this as a blocking COMMENT review instead. Treat this as request-changes-equivalent until the inline comment block is removed.

BLOCKING

  • T1 — Remove inline comments from shipped app code
    • Evidence: apps/registry/lib/design-guide.ts:10-15
    • Why it matters: AGENTS.md points reviewers to the blocking repo rules, and R10 says shipped code should not add inline // comments. This helper ships in the registry app, so keeping a six-line implementation note here leaves the PR violating the documented rule even though the functional gates are green.
    • Fix: remove the comment block and let the ordered DESIGN_FILE_CANDIDATES entries speak for themselves, or encode the context in clearer constant names if needed.

WARN

  • None.

VERIFIED CLEAN

  • Inspected all 24 changed files on head e457eaa35ec758074f4151c9844c7a6b820b3109: PR template, AGENTS/CONTRIBUTING/DESIGN docs, Dockerfile, design routes/page, llms routes, sitemap, header/footer links, design-guide helper, registry metadata, MDX GFM support, design token files/schema/docs, Storybook token story, package and lockfile changes.
  • The design guide is exposed through /design, /design.txt, /r/design.json, /llms.txt, /llms-full.txt, sitemap, header/footer links, and Docker build context.
  • MDXContent now uses remark-gfm in both the package source and registry copy, with a focused table rendering test.
  • PR remains linked to #250 and CI checks are green.

VALIDATION

  • Ran: pnpm install --frozen-lockfile --offline — passed.
  • Ran: git diff --check origin/main...HEAD — passed.
  • Ran: python3 JSON parse for packages/design/tokens.json, packages/design/tokens.schema.json, and apps/registry/registry.json — passed.
  • Ran: pnpm -F @vllnt/ui lint — passed.
  • Ran: pnpm -F @vllnt/ui exec tsc --noEmit --project tsconfig.build.json — passed.
  • Ran: pnpm test:once — passed, 217 files / 1216 tests.
  • Ran: pnpm build — passed; Next build emitted an existing-style NFT tracing warning but completed successfully.
  • Checked: gh pr checks 336 --repo vllnt/ui --watch=false — all listed checks passed, including Quality Gates, Storybook Tests, Visual Regression, CodeQL, deployments, and preview deploy.

Comment thread apps/registry/lib/design-guide.ts Outdated
readonly title: string;
};

// Candidate order:
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocking repo-rule issue: this is new shipped registry-app code, and R10 says not to add inline // comments in shipped code. Please remove this comment block (or make the fallback order self-explanatory with names) before merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-agents AI agent discoverability (llms.txt, structured data, MCP) discoverability Site/library discoverability documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add DESIGN.md + /design page + design.tokens.json (agent-consumable brand guide)

1 participant