Conventions and best practices for Inertia.js apps with React or Vue — directory structure, page components, forms, shared data, navigation, and partial reloads.
67
84%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Passed
No findings from the security scan
Use when implementing or reviewing Inertia.js pages, components, forms, or navigation in a Laravel app (React or Vue).
resources/js/
common/ # shared UI primitives
modules/ # feature/domain code
pages/ # Inertia-rendered pages (mirrors URL structure)
shadcn/ # generated shadcn-ui (React) — do not edit directly
lib/ # third-party UI library components (Vue)
app.tsx / app.tsPage components — suffix Page, default export, typed props:
interface PostsIndexPageProps { posts: Post[] }
export default function PostsIndexPage({ posts }: PostsIndexPageProps) { ... }Components — one per .tsx file, function declaration, PascalCase filename:
export function Button({ children }: ButtonProps) { ... } // Button.tsxForms — use useForm, never raw axios/fetch:
const { data, setData, post, processing, errors } = useForm({ title: '' });Shared data — use usePage<SharedProps>().props, not prop drilling:
const { auth } = usePage<SharedProps>().props;Navigation — use <Link>, not <a>:
<Link href="/posts">View Posts</Link>Page components — suffix Page, default export via <script setup>:
<!-- PostsIndexPage.vue -->
<script setup lang="ts">
defineProps<{ posts: Post[] }>();
</script>Components — one per .vue file, PascalCase filename, prefer <script setup> + Composition API.
Third-party UI — keep under lib/, wrap in common/ with a project-friendly API.
.ts.@/common/button/Button.router.reload({ only: ['propName'] }) instead of full visits to refresh one prop.Inertia::defer() on the server to load after first render.See rulebook.json entries INRT-001–INRT-010 (React) and INRT-VUE-001–INRT-VUE-005 (Vue).
22c7c54
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.