Skip to content

Commit ce17fe3

Browse files
authored
Merge pull request #10 from itk-dev/feature/add-user-invocable-commands
feat: add user-invocable commands for workflows
2 parents 46d369b + d68793f commit ce17fe3

3 files changed

Lines changed: 165 additions & 11 deletions

File tree

commands/example.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

commands/github-issue-workflow.md

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# GitHub Issue Workflow
2+
3+
You are an autonomous developer working through GitHub issues. Work with MINIMAL user interaction - only pause when user review/merge is required.
4+
5+
## PHASE 1: Issue Selection
6+
1. Run `gh issue list --state open --limit 10` to show open issues
7+
2. If user provided an issue number, use that. Otherwise, present the list and ask which issue to work on.
8+
3. Run `gh issue view <number>` to get full details
9+
4. Briefly summarize the issue and START WORKING IMMEDIATELY - do not ask for confirmation.
10+
11+
## PHASE 2: Development (AUTONOMOUS)
12+
1. Switch to main branch and pull latest: `git checkout main && git pull`
13+
2. Create feature branch: `git checkout -b feature/issue-<number>-<short-description>`
14+
3. For non-trivial tasks, use EnterPlanMode to plan implementation
15+
4. Implement the solution following CLAUDE.md guidelines
16+
5. Update CHANGELOG.md with the changes
17+
6. Run `task ci` and fix any issues until CI passes
18+
7. Commit changes with descriptive message referencing the issue
19+
8. Push branch and create PR with proper format
20+
21+
## PHASE 3: Automated Testing (AUTONOMOUS)
22+
Automatically test based on the type of change:
23+
24+
**For UI changes:**
25+
- Use dev-browser skill to navigate to the affected page
26+
- Test the specific functionality that was changed
27+
- Take screenshots if helpful
28+
- Document any issues found and fix them
29+
30+
**For API/backend changes:**
31+
- If there's a UI component (like a download button), test it via dev-browser
32+
- Verify the fix works as expected
33+
34+
**For PDF/report changes:**
35+
- Navigate to a scan results page
36+
- Click the PDF download button
37+
- Verify no errors occur
38+
39+
**For form/validation changes:**
40+
- Navigate to the relevant form
41+
- Test with valid and invalid inputs
42+
43+
Fix any issues found during testing, commit, and push.
44+
45+
## PHASE 4: Automated Code Review (AUTONOMOUS)
46+
1. Run Task tool with subagent_type='pr-review-toolkit:code-reviewer'
47+
2. Run Task tool with subagent_type='pr-review-toolkit:silent-failure-hunter'
48+
3. If HIGH priority issues are found, fix them automatically
49+
4. For MEDIUM/LOW issues, use judgment - fix if straightforward, otherwise note them
50+
5. Push any fixes made
51+
52+
## PHASE 5: User Review & Merge (WAIT FOR USER)
53+
Present a summary to the user:
54+
- What was implemented
55+
- What was tested
56+
- Code review results and any fixes made
57+
- PR link
58+
59+
Then say: "PR is ready for your review and merge. I'll wait for the merge to complete."
60+
61+
Wait for merge using:
62+
```bash
63+
while true; do
64+
pr_state=$(gh pr view <PR_NUMBER> --json state -q '.state')
65+
if [ "$pr_state" = "MERGED" ]; then
66+
echo "PR merged!"
67+
break
68+
fi
69+
sleep 10
70+
done
71+
```
72+
73+
## PHASE 6: Next Issue (AFTER MERGE)
74+
1. Switch to main and pull: `git checkout main && git pull`
75+
2. Check for remaining open issues: `gh issue list --state open --limit 5`
76+
3. If there are open issues, suggest the next one to tackle:
77+
"Merge complete! Here are the remaining open issues:
78+
[list issues]
79+
80+
I suggest we tackle #XX next because [reason]. Should I start working on it?"
81+
4. If user confirms, immediately start Phase 1 with that issue number.
82+
83+
## Important Rules
84+
- Work AUTONOMOUSLY through phases 1-4 without asking for confirmation
85+
- Only pause at Phase 5 for user review/merge
86+
- Always follow CLAUDE.md guidelines
87+
- Never commit directly to main
88+
- Always run `task ci` before creating PR
89+
- Fix issues found by automated testing and review without asking
90+
- Be efficient - don't ask unnecessary questions

commands/itk-dev-github.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# itk-dev GitHub Workflow
2+
3+
## Core Rules
4+
5+
1. **Never commit directly to main** - All changes go through pull requests
6+
2. **Always create a feature branch** for every PR
7+
3. **Every PR must include** an updated CHANGELOG and reference related GitHub issues
8+
4. **Close related issues** upon PR merge using "Closes #XX" syntax
9+
10+
## Branch Naming
11+
12+
Format: `feature/issue-{number}-{short-description}`
13+
14+
Examples:
15+
- `feature/issue-123-add-user-authentication`
16+
- `feature/issue-45-fix-pagination-bug`
17+
- `feature/issue-78-update-api-endpoints`
18+
19+
## Commit Messages
20+
21+
Follow [Conventional Commits](https://www.conventionalcommits.org/):
22+
23+
```
24+
<type>: <description>
25+
26+
[optional body]
27+
28+
[optional footer]
29+
```
30+
31+
Types: `feat`, `fix`, `docs`, `style`, `refactor`, `test`, `chore`, `perf`, `ci`, `build`
32+
33+
Examples:
34+
- `feat: add language switcher component`
35+
- `fix: resolve pagination offset error`
36+
- `docs: update API documentation`
37+
- `refactor: extract validation logic to service`
38+
39+
## Changelog
40+
41+
Follow [Keep a Changelog](https://keepachangelog.com/) format. Update `CHANGELOG.md` with every PR under the `[Unreleased]` section.
42+
43+
Categories: `Added`, `Changed`, `Deprecated`, `Removed`, `Fixed`, `Security`
44+
45+
## Pull Request Requirements
46+
47+
### Before Opening PR
48+
- [ ] All GitHub Actions checks pass
49+
- [ ] CHANGELOG.md updated under `[Unreleased]`
50+
- [ ] Branch is up-to-date with main
51+
52+
### PR Description Template
53+
54+
```markdown
55+
## Summary
56+
Brief description of what this PR does and which issue it addresses (#XX).
57+
58+
## Features Added
59+
* Feature 1: Description
60+
* Feature 2: Description
61+
62+
## Files Changed
63+
* `path/to/file.ext` - What changed
64+
* `path/to/new-file.ext` (new) - Purpose
65+
66+
## Test Plan
67+
* Step-by-step verification instructions
68+
* Expected outcomes for each test
69+
70+
Closes #XX
71+
```
72+
73+
### Review Requirements
74+
- Minimum **one approving review** required before merge
75+
- All GitHub Actions checks must pass

0 commit comments

Comments
 (0)