Skip to content

Commit 4207693

Browse files
committed
Merge branch 'develop' of github.com:sccn/eeglab into develop
2 parents f64cc25 + 329056e commit 4207693

12 files changed

Lines changed: 1155 additions & 400 deletions

File tree

.agents/skills/fix-issue/SKILL.md

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
---
2+
name: fix-issue
3+
description: End-to-end workflow for fixing a GitHub issue in sccn/eeglab. Use when asked to fix, investigate, or resolve a GitHub issue.
4+
---
5+
6+
# Skill: Fix GitHub Issue
7+
8+
You are to fix the GitHub issue indicated by the user.
9+
10+
Read first:
11+
12+
@AGENTS.md
13+
14+
## Writing Style For GitHub Comments
15+
16+
Be terse. Every sentence must add information.
17+
18+
- No preamble, filler, or generic investigation language.
19+
- Do not repeat the issue body.
20+
- Link or name relevant files instead of narrating obvious code.
21+
- Keep progress comments short and update one comment in place when running from
22+
automation.
23+
24+
## Research
25+
26+
Use `gh` to fetch the issue. Read enough source to identify the relevant
27+
function, helper chain, plugin, or GUI path.
28+
29+
Before coding, run a duplicate-work preflight:
30+
31+
```bash
32+
gh pr list --state open --search "<issue-id or keyword>"
33+
gh issue list --state open --search "<keyword>"
34+
```
35+
36+
If overlapping work exists, do not open a parallel implementation. Comment with
37+
what you found and either hand off to the existing work or scope your fix to a
38+
non-overlapping follow-up.
39+
40+
Post one comment with these sections before implementing:
41+
42+
```md
43+
# Research
44+
45+
<2-3 sentences explaining the root cause or missing behavior.>
46+
47+
**Relevant code**
48+
- `path/to/file.m#Lx-Ly` - short annotation
49+
50+
# Proposed Fix
51+
52+
<One short paragraph explaining the smallest fix and focused validation.>
53+
```
54+
55+
For larger feature or design work, do not guess. Write a concise design note in
56+
the issue instead of opening a PR immediately. Include the problem, approach,
57+
affected files, tests, tradeoffs, and open questions.
58+
59+
## Implementation
60+
61+
- Create a branch named `agent/{YYYYMMDD}-fix-{issue-id}`.
62+
- Reproduce the issue with a focused MATLAB or Octave command when possible.
63+
- Add a regression test or reproducibility command when practical. EEGLAB has no
64+
single central test suite, so prefer a minimal scriptable command using
65+
`sample_data/` or plugin-local tests.
66+
- Make the smallest local MATLAB change.
67+
- Preserve `pop_*` GUI, command-line, and history behavior.
68+
- Keep EEG structure fields consistent and validate with `eeg_checkset`.
69+
70+
## Testing
71+
72+
Use the narrowest relevant validation first:
73+
74+
```bash
75+
matlab -batch "cd('/path/to/eeglab'); eeglab('nogui'); <focused commands>"
76+
```
77+
78+
```bash
79+
octave --quiet --eval "cd('/path/to/eeglab'); eeglab('nogui'); <focused commands>"
80+
```
81+
82+
Run plugin tests when relevant, for example:
83+
84+
```bash
85+
matlab -batch "cd('/path/to/eeglab/plugins/ICLabel'); run_tests"
86+
```
87+
88+
Do not weaken assertions or change expected numerical behavior without proving
89+
the old expectation was wrong.
90+
91+
## Uploading
92+
93+
When validation is complete, open a PR following
94+
`.agents/skills/pull-request/SKILL.md` exactly. Attach it to the issue with a
95+
short comment summarizing the fix and the validation command.
96+
97+
## Verify CI Status
98+
99+
After opening the PR, monitor checks:
100+
101+
```bash
102+
gh pr view <number> --json statusCheckRollup
103+
```
104+
105+
Fix actionable failures before considering the task complete.
106+
107+
## Tasks
108+
109+
- [ ] Fetch issue information.
110+
- [ ] Research relevant EEGLAB source and helper chain.
111+
- [ ] Run duplicate-work preflight.
112+
- [ ] Post Research and Proposed Fix.
113+
- [ ] Create issue branch.
114+
- [ ] Reproduce or define a focused validation command.
115+
- [ ] Implement the smallest fix.
116+
- [ ] Run MATLAB or Octave validation, plus plugin tests if relevant.
117+
- [ ] Push branch.
118+
- [ ] Open PR using the pull-request skill.
119+
- [ ] Monitor CI and address failures.
120+
121+
## Rules
122+
123+
Never credit yourself or AI tools in commits, comments, or PR descriptions.
Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
---
2+
name: github-pr-review
3+
description: Review a pull request for correctness, MATLAB/Octave behavior, EEGLAB data-structure consistency, GUI/history regressions, and repository convention compliance in sccn/eeglab.
4+
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:*), Bash(gh pr review:*), Bash(git rev-parse:*), mcp__github_inline_comment__create_inline_comment
5+
---
6+
7+
Provide a code review for the given pull request.
8+
9+
You are reviewing EEGLAB, a MATLAB-native toolbox for EEG and related
10+
electrophysiological signal processing.
11+
12+
Read first:
13+
14+
@AGENTS.md
15+
16+
## Review Goals
17+
18+
Prioritize:
19+
20+
1. Correctness bugs and behavioral regressions in changed MATLAB code.
21+
2. EEG structure consistency, including dimensions, events, epochs, channel
22+
locations, ICA fields, STUDY fields, and save/history fields.
23+
3. GUI and command-line parity for `pop_*` functions.
24+
4. MATLAB and Octave compatibility where the changed code claims or implies it.
25+
5. Focused tests or reproducibility commands for changed behavior.
26+
6. Simple code that follows existing EEGLAB conventions.
27+
28+
## High-Signal Threshold
29+
30+
Flag only issues that are specific, actionable, and tied to changed code.
31+
32+
Flag:
33+
34+
- Code that will fail to parse or run in a common MATLAB or Octave path.
35+
- Incorrect dimensions, indexing, event latencies, channel metadata, ICA fields,
36+
or STUDY state after the changed operation.
37+
- A broken `pop_*` command-line path, GUI path, or returned command string.
38+
- Missing validation for a realistic regression introduced by the change.
39+
- Unsafe file, path, download, or plugin handling in changed code.
40+
- Clear violations of `AGENTS.md` or scoped directory instructions.
41+
42+
Do not flag:
43+
44+
- Pre-existing issues outside the PR.
45+
- Generic style preferences.
46+
- Broad refactors unrelated to the diff.
47+
- Hypothetical edge cases without a realistic EEGLAB path.
48+
- Issues a normal linter or MATLAB parser would report unless they change
49+
behavior or block execution.
50+
51+
## Review Workflow
52+
53+
1. Check whether the PR is closed or draft. If so, stop unless the user
54+
explicitly requested review anyway.
55+
2. Read the PR title, body, changed files, and diff:
56+
57+
```bash
58+
gh pr view <PR> --json title,body,files,state,isDraft,author
59+
gh pr diff <PR>
60+
```
61+
62+
3. Find relevant instructions:
63+
64+
```bash
65+
find .. -name AGENTS.md -o -name CLAUDE.md
66+
```
67+
68+
Apply only instructions in the changed file's directory or parents.
69+
70+
4. Review changed files against the EEGLAB rules in `AGENTS.md`.
71+
5. Validate candidate findings by reading the surrounding source, not just the
72+
diff.
73+
6. Produce a concise terminal summary. If `--comment` was not provided, stop.
74+
7. If `--comment` was provided, post or update a single PR comment.
75+
76+
## Review Comment Format
77+
78+
Use this format:
79+
80+
```md
81+
## Code review
82+
83+
- Overall assessment: <safe to merge / needs changes / needs more context>
84+
- Highest-risk area: <area>
85+
- Merge recommendation: <safe to merge / needs changes / needs more context>
86+
87+
## Blocking
88+
89+
<findings or None.>
90+
91+
## Important
92+
93+
<findings or None.>
94+
95+
## Nits
96+
97+
<findings or None.>
98+
99+
## Test gaps
100+
101+
<findings or None.>
102+
103+
## EEGLAB notes
104+
105+
<findings or None.>
106+
```
107+
108+
Rules:
109+
110+
- If a section has no findings, write `None.`
111+
- Each finding must include severity, file/function reference, why it matters,
112+
and a concrete suggested fix.
113+
- Keep the review concise.
114+
- Do not include generic praise.
115+
- If no issues were found, say:
116+
117+
```md
118+
## Code review
119+
120+
- Overall assessment: Looks good.
121+
- Highest-risk area: None identified.
122+
- Merge recommendation: Safe to merge.
123+
124+
## Blocking
125+
126+
None.
127+
128+
## Important
129+
130+
None.
131+
132+
## Nits
133+
134+
None.
135+
136+
## Test gaps
137+
138+
None.
139+
140+
## EEGLAB notes
141+
142+
None.
143+
144+
Checked for correctness bugs, MATLAB/Octave behavior, EEG structure consistency, GUI/history regressions, changed-behavior tests, and AGENTS.md compliance.
145+
```
146+
147+
Post or update the review comment with:
148+
149+
```bash
150+
gh pr comment "$PR_NUMBER" --edit-last --create-if-none --body-file <file>
151+
```
152+
153+
## Inline Comments
154+
155+
Use inline comments only for validated issues that are best attached to a
156+
specific changed line. Do not duplicate summary findings inline.
157+
158+
Inline comments must:
159+
160+
- State severity.
161+
- Explain the concrete bug or risk.
162+
- Suggest a fix.
163+
- Include a committable suggestion only when the suggestion fully fixes the
164+
issue and is small.
165+
166+
Never credit yourself or AI tools in review comments.
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
---
2+
name: pull-request
3+
description: Authoring pull requests for sccn/eeglab. Use when creating or updating a PR, and whenever changing a branch that is already associated with a PR.
4+
---
5+
6+
# Skill: Author a Pull Request
7+
8+
This skill defines the PR format and pre-push expectations for EEGLAB work.
9+
Follow it when creating or updating a PR.
10+
11+
Read first:
12+
13+
@AGENTS.md
14+
15+
## PR Description Format
16+
17+
The PR description should be plain text and short.
18+
19+
Title: Short imperative sentence. Optional scope tag in brackets.
20+
21+
Body: 1-3 sentences stating what changed and why. End with an issue link if one
22+
exists.
23+
24+
Hard rules:
25+
26+
- No markdown headers, tables, images, or checkboxes.
27+
- No `## Summary`, `## Test plan`, or section labels.
28+
- No filler phrases such as "This PR" or "Summary of changes".
29+
- No emoji.
30+
- Under about 80 words total.
31+
- Never credit yourself or AI tools.
32+
33+
Example:
34+
35+
```text
36+
Title: [EEG] Fix event latency update after selection
37+
38+
Body:
39+
Keep event latencies consistent when selecting a trailing continuous-data
40+
window. Adds a sample-data regression command covering first and last event
41+
latencies.
42+
43+
Fixes #1234
44+
```
45+
46+
## Issue Linking
47+
48+
Use `Fixes #NNNN` only when the change resolves a pre-existing issue. Use
49+
`Part of #NNNN` for partial work. Omit issue links for user-directed work with
50+
no issue.
51+
52+
## Pre-Push Checklist
53+
54+
Run the narrowest meaningful validation before pushing:
55+
56+
- Core smoke:
57+
58+
```bash
59+
matlab -batch "cd('/path/to/eeglab'); eeglab('nogui'); EEG = pop_loadset('filename', 'eeglab_data.set', 'filepath', 'sample_data/'); EEG = eeg_checkset(EEG);"
60+
```
61+
62+
- Octave smoke when MATLAB is unavailable:
63+
64+
```bash
65+
octave --quiet --eval "cd('/path/to/eeglab'); eeglab('nogui'); EEG = pop_loadset('filename', 'eeglab_data.set', 'filepath', 'sample_data/'); EEG = eeg_checkset(EEG);"
66+
```
67+
68+
- Focused test or command for the function, plugin, import path, GUI path, or
69+
STUDY path that changed.
70+
71+
If validation cannot run because MATLAB, Octave, a display, a license, or test
72+
data are unavailable, say that clearly in the PR body or final status.
73+
74+
## Creating The PR
75+
76+
Unless the user says otherwise, push directly to a branch on `sccn/eeglab` when
77+
permissions allow. Do not push to a fork unless direct push is unavailable or
78+
requested.
79+
80+
Use:
81+
82+
```bash
83+
gh pr create \
84+
--title "<title>" \
85+
--body "<plain text body>"
86+
```
87+
88+
Add the `agent-generated` label only when repository automation creates the PR.
89+
Do not add it when a human asks an interactive agent to open or update a PR.
90+
91+
## See Also
92+
93+
- `.agents/skills/fix-issue/`
94+
- `.agents/skills/github-pr-review/`
95+
- `AGENTS.md`

.claude/skills

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../.agents/skills

0 commit comments

Comments
 (0)