From be52bf2855d34304f4923f6636b758f0edd7bd94 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 18 Aug 2026 20:44:51 +0000 Subject: [PATCH] docs: restructure AGENTS.md and add an AI contributions policy Reshape AGENTS.md along the structure PostHog/posthog-js uses for its agent guide: an overview with the pinned toolchain versions, folder structure, a workspace package table, environment setup, a command reference with Turborepo filters, a CI workflow table, an important-files table, and troubleshooting. The architecture boundaries and the safety and determinism rules are kept verbatim, and the Skilld-managed block at the end of the file is preserved. Add AI_POLICY.md, adapted from PostHog's policy to this repository: the contributor owns the diff, respects the package boundaries, runs the full check set with deterministic tests, and discloses agent involvement. Model output stays untrusted input, security reports follow SECURITY.md, and unsolicited AI-generated reviews are not accepted. Add the Agent context section the policy refers to in the pull request template, and link the policy from CONTRIBUTING.md. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01E7MKWqd4RdBJPCywtWA3zf --- .github/PULL_REQUEST_TEMPLATE.md | 10 ++ AGENTS.md | 170 ++++++++++++++++++++++++++++++- AI_POLICY.md | 56 ++++++++++ CONTRIBUTING.md | 2 + 4 files changed, 235 insertions(+), 3 deletions(-) create mode 100644 AI_POLICY.md diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 8db725a..d6ea0af 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -24,6 +24,16 @@ - [ ] I did not expose secrets, tokens, personal data, or untrusted output in logs. - [ ] I updated documentation and Agent Skills when workflows or boundaries changed. +## Agent context + + + +- Agent/tools used: +- What the agent did, and what you changed or verified yourself: + ## Reviewer notes diff --git a/AGENTS.md b/AGENTS.md index c5311cb..7d6fef8 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,13 +1,56 @@ -# Agent Zero contributor instructions +# Agent Zero development guide These instructions apply to humans and coding agents working in this repository. +## Overview + +Agent Zero is an open-source autonomous engineer that finds, fixes, and verifies problems in pull requests. This is an [aube](https://aube.jdx.dev) workspace containing the runtime packages, their adapters, and a single deployable Nuxt app. Turborepo orchestrates builds and checks. + +**Key information:** + +- Node version: `24.19.0` (`>=24.2` supported; see `mise.toml` and `engines`) +- Package manager: `aube@1.38.0` (pinned in `package.json` via `packageManager`) +- TypeScript: `^5.9.2`, overridden to `typescript-native-bridge` so checks run on tsgo +- Main branch: `main` + ## Start here 1. Read `README.md`, `CONTRIBUTING.md`, and the relevant skill in `.agents/skills/`. 2. Inspect the package you are changing and its tests before editing. 3. Keep the change narrow and preserve package boundaries. -4. Run the checks listed in `CONTRIBUTING.md` before handing off the change. +4. Run the checks listed in [Required checks](#required-checks) before handing off the change. +5. If an AI agent helped write the change, follow [AI_POLICY.md](AI_POLICY.md). + +## Folder structure + +- `./packages` — runtime packages and their adapters, published under `@agent-zero/*` +- `./apps` — the deployable dashboard plus the docs, marketing, and mail-preview sites +- `./docs` — canonical architecture and provider references, included verbatim by `apps/docs` +- `./tooling` — shared Oxlint and Oxfmt configuration +- `./scripts` — repository checks and the shared tsdown configuration +- `./.agents/skills` — Agent Skills; `.skills/` holds the Skilld-managed subset +- `./.github` — CI workflows, issue and pull request templates + +## Workspace packages + +| Path | Name | Description | +| ------------------------- | ---------------------------- | ---------------------------------------------------------------- | +| `packages/agent` | `@agent-zero/agent` | Orchestration and state transitions only | +| `packages/runner` | `@agent-zero/runner` | The only boundary allowed to run commands or mutate a checkout | +| `packages/models` | `@agent-zero/models` | Model-provider abstractions | +| `packages/source-control` | `@agent-zero/source-control` | Provider-neutral contracts plus GitHub, GitLab, Bitbucket, Gitea | +| `packages/config` | `@agent-zero/config` | Configuration parsing and policy | +| `packages/shared` | `@agent-zero/shared` | Stable cross-package contracts | +| `packages/cli` | `@agent-zero/cli` | Argument parsing and terminal presentation | +| `packages/database` | `@agent-zero/database` | Schema, Drizzle client, and checked-in migrations | +| `packages/auth` | `@agent-zero/auth` | Authentication policy and the Better Auth options factory | +| `packages/api` | `@agent-zero/api` | The oRPC router and control-plane operations | +| `packages/i18n` | `@agent-zero/i18n` | Locale messages and i18n tooling | +| `packages/mail` | `@agent-zero/mail` | Transactional mail templates | +| `apps/dashboard` | `@agent-zero/dashboard` | The single deployable app and composition root | +| `apps/docs` | `@agent-zero/docs` | VitePress documentation site (not deployed with the dashboard) | +| `apps/marketing` | `@agent-zero/marketing` | Frontend-only public marketing site | +| `apps/mail-preview` | `@agent-zero/mail-preview` | Dev-only Maizzle preview server for `packages/mail` | ## Toolchain @@ -19,6 +62,65 @@ These instructions apply to humans and coding agents working in this repository. - Use Oxlint with type-aware checks and Oxfmt. Do not add ESLint or Prettier. - Do not edit `dist/`, `.turbo/`, or generated declaration files. +## Environment setup + +```bash +# Install the pinned Node.js and aube versions +mise install # or: npm install -g --ignore-scripts=false @endevco/aube + +# Install workspace dependencies +aube ci + +# Seed local environment files +cp .env.example .env +cp apps/dashboard/.env.example apps/dashboard/.env +``` + +`aube run