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/perniemann/pncore/pn-node-backendgit clone --depth 1 https://github.com/perniemann/pnCoreWhat 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.00711 |
| Opus 5 | $0.00000 | $0.00356 |
| Sonnet 5 | $0.00000 | $0.00142 |
| Haiku 4.5 | $0.00000 | $0.00071 |
Grade A, and why
pn-node-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 yesterday.
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 — 44 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Node / backend rules
Variables and style
- Prefer
constoverlet; useletonly when reassignment is needed. Never usevar. - Use async/await over raw promise chains. Never mix callbacks with promises in the same flow.
- TypeScript types or JSDoc at all public API boundaries; avoid
any. Useunknown+ type narrowing for external input. - Small functions, single responsibility. Handlers delegate to services — route files stay thin.
Secrets and config
- All config and secrets come from environment variables (
process.env.VAR). Never hardcode keys, passwords, or connection strings in source. - Validate required env vars at startup, not lazily at use-time:
if (!process.env.DB_URL) throw new Error("DB_URL is required"). - Keep a
.env.examplewith placeholder names; document every required variable in README. Never commit.envto git.
Error handling
- Catch errors at boundaries (route handlers, service entry points); propagate with
throwinternally. Never swallow errors silently. - Use a centralized Express error middleware — route handlers
throwor callnext(err); the middleware formats and sends the response. - Return consistent error shapes:
{ error: { code: string, message: string, requestId: string } }. - Map errors to correct HTTP status codes: 400 bad input, 401 unauthenticated, 403 forbidden, 404 not found, 422 validation failed, 429 rate limited, 500 unexpected.
- Use structured logging (pino, winston). Include
requestId,userId, and relevant IDs in every log line. Never log secrets or PII.
Security
- Parameterized queries always — never interpolate user input into SQL or commands.
- Validate and parse all request input before use. Use
zodor similar at route boundaries. - Scope data queries to the authenticated user's ID. Never trust a client-supplied
userId. - Apply
helmetfor security headers. Configure CORS with an explicit origin allowlist, not*. - Rate-limit auth routes (
/login,/register) more aggressively than general API routes.
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.
- yesterday First seen · 44 lines · 0 tokens per session scan A 752ff9db112f
pn-node-backend is a cursor rule published in the GitHub repository perniemann/pnCore (0 stars, last pushed 2d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 711 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
archcore-files
Enforce MCP-only operations when working with .archcore/ files.
x402-coding
@dexterai/x402 SDK conventions and hosted-only OpenDexter tool usage.
collate
你在 collate 插件环境下工作。这是一个中文历史文献 OCR + 校对工具包,完整契约见 AGENTS.md。.
web-shaders
Expertise for writing and debugging web shaders (GLSL/WGSL, WebGL2/WebGPU, Three.js, R3F).
agent-models
Agent model registry. Defines which model to use per role. Use [MODEL:X] signal to reference a role anywhere delegation occurs.
engineering-standards
Engineering quality — security defaults, show options when planning, think through failure modes.