agent-instructions
Use when writing project instructions for a coding agent (CLAUDE.md, AGENTS.md, or equivalent). Covers what belongs in them, what…
Use when designing or operating a GraphQL API. Covers schema design, resolver performance and DataLoader batching, query cost limiting, error handling, and federation. Trigger on "graphql query is slow", "n+1 in my resolvers", "set up dataloader", "limit query depth on our
Claude Code
$ npx -y skills add nimadorostkar/Claude-Skills-collection --skill graphql --agent claude-code
Codex
$ npx skills add nimadorostkar/Claude-Skills-collection --skill graphql -a codex -y
Cursor
$ npx skills add nimadorostkar/Claude-Skills-collection --skill graphql -a cursor -y
Gemini CLI
$ npx skills add nimadorostkar/Claude-Skills-collection --skill graphql -a gemini-cli -y
GitHub Copilot
$ npx skills add nimadorostkar/Claude-Skills-collection --skill graphql -a github-copilot -y
OpenCode
$ npx skills add nimadorostkar/Claude-Skills-collection --skill graphql -a opencode -y
Windsurf
$ npx skills add nimadorostkar/Claude-Skills-collection --skill graphql -a windsurf -y
name: graphql description: Use when designing or operating a GraphQL API. Covers schema design, resolver performance and DataLoader batching, query cost limiting, error handling, and federation. Trigger on "graphql query is slow", "n+1 in my resolvers", "set up dataloader", "limit query depth on our graphql endpoint". Do not use for REST endpoint design — see the api-design skill. metadata: category: backend version: 1.0.0 tags: [graphql, schema, dataloader, federation, performance]
Design a GraphQL schema that models the domain rather than the database, and operate it without letting a single query take down the service.
1. **Design for the client, not the tables** — The schema is a product surface. If it mirrors your database, you have built a slower REST API with worse caching. 2. **Get nullability right early** — A nullable field is a permanent client burden; a non-null field that later fails takes down the whole parent object. Non-null for genuine invariants only. 3. **Batch every relation** — Every resolver that fetches by id gets a DataLoader. Without one, `orders { customer { name } }` issues one query per order. 4. **Bound the cost** — Depth limit, complexity limit, and pagination caps. Then persisted queries for first-party clients. 5. **Model errors explicitly** — Expected failures (validation, not found) belong in the schema as union results; unexpected failures go to `errors`.
**DataLoader eliminating an N+1:**
// Without a loader: 1 query for orders, then N queries for customers.
const resolvers = {
Order: {
customer: (order, _args, ctx) => ctx.loaders.customer.load(order.customerId),
},
};
// The loader batches every customerId requested in the same tick into one query.
export function createLoaders(db: Db) {
return {
customer: new DataLoader<string, Customer>(async (ids) => {
const rows = await db.customers.findMany({ where: { id: { in: [...ids] } } });
const byId = new Map(rows.map((r) => [r.id, r]));
return ids.map((id) => byId.get(id) ?? new Error(`Customer ${id} not found`));
}),
};
}**Expected failures modeled in the schema:**
union CreateOrderResult = Order | ValidationFailed | InsufficientInventory
type Mutation {
createOrder(input: CreateOrderInput!): CreateOrderResult!
}The client must handle each outcome. Business failures no longer masquerade as transport errors.
A curated library of 137 production-grade skills for Claude and other AI coding agents. Every skill follows one structure, speaks with one voice, and earns its place by changing what the agent does.
Use when writing project instructions for a coding agent (CLAUDE.md, AGENTS.md, or equivalent). Covers what belongs in them, what…
Use when an agent needs state that survives a session or a context compaction. Covers what to persist, file-based memory,…
Use when automating agent behavior with lifecycle hooks. Covers hook events, deterministic enforcement of rules the model should…
Use when packaging skills, commands, hooks, and MCP servers into a distributable plugin. Covers manifest structure, bundling,…
Use when writing a new skill for an AI agent. Covers scoping, description writing for reliable triggering, progressive…
Use when reviewing or improving an existing agent skill. Covers triggering accuracy, content quality, redundancy with the base…
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.