GraphQL Schema Optimizer skill for Claude and Codex
A revised GraphQL schema tuned for runtime cost: query complexity brought under your ceiling, list fields paginated and bounded, cache-friendly field design…
Install it once and Claude or Codex runs it for you. When your request matches, your AI loads the skill, asks for anything it is missing, and works through the template itself. Prefer to fill it in by hand? See the full prompt template.
Download the skill (.zip) · View SKILL.md
When it is used
Use when a GraphQL schema allows queries that are too slow or expensive and needs pagination limits, complexity caps, cache-friendly field design, and N+1 fixes without breaking clients. Do not use for fixing schema validation errors, writing documentation, or a naming-only cleanup with a version bump. Related topics: coding, graphql.
What it will ask you for
- Existing SDL (longer free text)
- Performance focus (choose one: Reduce latency, Lower server load, Improve caching, Balance all)
- Naming convention to enforce (choose one: camelCase, PascalCase types with camelCase fields, snake_case, Leave as is)
- Types to leave untouched (free text, e.g. "Type names that must not change")
- Complexity ceiling per query (number from 10 to 10000)
- Known slow queries (longer free text)
- Documentation style (choose one: Inline comments, Separate markdown, Both)
How it works
- Estimate the worst-case query cost from unbounded lists, nesting depth, and fan-out fields, so the changes target what actually exceeds the ceiling.
- Bound every list with pagination arguments and a maximum page size, and annotate expensive fields with their complexity weight.
- Separate volatile fields from stable ones and keep entities keyed by stable ids so cache hints can apply, when the focus includes caching.
- Mark each N+1 field with the batching strategy it needs, and apply naming changes through deprecation aliases rather than hard renames.
- Write the revised SDL, the per-change table, and the recommendations list, leaving the protected types untouched.
What you get
A markdown document with the revised SDL in a graphql block, a table of modifications (type, field, change, reason), and a ranked list of performance recommendations.
What it watches out for
- Renaming fields outright for consistency, which is a breaking change that no performance gain justifies.
- Setting a complexity ceiling without weighting list fields by page size, so a request for 1000 items costs the same as one.
- Marking whole types as cacheable when one field on them changes every second, which serves stale data everywhere.
How to install
Claude.ai and the Claude desktop app
- Download the skill .zip.
- Open Settings, then Capabilities, and find Skills.
- Choose Upload skill and select the .zip.
- Ask Claude for help with the task. It loads the skill when your request matches.
Claude Code
- Download the skill .zip.
- Unzip it into ~/.claude/skills/ (or .claude/skills/ inside a project).
- Start a new session. Claude Code loads the skill when your request matches.
Codex
- Download the skill .zip.
- Unzip it into ~/.agents/skills/ (or .agents/skills/ inside a project).
- Codex picks it up on its own. Type $ and the skill name to use it, or just ask for the task.
Cursor
- Download the Cursor rule (.mdc).
- Save it in .cursor/rules/ inside your project.
- Cursor's agent applies the rule when your request matches its description.
AGENTS.md (Codex, Cursor, and other coding agents)
- Copy the AGENTS.md section.
- Paste it into AGENTS.md at the root of your repository, creating the file if needed.
- Coding agents that read AGENTS.md follow it when your request fits.