agentleFS
tapiotorstitapiotorsti/torsti-tapiola-website/.agents/skills/add-page-section/SKILL.md

add-page-section

Skill0 starsChanged 3 days agoMITView on GitHub

Add a new public page or portfolio section to the TanStack Start site, with server-side data loading, SEO head tags, navigation link and the site's editorial styling. Use when asked to add a route, page or section such as "talks", "writing" or "testimonials".

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    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:

    Use src/routes/skills.tsx as the reference implementation: it is short and shows every part of the pattern.

    line 8
  2. Very specific:

    Data: If the section shows new kinds of content, first follow the database-change skill to add the table, server fn and queryOptions.

    line 13
  3. Very specific:

    Route file: Create src/routes/<name>.tsx.

    line 18
  4. Very specific:

    Add the page to public/sitemap.xml with a <url><loc>https://torsti.dev/things</loc></url> entry.

    line 57
  5. Very specific:

    Navigation: Add an entry to the nav array in src/components/site/SiteHeader.tsx, for example { to: "/things", label: "Things", n: "05" }.

    line 59
  6. Very specific:

    If the page renders external links, filter them with isSafeUrl() from @/lib/utils and use target="_blank" rel="noreferrer".

    line 64
  7. Distinctive:

    Styling: Follow the editorial style:

    line 67
  8. Distinctive:

    Check the page at about 375px width and on desktop.

    line 73
  9. Very specific:

    Admin (optional): If the content is editable, add src/routes/admin.<name>.tsx and a tab in the tabs array in src/routes/admin.tsx.

    line 75
  10. Very specific:

    Tests: Add a case to src/test/app-routing.test.tsx checking that the new path matches a route (copy the / case).

    line 80
  11. Very specific:

    Verify: Run the verify-changes skill.

    line 83

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 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

Add a page or section

Use src/routes/skills.tsx as the reference implementation: it is short and shows every part of the pattern.

Steps

  1. Data. If the section shows new kinds of content, first follow the database-change skill to add the table, server fn and queryOptions. If the page is static, skip the loader's data query and keep only loadSiteIdentity().
  2. Route file. Create src/routes/<name>.tsx. Bare $ marks a dynamic segment, and routeTree.gen.ts regenerates on its own:

    import { createFileRoute } from "@tanstack/react-router";
    import { useSuspenseQuery } from "@tanstack/react-query";
    import { loadSiteIdentity, pageTitle, siteName, thingsQuery } from "@/data";
    import { Page, SectionHeader } from "@/components/site/primitives";
    import { seo } from "@/lib/seo";
    
    export const Route = createFileRoute("/things")({
      // loader before head, so loaderData is typed in head()
      loader: async ({ context }) => {
        await context.queryClient.ensureQueryData(thingsQuery);
        return loadSiteIdentity(context.queryClient);
      },
      // seo() adds description, canonical, Open Graph and Twitter tags.
      // Write a specific 120–160 character description that names the person.
      head: ({ loaderData }) =>
        seo({
          title: pageTitle("Things", loaderData),
          description: `Things by ${siteName(loaderData)}: one specific sentence about this page.`,
          path: "/things",
          siteName: siteName(loaderData),
        }),
      component: ThingsPage,
    });
    
    function ThingsPage() {
      const { data } = useSuspenseQuery(thingsQuery);
      return (
        <Page>
          <SectionHeader index="05" title="Things" intro="Short intro line." />
          {/* content */}
        </Page>
      );
    }

    Add the page to public/sitemap.xml with a <url><loc>https://torsti.dev/things</loc></url> entry.

  3. Navigation. Add an entry to the nav array in src/components/site/SiteHeader.tsx, for example { to: "/things", label: "Things", n: "05" }. Keep its n number the same as the index in the page's SectionHeader, and keep the numbers in order.

    If the page renders external links, filter them with isSafeUrl() from @/lib/utils and use target="_blank" rel="noreferrer".

  4. Styling. Follow the editorial style:

    • 1px border-border dividers, no heavy cards, shadows or gradients
    • font-mono text-xs for indices, dates and tags
    • text-primary only for accents
    • reveal class with a staggered animationDelay for list items

    Check the page at about 375px width and on desktop.

  5. Admin (optional). If the content is editable, add src/routes/admin.<name>.tsx and a tab in the tabs array in src/routes/admin.tsx. Reuse useAdminCrud, TagInput and ConfirmDelete from src/components/admin/.
  6. Tests. Add a case to src/test/app-routing.test.tsx checking that the new path matches a route (copy the / case).
  7. Verify. Run the verify-changes skill.

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.