agentleFS
Google CloudKnown publisherGoogleCloudPlatform/devrel-demos/other/modernizing-expressjs/.agents/skills/scaffolding-ui-and-pages/SKILL.md

scaffolding-ui-and-pages

Skill378 starsChanged 4 months agoApache-2.0View on GitHub

Translates a UI_Component_Inventory.md artifact into modern ShadCN + Tailwind components AND fully scaffolded Next.js pages. Use when building the frontend design system and routing infrastructure.

The file

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 1 is distinctive, and 7 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 7

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Build Shared Layouts: Create the Navbar, Footer, and MobileMenu.

    line 26
  2. Very specific:

    Modernize Features: Use premium ShadCN primitives (e.g., NavigationMenu, Avatar, Button, Card) instead of raw Bootstrap/CSS classes.

    line 28
  3. Distinctive:

    Verification (Visual smoke-test): Verify that the UI is visually appealing and functional.

    line 32
  4. Very specific:

    Output Result: Ensure all components are exported from src/components/ and all pages are functionally implemented in src/app/.

    line 35
  5. Very specific:

    If the design system uses @base-ui/react primitives (standard in ShadCN v4+), you MUST follow these patterns for asChild support:

    line 38
  6. Very specific:

    Implicit Slot Pattern: Use the render prop on Base UI primitives to implement asChild.

    line 40
  7. Very specific:

    Button Semantics: When a Button or MenuItem acts as a Link (via asChild), you MUST set nativeButton={false} on the primitive to suppress …

    line 41
  8. Very specific:

    Prop Merging: Use React.cloneElement or direct Prop spreading into the render callback to ensure ref, className, and event handlers are …

    line 43

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

UI & Pages Scaffolding Specialist

Locate and read all artifacts in docs/legacy-audit/ directory.

Objective

Implement high-fidelity, modern React components using ShadCN and Tailwind, AND wire them together into fully functional Next.js pages (src/app/**/page.tsx) based on the requirements and Route Topology extracted from legacy Pug templates.

Instructions for the Scaffold Subagent

Copy this checklist and track your progress:

Task Progress:
- [ ] Step 1: Initialize ShadCN
- [ ] Step 2: Build Shared Layout Components (src/components/layout/)
- [ ] Step 3: Scaffold Domain Components (src/components/articles/, etc.)
- [ ] Step 4: Extract Route & Page Topology
- [ ] Step 5: Scaffold Pages (src/app/**/page.tsx)
- [ ] Step 6: Verification (Visual smoke-test)
  1. Initialize Design System: Install the core ShadCN CLI using npx shadcn@latest init and configure the Tailwind theme (colors, fonts).
  2. Build Shared Layouts: Create the Navbar, Footer, and MobileMenu.
    • Logic: Replicate the conditional logic (e.g., Auth-links) from the legacy metadata using Next.js getServerSession.
    • Modernize Features: Use premium ShadCN primitives (e.g., NavigationMenu, Avatar, Button, Card) instead of raw Bootstrap/CSS classes.
  3. Component Scaffolding: Build specific logic-heavy components like CommentList and ArticleCard using the legacy field mapping.
  4. Route & Page Topology Check: Go to the docs/legacy-audit/UI_Component_Inventory.md and explicitly extract the list of intended pages and URLs.
  5. Page Scaffolding: For every single mapped route, create its routing wrapper in src/app/[path]/page.tsx (e.g. /articles needs src/app/articles/page.tsx). Hook up all business logic, server actions, UX intent, and data fetching components required.
  6. Verification (Visual smoke-test): Verify that the UI is visually appealing and functional.

Output Result: Ensure all components are exported from src/components/ and all pages are functionally implemented in src/app/.

Base UI & asChild Best Practices

If the design system uses @base-ui/react primitives (standard in ShadCN v4+), you MUST follow these patterns for asChild support:

  1. Implicit Slot Pattern: Use the render prop on Base UI primitives to implement asChild.
  2. Button Semantics: When a Button or MenuItem acts as a Link (via asChild), you MUST set nativeButton={false} on the primitive to suppress semantics warnings and avoid invalid nested interactive elements.
    • Example: <ButtonPrimitive nativeButton={false} render={(props) => <Link {...props} />}>
  3. Prop Merging: Use React.cloneElement or direct Prop spreading into the render callback to ensure ref, className, and event handlers are correctly merged onto the child.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.