Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add rules/rm2thaddeus/pixel_detective/react-query-api-integrationgit clone --depth 1 https://github.com/rm2thaddeus/Pixel_DetectiveWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00000 | $0.01362 |
| Opus 5 | $0.00000 | $0.00681 |
| Sonnet 5 | $0.00000 | $0.00272 |
| Haiku 4.5 | $0.00000 | $0.00136 |
Grade A, and why
react-query-api-integration scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
const api = axios.create({ How it starts
The opening of the file, as written. The whole thing — 206 lines — stays where its author put it; the contents beside it link to each section on GitHub.
React Query & API Integration Patterns
🎯 MANDATORY: Use React Query for ALL Server State
Sprint 10 revealed that manual useEffect + useState patterns for API calls create unnecessary complexity and bugs. ALWAYS use React Query.
✅ CORRECT PATTERNS:
1. Query Hook Pattern
// ✅ Use useQuery for data fetching
function useCollections() {
return useQuery({
queryKey: ['collections'],
queryFn: async () => {
const response = await api.get('/api/v1/collections');
return response.data;
},
staleTime: 5 * 60 * 1000, // 5 minutes
retry: 3,
});
}
// ✅ Component usage
function CollectionsList() {
const { data: collections, isLoading, error } = useCollections();
if (isLoading) return <Spinner />;
if (error) return <ErrorAlert message={error.message} />;
return <CollectionGrid collections={collections} />;
}
2. Mutation Pattern
// ✅ Use useMutation for server modifications
function useCreateCollection() {
const queryClient = useQueryClient();
return useMutation({
mutationFn: async (data: CreateCollectionRequest) => {
const response = await api.post('/api/v1/collections', data);
return response.data;
},
onSuccess: () => {
// Invalidate and refetch collections
queryClient.invalidateQueries({ queryKey: ['collections'] });
toast.success('Collection created successfully');
},
onError: (error) => {
toast.error(`Failed to create collection: ${error.message}`);
},
});
}
3. Background Polling Pattern
// ✅ Job status polling with automatic cleanup
function useJobStatus(jobId: string | null) {
return useQuery({
queryKey: ['job-status', jobId],
queryFn: async () => {
if (!jobId) throw new Error('No job ID provided');
const response = await api.get(`/api/v1/ingest/status/${jobId}`);
return response.data;
},
enabled: !!jobId, // Only run when jobId exists
refetchInterval: (data) => {
// Stop polling when job is complete
if (data?.status === 'completed' || data?.status === 'failed') {
return false;
}
return 2000; // Poll every 2 seconds
},
retry: false, // Don't retry failed polls
});
}
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2d ago First seen · 206 lines · 0 tokens per session scan A 085cde1facbc
react-query-api-integration is a cursor rule published in the GitHub repository rm2thaddeus/Pixel_Detective (21 stars, last pushed 6mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,362 tokens. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other cursor rules, from other repositories
test-plan
Plan Katalon True Platform/TestOps testing for a release, sprint, or feature. Use when you need to translate quality goals into scope, prioritize testing by requirement coverage and risk, decide what to test first, or build the executable plan structure (folders, suites, and sprint/release association) that stands in…
cli-forge-schema
Generate GitHub-compatible Mermaid diagrams — auto-picks diagram type, splits complex ones, converts tables/kanban/PERT.
STAGE_S5_TEST_POINTS
AIDocxWorkFlow Stage 5 — 测试点生成(独立阶段).
sprint-planning
BMAD BMM Agent: sprint-planning.
head-of-product
Head of Product persona — planning, user stories, UX decisions, scope guardian. Use when discussing product strategy, PRDs, user research, feature proposals, or backlog prioritization.
angular-20
This rule provides comprehensive best practices and coding standards for Angular development, focusing on modern TypeScript, standalone components, signals, and performance optimizations.