CLAUDE.md
claude.md/CLAUDE.mdCLAUDE.md
Quality
71/100
Scores the file, not the repository.Length
752 words
13 headings · 0 code blocksRepository
0
— · pushed 58 days agoLast changed
3 days ago
First indexed 3 days ago.1# CLAUDE.md23Coding rules for any AI agent (Claude Code, Claude Desktop, Cursor, etc.)4working in this repository. Follow every time without exception.56## Module headers78Every Python module starts with:910\`\`\`11"""12Role: <one line, what this module is>13Description: <a few lines, what it does and important details>14Author: Bor15"""16\`\`\`1718Do not change the Author field.1920## Prose style2122No em dashes anywhere. Not in code, comments, docstrings, log messages,23commit messages, or Markdown. Use a comma, a colon, or two sentences.2425No semicolons in prose. Code semicolons follow Python rules.2627Short scientific sentences. No throat-clearing. Forbidden filler:28"now", "let's", "we'll", "here we", "essentially", "basically",29"simply", "just". If a comment says "now do X", delete "now".3031## Comments3233Comments explain what is not obvious from the code. They never restate34the code in English.3536No section dividers like `# ---- Auth ----` or `# ===== Fetch =====`.37Function names and module structure are the dividers.3839No step narration like `# 1. authenticate`, `# 2. fetch`. The log lines40already announce these steps at runtime.4142If a comment exists, it earns its space.4344## Logging4546Use `from spw_attrib.logger import get_logger; log = get_logger(__name__)`.4748Never use `print()` in library or diag code. Logger only.4950Format with `%s` placeholders, not f-strings, so the logger can51lazy-format and so structured log backends work.5253`log.info` for milestones, `log.warning` for recoverable issues,54`log.error` for failures.5556## Naming5758Functions describe what they do, not how. `fetch_frames` not59`do_api_fetch`. `enrich_irbem` not `process_with_model`.6061Private helpers prefix with `_`.6263Constants in module scope are UPPER_SNAKE_CASE.6465## Imports6667Standard library, then third-party, then `spw_attrib.*`. Blank line68between groups. One import per line. No `from x import *`.6970## Type hints7172Modern syntax: `list[int]`, `dict[str, float]`, `int | None`.7374Type all public function signatures. Internal helpers may skip when75types are obvious from a one-line body.7677## Errors7879Never silently swallow errors. Catch what you can act on, log the rest,80re-raise when in doubt.8182Library code does not exit the process. Only entry-point scripts may83call `sys.exit`.8485## Tests8687Tests live in `tests/`, mirror the source layout. Plain `pytest`.8889Test names describe behaviour, not the function:90`test_engine_attributes_saa_proton_as_environmental` rather than91`test_attribute`.9293## Things never to do9495- Emoji in code, comments, or commit messages.96- ASCII art banners.97- Unicode smart quotes or fancy bullets in code or docs.98- Placeholder TODOs without an attached GitLab issue number.99- Modify rule confidences in `attribution/engine.py` without re-running100 FLP validation against Noeldeke 2017.101- Modify the import order in `radiation/irene.py` (the order is102 load-bearing for the Fortran library).103- Modify the WGS84 conversion in `ephemeris/coords.py` without104 re-running the FLP onboard-truth check.105106## Defaults and missing data107108A silent default is a lie. If a value cannot be retrieved or computed, the109right behaviour is one of these, in this preference order:1101111. Return `None` or `pd.NA` and let the caller decide.1122. Raise an explicit exception with a message naming the missing input.1133. Log a WARNING and return a sentinel only when the caller has documented114 that it accepts and handles the sentinel.115116Never do any of these:117118- Substitute a "reasonable" value (e.g. `Dst = 0`, `Bz = 0`, `Kp = 2`) when119 the real value is missing. Reasonable values mask gaps in input data and120 produce attribution verdicts that look defensible but are computed from121 fiction.122- Use `dict.get(key, fallback)` for scientific quantities. Use123 `dict.get(key)` and let `None` propagate, or check membership and raise.124- Wrap a computation in `try/except Exception: return default_value`.125 Catch only the specific error class you expect, and only when the126 recovery path is documented.127- Fill NaN columns with zero before a statistic. `df.fillna(0).mean()`128 hides missing data inside the mean. Use `df.mean(skipna=True)` and log129 the gap count, or `df.dropna()` and report `n_valid`.130131There is one explicit exception: a function may have a "quiet baseline"132mode where defaults are used deliberately and named in the function133signature. `enrich_density` does this for the NRLMSIS quiet comparison.134The defaults are bound by an argument default or a documented module135constant, and the calling code is explicit about choosing the quiet mode.136Quiet defaults that exist only inside a fallback path do not qualify.137138When you see a default that fails this test, raise an issue, do not fix139silently. The fix changes behaviour and needs an explicit review.140141## When in doubt142143Ask. Do not invent a convention. If a file in the repo contradicts144these rules, the file is wrong. Fix it, do not copy it.145
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| Adit-Jain-srm/NightmareNetCLAUDE.md · 45 | CLAUDE.md | buildtestlint-formatstyle+6 | 100/100 | 3 days ago | |
| dotCMS/corecore-web/CLAUDE.md · 949 | CLAUDE.md | teststylearchtesting-strategy+3 | 100/100 | 3 days ago | |
| dotCMS/coreCLAUDE.md · 949 | CLAUDE.md | setupbuildteststyle+7 | 99/100 | today | |
| dotCMS/corecore-web/libs/sdk/react/CLAUDE.md · 949 | CLAUDE.md | setupbuildtestlint-format+9 | 97/100 | 3 days ago | |
| modelcontextprotocol/serversCLAUDE.md · 89k | CLAUDE.md | setupbuildtestlint-format+6 | 97/100 | 3 days ago | |
| luongnv89/claude-howtovi/CLAUDE.md · 41k | CLAUDE.md | setupbuildtestlint-format+8 | 97/100 | 3 days ago | |
| dotCMS/corecore-web/libs/sdk/client/CLAUDE.md · 949 | CLAUDE.md | setupbuildtestlint-format+9 | 97/100 | 3 days ago | |
| supabase/supabase.claude/CLAUDE.md · 108k | CLAUDE.md | testlint-formatstylearch+1 | 97/100 | 3 days ago |
