Index of every page on this site: llms.txt
All skills
saadaan-hassan avatar

/pre-merge-check

@4a1a53e
Run it yourself

Runs a pre-merge security and hygiene sweep on staged or changed code before opening or merging a pull request, scans for hardcoded secrets and credentials, checks dependencies for known vulnerabilities using whatever scanner fits the project (npm/pnpm/yarn audit, pip-audit, govulncheck, cargo-audit), and flags debug leftovers and unresolved TODOs. Use whenever the user says "is this ready to merge", "check this PR", "review before I push", "did I leave any secrets in this", or asks for a security pass on their changes. Trigger this proactively before you yourself open a PR on the user's behalf.

Use this Skill: https://skilld.dev/gh/saadaan-hassan/baseline-skills/pre-merge-check

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈155 tokens for metadata: the name and description. ≈877 when used: this file.

Description uses 7.8% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈620 characters, or 7.8%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

Pre-Merge Check

A five-minute sweep that catches the mistakes everyone makes under deadline pressure: a forgotten console.log(apiKey), a dependency with a known CVE, a TODO that quietly became permanent. None of it replaces real code review, it's the mechanical part review shouldn't have to be.

Step 1: secrets scan

Prefer a real scanner if one is installed:

which gitleaks && gitleaks protect --staged --verbose   # if installed
which trufflehog && trufflehog git file://. --since-commit HEAD --only-verified  # if installed

If neither is available, use the bundled fallback:

python3 <skill_dir>/scripts/scan_secrets.py          # scans staged git diff
python3 <skill_dir>/scripts/scan_secrets.py <path>   # scans a file or directory instead

It's a regex scanner, real but not exhaustive, treat any finding as worth a second look rather than an automatic false alarm, and don't treat a clean result as a guarantee. Findings are redacted in the output; if something looks like a real secret, the fix is to rotate it, not just delete the line.

Step 2: dependency vulnerability check

python3 <skill_dir>/scripts/check_dependencies.py <project_path>

This detects the project's ecosystem from its manifest file and runs the matching scanner if it's installed (npm audit, pnpm audit, yarn audit, pip-audit, govulncheck, cargo-audit). Read the result carefully:

  • "available": false means the tool isn't installed, hand the user the install_hint rather than silently treating it as "no vulnerabilities." Those are different things.
  • "has_critical_or_high": true/false is only trustworthy when it came from parsed structured output. If you see "severity_undetermined" or "severity_method": "text-heuristic" in the result, read raw_output yourself and judge it, don't repeat the boolean as fact.

Step 3: quick hygiene pass

On the changed files (git diff --cached --name-only, or the relevant diff if you're reviewing a PR that isn't staged locally), check for:

  • Debug leftovers: console.log, print(, debugger, pdb.set_trace(), dd(, var_dump depending on language, judge by what's actually in the diff, not a fixed list.
  • Commented-out code blocks that look abandoned rather than intentionally documented.
  • TODO/FIXME comments with no ticket/issue reference nearby, worth a mention, not a blocker on their own.

This step doesn't need a script, grep the diff and use judgment; a TODO inside a test fixture is not the same problem as one inside error handling for a payment flow.

Step 4: report back, don't gate silently

Summarize findings by severity, not just a raw list: secrets and critical/high dependency issues first, hygiene notes last. If everything's clean, say so briefly, don't pad a clean result with caveats to seem thorough. If something needs a person's judgment (a finding that might be a false positive, an unavailable scanner), say exactly that rather than guessing on their behalf.

Ground rules

  • Never auto-fix a finding by deleting evidence (e.g. removing a line with a real secret) without telling the user, rotation comes first, then cleanup.
  • Don't block a merge yourself, you're not the CI system, surface findings clearly enough that the human or the actual CI gate can decide.
  • If both a real scanner and the bundled fallback are available, run the real one, the fallback exists for when nothing else is installed, not as a first choice.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts2mo3 checks · Risk SAFE
  • Gen Agent Trust Hub2mo

    The skill is a security and hygiene utility designed to perform pre-merge checks on source code. It uses local tools such as git and various package manager audit commands to detect hardcoded secrets and dependency vulnerabilities. The included Python scripts are well-structured, use standard libraries, and follow safe practices like redacting detected secrets in output. No malicious patterns or security risks were identified.

  • Socket2mo

    No alerts

  • Snyk2mo

    Risk: LOW · No issues

Signed by skilld at 4a1a53e. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 months ago.

Steadyupdated 2 months ago

README badge

README badge for saadaan-hassan/baseline-skills/pre-merge-check