|
| 1 | +# Sync Documentation |
| 2 | + |
| 3 | +After feature work, update the affected documentation to reflect code changes. |
| 4 | + |
| 5 | +## Steps |
| 6 | + |
| 7 | +1. **Identify changed files** — Run `git diff main --name-only` to find modified Go files. |
| 8 | + |
| 9 | +2. **Map files to docs** — Use this mapping to determine which docs need updates: |
| 10 | + |
| 11 | + | Changed path pattern | Affected docs | |
| 12 | + |---------------------|---------------| |
| 13 | + | `forge-core/runtime/` | `docs/runtime.md`, `docs/hooks.md` | |
| 14 | + | `forge-core/security/` | `docs/security/overview.md`, `docs/security/egress.md` | |
| 15 | + | `forge-core/tools/` | `docs/tools.md` | |
| 16 | + | `forge-core/llm/` | `docs/runtime.md` | |
| 17 | + | `forge-core/memory/` | `docs/memory.md` | |
| 18 | + | `forge-core/scheduler/` | `docs/scheduling.md` | |
| 19 | + | `forge-core/secrets/` | `docs/security/secrets.md` | |
| 20 | + | `forge-core/skills/` | `docs/skills.md` | |
| 21 | + | `forge-core/channels/` | `docs/channels.md` | |
| 22 | + | `forge-cli/cmd/` | `docs/commands.md` | |
| 23 | + | `forge-cli/runtime/` | `docs/runtime.md` | |
| 24 | + | `forge-cli/server/` | `docs/architecture.md` | |
| 25 | + | `forge-cli/channels/` | `docs/channels.md` | |
| 26 | + | `forge-cli/tools/` | `docs/tools.md` | |
| 27 | + | `forge-plugins/` | `docs/channels.md`, `docs/plugins.md` | |
| 28 | + | `forge-ui/` | `docs/dashboard.md` | |
| 29 | + | `forge-skills/` | `docs/skills.md` | |
| 30 | + | `forge.yaml` / `types/` | `docs/configuration.md` | |
| 31 | + |
| 32 | +3. **Read the diff** — For each mapped doc, read the relevant `git diff main` output to understand what changed. |
| 33 | + |
| 34 | +4. **Update docs** — For each affected doc: |
| 35 | + - Read the current doc file |
| 36 | + - Identify sections that need updating based on the code changes |
| 37 | + - Edit the doc to reflect new behavior, flags, types, or configuration |
| 38 | + - Preserve the navigation footer and header |
| 39 | + |
| 40 | +5. **Check cross-references** — If you added a new feature/section, ensure: |
| 41 | + - The README.md documentation table links to it (if it's a new doc) |
| 42 | + - Related docs cross-link to it where appropriate |
| 43 | + - Navigation order is still correct |
| 44 | + |
| 45 | +6. **Validate** — Run a quick broken-link check: |
| 46 | + ```bash |
| 47 | + grep -rn '\[.*\](.*\.md)' README.md docs/ | while read line; do |
| 48 | + file=$(echo "$line" | grep -oP '\(.*?\.md\)' | tr -d '()') |
| 49 | + dir=$(dirname "$(echo "$line" | cut -d: -f1)") |
| 50 | + target="$dir/$file" |
| 51 | + [ ! -f "$target" ] && echo "BROKEN: $line" |
| 52 | + done |
| 53 | + ``` |
| 54 | + |
| 55 | +## Rules |
| 56 | + |
| 57 | +- One topic per file; split if >300 lines |
| 58 | +- Start each doc with a one-sentence summary |
| 59 | +- Use tables over bullet lists for comparisons |
| 60 | +- Link, don't repeat — cross-reference other docs |
| 61 | +- Keep ASCII diagrams (they render everywhere) |
| 62 | +- Code examples must be runnable |
0 commit comments