Agent Friendly Action — score every PR
A GitHub Action that comments the agent-friendliness delta on every pull request — “this PR drops your Claude Code score by 4.1 points because it removed CI config”. Runs entirely inside your CI, no third-party server, opt-in via a single secret.
Catch score regressions on every PR
Drop the workflow below into your repo and the action will post (or edit) a single comment on each PR with the score delta and the per-signal changes — runs entirely inside your CI, no third-party server in the loop.
# .github/workflows/agent-friendly.yml
name: Agent-friendly score diff
on:
pull_request:
branches: [main]
permissions:
contents: read
pull-requests: write
jobs:
score-diff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: hsnice16/agent-friendly-action@v0
with:
agents-badge-token: ${{ secrets.AGENTS_BADGE_TOKEN }}Set AGENTS_BADGE_TOKENin the repo's secrets to enable the comment; leave it unset and the action exits silently.
Set the AGENTS_BADGE_TOKEN secret
The action only fires when AGENTS_BADGE_TOKEN is present — it's an opt-in marker, not a credential. Add it once and forget it:
- In your repo, open Settings → Secrets and variables → Actions.
- Click New repository secret.
- Name:
AGENTS_BADGE_TOKEN. Value: any non-empty string —enabledworks. The string itself isn't checked. - Click Add secret. The action fires on the next PR.
Authoritative reference: docs.github.com — encrypted secrets .
How it works
actions/checkoutwithfetch-depth: 0gives the action the PR head and access to base history.- The action fetches the base ref locally and checks it out into a worktree — no network clone.
- Scores both trees with the bundled scorer and computes the overall + per-signal + per-model delta.
- Posts (or edits) a single PR comment marked with
<!-- agent-friendly-action -->.
Self-contained by design
The scorer and weights are bundled into dist/ via @vercel/ncc. If Agent Friendly Code goes offline tomorrow, the action keeps producing PR comments unchanged. Runtime weight refresh from a future /api/weights endpoint is deferred to v1.0.0 once benchmark-derived weights ship — until then both the head and the base are scored with the same bundled weights, so any drift cancels in the diff.
FAQ
- What does the action do on a PR?
It runs inside your CI (no third-party server in the loop), checks out the PR head and the base ref, scores both trees with the bundled scorer, and posts a single PR comment with the overall delta plus per-signal changes. On the next push it edits that same comment instead of creating a new one.
- Why is AGENTS_BADGE_TOKEN required?
It's an opt-in marker, not an API credential. Set it (any non-empty string) to enable the comment; leave it unset and the action exits silently. This lets template / starter repos ship the workflow without it firing for forks or unenrolled installs.
- Does it talk to your web app?
No. The scorer and weights are bundled into the action's dist via @vercel/ncc. If this dashboard goes offline, the action keeps producing PR comments unchanged. A future version will optionally fetch fresh weights from /api/weights once benchmark-derived weights ship (1.0.0).
- Does it work on private repos?
Yes — it runs in your CI under your existing GITHUB_TOKEN. The action never sends repo contents anywhere; the scoring is local to the runner.
- Where is the source?
github.com/hsnice16/agent-friendly-action. MIT-licensed, semver-tagged. Pin @v0 to track the latest 0.x release; pin @v0.1.0 to opt out of automatic minor / patch updates.
Source
github.com/hsnice16/agent-friendly-action — MIT-licensed, semver-tagged. Listed on the GitHub Marketplace under Code Quality / Continuous Integration.