Skip to content

Commit d4fb12a

Browse files
authored
Merge pull request #90 from jwm4/bugfix/comprehensive-workflow-improvements
fix(bugfix): comprehensive workflow improvements addressing 9 open issues
2 parents b3ed157 + 44f926e commit d4fb12a

File tree

9 files changed

+517
-59
lines changed

9 files changed

+517
-59
lines changed

workflows/bugfix/.claude/skills/assess/SKILL.md

Lines changed: 61 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,49 @@ gh repo clone OWNER/REPO /workspace/repos/REPO
6868

6969
This is read-only exploration — understand the code, don't change it.
7070

71-
### Step 3: Summarize Your Understanding
71+
### Step 3: Check for Existing Work
72+
73+
Before investing effort, check whether this bug is already being addressed:
74+
75+
- **Check for linked PRs on the issue:**
76+
77+
```bash
78+
gh issue view NUMBER --repo OWNER/REPO --json body,comments --jq '[.body, .comments[].body] | join("\n")' | grep -i "pull\|PR\|#"
79+
```
80+
81+
- **Scan recent PR titles for overlap:**
82+
83+
```bash
84+
gh pr list --repo OWNER/REPO --state open --limit 30 --json number,title,headRefName --jq '.[] | "\(.number)\t\(.title)"'
85+
```
86+
87+
Skim the titles for anything related to the bug's component, error, or
88+
symptoms. If a PR looks relevant, read its description before proceeding.
89+
90+
- **Check for duplicate or related issues:**
91+
92+
```bash
93+
gh issue list --repo OWNER/REPO --state open --limit 30 --json number,title --jq '.[] | "\(.number)\t\(.title)"'
94+
```
95+
96+
If you find an open PR that appears to directly address this bug, **stop here
97+
and use `AskUserQuestion`** before continuing the assessment. Present the
98+
options:
99+
100+
- "PR #N appears to address this bug — review it instead of starting fresh"
101+
- "PR #N is related but doesn't fully cover it — continue with assessment"
102+
- "Not sure if PR #N is relevant — continue with assessment"
103+
104+
This gate applies in both normal and speedrun mode. Do not continue to Step 4
105+
until the user responds. The `AskUserQuestion` tool triggers platform
106+
notifications so the user knows you need their input.
107+
108+
If duplicate or related issues are found (but no PR), note them in the
109+
assessment and continue — these inform the assessment but don't block it.
110+
111+
If no existing work is found, note that and continue.
112+
113+
### Step 4: Summarize Your Understanding
72114

73115
Present a clear, concise summary to the user covering:
74116

@@ -81,7 +123,7 @@ Present a clear, concise summary to the user covering:
81123
- **Severity/impact:** Your assessment of how serious this is, based on the
82124
information available
83125

84-
### Step 4: Identify What You Know vs. What's Missing
126+
### Step 5: Identify What You Know vs. What's Missing
85127

86128
Be explicit about gaps:
87129

@@ -93,7 +135,7 @@ Be explicit about gaps:
93135
- **Assumptions:** Any assumptions you're making — call them out so the user
94136
can confirm or correct them
95137

96-
### Step 5: Propose a Reproduction Plan
138+
### Step 6: Propose a Reproduction Plan
97139

98140
Based on your understanding, outline how you would approach reproduction:
99141

@@ -105,7 +147,7 @@ Based on your understanding, outline how you would approach reproduction:
105147
If the bug seems straightforward, the plan can be brief. If it's complex or
106148
ambiguous, be thorough.
107149

108-
### Step 6: Present to the User
150+
### Step 7: Present to the User
109151

110152
Deliver your assessment in this structure:
111153

@@ -115,6 +157,9 @@ Deliver your assessment in this structure:
115157
**Issue:** [title or one-line summary]
116158
**Source:** [issue URL, conversation, etc.]
117159

160+
### Existing Work
161+
[Any related PRs, duplicate issues, or prior attempts — or "None found"]
162+
118163
### Understanding
119164
[Your 2-3 sentence summary of the bug]
120165

@@ -139,12 +184,22 @@ Deliver your assessment in this structure:
139184
Be direct. If the bug report is clear and complete, say so. If it's vague or
140185
missing critical details, say that too.
141186

142-
### Step 7: Write the Assessment Artifact
187+
**If the bug doesn't actually apply**, say so clearly and present options:
188+
189+
- "This issue doesn't affect your project — here's why. Want to close it?"
190+
- "The reported issue doesn't apply directly, but here's a related improvement
191+
we could make (with trade-offs): ..."
192+
- "This appears to be a duplicate of #N — should we close this one?"
193+
194+
Do not proceed to fix something you've concluded isn't broken. Present your
195+
finding and let the user decide.
196+
197+
### Step 8: Write the Assessment Artifact
143198

144199
Save your assessment to `artifacts/bugfix/reports/assessment.md` so that
145200
subsequent phases (and speedrun resumption) can detect that this phase is
146201
complete. The file should contain the same content you presented to the user
147-
in Step 6.
202+
in Step 7.
148203

149204
## Output
150205

workflows/bugfix/.claude/skills/controller/SKILL.md

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ executing phases and handling transitions between them.
3434
8. **PR** (`/pr`) — `.claude/skills/pr/SKILL.md`
3535
Push the branch to a fork and create a draft pull request.
3636

37+
9. **Summary** (`/summary`) — `.claude/skills/summary/SKILL.md`
38+
Scan all artifacts and present a synthesized summary of findings, decisions,
39+
and status. Can also be invoked at any point mid-workflow.
40+
3741
Phases can be skipped or reordered at the user's discretion.
3842

3943
## How to Execute a Phase
@@ -43,12 +47,20 @@ Phases can be skipped or reordered at the user's discretion.
4347
"Starting the /fix phase (dispatched by `.claude/skills/controller/SKILL.md`)."
4448
This is very important so the user knows the workflow is working, learns
4549
about the available phases, and so skills can find their way back here.
46-
2. **Read** the skill file from the list above
50+
2. **Read** the skill file from the list above. You MUST call the Read tool on
51+
the skill's `SKILL.md` file before executing. If you find yourself executing
52+
a phase without having read its skill file, you are doing it wrong — stop
53+
and read it now.
4754
3. **Execute** the skill's steps directly — the user should see your progress
4855
4. When the skill is done, it will report its findings and re-read this
4956
controller. Then use "Recommending Next Steps" below to offer options.
50-
5. Present the skill's results and your recommendations to the user
51-
6. **Stop and wait** for the user to tell you what to do next
57+
5. Present the skill's results and your recommendations to the user.
58+
6. **Use `AskUserQuestion` to get the user's decision.** Present the
59+
recommended next step and alternatives as options. Do NOT continue until the
60+
user responds. This is a hard gate — the `AskUserQuestion` tool triggers
61+
platform notifications and status indicators so the user knows you need
62+
their input. Plain-text questions do not create these signals and the user
63+
may not see them.
5264

5365
## Recommending Next Steps
5466

@@ -59,7 +71,7 @@ happened.
5971
### Typical Flow
6072

6173
```text
62-
assess → reproduce → diagnose → fix → test → review → document → pr
74+
assess → reproduce → diagnose → fix → test → review → document → pr → summary
6375
```
6476

6577
### What to Recommend
@@ -110,6 +122,17 @@ directly — don't force them through earlier phases.
110122

111123
## Rules
112124

113-
- **Never auto-advance.** Always wait for the user between phases.
125+
- **Never auto-advance.** Always use `AskUserQuestion` and wait for the user's
126+
response between phases. This is the single most important rule in this
127+
controller. If you proceed to another phase without the user's explicit
128+
go-ahead, the workflow is broken.
129+
- **Always read skill files.** Every phase execution MUST begin with a Read
130+
tool call on the skill's `SKILL.md` file. Do not execute a phase from memory
131+
or general knowledge — the skill files contain specific, tested instructions
132+
that differ from what you might do ad-hoc.
133+
- **Urgency does not bypass process.** Security advisories, critical bugs, and
134+
production incidents may create pressure to act fast. The phase-gated
135+
workflow exists precisely to prevent hasty action. Follow every phase gate
136+
regardless of perceived urgency.
114137
- **Recommendations come from this file, not from skills.** Skills report
115138
findings; this controller decides what to recommend next.

workflows/bugfix/.claude/skills/fix/SKILL.md

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,29 +59,50 @@ Before finalizing the implementation, ensure thoroughness:
5959
- **Check for complete enumeration**: If implementing switch/case logic or conditional checks, verify you've handled all possible values. Search the codebase for where these values are defined or used.
6060
- **Example**: If implementing polling that stops on "terminal" session phases, search the codebase for all usages of session phases to build a complete list (Stopped, Completed, Failed, Error) rather than assuming you know them all.
6161

62-
### Step 4: Address Related Code
62+
### Step 4: Review Error Handling UX
63+
64+
If your fix involves error handling, validation, or user-facing messages,
65+
review the error paths for clarity:
66+
67+
- **Match error context to error type.** A CLI argument error should use the
68+
CLI framework's error type (e.g., `click.BadParameter`), while a
69+
configuration file error should use a general exception that says which file
70+
and line caused the problem. Don't report config file errors as CLI parameter
71+
errors, or vice versa.
72+
- **Test every error path manually.** Trigger each error condition and read the
73+
message from the user's perspective. Is it clear what went wrong? Does it
74+
point to the right place to fix it?
75+
- **Consider different error contexts:**
76+
- CLI errors → should reference the flag or argument
77+
- Config file errors → should reference the file path and setting
78+
- Runtime errors → should include enough context to reproduce
79+
- API errors → should include the endpoint and status code
80+
- **Ensure error messages don't leak internals.** Stack traces, internal paths,
81+
and raw exception types are useful for developers but confusing for users.
82+
83+
### Step 5: Address Related Code
6384

6485
- Fix similar patterns identified in root cause analysis
6586
- Update affected function signatures if necessary
6687
- Ensure consistency across the codebase
6788
- Consider adding defensive programming where appropriate
6889

69-
### Step 5: Update Documentation
90+
### Step 6: Update Documentation
7091

7192
- Update inline code documentation
7293
- Modify API documentation if interfaces changed
7394
- Update configuration documentation if settings changed
7495
- Note any breaking changes clearly
7596

76-
### Step 6: Pre-commit Quality Checks
97+
### Step 7: Pre-commit Quality Checks
7798

7899
- Run code formatters (e.g., `gofmt`, `black`, `prettier`)
79100
- Run linters and fix all warnings (e.g., `golangci-lint`, `flake8`, `eslint`)
80101
- Ensure code compiles/builds without errors
81102
- Check for any new security vulnerabilities introduced
82103
- Verify no secrets or sensitive data added
83104

84-
### Step 7: Document Implementation
105+
### Step 8: Document Implementation
85106

86107
Create `artifacts/bugfix/fixes/implementation-notes.md` containing:
87108

0 commit comments

Comments
 (0)