# Export guidelines to captured repositories The repositories the wiki captures documentation from can get something back: the wiki's guidelines, as one generated `GUIDELINES.md` in each repository's root, which that repository's own agents then read. ## What you prepare - **Decide which pages count as guidelines.** That decision is yours, and it is written down in `kb/CONVENTIONS.md` ยง Guidelines for other repositories. Usually it is a tag. To see the file exactly as it would be written, without touching any repository: ```bash tools/wikitool export guidelines --tag guideline ``` - **Opt each repository in, by hand, once.** A repository takes part only if it carries a `GUIDELINES.md` whose first line is exactly: ```markdown ``` Commit that one line there. Then point the repository's own `AGENTS.md` at the file (for Claude Code: `@GUIDELINES.md`). A `GUIDELINES.md` without that first line is hand-written, and the export never touches it. The repository has to be one the wiki has captured ([Capture documentation from a git repository](capture-repository-docs.md)). That is how the export knows where the repository lives. Its capture also has to follow a branch: a repository captured by a tag pattern is skipped, because a tag has no branch to commit onto. ## What you say ```text Roll out the guidelines to the captured repositories ``` ## Where the agent stops The agent runs `export guidelines --push`, which stops before pushing anything. This is the **Guideline Push Gate** (exit 42). For every repository, it prints the status, the diff it would write and a `--confirm ` line. The agent puts every diff in front of you. Only your approval pushes, and then only one commit per repository, which changes only `GUIDELINES.md` and goes straight onto its branch. The token is a digest of each target's branch tip and of the generated file. If a branch has moved or a guideline was edited since you looked, the gate asks again rather than pushing something you did not see. ## Related - [Export commands](../reference/commands/exports.md) - [Export pages to a synced folder](export-to-a-synced-folder.md) - the other export, a read-only version of `kb/` pages - [Why the gates are code](../explanation/why-gates-are-code.md)