compass
CLAUDE.md72 starsChanged 5 years agoApache-2.0View on GitHub
Compass is a context engine that builds temporal knowledge graphs. Written in Go (1.25+), it uses PostgreSQL with pgvector, pg_trgm, and tsvector extensions. Single binary with no external dependencies beyond Postgres. Proto definitions live in a separate repo: raystack/proton (at ../proton relative to compass). Never edit files in gen/ directly. Workflow for API changes: 1. Edit proto definitions in the proton repo first 2. Regenerate: buf generate ../proton --template buf.gen.yaml --path raystack/compass 3. Update compass handler/service code to match Alternative:…
The file
We split this CLAUDE.md into the rules it gives an agent
3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 14
Update compass handler/service code to match
- Distinctive: line 60
Add Elasticsearch, Kafka, or other infrastructure dependencies -- Postgres only
- Very specific: line 61
Use User or Caller naming -- the identity type is Principal
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CLAUDE.md
Project Overview
Compass is a context engine that builds temporal knowledge graphs. Written in Go (1.25+), it uses PostgreSQL with pgvector, pg_trgm, and tsvector extensions. Single binary with no external dependencies beyond Postgres.
API Development Workflow
Proto definitions live in a separate repo: raystack/proton (at ../proton relative to compass). Never edit files in gen/ directly.
Workflow for API changes:
- Edit proto definitions in the proton repo first
- Regenerate:
buf generate ../proton --template buf.gen.yaml --path raystack/compass - Update compass handler/service code to match
Alternative: make proto fetches proton from GitHub using the PROTON_COMMIT pinned in the Makefile.
Generated code lands in gen/raystack/compass/v1beta1/. The API layer uses ConnectRPC (not plain gRPC) -- handlers implement the connect service interface.
Architecture
core/-- Domain logic (entity, principal, document, embedding, namespace, pipeline)store/-- PostgreSQL repositories and migrationshandler/-- ConnectRPC handlersinternal/mcp/-- MCP server for AI agent tool accessinternal/middleware/-- Connect interceptors (namespace, principal, logging, recovery)internal/server/-- Server bootstrap and wiringinternal/config/-- Configurationcli/-- CLI commandsgen/-- Auto-generated protobuf/connect code (DO NOT EDIT)
Key Conventions
- Identity model uses
Principal(not User/Caller) -- supports types: user, agent, service - Multi-tenancy via
Namespacewith PostgreSQL Row-Level Security - Temporal data: entities and edges use
valid_from/valid_totimestamps - Soft deletes: set
valid_to = now()instead of DELETE - Database migrations in
store/migrations/-- sequential numbering (000001, 000002, etc.) - MCP server reads namespace and principal from context (injected by middleware)
Common Commands
make build # Build binary
make test # Run tests with coverage
make proto # Regenerate proto from proton (GitHub, uses PROTON_COMMIT)
make lint # Run golangci-lint
go vet ./... # Run vet
go build ./... # Check compilationLocal proto generation from a local proton checkout:
buf generate ../proton --template buf.gen.yaml --path raystack/compassDo NOT
- Edit files in
gen/directly - Add Elasticsearch, Kafka, or other infrastructure dependencies -- Postgres only
- Use
UserorCallernaming -- the identity type isPrincipal - Skip database migrations -- always add a new migration file for schema changes
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

