/finance-guru:compliance-scanfrom Finance Guru
Scans a repository for leaked secrets, PII, untracked sensitive files, and gitignore gaps before push. Runs seven detection layers including API tokens, account numbers, and owner-name leaks.
Ships in Finance Guru. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
The repo's last line of defense before something compromising hits GitHub. Layered scanner that runs the existing privacy tests, looks for new patterns of leakage, and (optionally) wires itself into git push so a failed scan blocks the push.
Trigger on any of these phrases — and proactively before any push that touches .claude/skills/, scripts/qa/, PRIVACY.md, .gitignore, notebooks/, or fin-guru/data/:
| # | Layer | Owner |
|---|---|---|
| 1 | Owner-name leak detector | reuses tests/python/test_no_hardcoded_references.py |
| 2 | Gitignore-coverage integration test | reuses tests/integration/test_gitignore_protection.sh |
| 3 | CRITICAL secret patterns (AWS/GitHub/Anthropic/OpenAI/Slack/JWT/private-key/Google API) | scripts/scan.py |
| 4 | HIGH PII patterns (account numbers, dispatcher URLs, SSNs, owner email) — sourced from scripts/qa/pii-replacements.txt plus built-ins | scripts/scan.py |
| 5 | Untracked files in sensitive paths (.claude/skills/, notebooks/, fin-guru-private/, .env*) | scripts/scan.py |
| 6 | PRIVACY.md "never leaves your machine" alignment with .gitignore | scripts/scan.py |
| 7 | Household financial figures in tracked docs (precise currency amounts) | scripts/scan.py |
references/DataClassification.md is the authority on which values may enter a
tracked file. Read it before adding a number, a name, or a fixture to any
committed file. The short version: this repo is public, code and docs describe
behaviour rather than carrying values, and evidence belongs in a document as a
percentage or ratio rather than an amount.
Default policy:
| Severity | Examples | Behaviour |
|---|---|---|
| CRITICAL | API tokens, private keys, AWS access keys | fail — exit 1, block push |
| HIGH | Account numbers, dispatcher URLs, SSNs, owner email, household financial figures | fail — exit 1, block push |
| MEDIUM | Owner first/last name in non-allowed file | report — does not fail |
| INFO | Untracked file in sensitive path, PRIVACY/.gitignore drift | report — does not fail |
Override with --fail-on CRITICAL for "secrets only" mode or --fail-on INFO for the strictest posture.
git commit).claude/skills/compliance-scan/scripts/scan.py --scope staged
.claude/skills/compliance-scan/scripts/scan.py --scope push
.claude/skills/compliance-scan/scripts/scan.py --scope tree
.claude/skills/compliance-scan/scripts/scan.py --scope tree --remediate gitignore
The remediation flag is conservative: it only touches .gitignore, only appends to it, and only for paths that match a known-sensitive prefix (.claude/skills/, notebooks/, fin-guru-private/, .env*). Idempotent — re-running won't create duplicate entries.
--format text # default, human-readable
--format json # machine-readable; pipe to jq
--format md # markdown report (use for PR descriptions)
Install once per clone:
.claude/skills/compliance-scan/scripts/install-pre-push.sh
This drops a .git/hooks/pre-push that runs --scope push. Failed scans block the push. Bypass for a one-off (you'll be asked why) with git push --no-verify — but this should be rare and called out in the commit message.
The hook is local to your clone (git hooks are not versioned). Re-run the installer after git clone on a new machine. The installer is idempotent.
Some PII is deliberately committed (e.g., a golden test fixture captured from a real production run). Suppress these via .claude/skills/compliance-scan/allowlist.json:
{
"allow": [
{
"path": "tests/python/fixtures/fidelity_history_golden_expected.json",
"reason": "Golden test fixture captured from real Fidelity history import",
"approved_by": "ossie",
"date": "2026-05-16"
}
]
}
path is a fnmatch glob (tests/**/golden_*.json works). An entry with only a path makes matching files skip the secret and PII pattern scans (layers 3 and 4). The layer 7 financial-figure check still runs. An entry that also sets rule (a built-in pattern name such as bright-data-token) and match_sha256 (the first 32 lowercase hex characters of the SHA-256 of each exact match, from printf %s '<match>' | shasum -a 256 | cut -c1-32) suppresses only those matches, so every other secret and PII check still runs on the file. Use the scoped form only for a public false positive, such as a release checksum. The policy file holds digests, never the matched text, and the scan checks the policy file itself like any other file. An entry with only one of the two, with either set to null or empty, with a digest that is not 32 hex characters, or with a raw values list fails the scan with exit code 2. So does a rule that is not a built-in pattern, because a pii-replacements rule name holds private text. Use a path-only entry for those. Invalid JSON or a wrong policy shape also exits 2. No entry can exempt the policy file itself. The staged scan reads the policy and the files from the index, the push scan reads both from the outgoing commit (HEAD), the history scan reads the policy from HEAD, and the tree scan reads the working tree. Every entry needs a reason, an approver, and a date — that's the audit trail. Don't allowlist a path unless the value being shielded is genuinely meant to stay committed; for "I'll fix it later" use the private-fixture pattern instead (see references/test-pii-pattern.md).
When --remediate gitignore is set, for each untracked file found in a sensitive path that is not currently gitignored, the scanner:
.claude/skills/, the file itself for .env*, etc.)<path>/ to .gitignore under a # Compliance scan auto-remediation block, creating the block if absentgit check-ignore to verify the path is now shieldedThe scanner never deletes, redacts, or rewrites files containing detected secrets — that's your call. It only silences future commits of paths that should already be private.
User intent: "is this safe to push?" / "compliance scan"
│
├─ Has uncommitted work?
│ ├─ Yes → run --scope staged first; if clean, also run --scope tree to catch untracked files
│ └─ No → run --scope push
│
├─ Findings of severity ≥ HIGH?
│ ├─ Yes → STOP. Show the findings. Do NOT auto-fix CRITICAL/HIGH (those need human judgment).
│ │ Suggest:
│ │ - For CRITICAL: rotate the leaked secret, then either drop the commit or rewrite history (heavy hammer — confirm explicitly).
│ │ - For HIGH: replace with template variable / env var / placeholder; re-stage; re-scan.
│ └─ No → continue
│
├─ INFO finding "untracked sensitive path"?
│ ├─ Yes → Confirm with user: "Add `<path>/` to .gitignore?"
│ │ On yes, re-run with --remediate gitignore.
│ └─ No → done
│
└─ Report PASS with the verdict line from the scanner output
Layers 1 and 2 are the existing tests. The scanner shells out to them as a single orchestration step:
uv run pytest tests/python/test_no_hardcoded_references.py -q --no-cov
bash tests/integration/test_gitignore_protection.sh
If those tests change shape (e.g., new fixtures), the scanner picks up the change automatically — no skill update required.
See references/secret-patterns.md for the full list of detected patterns, why each matters, and how to remediate when one fires.
Currently shielded prefixes (extend in scripts/scan.py:SENSITIVE_PATH_PREFIXES):
.claude/skills/apps-script-run/ and any other skill with apps-script, dispatcher, or webhook in the namenotebooks/ (entire tree — financial CSVs)fin-guru/data/ (except whitelisted methodology files)fin-guru-private/.env, .env.*, *.envcredentials/, private/, sensitive/*.key, *.pemReads PRIVACY.md, finds the "What never leaves your machine" section, extracts each bullet, and verifies the corresponding pattern is in .gitignore. Misalignment is INFO severity and lists the missing pattern.
scripts/qa/pii-replacements.txt with git-filter-repo (a separate, destructive workflow documented in .planning/phases/01-git-history-scrub-security-foundation/).uv run pip-audit.SKILL.md — this filescripts/scan.py — Python 3 scanner; no third-party deps; runnable as ./scan.pyscripts/install-pre-push.sh — idempotent installer for the git hookreferences/secret-patterns.md — full pattern catalog with remediation guidancereferences/severity-guide.md — when to escalate, when to ignoreThe installed pre-push hook also runs the review gate (~/.agents/skills/review-gate/SKILL.md), after the privacy scans:
~/.agents/skills/review-gate/scripts/review-receipt.ts present and bun on PATH, the hook execs review-receipt.ts gate: the .review-gate check list runs on a clean tree at HEAD (or a green receipt for HEAD is reused), then a recorded second-model diff review with every Act On item closed is required. REVIEW_GATE_OFF=1 is the operator's switch and is honored by that tool..review-gate list itself, one command per line with stdin on /dev/null; no receipt is recorded and no review is required. An empty list blocks the push; a missing .review-gate skips the gate with a warning (the installer warns about that at install time too).Existing clones pick this up only after re-running scripts/install-pre-push.sh.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub aojdevstudio/finance-guru --plugin finance-guru18 skills in this plugin
/dividend-trackingRefresh the local DB, then read and analyze DIVIDEND rows from family_office.db for Layer 2 income tracking. Sync-first so dividend income is never stale; symbol resolution for null tickers is handled in the activities sync. Triggers on sync dividends, update dividends, dividend tracker, layer 2 income, or monthly dividend analysis./finance-reportGenerate institutional-quality PDF analysis reports for stocks and ETFs. USE WHEN user mentions generate report, create pdf, stock analysis, ticker report, watchlist analysis, OR regenerate reports. Includes VGT-style headers, embedded charts, portfolio sizing, and Perplexity sentiment integration./fin-coreFinance Guru™ Core Context Loader
Auto-loads essential Finance Guru system configuration and user profile at session start.
Ensures complete context availability for all financial operations.
/fin-guru-checklistRun a pass or fail checklist from fin-guru/checklists/ against a deliverable, such as the margin strategy, dividend framework, or cash-flow policy checklist. Use when a deliverable needs a final quality gate or the owner asks whether an analysis is complete. Not for a full compliance review with ITC risk (use fin-guru-compliance-review)./fin-guru-compliance-reviewCompliance review of a Finance Guru deliverable or a proposed position. Checks disclaimers, source citations, and risk disclosures, and runs the ITC market-implied risk check with decision rules DR-1 to DR-5. Use when an analysis or buy ticket is about to be final, or when the owner asks whether a position passes risk review. Not for scanning the repository for secrets or PII before a push (use compliance-scan)./fin-guru-create-docWrite a Finance Guru document from a template in fin-guru/templates/, such as an analysis report, buy ticket, compliance memo, Excel model spec, presentation, or onboarding report. Use when finished analysis must become a dated file in analysis/ or tickets/. Not for the analysis itself (use fin-guru-quant-analysis or fin-guru-research) or a PDF ticker report (use finance-report).Other plugins' skills for the same job