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.
git clone --depth 1 https://github.com/waynesutton/promptstackWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/rules/waynesutton/promptstack/clerk-auth-check)<a href="https://agentmods.dev/rules/waynesutton/promptstack/clerk-auth-check"><img src="https://agentmods.dev/badge/rules/waynesutton/promptstack/clerk-auth-check/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/rules/waynesutton/promptstack/clerk-auth-check"><img src="https://agentmods.dev/badge/rules/waynesutton/promptstack/clerk-auth-check.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What 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.1 | $0.00000 | $0.00642 |
| Opus 5.5 | $0.00000 | $0.00257 |
| Sonnet 5.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 1mo 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.
- 1mo 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 (78 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
tanstack-start-guide
TanStack Start best practices emphasizing client-first architecture, type safety, and modern React patterns.
new-component
Workflow for creating new React components.
tanstack-react-router_routing
TanStack Router: Routing.
project-structure
Folder layout for Next.js App Router and Vite + React variants.
react-basics-state
A set of React rules for managing shared application state with Context API and useReducer. React is a JavaScript library for building user interfaces; shared state is information used by multiple parts of an interface.
ui-ux
UI/UX Design Best Practices and Guidelines.