error_handling_rules

error_handling_rules is a cursor rule for coding agents from gaebalai/Cursor-DEF-A-Rule. It costs 2,458 tokens per session, scanned A, original, MIT.

A set of rules for handling software errors, written as a Cursor editor rule. It classifies failures such as outages, data loss, security incidents, broken behavior, slow performance, and future risks, then assigns an investigation approach.

In plain words
What is it for?
Use it to analyze error messages and stack traces, record reproduction steps, assess affected users or data, compare solutions, and design fixes and measures to prevent recurrence.
Why use it?
It gives developers a repeatable way to assess urgency, impact, causes, fixes, and prevention. This helps keep error handling from stopping at a vague message or an isolated patch.

Cursor rule

Install

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.

agentmods
npx agentmods add rules/gaebalai/cursor-def-a-rule/error_handling_rules
Clone the repo
git clone --depth 1 https://github.com/gaebalai/Cursor-DEF-A-Rule

Wrote 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.

agentmods badge for error_handling_rules

README.md
[![agentmods](https://agentmods.dev/badge/rules/gaebalai/cursor-def-a-rule/error_handling_rules.svg)](https://agentmods.dev/rules/gaebalai/cursor-def-a-rule/error_handling_rules)
Your own site
<a href="https://agentmods.dev/rules/gaebalai/cursor-def-a-rule/error_handling_rules"><img src="https://agentmods.dev/badge/rules/gaebalai/cursor-def-a-rule/error_handling_rules.svg" alt="Measured on agentmods" height="20"></a>
Per session 2,458 This file is loaded in full into every session.
When invoked 2,458 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5 $0.02458 $0.02458
Opus 5 $0.01229 $0.01229
Sonnet 5 $0.00492 $0.00492
Haiku 4.5 $0.00246 $0.00246

Measured 4d ago against content hash 4a34bb6f2feb, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

error_handling_rules 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 4d 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.

rules/defa/error_handling_rules.mdc · 337 lines

How it starts

The opening of the file, as written. The whole thing — 337 lines — stays where its author put it; the contents beside it link to each section on GitHub.

MIT License - https://opensource.org/licenses/MIT

[DEFINE] 오류 처리 통합 전략

오류 상황 분류 및 대응 전략

error_categories:
  critical_error:
    definition: "시스템 중단, 데이터 손실, 보안 침해" 
    defa_strategy: "Act 단계 최소 적용·긴급 대응" 
    priority: "즉시 대응"
    
  functional_error:
    definition: "기능부전 및 기대 동작과 다른 동작" 
    defa_strategy: "Formulate→Act→Assess(수정 중시)" 
    priority: "단기 대응"
    
  performance_error:
    definition: "성능 저하 및 응답 저하" 
    defa_strategy: "Explore→Formulate→Act(분석 중시)" 
    priority: "중기적 대응"
    
  preventive_error:
    definition: "잠재적 문제 및 향후 장애 위험" 
    defa_strategy: "완전 DEF-A 적용(예방책 설계)" 
    priority: "장기적 대응"

DEF-A 단계별 오류 처리 흐름

defa_error_flow:
  define_stage:
    focus: "오류 상황의 구조화 정의 및 영향 범위 식별"
    activities:
        - 오류 메시지의 상세 분석 
        - 영향 범위의 명확화(기능·데이터·사용자) 
        - 긴급도 및 중요도 판정 
        - 재현 절차 기록
    
  explore_stage:
    focus: "근본 원인 분석 및 다중 해결 방법 검토"
    activities:
        - 로그 스택 추적의 상세 분석 
        - 유사한 오류의 기록 조사 
        - 다중 솔루션 접근법 검토 
        - 의존성 및 외부 요인 분석
    
  formulate_stage:
    focus: "통합적인 오류 처리 전략 및 예방책 설계"
    activities:
        - 최적 솔루션 선택 및 설계 
        - 예방책 및 재발방지책의 통합설계 
        - 테스트 전략 수립 
        - 단계적 구현 계획 수립
    
  act_stage:
    focus: "단계적 수정 구현 및 테스트"
    activities:
        - 최소한의 수정 구현 
        - 단위 테스트 및 통합 테스트 실행 
        - 단계적 배포 및 검증 
        - 모니터링 및 로그 강화
    
  assess_stage:
    focus: "수정 효과 측정 및 재발 방지책 평가"
    activities:
        - 수정 효과의 정량 평가 
        - 부작용 및 신규 문제 확인 
        - 재발 방지책의 유효성 평가 
        - 프로세스 개선 및 학습 효과 측정

[EXPLORE] 오류 처리의 다층 방어 전략

기술 계층별 오류 처리

technical_layers:
  frontend_layer:
    error_types:
        - JavaScript 실행 오류 
        - API 통신 오류 
        - UI 표시 오류 
        - 성능 오류
    defa_application:
        - Define : 에러가 발생한 장소 및 사용자 영향 식별 
        - Explore: 브라우저 호환성 및 네트워크 상태 분석 
        - Formulate : 오류 경계 폴백 설계 
        - Act: 단계적 수정 및 사용성 개선 
        - Assess: 오류율 및 사용자 만족도 측정
    
  backend_layer:
    error_types:
        - 데이터베이스 오류 
        - API 처리 오류 
        - 인증 및 허가 오류 
        - 외부 서비스 연동 오류
    defa_application:
        - Define : 에러가 발생한 장소 및 시스템 영향 식별 
        - Explore: 데이터 무결성 및 자원 상태 분석 
        - Formulate : 오류 처리 및 재시도 전략 설계 
        - Act: 단계적 수정 및 감시 강화 
        - Assess: 시스템 안정성 및 성능 측정
    
  infrastructure_layer:
    error_types:
        - 서버 리소스 부족 
        - 네트워크 장애 
        - 설정 오류 
        - 보안 침해
    defa_application:
        - Define: 인프라 상황 및 영향 범위 식별 
        - Explore: 리소스 사용 및 설정 분석 
        - Formulate : 스케일링 및 모니터링 전략 설계 
        - Act: 단계적 개선 및 자동화 구현 
        - Assess: 시스템 안정성 및 비용 효율 측정

Read the full file on GitHub · 337 lines

Changes

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.

  1. 4d ago First seen · 337 lines · 2,458 tokens per session scan A 4a34bb6f2feb

Subscribe to this mod's changes

error_handling_rules is a cursor rule published in the GitHub repository gaebalai/Cursor-DEF-A-Rule (12 stars, last pushed 1y ago), licensed MIT. It adds 2,458 tokens to every session, about $0.0123 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-30.