Skip to content

oioio-space/unpixel / .claude/skills/secret-guard

secret-guard

Verified

Use when reviewing changes or committing ANY code in this project — prevents leaking secrets and sensitive information to git/GitHub. Pairs with the deterministic gitleaks pre-commit gate.

FileKindSize
SKILL.mdskill md2.3 KB
---
name: secret-guard
description: Use when reviewing changes or committing ANY code in this project — prevents leaking secrets and sensitive information to git/GitHub. Pairs with the deterministic gitleaks pre-commit gate.
---

# Secret Guard

Goal: **nothing sensitive ever reaches git history / GitHub.** Two layers:

- **Deterministic** — `gitleaks git --staged` runs in the git `pre-commit` hook
  (`mise run scan:secrets:staged`) and blocks the commit on a regex/entropy match.
  Full history is re-scanned in CI (`mise run scan:secrets`).
- **AI review (this skill)** — when you (Claude) are about to `git commit`, the
  PreToolUse hook injects this checklist so you confront the staged diff against the
  things regex misses (internal hostnames, PII, private URLs, unknown token shapes).

## What counts as a leak — review the staged diff for:

- **Credentials & keys**: API keys/tokens, passwords, `Authorization:` headers,
  private keys (`-----BEGIN ... PRIVATE KEY-----`), `.pem`/`.p12`, SSH keys,
  cloud creds (AWS `AKIA…`, GCP service-account JSON), DB connection strings with
  passwords, OAuth client secrets, JWTs, webhook signing secrets.
- **Config that should be local**: `.env` files, `*.local.*`, credential files,
  `kubeconfig`, `.netrc`, `.npmrc` with `_authToken`.
- **Internal/PII**: real internal hostnames/IPs, private endpoints, customer data,
  emails, names, phone numbers, account IDs in fixtures or logs.
- **Accidental inclusions**: pasted terminal output containing tokens, debug dumps,
  build artifacts, `dist/`, coverage files with embedded data.

## How to act

1. Run `git diff --cached` and scan for the categories above.
2. If you find a secret: **do not commit.** Remove it, move it to an env var /
   secret manager, and add the file to `.gitignore`. If it was a real credential
   that already touched the working tree, treat it as compromised → rotate it.
3. For false positives in gitleaks, add a scoped allowlist to `.gitleaks.toml`
   (never disable scanning wholesale) or a `.gitleaksignore` entry with a comment.
4. Prefer placeholders in examples: `ghp_xxx`, `<API_KEY>`, `password=REDACTED`.

## Notes

- The deterministic gate uses `--redact`, so matched secrets are not printed back.
- This skill is a safety net for what gitleaks can't pattern-match; it does not
  replace the gate. Both run before every commit.
rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.Stars: 194kUpdated Claude CodeCodexVerifiedInstall