> ## Documentation Index
> Fetch the complete documentation index at: https://calendar-effects.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# CLAUDE.md

> Claude Code specifics

`CLAUDE.md` · chapter [Tests and team tooling](https://calendar-effects.mintlify.site/tour/10-tests-and-tooling.md), file 19 · 25 lines · [open in the repository](https://github.sfu.ca/aba395/Calendar-Effects/blob/main/CLAUDE.md)

## What it does

The full text is below.

## Source

```markdown title="CLAUDE.md" lines expandable theme={null}
@AGENTS.md
@docs/data-contracts.md

# Claude Code specifics

- **Start of session:** a hook prints `docs/STATUS.md`, the newest handoff notes, recent commits and uncommitted changes. Read them before starting work, and mention anything that affects the user's part of the project.
- **Who is the user?** Match `git config user.name` against the roster in AGENTS.md. If that doesn't settle it, ask once.
- **Team commands (project skills):**
  - `/sync`: pull teammates' changes and brief the user on what changed.
  - `/handoff [summary]`: end of session. It writes a handoff note, updates the user's row in STATUS.md, logs AI usage, commits those docs and asks before pushing.
  - `/decision [title]`: record a settled question in `docs/decisions/`.
- **Subagent `contract-checker`:** use it before committing code that reads or writes any dataset in `docs/data-contracts.md`, including the registries in `config/`. Its memory is committed, so what it learns reaches the whole team.
- **Path rules** in `.claude/rules/` load automatically for `etl/`, `config/`, `src/common/`, streaming and event-study code.
- **The user is learning.** Explain the why behind non-obvious code in plain words, and point out Spark or statistics concepts worth understanding. Every member must be able to explain their component in the cross-review and the AI Usage Report.
- **Memory hygiene:** auto memory stays on one machine. If something matters to the whole team, put it in AGENTS.md, a rule or a decision record. Personal preferences go in `CLAUDE.local.md` (gitignored).

## Enforced rules (AGENTS.md rules 6 and 8 to 12)

- **Tests gate every commit.** A `PreToolUse` hook (`.claude/hooks/pre-commit-tests.sh`, which Cursor runs too) runs `python3 -m pytest -q` before any `git commit` and blocks the commit if a test fails. It tests a copy of what the commit will contain, so each commit must work on its own: stage everything a change needs together, and run `git add` and `git commit` as separate commands (the hook refuses both in one). Read the failure: the tests name the file and line, what to import instead, or which ETL script to re-run. Fix the cause. Never edit or skip a test just to get a commit through, and never work around the hook.
- **Pushing and rollbacks (AGENTS.md rule 6).** You may push to `main` after the tests pass; then remind the user to tell the team, and write the handoff. If a push breaks `main` (tests fail, or the pipeline or a check fails), you may roll it back with `git revert <commit>` and push the revert, then tell the user whose change it undid and why. Ask before reverting a teammate's commit unless the user already asked you to. Never force push, and never `git reset` or rebase pushed commits.
- **Docs move with the code.** Before every commit run `python3 scripts/build_docs.py` and stage `docs-site/` with the change (the tests refuse a commit with stale docs). For a new file, first add it to its chapter in `docs-site/reading_order.json`; if a stage's purpose or reasons changed, update its chapter in `docs-site/tour/` outside the GENERATED markers. To answer questions about the codebase, the tour and the generated pages are the quickest map.
- **`# not-config: <reason>`** keeps a literal that only looks like config, such as pandas' month code `'M'`. Use it only when the value truly is not a ticker, event, year or path, give the reason, and mention it in the handoff note.
- **Read values, don't type them.** Before writing a ticker, event name, Wikipedia title, FRED series, year, date, data path, Kafka topic or server into code, find where it is defined (`config/`, `common.study`, `common.settings`, `common.contracts`) and import it. If the user asks for a new kind of list, propose a new `config/` CSV with a contract, a loader and tests.
- **New scripts follow the existing ones:** paths from `common.settings`, `require_contract` before every write, no `sys.path` changes, a docstring with how to run it and what it writes.
- **Teammates' files:** each script in `etl/` has an owner (`docs/etl-guide.md`). If a change has to touch someone else's script, keep their style, change only what is needed, and list the file under "needs from others" in the handoff note so its owner reviews it.
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.