diff --git a/.agents/skills/ship-pr/SKILL.md b/.agents/skills/ship-pr/SKILL.md deleted file mode 100644 index d3490da..0000000 --- a/.agents/skills/ship-pr/SKILL.md +++ /dev/null @@ -1,84 +0,0 @@ ---- -name: ship-pr -description: Ship a finished openboot.dev change through the canonical pull-request flow. Use when the user asks to open, submit, or ship a PR/MR for the current branch, including phrases such as "open a PR", "ship this", "提 PR", or "提个 MR". Push, open the PR, wait for CI, review the full diff, fix small findings, escalate product decisions, squash-merge a clean PR, and clean up locally. Do not use for status checks on an existing PR or for draft/WIP work. ---- - -# Ship a PR for openboot.dev - -Treat the PR review as the last reversible gate before `main` deploys. - -Do not use auto-merge. Complete CI and review before merging from the current -session. - -## Check the branch - -Run: - -```bash -git status -sb -git rev-parse --abbrev-ref HEAD -git log --oneline main..HEAD -``` - -Stop if the branch is `main` or has no commits ahead of `main`. Account for all -working-tree changes before shipping. - -For draft/WIP work, use a draft PR and stop. For a backwards-incompatible D1 -migration, verify it locally and ask for the rollout decision before proceeding. - -## Push and open the PR - -Push the current branch: - -```bash -git push -u origin "$(git rev-parse --abbrev-ref HEAD)" -``` - -The installed pre-push hook runs `npm run validate`; CI remains the gate when -the hook is not installed. - -Create a PR with a Conventional Commits title under 70 characters. Summarize -the change and list the actual local verification in the body. - -## Wait for CI - -Run: - -```bash -gh pr checks --watch -``` - -Require the checks listed in `.github/required-checks.txt`. If a required check -fails, inspect it with `gh run view --log-failed`, fix failures that have an -unambiguous solution, push, and wait again. Escalate failures that require a -product or rollout decision. Treat harness drift sensors as informational unless -repository policy changes. - -## Review the full diff - -After CI passes, review `git diff main...HEAD` for behavior, design, tests, -risk, and rollback. In particular, check: - -- D1 access boundaries and parameter binding. -- API contract alignment with `openboot-contract`. -- Forward-only D1 migrations. -- Round trips for fields that flow CLI -> server -> CLI. -- New warnings, missing tests, and unexpected generated files. - -Fix small, clear issues in the current session, commit them, push, and wait for -CI again. Escalate choices that depend on product intent or team convention. -Merge without asking for another confirmation when the PR is clean. - -## Merge and clean up - -Run: - -```bash -gh pr merge --squash --delete-branch -git checkout main -git pull --ff-only -``` - -Delete the local feature branch if it still exists. Do not roll back a failed -deployment, change the separate `openboot-contract` repository, or alter -production secrets without explicit direction. diff --git a/AGENTS.md b/AGENTS.md index e3eb0ce..0b171eb 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -6,7 +6,7 @@ project knowledge here rather than in tool-specific configuration. ## Agent compatibility - Codex loads this `AGENTS.md` directly. -- Canonical project skills live in [`.agents/skills/`](.agents/skills/). +- Keep repository-specific guidance here; personal skills are installed globally. - Quality enforcement is agent-independent: use the Git hooks, `npm run validate`, and CI. Do not add tool-specific lifecycle hooks for checks that belong in those shared gates. @@ -159,9 +159,20 @@ finishes with health and contract checks. Repository reads/writes, `npm run *`, local Wrangler commands, and Vitest are otherwise safe without confirmation. -## Skills - -- `ship-pr` — use the shared skill for the canonical push -> PR -> CI -> review - -> triage -> squash-merge -> cleanup flow. Never use `--auto`; merge directly - when the PR is clean, and escalate only decisions that need product or team - input. +## PR review and delivery + +The personal `ship-pr` skill is installed globally; do not keep a duplicate +repository-local entry. These project rules also apply without that skill: + +- Use `.github/required-checks.txt` alongside live branch protection to identify + required checks. Harness drift sensors are informational unless policy changes. +- Review D1 access boundaries and parameter binding, API alignment with + `openboot-contract`, forward-only D1 migrations, and field round trips through + CLI -> server -> CLI. Check new warnings, test gaps, and generated files. +- For backwards-incompatible D1 migrations, verify locally and obtain the + rollout decision before proceeding. Review is the last reversible gate before + merging to `main` triggers deployment. +- When merging is authorized, use squash merge after CI and review pass. Do not + use auto-merge. Fix clear issues in scope; escalate product or rollout choices. +- Do not roll back a failed deployment, modify the separate `openboot-contract` + repository, or alter production secrets without explicit direction. diff --git a/docs/HARNESS.md b/docs/HARNESS.md index 129943d..553bbd5 100644 --- a/docs/HARNESS.md +++ b/docs/HARNESS.md @@ -51,7 +51,7 @@ Three regulation categories: | Behav. | Post-deploy health check (`/api/health`) | CD `deploy` job | `.github/workflows/deploy.yml` | | Behav. | Post-deploy smoke test + contract round-trip | CD `deploy` job | `scripts/smoke-test-api.sh` | | Feedfwd. | Shared agent conventions | Codex loads directly | `AGENTS.md` (canonical) | -| Feedfwd. | `ship-pr` skill — push → CI → review → triage → squash → cleanup; **no `--auto`** | model-loaded | `.agents/skills/ship-pr/SKILL.md` | +| Feedfwd. | PR review and delivery rules; personal global `ship-pr` can orchestrate the flow | PR delivery | `AGENTS.md` "PR review and delivery" | | Maint. | `eslint` on staged diff + `prettier --check` | local git pre-commit | `scripts/hooks/pre-commit` | | Behav. | `npm run validate` (lint + check + test + build) | local git pre-push | `scripts/hooks/pre-push` | | Drift loop | Failed harness sensor → open/update GitHub issue | on main / nightly | `.github/workflows/drift-to-issue.yml` | @@ -70,7 +70,7 @@ When you observe a recurring issue, decide where to encode the fix: | "Agent breaks behaviour that has no test." | Write the test next to existing ones (`src/**/*.test.ts`). The pattern is vitest + happy-dom + the helpers in `src/lib/test/`. | | "Agent missed an `AGENTS.md` rule we keep restating." | Make it a lint rule or an archtest test. A docs rule that doesn't fail is a docs rule that drifts. | | "Agent guessed at an API contract." | Update `openboot-contract` fixtures + schemas. CI runs schema validation against them in the `check` job and after deploy. | -| "Agent's PR description was off." | Tighten `.github/pull_request_template.md` (if added) or the `ship-pr` skill. | +| "Agent's PR description was off." | Tighten `.github/pull_request_template.md` (if added) or the PR delivery rules in `AGENTS.md`. | | "Drift sensor failed on main but nobody noticed." | Already handled: `.github/workflows/drift-to-issue.yml` opens/updates a tracking issue per failed sensor. | Rule of thumb: **if you reach for a doc edit, first ask whether a test or