docs: add agent bootstrap and contract read router

This commit is contained in:
Mikhail Chusavitin
2026-04-02 13:48:36 +03:00
parent 688b87e98d
commit 1d89a4918e
22 changed files with 883 additions and 1284 deletions

View File

@@ -4,6 +4,22 @@ Shared engineering rules library for Go web projects.
Add as a git submodule to any project — agents (Claude, Codex) will read the rules automatically.
## Agent Read Path
Agents should not read the whole submodule by default.
Start here:
1. `bible/AGENT-BOOTSTRAP.md`
2. `bible-local/README.md`
3. Only the relevant files in `bible-local/architecture/`, `bible-local/decisions/`, and
`bible/rules/patterns/...`
The bootstrap file contains:
- the always-on core contracts
- a router from task type to relevant contracts
- the default rule to skip unrelated contracts
## Usage
```bash
@@ -17,6 +33,7 @@ git submodule update --remote bible
## Structure
```
AGENT-BOOTSTRAP.md — first file agents should read
rules/patterns/ — shared engineering rule contracts
go-logging/ — slog, server-side only
go-database/ — cursor safety, soft delete, GORM, N+1
@@ -32,6 +49,8 @@ rules/patterns/ — shared engineering rule contracts
controls-selection/ — buttons, checkboxes, segmented filters
rules/ai/claude/
CLAUDE.template.md — base CLAUDE.md template for new projects
rules/ai/codex/
AGENTS.template.md — base AGENTS.md template for new projects
```
## Project Setup
@@ -39,7 +58,8 @@ rules/ai/claude/
Each project needs:
- `bible/` — this submodule
- `bible-local/` — project-specific architecture (data model, API, ADL)
- `CLAUDE.md` + `AGENTS.md` — point agents to both
- `CLAUDE.md` + `AGENTS.md` — point agents to the bootstrap file and to `bible-local/`
See `rules/ai/claude/CLAUDE.template.md` for a ready-made template.
See `rules/ai/codex/AGENTS.template.md` for a ready-made Codex template.
See `rules/patterns/go-project-bible/contract.md` for what goes in `bible-local/`.