agents-md-generator

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

AGENTS.md Generation Capability

AGENTS.md生成能力

This skill enables the agent to generate
AGENTS.md
files that serve as contributor guides for AI agents working on a codebase.
本技能使Agent能够生成
AGENTS.md
文件,作为AI Agent参与代码库开发的贡献者指南。

Core Capability

核心能力

  • Function: Analyze repository structure and generate or update a standardized
    AGENTS.md
    document
  • Output Format: Markdown file with structured sections
  • Character Limit: Dynamic, based on repository LOC (Lines of Code)
  • Monorepo Support: Automatically detects monorepo structures and generates hierarchical documentation (Root + Packages)
  • Update Support: Refreshes only standard sections in an existing
    AGENTS.md
    , preserving user-defined custom sections
  • 功能:分析仓库结构并生成或更新标准化的
    AGENTS.md
    文档
  • 输出格式:带有结构化章节的Markdown文件
  • 字符限制:动态调整,基于仓库代码行数(LOC)
  • 单体仓库(Monorepo)支持:自动检测单体仓库结构,生成层级化文档(根目录 + 各包)
  • 更新支持:刷新现有
    AGENTS.md
    中的标准章节,同时保留用户定义的自定义章节

Output Sections

输出章节

Single Repo / Package Document (5 Sections)

单仓库/包文档(5个章节)

For single repositories or individual packages in a monorepo:
  • Overview: 1-2 sentence project description (abstract, no tool/framework lists)
  • Folder Structure: Key directories and their contents
  • Core Behaviors & Patterns: Logging, error handling, control flow, module structure patterns observed in code
  • Conventions: Naming, comments, code style derived from analysis
  • Working Agreements: Rules for agent behavior and communication
适用于单仓库或单体仓库中的单个包:
  • 概述:1-2句话的项目描述(为摘要形式,不包含工具/框架列表)
  • 文件夹结构:关键目录及其内容
  • 核心行为与模式:代码中观察到的日志、错误处理、控制流、模块结构模式
  • 约定:从代码分析中提炼的命名、注释、代码风格规范
  • 工作协议:Agent行为与沟通规则

Monorepo Root Document (3 Sections)

单体仓库根目录文档(3个章节)

For the root of a monorepo structure:
  • Overview: 1-2 sentences describing the monorepo's purpose
  • Folder Structure: High-level map of apps, packages, and shared configs
  • Working Agreements: Common working agreements applicable to all packages
适用于单体仓库的根目录:
  • 概述:1-2句话描述单体仓库的用途
  • 文件夹结构:应用、包和共享配置的高层级映射
  • 工作协议:适用于所有包的通用工作协议

Operation Modes

操作模式

Generate vs Update

生成 vs 更新

  • Generate: Creates a new
    AGENTS.md
    from scratch (default when no
    AGENTS.md
    exists)
  • Update: Refreshes standard sections in an existing
    AGENTS.md
    while preserving custom sections. See ./references/update_strategy.md for detailed workflow and section matching rules.
The agent automatically selects the appropriate mode based on whether an
AGENTS.md
file already exists at the target location.
  • 生成:从头创建新的
    AGENTS.md
    (当不存在
    AGENTS.md
    时默认使用该模式)
  • 更新:刷新现有
    AGENTS.md
    中的标准章节,同时保留自定义章节。详细工作流和章节匹配规则请参考./references/update_strategy.md。 Agent会根据目标位置是否已存在
    AGENTS.md
    文件自动选择合适的模式。

Generation Modes (Monorepo)

生成模式(单体仓库)

Supports three modes: All (root + all packages, default), Root Only, and Single Package. See ./references/monorepo_strategy.md for detailed strategy and mode selection criteria.
支持三种模式:全部(根目录 + 所有包,默认)、仅根目录单个包。详细策略和模式选择标准请参考./references/monorepo_strategy.md

Tools

工具

This skill uses the following read-only tools for repository analysis. See ./references/read_only_commands.md for detailed usage patterns.
  • tokei
    : LOC measurement (required)
  • rg
    (ripgrep)
    : Content search (preferred)
  • grep
    /
    Select-String
    : Content search (fallback per OS)
  • sed -n
    /
    Get-Content \| Select-Object
    : Paginated file reading per OS
  • tree
    : Directory structure visualization
  • find
    : File and directory discovery (Linux / macOS)
  • ls
    ,
    pwd
    : Basic directory navigation
本技能使用以下只读工具进行仓库分析。详细使用模式请参考./references/read_only_commands.md
  • tokei
    :代码行数(LOC)统计(必需)
  • rg
    (ripgrep)
    :内容搜索(优先使用)
  • grep
    /
    Select-String
    :内容搜索(根据操作系统备选)
  • sed -n
    /
    Get-Content | Select-Object
    :分页读取文件(根据操作系统)
  • tree
    :目录结构可视化
  • find
    :文件和目录查找(Linux / macOS)
  • ls
    ,
    pwd
    :基础目录导航

Domain Knowledge

领域知识

  • LOC Measurement: Capability to measure repository size and determine character limits. See ./references/loc_measurement.md
  • Repository Analysis: Capability to inspect and understand codebase structure. See ./references/read_only_commands.md
  • Output Template: Standardized AGENTS.md structure specification. See ./references/agents_md_template.md
  • Working Agreements: Agent behavior rules for generated documents. See ./references/working_agreements.md
  • Monorepo Detection: Capability to identify monorepo structures. See ./references/monorepo_detection.md
  • Monorepo Strategy: Strategy for generating documentation in monorepos. See ./references/monorepo_strategy.md
  • Update Strategy: Strategy for updating existing AGENTS.md files with selective section refresh. See ./references/update_strategy.md
  • LOC统计:统计仓库大小并确定字符限制的能力。请参考./references/loc_measurement.md
  • 仓库分析:检查并理解代码库结构的能力。请参考./references/read_only_commands.md
  • 输出模板:标准化AGENTS.md结构规范。请参考./references/agents_md_template.md
  • 工作协议:生成文档中的Agent行为规则。请参考./references/working_agreements.md
  • 单体仓库检测:识别单体仓库结构的能力。请参考./references/monorepo_detection.md
  • 单体仓库策略:在单体仓库中生成文档的策略。请参考./references/monorepo_strategy.md
  • 更新策略:选择性刷新章节以更新现有AGENTS.md文件的策略。请参考./references/update_strategy.md

Scope Boundaries

范围边界

  • Read-Only Analysis: Supports non-destructive commands for repository inspection
  • Output Scope: Produces documentation content only; excludes run/test/build/deploy instructions
  • Excluded Inputs: Lock files (
    pnpm-lock.yaml
    ,
    package-lock.json
    ,
    yarn.lock
    , etc.) are outside analysis scope
  • 只读分析:支持用于仓库检查的非破坏性命令
  • 输出范围:仅生成文档内容;不包含运行/测试/构建/部署说明
  • 排除输入:锁文件(
    pnpm-lock.yaml
    package-lock.json
    yarn.lock
    等)不在分析范围内