graphql
Skill33 starsChanged 22 days agoMITView on GitHub
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.
We split this skill into the rules it gives an agent
2 rules. 0 are common, 0 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 18 edited versions we read keep these.
0
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
- Very specific: line 53
Never expose an unbounded list field.
- Very specific: line 56
Do not version a GraphQL schema.
“Common” is measured: kept by at least 6 in 10 of the 18 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
GraphQL
Purpose
Design a GraphQL schema that models the domain rather than the database, and operate it without letting a single query take down the service.
When to Use
- Designing a GraphQL schema from scratch.
- Diagnosing slow queries or N+1 resolver behavior.
- Protecting a public GraphQL endpoint from expensive queries.
- Splitting a schema across services with federation.
Capabilities
- Schema design: types, interfaces, unions, connections, nullability.
- Resolver architecture and DataLoader batching.
- Query cost analysis, depth limiting, and persisted queries.
- Error handling that distinguishes partial failures from total ones.
- Federation and schema composition.
Inputs
- The domain model and the client's actual query patterns.
- The data sources behind each field.
- Whether the endpoint is public (untrusted queries) or internal.
Outputs
- A schema with deliberate nullability and stable field names.
- Resolvers that batch, with no N+1 on any documented query.
- Cost limits and a persisted-query allow-list for public endpoints.
Workflow
- 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.
- 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.
- Batch every relation — Every resolver that fetches by id gets a DataLoader. Without one,
orders { customer { name } }issues one query per order. - Bound the cost — Depth limit, complexity limit, and pagination caps. Then persisted queries for first-party clients.
- Model errors explicitly — Expected failures (validation, not found) belong in the schema as union results; unexpected failures go to
errors.
Best Practices
- Never expose an unbounded list field. Use the Connection pattern with a
first/aftercap. DataLoaderinstances are per-request. A shared loader is a cache-poisoning bug across users.- Changing a field from nullable to non-null is a breaking change for clients that handle null; the reverse is breaking for clients that do not. Get it right before launch.
- Do not version a GraphQL schema. Add fields, deprecate old ones with
@deprecated(reason:), and remove them once usage reaches zero. - Instrument per-field resolver latency. The slow field is never the one you would guess.
- Introspection on a public production endpoint is a reconnaissance gift. Disable it or restrict it.
Examples
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.
Notes
- Query complexity limits must be tuned against real queries, not guessed. Log the complexity of every production query for a week before enforcing a ceiling.
- Federation solves an organizational problem (independent teams owning parts of the graph), not a technical one. If one team owns the whole schema, a single service is simpler.
- GraphQL over HTTP GET with persisted queries restores CDN caching, which naive POST-based GraphQL throws away.
Other versions21 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 21
- ParabolInc/parabol★ 2ksame name
- Mindrally/skills★ 275same name
- kid-sid/claude-spellbook★ 190same name
- TheBeardedBearSAS/claude-craft★ 108same name
- SubhiSec/claude-ai-cyber-security-skills★ 45same name
- 0xGhostCAT/claude-ai-cyber-security-skills★ 41same name
- G1Joshi/Agent-Skills★ 15same name
- crowdin/skills★ 9same name
- xfstudio/skills★ 9same name
- muon-m2/magento2-tools★ 6same name
11 more not listed
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.
Used alongsideProjects with it also use ssti, oauth-oidc and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
SubhiSecSkillssti
Hunt Server-Side Template Injection (SSTI) in Jinja2, Twig, Freemarker, Velocity, Smarty, ERB, Handlebars, Mustache, and Spring (SpEL). Use when input is reflected in a way that suggests template rendering — error pages, email templates, PDF generators, dynamic content systems.
Also in 5 projects that use this
SubhiSecSkilloauth-oidc
Hunt OAuth 2.0 and OIDC flaws — redirect_uri abuse, state CSRF, PKCE bypass, scope manipulation, implicit-flow token theft, postMessage origin tricks, ID token sub claim swap, JWKS confusion, response_type confusion, and OAuth-CSRF. Use when an app has Google/GitHub/Facebook/Apple/custom OAuth or OpenID Connect.
Also in 3 projects that use this
blacklanternsecuritySkillssrf
Guide server-side request forgery (SSRF) exploitation during authorized penetration testing.
Also in 5 projects that use this
zebbernSkillsubdomain-enum
Enumerate subdomains for a target domain using passive and active reconnaissance techniques. Use when starting reconnaissance on a new target, when you need to discover the attack surface, when expanding scope from a root domain, or when the user provides a domain to investigate.
Also in 3 projects that use this
blacklanternsecuritySkilljwt-attacks
Exploit JWT (JSON Web Token) vulnerabilities during authorized penetration testing.
Also in 3 projects that use this
iAskShahramSkillfile-upload
Uploads a local file to Cloudflare R2 bucket `public` with wrangler and returns the public URL on assets.shahram.dev. Use when the user wants a public link, public URL, or to host/upload a local image or file to R2.
Also in 4 projects that use this
- +3 more from SubhiSec
- +1 more from blacklanternsecurity
In this repository137 other files it gives its agents.
- agent-instructionsSkill
- agent-memorySkill
- hooksSkill
- plugin-developmentSkill
- skill-authoringSkill
- skill-reviewSkill
- slash-commandsSkill
- subagentsSkill
- agent-designSkill
- context-engineeringSkill
- fine-tuningSkill
- llm-cost-optimizationSkill
- llm-evaluationSkill
- llm-integrationSkill
- mcp-serverSkill
- ml-pipelineSkill
- model-selectionSkill
- prompt-engineeringSkill
- ragSkill
- structured-outputSkill
- api-designSkill
- background-jobsSkill
- cachingSkill
- djangoSkill
- event-driven-architectureSkill
- fastapiSkill
- microservicesSkill
- nestjsSkill
- realtime-websocketsSkill
- spring-bootSkill
- competitive-analysisSkill
- lead-researchSkill
- product-analysisSkill
- resumeSkill
- user-researchSkill
- database-performanceSkill
- data-modelingSkill
- data-qualitySkill
- pandasSkill
- postgresSkill
- sparkSkill
- brand-guidelinesSkill
- generative-artSkill
- themingSkill
- ui-reviewSkill
- visual-designSkill
- architecture-decisionsSkill
- bug-fix-protocolSkill
- cli-developmentSkill
- code-reviewSkill
- debuggingSkill
- design-patternsSkill
- domain-modelingSkill
- git-workflowSkill
- legacy-modernizationSkill
- refactoringSkill
- repository-explorationSkill
- simple-designSkill
- system-designSkill
- aws-cdkSkill
- The first 60 shown.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
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.

