docs-assistant
AGENTS.md0 starsChanged 34 days agoMITView on GitHub
Embeddable AI support assistant: answers from a tenant's own documents with citations, abstains when it does not know, and hands off to a human. Hybrid RAG over Postgres (pgvector + full-text). These rules are binding for any agent (Claude Code, Codex, Copilot) working in this repo. - .NET 10 / C# 14 (global.json), Central Package Management, TreatWarningsAsErrors=true. - ASP.NET Core Minimal APIs, ProblemDetails. Aspire 13.6 AppHost for local dev. - EF Core 10 + Npgsql + pgvector (pgvector/pgvector:0.8.7-pg18), snake_case naming.…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 32,671 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository2 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- add-endpointSkill
The file
We split this AGENTS.md into the rules it gives an agent
4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
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 30
No MediatR, no AutoMapper, no MassTransit (licensing — see docs/adr/).
- Very specific: line 34
Every tenant-owned entity carries TenantId and has an EF global query filter that fails closed.
- Distinctive: line 49
Every LLM call goes through the cost-tracking and spend-cap pipeline.
- Distinctive: line 69
When you add a rule-like test (architecture, isolation), prove it can fail: inject the violation once, watch it go red, revert.
≈ “Common” is an estimate: at least 1 in 5 of the 41,581 AGENTS.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
docs-assistant · Agent guidelines
Embeddable AI support assistant: answers from a tenant's own documents with citations, abstains when it does not know, and hands off to a human. Hybrid RAG over Postgres (pgvector + full-text).
These rules are binding for any agent (Claude Code, Codex, Copilot) working in this repo.
<!-- BEGIN:managed-rules -->Stack (pinned — check Directory.Packages.props before adding anything)
- .NET 10 / C# 14 (
global.json), Central Package Management,TreatWarningsAsErrors=true. - ASP.NET Core Minimal APIs, ProblemDetails. Aspire 13.6 AppHost for local dev.
- EF Core 10 + Npgsql + pgvector (
pgvector/pgvector:0.8.7-pg18), snake_case naming. - AI:
Microsoft.Extensions.AIabstractions as ports; Claude via the officialAnthropicSDK; embeddings in-process with ONNX (multilingual-e5-small, 384 dims). - Tests: xUnit v2 (ArchUnitNET's adapter requires it — do not move to xunit.v3), Testcontainers.
Dependency rule (enforced by tests/DocsAssistant.Architecture.Tests)
Domain ← Application ← Infrastructure ← ApiDomain: plain C#. No package references. Entities guard their own invariants.Application: use cases organized by feature (Features/<Feature>/<UseCase>.cs) plus ports (Abstractions/). May referenceMicrosoft.Extensions.AI.Abstractions, nothing concrete.Infrastructure: adapters (EF Core, Anthropic, ONNX, Valkey, SMTP).Api: composition root and endpoints only. No business logic.- No MediatR, no AutoMapper, no MassTransit (licensing — see
docs/adr/).
Tenancy
- Every tenant-owned entity carries
TenantIdand has an EF global query filter that fails closed. - Bind the tenant once per scope with
ITenantContext.Set. Never callIgnoreQueryFilters()outside an explicitly cross-tenant admin path, and comment why when you do.
No magic strings or numbers
- Limits, thresholds, model ids and prices live in options classes bound from configuration and validated at startup, or in named constants with a comment saying where the value comes from.
- Database names used in more than one place live in
Infrastructure/Persistence/PostgresNames.cs.
AI rules
- Model ids and per-model prices are configuration, never literals in code.
- Prompts are files under
Infrastructure/Ai/Prompts/; any prompt change must be run through the evals. - Retrieved text is data, not instructions: always delimited, never concatenated into the system prompt.
- Every LLM call goes through the cost-tracking and spend-cap pipeline.
Tests and the verification gate
| Project | What | Needs Docker |
Architecture.Tests | layer rules, forbidden references | no |
Domain.Tests | pure logic: chunking, fusion, state machines | no |
Application.Tests | use cases against fake ports | no |
Integration.Tests | real Postgres/Mailpit via Testcontainers | yes |
widget/tests/widget | the widget in Chromium against a scripted API, axe | no |
widget/tests/stack | browser → real API → Postgres → Mailpit (widget/e2e/README.md) | yes |
Nothing is done until it ran: dotnet build (warnings are errors), dotnet test, and
dotnet format whitespace --verify-no-changes. For widget/: npm run typecheck, npm run build
(enforces the size budget) and npm test. "Should work" is not verified.
Widget rules: no runtime dependencies, text from the API is never inserted as HTML, every string
exists in English and Spanish (src/i18n.ts).
When you add a rule-like test (architecture, isolation), prove it can fail: inject the violation once, watch it go red, revert.
Style
- Tabs for indentation (
.editorconfig). File-scoped namespaces.sealedby default. - Comments explain why, not what. No commented-out code.
- Migrations:
dotnet ef migrations add <Name> --project src/DocsAssistant.Infrastructure --startup-project src/DocsAssistant.Api --output-dir Persistence/Migrations.
<!-- END:managed-rules -->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.

