Connapse
CLAUDE.md22 starsChanged 5 days agoMITView on GitHub
Two separate EF Core migration histories: - KnowledgeDbContext (Storage): dotnet ef migrations add Name --project src/Connapse.Storage - ConnapseIdentityDbContext (Identity): dotnet ef migrations add Name --project src/Connapse.Identity Migrations run automatically on app startup. Dependencies flow downward. Core has zero external dependencies. All projects reference Core. The connapse CLI lives in a separate repository (https://github.com/Destrayon/connapse-cli) and talks to this server only via the REST API.
In this repository6 other files it gives its agents.
- docs/llms.txtllms.txt
- create-ticketsSkill
- discover-workSkill
- next-taskSkill
- parallel-workSkill
- release-gatekeeperSkill
The file
Show its rules and text
We split this CLAUDE.md into the rules it gives an agent
18 rules. About 0 are common, 4 are distinctive, and 14 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
14
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 45
Every test container is capped at 2 CPUs and 4 GB by TestContainerLimits.
- Very specific: line 73
DbContext Factory: Always use IDbContextFactory<T> and create short-lived contexts (await using var ctx = await …
- Very specific: line 84
Search filters by model_id and casts query vector to matching dimensions
- Very specific: line 101
Don't use var for primitive types
- Very specific: line 102
Don't use dynamic
- Very specific: line 103
When logging user-controlled values (search queries, request bodies, headers, client-supplied IDs), wrap them with …
- Very specific: line 122
If the Connapse MCP server is available, use it as your primary source of project context before relying on assumptions or general …
- Distinctive: line 126
Before starting any task, search relevant containers for context on:
- Distinctive: line 133
Brand guidelines: when working on UI or public-facing content
- Very specific: line 147
Use container_list to discover all available containers.
- Very specific: line 151
Use search_knowledge with the most relevant container and a natural language query.
- Distinctive: line 159
Test results or release validation reports
- Very specific: line 161
To add a new file: Use upload_file with textContent and a descriptive fileName.
- Very specific: line 165
Use get_document to retrieve the current content
- Very specific: line 166
Use delete_file to remove the old version
- Very specific: line 167
Use upload_file to upload the new version with the appended or revised content
- Very specific: line 169
Keep the same fileName and path so the file retains its identity.
- Distinctive: line 171
Do not: create new containers without asking the user first.
≈ “Common” is an estimate: at least 1 in 5 of the 26,980 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
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Build & Run
# Build
dotnet build
# Run web app (requires backing services)
dotnet run --project src/Connapse.Web
# Start backing services (PostgreSQL + MinIO, ports exposed to host)
docker compose -f docker-compose.yml -f docker-compose.dev.yml up -d
# Full stack via Docker
docker compose up -dTests
# All tests
dotnet test
# Unit tests only (no Docker required)
dotnet test --filter "Category=Unit"
# Integration tests (needs Docker for Testcontainers)
dotnet test --filter "Category=Integration"
# Single test class
dotnet test --filter "FullyQualifiedName~Connapse.Core.Tests.CloudScope.CloudScopeServiceTests"
# Single test method
dotnet test --filter "FullyQualifiedName~ClassName.MethodName_Scenario_ExpectedResult"
# Retrieval eval harness (Docker + Ollama; see tests/Connapse.Eval/README.md)
dotnet run --project tests/Connapse.Eval -- run --suite v1 --config hybrid- xUnit framework, FluentAssertions (
.Should()), NSubstitute for mocking - Integration tests share a single PostgreSQL+MinIO container pair via
SharedWebAppFixture(collection-based) - Every test container is capped at 2 CPUs and 4 GB by
TestContainerLimits; setCONNAPSE_TEST_CONTAINER_LIMITSto<cpus>,<memory>(e.g.4,8g) oroffto change that. New fixtures must add.WithCreateParameterModifier(TestContainerLimits.Apply) - Tag tests:
[Trait("Category", "Unit")]or[Trait("Category", "Integration")]; speed gates that time real work use[Trait("Category", "Gate")]and run in their own CI step - Test naming:
MethodName_Scenario_ExpectedResult
Database Migrations
Two separate EF Core migration histories:
KnowledgeDbContext(Storage):dotnet ef migrations add Name --project src/Connapse.StorageConnapseIdentityDbContext(Identity):dotnet ef migrations add Name --project src/Connapse.Identity
Migrations run automatically on app startup.
Architecture
Connapse.Web (Blazor Server + Minimal API endpoints + MCP server)
├── Connapse.Identity (Auth: OAuth 2.1/JWT/PAT/cookie, cloud identity, audit)
├── Connapse.Ingestion(Parsers, chunking strategies, background worker)
├── Connapse.Search (Vector, keyword, hybrid search + reranking)
├── Connapse.Storage (PostgreSQL/pgvector, EF Core, connectors, embedding/LLM providers)
├── Connapse.Agents (Agent orchestration)
└── Connapse.Core (Domain models, interfaces, settings records — zero dependencies)Dependencies flow downward. Core has zero external dependencies. All projects reference Core. The connapse CLI lives in a separate repository (https://github.com/Destrayon/connapse-cli) and talks to this server only via the REST API.
Key Patterns
- DbContext Factory: Always use
IDbContextFactory<T>and create short-lived contexts (await using var ctx = await factory.CreateDbContextAsync(ct)) — never share a scoped DbContext across threads (Blazor Server requirement) - Provider factory delegates:
IEmbeddingProviderandILlmProviderresolved via factory delegates that read settings at scope time (swap providers without restart) - Endpoint registration: Each domain has
Map{Feature}Endpoints()extension methods insrc/Connapse.Web/Endpoints/, registered inProgram.cs - DI registration: Each layer has
ServiceCollectionExtensionswithAdd{Layer}()methods - Settings hierarchy: appsettings.json < environment-specific < User Secrets < env vars < CLI args < PostgreSQL
settingstable, except that an address set by env var or CLI arg beats the saved one (DeploymentAddresses). Services useIOptionsMonitor<T>for runtime reload. - Container isolation: Each Container has its own storage connector, vector index, and optional settings overrides — no cross-container data sharing
Vector Storage
chunk_vectors.embeddingis unconstrainedvector(no fixed dimension) — supports mixed embedding models- Partial IVFFlat indexes per
model_id, managed byVectorColumnManager - Search filters by
model_idand casts query vector to matching dimensions
Access Surfaces
- Blazor Server UI — interactive components at
/ - REST API — Minimal API endpoints at
/api/... - MCP Server — at
/mcpvia ModelContextProtocol SDK
The standalone connapse-cli is an additional client that talks to this server over the REST API.
Code Conventions
- .NET 10, file-scoped namespaces, nullable enabled, implicit usings
- Records for DTOs and settings models
- Primary constructors for DI
- Async all the way (never
.Resultor.Wait()) - Parameterized SQL queries only (never string interpolation)
- Don't use
varfor primitive types - Don't use
dynamic - When logging user-controlled values (search queries, request bodies, headers, client-supplied IDs), wrap them with
LogSanitizer.Sanitize(...)fromConnapse.Core.Utilitiesto prevent CodeQLcs/log-forgingalerts
Commit Messages
<type>: <summary>Types: feat:, fix:, docs:, test:, refactor:, perf:, chore:
Branch Naming
feature/<issue>-desc, fix/<issue>-desc, refactor/<issue>-desc, docs/<issue>-desc
GitHub Issues — File Before Implementing
Before starting any new feature, fix, or non-trivial change, file a GitHub issue first. The branch name (feature/<issue>-desc, fix/<issue>-desc) and PR description (Closes #<issue>) both reference it. Do not begin implementation work — even setting up branches or worktrees — until the issue exists. Trivial in-place edits (typo fixes, single-line doc tweaks) are exempt.
Knowledge Base (Connapse MCP)
If the Connapse MCP server is available, use it as your primary source of project context before relying on assumptions or general knowledge.
When to search
Before starting any task, search relevant containers for context on:
- Architecture decisions and design rationale
- Open issues and known bugs
- Developer guides and setup gotchas
- Research related to the feature or area you're working in
- Release history and test results
- Brand guidelines when working on UI or public-facing content
Key containers
| Container | What's in it |
connapse-architecture | Design patterns, architecture decisions, API behaviors, business rules |
connapse-developer-guide | Setup guides, feature maps, how-tos for extending Connapse |
connapse-release-testing | Release test results, pass/fail reports, release decisions |
connapse-brand | Brand guidelines, logo rules, color palettes |
connapse-roadmap | Milestone plans, feature priorities, version goals |
connapse-bugs | Known bugs, reproduction steps, root cause analysis |
connapse-business-rules | Domain rules, validation logic, behavioral requirements |
Use container_list to discover all available containers. Research containers are typically prefixed with research- and contain deep-dive findings on specific topics. Search multiple containers if the topic could span areas.
How to search
Use search_knowledge with the most relevant container and a natural language query. Use Hybrid mode for best results. Search multiple containers if the topic spans areas (e.g., an architecture question might have context in both connapse-architecture and a research-* container).
Contributing back to the knowledge base
While working, you may add to the knowledge base if you produce insights, decisions, or research that would be valuable for future sessions. Examples:
- A new architecture decision or design rationale
- Research findings from investigating a bug or evaluating an approach
- Test results or release validation reports
To add a new file: Use upload_file with textContent and a descriptive fileName. Place it in the most appropriate existing container.
To update an existing file: Connapse does not support in-place edits. To update a file:
- Use
get_documentto retrieve the current content - Use
delete_fileto remove the old version - Use
upload_fileto upload the new version with the appended or revised content
Keep the same fileName and path so the file retains its identity.
Do not create new containers without asking the user first.
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.

