agentleFS
wanwrickwanwrick/noosphere-public/scripts/CLAUDE.md

noosphere-public / scripts

CLAUDE.md0 starsChanged 7 months agoMITView on GitHub

Executable gates. Nothing here is documentation; every file either blocks a commit or reports a verdict. lint_sanitization.sh and sanitize_from_notion.py both need a banned-token lexicon, and it is not in this repository. It enumerates the employer, team, vendor, and stakeholder proper nouns it exists to suppress, so committing it to a public repo would publish exactly that list. Bootstrap once per clone: Load order: $NOOSPHERE_LEXICON, then .sanitization-lexicon.local, then .sanitization-lexicon.example. Falling through to the example prints a loud NOT-PROTECTED banner — it…

The file

We split this CLAUDE.md into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Add --files-only to report offending paths without echoing the pattern or the matched line — use it anywhere the output is public, such as …

    line 65

≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

Scripts — Routing

Executable gates. Nothing here is documentation; every file either blocks a commit or reports a verdict.

FilePurpose
lint_sanitization.shInvariant #0 — banned-token guard over the working tree; loads a gitignored lexicon
lint_pii.pyPersonal-data guard: email, phone, SIN/SSN, card, IP, address, DOB, ID numbers
sanitize_from_notion.pyRewrites private-source content into placeholder form; same lexicon
verify_all.shRunner for the 10 verification checks; non-zero exit on any FAIL
verify/The 10 checks themselves

The lexicon (read this first)

lint_sanitization.sh and sanitize_from_notion.py both need a banned-token lexicon, and it is not in this repository. It enumerates the employer, team, vendor, and stakeholder proper nouns it exists to suppress, so committing it to a public repo would publish exactly that list. Bootstrap once per clone:

cp .sanitization-lexicon.example .sanitization-lexicon.local
# then replace the placeholders with your real terms

Load order: $NOOSPHERE_LEXICON, then .sanitization-lexicon.local, then .sanitization-lexicon.example. Falling through to the example prints a loud NOT-PROTECTED banner — it never silently passes. Pass --require-real-lexicon to fail instead. The canonical copy lives in noosphere-private; CI reads it from the SANITIZATION_LEXICON repo secret.

The PII rules (tracked, unlike the lexicon)

lint_pii.py reads .pii-patterns and .pii-allowlist, and both are committed. That looks inconsistent with the lexicon rule above until you see what each file holds.

LexiconPII rules
ContainsThe actual proper nounsGeneric format regexes
Publishing itPublishes exactly what it protectsReveals nothing
A fork getsNothing until it bootstrapsWorking protection immediately

"An email address shaped like x@y.z" identifies nobody. Tracking the rules is the only way a template repo protects the people who fork it.

Each rule carries a canary the pattern must match, verified at load. A regex typo compiles fine and then matches nothing, so the gate reports clean while protecting nothing — a silent failure indistinguishable from success. A rule that fails its canary is a hard error. Same discipline as the lexicon.

Allowlist entries match the matched text, not the line, so a line carrying both a documentation IP and a real one still fails. Full procedure and triage table: Workflows/pii-audit-pass.md.

Run the gates

bash scripts/lint_sanitization.sh --require-real-lexicon   # Invariant #0, fast
python3 scripts/lint_pii.py                                # personal data, fast
bash scripts/verify_all.sh                                 # all 10 checks, what CI runs

Add --files-only to report offending paths without echoing the pattern or the matched line — use it anywhere the output is public, such as CI logs.

lint_sanitization.sh needs ripgrep. 06/07 need pyyaml. lint_pii.py needs only the standard library. 04 needs the databricks CLI plus pytest; it prints SKIP when either is absent rather than failing.

The 10 checks

CheckAsserts
verify/01_token_budget.shRoot CLAUDE.md ≤600 tokens, estimated as LC_ALL=C wc -w × 1.3
verify/02_routing.shEvery backticked path in root CLAUDE.md exists on disk
verify/03_skill_invocation.shEvery name under the root ## Skills heading resolves to .claude/skills/<name>/SKILL.md, or to one of the three subagents in .claude/agents/
verify/04_dabs_end_to_end.shDABs subproject validates and its unit tests pass
verify/05_attribution_lint.shInvariant #3 — every ip/curated/*.md carries a Source callout
verify/06_governance_gate.pyEvery regulated: true archetype declares dpia_required and dpia_completed explicitly
verify/07_ip_coverage.pyInvariant #1 — every archetype names ≥1 IP file, and every slug resolves
verify/08_sanitization_audit.shWraps lint_sanitization.sh
verify/09_diagram_coverage.shEvery diagram declared in methodology/diagram-generation.md exists in _Diagrams/
verify/10_pii_scan.pyNo personal data in the working tree; wraps lint_pii.py --files-only

Editing root CLAUDE.md

Checks 01–03 make the root file the most constrained file in the repo. Before committing a change to it:

  1. Budget. The file sits close to the cap. Every added word costs a removed word. Note that wc -w counts a standalone · as a word.
  2. Routing. Any backticked token ending in .md, .sh, .py, .yaml, .yml, .json, or / must exist. Add the target file before the route.
  3. Skills. Under the ## Skills heading, backtick only real skill or subagent names. Check 03 reads that section literally.

Then run bash scripts/verify_all.sh and confirm 10 pass · 0 fail.

Adding a check

Drop verify/<NN>_<name>.{sh,py} in, add it to the CHECKS array in verify_all.sh, and log the addition per _Logs/CLAUDE.md. Shell checks are invoked with bash, Python with python3; both receive ROOT. Exit non-zero to fail. Print SKIP: and exit 0 when a tool is genuinely unavailable.

Wired into

.pre-commit-config.yaml (sanitization lint + PII lint + gitleaks + hygiene hooks), .github/workflows/sanitization.yml (banned-token guard + PII guard + gitleaks), .github/workflows/verify.yml (all 10 checks). Both workflows run on pull requests to main and pushes to main.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.