repo-rules-agent: Instructions file for Codex

AGENTS.md

repo-rules-agent AGENTS.md is an instructions file for Codex, OpenCode from unblocked/repo-rules-agent. It costs 844 tokens per session, scanned A, original, MIT.

Repository instructions for repo-rules-agent, a tool that finds and indexes coding instructions from files such as AGENTS.md and CLAUDE.md.

In plain words
What is it for?
They guide development, data-flow changes, new command-line commands, and detection of additional instruction-file formats.
Why use it?
They explain the project workflow and discovery patterns, reducing guesswork when changing the tool.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: reads .claude/ paths; mentions CLAUDE.md.

This is unblocked/repo-rules-agent's own configuration. It tells Codex and OpenCode how to work on repo-rules-agent itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything repo-rules-agent configures →

Reuse

Borrowing it

Nothing to install: this file belongs to unblocked/repo-rules-agent. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/unblocked/repo-rules-agent/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/unblocked/repo-rules-agent

Made for: Codex, OpenCode.

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 repo-rules-agent AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/unblocked/repo-rules-agent/agents-md/github.svg)](https://agentmods.dev/instructions/unblocked/repo-rules-agent/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/unblocked/repo-rules-agent/agents-md"><img src="https://agentmods.dev/badge/instructions/unblocked/repo-rules-agent/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for repo-rules-agent AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/unblocked/repo-rules-agent/agents-md"><img src="https://agentmods.dev/badge/instructions/unblocked/repo-rules-agent/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 844 This file is loaded in full into every session.
When invoked 844 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00844 $0.00844
Opus 5.5 $0.00338 $0.00338
Sonnet 5.5 $0.00169 $0.00169
Haiku 4.5 $0.00084 $0.00084

Measured 2mo ago against content hash faf0de5c92be, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

repo-rules-agent AGENTS.md 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 2mo 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.

AGENTS.md · 67 lines

How it starts

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

repo-rules-agent Development Guide

Architecture

The pipeline flows: discover → extract → index → query

  1. Discovery (rules/discovery.py): Scans a repo for rules files (CLAUDE.md, .cursorrules, etc.) organized by priority tiers defined in config.toml.
  2. Extraction (rules/extractor.py): Sends file contents to an LLM via tool use to extract structured rules. Large files are chunked using chonkie (markdown-aware chunking).
  3. Indexing (rules/index.py): Deduplicates rules (text similarity), detects conflicts (contradictory severity), and builds a RuleIndex.
  4. Query (rules/query.py): Filters rules by task, language, scope, severity. Formats output as table, JSON, or prompt.
  5. Eval (rules/eval.py): Uses an LLM judge to score extraction quality (precision, recall, F1).

Data Flow

  • discover_rules_files(repo_path) → list[RuleFile], dict[str, str] (files + contents)
  • extract_rules_from_files(rule_files, contents) → list[ProcessedFile]
  • build_index(repo_path, processed_files) → RuleIndex
  • query_rules(index, task=, lang=, ...) → list[Rule]

Adding a New CLI Command

  1. Add the command function in cli.py with @app.command(name="command-name")
  2. Use typer.Argument / typer.Option for parameters
  3. Use console (Rich) for output, not print()
  4. Add tests using typer.testing.CliRunner in tests/test_<name>.py
  5. Update the bundled skill files if the command should be user-facing:
    • src/rules_agent/skill/SKILL.md (bundled package copy)
    • skills/repo-rules/SKILL.md (plugin copy)
    • .claude/skills/repo-rules/SKILL.md (local dev copy, uses uv run)

Adding Discovery Patterns

Edit src/rules_agent/config.toml to add new file patterns or tiers. The config is loaded via pydantic-settings at module import time.

Testing Conventions

  • Tests live in tests/test_*.py, one file per module
  • Mock all LLM/API calls — tests must run offline
  • Use tmp_path fixture for filesystem tests
  • Use typer.testing.CliRunner for CLI integration tests
  • Run make test (which runs uv run pytest tests -v)

Read the full file on GitHub · 67 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. 2mo ago First seen · 67 lines · 844 tokens per session scan A faf0de5c92be

Subscribe to this mod's changes

repo-rules-agent AGENTS.md is an instructions file published in the GitHub repository unblocked/repo-rules-agent (77 stars, last pushed 1mo ago), licensed MIT. It adds 844 tokens to every session, about $0.0034 per session on Opus 5.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.

Related

repo-rules-agent AGENTS.md compared with instructions from other repositories

repo-rules-agent AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
repo-rules-agent AGENTS.mdunblocked/repo-rules-agentInstructions file771mo agoMITA844Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143kyesterdayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode