Skip to content
Skills Library
Security · Automation

security-remediate

/security-remediate

Fix open Dependabot and CodeQL/code-scanning alerts directly on the current branch. Triggered automatically by the security-remediate-trigger PostToolUse hook after a git push where GitHub reports open vulnerabilities; can also be invoked manually. Never opens a new PR or issue - commits land on the branch that's already open.

Repository
atmos ↗
Licence
Apache-2.0
Last repository change
27.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 27.10.2026, without references to retired models or APIs.

Licence

Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.

What it does and when to use it

Fix open Dependabot and CodeQL/code-scanning alerts directly on the current branch. Triggered automatically by the security-remediate-trigger PostToolUse hook after a git push where GitHub reports open vulnerabilities; can also be invoked manually. Never opens a new PR or issue - commits land on the branch that's already open.

Original author description

Fix open Dependabot and CodeQL/code-scanning alerts directly on the current branch. Triggered automatically by the security-remediate-trigger PostToolUse hook after a git push where GitHub reports open vulnerabilities; can also be invoked manually. Never opens a new PR or issue - commits land on the branch that's already open.

How it works

  1. Fork / permission prerequisite (read first)
  2. Workflow
  3. What this skill must never do
Original SKILL.md headings · 61 lines, 676 words
SKILL.md preview
---
name: security-remediate
description: "Fix open Dependabot and CodeQL/code-scanning alerts directly on the current branch. Triggered automatically by the security-remediate-trigger PostToolUse hook after a git push where GitHub reports open vulnerabilities; can also be invoked manually. Never opens a new PR or issue - commits land on the branch that's already open."
metadata:
  copyright: Copyright Cloud Posse, LLC 2026
  version: "1.0.0"
---

# Security Remediate (Atmos)

Proactively fix GitHub-reported security alerts on the branch you're already working on, instead of letting them accumulate until a manual sweep (see commit `0e32451913` for what that manual sweep looked like).

## Fork / permission prerequisite (read first)

This repo is public, so a plain `gh` token with `repo` scope (the default from `gh auth login`) is **sufficient** to read both alert endpoints — `security_events` is only required on **private** repos (see GitHub's Dependabot alerts API docs: private repos need `security_events`, public repos only need `public_repo`/`repo`). Don't chase a `security_events` scope refresh for this repo; it's unnecessary and, per `cli/cli#12073` and independent reports (e.g. `microsoft/sarif-sdk#3081`), `gh auth refresh -s security_events` can report success while GitHub silently drops the scope anyway — a dead end that's easy to mistake for a real permission gap.

If `gh api` calls below still 404/403 even with `-X GET` present, that's a genuine permission gap (e.g. a fork contributor without repo access, or a future private-repo use of this skill lacking `security_events`) — stop and report it instead of attempting a workaround. `.claude/hooks/security-remediate-trigger.sh` treats that case exactly like "no alerts open" and silently does nothing.

## Workflow

1. **Resolve context.**
    ```bash
    owner_repo="$(gh repo view --json owner,name --jq '.owner.login + "/" + .name')"
    branch="$(git rev-parse --abbrev-ref HEAD)"
    ```

2. **Query both alert sources live** (the hook's cached alert set was only a trigger signal — treat it as stale):
    ```bash
    gh api "repos/${owner_repo}/dependabot/alerts" -X GET --paginate -f state=open
    gh api "repos/${owner_repo}/code-scanning/alerts" -X GET --paginate -f state=open
    ```
    The `-X GET` is required: `gh api` implicitly sends a `POST` when `-f`/`--paginate`
    params are given without an explicit method, and these list endpoints 404 on `POST`
    — indistinguishable from a real permission error unless you notice the verb. If
    either call still 403/404s with `-X GET` present, stop and report the permission gap
    — do not proceed partway.

3. **Filter to high-confidence fixes**, following the precedent set by `0e32451913`:
    - **Dependabot alerts**: only fix if a patched version exists *within* what `.github/dependabot.yml`'s `ignore` rules allow (that file currently ignores all major-version bumps across `gomod`, `github-actions`, and `npm`/website). If the only fix requires a major bump the policy blocks, do not bump it — report it as "blocked by dependabot ignore policy" instead.
    - **CodeQL alerts**: only fix rule IDs with an established safe pattern in this repo. Currently that's `go/allocation-size-overflow`, fixed by avoiding summed `len()` capacity hints (e.g., replacing `make([]T, len(a)+len(b))` with a pattern that doesn't sum lengths as a capacity hint). Extend this list cautiously — an unfamiliar rule ID with an ambiguous fix goes in the "not auto-fixable" bucket, not a guessed fix.
    - **GitHub Action pins**: bump to the patched SHA/tag referenced by the alert.
    - **npm/pnpm alerts** (in `website/`): bump via `pnpm.overrides` in `website/package.json`, then regenerate `NOTICE`:
      ```bash
      go tool mage notice:generate
      ```

4. **Apply fixes in the working tree**, then verify before committing anything:
    ```bash
    make lint
    go test ./... # or scope to the touched packages
    ```
    If either fails for a given fix, drop that fix from the commit and move it to the "not auto-fixable" report — don't commit something that doesn't pass.

5. **Commit directly onto the current branch.** No new branch, no new PR, no issue — this branch already has an open PR, and the fix belongs on it:
    ```bash
    git add <only the files you actually changed>
    git commit -m "fix(security): remediate N CodeQL/Dependabot alerts"
    ```

6. **Report a summary back in chat** (not as a GitHub comment/issue): which alerts were fixed (numbers + URLs), and which weren't, with a reason for each (major-bump blocked by policy, ambiguous/unfamiliar rule ID, no patch available yet, permission gap). Never silently drop an alert without accounting for it in this summary.

## What this skill must never do

- Open a new pull request.
- Open a new GitHub issue (per standing project guidance: never open issues without explicit per-issue user authorization).
- Push past a dependabot.yml `ignore` rule.
- Commit a fix that fails `make lint` or the targeted tests.

Versions

The database has no other skills named security-remediate.

Database snapshot: 13.11.2026 · package version 0641fb386a71 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100security-vulnerability-fix
    修復 npm 依賴與 GitHub Code Scanning 程式碼安全漏洞的完整工作流程。當使用者提到安全警告、Dependabot Security Alerts、CodeQL、Code Scanning、CVE、GHSA 或 npm audit 漏洞時使用;不適用於沒有安全 finding 的例行版本更新。包含漏洞分析、依賴或原始碼修正、驗證、PR、annotated tag 與 GitHub Actions CD。Fix npm dependency and GitHub Code Scanning vulnerabilities from…
  • 100github-dependabot
    Use the GitHub CLI to retrieve current open `Dependabot` alerts for a repository, inspect affected dependencies and patched versions, update manifests and lock files, and verify the local fixes. Use whenever a user asks to inspect, address, resolve, remediate, or fix…
  • 100security-scanning
    Review and fix security scanning alerts from CodeQL and secret scanning. Run as part of system reviews, after CI runs, or on manual request. Triggers on "security scan", "codeql", "secret scanning", "security alerts".
  • 100implementing-github-advanced-security-for-code-scanning
    Configures GitHub Advanced Security (code scanning with CodeQL, secret scanning, dependency review, and Dependabot alerts) to perform automated static analysis and vulnerability detection across repositories at enterprise scale, including custom CodeQL queries and CI workflow…
  • 100bifrost-secaudit
    Snapshot the current Security tab state for gobifrost/bifrost — open Dependabot alerts (counts by severity + ecosystem), open Dependabot PRs (counts by category + needs-review status), open CodeQL alerts (severity + top rules), open secret-scanning alerts, current Scorecard,…
  • 100bifrost-secupdate
    Drain the Bifrost Security tab — work through open Dependabot PRs (auto-merge eligible vs needs-review classification), Dependabot alerts (with/without PR), CodeQL alerts (severity-first triage with subagent fan-out for class-level rules), secret-scanning alerts (real vs FP).…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.