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/SeanLF/weather-mcpWrote 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/seanlf/weather-mcp/proactive-edge-case-handling)<a href="https://agentmods.dev/rules/seanlf/weather-mcp/proactive-edge-case-handling"><img src="https://agentmods.dev/badge/rules/seanlf/weather-mcp/proactive-edge-case-handling.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.01027 | $0.01027 |
| Opus 5 | $0.00513 | $0.00513 |
| Sonnet 5 | $0.00205 | $0.00205 |
| Haiku 4.5 | $0.00103 | $0.00103 |
Grade A, and why
proactive-edge-case-handling 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 7d 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 — 154 lines — stays where its author put it; the contents beside it link to each section on GitHub.
filters:
- type: event pattern: "code_implementation"
- type: content pattern: "(?i)(function|method|class|component)"
actions:
-
type: transform pattern: "^(
[a-z]*\n)?.*?()?$" replacement: |Implementation with Edge Case Handling
Potential Failure Points
{list_of_identified_edge_cases}
Handling Strategy
{edge_case_handling_approach}
${2}Remaining Risks
{unhandled_edge_cases_and_rationale}
-
type: validate conditions:
-
pattern: ".*" validationScript: | // Check for error handling patterns based on language const language = detectedLanguage; let requiredPatterns = [];
if (language === "javascript" || language === "typescript") { requiredPatterns = [ /try\s*{.?}\scatch/s, /if\s*([^)]?null|undefined[^)]?)/, /?./ ]; } else if (language === "python") { requiredPatterns = [ /try:(?:\s.?)?except/s, /if\s+[\w\s.]+\s+is\s+None/, /if\s+not\s+[\w\s.]+:?/ ]; } else if (language === "java" || language === "kotlin") { requiredPatterns = [ /try\s{.?}\scatch/s, /if\s*([^)]?null[^)]?)/, /Optional<.*?>/ ]; }
// Check if code has appropriate error handling const missingPatterns = requiredPatterns.filter(pattern => !pattern.test(code));
if (missingPatterns.length > 0 && code.length > 100) { return { valid: false, message: "Code appears to be missing error handling for common edge cases." }; }
return { valid: true };
-
-
type: suggest message: | When implementing any functionality, remember to:
- Identify all possible edge cases before coding
- Handle null/undefined/empty values explicitly
- Consider resource availability (network, disk, memory)
- Add appropriate error logging for debugging
- Use defensive programming techniques consistently
examples:
-
input: |
function getUserData(userId) { const userData = database.fetchUser(userId); return { name: userData.name, email: userData.email, permissions: userData.permissions }; }output: |
Implementation with Edge Case Handling
Potential Failure Points
userIdcould be null, undefined, or invalid format- Database operation could fail (connection issues, timeouts)
- User might not exist in the database
- User data might be incomplete (missing required fields)
- Database might return unexpected data types
Handling Strategy
- Input validation for userId
- Explicit error handling for database operations
- Null/undefined checks for user data
- Default values for missing properties
- Type checking/conversion for data safety
function getUserData(userId) { // Input validation if (!userId || typeof userId !== 'string') { throw new Error('Invalid user ID provided'); } try { // Handle potential database failures const userData = database.fetchUser(userId); // Handle missing user if (!userData) { return null; } // Handle potentially missing data with defaults and type safety return { name: userData.name || 'Unknown User', email: userData.email || '', permissions: Array.isArray(userData.permissions) ? userData.permissions : [] }; } catch (error) { // Log error for debugging console.error(`Failed to fetch user data for ID ${userId}:`, error); throw new Error(`Unable to retrieve user data: ${error.message}`); } }
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.
- 7d ago First seen · 154 lines · 1,027 tokens per session scan A 2bd2d816ea55
proactive-edge-case-handling is a cursor rule published in the GitHub repository SeanLF/weather-mcp (2 stars, last pushed 1y ago), licensed MIT. It adds 1,027 tokens to every session, about $0.0051 per session on Opus 5. 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
error-handling-and-validation
A code-quality guide for handling errors, invalid inputs, edge cases, preconditions, logging, and user-friendly error messages.
css-render-blocking-diagnosis
Cursor rule "css-render-blocking-diagnosis" from adobecom/da-express-milo, covering css render-blocking diagnosis & resolution, critical learning from 98 pagespeed achievement, primary diagnostic protocol, step 1: css blocking symptom recognition and step 2: css loading sequence audit.
workflow-level1
Streamlined workflow for Level 1 Quick Bug Fix tasks.
modus-checkbox-value-inversion-react-short
Critical bug fix for ModusWcCheckbox value property inversion.
javascript-expert-performance
Profile first. Measure before and after. Never optimize without data.
5-bug-finder
APPLY WHEN investigating a bug.