Clone
3
How to Export guidelines
Wiki Mirror edited this page 2026-10-16 14:43:37 +00:00
This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Generated from docs/how-to/export-guidelines.md at v10.1.0 – edit the repository, not this wiki.

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:

    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:

    <!-- wikitool:export kind=guidelines -->
    

    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). 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

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 <token> 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.