diff --git a/.agents/skills/pr-comments/SKILL.md b/.agents/skills/pr-comments/SKILL.md index 55ab7d8..4417831 100644 --- a/.agents/skills/pr-comments/SKILL.md +++ b/.agents/skills/pr-comments/SKILL.md @@ -16,8 +16,10 @@ Post review findings as inline comments on specific diff lines via the GitHub Pu **Before doing anything else**, check the pr-review output: -- If the review found **zero Must Fix and zero Should Fix items**, submit an `APPROVE` review with a short body like "Clean PR — builds, tests pass, lint clean. LGTM." and **no inline comments**. Then stop. -- If only "Consider" items exist and they're truly optional, approve without inline comments. +- Before submitting any review, fetch PR status checks with `gh pr view --repo daltoniam/switchboard_plugins --json statusCheckRollup` and include a short status summary in the review body or fallback comment. +- If the review found **zero Must Fix and zero Should Fix items**, submit an `APPROVE` review with a short body like "Clean PR — CI/status checks are passing and I didn't find any blocking issues. LGTM." and **no inline comments**. Then stop. +- If GitHub rejects the approval because the token belongs to the PR author, post a regular PR comment with the same short positive summary, include the CI/status check summary, and mention that approval was blocked by GitHub's own-PR restriction. Then stop. +- If only "Consider" items exist and they're truly optional, approve without inline comments. If approval is blocked by GitHub's own-PR restriction, post a regular PR comment summarizing that the review found no blocking issues and include the CI/status check summary. - Only proceed to Step 1 if there are **concrete, actionable findings** worth commenting on. **Never post test/placeholder comments.** Every comment submitted to the PR must contain real, substantive feedback. diff --git a/.agents/skills/pr-review/SKILL.md b/.agents/skills/pr-review/SKILL.md index 40cd553..d92ba9f 100644 --- a/.agents/skills/pr-review/SKILL.md +++ b/.agents/skills/pr-review/SKILL.md @@ -49,29 +49,24 @@ git fetch origin && git checkout Note the PR size (files changed, additions, deletions) — large PRs deserve extra scrutiny. -### Step 2: Build Verification +### Step 2: CI Status Verification -Read `AGENTS.md` first, then verify the changed code builds: +CI has already run before this review workflow starts. Do not rerun `cargo build`, `cargo fmt`, `cargo clippy`, `cargo test`, or the full CI matrix during automated review. + +Use GitHub status and run metadata to verify CI instead: ```bash -cargo build --release --target wasm32-wasip1 +gh pr view --repo daltoniam/switchboard_plugins --json statusCheckRollup ``` -If the build fails, report it as a **Must Fix** item unless it is clearly unrelated to the PR and already known. Include the failing crate and linker/compiler error. - -### Step 3: Test and Format Verification - -Run the configured checks: +Report the existing CI result in the review. If CI failed or is missing, report that as a **Must Fix** item. If CI passed, proceed directly to diff review. -```bash -cargo fmt --check -cargo clippy --target wasm32-wasip1 -- -D warnings -``` +### Step 3: Test and Validation Coverage Review -If the repo contains tests for touched crates, run the relevant `cargo test` commands too. If tests are not available because the plugin only targets WASM, state that and rely on build/clippy plus code review. +Review whether the diff includes appropriate tests or validation for the changed behavior. Do not run cargo checks unless needed to validate a specific finding that cannot be assessed from the diff and existing CI status. -- If checks fail due to code issues, report each failure with the file and error output. - If there are no tests or validation for new behavior, flag it when the behavior is non-trivial. +- If a targeted command is truly necessary, keep it narrow and avoid broad workspace builds. ### Step 4: Manifest and Artifact Verification diff --git a/.ci/crush/crush.json b/.ci/crush/crush.json index 66808c2..b93b394 100644 --- a/.ci/crush/crush.json +++ b/.ci/crush/crush.json @@ -18,7 +18,7 @@ "base_url": "https://gateway.ai.cloudflare.com/v1/${CF_AIG_ACCOUNT_ID:?set CF_AIG_ACCOUNT_ID}/${CF_AIG_GATEWAY_ID:?set CF_AIG_GATEWAY_ID}/grok", "api_key": "${CF_AIG_TOKEN:?set CF_AIG_TOKEN to your Cloudflare AI Gateway token}", "extra_headers": { - "cf-aig-metadata": "{\"developer_id\": \"austin.cherry\", \"task_type\": \"ci_pr_review\", \"tool\": \"crush\", \"repo\": \"daltoniam/switchboard_plugins\"}", + "cf-aig-metadata": "{\"developer_id\": \"austin.cherry\"}", "cf-aig-collect-log-payload": "false" }, "models": [ diff --git a/.github/workflows/crush-pr-review.yml b/.github/workflows/crush-pr-review.yml index 5719388..c8f00b7 100644 --- a/.github/workflows/crush-pr-review.yml +++ b/.github/workflows/crush-pr-review.yml @@ -43,5 +43,6 @@ jobs: run: > crush run -c "${{ github.workspace }}" "Review PR #${{ github.event.pull_request.number }} in ${{ github.repository }}. + CI has already passed for this PR. Do not rerun cargo build, cargo fmt, cargo clippy, cargo test, or the full CI matrix. Inspect existing CI/status checks and focus on code review of the diff. Use the pr-review skill to do a full code review, then use the pr-comments skill to post your findings as inline comments on the PR. The repo is already checked out locally. Use gh CLI for all GitHub API interactions."