coding-guidelines-gen

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Coding guidelines generator

编码规范生成器

Goal

目标

Create nested
AGENTS.md
files (not repo root) that define:
  • architecture preferences + boundaries (high level)
  • formatting/lint/testing commands (runnable)
  • a small verifiable config block the verifier skill can execute
创建嵌套式
AGENTS.md
文件(而非仓库根目录下的文件),文件需定义:
  • 架构偏好与边界(高层级)
  • 格式化/代码检查/测试命令(可直接运行)
  • 一个可供验证Skill执行的小型可验证配置块

Minimal questions to ask (don’t skip)

必须询问的核心问题(不可跳过)

  • Where are the module roots? (Confirm the folders that should each get an
    AGENTS.md
    ; avoid repo root unless explicitly requested.)
  • Architecture style: layered / hex / clean (pick one) and any hard boundaries (e.g.,
    domain/
    must not import
    infra/
    ).
  • OK to add tooling when missing? (default: yes; Spotless for Java/Kotlin)
  • Default commands: format / lint / test for each module (changed-files-first where practical).
  • 模块根目录位置?(确认每个应生成
    AGENTS.md
    的文件夹;除非明确要求,否则避免使用仓库根目录。)
  • 架构风格:分层/六边形/整洁架构(三选一),以及任何硬性边界(例如:
    domain/
    禁止导入
    infra/
    )。
  • 允许添加缺失的工具吗?(默认:是;Java/Kotlin使用Spotless)
  • 默认命令:每个模块的格式化/代码检查/测试命令(尽可能优先处理变更文件)。

Workflow (monorepo-aware)

工作流(支持单体仓库)

  1. Scan for candidate modules and languages.
    • Use
      scripts/scan_modules.py
      to produce a quick inventory.
    • If
      python
      is not available or the script fails, tell the user and ask whether to install Python or proceed with a manual module scan.
  2. Propose the nested
    AGENTS.md
    placement(s) and get confirmation.
    • If the only detected module is repo root, suggest a subdir (e.g.,
      src/
      ,
      apps/<name>/
      ,
      packages/<name>/
      ) or ask the user where the code “starts”.
  3. For each confirmed module root:
    • Create/update
      <module>/AGENTS.md
      using
      references/agents-template.md
      .
    • Fill the
      codex-guidelines
      JSON block (schema:
      references/verifiable-block.md
      ) with runnable commands.
  4. Ensure formatting + linting exist (prefer existing; otherwise add best-practice defaults).
    • JVM (Gradle/Maven): add/configure Spotless (see
      references/spotless.md
      ).
    • Others: pick a minimal, common default and wire commands into
      AGENTS.md
      (see
      references/language-defaults.md
      ).
  1. 扫描候选模块与语言。
    • 使用
      scripts/scan_modules.py
      生成快速清单。
    • 如果
      python
      不可用或脚本执行失败,告知用户并询问是否安装Python或手动扫描模块。
  2. 提议嵌套式
    AGENTS.md
    的放置位置并获取确认。
    • 如果仅检测到仓库根目录作为模块,建议使用子目录(例如:
      src/
      apps/<name>/
      packages/<name>/
      ),或询问用户代码的起始位置。
  3. 针对每个确认的模块根目录:
    • 使用
      references/agents-template.md
      创建/更新
      <module>/AGENTS.md
    • 填充
      codex-guidelines
      JSON块( schema参考
      references/verifiable-block.md
      ),包含可运行的命令。
  4. 确保格式化+代码检查工具已配置(优先使用现有工具;若无则添加最佳实践默认工具)。
    • JVM(Gradle/Maven):添加并配置Spotless(参考
      references/spotless.md
      )。
    • 其他语言:选择最小化的通用默认工具,并将命令关联到
      AGENTS.md
      中(参考
      references/language-defaults.md
      )。

Deliverable

交付物

Provide:
  • The list of module roots covered and each
    AGENTS.md
    created/updated.
  • The
    codex-guidelines
    command block per module (format/lint/test).
  • Any tooling/config changes added (e.g., Spotless) and where they live.
提供:
  • 已覆盖的模块根目录列表,以及每个已创建/更新的
    AGENTS.md
    文件。
  • 每个模块的
    codex-guidelines
    命令块(格式化/代码检查/测试)。
  • 所有添加的工具/配置变更(例如Spotless)及其所在位置。