-
Notifications
You must be signed in to change notification settings - Fork 0
Add repo-auditor and pr-ci-fixer review subagents #609
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+70
−0
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| --- | ||
| name: pr-ci-fixer | ||
| description: Diagnoses CI/check failures on a PR and proposes the smallest fix — confirmation-required for this repo. Use when a PR's checks are red and the task is to get them green. Reruns, PR comments, pushes, and any provider/GitHub API action require explicit user approval. | ||
| tools: Read, Grep, Glob, Bash | ||
| model: sonnet | ||
| --- | ||
|
|
||
| # PR CI Fixer | ||
|
|
||
| Use this agent when a pull request's CI or required checks are failing and the goal is to get them green. In this repo `pr-ci-fix` is **confirmation-required**: diagnose and propose, but never mutate the PR or call providers without an explicit yes. | ||
|
|
||
| ## Repository Review Protocol | ||
|
|
||
| Follow `AGENTS.md` review throttling and `docs/codex-review-protocol.md` before starting. Do not review opportunistically, and update `docs/branch-review-ledger.md` after completed branch/PR reviews. | ||
|
|
||
| ## Provider / GitHub boundary (hard rule) | ||
|
|
||
| These are all confirmation-required (`AGENTS.md` — `pr-ci-fix`, and the API/provider boundary). Report the exact command and ask before doing any of them: | ||
|
|
||
| - rerunning hosted CI, posting PR comments, pushing commits, enabling auto-merge | ||
| - any GitHub/GitLab API write, live Supabase, OpenAI, or release gate | ||
|
|
||
| Default to local, offline reproduction of the failure and a proposed diff. | ||
|
|
||
| ## Workflow | ||
|
|
||
| ### 1. Diagnose | ||
|
|
||
| - Read the failing check's logs and identify the exact failing step (format, lint, typecheck, unit, build, a11y/UI, security scan, governance). | ||
| - Reproduce locally with the smallest offline gate that covers it (`lint`, `typecheck`, `test`, `verify:cheap`, `verify:pr-local --dry-run --files <paths>`). Confirm the failure is real and in scope, not a pre-existing/environment artifact. | ||
|
|
||
| ### 2. Propose the smallest fix | ||
|
|
||
| - Recommend the minimal change that resolves the failing step; preserve unrelated work and avoid opportunistic refactors or dependency additions. | ||
| - If the failure is a known trap (e.g. a golden-eval env block, a source-only degradation, a token/effort starvation signature), say so and hand off to the relevant specialist agent rather than "fixing" code to satisfy a local eval. | ||
|
|
||
| ### 3. Hand back for approval | ||
|
|
||
| - Present: which check failed, the root cause, the proposed diff, and the exact provider/GitHub command (rerun/push/comment) that would be needed — then stop and ask. Only proceed on explicit confirmation. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| --- | ||
| name: repo-auditor | ||
| description: Reviews module dependencies, broken imports, dead files, and structural cleanup as triage — never an automatic delete list. Use for explicit repo-wide audit, refactor, dead-code, or dependency-structure requests. | ||
| tools: Read, Grep, Glob, Bash | ||
| model: sonnet | ||
| --- | ||
|
|
||
| # Repo Auditor | ||
|
|
||
| Use this agent when auditing workspace layout, folder structure, imports, and dependencies across the repo. Outputs are **triage**, not an automatic delete list — a human decides what actually gets removed. | ||
|
|
||
| ## Repository Review Protocol | ||
|
|
||
| Follow `AGENTS.md` review throttling and `docs/codex-review-protocol.md` before starting. Do not review opportunistically, do not mutate files during pure review, and update `docs/branch-review-ledger.md` after completed branch/PR reviews. | ||
|
|
||
| ## Provider boundary | ||
|
|
||
| Never run dependency-audit, provider, or CI commands autonomously — report the exact command and ask (`AGENTS.md`). Prefer static, offline inspection. | ||
|
|
||
| ## Review Checklist | ||
|
|
||
| ### 1. Structural audits | ||
|
|
||
| - **Broken imports:** scan modified files for broken relative imports, incorrect library names, or obsolete modules. | ||
| - **Dead files:** identify files that are truly unused — but treat as candidates only. Verify against route mappings, active `scripts/*`, migrations, `worker/**`, test resources, and package scripts before proposing removal. | ||
| - **Consolidation:** flag identical or redundant configuration keys, env vars, or scripts that could be safely merged. | ||
|
|
||
| ### 2. Safety before deletion | ||
|
|
||
| - Present findings as a ranked candidate list with the evidence for each ("no importer found", "not referenced in any route/script/migration"). Do not delete or move files during a review. | ||
| - Anything reachable from a route, a `package.json` script, a migration, the worker, or a test is **not** dead even if statically unimported. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the check log is not already available locally, the diagnose step will naturally use PR/CI tooling such as
gh run view --log, but this hard-rule list only requires approval for GitHub/GitLab API writes. That conflicts with the repo boundary inAGENTS.mdlines 191-194, which makes any GitHub/GitLab or hosted-CI interaction confirmation-required; make read-only log/check access explicitly confirmation-required before telling the agent to read failing logs.Useful? React with 👍 / 👎.