一键导入
laravel-inertia
Inertia.js page component patterns with TypeScript. Use when creating pages or when user asks to "create a page", "build a component".
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Inertia.js page component patterns with TypeScript. Use when creating pages or when user asks to "create a page", "build a component".
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | laravel-inertia |
| description | Inertia.js page component patterns with TypeScript. Use when creating pages or when user asks to "create a page", "build a component". |
| allowed-tools | Read, Glob, Grep, Edit, Write, Bash |
resources/js/
├── Pages/
│ └── {Resource}/
│ ├── Index{Resources}.tsx # List view
│ └── Show{Resource}.tsx # Detail view
├── @types/
│ └── {Resource}.ts # TypeScript interfaces
├── components/
│ └── {feature}/ # Feature components
└── layouts/
└── {Layout}.tsx # Page layouts
Use the .layout property for persistent layouts that don't remount between page visits:
import React from 'react';
import { Page } from '@/@types/Page';
import { Authenticated } from '@/layouts/Authenticated';
interface Props extends Page {
post: Post;
}
const ShowPost = ({ post }: Props) => {
return (
<div>
<h1>{post.title}</h1>
<p>{post.body}</p>
</div>
);
};
// Persistent layout - doesn't remount between page visits
ShowPost.layout = (page: any) => (
<Authenticated children={page} meta={page.props.meta} />
);
export default ShowPost;
// @types/Page.ts
export interface Page {
meta: {
title: string;
[key: string]: any;
};
}
interface Props extends Page {
post: Post; // Single resource
posts: PaginatedResource<IndexPost>; // Paginated collection
categories?: Category[]; // Optional data
}
interface PaginatedResource<T> {
data: T[];
links: {
first: string;
last: string;
prev: string | null;
next: string | null;
};
meta: {
current_page: number;
from: number;
last_page: number;
per_page: number;
to: number;
total: number;
};
}
Define in @types/{Resource}.ts:
export interface Post {
id: number;
title: string;
body?: string;
category?: Category;
created_at: string;
updated_at: string;
}
export interface IndexPost {
id: number;
title: string;
category?: string;
status: string;
}
| Controller | Component Path |
|---|---|
IndexPostsController | Pages/Posts/IndexPosts.tsx |
ShowPostController | Pages/Posts/ShowPost.tsx |
ShowPostCommentsController | Pages/Posts/ShowPostComments.tsx |
examples/ - Full component examplesRun the project's verification commands before claiming work complete. Use ALWAYS when finishing a task, claiming work done, committing, or creating a PR. Blocks completion until all checks pass.
Create atomic GitHub issues with clear acceptance criteria. Use when breaking down work into single-iteration tasks that can be picked up and completed independently.
Create well-structured GitHub milestones. Use when planning new phases of work that group related issues together.
Background knowledge about npm native binary corruption in Docker sandboxes
Laravel invokable controller patterns with Inertia. Use when creating endpoints, adding pages, building CRUD, or when user asks to "create an endpoint", "add a controller", "build a page", "add a store action", "create show page".
Use when taking screenshots, PDFs, or video recordings with agent-browser in a Laravel project. Applies to any visual capture command including screenshot, pdf, and record.