hash: 29d9ac099b64 path: .specify/memory/constitution.md
Chirograph generates typed HTTP clients from OpenAPI documents at build time. A project declares a client with one OpenApiClient
MSBuild item and gets a compiled Kiota or Refitter client, registered with IHttpClientFactory. The words below (client, source,
document, generator, registration, joint) mean what GLOSSARY.md says. The design and its decisions are in
plans/chirograph.md.
Chirograph ships one package, Chirograph, of package type MSBuildSdk: props, targets and templates under Sdk/, and the
assembly of its MSBuild tasks, Chirograph.Build.Tasks, under Sdk/tasks/netstandard2.0. It ships no runtime library and no source
generator. The generators run as processes during the build, fetched with PackageDownload. The tasks follow Dovetail's pattern: one
netstandard2.0 assembly that compiles against MSBuild only and is never a package of its own. Logic goes into a task when MSBuild's
own tasks and property functions express it badly; the targets keep the data, the checks and the diagnostics.
Every behaviour is proven by building a real consumer project against the packed SDK: test/Chirograph.Tests packs src/**
before it builds and scaffolds consumers with MSBuild.ProjectCreation. Tests observe what a consumer sees (generated files, build
output, diagnostics, the registered client), never the targets' internals. Snapshots use Verify on the observable result only.
The CHIROnnn codes, the OpenApiClient item metadata and the Chirograph* properties are Chirograph's public surface. A code is
never reused or renumbered, every code has a reference page with its own anchor, and a test checks that the reference pages list
exactly the metadata, properties and codes the targets read and raise. Breaking changes follow semantic versioning.
Builds must not phone home. Chirograph sets KIOTA_CLI_TELEMETRY_OPTOUT=true, KIOTA_OFFLINE_ENABLED=true and
DOTNET_CLI_TELEMETRY_OPTOUT=1 for every generator run, and a test pins them. Generated code stays in obj and is never committed;
only a URL source's document cache may be committed.
Registration is a plain IServiceCollection extension. Dovetail users get a joint through Dovetail's own DovetailTemplate
extension point. Chirograph never references Dovetail.
All NuGet package versions live in Directory.Packages.props; .csproj files never specify versions. The generator tools and the
runtime packages their clients need (Microsoft.OpenApi.Kiota, Microsoft.Kiota.Bundle, Refitter, Refit.HttpClientFactory)
move together as one Renovate group, and the pack writes their versions into Sdk/Packages.props. A package a consumer references
itself always wins over Chirograph's implicit reference.
The repository mirrors Dovetail's conventions.
Toolchain: mise install installs everything (the .NET 11 SDK, the .NET 10 runtime, node, hk and the rest, from
.config/mise.toml). Run dotnet through mise.
Build: mise run build runs the ModularPipelines build in build/Build.cs: build, test, pack into artifacts/nuget, and the
docs into artifacts/docs.
Test:
- Framework: TUnit on Microsoft.Testing.Platform (not VSTest)
- Test classes inherit
LoggerTest<TestRecord>fromRocket.Surgery.Extensions.Testing.TUnit - Assertions: TUnit Should syntax (
TUnit.Assertions.Should) · Mocks, if ever needed: TUnit.Mocks · Snapshots: Verify.TUnit - Run all:
dotnet test - Run single:
dotnet run --project test/Chirograph.Tests -- --treenode-filter "*/..." - Accept snapshots:
dotnet verify accept, only after reading the diff
Lint and format: hk check and hk fix (.config/hk.pkl: dotnet format, biome, oxfmt, tombi, actionlint, xmllint and the
rest). The pre-commit hook runs hk fix; CI runs it through lint.yml with autofix.ci.
Docs: mise run docs (Astro + Starlight dev server); mise run docs:build builds the site that build.yml deploys to gh-pages.
Sample: mise run sample:pack packs src/** at 0.0.0-sample, then dotnet build sample/ChirographSample/ChirographSample.slnx.
Release: GitVersion computes the version from the branch or tag; GitReleaseManager drafts releases and milestones; pushing a v*
tag publishes to nuget.org with trusted publishing.
This constitution supersedes all other practices in this repository. AGENTS.md and CLAUDE.md are generated from it by APM
(apm compile): amend this file, then recompile, never the generated files. Pull requests pass hk check, mise run build and the
tests. Complexity must be justified.
Version: 1.1.0 | Ratified: 2026-11-15 | Last Amended: 2026-11-16
Use these four operating modes to shape task execution when the runtime or prompt layer needs a consistent stance.
- Goal: recommend repository-specific structure, patterns, and trade-offs before implementation.
- Default posture: read-only analysis with concrete assumptions called out early.
- Preferred helpers:
dotnet-architect,dotnet-aspnetcore-specialist,dotnet-cloud-specialist. - Output contract: lead with the recommendation, then trade-offs, target scope, and next implementation steps.
- Goal: deliver the smallest safe code or configuration change that satisfies the request.
- Default posture: identify the exact target first, then edit and verify with narrow repo-native commands.
- Preferred helpers:
dotnet-architect,dotnet-aspnetcore-specialist,dotnet-testing-specialist. - Output contract: state the intended change first, then changed target, verification, and any remaining blockers.
- Goal: produce findings-first review output focused on correctness, safety, performance, and maintainability.
- Default posture: read-only inspection with severity ordering and evidence for every issue.
- Preferred helpers:
dotnet-code-review-agent,dotnet-security-reviewer,dotnet-performance-analyst,dotnet-testing-specialist. - Output contract: list findings first, include file evidence, call out missing verification, and explain the risk behind each fix.
- Goal: define or execute the narrowest effective verification path for the affected target.
- Default posture: prefer existing test infrastructure, deterministic checks, and scoped validation commands.
- Preferred helpers:
dotnet-testing-specialist,dotnet-code-review-agent,dotnet-performance-analyst. - Output contract: state the verification goal, scope, exact command or test path, and any residual coverage or flakiness risk.
- Resolve the concrete repository target before making scope claims.
- Prefer repository conventions over generic .NET examples.
- Escalate unresolved assumptions instead of silently inventing context.
- Match tool usage to the mode: read-only for architect and reviewer by default; edit only when implementation or testing work requires it.
MCP servers and fallback tooling for the dotnet-agent-harness ecosystem.
| Server | Type | Primary Role | Best Use Cases |
|---|---|---|---|
| serena | stdio | Semantic code analysis | Symbol-level navigation, refactoring, dependency analysis, precise code edits |
| microsoftdocs-mcp | http | Official Microsoft documentation | First-party .NET/ASP.NET/Azure docs, authoritative API references |
Need to navigate or refactor code?
YES -> [mcp:serena] for symbol operations
NO -> Continue...
Need official Microsoft documentation?
YES -> [mcp:microsoftdocs-mcp] for .NET/Azure docs
NO -> Continue...
Need documentation?
Official Microsoft docs -> [mcp:microsoftdocs-mcp]
Third-party libraries -> Web search + library READMEs
Project-specific docs -> Read markdown files from docs/, wiki/
GitHub operations -> Use gh CLI or web interface
Other -> Traditional tools (Read, Grep, Glob, Bash)
| Target | MCP Access | Notes |
|---|---|---|
| Claude Code | Full | Native MCP server support, all tools available |
| OpenCode | Filtered | Tab cycles primary agents only, @mention for subagents |
| Codex CLI | Full | All configured servers available |
| Copilot | Jointial | Uses execute tool, MCP via extensions |
| Gemini CLI | Full | Similar to Claude Code for stdio/http |
| Factory Droid | Rules-only | MCP routing through generated rules |
| Antigravity | Portable | Hooks-based, minimal surface |
Session start validation:
- Verify server connectivity
- Report available/unavailable status
- Suggest fallbacks if needed
Output format:
{
"mcpHealth": {
"serena": { "status": "available", "type": "stdio" },
"microsoftdocs-mcp": { "status": "available", "type": "http" }
},
"recommendations": []
}Failure mitigation:
| Server Down | Mitigation |
|---|---|
| serena | Use Read + Grep for finding code |
| microsoftdocs-mcp | Use web search with microsoft.com/learn |
| Category | Tools | Use When |
|---|---|---|
| Code Intelligence | serena | Navigation, refactoring, analysis |
| Documentation | microsoftdocs-mcp, web search | Official docs, research |
| GitHub | gh CLI | Repository operations |
| Traditional | Read, Grep, Glob, Bash | Fallback, offline scenarios |
Prefer lean-ctx MCP tools over native equivalents for token savings:
ctx_read > Read/cat, ctx_search > Grep/rg, ctx_shell > bash, ctx_tree > ls/find.
Native Edit/Write/Glob stay as-is; use ctx_edit only when Edit needs an unavailable Read.
Full rules: LEAN-CTX.md (open on demand — do not auto-load).
Use the neo4j-local MCP server to query and manage the local Neo4j knowledge graph. This is a fully local graph database populated by ingesting unstructured documents via llm-graph-builder.
When to use: When the user asks about topics that may be in the knowledge base, wants to find relationships between concepts, asks to store new information, or wants to explore the graph.
Do not use: For general programming questions, library docs, or anything not likely to be in the local knowledge base.
get_neo4j_schema— inspect current node labels, relationship types, and property keysread_neo4j_cypher— run read-only Cypher queries (MATCH, RETURN, etc.)write_neo4j_cypher— run write queries (CREATE, MERGE, SET, DELETE)
// See all node labels and counts
CALL apoc.meta.stats() YIELD labels RETURN labels
// Browse entities of a type
MATCH (n:Entity) RETURN n LIMIT 25
// Find connections around a concept
MATCH (n)-[r]-(m)
WHERE n.id CONTAINS 'keyword' OR n.name CONTAINS 'keyword'
RETURN n, r, m LIMIT 50// Shortest path between two concepts
MATCH path = shortestPath((a)-[*..6]-(b))
WHERE a.name = 'ConceptA' AND b.name = 'ConceptB'
RETURN path
// All neighbors of a node
MATCH (n {name: 'ConceptName'})-[r]-(neighbor)
RETURN type(r), neighbor.name, neighborCALL apoc.meta.data()The knowledgebase requires these services to be running:
- Neo4j + Neo4j Cypher MCP:
cd <knowledgebase-dir> && ./run.sh --start - MCP endpoint: http://localhost:8000/mcp/
- Neo4j Browser UI: http://localhost:7474
If MCP tools are unavailable, the services may need to be started. Inform the user rather than guessing.
To add new knowledge:
- Open http://localhost:8080 (llm-graph-builder UI)
- Select
ollama_llama3.2from the model dropdown - Upload documents (PDF, TXT, Markdown, HTML)
- Click Generate Graph
- Use
get_neo4j_schemato confirm new nodes appeared
- Ollama runs natively on Windows (not in Docker) — start with
ollama serveor via system tray - Docker services:
./run.sh --start(or equivalent PowerShell/batch wrapper) OLLAMA_BASE_URLin.envshould point tohttp://host.docker.internal:11434
Use Context7 MCP to fetch current documentation whenever the user asks about a library, framework, SDK, API, CLI tool, or cloud service -- even well-known ones like React, Next.js, Prisma, Express, Tailwind, Django, or Spring Boot. This includes API syntax, configuration, version migration, library-specific debugging, setup instructions, and CLI tool usage. Use even when you think you know the answer -- your training data may not reflect recent changes. Prefer this over web search for library docs.
Do not use for: refactoring, writing scripts from scratch, debugging business logic, code review, or general programming concepts.
- Always start with
resolve-library-idusing the library name and the user's question, unless the user provides an exact library ID in/org/projectformat - Pick the best match (ID format:
/org/project) by: exact name match, description relevance, code snippet count, source reputation (High/Medium preferred), and benchmark score (higher is better). If results don't look right, try alternate names or queries (e.g., "next.js" not "nextjs", or rephrase the question). Use version-specific IDs when the user mentions a version query-docswith the selected library ID and the user's full question (not single words)- Answer using the fetched docs
When reviewing these files, apply the evaluation design quality bar in
CONTRIBUTING.md and .agents/skills/create-skill-test/SKILL.md. For a grader,
reference, or fixture change, inspect its owning eval.yaml and apply only the
checks relevant to that artifact.
Leave an inline comment only for a specific, actionable defect. Check that:
- each scenario is necessary for the target; each preference-eligible scenario adds distinct capability, risk, or customer-journey value, while dormancy and no-op guards protect a meaningful routing or preservation invariant;
- prompts are natural developer requests and do not name the skill, reveal the answer, or prescribe its workflow;
- deterministic graders prove the complete required result and, when scope or preservation is part of the request, cover every in-scope file;
- golden evidence passes the deterministic contract and a realistic broken mutation would fail it;
- rewrite scenarios include an already-correct no-op case, and routing boundaries include an uncued dormancy case that proves recognition, restraint, and redirection;
- preference-eligible stimuli have enough task breadth for the expected tie rate, not only the five-stimulus floor;
- fixtures reproduce only the intended condition and are complete and consistent;
- skill evals use the Vally path, agent evals use the native SDK path, and declared time budgets are realistic;
- broad routing or behavior claims have separate evidence across model families;
- a proposed skill-content fix follows failure classification and is supported by the observed evidence.
Do not duplicate deterministic findings already reported by check_eval_quality.py. Do not request
style-only changes. If evidence is missing, state what must be added and why the current eval could
accept an incorrect result or reject a correct one.