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/perniemann/pnCoreWrote 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/perniemann/pncore/pn-php-backend)<a href="https://agentmods.dev/rules/perniemann/pncore/pn-php-backend"><img src="https://agentmods.dev/badge/rules/perniemann/pncore/pn-php-backend/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/perniemann/pncore/pn-php-backend"><img src="https://agentmods.dev/badge/rules/perniemann/pncore/pn-php-backend.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.00893 |
| Opus 5.5 | $0.00000 | $0.00357 |
| Sonnet 5.5 | $0.00000 | $0.00179 |
| Haiku 4.5 | $0.00000 | $0.00089 |
Grade A, and why
pn-php-backend 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 — 51 lines — stays where its author put it; the contents beside it link to each section on GitHub.
PHP / backend rules
Style and typing
- Use
declare(strict_types=1)at the top of every file. - Type declarations for all function parameters and return types. Use union types (
string|int) and nullable types (?string) where needed. Avoidmixedexcept at true boundaries. - Follow PSR-12 coding style. Use a formatter (PHP CS Fixer or Pint for Laravel) — style should be automated, not debated.
- Named arguments for clarity in calls with 3+ parameters or boolean flags:
createUser(name: 'Alice', role: 'admin', sendEmail: true).
Laravel conventions
- Use Eloquent scopes, resource controllers, and form request classes. Business logic belongs in service classes, not controllers.
- Form Request classes (
App\Http\Requests\) for all input validation — not inline$request->validate()in controllers. - Use Eloquent relationships correctly:
->with(['orders'])for eager loading; never load relationships inside loops. - Events and Listeners for decoupled side effects (sending emails, updating search index) rather than fat service methods.
- Use
php artisan make:model -mfsc(migration, factory, seeder, controller) — follow the resource pattern.
Secrets and config
- All secrets and config from environment variables:
env('VAR')(Laravel) orgetenv('VAR'). Never hardcode keys or passwords. - Use
vlucas/phpdotenvin non-Laravel projects. Never commit.envto git. Keep.env.examplewith placeholders. - Reference config via
config('services.stripe.key')(Laravel) — neverenv()directly in business logic (config is cached;env()does not work afterphp artisan config:cache).
Error handling
- Catch specific exception classes in try/catch, not bare
catch (\Exception $e)for everything. - In Laravel: extend
App\Exceptions\Handlerto centralize error formatting. Return consistent JSON shapes for API responses. - Return consistent error shapes:
{ "error": { "code": string, "message": string, "requestId": string } }. - Use Laravel's
Log::warning(),Log::error()with context arrays — notechoorvar_dump.
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 · 51 lines · 0 tokens per session scan A 70510945bbf5
pn-php-backend is a cursor rule published in the GitHub repository perniemann/pnCore (0 stars, last pushed 5d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 893 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
python--typescript-guide-cursorrules-prompt-file
Cursor rules for Python development with TypeScript guide integration.
nestjs-best-practices
../../.claude/rules/nestjs-best-practices.md.
backend-stack-rules
A set of rules for backend code using Next.js API Routes, TypeScript, Zod validation, optional authentication, and a project-selected database tool.
tsoa-rules
This document outlines comprehensive guidelines and best practices for developing Node.js server-side applications with tsoa, focusing on TypeScript for type safety and OpenAPI specification generation.
api-design-typescript
API Design for TypeScript — Express, NestJS, Fastify patterns, middleware, validation, and error handling. Extends core/rules/api-design.mdc with TypeScript-specific guidance.
typescript
Cursor rule "typescript" from girijashankarj/cursor-handbook, covering backend: typescript, strictness, types and conventions.