Repository navigation
182 lines (167 loc) · 7.65 KB
/
Copy pathclaude.yml
File metadata and controls
182 lines (167 loc) · 7.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
name: Claude Code
on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
issues:
types: [opened, assigned]
pull_request_review:
types: [submitted]
jobs:
claude:
if: |
(github.event_name == 'issue_comment' &&
(github.event.comment.author_association == 'OWNER' ||
github.event.comment.author_association == 'MEMBER' ||
github.event.comment.author_association == 'COLLABORATOR') &&
contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review_comment' &&
(github.event.comment.author_association == 'OWNER' ||
github.event.comment.author_association == 'MEMBER' ||
github.event.comment.author_association == 'COLLABORATOR') &&
contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review' &&
(github.event.review.author_association == 'OWNER' ||
github.event.review.author_association == 'MEMBER' ||
github.event.review.author_association == 'COLLABORATOR') &&
contains(github.event.review.body, '@claude')) ||
(github.event_name == 'issues' &&
(github.event.issue.author_association == 'OWNER' ||
github.event.issue.author_association == 'MEMBER' ||
github.event.issue.author_association == 'COLLABORATOR') &&
(contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
timeout-minutes: 45
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
issues: write
id-token: write
actions: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- name: Install Octave
run: |
sudo apt-get update
sudo apt-get install -y octave
- name: Run Claude Code
uses: anthropics/claude-code-action@v1
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN || secrets.CLAUDE_MAX_OAUTH_TOKEN }}
allowed_bots: 'claude[bot]'
additional_permissions: |
actions: read
claude_args: |
--model claude-opus-4-7
--max-turns 250
--allowedTools "Bash(git:*),Bash(gh:*),Bash(matlab:*),Bash(octave:*),Bash(find:*),Bash(rg:*),Bash(sed:*),Bash(ls:*),Bash(pwd:*),Bash(cat:*)"
--system-prompt "Always read and follow AGENTS.md before starting work. Keep changes small, MATLAB-native, and consistent with existing EEGLAB helpers. You can commit and push changes. Before submitting changes, run the narrowest relevant MATLAB or Octave validation command; report exactly what passed or failed. Always commit and push changes, even if validation cannot run or fails."
triage:
if: |
github.event_name == 'issues' &&
github.event.action == 'opened' &&
(github.event.issue.author_association == 'OWNER' ||
github.event.issue.author_association == 'MEMBER' ||
github.event.issue.author_association == 'COLLABORATOR') &&
!contains(github.event.issue.body, '@claude') &&
!contains(github.event.issue.title, '@claude')
timeout-minutes: 60
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
issues: write
id-token: write
actions: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- name: Install Octave
run: |
sudo apt-get update
sudo apt-get install -y octave
- name: Triage Issue
uses: anthropics/claude-code-action@v1
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN || secrets.CLAUDE_MAX_OAUTH_TOKEN }}
allowed_bots: 'claude[bot]'
additional_permissions: |
actions: read
prompt: |
Read AGENTS.md, .agents/skills/fix-issue/SKILL.md, and .agents/skills/pull-request/SKILL.md.
Then analyze issue #${{ github.event.issue.number }}.
Before doing anything else, decide whether the issue is actionable.
An actionable issue states what is broken or requested in concrete
terms, names the affected area or workflow, and gives enough detail
to reproduce or identify the relevant source. If it is vague, post
one comment listing the exact missing details and stop.
Use a single issue comment for progress. Post it once, then use
gh issue comment --edit-last for updates.
For small, self-contained bug fixes under about 100 changed lines,
follow the fix-issue workflow and open a PR. For larger changes,
new features, design questions, GUI redesigns, plugin architecture,
or anything with unclear acceptance criteria, do not open a PR.
Instead, update the issue with root-cause analysis, relevant code
references, and a proposed approach for maintainer review.
Always produce output: a PR for a small actionable fix, or an
analysis comment explaining what is needed next.
claude_args: |
--model claude-opus-4-7
--max-turns 250
--permission-mode acceptEdits
--allowedTools "Bash(git:*),Bash(gh:*),Bash(matlab:*),Bash(octave:*),Bash(find:*),Bash(rg:*),Bash(sed:*),Bash(ls:*),Bash(pwd:*),Bash(cat:*)"
--system-prompt "You can commit and push changes. Use MATLAB or Octave validation when possible. Keep EEGLAB changes small and aligned with existing MATLAB helpers. Never post multiple progress comments; post one comment, then use --edit-last for all updates."
autofix:
if: |
github.event_name == 'pull_request_review' &&
(github.event.review.author_association == 'OWNER' ||
github.event.review.author_association == 'MEMBER' ||
github.event.review.author_association == 'COLLABORATOR') &&
contains(github.event.review.body, 'autofix') &&
!contains(github.event.review.body, '@claude')
timeout-minutes: 45
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
issues: write
id-token: write
actions: read
steps:
- name: Checkout PR branch
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
ref: ${{ github.event.pull_request.head.ref }}
- name: Install Octave
run: |
sudo apt-get update
sudo apt-get install -y octave
- name: Apply Autofix
uses: anthropics/claude-code-action@v1
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN || secrets.CLAUDE_MAX_OAUTH_TOKEN }}
allowed_bots: 'claude[bot]'
prompt: |
PR: #${{ github.event.pull_request.number }}
REVIEW: ${{ github.event.review.body }}
A maintainer requested autofix. Read AGENTS.md.
1. Fetch the full review with inline comments.
2. Apply all actionable review comments to the PR branch.
3. Keep changes small and consistent with EEGLAB MATLAB conventions.
4. Run relevant MATLAB or Octave validation.
5. Commit and push changes to the PR branch.
6. Post a comment summarizing what changed and what validation ran, prefixed with "Autofix:".
claude_args: |
--model claude-opus-4-7
--max-turns 150
--allowedTools "Bash(git:*),Bash(gh:*),Bash(matlab:*),Bash(octave:*),Bash(find:*),Bash(rg:*),Bash(sed:*),Bash(ls:*),Bash(pwd:*),Bash(cat:*)"