GitHub Action会在每个拉取请求上发表评论,说明它如何改变仓库的Agent Friendly Code评分。
AI 翻译
GitHub Action that comments on each pull request with how it changes the repo's Agent Friendly Code score.
取自仓库 README
正在加载完整 README。 以下为已保存的摘录。
GitHub Action that comments on each pull request with how it changes the repo's Agent Friendly Code score — "this PR drops your Claude Code score by 4.1 points because it removed CI config."
Version: v0.1.6 — per-release plans live in tasks/ (one folder per version). Pin @v0 to follow the latest 0.x release; pin a precise tag (@v0.1.6) if you want to opt out of automatic minor/patch updates. Tracking task in the parent project: tasks/0.5.0/02-score-diff-on-pr.md.查看完整 README ↗GitHub Action that checks AI agent readiness on every pull request: it comments with how the PR changes the repo's Agent Friendly Code score — "this PR drops your Claude Code score by 4.1 points because it removed CI config."
On every pull request, the action:
git worktree) with the bundled scorer.It reads files only — nothing from the PR is executed — and calls no server besides the GitHub API. The checks and per-agent weights are the same as on the website.
Walkthrough and FAQ: https://agentfriendlycode.com/action.
# .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@v7
with:
fetch-depth: 0
- uses: hsnice16/agent-friendly-action@v0
with:
agents-badge-token: ${{ secrets.AGENTS_BADGE_TOKEN }}
AGENTS_BADGE_TOKEN is an opt-in marker, not a credential: set it to any non-empty value in the repo's secrets to enable the comment. Unset, the action exits silently — which is also what happens on fork PRs, where secrets aren't passed. fetch-depth: 0 keeps the base commit local; without it the action fetches it from origin.
Use the pull_request trigger. The action also accepts pull_request_target, but that runs with a write token on fork PRs; it is safe only because the action never executes PR code, so don't add steps that do.
| Input | Required | Default | Description |
|---|---|---|---|
agents-badge-token | yes | — | Opt-in marker. The action exits silently when empty. |
github-token | no | ${{ github.token }} | Posts and edits the comment. A GitHub App installation token or a PAT also works. |
base-ref | no | the PR's base commit | A branch, tag, SHA or revision such as HEAD~1 to compare against instead. |
A template or starter repo can ship this workflow without it commenting on every copy; only repos that set the secret get the comment.
The scorer is vendored from agent-friendly-code and bundled into dist/, so the action keeps working if the website is down.
agent-friendly-code — the website and the canonical scorer.agent-friendly-skill — the same scorer in your editor; scores the local repo and recommends a model class. Install: npx skills add hsnice16/agent-friendly-skill#v0. Details: https://agentfriendlycode.com/skill.