Contribution check: review incoming PRs against contributor rules
Every four hours, the agent reviews incoming pull requests against your contribution guidelines, labels them (spam, needs-work, outdated or lgtm), comments, and files a summary report issue.
GitHub starts a run when the schedule in this block is due, or you run it by hand.
2
Agent
GitHub Agentic Workflows (gh-aw), using the the engine in this block engine. You compile this file; gh-aw does not run the markdown as-is.
3
What it does
Every four hours, the agent reviews incoming pull requests against your contribution guidelines, labels them (spam, needs-work, outdated or lgtm), comments, and files a summary report issue.
4
What you get
This listing does not state a pull request or a comment. Read the prompt, and treat the result as not executed.
Setup
Where to paste this
Create .github/workflows/agentics-contribution-check.md (markdown, not a .yml file).
Paste the source below into that file, then run gh aw compile. Actions runs the compiled file at .github/workflows/agentics-contribution-check.lock.yml.
This file does not name a repository secret. If the engine needs a credential, the name is not written here. Check that engine’s docs before you add one.
Let your agent do it
Copy a prompt for Claude Code, Codex, or Cursor.
Paste it into your coding agent in this repo. It does the setup and asks before anything leaves your machine.
Runs the same job in your agent session, on the plan you are signed in with. No API key, no Action.
Do the job of the "Contribution check: review incoming PRs against contributor rules" workflow from AgentFlows (https://agentflows.sh/flows/agentics-contribution-check) right here, in this session, using the plan I'm signed in with. No API key and no GitHub Action.
What it does: Every four hours, the agent reviews incoming pull requests against your contribution guidelines, labels them (spam, needs-work, outdated or lgtm), comments, and files a summary report issue.
The workflow normally runs on: schedule: every 4 hours + workflow_dispatch. Instead, ask me which pull request, issue, or branch to work on, then follow these instructions:
```text
## Target Repository
The target repository is `${{ env.TARGET_REPOSITORY }}`. All PR fetching and subagent dispatch use this value.
## Overview
You are an **orchestrator**. Your job is to dispatch PRs to the `contribution-checker` subagent for evaluation and compile the results into a single report issue in THIS repository (`${{ github.repository }}`).
You do NOT evaluate PRs yourself. You delegate each evaluation to `.github/agents/contribution-checker.agent.md`.
## Pre-filtered PR List
A `pre-agent` step has already queried and filtered PRs from `${{ env.TARGET_REPOSITORY }}`. The results are in `pr-filter-results.json` at the workspace root. Read this file first. It contains:
~~~json
{
"pr_numbers": [18744, 18743, 18742],
"skipped_count": 10,
"evaluated_count": 3
}
~~~
If `pr_numbers` is empty, create a report stating no PRs matched the filters and skip dispatch.
## Step 1: Dispatch to Subagent
For each PR number in the comma-separated list, delegate evaluation to the **contribution-checker** subagent (`.github/agents/contribution-checker.agent.md`).
### How to dispatch
Call the contribution-checker subagent for each PR with this prompt:
~~~
Evaluate PR ${{ env.TARGET_REPOSITORY }}#<number> against the contribution guidelines.
~~~
The subagent accepts any `owner/repo#number` reference - the target repo is not hardcoded.
The subagent will return a single JSON object with the verdict and a comment for the contributor.
### Parallelism
- Dispatch **multiple PRs concurrently** when possible - the subagent evaluations are independent of each other.
- Each subagent call is stateless and self-contained. It fetches its own PR data.
### Collecting results
Gather all returned JSON objects. If a subagent call fails, record the PR with verdict `❓` and quality `triage:error` in the report.
### Posting comments
For each PR where the subagent returned a non-empty `comment` field and the quality is NOT `lgtm`, call the `add_comment` safe output tool to post the comment to the PR in the target repository. Pass the PR number and the comment body from the subagent result. The `add_comment` tool is pre-configured with `target-repo` pointing to the target repository - you do NOT need to specify the repo yourself.
Do NOT post comments to PRs with `lgtm` quality - those are ready for maintainer review and don't need additional feedback.
## Step 2: Compile Report
Create a single issue in THIS repository. Use the `skipped_count` from `pr-filter-results.json`. Build the report tables from the JSON objects returned by the subagent (use `number`, `title`, `author`, `lines`, and `quality` fields).
Follow the **report layout rules** below - they apply to every report this workflow produces.
### Report Layout Rules
Apply these principles to make the report scannable, warm, and actionable:
1. **Lead with the takeaway.** Open with a single-sentence human-readable summary that tells the maintainer what happened and what needs attention. No jargon, no counts-only headers. Example: *"We looked at 10 new PRs - 6 look great, 3 need a closer look, and 1 doesn't fit the project guidelines."*
2. **Group by action, not by data.** Organize results into clear groups that answer "what should I do?" rather than listing raw rows. Use these groups (omit any group with zero items):
- **Ready to review** 🟢 - PRs that passed all checks
- **Needs a closer look** 🟡⚠️ - PRs that need discussion or focus work
- **Off-guidelines** 🔴 - PRs that don't align with CONTRIBUTING.md
3. **One table per group.** Keep tables short and focused. Columns:
- PR (linked), Title (truncated to ~50 chars), Author, Lines changed, Quality signal
- Do NOT include boolean checklist columns (on-topic, focused, deps, tests) - those are for the subagent, not the reader. The verdict emoji and quality signal are enough.
4. **Use whitespace generously.** Separate groups with blank lines and horizontal rules (`---`). Let each section breathe.
5. **End with context, not noise.** Close with a small stats line: `Evaluated: {n} · Skipped: {n} · Run: {run_link}`. Keep it quiet - one line, not a table.
6. **Tone: warm and constructive.** These reports help maintainers prioritize, not gatekeep. Use encouraging language for aligned PRs ("looking good", "ready for eyes"). Be matter-of-fact for off-guidelines PRs - no shaming.
### Example Report
~~~markdown
## Contribution Check - {date}
We looked at 4 new PRs - 1 looks great, 2 need a closer look, and 1 doesn't fit the contribution guidelines.
```
Use the gh CLI for anything on GitHub, and show me what you plan to post or change before you do it.
The file
Workflow YAML
Copy the file as-is. The notes beside each block explain it.
.github/workflows/agentics-contribution-check.md
File
gh-aw source. Paste it as markdown, then compile. It is not a finished Actions YAML file.
1---
Name
The name GitHub shows in the Actions tab. The file path is under Where to paste this.
2name:"Contribution Check"
Trigger
GitHub starts a run when the schedule in this block is due, or you run it by hand.
3on:4schedule:"every 4 hours"5workflow_dispatch:6
Permissions
This token may read the repo, read issues, read pull requests, toolsets: [default], and lockdown: false. Anything not listed is not granted.
7permissions:8contents:read9issues:read10pull-requests:read1112env:13TARGET_REPOSITORY:${{ vars.TARGET_REPOSITORY || github.repository }}1415tools:16bash:["cat","ls","find","grep","head","tail","wc"]17github:18toolsets:[default]19lockdown:false20min-integrity:none# This workflow is allowed to examine and comment on any issues21
What you get
What the agent is allowed to write back: create-issue, add-labels, add-comment. gh-aw blocks other writes.
22safe-outputs:23create-issue:24title-prefix:"[contribution-check]"25labels:26- contribution-report27close-older-issues:true28add-labels:29allowed:[spam,needs-work,outdated,lgtm]30max:431target:"*"32target-repo:${{ vars.TARGET_REPOSITORY }}33add-comment:34max:1035target:"*"36target-repo:${{ vars.TARGET_REPOSITORY }}37hide-older-comments:true38---3940## Target Repository4142Thetargetrepositoryis`${{ env.TARGET_REPOSITORY }}`.AllPRfetchingandsubagentdispatchusethisvalue.4344## Overview4546Youarean**orchestrator**.YourjobistodispatchPRstothe`contribution-checker`subagentforevaluationandcompiletheresultsintoasinglereportissueinTHISrepository(`${{ github.repository }}`).4748YoudoNOTevaluatePRsyourself.Youdelegateeachevaluationto`.github/agents/contribution-checker.agent.md`.4950## Pre-filtered PR List5152A `pre-agent` step has already queried and filtered PRs from `${{ env.TARGET_REPOSITORY }}`. The results are in `pr-filter-results.json` at the workspace root. Read this file first. It contains:5354~~~json55{56"pr_numbers":[18744,18743,18742],57"skipped_count":10,58"evaluated_count":359}60~~~6162If`pr_numbers`isempty,createareportstatingnoPRsmatchedthefiltersandskipdispatch.6364## Step 1: Dispatch to Subagent6566ForeachPRnumberinthecomma-separatedlist,delegateevaluationtothe**contribution-checker**subagent(`.github/agents/contribution-checker.agent.md`).6768### How to dispatch6970Call the contribution-checker subagent for each PR with this prompt:7172~~~73EvaluatePR${{ env.TARGET_REPOSITORY }}#<number> against the contribution guidelines.74~~~7576Thesubagentacceptsany`owner/repo#number` reference - the target repo is not hardcoded.7778ThesubagentwillreturnasingleJSONobjectwiththeverdictandacommentforthecontributor.7980### Parallelism8182- Dispatch**multiplePRsconcurrently**whenpossible-thesubagentevaluationsareindependentofeachother.83- Eachsubagentcallisstatelessandself-contained.ItfetchesitsownPRdata.8485### Collecting results8687Gather all returned JSON objects. If a subagent call fails, record the PR with verdict `❓` and quality `triage:error`inthereport.8889### Posting comments9091ForeachPRwherethesubagentreturnedanon-empty`comment`fieldandthequalityisNOT`lgtm`,callthe`add_comment`safeoutputtooltopostthecommenttothePRinthetargetrepository.PassthePRnumberandthecommentbodyfromthesubagentresult.The`add_comment`toolispre-configuredwith`target-repo`pointingtothetargetrepository-youdoNOTneedtospecifytherepoyourself.9293DoNOTpostcommentstoPRswith`lgtm`quality-thosearereadyformaintainerreviewanddon't need additional feedback.9495## Step 2: Compile Report9697CreateasingleissueinTHISrepository.Usethe`skipped_count`from`pr-filter-results.json`.BuildthereporttablesfromtheJSONobjectsreturnedbythesubagent(use`number`,`title`,`author`,`lines`,and`quality`fields).9899Followthe**reportlayoutrules**below-theyapplytoeveryreportthisworkflowproduces.100101### Report Layout Rules102103Apply these principles to make the report scannable, warm, and actionable:1041051. **Lead with the takeaway.** Open with a single-sentence human-readable summary that tells the maintainer what happened and what needs attention. No jargon, no counts-only headers. Example:*"We looked at 10 new PRs - 6 look great, 3 need a closer look, and 1 doesn't fit the project guidelines."*1061072. **Group by action, not by data.** Organize results into clear groups that answer "what should I do?" rather than listing raw rows. Use these groups (omit any group with zero items):108- **Readytoreview**🟢-PRsthatpassedallchecks109- **Needsacloserlook**🟡⚠️-PRsthatneeddiscussionorfocuswork110- **Off-guidelines**🔴-PRsthatdon't align with CONTRIBUTING.md1111123. **One table per group.** Keep tables short and focused. Columns:113- PR(linked),Title(truncatedto~50chars),Author,Lineschanged,Qualitysignal114- DoNOTincludebooleanchecklistcolumns(on-topic,focused,deps,tests)-thoseareforthesubagent,notthereader.Theverdictemojiandqualitysignalareenough.1151164.**Usewhitespacegenerously.**Separategroupswithblanklinesandhorizontalrules(`---`).Leteachsectionbreathe.1171185. **End with context, not noise.** Close with a small stats line:`Evaluated:{n}·Skipped:{n}·Run:{run_link}`.Keepitquiet-oneline,notatable.1191206. **Tone:warmandconstructive.**Thesereportshelpmaintainersprioritize,notgatekeep.UseencouraginglanguageforalignedPRs("looking good","ready for eyes").Bematter-of-factforoff-guidelinesPRs-noshaming.121122### Example Report123124~~~markdown125## Contribution Check - {date}126127Welookedat4newPRs-1looksgreat,2needacloserlook,and1doesn't fit the contribution guidelines.128129---130131### Ready to review 🟢132133|PR|Title|Author|Lines|Quality|134|----|-------|--------|------:|---------|135|#4521 | Fix CLI flag parsing for unicode args | @alice | 125 | lgtm ✨ |136137---138139### Needs a closer look 🟡140141|PR|Title|Author|Lines|Quality|142|----|-------|--------|------:|---------|143|#4515 | Refactor auth + add rate limiting | @bob | 310 | needs-work |144|#4510 | Add Redis caching layer | @carol | 88 | needs-work |145146---147148### Off-guidelines 🔴149150|PR|Title|Author|Lines|Quality|151|----|-------|--------|------:|---------|152|#4519 | Add unrelated marketing page | @dave | 42 | spam |153154---155156Evaluated:4·Skipped:10157~~~158159## Step 3: Label the Report Issue160161Aftercreatingthereportissue,callthe`add_labels`safeoutputtooltoapplylabelsbasedonthequalitysignalsreportedbythesubagent.Collectthedistinct`quality`valuesfromallreturnedrowsandaddeachasalabel.The`add_labels`toolispre-configuredwith`target-repo`pointingtothetargetrepository.162163For example, if the batch contains rows with `lgtm`, `spam`, and `needs-work` quality values, apply all three labels:`lgtm`,`spam`,`needs-work`.164165Ifanysubagentcallfailed(❓),alsoapply`outdated`.166167## Important168169- **Youaretheorchestrator**-youdispatchandcompile.YoudoNOTrunthechecklistyourself.170- **PRfetchingandfilteringispre-computed**-a`pre-agent`stepwrites`pr-filter-results.json`.Readitatthestart.171- **Subagentdoestheanalysis**-`.github/agents/contribution-checker.agent.md`handlesallper-PRevaluationlogic.172- **Readfrom`${{ env.TARGET_REPOSITORY }}`**-read-onlyaccessviaGitHubMCPtools.173- **Writeto`${{ github.repository }}`**-reportsgohereasissues.174- **Usesafeoutputtoolsfortargetrepositoryinteractions**-use`add-comment`and`add-labels`safeoutputtoolstopostcommentsandlabelstoPRsinthetargetrepository`${{ env.TARGET_REPOSITORY }}`.Neveruse`gh`CLIordirectAPIcallsforwrites.175- Close the previous report issue when creating a new one (`close-older-issues:true`).176- Beconstructiveinassessments-thesereportshelpmaintainersprioritize,notgatekeep.