frontend-data-consumer
Skill2 starsChanged 5 days agoMITView on GitHub
Ingests backend API contracts and scaffolds high-quality, typed React/Vue components (Data Tables, Detail Cards, Forms) using a specific design system (like Tailwind or Shadcn/UI). Use when a user wants to build a UI for their backend API or data platform.
- Sends data out
In this repository8 other files it gives its agents.
- AGENTS.mdAGENTS.md
- api-test-generatorSkill
- cloud-solution-architectSkill
- context7-mcpSkill
- forgeSkill
- frontend-design-reviewSkill
- infrastructure-as-code-architectSkill
- ship-to-vpsSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 4 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 11
When the backend has been scaffolded and the user wants to start building the frontend features.
- Distinctive: line 12
When you need to generate a React or Vue component that reads or writes to a specific API endpoint.
- Distinctive: line 13
When generating admin dashboards, data tables, or forms based on database tables.
- Distinctive: line 70
Never return a component that crashes when data is fetching or fails.
- Very specific: line 71
Always handle the isLoading or isPending state with skeletons or spinners.
- Very specific: line 72
Always handle the isError state with a friendly error message or fallback UI.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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.
Files
Frontend Data Consumer
Automatically convert backend API contracts, database schemas, or ORM models into fully functional, strongly-typed frontend components. This skill is the perfect companion to the forge backend generator.
🎯 When to Use
- When the backend has been scaffolded and the user wants to start building the frontend features.
- When you need to generate a React or Vue component that reads or writes to a specific API endpoint.
- When generating admin dashboards, data tables, or forms based on database tables.
- Works perfectly alongside the
frontend-design-reviewskill to refine the generated UI.
🛠️ Step-by-Step Workflow
1. Analyze the Backend Contracts
- Locate the backend API routers/controllers, DTOs, or ORM schemas (e.g., Prisma schema, SQLAlchemy models).
- Understand the exact shape of the data returned by the
GETendpoints. - Understand the required payloads for the
POST/PUT/PATCHendpoints.
2. Scaffold Frontend API Hooks/Services
Once the data shape is known, generate the data-fetching layer in the frontend using modern libraries (e.g., React Query, SWR, or RTK Query for React; Vue Query for Vue).
Example (React Query):
// hooks/useUsers.ts
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';
import { User, CreateUserDto } from '../types/api';
export const useUsers = () => {
return useQuery<User[], Error>({
queryKey: ['users'],
queryFn: async () => {
const response = await fetch('/api/users');
if (!response.ok) throw new Error('Failed to fetch users');
return response.json();
},
});
};
export const useCreateUser = () => {
const queryClient = useQueryClient();
return useMutation({
mutationFn: async (newUser: CreateUserDto) => {
const response = await fetch('/api/users', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(newUser),
});
if (!response.ok) throw new Error('Failed to create user');
return response.json();
},
onSuccess: () => {
queryClient.invalidateQueries({ queryKey: ['users'] });
},
});
};3. Generate UI Components
Based on the API contracts, scaffold the necessary UI components. Always use the project's preferred styling solution (TailwindCSS, CSS Modules, Styled Components, Shadcn/UI, Material UI).
- Data Tables: Map array responses to robust data tables (with pagination and sorting if supported by the backend).
- Forms: Generate creation/edit forms using a library like
react-hook-formpaired withzodvalidation that matches the backend rules exactly. - Detail Views: Generate read-only detail cards for individual records.
4. Implement Loading & Error States
Never return a component that crashes when data is fetching or fails.
- Always handle the
isLoadingorisPendingstate with skeletons or spinners. - Always handle the
isErrorstate with a friendly error message or fallback UI.
5. Finalize UI Contracts (No Hardcoding)
Adhere strictly to this rule: Never hardcode static arrays representing business entities. The components must always consume the generated API hooks. If the backend endpoint doesn't exist yet, the hook should query a real endpoint path even if it currently 404s, so the wiring is ready to go.
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
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.

