This file provides guidance to OpenAI Codex and other coding agents when working with this repository.
Use yarn instead of npm.
cd website
yarnBuild full solution:
dotnet build src/All.slnxBuild or test a subset directly (each area has its own solution file):
dotnet test src/HotChocolate/Fusion- You are the orchestrator, not the worker.
- Keep the main context window focused on decisions.
- Do not do work yourself that a subagent could do.
- Context-window discipline: when instructed to "let it cook" or "don't inspect", trust the subagent and do not re-read its output.
- For non-trivial work, minimum team composition is lead developer plus devil's advocate.
- "Done" means the code compiles, tests pass, and results are verified by running relevant tests.
- Never mark work complete without proving it works.
- During iteration, use
--filterand avoid running the full suite unnecessarily.
- Simplicity first: make every change as simple as possible and keep impact minimal.
- No lazy fixes: find root causes and avoid temporary patches.
- Minimal impact: touch only what is necessary and avoid regressions.
- Always use curly braces for loops and conditionals.
- Use file-scoped namespaces and 4-space indentation.
- Use test naming format:
Method_Should_Outcome_When_Condition. - Do not write vacuous assertions (
Assert.NotNullalone is not a complete test). - If a test requires excessive stubs and reflection, use a more appropriate test tier.
- Do not use em dash style sentences in docs, comments, or XML documentation. Use commas, periods, parentheses, or colons instead.
- Prefer snapshot tests over manual
Assertcalls using CookieCrumble. - Use CookieCrumble native snapshot support for
IExecutionResult,GraphQLHttpResponse, and related core types. - For small snapshots, prefer inline snapshots (
MatchInlineSnapshot). - For tests with multiple assertions, use markdown snapshots (
MatchMarkdownSnapshot). - For snapshot updates, use
__mismatch__/and understand ordering issues before updating snapshots. - Filter tests during iteration and avoid full-suite runs unless necessary.
- Use real databases in integration tests instead of mocks unless explicitly instructed otherwise.
This is framework code. Performance matters; optimize for low allocations on hot paths.
- Use
ChunkedArrayWriterorPooledArrayWriterwhen an in-memoryIBufferWriter<byte>is required.
Use dotnet CLI to search NuGet packages, for example:
dotnet package search HotChocolate