Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AGENTS.md
4 changes: 3 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ before you change it.

## Where facts live

- The extensions and the layout: `README.md` "Layout".
- The extensions and the layout: `README.md` "What is in this repo".
- What CI runs per extension, the `MIN_EXECUTED` floors, the one required job `ci-required`:
`.github/workflows/ci.yml`.
- The release by merge, holds, the npm state: `docs/release.md`; proof `.github/workflows/release.yml`.
Expand All @@ -24,3 +24,5 @@ before you change it.
- `.github/release-hold` keeps a folder out of the release; each line names its reason. Remove the
line only when that reason is gone.
- Merge a pull request that moves files with "rebase", so `git log --follow` keeps the history.
- Commands, in the extension folder: `npm ci`, `npm run verify`, `npx agentage extension check`, one test with `npx vitest run <file>`. Never run `extension create` without `--no-install`.
- Never publish, tag or dispatch the release by hand, and never commit a secret.
89 changes: 61 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,76 @@
# examples

Example agentage extensions, one folder each under `extensions/`. A merge to master is the release.
![examples: an extension in extensions/<id>, a merge to master releases <id>@version, the estate runs the images](https://github.com/agentage/examples/raw/master/docs/banner.svg)

| Folder | Id | What |
| ------------------------------------------ | --------- | ---------------------------------------------------------------- |
| [`extensions/probe`](extensions/probe) | `probe` | one of every part kind: the shape every extension copies |
| [`extensions/fixture`](extensions/fixture) | `fixture` | three parts (`pages`, `api`, `app`): test input for the e2e gate |
Two small agentage extensions that show how an extension is built and released. Use them to learn the shape, or copy one to start your own.

To start your own extension, run `npx @agentage/cli@latest extension create <id>`.
## Quick start

## Layout
You need Node 22 or newer, npm 10 or newer and git.

- Each folder is a whole extension package: its own `package.json`, `package-lock.json`, configs
and tests. There are no npm workspaces: the image build installs the folder's own lockfile, and
the kit versions can differ per folder.
- Work inside a folder: `cd extensions/<name> && npm ci && npm run verify`. Each README says how to
run it.
```bash
git clone https://github.com/agentage/examples && cd examples/extensions/probe
npm ci
npm run verify
npx agentage extension check # PASS probe <version> conforms (6 rules)
```

## Verify
## What is in this repo

`.github/workflows/ci.yml` tests each extension folder a change touches; a change outside
`extensions/` tests all of them. Per extension: `npm run verify`, `agentage extension check`,
`agentage extension up --docker`, `npm run test:e2e` and the gate of agentage/e2e (private, so only
maintainers run it). The job `ci-required` is green when every one passed.
| Folder | Id | What it shows |
| ------------------------------------------ | --------- | --------------------------------------------------------------------- |
| [`extensions/probe`](extensions/probe) | `probe` | one of every part kind: pages, ui, api, mcp, worker, store, cli, app |
| [`extensions/fixture`](extensions/fixture) | `fixture` | three parts (pages, api, app): the test extension of the release loop |

## Release
Each folder is a whole npm package with its own `package.json` and lock file. There are no npm workspaces. Each folder README says how to run it.

A merge to master runs `.github/workflows/release.yml`: `agentage extension release --changed`.
Each extension whose folder differs from its last `<id>@*` tag gets:
## How to work on it

1. a date version `YYYY.MDD.N` (the UTC year, month times 100 plus day, the count that day), written
in the CI copy only: nothing is bumped by hand;
2. the tag `<id>@<version>` on the merge commit;
3. its images `ghcr.io/agentage/<id>-<part>` and `ghcr.io/agentage/<id>`, and the records
`agentage-extension.json` and `agentage-container.json` on the GitHub release;
4. npm with provenance, unless the package is `"private": true`.
Work inside one extension folder:

A folder named in `.github/release-hold` is not released: the run prints one `AMBER` line with the
reason. Details and the current holds: [docs/release.md](docs/release.md).
```bash
cd extensions/<id>
npm ci
npm run verify # type-check, lint, format, tests with coverage, build
npx agentage extension check # the kit's six rules
```

CI runs `verify`, `check`, `agentage extension up --docker` and the e2e tests for each folder that a change touches. A change outside `extensions/` tests all folders. The job `ci-required` is green when all of them pass.

To start a new extension, run `npx @agentage/cli@latest extension create <id> --no-install`. The template comes from [agentage/kit](https://github.com/agentage/kit).

## How a change is released

A merge to master is the release. `.github/workflows/release.yml` runs `agentage extension release --changed`.

- Only an extension whose folder changed since its last tag is released. Each extension gets its own version and tag.
- The version has the form `YYYY.MDD.N`: the year, the month times 100 plus the day, and the count of that day. Example: `2026.1122.3`.
- The tag has the form `<id>@<version>`, for example `probe@2026.1122.3`.
- The release pushes the images `ghcr.io/agentage/<id>-<part>` and `ghcr.io/agentage/<id>`. Both `package.json` files set `"private": true`, so nothing goes to npm.
- Nobody bumps a version by hand. A released version never changes: a fix is a new merge.
- A change to a root-level `*.md` file or to `docs/` of an extension folder releases nothing. The same holds for the root `README.md`, `docs/` and `.github/` of this repo.
- To stop a folder from releasing, add a line to `.github/release-hold`: the folder name, then the reason. A line with no reason fails the run.
- Lock files: `extensions/<id>/package-lock.json` is the only lock file of an extension. A change to it releases that extension.

More: [docs/release.md](docs/release.md).

## For agents

```bash
cd extensions/probe && npm ci && npm run verify && npx agentage extension check
```

- Required CI check: `ci-required`. Local gate: `npm run verify` in the folder you changed.
- Never edit `openapi.json` or `probe.mcpc.json` by hand. They are generated; `agentage extension check --write` refreshes them.
- Never tag, publish or run the release workflow by hand. A merge to master releases.
- Run `agentage extension up`, `install`, `setup` and `update` only in a throwaway environment: they change the local daemon.
- Run `agentage extension create` with `--no-install`.
- Deeper rules: [CLAUDE.md](CLAUDE.md) (`AGENTS.md` links to it), one per extension folder, and [docs/release.md](docs/release.md).

## Related

- [agentage/kit](https://github.com/agentage/kit): the kit and the extension template.
- [agentage/cli](https://github.com/agentage/cli): the `agentage` command.

## License

Expand Down
51 changes: 51 additions & 0 deletions docs/banner.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 1 addition & 2 deletions docs/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
name, then the reason. A line with a name and no reason fails the run (`FAIL release-hold: line N names <id> without a reason`); `#` lines and blank lines are fine. The release step drops a held folder from its checkout and prints
`AMBER <name>: not released: <reason>`. Remove the line to release the folder with the next merge.

- `fixture`: its image packages `fixture`, `fixture-api` and `fixture-pages` are linked to
agentage/extension-fixture. The release can push them only when agentage/examples can write them.
- No folder is held today: the file holds comments only.

## npm

Expand Down
6 changes: 3 additions & 3 deletions extensions/fixture/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

A three-part extension (`pages`, `api`, `app`) that agentage/e2e runs its gate
against. The human guide is [README.md](README.md). Keep this folder small: it is test input, not a
starting point. The extension template is agentage/extension-template.
starting point. The extension template is `template/` of agentage/kit.

## Where facts live

- What each part serves, its scope and answers: `README.md` "What it serves".
- What each part serves, its scope and answers: `README.md` "Parts".
- Routes, scopes, status codes, body limits: `openapi.json` (generated; never edit by hand).
- Run it locally, ports, tokens: `README.md` "Quick start".
- CI jobs and the `MIN_EXECUTED` floor: the repo root `.github/workflows/ci.yml`. Test coverage floor: `vitest.config.ts`.
- Release rules and refusals: `README.md` "Release", the repo root `.github/workflows/release.yml`.
- The manifest and its parts: the `agentage` block of `package.json`.
- Where a release runs: `README.md` "Deploy".
- Where a release runs: the estate that installs it is outside this repo; a release alone deploys nothing.
- The target design (the extension model, the app host, the app shell): the north star in the agentage product vault, `projects/architecture/`. Do not copy it into this repo.

Read the file named here before you read `src/`.
Expand Down
60 changes: 18 additions & 42 deletions extensions/fixture/README.md
Original file line number Diff line number Diff line change
@@ -1,68 +1,44 @@
# fixture

A small agentage extension with three parts (folders that each do one job), `pages`, `api` and `app`. The agentage e2e tests use
it as test input. It is for maintainers of the extension platform. It is not a starting point:
to start an extension, use [agentage/extension-template](https://github.com/agentage/extension-template).
The fixture is an agentage extension with three parts: `pages`, `api` and `app`. It is the test extension of the release loop and of the e2e tests. It is not a starting point: to learn the shape, read the [probe](../probe).

## Quick start

Needs Node 22 or newer, npm 10 or newer, Docker and git. Nothing needs a sign-in. Run every command in
this folder, `extensions/fixture` of agentage/examples.
You need Node 22 or newer, npm 10 or newer and git. Run the commands in this folder.

```bash
npm ci
npm run build
npx agentage extension up # on the daemon, 127.0.0.1:4243: the api and app parts, reload on save (pages need --docker)
curl -s "127.0.0.1:4243/api/fixture/echo?msg=hi"
npx agentage extension down
# npx agentage extension up --docker # the release images (api and pages); ports 4280 and 4281 must be free
npm run verify
npx agentage extension check # PASS fixture <version> conforms (6 rules)
```

Use `npx agentage` inside this folder: its lockfile pins that version.
Use `npx agentage` here: the lock file pins the cli version.

## What it serves
## Parts

| Part | Source | Serves |
| ----- | -------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| pages | [`src/pages`](src/pages) | `/`: a static page with the id, version and commit |
| api | [`src/api/index.ts`](src/api/index.ts) | `GET /api/fixture/echo?msg=` (scope `fixture:read`), `GET /api/fixture/ping` and `GET /api/fixture/installations/{target}` (both public) |
| app | [`src/app`](src/app/index.tsx) | the shell page `/fixture`: nav row Fixture, one Note input kept in `useAppState('note')` |
| Part | Source | Serves |
| ----- | -------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| pages | [`src/pages`](src/pages) | `/`: a static page with the id, version and commit |
| api | [`src/api/index.ts`](src/api/index.ts) | `GET /api/fixture/echo?msg=` (scope `fixture:read`), `GET /api/fixture/ping` and `GET /api/fixture/installations/{target}` |
| app | [`src/app`](src/app/index.tsx) | the shell page `/fixture`: one Note input |

- `ping` answers `{"success":true,"data":{"msg":"pong","pings":null}}`: this extension has no store.
- `installations/{target}` accepts only `fixture.<env>` (no estate host uses that name today).
It answers an installation document that deploys the probe extension at
`https://probe.<env>`. Any other target answers 404 `NOT_FOUND`.
- `openapi.json` lists every route. A test, `src/manifest.test.ts`, checks that the file exists
only when `src/api` exists.
`openapi.json` lists every route. It is generated: never edit it by hand.

## Verify
## Checks

```bash
npm run verify # type-check, lint, format, tests with coverage, build
npx agentage extension check # PASS fixture <version> conforms
npx agentage extension check # the kit's six rules
```

CI then runs `up --docker` and `npm run e2e -- fixture gate docker` in an agentage/e2e checkout.
CI then runs `agentage extension up --docker` and the e2e gate. The gate lives in a private repo.

## Release

A merge to master that changes this folder releases it with a date version `YYYY.MDD.N` and the
tag `fixture@<version>`: see the [repo README](../../README.md#release). The package is private:
the release pushes the images, attaches the records `agentage-container.json` and
`agentage-extension.json` to the GitHub release and publishes nothing to npm. Releases made before
the move are `v*` tags of agentage/extension-fixture.
A merge to master that changes this folder releases it, with the version `YYYY.MDD.N` and the tag `fixture@<version>`. See the [repo README](../../README.md#how-a-change-is-released). The package is private, so nothing goes to npm. A change to this README or to `CLAUDE.md` releases nothing.

## Deploy

A release deploys nothing. One file runs the fixture on `next`, the staging estate, and it follows
the newest release: the cloud extension opens a pull request that changes the version.

- The `fixture` row in `test/installation.json` of agentage/apphosts (`"track": "latest"`): the `test` app host, served at `https://test.next.agentage.io`.

## Documentation
## More

- [CLAUDE.md](CLAUDE.md): the layout and the rules for an agent that changes this folder.

## License

MIT, see [LICENSE](LICENSE).
MIT. See [LICENSE](LICENSE).
Loading