claude-dev-env 1.21.2 → 1.22.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/skills/bugteam/SKILL.md +530 -0
- package/skills/bugteam/_claude_permissions_common.py +224 -0
- package/skills/bugteam/grant_project_claude_permissions.py +110 -0
- package/skills/bugteam/revoke_project_claude_permissions.py +136 -0
- package/skills/findbugs/SKILL.md +203 -0
- package/skills/fixbugs/SKILL.md +143 -0
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: fixbugs
|
|
3
|
+
description: >-
|
|
4
|
+
Fixes the bugs surfaced by the most recent /findbugs invocation by handing
|
|
5
|
+
the findings to /agent-prompt, which authors a structured XML prompt and
|
|
6
|
+
spawns a background sonnet clean-coder agent to implement every fix in one
|
|
7
|
+
commit on the existing branch. Default scope: all severities. Optional
|
|
8
|
+
argument filters by severity (e.g. /fixbugs P0, /fixbugs P0+P1).
|
|
9
|
+
Triggers: '/fixbugs', 'fix all the bugs', 'apply the audit fixes',
|
|
10
|
+
'implement the findbugs results'.
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Fixbugs
|
|
14
|
+
|
|
15
|
+
**Core principle:** A thin bridge between `/findbugs` (read-only audit) and `/agent-prompt` (structured prompt authoring + spawn). /fixbugs recovers the prior findings, packages them as a goal, and hands off. It does not author prompts itself, does not spawn agents directly, and does not run audits.
|
|
16
|
+
|
|
17
|
+
## When this skill applies
|
|
18
|
+
|
|
19
|
+
Right after `/findbugs` returned findings on the current branch and the user wants the bugs fixed without further triage. Bare `/fixbugs` defaults to all severities (P0 + P1 + P2). Argument-filtered invocations (e.g. `/fixbugs P0`, `/fixbugs P0+P1`, `/fixbugs P0 P1`) narrow the target set.
|
|
20
|
+
|
|
21
|
+
Refusal cases:
|
|
22
|
+
|
|
23
|
+
- **No findings in session.** Respond exactly: `No findings in this session. Run /findbugs first.` and stop.
|
|
24
|
+
- **Most recent /findbugs returned zero bugs.** Respond exactly: `No bugs to fix.` and stop.
|
|
25
|
+
- **Filter excludes every finding.** Respond: `No bugs match the filter <args>.` and stop.
|
|
26
|
+
- **Agent-prompt skill not installed.** Before Step 1, verify the `agent-prompt` skill is in the available skills list. If missing, respond: `agent-prompt skill not installed. /fixbugs hands off to it; install it first.` and stop.
|
|
27
|
+
|
|
28
|
+
## The Process
|
|
29
|
+
|
|
30
|
+
### Step 1: Recover the findings
|
|
31
|
+
|
|
32
|
+
Locate the most recent `/findbugs` output in the current conversation. For each finding, capture:
|
|
33
|
+
|
|
34
|
+
- Severity (`P0` / `P1` / `P2`)
|
|
35
|
+
- `file:line`
|
|
36
|
+
- Category (the A–J letter or category name `/findbugs` reported)
|
|
37
|
+
- One-sentence description as `/findbugs` wrote it
|
|
38
|
+
|
|
39
|
+
Apply the severity filter from `$ARGUMENTS` if present:
|
|
40
|
+
|
|
41
|
+
- `P0` → P0 only
|
|
42
|
+
- `P0+P1` or `P0 P1` → P0 and P1
|
|
43
|
+
- `P1` → P1 only
|
|
44
|
+
- absent → all severities
|
|
45
|
+
|
|
46
|
+
If the filtered set is empty, refuse per the refusal cases above.
|
|
47
|
+
|
|
48
|
+
### Step 2: Re-resolve PR scope
|
|
49
|
+
|
|
50
|
+
Re-establish the same PR target `/findbugs` used:
|
|
51
|
+
|
|
52
|
+
1. `gh pr view --json number,baseRefName,headRefName,url` from the working directory.
|
|
53
|
+
2. Fall back to `git merge-base HEAD origin/<default>` then `git diff <merge-base>...HEAD`.
|
|
54
|
+
3. Neither → respond `No PR or upstream diff. Cannot scope fixes.` and stop.
|
|
55
|
+
|
|
56
|
+
Capture: `<owner>/<repo>`, head branch, base branch, PR number, PR URL.
|
|
57
|
+
|
|
58
|
+
### Step 3: Hand off to /agent-prompt
|
|
59
|
+
|
|
60
|
+
Invoke the `agent-prompt` skill with a goal string of this exact shape:
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
Fix the following bugs surfaced by /findbugs on
|
|
64
|
+
<owner>/<repo> @ <head_branch> (PR #<number>, base <base_branch>):
|
|
65
|
+
|
|
66
|
+
[for each filtered finding, one bullet:]
|
|
67
|
+
- [<severity>] <file:line> (<category>): <description>
|
|
68
|
+
|
|
69
|
+
Deploy a clean-coder background agent (model: sonnet) to implement all fixes
|
|
70
|
+
in one commit on the existing branch and push. Constraints:
|
|
71
|
+
- Modify only the files referenced in the bug list above.
|
|
72
|
+
- Do NOT change the PR base, do NOT rebase, do NOT amend, do NOT --force.
|
|
73
|
+
- Do NOT skip git hooks (no --no-verify, no --no-gpg-sign).
|
|
74
|
+
- Use git add by explicit path; never `git add .` or `git add -A`.
|
|
75
|
+
- Preserve existing comments on lines you do not modify.
|
|
76
|
+
- Type hints on every signature you touch.
|
|
77
|
+
|
|
78
|
+
After push, report: commit SHA, per-file lines added/removed, hook output
|
|
79
|
+
summary, and confirmation that each bug above was addressed.
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
`/agent-prompt` then runs its own workflow end-to-end: prompt-generator authoring, Outcome preview, AskUserQuestion confirmation gate, background spawn. The confirmation gate is preserved — fixes are write operations and the user must approve the final XML before the agent runs.
|
|
83
|
+
|
|
84
|
+
### Step 4: Hand-off complete
|
|
85
|
+
|
|
86
|
+
`/fixbugs` produces no further output. `/agent-prompt` owns the visible chat from this point: the XML fence, the Outcome digest, the AskUserQuestion, and the spawn confirmation. Do not duplicate any of those, do not summarize them, do not add commentary.
|
|
87
|
+
|
|
88
|
+
## Output Format
|
|
89
|
+
|
|
90
|
+
When `/fixbugs` proceeds, the visible output is `/agent-prompt`'s output — nothing from `/fixbugs` itself.
|
|
91
|
+
|
|
92
|
+
When `/fixbugs` short-circuits (no findings, no PR, empty filter, zero bugs), the visible output is the single-line refusal message and nothing else.
|
|
93
|
+
|
|
94
|
+
## Constraints
|
|
95
|
+
|
|
96
|
+
- **Sequencing.** `/fixbugs` runs AFTER `/findbugs`. It does not perform audits.
|
|
97
|
+
- **Scope inheritance.** Fixes target only files referenced in the prior `/findbugs` findings — the PR diff scope. Do not expand to unrelated files.
|
|
98
|
+
- **No silent spawn.** `/agent-prompt`'s confirmation gate is preserved on every run.
|
|
99
|
+
- **One commit per `/fixbugs` run.** All filtered fixes batch into a single commit.
|
|
100
|
+
- **No `--force`, no `--amend`, no rebase, no base change.** Standard git workflow applies to the spawned agent.
|
|
101
|
+
- **Sonnet for the implementer.** Always pass `model: sonnet` to the spawn — keeps cost predictable and matches the agent's training fit for code edits.
|
|
102
|
+
- **Background spawn.** The user typed `/fixbugs` to delegate, not to wait. The agent runs in the background and notifies on completion.
|
|
103
|
+
|
|
104
|
+
## Examples
|
|
105
|
+
|
|
106
|
+
<example>
|
|
107
|
+
User: `/findbugs` → returns `1 P0 / 2 P1 / 0 P2`
|
|
108
|
+
User: `/fixbugs`
|
|
109
|
+
Claude: [recovers all 3 findings, resolves PR scope, invokes /agent-prompt with a goal targeting all 3 bugs; /agent-prompt presents the XML + Outcome digest + AskUserQuestion; on Launch it, the background sonnet clean-coder spawns]
|
|
110
|
+
</example>
|
|
111
|
+
|
|
112
|
+
<example>
|
|
113
|
+
User: `/findbugs` → returns `1 P0 / 2 P1 / 1 P2`
|
|
114
|
+
User: `/fixbugs P0+P1`
|
|
115
|
+
Claude: [filters to 3 findings (the P2 is dropped), hands the filtered set to /agent-prompt]
|
|
116
|
+
</example>
|
|
117
|
+
|
|
118
|
+
<example>
|
|
119
|
+
User: `/fixbugs` (no prior /findbugs in session)
|
|
120
|
+
Claude: `No findings in this session. Run /findbugs first.`
|
|
121
|
+
</example>
|
|
122
|
+
|
|
123
|
+
<example>
|
|
124
|
+
User: `/findbugs` → returns `0 P0 / 0 P1 / 0 P2`
|
|
125
|
+
User: `/fixbugs`
|
|
126
|
+
Claude: `No bugs to fix.`
|
|
127
|
+
</example>
|
|
128
|
+
|
|
129
|
+
<example>
|
|
130
|
+
User: `/findbugs` → returns `0 P0 / 0 P1 / 1 P2`
|
|
131
|
+
User: `/fixbugs P0`
|
|
132
|
+
Claude: `No bugs match the filter P0.`
|
|
133
|
+
</example>
|
|
134
|
+
|
|
135
|
+
## Why this design
|
|
136
|
+
|
|
137
|
+
Three skills, three responsibilities:
|
|
138
|
+
|
|
139
|
+
- `/findbugs` audits in a clean room, returns findings.
|
|
140
|
+
- `/fixbugs` packages findings as a goal, delegates.
|
|
141
|
+
- `/agent-prompt` authors the XML and spawns the agent (with confirmation).
|
|
142
|
+
|
|
143
|
+
Each skill stays small and reuses what already exists. `/fixbugs` adds value by recovering findings from chat, filtering by severity, and writing the goal in `/agent-prompt`'s expected shape — not by reimplementing prompt authoring or spawn logic. The `/agent-prompt` confirmation gate is non-negotiable because fixes write code, push to a PR, and are visible to reviewers; the friction is the safety.
|