agentleFS
PradnyeshpPradnyeshp/Claude-Skills/.claude/skills/graphql/SKILL.md

graphql

Skill2 starsChanged 4 months agoMITView on GitHub

Write, explain, or optimize a GraphQL operation or schema — queries, mutations, fragments, resolvers — with attention to the real schema, over-fetching, and the N+1 problem. Use when the user says "write a GraphQL query", "explain this query", "why is this resolver slow", "design a GraphQL schema", "fix N+1 in resolvers", or pastes an operation and asks what it does.

25 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use oauth-oidc, ssti and 9 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.
  • SubhiSecSkill

    oauth-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

  • SubhiSecSkill

    ssti

    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

  • blacklanternsecuritySkill

    ssrf

    Guide server-side request forgery (SSRF) exploitation during authorized penetration testing.

    Also in 5 projects that use this

  • blacklanternsecuritySkill

    jwt-attacks

    Exploit JWT (JSON Web Token) vulnerabilities during authorized penetration testing.

    Also in 3 projects that use this

  • zebbernSkill

    subdomain-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

  • iAskShahramSkill

    file-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

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 3 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 20 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Call out the assumption about schema shape and how variables are supplied.

    line 26
  2. Distinctive:

    Never guess at schema field/type names silently — verify against the SDL/type defs or state the assumption.

    line 40
  3. Distinctive:

    Treat the N+1 resolver problem as the default suspect for slow list queries — don't optimize blindly without naming the batching fix.

    line 42

“Common” is measured: kept by at least 6 in 10 of the 20 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Schema & resolver hints

!find . -type d \( -name node_modules -o -name .git -o -name dist -o -name build \) -prune -o -type f \( -iname '*.graphql' -o -iname '*.gql' -o -iname 'schema.*' -o -iname '*resolver*' -o -iname '*typedefs*' \) -print 2>/dev/null | head -20

Instructions

Handle the GraphQL request in $ARGUMENTS. It's one of: write an operation/schema from a description, explain a given operation, or optimize a slow query/resolver. If unclear, ask which.

Determine the schema first

  • Find the real schema (SDL .graphql files, code-first type defs, or introspection) and use actual type, field, and argument names. Don't invent fields; if the schema is unknown, state your assumptions explicitly.
  • Note the server/framework (Apollo, GraphQL Yoga, Nexus, graphql-ruby, Strawberry, Hasura) since resolver patterns and tooling differ.

Writing an operation or schema

  1. Produce a valid operation: a named operation, typed $variables (not inline literals), only the fields actually needed, and fragments for reused selections.
  2. For schema design: model nullability deliberately, use enums/interfaces/unions where they fit, follow connection/edge pagination conventions for lists, and keep mutations returning the affected object (and a payload type) rather than a bare scalar.
  3. Call out the assumption about schema shape and how variables are supplied.

Explaining an operation

Walk the selection set from the root field outward: what each field, argument, fragment, and directive resolves to, and what the response shape looks like. Flag surprises — deeply nested selections that fan out, fields with side-effectful resolvers, or aliases that mask multiple calls to the same field.

Optimizing

  1. Identify the likely cost: N+1 resolvers (the classic — a list field whose item resolver hits the DB per element), over-fetching deep nested selections, missing pagination, or unbounded query depth/complexity.
  2. Recommend concrete fixes: a DataLoader/batch-load to collapse N+1, pagination on list fields, query depth/complexity limits, projecting only requested fields to the data source, and caching where appropriate. Show the improved operation or resolver sketch.
  3. Suggest measuring with the server's tracing/extensions timing to confirm the win.

Rules

  1. Never guess at schema field/type names silently — verify against the SDL/type defs or state the assumption.
  2. Validate operations against the schema's nullability and argument types; flag a selection that wouldn't type-check.
  3. Treat the N+1 resolver problem as the default suspect for slow list queries — don't optimize blindly without naming the batching fix.
  4. Watch security/cost: recommend depth/complexity limits and pagination for any client-facing schema, and don't expose unbounded list fields without them.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.