McpServer
Copilot instructions4 starsChanged 28 days agoApache-2.0View on GitHub
Agent Identity: When posting to the MCP session log, use the agent's actual identity in Pascal-Case for sourceType and the session ID prefix. Do not use inaccurate aliases, lowercase names, or legacy placeholders. Example: Codex. For specific operational instructions (session bootstrap, turn logging lifecycle, helper command order), follow AGENTS-README-FIRST.yaml. QBrainAi is a standalone ASP.NET Core 9 server providing context retrieval, TODO management, session logging, repository operations, and GitHub issue sync for AI agents. It exposes functionality via two transports: Workspace…
We split this copilot-instructions.md into the rules it gives an agent
8 rules. About 0 are common, 4 are distinctive, and 4 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.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 3
Agent Identity: When posting to the MCP session log, use the agent's actual identity in Pascal-Case for sourceType and the session ID …
- Distinctive: line 8
Do not use table-style output in responses.
- Distinctive: line 9
Use concise bullets or short paragraphs instead.
- Distinctive: line 13
Do NOT set focus to the terminal window.
- Distinctive: line 14
Do NOT write multiline commands to the terminal.
- Very specific: line 15
Use only pwsh.exe (PowerShell 7+).
- Very specific: line 19
Follow AGENTS-README-FIRST.yaml for workflow and helper command order.
- Very specific: line 81
All source files reference their FR/TR requirement IDs in doc comments (e.g., /// <summary>TR-PLANNED-CORE-013: Constructor.</summary>).
≈ “Common” is an estimate: at least 1 in 5 of the 3,669 Copilot instructions 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
Copilot Instructions — QBrainAi
Agent Identity: When posting to the MCP session log, use the agent's actual identity in Pascal-Case for sourceType and the session ID prefix. Do not use inaccurate aliases, lowercase names, or legacy placeholders. Example: Codex.
For specific operational instructions (session bootstrap, turn logging lifecycle, helper command order), follow AGENTS-README-FIRST.yaml.
Response Formatting
- Do not use table-style output in responses.
- Use concise bullets or short paragraphs instead.
Terminal Usage
- Do NOT set focus to the terminal window.
- Do NOT write multiline commands to the terminal; use temporary scripts instead.
- Use only
pwsh.exe(PowerShell 7+). Do not invokepowershell.exe(Windows PowerShell 5.1) for scripts, examples, or tooling.
Session Logging Requirements
- Follow
AGENTS-README-FIRST.yamlfor workflow and helper command order. - Persist session log changes immediately after each meaningful update; do not batch unsaved turn changes.
- For each turn, include as much detail as available: interpretation, response/status, actions (type/status/filePath), files modified, design decisions, requirements discovered, blockers, and context references.
Build, Test, Lint
# Build (via Nuke)
./build.ps1 Compile
# or: dotnet build src\QBrainAi.Support.Mcp -c Debug
# Run all unit tests (via Nuke)
./build.ps1 Test
# or individual projects:
# dotnet test tests\QBrainAi.Support.Mcp.Tests -c Debug
# dotnet test tests\QBrainAi.Client.Tests -c Debug
# dotnet test tests\Build.Tests -c Debug
# Run integration tests (uses CustomWebApplicationFactory, in-memory EF)
dotnet test tests\QBrainAi.Support.Mcp.IntegrationTests -c Debug
# Run a single test by fully-qualified name
dotnet test tests\QBrainAi.Support.Mcp.Tests -c Debug --filter "FullyQualifiedName~TodoServiceTests.QueryAsync_NoFilters_ReturnsAllItems"
# Run tests in a single class
dotnet test tests\QBrainAi.Support.Mcp.Tests -c Debug --filter "FullyQualifiedName~TodoServiceTests"
# Validate appsettings config (via Nuke)
./build.ps1 ValidateConfig
# or: pwsh.exe -NoLogo -NoProfile -NonInteractive -File ./scripts/Validate-McpConfig.ps1
# Validate requirements traceability
./build.ps1 ValidateTraceability
# Markdown lint (docs only)
# CI uses markdownlint-cli2 with .markdownlint-cli2.yamlArchitecture
QBrainAi is a standalone ASP.NET Core 9 server providing context retrieval, TODO management, session logging, repository operations, and GitHub issue sync for AI agents. It exposes functionality via two transports:
- HTTP REST API — Controllers under
src/QBrainAi.Support.Mcp/Controllers/(routes at/qbrainai/*). - MCP Streamable HTTP —
app.MapMcp("/mcp-transport")using ModelContextProtocol.AspNetCore. - MCP STDIO —
--transport stdioflag; same tools as HTTP viaMcpStdio/FwhMcpTools.cs.
Workspace model: The primary host manages multiple workspaces, each getting its own in-process Kestrel WebApplication (not child processes). Workspace config lives in appsettings.json under Mcp:Workspaces (not in the database). One workspace is the "primary" — served by the host process directly; others get child WebApplication instances via WorkspaceAppFactory.
Search pipeline: Hybrid search combines SQLite FTS5 full-text with HNSW vector similarity (384-dim all-MiniLM-L6-v2 ONNX embeddings). HybridSearchService fuses both with BM25 scoring.
Storage: EF Core with SQLite (McpDbContext). TODO items use a pluggable backend — either YAML file-backed (TodoService) or SQLite table-backed (SqliteTodoService), selected via Mcp:TodoStorage:Provider.
Multi-instance: McpInstanceResolver overlays per-instance config from Mcp:Instances:{name} onto base Mcp:* settings.
Key Conventions
XML Documentation Required
TreatWarningsAsErrors and GenerateDocumentationFile are enabled globally in Directory.Build.props. All public types and members must have XML doc comments or the build fails (CS1591). Use /// <inheritdoc /> for interface implementations. Test projects are not exempt: test classes and test methods must include XML docs that state what is being tested, what data/fixtures are used, why that data/fixtures are used, and which requirement IDs are validated.
Requirement Traceability Comments
All source files reference their FR/TR requirement IDs in doc comments (e.g., /// <summary>TR-PLANNED-CORE-013: Constructor.</summary>). When adding new functionality, reference the relevant requirement ID from docs/Project/Functional-Requirements.md and docs/Project/Technical-Requirements.md.
Where files are headingNew Copilot instructions files have more rules about branches and pull requests, and fewer about code style.
Of the Copilot instructions files we read, the 2,297 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 repository10 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .cursor/rules/mcp-session-logging.mdcCursor rule
- bash-usageSkill
- byrd-tdd-processSkill
- edit-file-usageSkill
- git-usageSkill
- mcp-requirements-traceabilitySkill
- mcp-session-loggingSkill
- mcp-todoSkill
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.

