skills/security-pipeline/SKILL.md
Bootstrap a complete security pipeline (Dependabot + OSV + Semgrep + gitleaks + pre-commit hooks + Codex review) on any GitHub repo. Designed for free user-private repos where GitHub Advanced Security is unavailable. Reusable across Python/TypeScript/Go/Rust stacks.
npx skillsauth add jaggerxtrm/jaggers-agent-tools security-pipelineInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Wires a 4-layer security baseline onto any GitHub repo. Originally proven on the Mercury infra stack but the templates and bootstrap script are project-agnostic — adapt the allowlists and dependabot ecosystems per repo.
Do NOT use this skill if the repo already has a working dependabot.yml AND
all three workflows (osv-scanner.yml, semgrep.yml, gitleaks.yml).
git commit ──► pre-commit (gitleaks staged, ruff, hygiene) ~1s
git push ──► pre-push (semgrep diff-only, osv, anti-main) ~30s
PR opened ──► CI (osv-scanner, semgrep, gitleaks) ~1m
PR review ──► Codex (semantic AI review, optional) ~2m
PR merged ──► Dependabot (continuous vuln + version PRs) async
Pre-existing debt is NEVER blocked by the push gate — only NEW findings vs
origin/main. CI does the full-repo authoritative scan.
GitHub Advanced Security (CodeQL, Dependency Review) needs Org/Enterprise
| GHAS | Free substitute |
|---|---|
| CodeQL | Semgrep p/security-audit + p/secrets + ecosystem packs |
| Dependency Review | osv-scanner action |
| Secret scanning | Native (free for all repos since 2025) |
| Push protection | Native (free for all repos since 2025) |
| Branch protection enforcement | Pre-push hook + gh pr merge --auto |
The skill ships with a bootstrap script that detects ecosystems and copies templates. From the source repo (where this skill is installed):
./scripts/security-bootstrap.sh /path/to/target/repo
The script:
pip, pip-pyproject, npm, docker, gomod,
cargo, github-actions).github/dependabot.ymltemplates/feat(security) PRgh api to enable Dependabot/secret scanning/push protectionThe script CAN'T do these — operator walks them per target repo:
main
OSV scan, Semgrep scan, Gitleaks scanmake install-hooks in the target clone (or run git config core.hooksPath .githooks)templates/| Template | Lands at | Purpose |
|---|---|---|
| .github/workflows/osv-scanner.yml | same path | Vuln scan via OSV.dev |
| .github/workflows/semgrep.yml | same path | SAST (replaces CodeQL) |
| .github/workflows/gitleaks.yml | same path | Secret scan |
| .gitleaks.toml | same path | Allowlist — adapt per project (see below) |
| .semgrepignore | same path | Excludes — adapt per project (see below) |
| .pre-commit-config.yaml | same path | Two-stage local gate |
| .githooks/pre-push.template | merge into existing .githooks/pre-push | Anti-main-push + pre-commit chain |
| scripts/semgrep-diff.sh | same path | Diff-only semgrep for push |
| scripts/security-scan.sh | same path | Local audit (informational) |
.github/dependabot.yml is NOT in templates/ — it's generated per-repo from
detected ecosystems.
The shipped .gitleaks.toml and .semgrepignore contain Mercury-specific
paths as examples. When applying to a non-Mercury repo, prune what
doesn't apply.
.gitleaks.toml — common allowlist patterns[allowlist]
paths = [
'''^\.env$''', # gitignored secrets (no-git scan walks fs)
'''^\.env\..*''',
# Project-specific machine-generated dirs (drop what doesn't apply):
'''^\.beads/.*''', # Mercury-only — issue tracker exports
'''^\.specialists/.*''', # Mercury-only — specialist runtime state
'''^\.dolt/.*''', # Mercury-only — Dolt SQL storage
# Add your own:
'''^vendor/.*''', # Go vendoring
'''^node_modules/.*''', # NPM (usually gitignored anyway)
]
.semgrepignore — common patterns.env
.env.*
node_modules/
vendor/
**/__pycache__/
**/test_fixtures/
package-lock.json
pnpm-lock.yaml
yarn.lock
poetry.lock
Pipfile.lock
go.sum
Cargo.lock
Don't blanket-allowlist findings without a tracked issue explaining why. Acknowledged debt should be visible.
pip3 install --user --break-system-packages pre-commit semgrep
mkdir -p ~/.local/bin
curl -sL https://github.com/gitleaks/gitleaks/releases/download/v8.21.2/gitleaks_8.21.2_linux_x64.tar.gz \
| tar -xz -C ~/.local/bin gitleaks
curl -sL https://github.com/google/osv-scanner/releases/download/v2.0.2/osv-scanner_linux_amd64 \
-o ~/.local/bin/osv-scanner && chmod +x ~/.local/bin/osv-scanner
git config core.hooksPath .githooks
chmod +x .githooks/pre-commit .githooks/pre-push 2>/dev/null
Verify: ./scripts/security-scan.sh.
gh pr view <num> --json reviews,comments | python3 -c "
import json, sys
d = json.load(sys.stdin)
for r in d.get('reviews', []):
if 'codex' in r.get('author',{}).get('login','').lower():
body = r.get('body', '')
print('👍 no suggestions' if 'automated review suggestions' in body and len(body) < 1500 else body[:1500])
"
core.hooksPath set → templates chain
pre-commit from .githooks/pre-commit and .githooks/pre-push instead of
using pre-commit install.pkg_resources missing)
→ templates use language: system pointing at globally installed semgrep.semgrep ci --error is invalid → use semgrep scan --error.actions/dependency-review-action requires GHAS → use osv-scanner instead.pull-requests: write to post leak summary on PRs.scripts/semgrep-diff.sh with --baseline-commit=$(git merge-base HEAD origin/main)..pre-commit-config.yaml default_stages: [pre-commit] → otherwise
ruff/hygiene hooks fire at push too.git commit --amend → verify
git log --stat <merge-sha> after merge; missing files require a follow-up PR.gh pr merge --squash --delete-branch
after gh pr checks --watch.trivy fs / trivy image — container + IaC scanningbandit — Python-specific SAST (Semgrep p/python already covers most)actionlint — GitHub Actions linter (Semgrep p/github-actions covers basics)Full pipeline narrative + UI screenshots + per-feature rationale lives in
the Mercury reference at mercury-infra/SECURITY-PIPELINE.md, also mirrored
in ~/second-mind/3-resources/github/SECURITY-PIPELINE.md.
development
Operational service-knowledge system for a project's services. One skill that creates, discovers, activates, updates, and scopes per-service expert skill packages (SKILL.md + diagnostic scripts + references), kept in sync with the code via a GitNexus-aware drift engine. Use when onboarding to a service, routing a task to the right expert, scaffolding a missing skill, or syncing a skill after the implementation drifted. Triggers: /service-skills, /creating-service-skills, /using-service-skills, /updating-service-skills, /scope, or any task that touches a registered service territory.
testing
Merges queued PRs from xt worktree sessions in the correct order (FIFO), maintaining linear history by rebasing remaining PRs after each merge. Use this skill whenever the user has multiple open PRs from xt worktrees, asks to "merge my PRs", "process the PR queue", "drain the queue", "merge worktree branches", or says "what PRs do I have open". Also activate after any xt-end completion when other PRs are already open, or when the user asks "can I merge yet" or "is CI green". Handles the full sequence: list → sort → CI check → merge oldest → rebase cascade → repeat until queue is empty.
testing
Autonomous session close flow for xt worktree sessions. Use this skill whenever the user says "done", "finished", "wrap up", "close session", "ship it", "I'm done", "ready to merge", or similar. Also activate when all beads issues in the session are closed, or when the user explicitly runs /xt-end. This skill is designed for headless/specialist use: it must make deterministic decisions, auto-remediate common anomalies, and avoid clarification questions unless execution is truly blocked.
development
Complete debugging workflow — error analysis, log interpretation, performance profiling, and GitNexus call-chain tracing. Use when investigating bugs, errors, crashes, or performance issues.