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-ruby-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.00825 |
| Opus 5 | $0.00000 | $0.00413 |
| Sonnet 5 | $0.00000 | $0.00165 |
| Haiku 4.5 | $0.00000 | $0.00082 |
Grade A, and why
pn-ruby-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 — 50 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Ruby / backend rules
Style
- Follow Ruby style: snake_case for methods/variables, PascalCase for classes/modules, SCREAMING_SNAKE for constants.
- Indent with 2 spaces. Use
frozen_string_literal: trueat the top of all files. - Prefer explicit returns only at early-exit guard clauses. Avoid implicit returns in multi-branch methods.
- Avoid deeply nested blocks; extract to named methods when nesting exceeds 2 levels.
Rails conventions
- Use Rails conventions before custom abstractions: RESTful resource routes,
before_action, scopes, callbacks. - Controller actions stay thin: validate input, call a service or model method, render result. Business logic belongs in models or service objects, not controllers.
- Service objects for complex operations: plain Ruby objects in
app/services/with a single public#callmethod. - Avoid callbacks (
before_save,after_create) for side effects that belong in service objects — they make unit testing and debugging opaque.
ActiveRecord and N+1
- Use
includesorpreloadfor associations accessed in a loop:User.includes(:orders). - Use
selectto limit columns fetched:User.select(:id, :email)— never load full rows when only a subset is needed. - Use
find_each(notall.each) for batch processing:User.find_each(batch_size: 500) { |u| ... }. - Use the Bullet gem in development to detect and alert on N+1 queries and unused eager loads.
Secrets and config
- All secrets and config from environment variables:
ENV["VAR"]or Rails credentials (Rails.application.credentials). - Use
dotenv-railsin development; never commit.envto git. Keep.env.examplewith placeholder values. - Never hardcode API keys, tokens, or DB passwords in source, initializers, or YAML config files.
Error handling
- Use
begin/rescuewith specific exception classes. Neverrescue Exception— it catchesSignalException(SIGTERM) andSystemExit. - Raise custom error classes:
class PaymentFailed < StandardError; end— allows callers to catch specifically. - In Rails controllers: use
rescue_fromfor centralized error formatting. Return consistent JSON shapes. - Use structured logging (Rails logger with
semantic_loggerorlograge). Include request ID, user ID in log context.
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 · 50 lines · 0 tokens per session scan A a215e7686c4a
pn-ruby-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 825 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.