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/waynesutton/promptstack/clerk-auth-checkgit clone --depth 1 https://github.com/waynesutton/promptstackWhat 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.00642 |
| Opus 5 | $0.00000 | $0.00321 |
| Sonnet 5 | $0.00000 | $0.00128 |
| Haiku 4.5 | $0.00000 | $0.00064 |
Grade A, and why
clerk-auth-check scanned grade A with 0 findings 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.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
What it actually says
This rule helps ensure that React components using Convex queries with Clerk authentication correctly handle loading and authentication states before attempting to fetch data, especially for admin-protected queries.
name: convex-clerk-admin-auth-guard
description: Ensures React components correctly handle auth state before calling admin-protected Convex queries.
globs: src/**/*.{ts,tsx}
condition: |
// Heuristic: Component uses useQuery/usePaginatedQuery for an "admin" query
// AND does NOT seem to have robust useConvexAuth handling for skipping.
// This is a simplified check; real implementation might need more sophisticated AST parsing.
const fileContent = ctx.currentFile.content;
const usesAdminQuery = /use(Query|PaginatedQuery)\\s*\\(\\s*api\\.\\w+\\.\\w+Admin/.test(fileContent);
const usesConvexAuth = /useConvexAuth\\s*\\(\s*\\)/.test(fileContent);
const hasSkipLogic = /authIsLoading\\s*\\|\\|\\s*!isAuthenticated\\s*\\?\\s*\"skip\"/.test(fileContent);
if (usesAdminQuery && (!usesConvexAuth || !hasSkipLogic)) {
return true; // Condition met to offer advice
}
return false;
advice: |
When using Convex queries that require admin authentication (often named like `...Admin`) with Clerk, ensure your React component correctly handles authentication states to prevent errors:
1. **Use `useConvexAuth`**: Get `authIsLoading` and `isAuthenticated`.
```tsx
import { useConvexAuth } from "convex/react";
// ...
const { isLoading: authIsLoading, isAuthenticated } = useConvexAuth();
```
2. **Handle Auth Loading**: Display a loading message if `authIsLoading` is true.
```tsx
if (authIsLoading) {
return <div>Loading authentication...</div>;
}
```
3. **Handle Not Authenticated**: (Optional, but good for UX if routing doesn't cover it)
If not `authIsLoading` and not `isAuthenticated`, prompt for login.
```tsx
if (!isAuthenticated) {
return <div>Please log in to access this section.</div>;
}
```
4. **Conditionally Skip Queries**: Pass `"skip"` to `useQuery` or `usePaginatedQuery` if `authIsLoading` or `!isAuthenticated`.
```tsx
const adminData = useQuery(
api.yourModule.yourAdminQuery,
(authIsLoading || !isAuthenticated) ? "skip" : { /* your_args */ }
);
```
This prevents queries from running before authentication is resolved, avoiding "No identity found" errors from `requireAdminRole` in your Convex functions.
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 · 61 lines · 0 tokens per session scan A 7524c0c0d45d
clerk-auth-check is a cursor rule published in the GitHub repository waynesutton/promptstack (76 stars, last pushed 1y ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 642 tokens. A static security scan graded it A with 0 findings. 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
README
Professional README Standards for GitHub OSS Projects - Design, Structure, and Best Practices.
Documentation
Professional Documentation Standards for GitHub OSS Projects - Developer, Collaborator, and User Readiness.
audit
Code Audit Practices and Security Assessment Standards.
backend
Backend Development Practices and API Design Standards.
ci
CI/CD Pipeline Practices and DevOps Automation Standards.
finetune
AI Model Fine-Tuning Practices and Machine Learning Standards.