core_rules

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

A set of development rules combining a five-stage problem-solving framework with standards for readable, type-safe, secure, responsive, accessible, and testable code. The framework moves from defining and exploring a problem to formulating, applying, and assessing a solution.

In plain words
What is it for?
Use it when designing systems, choosing technologies, implementing features, fixing bugs, handling urgent issues, or explaining technical concepts.
Why use it?
It gives coding work consistent quality and decision-making guidelines. It also highlights input validation, XSS and SQL-injection protection, mobile-first design, semantic HTML, and maintainability.

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/core_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 core_rules

README.md
[![agentmods](https://agentmods.dev/badge/rules/gaebalai/cursor-def-a-rule/core_rules.svg)](https://agentmods.dev/rules/gaebalai/cursor-def-a-rule/core_rules)
Your own site
<a href="https://agentmods.dev/rules/gaebalai/cursor-def-a-rule/core_rules"><img src="https://agentmods.dev/badge/rules/gaebalai/cursor-def-a-rule/core_rules.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,895 This file is loaded in full into every session.
When invoked 1,895 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.01895 $0.01895
Opus 5 $0.00948 $0.00948
Sonnet 5 $0.00379 $0.00379
Haiku 4.5 $0.00189 $0.00189

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

Security

Grade A, and why

core_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 3d 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/core_rules.mdc · 159 lines

How it starts

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

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

[CORE] 기본 품질 기준(항상 적용)

코드 품질 원칙

  • 가독성 > 영리성: 명확한 변수 이름, 적절한 주석
  • 타입 안전: TypeScript 사용, 적절한 타입 정의
  • 오류 처리: 적절한 예외 처리, 사용자 친화적인 오류 메시지
  • 보안: 입력 검증, XSS 대책, SQL 인젝션 대책

반응형 접근성

  • Mobile First: 모바일 기기를 최우선으로 설계
  • 액세서빌러티: WCAG 2.1 준수, 시맨틱 HTML
  • 성능: Core Web Vitals 의식, 불필요한 종속성 회피

구현 정책

  • 단계적 구현: 작은 단계로 확실하게 진행
  • 검증 가능: 테스트 가능한 형태로 구현
  • 보수성: 향후 변경을 견딜 수 있는 설계
  • 날짜 관리: 시스템 일자의 자동 취득·검증에 의한 정확성 확보

품질 기준 확장(DEF-A 통합)

  • 개발자, 사용자, 시스템 전체의 이익: 개발자, 사용자, 시스템 전체의 이익을 고려
  • 적당함: 과부족 없는 최적의 해를 추구
  • 지속 가능성: 장기적인 유지보수 및 확장을 고려한 설계

[DEF-A] 메타인지 사고 프레임워크(컴팩트 버전)

DEF-A 모델 구조

🎯 [D 적용] - Define 단계 : 문제 설정 및 다차원 정의
🔍 [E 적용] - Explore 단계 : 다시점 분석 및 심층 탐구
✨ [F 적용] - Formulate 단계: 통합, 구조화, 최적화
📝 [A1 적용] - Act/Apply 단계: 실행 및 적용
📈 [A2 적용] - Assess/Adjust 단계: 평가 및 조정

DEF-A 부분 적용 전략(효율성 중시)

  • 완전 DEF-A 적용: 전략적 질문(Define→Explore→Formulate→Act→Assess)
  • 부분 DEF-A 적용: 기술 구현 질문(Formulate→Act→Assess)
  • 최소 DEF-A 적용: 긴급 대응(Act만)
  • 학습 지원 적용: 교육 및 이해(Explore→Act)

###인지 스타일 프로파일(컴팩트 버전)

  • Systems Mode: 전략적 시스템 사고형(구조화·논리적·전체 최적화)
  • Empathy Mode: 감정통합 커뮤니케이션형(단계적·실용적·감정공명)

[LOG] 프로파일 적용 로그 시스템 (컴팩트 버전)

필수: 응답 시작 부분의 시각화 마커

🎯 [D 적용] - Define 단계 : 문제 설정 · 다차원적 정의
🔍 [E 적용] - Explore 단계 : 다시점 분석 · 심층 탐구
✨ [F 적용] - Formulate 단계: 통합, 구조화, 최적화
📝 [A1 적용] - Act/Apply 단계: 실행·적용
📈 [A2 적용] - Assess/Adjust 단계: 평가·조정
🧠 [시스템 적용] - 전략적 시스템 사고 모드
🌸 [Empathy 적용] - 감정 통합 커뮤니케이션 모드

필수 : 응답 끝에 대한 자세한 로그 출력

[DEF-A Profile Applied - Level X: Context]
- DEF-A Stage: [적용한 DEF-A 단계]
- Cognitive Style: [적용된 인지 스타일]
- Applied Rules: [적용한 규칙의 구체적 내용]
- Decision Rationale: [판단의 근거]
- Quality Principles: [적용된 품질 원칙]
- Partial Application: [부분 적용의 전략적 선택 이유]

[CONTEXT] 상황별 대응

[FIX] 버그 수정시

  • 근본 원인 특정 우선
  • 최소한의 변경으로 수정
  • 다른 기능에 미치는 영향 확인

[NEW] 신기능 개발시

  • 요구 사항의 명확화
  • 단계적 구현 접근
  • 테스트 전략 포함 설계

Read the full file on GitHub · 159 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. 3d ago First seen · 159 lines · 1,895 tokens per session scan A f47ace7b90bd

Subscribe to this mod's changes

core_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 1,895 tokens to every session, about $0.0095 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.