Skip to content

Commit 7b9a218

Browse files
committed
claude: grant claude more capabilities to make fixes, but gated on triggering it from @natemcmaster
1 parent b9fc2d7 commit 7b9a218

5 files changed

Lines changed: 46 additions & 27 deletions

File tree

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Setup .NET
2+
description: Checkout the repository and install .NET SDK versions used by this project
3+
4+
inputs:
5+
fetch-depth:
6+
description: Number of commits to fetch (0 for full history)
7+
default: "1"
8+
9+
runs:
10+
using: composite
11+
steps:
12+
- uses: actions/checkout@v6
13+
with:
14+
fetch-depth: ${{ inputs.fetch-depth }}
15+
- name: Setup .NET
16+
uses: actions/setup-dotnet@v5
17+
with:
18+
dotnet-version: |
19+
8.x
20+
9.x
21+
10.x

.github/workflows/ci.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,7 @@ jobs:
3333
package_version: ${{ steps.build_script.outputs.package_version }}
3434

3535
steps:
36-
- uses: actions/checkout@v6
37-
- name: Setup .NET
38-
uses: actions/setup-dotnet@v5
39-
with:
40-
dotnet-version: |
41-
8.x
42-
9.x
43-
10.x
36+
- uses: ./.github/actions/setup-dotnet
4437
- name: Run build script
4538
id: build_script
4639
run: ./build.ps1 -ci

.github/workflows/claude.yml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,24 @@ jobs:
1414
claude:
1515
if: |
1616
(
17-
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
18-
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
19-
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
20-
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
17+
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude') &&
18+
(github.event.comment.author_association == 'OWNER' || github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'COLLABORATOR')) ||
19+
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude') &&
20+
(github.event.comment.author_association == 'OWNER' || github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'COLLABORATOR')) ||
21+
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude') &&
22+
(github.event.review.author_association == 'OWNER' || github.event.review.author_association == 'MEMBER' || github.event.review.author_association == 'COLLABORATOR')) ||
23+
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')) &&
24+
(github.event.issue.author_association == 'OWNER' || github.event.issue.author_association == 'MEMBER' || github.event.issue.author_association == 'COLLABORATOR'))
2125
)
2226
runs-on: ubuntu-latest
2327
permissions:
24-
contents: read
28+
contents: write
2529
pull-requests: write
2630
issues: write
2731
id-token: write
2832
actions: read # Required for Claude to read CI results on PRs
2933
steps:
30-
- name: Checkout repository
31-
uses: actions/checkout@v6
32-
with:
33-
fetch-depth: 1
34+
- uses: ./.github/actions/setup-dotnet
3435

3536
- name: Run Claude Code
3637
id: claude
@@ -45,5 +46,5 @@ jobs:
4546
# Optional: Add claude_args to customize behavior and configuration
4647
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
4748
# or https://code.claude.com/docs/en/cli-reference for available options
48-
claude_args: '--model opus --allowed-tools "Bash(gh issue view:*),Bash(gh issue comment:*),Bash(gh search:*),Bash(gh issue list:*),Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*)"'
49+
claude_args: '--model opus'
4950

.github/workflows/docs.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,7 @@ jobs:
2020
runs-on: ubuntu-latest
2121

2222
steps:
23-
- uses: actions/checkout@v6
24-
- name: Setup .NET
25-
uses: actions/setup-dotnet@v5
26-
with:
27-
dotnet-version: |
28-
8.x
29-
9.x
30-
10.x
23+
- uses: ./.github/actions/setup-dotnet
3124
- name: Run docs generation
3225
run: ./docs/generate.ps1
3326

CLAUDE.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ return app.Execute(args);
9696
- Nullable reference types enabled
9797
- Warnings treated as errors
9898
- Code style enforced in build (`EnforceCodeStyleInBuild=true`)
99-
- Format check: `dotnet tool run dotnet-format`
99+
- Run `dotnet format` to auto-fix formatting before committing
100100

101101
## Testing
102102

@@ -130,6 +130,17 @@ The build script runs the complete validation pipeline including tests, samples,
130130

131131
This approach ensures code correctness, prevents regressions, and validates that tests actually catch the issues they're meant to detect. The test suite already has good coverage and patterns to follow.
132132

133+
## Pull Requests
134+
135+
When asked to fix an issue or implement a change via GitHub, follow this workflow:
136+
137+
1. Create a branch with the `claude/` prefix (e.g., `claude/fix-null-ref`, `claude/issue-123`). Never push directly to `main`.
138+
2. Make the changes, following the TDD approach described above when applicable.
139+
3. Run `pwsh -File build.ps1` to validate the full build passes before pushing.
140+
4. Push the branch and open a PR.
141+
5. Link the PR to the relevant issue using `Fixes #N` in the PR body.
142+
6. Keep PRs focused — only change what's needed to address the issue. Don't refactor surrounding code or add unrelated improvements.
143+
133144
## Commit Guidelines
134145

135146
**IMPORTANT:** Use Conventional Commit format for all commit messages. This ensures consistency and enables automated changelog generation.

0 commit comments

Comments
 (0)