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/adonai-labs/agent-runway/advanced-patternsgit clone --depth 1 https://github.com/adonai-labs/agent-runwayWrote 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/adonai-labs/agent-runway/advanced-patterns)<a href="https://agentmods.dev/rules/adonai-labs/agent-runway/advanced-patterns"><img src="https://agentmods.dev/badge/rules/adonai-labs/agent-runway/advanced-patterns.svg" alt="Measured on agentmods" 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.01701 |
| Opus 5 | $0.00000 | $0.00851 |
| Sonnet 5 | $0.00000 | $0.00340 |
| Haiku 4.5 | $0.00000 | $0.00170 |
Grade A, and why
advanced-patterns 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 2d 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 — 151 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Advanced Patterns for Electron Development
Directives for building complex, scalable Electron applications. Apply when implementing multi-window apps, typed IPC, plugins, or enterprise-level features.
Security Best Practices
- Context isolation: Always enable
contextIsolation: trueandnodeIntegration: falseinwebPreferences - Preload scripts: Expose only the minimal API surface via
contextBridge.exposeInMainWorld; never expose rawipcRendererorrequire - CSP: Implement strict Content Security Policy headers; restrict script sources to trusted domains; use nonces or hashes for inline scripts when unavoidable
- IPC validation: Validate all IPC messages (type, format, length) before processing; reject invalid payloads explicitly
- Origin verification: Verify message origin for sensitive IPC channels
- For detailed security guidance (auth, encryption, input validation), defer to
security.mdcandengineering-security.mdc
// Minimal BrowserWindow security
webPreferences: { nodeIntegration: false, contextIsolation: true, preload: path.join(__dirname, 'preload.js') }
Multi-Window Management
- Use a centralised window manager — a single module or class that owns creation, lookup, and teardown of all
BrowserWindowinstances - Persist window state (bounds, maximised/minimised) on close; restore on reopen; ensure restored bounds stay within screen
- Cleanup on close: Remove windows from the manager map on
closed; clear references to avoid leaks - Unique IDs: Assign a stable ID per window; use it for IPC routing and state persistence
- Parent-child relationships: Set
parentwhere appropriate; ensure child windows close with parent - Do not create windows ad hoc from multiple places; route all creation through the manager
Advanced IPC Patterns
- Typed request-response: Use a request ID, correlate responses, and support
invoke-style async calls; avoid fire-and-forget for operations that need a result - Timeout handling: Set a timeout (e.g. 5s) for each request; reject and clean up pending requests on timeout
- Batching: For high-frequency IPC, consider batching multiple operations into a single round-trip where latency allows
- Validation: Validate payload shape and size before processing; return structured errors (code, message) rather than raw exceptions
- Channel naming: Use a consistent naming scheme (e.g.
module:action) and document the contract - Define shared TypeScript interfaces for request/response shapes in a
shared/typesmodule
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.
- 2d ago First seen · 151 lines · 0 tokens per session scan A 1f19b6c383d9
advanced-patterns is a cursor rule published in the GitHub repository adonai-labs/agent-runway (2 stars, last pushed 15d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,701 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-09-03.
Other cursor rules, from other repositories
archgate-governance
Archgate ADR governance — enforces architecture decision records.
cursorrules
When the user asks you to generate diagrams, analyze code structure, or visualize architecture, follow this analysis pipeline. Use terminal commands (rg, find, cat) for all file operations.
arch4
Keep Arch4 architecture maps current.
cursorrules
You are working with a React Native (Expo) architecture reference project. Read the skill files before generating any code.
nativescript
NativeScript best practices and patterns for mobile applications.
python
Python best practices and patterns for modern software development with Flask and SQLite.