---
name: codefacts
description: Read and maintain repository knowledge stored as one fact per file in .codefacts.
---

# CodeFacts

Use `.codefacts/` as the repository's durable memory.

## Before changing code

Read the relevant files under `.codefacts/` before making architectural or cross-cutting changes.

## Writing facts

- Write exactly one fact per file.
- Store it at `.codefacts/<topic>/<short-slug>.md`; the directory is the topic.
- Start with one clear `# Title`, then explain what is true, why it is true, and any constraint future contributors must preserve.
- Keep facts concise, repository-specific, and version controlled.
- Update an existing fact instead of creating a duplicate.
- Never store secrets, credentials, access tokens, or personal data.

Choose the narrowest matching topic:

- `architecture` — system shape and major technical decisions
- `auth` — authentication, authorization, and identity
- `api` — endpoints, contracts, and external interfaces
- `data` — schemas, storage, migrations, and data flow
- `ui` — user interface, accessibility, and interaction patterns
- `security` — threat controls and sensitive boundaries
- `integration` — third-party services and cross-system behavior
- `infrastructure` — hosting, networking, and cloud resources
- `deployment` — builds, releases, environments, and delivery
- `testing` — test strategy, fixtures, and verification
- `performance` — measured limits, caching, and optimization
- `operations` — monitoring, incidents, support, and maintenance
- `workflow` — repository conventions and contributor processes
- `other` — fallback only when no topic above fits
