add-resource
Skill0 starsChanged 6 months agoMITView on GitHub
Use when adding a new full-stack CRUD resource (e.g. "add a Comments resource"). Walks through Prisma model, Zod schema, tRPC router, and React page in order. Mirrors the patterns already used by Contact/Task/Project.
5 other projects use a version of this.
Adopted by
Most recently taken up by
- deepmodeling/Uni-Lab-OStheir own version, first seen Oct 8, 2026
- luxury-yacht/apptheir own version, first seen Oct 8, 2026
- ficaviolaodorata520/met-museum-mcp-servertheir own version, first seen Jun 1, 2026
- PostHog/posthog-definitionstheir own version, first seen May 14, 2026
- Bufferoverflovv/FastMCP-Blueprinttheir own version, first seen Apr 5, 2026
Other versions5 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 5
- luxury-yacht/app★ 446same name
- deepmodeling/Uni-Lab-OS★ 178same name
- PostHog/posthog-definitions★ 16same name
- Bufferoverflovv/FastMCP-Blueprint★ 0same name
- ficaviolaodorata520/met-museum-mcp-server★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository7 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- deploy-checklistSkill
- onboard-an-agentSkill
- remove-demo-codeSkill
- self-correcting-loopSkill
The file
We split this skill into the rules it gives an agent
3 rules. 0 are common, 1 is distinctive, and 2 are very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
1
Distinctive
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
- Distinctive: line 8
Add a new full-stack CRUD resource end-to-end.
- Very specific: line 127
Add a basic form test (see src/client/__tests__/ContactForm.test.tsx) and/or a router validation test (see …
- Very specific: line 136
If pre-commit complains: read all errors, fix in one pass, retry.
“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Add a resource
Add a new full-stack CRUD resource end-to-end. Total time: ~10 minutes for a simple resource.
Reference: The Contact resource is the simplest existing example. Read it before you start:
prisma/schema.prisma—model Contactsrc/shared/schemas/contact.ts— Zod schemassrc/server/routers/contact.ts— tRPC router (list, byId, create, update, delete)src/client/components/ContactForm.tsx— RHF + Zod formsrc/client/pages/ContactsPage.tsx— page with table, dialog, mutations
Ordered steps
Replace Widget / widget with your resource name throughout.
1. Database — prisma/schema.prisma
model Widget {
id Int @id @default(autoincrement())
name String
notes String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}npm run db:migrate # generate + apply migration; name it "add_widget"2. Shared schema — src/shared/schemas/widget.ts
import { z } from 'zod';
export const widgetInput = z.object({
name: z.string().min(1).max(200),
notes: z.string().max(2000).optional().nullable(),
});
export type WidgetInput = z.infer<typeof widgetInput>;
export const widgetUpdateInput = widgetInput.partial().extend({
id: z.number().int().positive(),
});
export type WidgetUpdateInput = z.infer<typeof widgetUpdateInput>;Then export it from src/shared/schemas/index.ts:
export * from './widget.js';3. tRPC router — src/server/routers/widget.ts
Copy src/server/routers/contact.ts and adapt:
import { TRPCError } from '@trpc/server';
import { z } from 'zod';
import { widgetInput, widgetUpdateInput } from '../../shared/schemas/index.js';
import { publicProcedure, router } from '../trpc.js';
const idInput = z.object({ id: z.number().int().positive() });
export const widgetRouter = router({
list: publicProcedure.query(({ ctx }) =>
ctx.prisma.widget.findMany({ orderBy: { createdAt: 'desc' } }),
),
byId: publicProcedure.input(idInput).query(async ({ ctx, input }) => {
const w = await ctx.prisma.widget.findUnique({ where: { id: input.id } });
if (!w) throw new TRPCError({ code: 'NOT_FOUND', message: 'Widget not found' });
return w;
}),
create: publicProcedure
.input(widgetInput)
.mutation(({ ctx, input }) => ctx.prisma.widget.create({ data: input })),
update: publicProcedure.input(widgetUpdateInput).mutation(({ ctx, input }) => {
const { id, ...data } = input;
return ctx.prisma.widget.update({ where: { id }, data });
}),
delete: publicProcedure.input(idInput).mutation(async ({ ctx, input }) => {
await ctx.prisma.widget.delete({ where: { id: input.id } });
return { ok: true };
}),
});Wire it into src/server/routers/index.ts:
import { widgetRouter } from './widget.js';
export const appRouter = router({
contact: contactRouter,
task: taskRouter,
project: projectRouter,
widget: widgetRouter, // ← add
});4. Client form — src/client/components/WidgetForm.tsx
Copy ContactForm.tsx and adapt — same pattern, RHF + Zod resolver.
5. Client page — src/client/pages/WidgetsPage.tsx
Copy ContactsPage.tsx and adapt. Wire the route in src/client/App.tsx:
<Route path="/widgets" element={<WidgetsPage />} />And the nav button in the same file.
6. Test
Add a basic form test (see src/client/__tests__/ContactForm.test.tsx) and/or a router validation test (see src/server/__tests__/contact.router.test.ts).
7. Commit
git add prisma src
git commit -m "feat(widget): add Widget CRUD resource"If pre-commit complains: read all errors, fix in one pass, retry. See self-correcting-loop.
Checklist
- Prisma model added + migration applied
- Zod schema in
src/shared/schemas/+ re-exported fromindex.ts - tRPC router has all 5 operations: list, byId, create, update, delete
- Router registered in
src/server/routers/index.ts - Client form component using RHF + Zod resolver
- Client page with table, create/edit dialog, mutations using
trpc.widget.* - Route + nav button added to
App.tsx - At least one test added
npm run typecheck && npm run lint && npm run test:runall pass- Conventional commit message
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
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.

