code-index-first

A set of rules for navigating and editing a codebase through its project indexes, which are documents describing where code lives and how parts connect. It requires checking those indexes before reviewing or changing code.

In plain words
What is it for?
Use it to plan small code changes, trace affected paths, update indexes when structure changes, and run relevant tests afterward.
Why use it?
It helps limit edits to the necessary files and makes related callers, imports, tests, and documentation easier to check.

Cursor rule for Cursor

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/hyunjunjeon/fastcampus_mcp_a2a_basic/code-index-first
Clone the repo
git clone --depth 1 https://github.com/HyunjunJeon/FastCampus_MCP_A2A_Basic

Made for: Cursor.

Per session 577 This file is loaded in full into every session.
When invoked 577 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.00577 $0.00577
Opus 5 $0.00289 $0.00289
Sonnet 5 $0.00115 $0.00115
Haiku 4.5 $0.00058 $0.00058

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

Security

Grade A, and why

code-index-first 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.

.cursor/rules/code-index-first.mdc · 41 lines

What it actually says

Code Index-First Workflow

항상 코드 편집/리뷰/탐색 전에 프로젝트 인덱스를 먼저 확인하고, 필요한 파일만 최소 범위로 수정합니다. 변경으로 영향받는 경로를 식별하고 관련 테스트/문서를 함께 갱신합니다.

Entry Points

하위 모듈 인덱스

Editing Policy

  1. 변경 계획 수립: 인덱스를 기반으로 수정 대상(필수 파일)과 주변 영향 경로(참조/임포트/호출부)를 식별합니다.

  2. 최소 변경: 요구사항을 충족하는 가장 작은 단위로 수정하고, 불필요한 리팩터링/포맷 변경을 피합니다.

  3. 일관성 유지: 새로운 파일/모듈을 추가할 경우, 해당 모듈의 code_index.md와 루트 인덱스에 역할을 2줄 이내로 추가합니다.

  4. 영향 분석: 수정 후 호출 관계, A2A/HITL/LangGraph 경계면(서버/클라이언트/그래프 노드/웹 UI)을 재점검합니다.

  5. 검증: 관련 테스트 스위트와 예제 스크립트를 우선 실행합니다. 자세한 위치는 README.mdtests/의 개별 테스트 파일을 참고하세요.

참고

  • 인덱스와 불일치 발견 시 먼저 인덱스를 갱신한 뒤 코드를 정리합니다.
  • 링크는 항상 클릭 가능한 마크다운 형태(문서)로 유지합니다.
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. 2d ago First seen · 41 lines · 577 tokens per session scan A 2d465a56df00

Subscribe to this mod's changes

code-index-first is a cursor rule published in the GitHub repository HyunjunJeon/FastCampus_MCP_A2A_Basic (11 stars, last pushed 8mo ago), licensed MIT. It adds 577 tokens to every session, about $0.0029 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.