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/bernierllc/agents-environment-configWrote 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/bernierllc/agents-environment-config/app-router)<a href="https://agentmods.dev/rules/bernierllc/agents-environment-config/app-router"><img src="https://agentmods.dev/badge/rules/bernierllc/agents-environment-config/app-router/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/bernierllc/agents-environment-config/app-router"><img src="https://agentmods.dev/badge/rules/bernierllc/agents-environment-config/app-router.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.01492 |
| Opus 5.5 | $0.00000 | $0.00597 |
| Sonnet 5.5 | $0.00000 | $0.00298 |
| Haiku 4.5 | $0.00000 | $0.00149 |
Grade A, and why
app-router 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.
How it starts
The opening of the file, as written. The whole thing — 225 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Next.js App Router & React Standards
Next.js App Router Patterns
Server Components (Default)
Server components are the default in Next.js App Router. Only use client components when interactivity is needed.
// ✅ DEFAULT: Server Component (no 'use client')
export default function Page() {
// Server-side rendering by default
return <div>Server Component</div>;
}
Client Components (Explicit)
Only mark components as client components when they need interactivity.
// ✅ EXPLICIT: Only when needed
'use client';
import { useState } from 'react';
export function InteractiveButton() {
const [count, setCount] = useState(0);
return <button onClick={() => setCount(c => c + 1)}>{count}</button>;
}
File Structure (App Router)
src/app/
├── layout.tsx # Root layout
├── page.tsx # Home page
├── loading.tsx # Loading UI
├── error.tsx # Error boundary
├── not-found.tsx # 404 page
├── dashboard/
│ ├── layout.tsx # Nested layout
│ ├── page.tsx # Dashboard page
│ └── users/
│ └── page.tsx # Users page
└── api/
└── users/
└── route.ts # API endpoint
Component Standards
Functional Components with TypeScript
All React components must have proper TypeScript interfaces and explicit return types.
// ✅ REQUIRED: Props interface + explicit return type
interface UserCardProps {
user: User;
onSelect?: (user: User) => void;
className?: string;
}
export function UserCard({
user,
onSelect,
className
}: UserCardProps): JSX.Element {
return (
<div
className={`border-gray-200 shadow-sm ${className}`}
onClick={() => onSelect?.(user)}
>
<h3 className="text-gray-900">{user.name}</h3>
<p className="text-gray-700">{user.email}</p>
</div>
);
}
Data Testid Requirements (MANDATORY)
Add data-testid to all interactive elements, dynamic state containers, and structural landmarks when building components. This is a build-time requirement, not a testing afterthought.
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 · 225 lines · 0 tokens per session scan A b93ddffb2b44
app-router is a cursor rule published in the GitHub repository bernierllc/agents-environment-config (11 stars, last pushed yesterday), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,492 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-31.
Other cursor rules, from other repositories
upgrade-tests
// ✅ CORRECT: Upgrade package pattern await using ctx = testReactResource(appRouter, { server: { // server configuration }, client(opts) { return { links: [ httpLink({ url: opts.httpUrl, // client configuration }), ], }; }, }).
agent-development
Python agents are typically in folders named agent-py/ or agent/ and use the sdk-python/ package.
test-running
When running tests, use the --watch false flag to avoid watch mode.
ai-collaboration
Instructions for AI agent code generation workflow.
context-management
Context window management — prevents AI from losing track during long sessions.
hydration-safety
React hydration mismatch prevention.