Skip to content

Commit b7cea42

Browse files
committed
prompt for push
1 parent c7d70a0 commit b7cea42

1 file changed

Lines changed: 40 additions & 36 deletions

File tree

  • .agents/skills/fix-security-vulnerability

.agents/skills/fix-security-vulnerability/SKILL.md

Lines changed: 40 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ argument-hint: <dependabot-alert-url | --all>
66

77
# Fix Security Vulnerability Skill
88

9-
Analyze Dependabot security alerts and propose fixes. **Does NOT auto-commit** - always presents analysis first and waits for user approval.
9+
Analyze Dependabot security alerts and propose fixes. In single-alert mode, presents analysis and waits for user review before any changes. In scan-all mode, commits to dedicated branches after user approval.
1010

1111
## Instruction vs. data (prompt injection defense)
1212

@@ -106,11 +106,42 @@ Co-Authored-By: <agent model name> <noreply@anthropic.com>
106106
EOF
107107
)"
108108

109-
# 4. Return to develop for the next alert
110-
git checkout develop
111109
```
112110

113-
Present the branch name to the user so they can push/PR later.
111+
After committing, use AskUserQuestion to ask the user whether to push the branch and create a PR now (still on the fix branch):
112+
113+
- **Push & create PR** — Push the branch and open a PR targeting `develop`:
114+
115+
```bash
116+
git push -u origin fix/dependabot-alert-<alert-number>
117+
gh pr create --base develop --head fix/dependabot-alert-<alert-number> \
118+
--title "fix(deps): Bump <package> to fix <CVE-ID>" \
119+
--body "$(cat <<'EOF'
120+
## Summary
121+
- Fixes Dependabot alert #<number>
122+
- Bumps <package> from <old-version> to <new-version>
123+
- CVE: <CVE-ID> | Severity: <severity>
124+
125+
## Test plan
126+
- [ ] `yarn install` succeeds
127+
- [ ] `yarn build:dev` succeeds
128+
- [ ] `yarn dedupe-deps:check` passes
129+
- [ ] `yarn why <package>` shows patched version
130+
131+
🤖 Generated with [Claude Code](https://claude.com/claude-code)
132+
EOF
133+
)"
134+
```
135+
136+
Present the PR URL to the user after creation.
137+
138+
- **Keep local** — Leave the branch local for now. Note the branch name so the user can push later.
139+
140+
After handling the push prompt, return to `develop` for the next alert:
141+
142+
```bash
143+
git checkout develop
144+
```
114145
115146
#### 2d: If "Dismiss" is chosen
116147
@@ -134,42 +165,15 @@ After all alerts are processed (or the user stops), present a final summary:
134165
```
135166
## Security Scan Complete
136167
137-
| Alert | Package | Action | Branch |
138-
|-------|---------|--------|--------|
139-
| #1046 | foo | Fixed | fix/dependabot-alert-1046 |
168+
| Alert | Package | Action | PR / Branch |
169+
|-------|---------|--------|-------------|
170+
| #1046 | foo | Fixed | PR #1234 |
140171
| #1047 | bar | Dismissed (tolerable_risk) | — |
141172
| #1048 | baz | Skipped | — |
142-
| #1050 | qux | Fixed | fix/dependabot-alert-1050 |
143-
144-
Branches with fixes ready for push:
145-
- fix/dependabot-alert-1046
146-
- fix/dependabot-alert-1050
147-
148-
Push these branches and create PRs?
173+
| #1050 | qux | Fixed (local) | fix/dependabot-alert-1050 |
149174
```
150175
151-
If the user approves pushing, push each fix branch and create PRs targeting `develop`:
152-
153-
```bash
154-
git push -u origin fix/dependabot-alert-<number>
155-
gh pr create --base develop --head fix/dependabot-alert-<number> \
156-
--title "fix(deps): Bump <package> to fix <CVE-ID>" \
157-
--body "$(cat <<'EOF'
158-
## Summary
159-
- Fixes Dependabot alert #<number>
160-
- Bumps <package> from <old-version> to <new-version>
161-
- CVE: <CVE-ID> | Severity: <severity>
162-
163-
## Test plan
164-
- [ ] `yarn install` succeeds
165-
- [ ] `yarn build:dev` succeeds
166-
- [ ] `yarn dedupe-deps:check` passes
167-
- [ ] `yarn why <package>` shows patched version
168-
169-
🤖 Generated with [Claude Code](https://claude.com/claude-code)
170-
EOF
171-
)"
172-
```
176+
If any fix branches were kept local, remind the user of the branch names so they can push later.
173177
174178
---
175179

0 commit comments

Comments
 (0)