-
Notifications
You must be signed in to change notification settings - Fork 6
Improve docs component reference #67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
mrcfps
wants to merge
111
commits into
main
Choose a base branch
from
feat/new-docs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 27 commits
Commits
Show all changes
111 commits
Select commit
Hold shift + click to select a range
ce91f3c
Ralph iteration 1: work in progress
mrcfps 729334f
Ralph iteration 2: work in progress
mrcfps d11ea19
Ralph iteration 3: work in progress
mrcfps a150fba
Ralph iteration 4: work in progress
mrcfps 16a4321
Ralph iteration 5: work in progress
mrcfps 49b04d0
Ralph iteration 6: work in progress
mrcfps a5e82c6
Ralph iteration 7: work in progress
mrcfps 81dba3f
Ralph iteration 8: work in progress
mrcfps 3f36033
Ralph iteration 9: work in progress
mrcfps e1567b9
Ralph iteration 10: work in progress
mrcfps e5d4865
Ralph iteration 11: work in progress
mrcfps a86f5b9
Ralph iteration 12: work in progress
mrcfps ce8ba77
Ralph iteration 13: work in progress
mrcfps 30d21da
Ralph iteration 14: work in progress
mrcfps 45d5d0e
Ralph iteration 15: work in progress
mrcfps 04273a1
Ralph iteration 16: work in progress
mrcfps 9657db3
Ralph iteration 17: work in progress
mrcfps 184d6b0
Ralph iteration 18: work in progress
mrcfps 21b0840
Ralph iteration 19: work in progress
mrcfps 6b7148e
Ralph iteration 20: work in progress
mrcfps cca072a
Ralph iteration 21: work in progress
mrcfps 19daaa2
finish ralph loop
mrcfps e38aabc
expand docs component coverage
mrcfps 9c7590c
fix overlay hover states
mrcfps a325d4e
improve docs theme toggle
mrcfps eb5593f
improve docs search and code actions
mrcfps 41416de
improve docs component reference
mrcfps 1718529
rewrite docs landing to sell the component library
mrcfps 0ac7280
ignore TypeScript build info
mrcfps 49cdb17
fix MCP server request handling
mrcfps f23ca5d
add ui hover states changeset
mrcfps 063c2d2
fix MCP metadata and method errors
mrcfps aa3be59
fix docs Pages build
mrcfps 9a22e50
fix docs Pages output path
mrcfps 017ac08
fix Cloudflare Pages build command
mrcfps 39d2e50
pin Cloudflare Pages output
mrcfps ad551d1
fix Pages Node version
mrcfps eb56940
fix Cloudflare Pages docs output
mrcfps 16157b2
fix Pages output fallbacks
mrcfps d9a2708
fix Pages dashboard config fallback
mrcfps aa13f8c
fix Pages Storybook build script
mrcfps e3f1abe
fix Pages root output fallback
mrcfps 5c40a21
fix agent metadata lookups
mrcfps fd77802
fix docs Storybook and coverage links
mrcfps 96c445e
fix docs Pages output fallback
mrcfps a7442b7
fix Pages output config
mrcfps 2609dcf
fix app Pages output config
mrcfps a95d902
fix Pages Node version
mrcfps 506702f
fix Pages app build aliases
mrcfps c665107
fix mcp tool request handling
mrcfps 1a24231
fix docs Pages build output
mrcfps 9db9a0e
fix docs app Pages output fallbacks
mrcfps 00642b1
fix mcp review follow-ups
mrcfps 4be9e4c
fix Pages Node version
mrcfps 3f00eed
fix Pages install scripts
mrcfps 135e9c5
fix Pages app Node version files
mrcfps 4a70baf
fix mcp review feedback
mrcfps 7587ffc
fix docs metadata repairs
mrcfps bfb1333
fix Pages app pnpm version detection
mrcfps 861bece
fix PR review repairs
mrcfps 9b140b0
fix Pages app pnpm lock detection
mrcfps 8b284d7
fix Pages app lockfile detection
mrcfps 2068f44
fix docs agent route links
mrcfps 94d1c74
fix docs example dependency parsing
mrcfps ad6212c
fix Pages build script alias
mrcfps 0d592c5
fix Pages docs output setup
mrcfps bcd2b79
fix Pages deployment config
mrcfps 31826ae
fix Pages config source
mrcfps 289bb52
fix docs metadata links
mrcfps 80a04c0
fix docs metadata coverage validation
mrcfps 3cb56ac
fix Pages deployment config
mrcfps b6c6ed9
fix Pages app deployment config
mrcfps 5fe4d92
fix Pages app build aliases
mrcfps 74b32f0
fix agent metadata links
mrcfps 0d1d0d1
fix Pages output paths
mrcfps 3c17088
fix docs Pages output config
mrcfps a2c6301
fix Pages config discovery
mrcfps 999a3ef
fix Pages dashboard config fallback
mrcfps 1f03cf8
fix Pages build script aliases
mrcfps 8ef8a63
fix Pages default build target
mrcfps d0dad73
fix Pages Node version pin
mrcfps 96464a2
fix docs manifest route paths
mrcfps dd41a54
fix Pages output config
mrcfps d7c0397
fix Pages compatibility date
mrcfps 40d5c76
fix Pages output directory
mrcfps bfc99b5
fix Pages build environment
mrcfps a1bb1cc
fix docs static route output
mrcfps a4fb9b2
fix llms docs links
mrcfps 11ad3ef
fix Pages Node runtime
mrcfps a7cf4c3
fix MCP component docs slug lookup
mrcfps fe1e031
fix Pages output config
mrcfps d26b557
fix Pages Storybook build aliases
mrcfps 84c8e9a
fix MCP metadata fallback search
mrcfps 4ac450f
fix Pages output config
mrcfps 6eb2728
fix MCP search result metadata
mrcfps e40abc8
fix Pages docs build command
mrcfps 1838503
fix Pages output directory
mrcfps 0e0b5ad
fix Pages dashboard configuration
mrcfps 896227d
fix Pages output fallbacks
mrcfps 851d609
fix Pages build output aliases
mrcfps 1f6424b
fix Pages output config
mrcfps 5b9db8a
fix Pages app output configs
mrcfps 482696b
fix Pages output directories
mrcfps bec72b1
fix PR review feedback
mrcfps 43fbd33
fix Pages compatibility date
mrcfps ccf9605
fix Pages deployment config
mrcfps 76b62d7
fix Storybook Pages output script
mrcfps de3929c
[CF-Pages-Skip] fix Pages install config
mrcfps 6a74056
fix MCP and Storybook review feedback
mrcfps 3c0704b
fix ui web CSS dist check
mrcfps e46f3fc
fix cloud demo Pages output
mrcfps File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| --- | ||
| name: composing-forms | ||
| description: Compose accessible forms with existing Nexu Design primitives and patterns such as Input, Select, Checkbox, Switch, FormField, Button, Card, Dialog, and Alert, using metadata and MCP for exact props and examples instead of embedding duplicate API tables. | ||
| --- | ||
|
|
||
| # Composing Forms | ||
|
|
||
| Use this skill to build forms from existing Nexu Design building blocks instead of designing ad hoc field systems. | ||
|
|
||
| ## When to use | ||
|
|
||
| Use this skill when the user asks to: | ||
|
|
||
| - build a form, settings panel, filter form, signup flow, or modal form | ||
| - choose between form primitives or patterns | ||
| - wire validation, help text, error states, submit actions, or confirmation UI | ||
| - improve accessibility or form copy | ||
|
|
||
| Relevant building blocks often include: | ||
|
|
||
| - `Input` | ||
| - `Select` | ||
| - `Checkbox` | ||
| - `Switch` | ||
| - `FormField` | ||
| - `Button` | ||
| - `Card` | ||
| - `Dialog` | ||
| - `Alert` | ||
|
|
||
| ## Workflow | ||
|
|
||
| 1. Map the user flow first: inputs, choices, validation, submission, and feedback. | ||
| 2. Compose with existing primitives and patterns rather than custom wrappers unless required. | ||
| 3. Use `FormField` or equivalent documented patterns for labels, descriptions, and errors. | ||
| 4. Keep actions clear with existing `Button` variants. | ||
| 5. Use `Card` for grouped sections, `Dialog` for modal forms, and `Alert` for important blocking or status messaging when appropriate. | ||
| 6. Check exact props, examples, and usage patterns via metadata or MCP before implementing. | ||
| 7. Keep validation and copy aligned with product guidance; prefer clear labels, concise helper text, and actionable error copy. | ||
|
|
||
| ## Source of truth / lookups | ||
|
|
||
| Use these references instead of embedding local tables: | ||
|
|
||
| - `/guide/ai-agents` | ||
| - `/reference/components` | ||
| - `/llms.txt` | ||
| - `/llms-full.txt` | ||
| - `/api/manifest.json` | ||
| - `/api/components.json` | ||
| - `/api/examples.json` | ||
|
|
||
| For exact lookups, use `@nexu-design/mcp`: | ||
|
|
||
| ```bash | ||
| npx -y @nexu-design/mcp | ||
| ``` | ||
|
|
||
| Useful tools: | ||
|
|
||
| - `search_components` | ||
| - `get_component` | ||
| - `get_component_props` | ||
| - `get_example` | ||
|
|
||
| Use them to verify: | ||
|
|
||
| - correct form primitives for the job | ||
| - available props and states | ||
| - examples for composition and layout | ||
| - whether a documented pattern already solves the request | ||
|
|
||
| For validation and wording, follow the repo's copy and accessibility guidance rather than inventing inconsistent messaging. | ||
|
|
||
| ## Avoid | ||
|
|
||
| - Do not duplicate prop tables or examples in this skill. | ||
| - Do not build one-off local field components if existing primitives cover the need. | ||
| - Do not separate labels, descriptions, and error text from accessible field wiring. | ||
| - Do not rely on placeholder text as the only label. | ||
| - Do not hard-code validation copy patterns when repo guidance or examples already exist. | ||
| - Do not add custom visual states before checking existing component variants and documented usage. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| --- | ||
| name: tokens-and-theming | ||
| description: Apply Nexu Design tokens, CSS variables, and theme classes correctly by using token metadata, token references, and documented component variants instead of hard-coding values or duplicating token tables. | ||
| --- | ||
|
|
||
| # Tokens and Theming | ||
|
|
||
| Use this skill when styling with Nexu Design tokens, CSS variables, and theme-aware component usage. | ||
|
|
||
| ## When to use | ||
|
|
||
| Use this skill when the user asks to: | ||
|
|
||
| - style UI with the Nexu token system | ||
| - choose colors, spacing, radii, typography, or shadows | ||
| - implement or extend theming | ||
| - understand CSS variables or theme classes | ||
| - align custom CSS with existing component variants | ||
|
|
||
| ## Workflow | ||
|
|
||
| 1. Start with existing component variants before adding custom styling. | ||
| 2. When custom styling is needed, prefer token-backed CSS variables. | ||
| 3. Use documented theme classes and token semantics rather than raw values. | ||
| 4. Check token names, intent, and examples through metadata or MCP. | ||
| 5. Keep custom CSS aligned with existing theming behavior so components stay consistent across themes. | ||
|
|
||
| ## Source of truth / lookups | ||
|
|
||
| Use these sources for exact token and theming information: | ||
|
|
||
| - `/guide/ai-agents` | ||
| - `/reference/tokens` | ||
| - `/reference/components` | ||
| - `/llms.txt` | ||
| - `/llms-full.txt` | ||
| - `/api/manifest.json` | ||
| - `/api/tokens.json` | ||
| - `/api/components.json` | ||
| - `/api/examples.json` | ||
|
|
||
| For machine-readable token lookup, use `@nexu-design/mcp`: | ||
|
|
||
| ```bash | ||
| npx -y @nexu-design/mcp | ||
| ``` | ||
|
|
||
| Useful tools: | ||
|
|
||
| - `search_tokens` | ||
| - `get_token` | ||
| - `search_components` | ||
| - `get_component` | ||
| - `get_example` | ||
|
|
||
| Use these to verify: | ||
|
|
||
| - which token or CSS variable should back a style | ||
| - whether an existing variant already expresses the desired state | ||
| - how a token is intended to be used in theming or component composition | ||
|
|
||
| ## Avoid | ||
|
|
||
| - Do not hard-code colors, spacing, radii, or other design values when a token exists. | ||
| - Do not duplicate token value tables in this skill. | ||
| - Do not create custom theme values that drift from documented token semantics without strong reason. | ||
| - Do not bypass existing component variants for styling that is already supported. | ||
| - Do not treat copied raw values as the source of truth; use token metadata, token APIs, and theming docs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| --- | ||
| name: using-nexu-design | ||
| description: Guide consumers and agents to use @nexu-design/ui-web and @nexu-design/tokens correctly, relying on Nexu Design docs, metadata endpoints, and MCP lookups instead of recreating components, variants, prop tables, or token tables locally. | ||
| --- | ||
|
|
||
| # Using Nexu Design | ||
|
|
||
| Use this skill when working with Nexu Design as a consumer-facing UI system rather than inventing a parallel one. | ||
|
|
||
| ## When to use | ||
|
|
||
| Use this skill when the user asks to: | ||
|
|
||
| - build UI with `@nexu-design/ui-web` | ||
| - consume `@nexu-design/tokens` | ||
| - find the right existing component or variant | ||
| - check installation, imports, props, examples, or token usage | ||
| - integrate Nexu Design into an app, prototype, or AI workflow | ||
|
|
||
| ## Workflow | ||
|
|
||
| 1. Confirm the task is consumption, composition, or lookup. | ||
| 2. Start from Nexu Design source-of-truth docs and machine-readable metadata. | ||
| 3. Identify the existing component, pattern, variant, or token before proposing new UI. | ||
| 4. Prefer published package usage: | ||
| - install `@nexu-design/ui-web` and/or `@nexu-design/tokens` | ||
| - import the package stylesheet: `@nexu-design/ui-web/styles.css` | ||
| 5. Reuse existing components and variants instead of recreating them locally. | ||
| 6. For exact APIs or examples, fetch them from metadata or MCP instead of writing static tables into the answer. | ||
|
|
||
| ## Source of truth / lookups | ||
|
|
||
| Prefer these in roughly this order: | ||
|
|
||
| - `/guide/ai-agents` | ||
| - `/reference/components` | ||
| - `/reference/tokens` | ||
| - `/llms.txt` | ||
| - `/llms-full.txt` | ||
| - `/api/manifest.json` | ||
| - `/api/components.json` | ||
| - `/api/tokens.json` | ||
| - `/api/examples.json` | ||
|
|
||
| For machine-readable lookups, use `@nexu-design/mcp`: | ||
|
|
||
| ```bash | ||
| npx -y @nexu-design/mcp | ||
| ``` | ||
|
|
||
| Useful tools: | ||
|
|
||
| - `search_components` | ||
| - `get_component` | ||
| - `get_component_props` | ||
| - `get_example` | ||
| - `search_tokens` | ||
| - `get_token` | ||
|
|
||
| Use MCP or metadata to answer questions like: | ||
|
|
||
| - which component should I use? | ||
| - what props or variants exist? | ||
| - is there an example for this pattern? | ||
| - which token or CSS variable should power this style? | ||
|
|
||
| ## Avoid | ||
|
|
||
| - Do not create local duplicate components when an existing Nexu Design component fits. | ||
| - Do not invent new variants before checking metadata, docs, and examples. | ||
| - Do not copy component API tables, prop tables, or token value tables into the skill. | ||
| - Do not hard-code design decisions that should come from tokens or documented variants. | ||
| - Do not treat memory as the source of truth when MCP or metadata can answer exactly. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| import type { Metadata } from "next"; | ||
| import { notFound } from "next/navigation"; | ||
|
|
||
| import { DocsShell } from "../../../components/docs-shell"; | ||
| import { docsPages, getPageBySlug } from "../../../lib/docs"; | ||
|
|
||
| interface DocsPageProps { | ||
| params: Promise<{ | ||
| slug: string[]; | ||
| }>; | ||
| } | ||
|
|
||
| export function generateStaticParams() { | ||
| return docsPages.map((page) => ({ slug: page.slug })); | ||
| } | ||
|
|
||
| export async function generateMetadata({ params }: DocsPageProps): Promise<Metadata> { | ||
| const { slug } = await params; | ||
| const page = getPageBySlug(slug); | ||
|
|
||
| if (!page) { | ||
| return {}; | ||
| } | ||
|
|
||
| return { | ||
| title: page.title, | ||
| description: page.description, | ||
| }; | ||
| } | ||
|
|
||
| export default async function DocsPage({ params }: DocsPageProps) { | ||
| const { slug } = await params; | ||
| const page = getPageBySlug(slug); | ||
|
|
||
| if (!page) { | ||
| notFound(); | ||
| } | ||
|
|
||
| return ( | ||
| <DocsShell | ||
| title={page.title} | ||
| description={page.description} | ||
| headings={page.headings} | ||
| pathname={`/${slug.join("/")}`} | ||
| > | ||
| {page.content} | ||
| </DocsShell> | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| export const dynamic = "force-static"; | ||
|
|
||
| export function GET() { | ||
| return Response.json({ | ||
| name: "Nexu Design MCP", | ||
| package: "@nexu-design/mcp", | ||
| command: "npx -y @nexu-design/mcp", | ||
| transport: "stdio", | ||
| docsUrl: "/guide/ai-agents", | ||
| metadata: { | ||
| components: "/api/components.json", | ||
| examples: "/api/examples.json", | ||
| tokens: "/api/tokens.json", | ||
|
mrcfps marked this conversation as resolved.
Outdated
|
||
| }, | ||
| tools: [ | ||
| "search_components", | ||
| "get_component", | ||
| "get_component_props", | ||
| "get_example", | ||
| "search_tokens", | ||
| "get_token", | ||
| ], | ||
| scope: "read-only", | ||
| }); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| import { getComponentsApi } from "../../../lib/agent-artifacts"; | ||
|
|
||
| export const dynamic = "force-static"; | ||
|
|
||
| export function GET() { | ||
| return Response.json(getComponentsApi()); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| import { getExamplesApi } from "../../../lib/agent-artifacts"; | ||
|
|
||
| export const dynamic = "force-static"; | ||
|
|
||
| export function GET() { | ||
| return Response.json(getExamplesApi()); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| import { getAgentManifest } from "../../../lib/agent-artifacts"; | ||
|
|
||
| export const dynamic = "force-static"; | ||
|
|
||
| export function GET() { | ||
| return Response.json(getAgentManifest()); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| import { getTokensApi } from "../../../lib/agent-artifacts"; | ||
|
|
||
| export const dynamic = "force-static"; | ||
|
|
||
| export function GET() { | ||
| return Response.json(getTokensApi()); | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.