agentleFS
KIMJINWOO4KIMJINWOO4/vue-skills/skills/vue-data/SKILL.md

vue-data

Skill28 starsChanged 30 days agoMITView on GitHub

Server state and data fetching in Vue 3. Pinia Colada queries and mutations, caching, invalidation, optimistic updates, Vue Router data loaders, race conditions, abort, SSR payloads, and choosing between fetch layers. Use when fetching API data, caching server responses, handling loading and error states, or wiring mutations in a Vue app.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    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:

    Every query key includes every input the request depends on.

    line 27

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “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

Vue Data Fetching

Versions checked on 2026-10-15: @pinia/colada 1.4.8 (stable, works with Pinia 4), Vue Router 5.4 data loaders (still experimental), @tanstack/vue-query 5. Nuxt apps start with useFetch and useAsyncData (nuxt skill).

Core rule

Server state is not client state. API data does not belong in hand-written Pinia stores with loading and error flags. A query layer owns caching, deduplication, invalidation and the request lifecycle. Pinia stores keep state the client owns: session, preferences, drafts.

Decision table

SituationUse
Vue SPA fetching REST or GraphQLPinia Colada useQuery and useMutation
Data must be ready before the route rendersData loaders (defineColadaLoader, defineBasicLoader) from vue-router/experimental
Nuxt appuseFetch or useAsyncData (SSR payload, Nitro aware)
Project already uses TanStack QueryKeep TanStack Vue Query
One-off call with no cache impact, such as a form submit$fetch or ofetch in the event handler
Static lookup fetched once at startupA composable with a module-level cache (not on SSR)

Checks before you finish

  • Every query key includes every input the request depends on.
  • Mutations invalidate or update the queries they affect.
  • Loading, error and empty states each render something deliberate.
  • Requests started by a watcher are cancelled or ignored when their inputs change.
  • On SSR, nothing user-specific is cached at module level.

References

TopicPath
Pinia Colada: keys, invalidation, optimistic updates, SSRpinia-colada
Data loaders with Vue Router 5data-loaders
Race conditions, AbortSignal, error handling, layeringpatterns

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.