Skip to content

Commit 3a31eea

Browse files
authored
Merge pull request #107 from AdjectiveAllison/claude_md_updates
new CLAUDE.md, gin server docs, and claude code in CI!
2 parents 93137c7 + f802c05 commit 3a31eea

File tree

5 files changed

+346
-440
lines changed

5 files changed

+346
-440
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Claude Code Review
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize] # Runs on new PRs and updates
6+
7+
jobs:
8+
code-review:
9+
runs-on: ubuntu-latest
10+
steps:
11+
# Check out the code to allow git diff operations
12+
- name: Checkout code
13+
uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0 # Fetch full history for accurate diffs
16+
17+
- name: Run Code Review with Claude
18+
id: code-review
19+
uses: anthropics/claude-code-action@beta
20+
with:
21+
# Define the review focus areas
22+
prompt: "Review the PR changes. Focus on code quality, potential bugs, and performance issues. Suggest improvements where appropriate. Pay special attention to Kubernetes operator patterns and Go best practices according to the CLAUDE.md file."
23+
24+
# Limited tools for safer review operations
25+
allowed_tools: [
26+
# Git inspection commands (read-only)
27+
"Bash(git status)",
28+
"Bash(git log)",
29+
"Bash(git diff --name-only HEAD~1)",
30+
"Bash(git diff HEAD~1)",
31+
"Bash(git show)",
32+
"Bash(git blame)",
33+
34+
# File exploration tools
35+
"View", # Read file contents
36+
"GlobTool", # Find files by pattern
37+
"GrepTool", # Search file contents
38+
"BatchTool" # Run multiple tools in parallel
39+
]
40+
41+
# Timeout after 15 minutes
42+
timeout_minutes: 15
43+
44+
# Your Anthropic API key (stored as a GitHub secret)
45+
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Claude Comment Response
2+
on:
3+
issue_comment:
4+
types: [created] # Triggers when someone comments on an issue or PR
5+
6+
jobs:
7+
respond-to-claude-mention:
8+
# Only run if the comment mentions @claude
9+
if: contains(github.event.comment.body, '@claude')
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: anthropics/claude-code-action@beta
13+
with:
14+
# Pass the comment text as the prompt
15+
prompt: "${{ github.event.comment.body }}"
16+
17+
# Define which tools Claude can use
18+
allowed_tools: [
19+
# Git inspection commands (read-only)
20+
"Bash(git status)",
21+
"Bash(git log)",
22+
"Bash(git show)",
23+
"Bash(git blame)",
24+
"Bash(git ls-files)",
25+
"Bash(git branch)",
26+
"Bash(git tag)",
27+
"Bash(git diff)",
28+
29+
# File modifications
30+
"Bash(git add)",
31+
"Bash(git commit)",
32+
33+
# File exploration tools
34+
"View", # Read file contents
35+
"Edit", # Edit files
36+
"GlobTool", # Find files by pattern
37+
"GrepTool", # Search file contents
38+
"BatchTool" # Run multiple tools in parallel
39+
]
40+
41+
# Maximum number of conversation turns
42+
max_turns: 10
43+
44+
# Timeout after 20 minutes
45+
timeout_minutes: 20
46+
47+
# Your Anthropic API key (stored as a GitHub secret)
48+
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Claude PR Creation
2+
3+
on:
4+
issue_comment:
5+
types: [created] # Triggers when someone comments on an issue
6+
7+
jobs:
8+
create-pr:
9+
# Only run if the comment mentions @claude create pr or similar
10+
if: >
11+
contains(github.event.comment.body, '@claude create pr') ||
12+
contains(github.event.comment.body, '@claude create a pr') ||
13+
contains(github.event.comment.body, '@claude implement') ||
14+
contains(github.event.comment.body, '@claude fix')
15+
runs-on: ubuntu-latest
16+
permissions:
17+
contents: write
18+
pull-requests: write
19+
issues: write
20+
steps:
21+
- uses: anthropics/claude-code-action@beta
22+
with:
23+
# Pass the comment text as the prompt
24+
prompt: "${{ github.event.comment.body }}"
25+
26+
# Define which tools Claude can use
27+
allowed_tools: [
28+
# Git inspection commands
29+
"Bash(git status)",
30+
"Bash(git log)",
31+
"Bash(git show)",
32+
"Bash(git blame)",
33+
"Bash(git reflog)",
34+
"Bash(git stash list)",
35+
"Bash(git ls-files)",
36+
"Bash(git branch)",
37+
"Bash(git tag)",
38+
"Bash(git diff)",
39+
40+
# Git modification commands
41+
"Bash(git checkout -b)",
42+
"Bash(git add)",
43+
"Bash(git commit)",
44+
"Bash(git push)",
45+
46+
# GitHub CLI commands for PR creation
47+
"Bash(gh pr create)",
48+
49+
# File exploration and modification tools
50+
"View", # Read file contents
51+
"Edit", # Edit files
52+
"GlobTool", # Find files by pattern
53+
"GrepTool", # Search file contents
54+
"BatchTool" # Run multiple tools in parallel
55+
]
56+
57+
# Maximum number of conversation turns
58+
max_turns: 20
59+
60+
# Timeout after 30 minutes for potentially complex implementations
61+
timeout_minutes: 30
62+
63+
# Your Anthropic API key (stored as a GitHub secret)
64+
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}

0 commit comments

Comments
 (0)