GenerateAgents.md AGENTS.md

Repository instructions for GenerateAgents.md, a Python command-line tool that analyzes a code repository and creates an AGENTS.md guide for AI coding agents. The guide covers its technology stack and modular analysis pipeline.

In plain words
What is it for?
Use it when changing the repository-analysis pipeline, command-line interface, generated guidance, AI integrations, configuration, or tests.
Why use it?
It helps contributors understand how the tool turns a codebase into a consistent map of architecture, conventions, and data flow for future agents.

Instructions file for CodexOpenCode

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 instructions/originalankur/generateagents.md/agents-md
Clone the repo
git clone --depth 1 https://github.com/originalankur/GenerateAgents.md

Made for: Codex, OpenCode.

Per session 3,246 This file is loaded in full into every session.
When invoked 3,246 The same file — it is already loaded in full.
Security scan A 1 finding. 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.03246 $0.03246
Opus 5 $0.01623 $0.01623
Sonnet 5 $0.00649 $0.00649
Haiku 4.5 $0.00325 $0.00325

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

Security

Grade A, and why

GenerateAgents.md AGENTS.md scanned grade A with 1 finding 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.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

* **Error Handling**: Application logic within modules and utilities should raise specific exceptions (e.g., `FileNotFoundError`, `subprocess.CalledProcessError`). Generic `except Exception` blocks should be avoided. A s
AGENTS.md · 278 lines

How it starts

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

AGENTS.md — AutogenerateAgentsMD.md

Project Overview

GenerateAgents.md is a Python command-line tool that automates the creation of a comprehensive AGENTS.md file for any public GitHub or local code repository. It acts as an automated codebase analyst and technical writer, using the dspy framework to programmatically interface with LLMs. The tool clones and analyzes a target codebase to produce a standardized blueprint, enabling AI coding agents to rapidly understand a project's architecture, conventions, and data flow. The primary language is Python (>=3.12).

Tech Stack

  • Primary Language: Python (>=3.12)
  • Core AI Framework: dspy
  • LLM Abstraction Layer: litellm
  • Dependency Management: uv
  • CLI Framework: argparse (standard library)
  • Configuration: python-dotenv
  • Version Control Interaction: git (via subprocess)
  • Testing: pytest

Architecture

The application follows a modular, stateless pipeline pattern orchestrated by the main CLI entry point.

  • src/autogenerateagentsmd/cli.py: The command-line interface entry point. It parses arguments and orchestrates the entire analysis and generation pipeline via the run_agents_md_pipeline function.
  • src/autogenerateagentsmd/modules.py: Contains the core dspy.Module classes (CodebaseConventionExtractor, AgentsMdCreator, AntiPatternExtractor). These modules encapsulate the primary LLM-driven logic for analyzing code and synthesizing the final document.
  • src/autogenerateagentsmd/signatures.py: Defines the contracts for LLM interactions using dspy.Signature. These signatures specify the expected inputs (e.g., source code) and outputs (e.g., extracted conventions) for each LLM-powered step.
  • src/autogenerateagentsmd/model_config.py: Centralizes the configuration for supported LLMs, making it easy to switch between models like Gemini, Claude, and OpenAI.
  • src/autogenerateagentsmd/utils.py: Contains helper functions for non-LLM tasks, such as cloning Git repositories, loading files into memory, and other file system operations.
  • tests/: The test suite, containing end-to-end and unit tests.
  • pyproject.toml: Defines project metadata, dependencies, and the autogenerateagentsmd console script entry point.

Read the full file on GitHub · 278 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 · 278 lines · 3,246 tokens per session scan A ec89263f5883

Subscribe to this mod's changes

GenerateAgents.md AGENTS.md is an instructions file published in the GitHub repository originalankur/GenerateAgents.md (255 stars, last pushed 6mo ago), licensed MIT. It adds 3,246 tokens to every session, about $0.0162 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.