agentleFS
dream-horizon-orgdream-horizon-org/pulse/.agents/skills/add-ui-screen/SKILL.md

add-ui-screen

Skill44 starsChanged 5 months agoApache-2.0View on GitHub

Step-by-step workflow for adding a new screen/page to pulse-ui. Use when creating a new UI screen, page, dashboard view, or route in pulse-ui/.

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 1 is distinctive, and 2 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.

  • 2

    Very specific

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

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

    Create a folder-based hook at pulse-ui/src/hooks/useGetMyData/:

    line 55
  2. Distinctive:

    Use Mantine components, handle loading/error states:

    line 98
  3. Very specific:

    Add entry in NAVBAR_ITEMS in Constants.ts with a Tabler icon.

    line 140

≈ “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 UI Screen

Workflow

- [ ] Step 1: Create screen folder structure
- [ ] Step 2: Define types/interfaces
- [ ] Step 3: Create React Query hook
- [ ] Step 4: Build the screen component
- [ ] Step 5: Add styles
- [ ] Step 6: Register route
- [ ] Step 7: Add navbar entry (if top-level)
- [ ] Step 8: Verify build

Step 1: Create Folder

pulse-ui/src/screens/MyScreen/
├── MyScreen.tsx
├── MyScreen.interface.ts
├── MyScreen.module.css
├── MyScreen.constants.ts
├── index.ts
└── components/           (if needed)

index.ts:

export { MyScreen } from "./MyScreen";

Step 2: Define Types

MyScreen.interface.ts:

export interface MyScreenProps {
  // props if any
}

export interface MyDataItem {
  id: string;
  name: string;
  // ...
}

Step 3: React Query Hook

Create a folder-based hook at pulse-ui/src/hooks/useGetMyData/:

hooks/useGetMyData/
├── index.ts                  # Barrel export
├── useGetMyData.ts           # Hook implementation
└── useGetMyData.interface.ts # Types for this hook

useGetMyData.interface.ts:

export interface MyDataResponse {
  items: MyDataItem[];
}

useGetMyData.ts:

import { useQuery } from "@tanstack/react-query";
import { makeRequest } from "../../helpers/makeRequest/makeRequest";
import { API_BASE_URL } from "../../constants/Constants";
import { MyDataResponse } from "./useGetMyData.interface";

export function useGetMyData(enabled: boolean) {
  return useQuery({
    queryKey: ["myData"],
    queryFn: () => makeRequest<MyDataResponse>({
      url: `${API_BASE_URL}/v1/my-endpoint`,
      init: { method: "GET" },
    }),
    enabled,
    refetchOnWindowFocus: false,
  });
}

index.ts:

export { useGetMyData } from "./useGetMyData";

Step 4: Screen Component

Use Mantine components, handle loading/error states:

import { Container, Title, Loader, Alert } from "@mantine/core";
import classes from "./MyScreen.module.css";
import { useGetMyData } from "../../hooks/useGetMyData";

export function MyScreen() {
  const { data, isLoading, error } = useGetMyData(true);
  if (isLoading) return <Loader />;
  if (error) return <Alert color="red">Failed to load data</Alert>;
  return (
    <Container className={classes.container}>
      <Title order={2}>My Screen</Title>
      {/* content */}
    </Container>
  );
}

Step 5: Styles

MyScreen.module.css using Mantine CSS variables:

.container {
  padding: var(--mantine-spacing-md);
}

Step 6: Register Route

In Constants.ts, add to ROUTES:

MY_SCREEN: { basePath: "/my-screen", ... }

In App.tsx, add <Route>:

<Route path={ROUTES.MY_SCREEN.basePath} element={<MyScreen />} />

Step 7: Navbar (optional)

Add entry in NAVBAR_ITEMS in Constants.ts with a Tabler icon.

Step 8: Verify

cd pulse-ui && yarn build

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.