Files changed: - CHANGES.md - VERSION - docs/how-to/README.md - docs/how-to/back-up-to-a-synced-folder.md - docs/how-to/collect-from-a-synced-folder.md - docs/how-to/export-guidelines.md - docs/how-to/export-to-a-synced-folder.md - docs/reference/commands/README.md - docs/reference/commands/exports.md - docs/reference/commands/git.md - docs/reference/commands/guideline-export.md - docs/reference/commands/instance-health.md - docs/reference/commands/raw-material-and-uploads.md - docs/reference/configuration.md - docs/reference/exit-codes.md - instructions/setup-instance.md - raw/CONTRACT.md - tools/CONTRACT.md - tools/README.md - tools/chemenu/backup.py - tools/chemenu/cli_contract.py - tools/chemenu/commands/doctor.py - tools/chemenu/commands/export_cmd.py - tools/chemenu/commands/git_publish.py - tools/chemenu/commands/raw/_common.py - tools/chemenu/commands/raw/accept.py - tools/chemenu/commands/raw/capture.py - tools/chemenu/config_shapes.py - tools/chemenu/guideline_export.py - tools/chemenu/page_export.py - tools/chemenu/reference_doc.py - tools/chemenu/repo_capture.py - tools/chemenu/tests/test_config_shapes.py - tools/chemenu/tests/test_export_run.py Co-Authored-By: Claude Code <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SnAJ7Z3CpVD3PRbN73QtU2
57 lines
2.3 KiB
Markdown
57 lines
2.3 KiB
Markdown
# 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
|
|
<!-- 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](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 <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.
|
|
|
|
## 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)
|