---
description: Repository-wide AI collaboration defaults shared across the codebase
globs:
alwaysApply: true
---

<!-- Generated by scripts/generate_ai_collab_docs.py. Edit metadata in that script. -->

# Cursor Rule: Repository AI Collaboration

- Read the nearest `AGENTS.md` and `CLAUDE.md` files first. Treat them as the
  primary shared instruction source for this repository.

- Keep the repository hard rules visible in those primary docs: English-only
  code-facing text, no hardcoded user-facing strings or secrets, and
  shared-contract doc updates in the same change.

- Use `ARCHITECTURE.md`, `PLANS.md`, and `docs/engineering-baseline.md`
  together: architecture map, ExecPlan spec, and stable engineering handbook.

- Inspect the existing implementation, adjacent call sites, and the nearest
  tests before making code changes.

- Reuse existing abstractions wherever practical instead of building parallel
  helpers, request paths, stores, or provider layers.

- For complex design work, create an ExecPlan under `docs/exec-plans/active/`
  and maintain it according to `PLANS.md`.

- Keep generated knowledge artifacts in sync by running
  `python scripts/build_repo_knowledge_index.py` after docs structure or
  metadata changes.

- Before committing, review the touched `AGENTS.md` and `CLAUDE.md` files and
  update any stale guidance in the same change.
