coding-guidelines-gen
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCoding guidelines generator
编码规范生成器
Goal
目标
Create nested files (not repo root) that define:
AGENTS.md- 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 ; avoid repo root unless explicitly requested.)
AGENTS.md - Architecture style: layered / hex / clean (pick one) and any hard boundaries (e.g., must not import
domain/).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)
工作流(支持单体仓库)
- Scan for candidate modules and languages.
- Use to produce a quick inventory.
scripts/scan_modules.py - If is not available or the script fails, tell the user and ask whether to install Python or proceed with a manual module scan.
python
- Use
- Propose the nested placement(s) and get confirmation.
AGENTS.md- If the only detected module is repo root, suggest a subdir (e.g., ,
src/,apps/<name>/) or ask the user where the code “starts”.packages/<name>/
- If the only detected module is repo root, suggest a subdir (e.g.,
- For each confirmed module root:
- Create/update using
<module>/AGENTS.md.references/agents-template.md - Fill the JSON block (schema:
codex-guidelines) with runnable commands.references/verifiable-block.md
- Create/update
- 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 (see
AGENTS.md).references/language-defaults.md
- JVM (Gradle/Maven): add/configure Spotless (see
- 扫描候选模块与语言。
- 使用生成快速清单。
scripts/scan_modules.py - 如果不可用或脚本执行失败,告知用户并询问是否安装Python或手动扫描模块。
python
- 使用
- 提议嵌套式的放置位置并获取确认。
AGENTS.md- 如果仅检测到仓库根目录作为模块,建议使用子目录(例如:、
src/、apps/<name>/),或询问用户代码的起始位置。packages/<name>/
- 如果仅检测到仓库根目录作为模块,建议使用子目录(例如:
- 针对每个确认的模块根目录:
- 使用创建/更新
references/agents-template.md。<module>/AGENTS.md - 填充JSON块( schema参考
codex-guidelines),包含可运行的命令。references/verifiable-block.md
- 使用
- 确保格式化+代码检查工具已配置(优先使用现有工具;若无则添加最佳实践默认工具)。
- JVM(Gradle/Maven):添加并配置Spotless(参考)。
references/spotless.md - 其他语言:选择最小化的通用默认工具,并将命令关联到中(参考
AGENTS.md)。references/language-defaults.md
- JVM(Gradle/Maven):添加并配置Spotless(参考
Deliverable
交付物
Provide:
- The list of module roots covered and each created/updated.
AGENTS.md - The command block per module (format/lint/test).
codex-guidelines - Any tooling/config changes added (e.g., Spotless) and where they live.
提供:
- 已覆盖的模块根目录列表,以及每个已创建/更新的文件。
AGENTS.md - 每个模块的命令块(格式化/代码检查/测试)。
codex-guidelines - 所有添加的工具/配置变更(例如Spotless)及其所在位置。