agentleFS
mark2685mark2685/agent-tools/skills/flow-frontend/new-page/SKILL.md

new-page

Skill0 starsChanged 5 months agoMITView on GitHub

Scaffolds a new page in flow-global or flow-factory following all project conventions. Use when user asks to "create a page", "add a new route", "scaffold a page", or "/new-page".

10 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use security-audit.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • CloudflareSkill

    security-audit

    Security guidance and vulnerability review for codebases, APIs, services, CLI tools, libraries, and daemons. Use for security questions, focused reviews, vulnerability research, security audits, or pen tests. Run the complete workflow only for explicit codebase audit or pen-test requests, full/comprehensive/end-to-end reviews, or requested report artifacts.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

11 rules. 0 are common, 2 are distinctive, and 9 are very specific to this project.

  • 0

    Common

    Most of the 8 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 9

    Very specific

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

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

    Create a new Next.js App Router page with all conventions followed.

    line 8
  2. Very specific:

    Default to a server component (no 'use client' directive)

    line 20
  3. Distinctive:

    Use TypeScript with proper param types for dynamic segments

    line 21
  4. Distinctive:

    Follow existing page patterns in the same domain for consistency

    line 22
  5. Very specific:

    Push 'use client' to the smallest leaf: Keep the page and as many children as possible as server components.

    line 29
  6. Very specific:

    Put actions in the _lib/actions folder, not a single _lib/actions.ts.

    line 36
  7. Very specific:

    Regenerate route types: Run pnpm build:typesafe-url

    line 44
  8. Very specific:

    Check domain boundaries: Ensure all imports respect eslint-plugin-boundaries rules:

    line 48
  9. Very specific:

    Only import from allowed sibling domains + shared layers (app/_lib/, lib/, utils/)

    line 49
  10. Very specific:

    Use FlowLink/FlowLinkButton for all navigation — never next/link

    line 50
  11. Very specific:

    Use @hadrian-mtv/flow-logger for logging — never console.*

    line 51

“Common” is measured: kept by at least 6 in 10 of the 8 edited versions of this file we could read. “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

New Page Scaffold

Create a new Next.js App Router page with all conventions followed.

Steps

  1. Ask which app (flow-global or flow-factory) and the route path (e.g., /orders/[orderId]/details)
  2. Determine domain — the top-level route segment determines the domain. List the live domains with ls apps/<app>/app/ — do not rely on a memorized list; domains drift. Every directory is a domain except _-prefixed dirs (_lib, _fonts), api, healthcheck, and post-login.
  3. Create the page at apps/<app>/app/<route>/page.tsx:
    • Default to a server component (no 'use client' directive)
    • Use TypeScript with proper param types for dynamic segments
    • Follow existing page patterns in the same domain for consistency
  4. Fetch data on the server by default. The page (a server component) awaits its data directly. Use Promise.all for independent fetches so they don't waterfall. Reserve client-side TanStack Query for genuinely client-driven data — mutations, polling, infinite scroll, or state that reacts to user interaction — not for the page's initial load.
  5. Push 'use client' to the smallest leaf. Keep the page and as many children as possible as server components; mark only the interactive child (the one with hooks/handlers) as a client component, and pass server-rendered children into it via props/children rather than making a whole subtree client.
  6. Create co-located files as needed:
    • _lib/actions/ — server actions ('use server') using @hadrian-mtv/connect-server-actions. Put actions in the _lib/actions folder, not a single _lib/actions.ts.
    • _lib/queries.ts — only if client-side fetching is actually needed. Define queryOptions() factories with hierarchical keys built through the domain's key factory per the tanstack-query rule (installed at .claude/rules/tanstack-query.md) — never hand-write a literal key.
    • loading.tsx — loading skeleton if the page does async data fetching
    • error.tsx — error boundary (must be 'use client')
  7. Regenerate route types: Run pnpm build:typesafe-url
  8. Verify navigation types: Confirm the new route is available in @hadrian-mtv/flow-navigation types
  9. Check domain boundaries: Ensure all imports respect eslint-plugin-boundaries rules:
    • Only import from allowed sibling domains + shared layers (app/_lib/, lib/, utils/)
    • Use FlowLink/FlowLinkButton for all navigation — never next/link
    • Use @hadrian-mtv/flow-logger for logging — never console.*
  10. Verify with pnpm lint:tsc that the page compiles cleanly

Gotchas

  • Domain lists drift — always read the filesystem. A hard-coded list in this skill was missing four live domains within months of being written.

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.