-
Notifications
You must be signed in to change notification settings - Fork 1
Add Claude automated code review #56
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
base: main
Are you sure you want to change the base?
Changes from all commits
d60e7be
faa9b04
b637ffe
e12cd86
98a238b
d39771c
bbf6e88
69fecb9
8bade45
2a53b22
f4a768c
04e11b2
44d66c6
8f1dfed
fa5686e
ebf43aa
fcb84e9
ef6d843
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,57 @@ | ||||||
| name: Claude Code Review | ||||||
|
|
||||||
| on: | ||||||
| pull_request: | ||||||
| types: [opened, synchronize, reopened] | ||||||
| issue_comment: | ||||||
| types: [created] | ||||||
|
|
||||||
| jobs: | ||||||
| claude-review: | ||||||
| if: > | ||||||
| (github.event_name == 'pull_request') || | ||||||
| (github.event_name == 'issue_comment' && github.event.issue.pull_request && contains(github.event.comment.body, '@claude')) | ||||||
| runs-on: ubuntu-latest | ||||||
| permissions: | ||||||
| id-token: write | ||||||
| actions: read | ||||||
| contents: read | ||||||
| pull-requests: write | ||||||
| issues: write | ||||||
| steps: | ||||||
| - uses: actions/checkout@v4 | ||||||
| with: | ||||||
| fetch-depth: 0 | ||||||
|
|
||||||
| - name: Check PR size | ||||||
| if: github.event_name == 'pull_request' | ||||||
| id: pr-size | ||||||
| run: | | ||||||
| CHANGED_LINES=$(git diff --stat origin/${{ github.event.pull_request.base.ref }}...origin/${{ github.event.pull_request.head.ref }} | tail -1 | awk '{gsub(/[^0-9]/, " "); print $1 + $2}') | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This A more robust approach using
Suggested change
|
||||||
| CHANGED_LINES=${CHANGED_LINES:-0} | ||||||
| echo "changed_lines=$CHANGED_LINES" >> "$GITHUB_OUTPUT" | ||||||
| echo "PR has $CHANGED_LINES changed lines" | ||||||
|
|
||||||
| - name: Claude Code Review | ||||||
| if: > | ||||||
| github.event_name == 'issue_comment' || | ||||||
| (github.event_name == 'pull_request' && fromJSON(steps.pr-size.outputs.changed_lines) >= 300) | ||||||
| uses: anthropics/claude-code-action@v1 | ||||||
| with: | ||||||
| anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} | ||||||
| github_token: ${{ secrets.GITHUB_TOKEN }} | ||||||
| trigger_phrase: "@claude" | ||||||
| track_progress: true | ||||||
| prompt: | | ||||||
| Review this PR focusing on: | ||||||
| 1. Accuracy - technical content is correct for the Mapbox APIs and SDKs referenced | ||||||
| 2. Skill structure - each skill has a valid frontmatter block (name, description, triggers, content) matching the schema in CONTRIBUTING.md | ||||||
| 3. Clarity - guidance is actionable and unambiguous; code examples are complete and runnable | ||||||
| 4. Consistency - tone, formatting, and depth match existing skills in the repo | ||||||
| 5. Scope - skills stay focused on their stated topic; no unnecessary overlap with other skills | ||||||
|
|
||||||
| Do NOT suggest adding more skills beyond what the PR introduces. | ||||||
| Do NOT flag minor prose style preferences as issues. | ||||||
|
|
||||||
| Provide detailed inline comments for specific issues. | ||||||
| claude_args: '--model claude-opus-4-6 --allowedTools "Bash(gh issue view:*),Bash(gh search:*),Bash(gh issue list:*),Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*),mcp__github_inline_comment__create_inline_comment,Read,Grep,Glob,Bash(git log:*),Bash(git diff:*),Bash(git show:*),Bash(git blame:*),Bash(git rev-parse:*),WebFetch(domain:github.com)"' | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: This line is 430+ characters. Consider using a YAML block scalar for readability and easier maintenance: claude_args: >-
--model claude-opus-4-6
--allowedTools
"Bash(gh issue view:*),Bash(gh search:*),..." |
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,3 +3,4 @@ node_modules | |
| build | ||
| **/build/** | ||
| .git | ||
| presentations/** | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| node_modules/ | ||
| dist/ | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| # Mapbox Agent Skills — Presentation | ||
|
|
||
| A [Slidev](https://sli.dev) presentation covering Agent Skills and the Mapbox skills library. | ||
|
|
||
| ## Running | ||
|
|
||
| ```bash | ||
| cd presentations/mapbox-skills | ||
| npm install | ||
| npm run dev | ||
| ``` | ||
|
|
||
| Then open [http://localhost:3030](http://localhost:3030). | ||
|
|
||
| ## Building | ||
|
|
||
| ```bash | ||
| npm run build # outputs to dist/ | ||
| npm run export # exports to PDF | ||
| ``` | ||
|
|
||
| ## Slides | ||
|
|
||
| 1. Title — Mapbox Agent Skills | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The slide order listed here doesn't match the actual order in |
||
| 2. What Are Agent Skills? (tools vs skills vs prompts) | ||
| 3. How Skills Work (install commands) | ||
| 4. Skill Structure (file layout + frontmatter) | ||
| 5. 18 Skills Across 6 Domains (overview) | ||
| 6. 18 Skills (cont.) — MCP, migration, security | ||
| 7. Deep Dive: Web Performance | ||
| 8. Deep Dive: iOS & Android | ||
| 9. Deep Dive: MCP Integration | ||
| 10. Skill Benchmarks (evals) | ||
| 11. Why Evals Matter (base model failures) | ||
| 12. Skills + MCP: Better Together | ||
| 13. Contributing a Skill | ||
| 14. Resources | ||
| 15. Q&A | ||
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.
The
id-token: writepermission is only needed for GitHub OIDC token exchange (GitHub App auth). Since this workflow usesANTHROPIC_API_KEYdirectly (and the commit history suggests this was intentionally removed at one point), this permission can be dropped to follow least-privilege: