|
| 1 | +# Contributing |
| 2 | + |
| 3 | +Thanks for helping improve the Agent Assembly examples. This guide covers the |
| 4 | +one repo-wide invariant that every contribution has to preserve: SDK version |
| 5 | +metadata across the example sub-projects is generated, not hand-maintained. |
| 6 | + |
| 7 | +## Example SDK metadata is generated |
| 8 | + |
| 9 | +Every example under `python/`, `node/`, `go/`, and `scenarios/` advertises the |
| 10 | +Agent Assembly SDK version it pins in two places: its manifest |
| 11 | +(`pyproject.toml`, `package.json`, or `go.mod`) and its `README.md`. Keeping |
| 12 | +those two in sync by hand across 20+ examples is how drift is born, so this |
| 13 | +repo owns the pattern with a single source of truth plus a generator plus a |
| 14 | +CI check. |
| 15 | + |
| 16 | +### Source of truth |
| 17 | + |
| 18 | +`metadata/sdk-versions.yaml` at the repo root pins the currently-shipped SDK |
| 19 | +version for each of the three language ecosystems along with the install |
| 20 | +commands used in the READMEs. |
| 21 | + |
| 22 | +### Regenerating after an SDK bump |
| 23 | + |
| 24 | +When a new Agent Assembly SDK release lands and you want the examples to |
| 25 | +advertise it: |
| 26 | + |
| 27 | +1. Edit `metadata/sdk-versions.yaml` — update the `version` field for the |
| 28 | + affected language(s). Do not edit any manifest or README by hand. |
| 29 | +2. Run the generator from the repo root: |
| 30 | + |
| 31 | + ```bash |
| 32 | + python scripts/generate_example_metadata.py |
| 33 | + ``` |
| 34 | + |
| 35 | +3. Commit the resulting manifest + README changes together with the SoT |
| 36 | + change. |
| 37 | + |
| 38 | +The generator is idempotent: running it twice produces no diff. It uses only |
| 39 | +the Python standard library, so no virtualenv or pip install is required. |
| 40 | + |
| 41 | +### Bounded README blocks |
| 42 | + |
| 43 | +Each affected README carries a generated block bounded by: |
| 44 | + |
| 45 | +```markdown |
| 46 | +<!-- BEGIN GENERATED: sdk-install --> |
| 47 | +... |
| 48 | +<!-- END GENERATED: sdk-install --> |
| 49 | +``` |
| 50 | + |
| 51 | +Never edit content between those markers by hand — it will be overwritten on |
| 52 | +the next generator run. Content outside the block (prose about what the |
| 53 | +example demonstrates, expected output, troubleshooting) is entirely yours to |
| 54 | +edit. |
| 55 | + |
| 56 | +### CI drift check |
| 57 | + |
| 58 | +`.github/workflows/example-metadata-check.yml` runs the generator on every |
| 59 | +PR that touches a manifest, README, the SoT, or the generator itself, and |
| 60 | +fails the build if the run produces a diff. If that check fails on your PR, |
| 61 | +run the generator locally and commit the result. |
| 62 | + |
| 63 | +### What is out of scope for the generator |
| 64 | + |
| 65 | +- **Historical / provenance text** — statements like "this example was |
| 66 | + written against 0.0.1-rc.3" are literal and must not be rewritten. |
| 67 | +- **Example runtime code** — the generator only touches manifest pins and |
| 68 | + the sdk-install README block. |
| 69 | +- **New examples** — the generator picks up new sub-projects automatically |
| 70 | + based on directory structure (any `python/<name>/pyproject.toml`, |
| 71 | + `node/<name>/package.json` pinning `@agent-assembly/sdk`, or |
| 72 | + `go/<name>/go.mod` pinning `github.com/ai-agent-assembly/go-sdk` is in |
| 73 | + scope). No configuration is needed. |
0 commit comments