This file governs how Claude operates in this repository. It overrides defaults where noted. For domain and architecture details, read the docs — not this file.
| Item | Reference |
|---|---|
| What ERE is | README.md |
| Architecture layers and patterns | docs/architecture/ERE-OVERVIEW.md |
| ERS–ERE interface contract | docs/ERS-ERE-System-Technical-Contract.pdf |
| Cosmic Python blueprint | docs/architecture/ERE-COSMIC-PYTHON-ARCHITECTURE.md |
| Current task | WORKING.md → docs/tasks/yyyy-mm-dd-*.md |
- Read
WORKING.md— it points to the current active task. - Read the referenced
docs/tasks/yyyy-mm-dd-*.mdfully (spec + history). - If the task file is missing, create it before doing anything else.
- Align changes with
README.mdintent anddocs/architecture/decisions.
The task file is a living document — update it as you progress, not only at the end. Record what you changed, why, what you learned, and what comes next.
Before planning or coding, load these skills from /.claude/skills/:
| Skill | When to apply |
|---|---|
stream-coding |
Primary workflow driver for all implementation |
cosmic-python |
Layer design, ports/adapters, SOLID enforcement |
bdd |
Scenario writing, step definitions, feature files |
gitnexus |
Codebase navigation, blast-radius analysis |
git-commit-and-pr |
Commit hygiene, PR narrative |
If a skill conflicts with the task file, the task file wins for that scope. If a skill conflicts with architecture constraints, stop and surface the conflict.
src/ere/
├── adapters/ # Infrastructure: Redis, cluster store, resolver strategies
├── entrypoints/ # Thin drivers: Redis pub/sub consumer
├── models/ # Domain models from erspec + ERE extensions (no I/O)
└── services/ # Use-case orchestration
test/
├── features/ # Gherkin BDD feature files
├── steps/ # pytest-bdd step definitions
└── test_data/ # RDF fixtures (Turtle)
docs/
├── tasks/ # yyyy-mm-dd-<task>.md — spec + engineering diary
└── architecture/ # ERE-OVERVIEW.md, sequence diagrams, ADRs
Repeat until the task-file acceptance criteria are all checked:
- Orient — re-read WORKING.md and the task file; identify the next smallest slice.
- Slice — define one vertical increment; state it in one sentence of domain language.
- Prove — write a failing test (unit) or scenario (BDD) first.
- Implement — minimal code to pass; stay within layer boundaries.
- Refactor — remove duplication, clarify naming, keep domain pure.
- Record — update the task file: slice / change / result / notes / next.
- Commit — small, coherent increment aligned with the slice. Never add coauthors or tool names in commit messages (e.g. claude, haiku, etc.).
If you cannot describe the slice in one sentence, it is too large.
Dependency direction is enforced at CI time via importlinter. Never violate it:
entrypoints → services → models
↘
adapters → models
-
models/— no framework imports, no I/O, no side effects. -
adapters/— infrastructure only; never callservices/. -
services/— orchestrate domain and adapters; never import fromentrypoints/. -
entrypoints/— parse input, call services, format output; no business logic. -
use best practices for OpenTelemetry and logging, but do not instrument prematurely — wait until a clear need arises to understand execution flows or debug issues.
Anti-patterns to refuse:
- I/O or framework imports inside
models/ - Business rules inside
adapters/orentrypoints/ - Magic strings or raw dicts where constants/enums belong
- Circular imports between layers or modules
- imports are not groupped in teh header of the module but are scattered across the code
- Unit tests per layer — each layer tests its own responsibility only.
- BDD for service use cases — feature files in
test/features/, steps intest/steps/. - TDD by default — write the failing test before the implementation.
- 80 %+ coverage target on new production code.
- Use
pytest-bddwithtarget_fixture(noctxdict); useparsers.rewhenparsers.parsecannot handle edge cases (empty strings, quoted numeric values).
Format: type(scope): concise description
Examples:
test(services): add BDD scenario for conflict detectionfeat(adapters): implement content-hash mock resolverrefactor(entrypoints): extract request validation to services
Never include co-author lines, tool names, agent names, or internal implementation details in commit messages. Focus on the what and why of the code change.
- Never stage or commit files you haven't modified — use
git add <file>to stage only your changes, orgit add -pto review hunks before staging. - Never revert or reset files outside your current task scope.
You may do without asking:
- Refactor for clarity within the current task scope
- Strengthen tests and BDD scenarios
- Extract ports/adapters when coupling appears
- Update the task file and README
You must not do without explicit instruction:
- Expand scope beyond WORKING.md
- Introduce speculative features
- Break architecture boundaries
- Make domain modelling decisions without evidence — ask first
A task slice is done when:
- Tests pass and coverage is meaningful for the new behaviour
- Layer boundaries are clean (no I/O in models, no business logic in entrypoints)
- Task file is updated (slice / change / result / notes / next)
- No silent TODOs — follow-ups are explicitly recorded
- Any non-trivial architectural decision is captured as an ADR-lite note
This project is indexed by GitNexus as ere-basic (344 symbols, 700 relationships, 16 execution flows).
GitNexus provides a knowledge graph over this codebase — call chains, blast radius, execution flows, and semantic search.
For any task involving code understanding, debugging, impact analysis, or refactoring, you must:
- Read
gitnexus://repo/{name}/context— codebase overview + check index freshness - Match your task to a skill below and read that skill file
- Follow the skill's workflow and checklist
If step 1 warns the index is stale, run
npx gitnexus analyzein the terminal first.
| Task | Read this skill file |
|---|---|
| Understand architecture / "How does X work?" | .claude/skills/gitnexus/exploring/SKILL.md |
| Blast radius / "What breaks if I change X?" | .claude/skills/gitnexus/impact-analysis/SKILL.md |
| Trace bugs / "Why is X failing?" | .claude/skills/gitnexus/debugging/SKILL.md |
| Rename / extract / split / refactor | .claude/skills/gitnexus/refactoring/SKILL.md |
| Tool | What it gives you |
|---|---|
query |
Process-grouped code intelligence — execution flows related to a concept |
context |
360-degree symbol view — categorized refs, processes it participates in |
impact |
Symbol blast radius — what breaks at depth 1/2/3 with confidence |
detect_changes |
Git-diff impact — what do your current changes affect |
rename |
Multi-file coordinated rename with confidence-tagged edits |
cypher |
Raw graph queries (read gitnexus://repo/{name}/schema first) |
list_repos |
Discover indexed repos |
Lightweight reads (~100-500 tokens) for navigation:
| Resource | Content |
|---|---|
gitnexus://repo/{name}/context |
Stats, staleness check |
gitnexus://repo/{name}/clusters |
All functional areas with cohesion scores |
gitnexus://repo/{name}/cluster/{clusterName} |
Area members |
gitnexus://repo/{name}/processes |
All execution flows |
gitnexus://repo/{name}/process/{processName} |
Step-by-step trace |
gitnexus://repo/{name}/schema |
Graph schema for Cypher |
Nodes: File, Function, Class, Interface, Method, Community, Process Edges (via CodeRelation.type): CALLS, IMPORTS, EXTENDS, IMPLEMENTS, DEFINES, MEMBER_OF, STEP_IN_PROCESS
MATCH (caller)-[:CodeRelation {type: 'CALLS'}]->(f:Function {name: "myFunc"})
RETURN caller.name, caller.filePath