Goal
Maintain project constraint files at both root and sub-module levels so that every agent modifying any part of the codebase has clear boundaries to follow.
Deliverables:
- Root-level
CLAUDE.md + AGENTS.md (three-section format: Commands / Business Goals / Documentation Index)
- Per-module
CLAUDE.md + AGENTS.md (description / file list / non-violable rules)
Acceptance Criteria
- Root
CLAUDE.md and AGENTS.md updated and consistent with actual code
- Prohibitions extracted from git history, issues, and CI config
- Every discovered sub-module has its own constraint files
- All generated files accurately reflect the current codebase state
Workflow
1. Explore the Codebase
Read the repository to understand:
- Project structure and how modules are organised
- Build system and package managers in use
- Existing documentation and development conventions
- CI config, git history, and issue patterns
2. Extract Prohibitions
Look across the project for implicit and explicit prohibitions. Concrete sources:
- Recurring revert / fix commits in git log
- Infeasible approaches mentioned in past issues
- Operations explicitly banned in CI config
- Technical limitations annotated in project docs
Each prohibition must be specific and actionable (e.g. "never auto-create database migrations" not "handle databases carefully"). Include them in root-level AGENTS.md and CLAUDE.md under a Prohibitions section.
3. Discover Sub-modules
Identify every sub-module that needs its own constraint files. A directory qualifies if EITHER:
- Has a package manifest: the directory contains
Cargo.toml, package.json, pyproject.toml, go.mod, pom.xml, build.gradle, etc.
- Lives in a well-known group directory: resides under
packages/, crates/, apps/, lib/, modules/, components/ AND has a clear boundary (own entry point, README, or standalone deployment unit)
For each sub-module record: relative path and a brief description (extract from the manifest's description field or README; infer from code if neither exists).
4. Write Root-level Files
Create or update CLAUDE.md and AGENTS.md in the project root using assets/templates/root-AGENTS.md and assets/templates/root-CLAUDE.md as format skeletons. Both use exactly three sections in this order:
- Common Development Commands — only include commands verifiable against real entry points (
package.json, Makefile, scripts, CI config). Before using any apltk command, run its --help first. Append a one-line purpose per command.
- Project Business Goals — project-level purpose and value, not a feature list.
- Project Documentation Index — cover all files under
docs/features/, docs/architecture/, docs/principles/, plus important root files (README.md, etc.). Also include each sub-module's constraint file: <module_name>/CLAUDE.md in CLAUDE.md, <module_name>/AGENTS.md in AGENTS.md — each with a one-line description.
AGENTS.md vs CLAUDE.md split:
| Aspect |
AGENTS.md |
CLAUDE.md |
| Audience |
Non-Claude agents (Codex, etc.) |
Claude Code |
| Syntax |
Agent-neutral, no platform-specific syntax |
May use Claude-specific syntax |
| Claude-only content |
Must not include |
May include hooks, scheduled tasks, cowork, MCP |
| Common base |
Three sections + Prohibitions |
Same as AGENTS.md |
Both files must stay under 100 lines. Prioritise brevity over completeness when constrained.
5. Write Per-module Files
For each sub-module discovered in Step 3, create or update CLAUDE.md and AGENTS.md in its directory using assets/templates/module-CLAUDE.md as the format skeleton.
Key points:
- Module-level
CLAUDE.md and AGENTS.md have identical content — the format is simple and carries no platform-specific information
MODULE FILE LIST covers all source files; exclude generated output, dist, node_modules, target, etc.
RULES SHOULD NOT BE VIOLATED derives from: module boundary rules, dependency direction, internal conventions, and historical error patterns
- If files already exist, verify their accuracy and update stale content — don't just append
Verification
Self-review before delivery:
References
assets/templates/root-AGENTS.md — format skeleton for root-level AGENTS.md
assets/templates/root-CLAUDE.md — format skeleton for root-level CLAUDE.md
assets/templates/module-CLAUDE.md — format skeleton for per-module constraint files
Source: LaiTszKin/apollo-toolkit — distributed by TomeVault.
1---2name: maintain-project-constraints3description: Reads the latest codebase and docs to update CLAUDE.md and AGENTS.md at both the project root and per sub-module (crate, package, etc.). CLAUDE.md targets Claude Code; AGENTS.md targets non-Claude agents (Codex, etc.). Use when this capability is needed.4---56## Goal78Maintain project constraint files at both root and sub-module levels so that every agent modifying any part of the codebase has clear boundaries to follow.910**Deliverables:**11- Root-level `CLAUDE.md` + `AGENTS.md` (three-section format: Commands / Business Goals / Documentation Index)12- Per-module `CLAUDE.md` + `AGENTS.md` (description / file list / non-violable rules)1314## Acceptance Criteria1516- Root `CLAUDE.md` and `AGENTS.md` updated and consistent with actual code17- Prohibitions extracted from git history, issues, and CI config18- Every discovered sub-module has its own constraint files19- All generated files accurately reflect the current codebase state2021## Workflow2223### 1. Explore the Codebase2425Read the repository to understand:26- Project structure and how modules are organised27- Build system and package managers in use28- Existing documentation and development conventions29- CI config, git history, and issue patterns3031### 2. Extract Prohibitions3233Look across the project for implicit and explicit prohibitions. Concrete sources:34- Recurring revert / fix commits in git log35- Infeasible approaches mentioned in past issues36- Operations explicitly banned in CI config37- Technical limitations annotated in project docs3839Each prohibition must be specific and actionable (e.g. "never auto-create database migrations" not "handle databases carefully"). Include them in root-level `AGENTS.md` and `CLAUDE.md` under a Prohibitions section.4041### 3. Discover Sub-modules4243Identify every sub-module that needs its own constraint files. A directory qualifies if EITHER:44451. **Has a package manifest**: the directory contains `Cargo.toml`, `package.json`, `pyproject.toml`, `go.mod`, `pom.xml`, `build.gradle`, etc.462. **Lives in a well-known group directory**: resides under `packages/`, `crates/`, `apps/`, `lib/`, `modules/`, `components/` AND has a clear boundary (own entry point, README, or standalone deployment unit)4748For each sub-module record: relative path and a brief description (extract from the manifest's `description` field or README; infer from code if neither exists).4950### 4. Write Root-level Files5152Create or update `CLAUDE.md` and `AGENTS.md` in the project root using `assets/templates/root-AGENTS.md` and `assets/templates/root-CLAUDE.md` as format skeletons. Both use exactly three sections in this order:53541. **Common Development Commands** — only include commands verifiable against real entry points (`package.json`, Makefile, scripts, CI config). Before using any `apltk` command, run its `--help` first. Append a one-line purpose per command.552. **Project Business Goals** — project-level purpose and value, not a feature list.563. **Project Documentation Index** — cover all files under `docs/features/`, `docs/architecture/`, `docs/principles/`, plus important root files (`README.md`, etc.). Also include each sub-module's constraint file: `<module_name>/CLAUDE.md` in CLAUDE.md, `<module_name>/AGENTS.md` in AGENTS.md — each with a one-line description.5758**AGENTS.md vs CLAUDE.md split:**5960| Aspect | AGENTS.md | CLAUDE.md |61|--------|-----------|-----------|62| Audience | Non-Claude agents (Codex, etc.) | Claude Code |63| Syntax | Agent-neutral, no platform-specific syntax | May use Claude-specific syntax |64| Claude-only content | Must not include | May include hooks, scheduled tasks, cowork, MCP |65| Common base | Three sections + Prohibitions | Same as AGENTS.md |6667Both files must stay under **100 lines**. Prioritise brevity over completeness when constrained.6869### 5. Write Per-module Files7071For each sub-module discovered in Step 3, create or update `CLAUDE.md` and `AGENTS.md` in its directory using `assets/templates/module-CLAUDE.md` as the format skeleton.7273Key points:74- Module-level `CLAUDE.md` and `AGENTS.md` have identical content — the format is simple and carries no platform-specific information75- `MODULE FILE LIST` covers all source files; exclude generated output, dist, node_modules, target, etc.76- `RULES SHOULD NOT BE VIOLATED` derives from: module boundary rules, dependency direction, internal conventions, and historical error patterns77- If files already exist, verify their accuracy and update stale content — don't just append7879## Verification8081Self-review before delivery:8283- [ ] Every sub-module has both `CLAUDE.md` and `AGENTS.md`84- [ ] All sub-modules discovered in Step 3 are covered — none missed85- [ ] File lists match actual source files in each directory86- [ ] Every prohibition has supporting evidence (git commit hash, issue link, CI config line number, or doc excerpt)87- [ ] Every `RULES SHOULD NOT BE VIOLATED` entry can be traced back to code structure or project history — no invented rules88- [ ] Documentation Index contains no dead links89- [ ] Root-level Documentation Index references every sub-module's constraint file9091## References9293- `assets/templates/root-AGENTS.md` — format skeleton for root-level AGENTS.md94- `assets/templates/root-CLAUDE.md` — format skeleton for root-level CLAUDE.md95- `assets/templates/module-CLAUDE.md` — format skeleton for per-module constraint files9697---98> Source: [LaiTszKin/apollo-toolkit](https://github.com/LaiTszKin/apollo-toolkit) — distributed by [TomeVault](https://tomevault.io).99<!-- tomevault:4.0:skill_md:2026-06-15 -->