Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsCommunityBlog
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

Back to skills

New Page

ASecurity

Scaffold a new frontend page in ayunis-core. Use when adding a new route with its page component following Feature-Sliced Design conventions.

33 stars
0 votes
0 copies
0 views
Added 9/20/2026
developmenttypescriptbashreactapifrontend

Works with

cliapi

Security Analysis

A100/100

Scanned 9/20/2026

Install to Claude Code

$npx -y skills add ayunis-core/ayunis-core --skill new-page --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of New Page?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for New Page
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ayunis-core-new-page/badge)](https://www.skillsdirectory.com/skills/ayunis-core-new-page)

More formats (shields.io, HTML) on the badges page.

Download Zip
Files
SKILL.md
---
name: new-page
description: Scaffold a new frontend page in ayunis-core. Use when adding a new route with its page component following Feature-Sliced Design conventions.
---

# New Frontend Page — ayunis-core-frontend

## Prerequisites

- Read the `ayunis-core-frontend-dev` skill for validation sequence and FSD rules
- Ensure the dev stack is running (`./dev up` from repo root)

## Working Directory

```bash
cd ayunis-core-frontend
```

## Directory Structure

Every page follows this structure:

```text
src/pages/<page-name>/
├── ui/
│   └── <PageName>Page.tsx       # Main page component (default export)
├── api/                          # Optional: mutation hooks
│   ├── useCreate<Entity>.ts
│   ├── useUpdate<Entity>.ts
│   └── useDelete<Entity>.ts
├── model/                        # Optional: types, constants
│   └── openapi.ts               # Re-exported types from generated API
└── index.ts                      # Barrel export

src/app/routes/_authenticated/
└── <page-name>.index.tsx          # TanStack Router route file
```

## File Templates

### 1. Barrel Export

```typescript
// src/pages/<page-name>/index.ts
export { default as MyPagePage } from './ui/MyPagePage';
```

### 2. Page Component

Pages compose layouts, widgets, and features. They receive data via props (from the route loader) or fetch it internally.

```typescript
// src/pages/<page-name>/ui/MyPagePage.tsx
import AppLayout from '@/layouts/app-layout';
import ContentAreaLayout from '@/layouts/content-area-layout/ui/ContentAreaLayout';
import ContentAreaHeader from '@/widgets/content-area-header/ui/ContentAreaHeader';
import { useTranslation } from 'react-i18next';

interface MyPagePageProps {
  items: Item[];
}

export default function MyPagePage({ items }: MyPagePageProps) {
  const { t } = useTranslation('<page-name>');

  return (
    <AppLayout>
      <ContentAreaLayout
        contentHeader={
          <ContentAreaHeader title={t('page.title')} />
        }
        contentArea={
          <div>
            {items.map((item) => (
              <div key={item.id}>{item.name}</div>
            ))}
          </div>
        }
      />
    </AppLayout>
  );
}
```

### 3. Route File

Routes use TanStack Router's `createFileRoute`. Data fetching happens in the `loader`.

```typescript
// src/app/routes/_authenticated/<page-name>.index.tsx
import { createFileRoute } from '@tanstack/react-router';
import { MyPagePage } from '@/pages/<page-name>';
import {
  getMyEntitiesControllerFindAllQueryKey,
  myEntitiesControllerFindAll,
} from '@/shared/api/generated/ayunisCoreAPI';

export const Route = createFileRoute('/_authenticated/<page-name>/')({
  component: RouteComponent,
  loader: async ({ context: { queryClient } }) => {
    const items = await queryClient.fetchQuery({
      queryKey: getMyEntitiesControllerFindAllQueryKey(),
      queryFn: () => myEntitiesControllerFindAll(),
    });
    return { items };
  },
});

function RouteComponent() {
  const { items } = Route.useLoaderData();
  return <MyPagePage items={items} />;
}
```

For routes with URL parameters:

```typescript
// src/app/routes/_authenticated/<page-name>.$id.tsx
import { createFileRoute } from '@tanstack/react-router';
import { MyDetailPage } from '@/pages/<page-name>';
import {
  getMyEntitiesControllerFindOneQueryKey,
  myEntitiesControllerFindOne,
} from '@/shared/api/generated/ayunisCoreAPI';

export const Route = createFileRoute('/_authenticated/<page-name>/$id')({
  component: RouteComponent,
  loader: async ({ params: { id }, context: { queryClient } }) => {
    const item = await queryClient.fetchQuery({
      queryKey: getMyEntitiesControllerFindOneQueryKey(id),
      queryFn: () => myEntitiesControllerFindOne(id),
    });
    return { item };
  },
});

function RouteComponent() {
  const { item } = Route.useLoaderData();
  return <MyDetailPage item={item} />;
}
```

For routes with search params:

```typescript
// src/app/routes/_authenticated/<page-name>.tsx
import { createFileRoute } from '@tanstack/react-router';
import { z } from 'zod';
import { MyPagePage } from '@/pages/<page-name>';

const searchSchema = z.object({
  filter: z.string().optional(),
});

export const Route = createFileRoute('/_authenticated/<page-name>')({
  component: RouteComponent,
  validateSearch: searchSchema,
});

function RouteComponent() {
  const { filter } = Route.useSearch();
  return <MyPagePage filter={filter} />;
}
```

### 4. Mutation Hooks (Optional)

One hook per operation. Each encapsulates a TanStack Query mutation with cache invalidation.

```typescript
// src/pages/<page-name>/api/useCreateMyEntity.ts
import {
  useMyEntitiesControllerCreate,
  getMyEntitiesControllerFindAllQueryKey,
} from '@/shared/api/generated/ayunisCoreAPI';
import { useQueryClient } from '@tanstack/react-query';
import { toast } from 'sonner';
import { useTranslation } from 'react-i18next';

export function useCreateMyEntity(onSuccess?: () => void) {
  const queryClient = useQueryClient();
  const { t } = useTranslation('<page-name>');

  const mutation = useMyEntitiesControllerCreate({
    mutation: {
      onSuccess: () => {
        void queryClient.invalidateQueries({
          queryKey: getMyEntitiesControllerFindAllQueryKey(),
        });
        toast.success(t('toast.createSuccess'));
        onSuccess?.();
      },
      onError: () => {
        toast.error(t('toast.createError'));
      },
    },
  });

  return {
    createMyEntity: (data: { name: string }) =>
      mutation.mutate({ data }),
    isCreating: mutation.isPending,
  };
}
```

### 5. Model Types (Optional)

Re-export types from the generated API client for cleaner imports within the page module.

```typescript
// src/pages/<page-name>/model/openapi.ts
export type {
  MyEntityResponseDto as MyEntity,
} from '@/shared/api/generated/ayunisCoreAPI.schemas';
```

## Internationalization

Add translation keys for the new page:

```bash
# Create translation files
# src/shared/i18n/locales/de/<page-name>.json
# src/shared/i18n/locales/en/<page-name>.json
```

```json
{
  "page": {
    "title": "My Page"
  },
  "toast": {
    "createSuccess": "Created successfully",
    "createError": "Failed to create"
  }
}
```

Register the namespace in `src/shared/i18n/i18n.ts`.

## FSD Import Rules

Pages sit at the top of the dependency hierarchy:

```text
pages → widgets → features → shared
```

A page **can** import from:

- `@/widgets/*` — Composite UI components
- `@/features/*` — Business logic features
- `@/shared/*` — Primitives (UI, API, lib, i18n)
- `@/layouts/*` — Layout components

A page **cannot** import from:

- Other pages (`@/pages/*`) — pages are siblings, never dependencies
- `@/app/*` — the app layer is above pages

## Available Layouts

| Layout | Use Case |
|--------|----------|
| `AppLayout` | Standard authenticated page with sidebar |
| `ContentAreaLayout` | Page with header + scrollable content area |
| `FullScreenMessageLayout` | Centered message (empty states, errors) |
| `ChatInterfaceLayout` | Chat conversation layout with input area |

## Scaffold Checklist

1. **Create page files**:
   - [ ] `src/pages/<page-name>/ui/<PageName>Page.tsx`
   - [ ] `src/pages/<page-name>/index.ts`
   - [ ] `src/app/routes/_authenticated/<page-name>.index.tsx`

2. **Create translations** (if using i18n):
   - [ ] `src/shared/i18n/locales/de/<page-name>.json`
   - [ ] `src/shared/i18n/locales/en/<page-name>.json`
   - [ ] Register namespace in `src/shared/i18n/i18n.ts`

3. **Regenerate route tree**:

   ```bash
   pnpm exec tsr generate
   ```

   This updates `src/app/routeTree.gen.ts` automatically.

4. **Validate**:

   ```bash
   pnpm run lint
   pnpm exec tsc --noEmit
   pnpm run build
   ```

5. **Visual check**: Navigate to the new route in the browser and verify it renders.

## Reference Pages

Study these existing pages as examples:

- **Simple list page**: `src/pages/agents/` — list with tabs, create dialog
- **Detail page with params**: `src/pages/agent/` — single entity view with `$id` param
- **Search params**: `src/pages/install/` — page with search schema validation
- **Settings sub-pages**: `src/pages/settings/` — nested layout with multiple sub-routes
- **Data loading in route**: `src/app/routes/_authenticated/prompts.index.tsx` — loader pattern with query prefetch

Attribution

ayunis-coreayunis-core
View sourceMore from ayunis-core →
SSkills DirectorySkills Directory

Your tool, in front of Claude Code builders.

3 founder slots · $299/mo · GSC-verified traffic · sponsors can never buy grades.

See placements

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Your tool, in front of Claude Code builders.

3 founder slots · $299/mo · GSC-verified traffic · sponsors can never buy grades.

See placements

Related Skills

Browser Extension Developer

Use this skill when developing or maintaining browser extension code in the `browser/` directory, including Chrome/Firefox/Edge compatibility, content scripts, background scripts, or i18n updates.

281612 votes

Seo Optimizer

SEO optimization with keyword analysis, readability assessment, technical validation, content quality. Use for search rankings, blog posts, content audits, or encountering keyword density, readability scores, meta tags, schema markup errors.

2132 votes

Google Official Seo Guide

Official Google SEO guide covering search optimization, best practices, Search Console, crawling, indexing, and improving website search visibility based on official Google documentation

1862 votes

Tanstack Start

Build a full-stack TanStack Start app on Cloudflare Workers from scratch — SSR, file-based routing, server functions, D1+Drizzle, better-auth, Tailwind v4+shadcn/ui. Use whenever the user mentions TanStack Start, asks to scaffold a full-stack Cloudflare app with SSR, wants an SSR dashboard, or asks for a React 19 + Cloudflare Workers app with file-based routing and server functions — even if they don't name TanStack Start specifically. No template repo — Claude generates every file fresh per ...

9881 votes

Pentest

PTES-aligned adversarial security audit for backend, frontend, and mobile applications. Produces a CVSS-scored Hacker Report with verified PoCs and phased remediation.

5491 votes
View all in development →