query-layer
Skill by EpicenterHQ
Guides edits to the TanStack Query integration in Epicenter's Whispering app. It covers query and mutation adapters, shared cache keys, and how service errors pass through to the UI. It is written for developers working on the query layer.
Install query-layer
Built from the published package, never by AI.
git clone --depth 1 https://github.com/EpicenterHQ/epicenter /tmp/epicenter && mkdir -p ~/.claude/skills && cp -r /tmp/epicenter/.agents/skills/query-layer ~/.claude/skills/query-layerRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/EpicenterHQ/epicenter /tmp/epicenter && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/epicenter/.agents/skills/query-layer ~/.gemini/antigravity-cli/skills/query-layerAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Skills can run scripts on your machine. Some need an API key: check the README.
About
This skill sets out patterns for the query layer, which sits between UI components and the service layer. It wraps service functions or observable operations with TanStack Query caching, mutation lifecycle state, and invalidation, using Wellcrafted factories such as resultQueryOptions, resultMutationOptions, defineQuery, defineMutation, and defineKeys. Adapters unwrap Results internally, and service and operation errors pass through to the report boundary.
The skill explains when to use reactive .options in Svelte hooks and when to use imperative calls such as .fetch(), .ensure(), or direct mutation calls. It sets rules for shared cache identity through exported *Keys maps and for deliberate cache updates. It is aimed at developers maintaining TanStack Query code in the Epicenter repository.
Written from the project's SKILL.md and checked against it.
What it can do
- Result query adaptersExplains resultQueryOptions for a Result-returning function used at one hook call site.
- Reusable query and mutation definitionsCovers defineQuery and defineMutation in shared $lib/queries modules.
- Shared cache keysDescribes defineKeys and the rule to export key maps beside the owning module.
- Reactive and imperative useShows createQuery and createMutation with .options, plus .fetch() and .ensure() calls.
- Adapter boundary guidanceSeparates shared query modules from orchestration in $lib/operations.
- Error pass-through rulesKeeps tagged service and operation errors intact for the UI or report layer.
- Cache update rulesAdvises invalidation or refetch unless optimistic writes have a clear owner and rollback.
Try asking
- Add a shared query definition for loading recording availability
- Explain when to use .fetch() versus .ensure() in this codebase
- Wire a service mutation into createMutation using defineMutation
Good to know
- The Whispering query modules the examples came from were removed, so the shape is a convention.
- Queries are not callable; they expose .options, .fetch(), and .ensure().
- Mutations do not expose .execute().
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: .agents/skills/query-layer/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Alternatives to query-layer
All alternatives →Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.
Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.
Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.
Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.
Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.
Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.
Compare with openclaw-github-repo-commander, gradio or hig-components-menus
query-layer: common questions
What does the query-layer skill cover?
It covers TanStack Query integration patterns, including createQuery, createMutation, defineQuery, defineMutation, defineKeys, and service-to-TanStack adapters. It is meant for editing that integration.
What is the difference between .fetch() and .ensure()?
Use .fetch() when TanStack should apply its normal staleness policy, so fresh cached data may return without a request. Use .ensure() when any cached data is acceptable and a fetch is needed only if the cache is empty.
Can I call a query like a function?
No. Queries are not callable and expose .options, .fetch(), and .ensure(). Mutations are callable and expose .options.
How do I install query-layer?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is query-layer free?
The code is published under the AGPL-3.0 licence. The service it connects to may have its own pricing.
Is query-layer safe to use?
It scores 77 of 100. Grades: maintenance A, licence C, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to query-layer?
Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.
