{"data":{"slug":"discovered-b81996043613697266751b488746c2f46aac1e1e5ae329fb","title":"Final Check \u2014 Executable Validator","summary":"Runs a final validation script before task completion, blocking on critical or high-severity findings. Ensures no hardcoded secrets, RCE risks, or SQL injection in the codebase.","url":"https:\/\/skillshunter.net\/skills\/discovered-b81996043613697266751b488746c2f46aac1e1e5ae329fb","json_url":"https:\/\/skillshunter.net\/api\/public\/v1\/skills\/discovered-b81996043613697266751b488746c2f46aac1e1e5ae329fb","markdown_url":"https:\/\/skillshunter.net\/skills\/discovered-b81996043613697266751b488746c2f46aac1e1e5ae329fb.md","download_url":"https:\/\/skillshunter.net\/skills\/discovered-b81996043613697266751b488746c2f46aac1e1e5ae329fb\/download","category":{"slug":"software-development","name":"Software & Development"},"editor_note":"The script must be run before completing any task and cannot be bypassed. It checks all staged, unstaged, and untracked files for security and quality issues. Use `npx tsx .claude\/hooks\/final-check.ts` to execute it. Exit code 1 indicates a block; re-run after fixing issues.","instructions":"---\nname: final-check\nversion: 2.0.1\ndescription: Final validator with VETO power. Now executable \u2014 runs `npx tsx .claude\/hooks\/final-check.ts` to scan for debug statements, secrets, .skip, any, RCE risks, SQL concat. Blocks completion on CRITICAL\/HIGH findings.\n---\n\n# Final Check \u2014 Executable Validator\n\n**ALWAYS run BEFORE completing ANY task. HAS VETO POWER.**\n\n> v2.0+ promotes this from a manual checklist to an executable script. The script never trusts memory.\n\n## How to Run\n\n```bash\nnpx tsx .claude\/hooks\/final-check.ts\n```\n\nExit codes:\n- `0` \u2014 clean (or only LOW\/MEDIUM warnings)\n- `1` \u2014 at least one CRITICAL or HIGH finding \u2192 **task blocked**\n\n## What It Scans\n\nFor every file in the diff (staged + unstaged + untracked) matching the active stack's source extensions, every line is checked against:\n\n| Severity | Rule | Why blocking |\n|---|---|---|\n| CRITICAL | Hardcoded secret pattern (api key \/ token \/ password) | Leak risk |\n| CRITICAL | Public env var with `*SECRET\\|*TOKEN\\|*PRIVATE\\|*PASSWORD\\|*CREDENTIAL` | Bundles into client |\n| HIGH | Arbitrary code-execution function (`eval`, Python `exec`) | RCE |\n| HIGH | `subprocess` with `shell=True` (Python) | Command injection |\n| HIGH | SQL string concatenation \/ f-string SQL | SQL injection |\n| HIGH | `it.only` \/ `test.only` \/ `describe.only` \/ `it.skip` in committed test | False green CI |\n| MEDIUM | `console.log\/debug\/trace` outside tests | Debug leftover, log noise |\n| MEDIUM | PHP `var_dump\/dd\/dump\/print_r` | Debug leftover |\n| MEDIUM | TypeScript `any` (without `\/* ok *\/` escape) | Erodes strict mode |\n| MEDIUM | `@ts-ignore` (use `@ts-expect-error` with comment) | Silently outdated |\n| MEDIUM | `@pytest.mark.skip` | Hidden test gaps |\n| LOW | `print()` outside tests (Python) | Use logger |\n| LOW | TODO \/ FIXME \/ XXX \/ HACK | Track or remove |\n\nLines containing recognised placeholders (`<your...>`, `YOUR_X`, `placeholder`, `example.com`, `sk_test_`) are skipped to avoid false positives in `.env.example` and docs.\n\n## Workflow\n\n```\n1. Implementation done\n2. Run npx tsx .claude\/hooks\/final-check.ts\n3. If exit 1 \u2192 fix, re-run\n4. If exit 0 \u2192 proceed to quality-gate \u2192 commit\n```\n\n## Suppressing False Positives\n\nWhen a finding is intentional (e.g. an `any` in well-justified glue code):\n\n```ts\nconst result = (json as any) \/* ok: external lib without types *\/;\n```\n\nOnly `\/* ok *\/` immediately after `: any` is recognised. For other rules, refactor \u2014 there is no general-purpose suppression by design.\n\n## Hook Wiring (Optional)\n\nTo run automatically on Stop, add to `.claude\/settings.json`:\n\n```json\n{\n  \"hooks\": {\n    \"Stop\": [{\n      \"matcher\": \"*\",\n      \"hooks\": [{ \"type\": \"command\", \"command\": \"npx tsx ${CLAUDE_PROJECT_DIR}\/.claude\/hooks\/final-check.ts\" }]\n    }]\n  }\n}\n```\n\nThe default Stop is `stop-validator.ts` (git\/branch\/CLAUDE.md\/secret scan). `final-check.ts` is complementary \u2014 runs before it as a code-quality gate.\n\n## Rules\n\n1. **VETO POWER** \u2014 exit 1 blocks task completion\n2. **NEVER skip** \u2014 `--no-verify` style bypasses are forbidden\n3. **RE-RUN after fixes** \u2014 don't trust memory\n4. **One finding at a time** \u2014 fix CRITICAL first, then HIGH\n5. **Refactor over suppress** \u2014 `\/* ok *\/` is for extraordinary cases\n\n## See Also\n\n- `dead-code-hygiene` \u2014 remove unused legacy\/inert paths after replacements (run before this scan)\n- `quality-gate` \u2014 typecheck\/lint\/test\/build (different scope)\n- `security-baseline` \u2014 what the secret\/RCE rules enforce\n- `stop-validator.ts` \u2014 git\/branch\/docs gate (sibling, complementary)\n","use_cases":["Preventing hardcoded secrets from being committed","Blocking arbitrary code execution functions like `eval`","Detecting SQL injection risks through string concatenation","Ensuring no test-only code is committed with `it.only` or `test.only`","Identifying and removing debug statements outside of tests"],"limitations":[],"compatibility":[],"setup_tip":null,"sample_input":null,"sample_output":null,"source_url":"https:\/\/github.com\/0x57-1\/start-vibing-stacks\/blob\/6e398b34c4dfe73ac8f809216b218856b8e02ff4\/stacks\/_shared\/skills\/final-check\/SKILL.md","source_commit":"6e398b34c4dfe73ac8f809216b218856b8e02ff4","license":null,"version":null,"listing_approved_at":"2026-12-03","created_at":"2026-12-02T09:11:14.000000Z","updated_at":"2026-12-03T16:20:08.000000Z","seo_title":"Final Check \u2014 Executable Validator for Code Quality and Security","seo_description":"A final validation script that blocks task completion on critical or high-severity issues, ensuring no hardcoded secrets, RCE risks, or SQL injection in the codebase.","seo_keywords":["code validation","security check","final check script","prevent hardcoded secrets","block task completion","code quality gate","RCE detection","SQL injection prevention"]}}