defa_development_framework_compact

A compact set of software-development rules built around Red-Green-Refactor, the TDD cycle of writing a failing test, making it pass, and then cleaning up the code. It also covers common frontend, backend, security, and infrastructure practices.

In plain words
What is it for?
Planning and implementing web applications, APIs, database work, security checks, responsive interfaces, and test-first development.
Why use it?
It gives the agent shared standards for readable code, safe inputs, accessible interfaces, API design, and testing. This reduces the need to restate those expectations for each task.

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/defa_development_framework_compact
Clone the repo
git clone --depth 1 https://github.com/gaebalai/Cursor-DEF-A-Rule
Per session 3,203 This file is loaded in full into every session.
When invoked 3,203 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.03203 $0.03203
Opus 5 $0.01602 $0.01602
Sonnet 5 $0.00641 $0.00641
Haiku 4.5 $0.00320 $0.00320

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

Security

Grade A, and why

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

archive_rules/defa_development_framework_compact.mdc · 292 lines

How it starts

The opening of the file, as written. The whole thing — 292 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] 즉시 실행 규칙 (항상 적용)

  • 코드 품질: 가독성 > 기교, 명확한 변수명, 적절한 주석 작성
  • 프론트엔드: 모바일 퍼스트 반응형 설계, 접근성 기준 준수, Core Web Vitals 인식
  • 백엔드: API 설계 및 데이터베이스 최적화, 서버 성능 개선, 확장성 고려
  • 보안: 입력값 검증, XSS 대응, SQL 인젝션 방지, 인증·인가 처리, 에러 핸들링
  • 테스트 주도: 상황에 맞는 TDD/BDD 적용 판단

[TECH] 기술 스택 (우선순위 기준)

프론트엔드

  1. JavaScript/TypeScript - 타입 안정성 중시
  2. Nuxt.js/Next.js - JAMstack 아키텍처
  3. CSS - PostCSS、CSS Grid/Flexbox

백엔드

  1. Node.js/TypeScript - 서버 사이드 개발
  2. Python/FastAPI - API 개발 및 데이터 처리
  3. 데이터베이스 - PostgreSQL、Redis、MongoDB
  4. 인프라 - Docker、Kubernetes、AWS/GCP

구현 방침

  • 프론트엔드: ES6+ 문법 사용, async/await 활용, 컴포넌트 재사용성 극대화, 번들 크기 최적화
  • 백엔드: RESTful API 설계, 데이터베이스 성능 튜닝, 보안 강화, 확장성 고려

[TDD/BDD] 테스트 주도 개발 & 행동 주도 개발

TDD (Test-Driven Development) – Kent Beck 철학

핵심 개념: Red-Green-Refactor 사이클, 단순한 설계, 동작하는 깔끔한 코드로 자신감 확보

Red-Green-Refactor 사이클
  1. Red: 실패하는 테스트 작성 (기대 동작 명확화)
  2. Green: 최소한의 코드로 테스트 통과
  3. Refactor: 코드 정리 및 유지보수성 향상

TDD 적용 규칙

[TDD 적용] Red-Green-Refactor 사이클을 준수하여 테스트 우선 개발을 진행합니다.
- 테스트 우선: 구현 전 테스트 작성
- 최소 구현: 테스트 통과에 필요한 최소 코드 작성
- 지속적 리팩터링: 동작하는 코드를 깔끔하게 정리

BDD (Behavior-Driven Development) – Dan North 철학

핵심 개념: 개발자와 비개발자 간의 원활한 소통, 비즈니스 가치 중심 개발

Given-When-Then형식
Given [전제 조건]
When [행동]
Then [기대 결과]
적용 규칙
[BDD 적용] Given-When-Then 형식을 활용해 비즈니스 가치를 명확히 하고, 공통 언어로 개발을 진행합니다.
- 비즈니스 가치: 기능이 주는 가치를 최우선
- 공통 언어: 개발자·비개발자 간 이해 증진
- 기대 동작 정의: 예상 동작을 명확히 기술

TDD/BDD 적용 판단 프레임워크

상황별 대응

TDD 적용 권장 사례:

  • ✅ 복잡한 비즈니스 로직을 구현할 때
  • ✅ 기존 기능을 수정하거나 확장할 때
  • ✅ 팀 개발에서 품질 보증이 중요한 경우
  • ✅ 장기적인 유지보수가 중요한 핵심 기능
  • ✅ 기술적 부채를 줄여야 하는 상황

BDD 적용 권장 사례:

  • ✅ 신규 기능 개발 시 비즈니스 요구사항이 복잡한 경우
  • ✅ 이해관계자와 요구사항 확인이 필요한 경우
  • ✅ 여러 팀 간 협업이 필요한 경우
  • ✅ 비즈니스 가치의 명확화가 중요한 경우
  • ✅ 사용자 수용 테스트(인수 테스트) 자동화가 필요한 경우
적용 판단 로그 (예시 포맷)
[TDD/BDD 적용 판단]
- 개발 상황: [신규 기능 / 기존 기능 수정 / 프로토타입 / 긴급 대응]
- 복잡성: [높음 / 중간 / 낮음]
- 팀 규모: [개인 / 소규모 / 대규모]
- 시간적 제약: [긴급 / 일반 / 여유]
- 품질 요구 수준: [높음 / 중간 / 낮음]

Read the full file on GitHub · 292 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 · 292 lines · 3,203 tokens per session scan A 329649a1abad

Subscribe to this mod's changes

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