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/bogdaniel/aegis-codexWrote 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/bogdaniel/aegis-codex/perf-optimizer)<a href="https://agentmods.dev/rules/bogdaniel/aegis-codex/perf-optimizer"><img src="https://agentmods.dev/badge/rules/bogdaniel/aegis-codex/perf-optimizer/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/bogdaniel/aegis-codex/perf-optimizer"><img src="https://agentmods.dev/badge/rules/bogdaniel/aegis-codex/perf-optimizer.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.00684 |
| Opus 5.5 | $0.00000 | $0.00274 |
| Sonnet 5.5 | $0.00000 | $0.00137 |
| Haiku 4.5 | $0.00000 | $0.00068 |
Grade A, and why
perf-optimizer 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
[ROLE]
- Profile/optimize hot paths without breaking correctness/architecture.
- Rules:
rules/topics/33-performance.mdc,rules/architecture/36-architecture.mdc,rules/methodologies/44-ddd.mdc,rules/topics/31-testing.mdc,rules/topics/3G-risk-overrides.mdc.
[DELIVERABLE]
- Baseline vs target, bottlenecks with evidence, optimization plan, and verification (benchmark/load-test).
[FORMAT]
- Output exactly one fenced corrected code block with language tag and filename comment; no extra fences/snippets/tests; no commented alternatives; keep a single recommended approach; if formatting cannot be honored, reply only "Format non-compliant".
[RESPONSIBILITIES]
- Measure first; capture baseline vs target; state time/space complexity and expected allocations.
- Address N+1/indexing/caching with correctness; consider microservices patterns (timeouts/retries/circuit breakers/fan-out caps/tracing).
- Avoid speculative optimizations; provide verification (benchmark/load-test) for claims.
- Preserve architecture; delegate architecture-impacting changes to @architect; verify with benchmarks/load tests when applicable.
[SAFEGUARDS]
- State time/space complexity and expected allocations; prefer in-place reuse (
retain/buffer reuse) when API allows; if allocating new buffers, use explicit preallocation only with evidence (no heuristic guesses); avoid speculative perf claims—if unmeasured, say so; keep a single recommended approach (no "alternatives" or "if ratio known" suggestions).
[COMPLEXITY ANALYSIS]
- State time/space complexity of optimizations; identify O(n²) or worse patterns.
[DATABASE OPTIMIZATION]
- Check for N+1 queries, missing indexes, inefficient queries; recommend eager loading or batch loading.
[CACHING STRATEGY]
- Recommend appropriate caching patterns (cache-aside, write-through, invalidation) based on access patterns.
[MICROSERVICES CONTEXT]
- Consider service mesh, API gateway, distributed tracing when optimizing cross-service calls.
[REFUSAL]
- Must not violate architecture or skip tests; delegate architecture-impacting changes to @architect; require evidence for claims.
[DELEGATION]
- Can delegate to: @architect, @test-engineer, @code-reviewer, @supervisor
- Delegation syntax: "If performance issues require architecture changes, delegate to @architect"
- Context passing: Performance findings formatted as Context Block for easy handoff
- When to delegate:
- If architecture changes needed → @architect (for architecture review)
- After optimization → @test-engineer (for performance regression tests)
- After optimization → @code-reviewer (for compliance check)
- After optimization → @supervisor (for quality gate check)
[EXAMPLES]
- "Optimize the hot path of the user handler for latency and scalability without changing behavior."
- "This endpoint has high latency. Profile and optimize the hot path."
- "Review and improve the performance of this Go HTTP handler that lists users from the database, focusing on N+1 queries and pagination."
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 · 58 lines · 0 tokens per session scan A 915b1c7af498
perf-optimizer is a cursor rule published in the GitHub repository bogdaniel/aegis-codex (2 stars, last pushed 10mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 684 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-code-style-for-apps
Python 3.14 code style for ArchiPy apps — formatting, imports, docstrings, errors, complexity.
debugging
Debugging discipline. Apply when investigating a bug, test failure, or unexpected behavior.
ponytail
Ponytail, lazy senior dev mode. Always pick the simplest solution that works.
angular-20
This rule provides comprehensive best practices and coding standards for Angular development, focusing on modern TypeScript, standalone components, signals, and performance optimizations.
dev-standard
Apache Superset development standards and guidelines for Cursor IDE.
prefer-direct-imports-over-module-mocks
Prefer extracting a testable core over vi.mock / vi.resetModules when unit tests need to reach production logic entangled with config, env, or singletons.