UR

unblocked/repo-rules-agent

Developer tools

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기

80 stars 품질 63 트렌드 8MIT

규칙 파일에서 추출 및 인덱스 AI 코딩 지침

개요

규칙 파일 (CLAUDE.md, AGENTS.md, .cursorrules 등)에서 추출 및 인덱스 AI 코딩 지침. 규칙을 작성했습니다. CLAUDE.md에는 Codex, .cursorrules 파일에 대한 AGENTS.md 및 .cursor/rules/ 또는 .github/instructions/의 밑에 다른 어떤 생명든지에 있는 CLAUDE.md가 있습니다. 그러나 에이전트 세션을 열 때 "이 PR을 검토,"그것은 그들 모두를 볼 수 없습니다. repo-rules-agent는 저장소의 모든 규칙 파일에서 하나의 쿼리 가능한 인덱스를 구축합니다. 의 앞에 작업에 대한 쿼리 - 예를 들어 --task code-review --lang py --severity should — 을 반환 ~15 규칙을 실제로 적용, 8,000 규칙 파일의 토큰. - 4개의 우선 계층에 걸쳐 ~40개의 알려진 규칙 파일 컨벤션을 청소합니다. - 루트 파일, 도구 별 경로, globs와 규칙 디렉터리 및 재큐브 **Extract**Index**Query**는 현재 작업에 따라 규칙을 반환합니다. 작업, 언어, severity, 범위로 필터링; 테이블, JSON 또는 신속한 블록으로 출력.

개요(AI 번역)

규칙 파일 (CLAUDE.md, AGENTS.md, .cursorrules 등)에서 추출 및 인덱스 AI 코딩 지침.

왜?

규칙을 작성했습니다. CLAUDE.md] root, AGENTS.md] Codex, a .cursorrules] 파일에 대한 .cursor/rules/ 또는 .github/instructions/]]에서 다른 모든 생명이 있다. 그러나 에이전트 세션을 열 때 "이 PR을 검토,"그것은 그들 모두를 볼 수 없습니다.

repo-rules-agent는 저장소의 모든 규칙 파일에서 하나의 쿼리 가능한 인덱스를 구축합니다. 의 앞에 작업에 대한 쿼리 - 예. --task code-review --lang py --severity must] - 실제로 적용하는 ~15 규칙을 반환, 8,000 규칙 파일의 토큰.

어떻게 작동합니까?

4개의 단계: **discover → 추출물 → 색인 → 조회 **.

  • Discover 스윕 ~40 네 가지 우선 순위에서 알려진 규칙 파일 컨벤션 - 루트 파일, 도구 별 경로, globs와 규칙 디렉터리, 재큐브 ** 계층. @include]-style 지시어를 해결한다. CLAUDE.md] AGENTS.md] 은 하나의 소스로 계산한다.
  • Extract는 OpenAI 도구 호출 프로토콜을 통해 LLM에 각 파일을 보냅니다. 모델은 pydantic-validated schema를 채우고 - 규칙 모델을 참조하십시오.

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요.

README

원문 README의 일부입니다. 원문 보기.

Rules Agent

Extract and index AI coding instructions from rules files (CLAUDE.md, AGENTS.md, .cursorrules, etc.).

Why?

You’ve written the rules. There’s a CLAUDE.md at the root, an AGENTS.md for Codex, a .cursorrules file, and whatever else lives under .cursor/rules/ or .github/instructions/. But when you open an agent session and say “review this PR,” it doesn’t see all of them.

repo-rules-agent builds one queryable index from every rules file in your repo. A query scoped to the work in front of you — e.g. --task code-review --lang py --severity must — returns the ~15 rules that actually apply, not 8,000 tokens of rules files.

How it works

Four stages: discover → extract → index → query.

  • Discover sweeps ~40 known rules-file conventions across four priority tiers — root files, tool-specific paths, rules directories with globs, and a recursive ** tier. It resolves @include-style directives, so a CLAUDE.md that’s just a pointer to AGENTS.md counts as one source, not two.
  • Extract sends each file to an LLM via the OpenAI tool-calling protocol. The model fills a pydantic-validated schema — see Rule Model. Large files are chunked on Markdown headings via chonkie.
  • Index merges near-duplicates by text similarity and flags potential conflicts — similar rules with contradictory severities — for human resolution.
  • Query returns rules scoped to the current task. Filter by task, language, severity, scope; output as a table, JSON, or a prompt-ready block.

Dependencies

  • uv — Python package manager
  • git — used for blob SHA computation during indexing
  • Ollama — required if you use the default local provider; not needed if you configure OpenAI, Anthropic, or another hosted provider

Setup

# Install dependencies
uv sync

Configuration

The tool works with any OpenAI-compatible API provider. By default, it connects to a local Ollama instance; OpenAI and Anthropic are also supported.

Copy .env.example to .env and uncomment the provider you want to use:

cp .env.example .env
# Edit .env with your API keys

The .env file is gitignored and loaded automatically at startup via python-dotenv. Shell environment variables take precedence over .env values, so you can always override a .env setting with an explicit export.

Providers

Local (Ollama — default, no API key needed):

ollama pull glm-4.7-flash:latest
uv run repo-rules-agent index /path/to/repo

Local models vary in tool-calling reliability; for the highest-quality extraction, use OpenAI or Anthropic.

Anthropic (add to .env):

RULES_AGENT_LLM__BASE_URL=https://api.anthropic.com/v1
RULES_AGENT_LLM__API_KEY_ENV=ANTHROPIC_API_KEY
RULES_AGENT_LLM__EXTRACTION_MODEL=claude-haiku-4-5
GitHub에서 전체 README 보기

추천 도구

다른 키워드를 입력하거나 필터를 제거해 보세요.

설치

npx skillfish add unblocked/repo-rules-agent
MCP 초보자라면? mcpskill.org 가이드부터 시작하세요 →