Skip to content

Commit 8e626ec

Browse files
phernandezclaude
andcommitted
feat: Enhanced Claude GitHub Actions with progress tracking and issue triage
Added three powerful automation features: **Progress Tracking:** - Visual progress indicators with checkboxes during Claude reviews - Shows "In progress" status updates in real-time - Maintains full GitHub context while working - Added to both code review and @claude mention workflows **Structured PR Review Checklist:** - Basic Memory-specific review criteria - Code quality standards (Python 3.12+, SQLAlchemy 2.0, FastAPI) - Architecture compliance (MCP tools, local-first, knowledge graph) - Security and performance checks - Systematic checklist format with actionable feedback **Automated Issue Triage:** - Classifies issue type (bug, feature, enhancement, docs, question) - Assesses priority (critical, high, medium, low) - Identifies component (CLI, MCP, database, cloud, docs) - Estimates complexity (simple, medium, complex) - Auto-applies appropriate labels and checks for duplicates - Provides helpful guidance for new contributors Enhanced Security: - Fork PR support with pull_request_target event - Organization-wide access for basicmachines-co members - Proper permission checks for all workflows 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: phernandez <paul@basicmachines.co>
1 parent 19f9b6c commit 8e626ec

3 files changed

Lines changed: 134 additions & 25 deletions

File tree

.github/workflows/claude-code-review.yml

Lines changed: 44 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@ on:
1212

1313
jobs:
1414
claude-review:
15-
# Optional: Filter by PR author
16-
# if: |
17-
# github.event.pull_request.user.login == 'external-contributor' ||
18-
# github.event.pull_request.user.login == 'new-developer' ||
19-
# github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR'
20-
15+
# Only run for organization members and collaborators
16+
if: |
17+
github.event.pull_request.author_association == 'OWNER' ||
18+
github.event.pull_request.author_association == 'MEMBER' ||
19+
github.event.pull_request.author_association == 'COLLABORATOR'
20+
2121
runs-on: ubuntu-latest
2222
permissions:
2323
contents: read
24-
pull-requests: read
24+
pull-requests: write
2525
issues: read
2626
id-token: write
2727

@@ -36,19 +36,42 @@ jobs:
3636
uses: anthropics/claude-code-action@v1
3737
with:
3838
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
39+
track_progress: true # Enable visual progress tracking
3940
prompt: |
40-
Please review this pull request and provide feedback on:
41-
- Code quality and best practices
42-
- Potential bugs or issues
43-
- Performance considerations
44-
- Security concerns
45-
- Test coverage
46-
47-
Use the repository's CLAUDE.md for guidance on style and conventions. Be constructive and helpful in your feedback.
48-
49-
Use `gh pr comment` with your Bash tool to leave your review as a comment on the PR.
50-
51-
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
52-
# or https://docs.claude.com/en/docs/claude-code/sdk#command-line for available options
53-
claude_args: '--allowed-tools "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:*)"'
41+
Review this Basic Memory PR against our team checklist:
42+
43+
## Code Quality & Standards
44+
- [ ] Follows Basic Memory's coding conventions in CLAUDE.md
45+
- [ ] Python 3.12+ type annotations and async patterns
46+
- [ ] SQLAlchemy 2.0 best practices
47+
- [ ] FastAPI and Typer conventions followed
48+
- [ ] 100-character line length limit maintained
49+
- [ ] No commented-out code blocks
50+
51+
## Testing & Documentation
52+
- [ ] Unit tests for new functions/methods
53+
- [ ] Integration tests for new MCP tools
54+
- [ ] Test coverage for edge cases
55+
- [ ] Documentation updated (README, docstrings)
56+
- [ ] CLAUDE.md updated if conventions change
57+
58+
## Basic Memory Architecture
59+
- [ ] MCP tools follow atomic, composable design
60+
- [ ] Database changes include Alembic migrations
61+
- [ ] Preserves local-first architecture principles
62+
- [ ] Knowledge graph operations maintain consistency
63+
- [ ] Markdown file handling preserves integrity
64+
- [ ] AI-human collaboration patterns followed
65+
66+
## Security & Performance
67+
- [ ] No hardcoded secrets or credentials
68+
- [ ] Input validation for MCP tools
69+
- [ ] Proper error handling and logging
70+
- [ ] Performance considerations addressed
71+
- [ ] No sensitive data in logs or commits
72+
73+
Read the CLAUDE.md file for detailed project context. For each checklist item, verify if it's satisfied and comment on any that need attention. Use inline comments for specific code issues and post a summary with checklist results.
74+
75+
# Allow broader tool access for thorough code review
76+
claude_args: '--allowed-tools "Bash(gh pr:*),Bash(gh issue:*),Bash(gh api:*),Bash(git log:*),Bash(git show:*),Read,Grep,Glob"'
5477

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Claude Issue Triage
2+
3+
on:
4+
issues:
5+
types: [opened]
6+
7+
jobs:
8+
triage:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
issues: write
12+
id-token: write
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 1
18+
19+
- name: Run Claude Issue Triage
20+
uses: anthropics/claude-code-action@v1
21+
with:
22+
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
23+
track_progress: true # Show triage progress
24+
prompt: |
25+
Analyze this new Basic Memory issue and perform triage:
26+
27+
**Issue Analysis:**
28+
1. **Type Classification:**
29+
- Bug report (code defect)
30+
- Feature request (new functionality)
31+
- Enhancement (improvement to existing feature)
32+
- Documentation (docs improvement)
33+
- Question/Support (user help)
34+
- MCP tool issue (specific to MCP functionality)
35+
36+
2. **Priority Assessment:**
37+
- Critical: Security issues, data loss, complete breakage
38+
- High: Major functionality broken, affects many users
39+
- Medium: Minor bugs, usability issues
40+
- Low: Nice-to-have improvements, cosmetic issues
41+
42+
3. **Component Classification:**
43+
- CLI commands
44+
- MCP tools
45+
- Database/sync
46+
- Cloud functionality
47+
- Documentation
48+
- Testing
49+
50+
4. **Complexity Estimate:**
51+
- Simple: Quick fix, documentation update
52+
- Medium: Requires some investigation/testing
53+
- Complex: Major feature work, architectural changes
54+
55+
**Actions to Take:**
56+
1. Add appropriate labels using: `gh issue edit ${{ github.event.issue.number }} --add-label "label1,label2"`
57+
2. Check for duplicates using: `gh search issues`
58+
3. If duplicate found, comment mentioning the original issue
59+
4. For feature requests, ask clarifying questions if needed
60+
5. For bugs, request reproduction steps if missing
61+
62+
**Available Labels:**
63+
- Type: bug, enhancement, feature, documentation, question, mcp-tool
64+
- Priority: critical, high, medium, low
65+
- Component: cli, mcp, database, cloud, docs, testing
66+
- Complexity: simple, medium, complex
67+
- Status: needs-reproduction, needs-clarification, duplicate
68+
69+
Read the issue carefully and provide helpful triage with appropriate labels.
70+
71+
claude_args: '--allowed-tools "Bash(gh issue:*),Bash(gh search:*),Read"'

.github/workflows/claude.yml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,26 @@ on:
99
types: [opened, assigned]
1010
pull_request_review:
1111
types: [submitted]
12+
pull_request_target:
13+
types: [opened, synchronize]
1214

1315
jobs:
1416
claude:
1517
if: |
16-
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
17-
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
18-
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
19-
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
18+
(
19+
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
20+
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
21+
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
22+
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude'))) ||
23+
(github.event_name == 'pull_request_target' && contains(github.event.pull_request.body, '@claude'))
24+
) && (
25+
github.event.sender.author_association == 'OWNER' ||
26+
github.event.sender.author_association == 'MEMBER' ||
27+
github.event.sender.author_association == 'COLLABORATOR' ||
28+
github.event.pull_request.author_association == 'OWNER' ||
29+
github.event.pull_request.author_association == 'MEMBER' ||
30+
github.event.pull_request.author_association == 'COLLABORATOR'
31+
)
2032
runs-on: ubuntu-latest
2133
permissions:
2234
contents: read
@@ -28,13 +40,16 @@ jobs:
2840
- name: Checkout repository
2941
uses: actions/checkout@v4
3042
with:
43+
# For pull_request_target, checkout the PR head to review the actual changes
44+
ref: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.sha || github.sha }}
3145
fetch-depth: 1
3246

3347
- name: Run Claude Code
3448
id: claude
3549
uses: anthropics/claude-code-action@v1
3650
with:
3751
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
52+
track_progress: true # Enable visual progress tracking
3853

3954
# This is an optional setting that allows Claude to read CI results on PRs
4055
additional_permissions: |

0 commit comments

Comments
 (0)