Skip to content

Commit 9035e6c

Browse files
committed
feat: enhance issue workflow with detailed CI detection and PR creation
- Add Tool Detection Strategy section with hierarchical approach: 1. Taskfile tasks (preferred) 2. Composer scripts (fallback) 3. itkdev-docker-compose direct commands (last resort) - Add explicit gh pr create command with template in Phase 2 - Add coding-standards:apply step before running checks - Document common task names and composer scripts - Remove duplicate commands/github-issue-workflow.md file
1 parent e75f384 commit 9035e6c

2 files changed

Lines changed: 88 additions & 93 deletions

File tree

commands/github-issue-workflow.md

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

skills/itkdev-issue-workflow/SKILL.md

Lines changed: 88 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,45 @@ You are an autonomous developer working through GitHub issues. Work with MINIMAL
1919
3. For non-trivial tasks, use EnterPlanMode to plan implementation
2020
4. Implement the solution following CLAUDE.md guidelines
2121
5. Update CHANGELOG.md with the changes
22-
6. Run `task ci` and fix any issues until CI passes
22+
6. Run CI checks (see "Tool Detection Strategy" section below):
23+
24+
**Step A - Detect available tools:**
25+
- Run `task` to list available Taskfile tasks (if Taskfile.yml exists)
26+
- Run `itkdev-docker-compose composer run --list` to see composer scripts
27+
28+
**Step B - Apply coding standards fixes first (auto-fix before checking):**
29+
- Preferred: `task coding-standards:apply`
30+
- Fallback: `itkdev-docker-compose composer run phpcbf` (if script exists)
31+
- Fallback: `itkdev-docker-compose vendor/bin/phpcbf`
32+
33+
**Step C - Run full CI checks:**
34+
- Preferred: `task ci` (runs all checks)
35+
- If `task ci` doesn't exist, run checks individually:
36+
- `task ci:coding-standards` or `itkdev-docker-compose vendor/bin/phpcs`
37+
- `task ci:phpunit` or `itkdev-docker-compose vendor/bin/phpunit`
38+
- `itkdev-docker-compose composer run phpstan` (if available)
39+
40+
**Step D - Fix any remaining issues and repeat until all checks pass**
41+
2342
7. Commit changes with descriptive message referencing the issue
24-
8. Push branch and create PR with proper format
43+
8. Push branch and create PR:
44+
```bash
45+
git push -u origin <branch-name>
46+
gh pr create --title "Issue #<number>: <short description>" --body "$(cat <<'EOF'
47+
## Summary
48+
<Brief description of what was implemented>
49+
50+
## Changes
51+
- <List key changes made>
52+
53+
## Testing
54+
- <How the changes were tested>
55+
56+
Fixes #<issue-number>
57+
EOF
58+
)"
59+
```
60+
Store the PR number for use in Phase 5.
2561
2662
## PHASE 3: Automated Testing (AUTONOMOUS)
2763
Automatically test based on the type of change:
@@ -85,11 +121,60 @@ done
85121
I suggest we tackle #XX next because [reason]. Should I start working on it?"
86122
4. If user confirms, immediately start Phase 1 with that issue number.
87123
124+
## Tool Detection Strategy
125+
126+
Before running CI commands, detect what's available in the project:
127+
128+
### 1. Check for Taskfile
129+
```bash
130+
if [ -f "Taskfile.yml" ] || [ -f "Taskfile.yaml" ]; then
131+
task --list # Shows available tasks
132+
fi
133+
```
134+
135+
### 2. Check composer.json scripts
136+
```bash
137+
itkdev-docker-compose composer run --list
138+
```
139+
140+
### 3. Common Taskfile task names to look for
141+
| Task | Purpose |
142+
|------|---------|
143+
| `task ci` | Full CI suite (coding standards + tests) |
144+
| `task ci:coding-standards` | Coding standards check only |
145+
| `task ci:phpunit` | PHPUnit tests only |
146+
| `task coding-standards:apply` | Auto-fix coding standards issues |
147+
| `task config:export` | Export Drupal configuration |
148+
| `task config:import` | Import Drupal configuration |
149+
| `task dev:setup` | Initial project setup |
150+
| `task dev:reset` | Reset local environment |
151+
152+
### 4. Common composer scripts to look for
153+
| Script | Purpose |
154+
|--------|---------|
155+
| `phpcs` | PHP CodeSniffer - check coding standards |
156+
| `phpcbf` | PHP Code Beautifier - auto-fix standards |
157+
| `phpunit` / `test` | Run PHPUnit tests |
158+
| `phpstan` / `analyze` | Static analysis |
159+
| `coding-standards` | Combined standards check |
160+
| `coding-standards:check` | Check only (no fix) |
161+
| `coding-standards:apply` | Apply/fix standards |
162+
163+
### 5. Direct itkdev-docker-compose fallbacks
164+
When no task or composer script exists, run tools directly:
165+
```bash
166+
itkdev-docker-compose vendor/bin/phpcs # Coding standards
167+
itkdev-docker-compose vendor/bin/phpcbf # Auto-fix standards
168+
itkdev-docker-compose vendor/bin/phpunit # PHPUnit tests
169+
itkdev-docker-compose vendor/bin/phpstan # Static analysis
170+
```
171+
88172
## Important Rules
89173
- Work AUTONOMOUSLY through phases 1-4 without asking for confirmation
90174
- Only pause at Phase 5 for user review/merge
91175
- Always follow CLAUDE.md guidelines
92176
- Never commit directly to main
93-
- Always run `task ci` before creating PR
177+
- Always run CI checks before creating PR (use tool detection strategy)
178+
- Apply coding standards fixes BEFORE running checks (saves time)
94179
- Fix issues found by automated testing and review without asking
95180
- Be efficient - don't ask unnecessary questions

0 commit comments

Comments
 (0)