willyu1007/template-skill-basic/fetch-frontend-data
Claude Code and agent skill by willyu1007/template-skill-basic
Trust tier 3
- community
Source check pending
Checking that the SKILL.md file is still in the repository.
Fetch and mutate frontend data with a consistent cache strategy (query keys, invalidation, suspense/loading, error handling, optimistic updates).
Install
npx vskill@latest install willyu1007/template-skill-basic/fetch-frontend-dataSKILL.md
The same SKILL.md was published earlier as willyu1007/template-skill-basic/fetch-frontend-data.
Fetch Frontend Data
Purpose
Standardize how the UI fetches and mutates server data so loading/error states, caching, and invalidation are predictable.
When to use
Use this skill when you are:
- Adding a new API read or mutation
- Implementing server-state caching
- Introducing Suspense-based data loading (optional)
- Handling parallel data fetches and dependent queries
- Implementing optimistic updates
Inputs
- API endpoints and request/response DTOs
- Caching requirements (stale time, refetch behavior)
- UX expectations for loading and errors
- Existing query/cache library (if any)
Outputs
- Query key strategy and hooks
- Mutation strategy with invalidation
- Loading/error UX plan
- Example payloads and expected behavior
Rules
- Server state SHOULD be managed via a query/cache layer (not duplicated in local state).
- Query keys MUST be stable and consistent across the codebase.
- Mutations MUST define how cache is updated (invalidate, update cache, optimistic).
- Error states MUST be explicit and user-safe.
Steps
- Define a typed API client function (one responsibility per function).
- Define query keys and a query hook.
- Define mutation hooks with:
- invalidation strategy
- optimistic update (optional)
- Define loading and error UI state (or Suspense boundaries).
- Verify with:
- one successful fetch
- one failure response
- one mutation followed by refreshed UI state
Verification
- [ ] Query keys are stable and follow project conventions
- [ ] Successful fetch renders expected data
- [ ] Failed fetch renders error UI with user-safe message
- [ ] Mutation invalidates or updates cache correctly
- [ ] Loading state is visible during fetch
- [ ] Optimistic update reverts on failure (if implemented)
Boundaries
- MUST NOT duplicate server state in local state
- MUST NOT use inconsistent query key patterns
- MUST NOT skip error handling for mutations
- MUST NOT expose raw API errors to users
- SHOULD NOT refetch on every render (use appropriate stale time)
- SHOULD NOT implement optimistic updates without rollback logic
Included assets
- Templates:
./templates/includes query key patterns and hook scaffolds. - Examples:
./examples/includes cache-first, parallel fetch, and optimistic update patterns.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking.ai/skills/frontend/data/fetch-frontend-data/SKILL.md
Popularity
- 7-day trend score
- 5
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/willyu1007/template-skill-basic/fetch-frontend-data)