coding-guidelines-gen
Generate nested AGENTS.md coding guidelines per module (monorepo-aware), detect languages/tooling, ask architecture preferences, and set up missing formatters/linters (Spotless for JVM).
When & Why to Use This Skill
This Claude skill automates the generation of module-level coding guidelines and architectural boundaries within complex monorepos. By creating nested AGENTS.md files, it establishes clear architecture preferences (such as Clean, Hexagonal, or Layered styles) and ensures codebase consistency. It also streamlines developer workflows by detecting project tooling and automatically configuring essential linters and formatters like Spotless for JVM environments.
Use Cases
- Monorepo Standardization: Automatically scan and generate localized coding guidelines for multiple modules to maintain consistency across large-scale projects.
- Architectural Boundary Enforcement: Define and document strict dependency rules (e.g., preventing domain layers from importing infrastructure) to preserve system integrity.
- Automated Environment Setup: Detect missing development tools and automatically configure best-practice formatters and linters for Java and Kotlin modules.
- AI-Agent Integration: Create machine-readable 'codex-guidelines' blocks that allow other AI agents to verify code quality using runnable commands.
| name | coding-guidelines-gen |
|---|---|
| description | Generate nested AGENTS.md coding guidelines per module (monorepo-aware), detect languages/tooling, ask architecture preferences, and set up missing formatters/linters (Spotless for JVM). |
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
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 importinfra/). - 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).
Workflow (monorepo-aware)
- Scan for candidate modules and languages.
- Use
scripts/scan_modules.pyto produce a quick inventory.
- Use
- Propose the nested
AGENTS.mdplacement(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”.
- If the only detected module is repo root, suggest a subdir (e.g.,
- For each confirmed module root:
- Create/update
<module>/AGENTS.mdusingreferences/agents-template.md. - Fill the
codex-guidelinesJSON block (schema:references/verifiable-block.md) with runnable commands.
- 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
AGENTS.md(seereferences/language-defaults.md).
- JVM (Gradle/Maven): add/configure Spotless (see
Output
- One
AGENTS.mdper module root (nested scope). - Minimal tool config changes only where tooling is missing (format/lint first).