diff --git a/AGENTS.md b/AGENTS.md index 0e8a706fc96b..a0f74fabf3aa 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -56,3 +56,77 @@ Note: Edits to source files take effect after rebuilding the package via `pnpm b - Example: `agent-browser click @e1` / `fill @e2 "text"` - Interact using refs - Re-snapshot after page changes. - Note: If you can't find `agent-browser`, your machine may not have it installed. If this happens, ask the user to run `npm install -g agent-browser && agent-browser install`. If you are running in headless mode with no human operator and need this tool to complete your job, it is best to fail the job vs. trying to work around not having the tool. + +# Pull Request Guidelines + +## Commit Messages + +Use [conventional commits](https://www.conventionalcommits.org/): + +``` +feat: add View Transitions support for SVG +fix: resolve CSS scoping regression in nested components +docs: update integration guide for React 19 +refactor: simplify middleware pipeline +chore: update dependencies +``` + +## Changesets + +This repo uses changesets. If your change affects published packages (features, fixes — not docs/chore), create a changeset. It will not trigger a release unless there is a changeset: + +```bash +pnpm changeset add --empty +``` + +Then edit the generated file in `.changeset/` to add the package name, bump type, and summary. For example: + +```markdown +--- +'astro': patch +--- + +Fix CSS scoping regression in nested components +``` + +- `feat:` → minor bump +- `fix:` → patch bump +- `docs:`, `chore:`, `refactor:` → usually no changeset needed +- Breaking changes → major bump, but these should never be introduced without prior agreement from maintainers + +## PR Description + +Every PR **must** use the repo's PR template at [`.github/PULL_REQUEST_TEMPLATE.md`](.github/PULL_REQUEST_TEMPLATE.md). Fill in all sections: + +1. **Changes** — Short, concise bullet points describing what changed and why. +2. **Testing** — How you verified the change works (tests added/updated, manual steps). Never delete this section — if no tests were added, explain why. +3. **Docs** — Whether this could affect user behavior and if docs updates are needed. + +### AI Disclosure + +If the PR was authored or co-authored using an AI tool (e.g. Claude, Copilot, Cursor, OpenCode), this **must** be disclosed in the PR description. Use one of the following labels: + +- **`AI-generated`** — The contribution was primarily generated by an AI tool with human review. +- **`AI-assisted`** — A human wrote the contribution with help from AI tools (e.g. code completion, suggestions, debugging). + +Include this as a line in the PR description, e.g.: + +``` +> AI-assisted: Co-authored using OpenCode (Claude) +``` + +or + +``` +> AI-generated: Generated by Claude with human review and testing +``` + +If a PR is `AI-generated`, it **must** be created as a draft (`gh pr create --draft`). The human controlling the agenty must manually review the changes and mark it as ready for review before it will be reviewed by the Astro team. + +## Workflow + +1. Always create a branch from `main` — never push directly. +2. Make changes and commit using conventional commit messages. +3. Create a changeset if needed. +4. Run tests (`pnpm test`) and fix any failures. +5. Push the branch and create a PR via `gh pr create`.