agent-framework-go
Copilot instructions635 starsChanged 2 months agoMITView on GitHub
Do not stage, commit, or push compiled binaries or build artifacts. This includes, but is not limited to: - Extensionless go build output named after its source directory (for example, examples/02-agents/agents/step10_as_mcp_tool/step10_as_mcp_tool). - go test -c binaries (*.test) and coverage output (*.out, coverage.html). - Platform executables and libraries (*.exe, *.dll, *.so, *.dylib). - Anything under bin/, dist/, vendor/, tmp/, or temp/. - When building or running examples locally, keep the compiled output out of Git. Never use git add -f /…
In this repository4 other files it gives its agents.
- unit-converterSkill
- unit-converterSkill
- agentic-workflowsSkill
- dotnet-symbolsSkill
The file
We split this copilot-instructions.md into the rules it gives an agent
12 rules. About 0 are common, 8 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
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
- Distinctive: line 5
Do not stage, commit, or push compiled binaries or build artifacts.
- Very specific: line 16
When building or running examples locally, keep the compiled output out of Git.
- Very specific: line 18
Before committing, verify no binary content is staged.
- Distinctive: line 26
Use the following guidance when reviewing a pull request.
- Distinctive: line 33
Keep the public surface small.
- Very specific: line 36
Follow neighboring APIs: constructor configuration is generally Config passed by value.
- Very specific: line 42
Prefer existing standard-library, SDK, and package helpers, such as slices.Clone, agent.GetOption, message.NewText, and SDK stream …
- Distinctive: line 44
Do not replace clear loops with more verbose callback helpers or extract forwarding helpers that add no meaning.
- Distinctive: line 69
Keep provider-specific schema and wire transformations at provider boundaries.
- Distinctive: line 79
Check nested calls and repeated runs for stale call/user identity, cross-session state leakage, duplicated retained history, and lost …
- Distinctive: line 85
Prefer black-box regression tests through public APIs.
- Distinctive: line 102
Keep findings and suggested fixes within the PR's purpose.
≈ “Common” is an estimate: at least 1 in 5 of the 1,644 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
Never commit compiled binaries or build artifacts
Do not stage, commit, or push compiled binaries or build artifacts. This includes, but is not limited to:
- Extensionless
go buildoutput named after its source directory (for example,examples/02-agents/agents/step10_as_mcp_tool/step10_as_mcp_tool). go test -cbinaries (*.test) and coverage output (*.out,coverage.html).- Platform executables and libraries (
*.exe,*.dll,*.so,*.dylib). - Anything under
bin/,dist/,vendor/,tmp/, ortemp/.
Rules:
- When building or running examples locally, keep the compiled output out of
Git. Never use
git add -f/--forceto add an ignored artifact. - Before committing, verify no binary content is staged. A quick check:
git diff --cached --numstatshows-for both columns on binary files, andgit ls-files --cachedshould list only source, config, and docs. - Compiled binaries are reproducible from source; they must be built by the consumer, not checked in.
Pull request reviews
Use the following guidance when reviewing a pull request. Check callers and documented contracts before reporting a defect. Explain the concrete failure or design inconsistency and suggest a scoped fix; do not turn hypothetical misuse into a requirement for additional defensive code.
API design and simplicity
- Keep the public surface small. Question new exports, aliases, callback types, or wrappers used only by examples, tests, or internal plumbing when existing APIs already cover the need. Do not request new public APIs just for samples.
- Follow neighboring APIs: constructor configuration is generally
Configpassed by value; ordinary accessors do not need aGetprefix. Keep middleware parameter ordering consistent. Do not mechanically rename existing APIs. - For optional configuration fields, preserve the distinction between unset and
explicit
falseor0. Use pointers when that distinction matters, not when nil and the zero value mean the same thing. - Prefer existing standard-library, SDK, and package helpers, such as
slices.Clone,agent.GetOption,message.NewText, and SDK stream accumulators. Do not replace clear loops with more verbose callback helpers or extract forwarding helpers that add no meaning.
Semantic parity and compatibility
- For upstream ports, check stable .NET Agent Framework and Microsoft.Extensions.AI semantics, including defaults, opt-in gates, errors, and lifecycle behavior. Flag experimental upstream API additions without explicit maintainer agreement.
- Match observable behavior, not language-specific API shapes. Local JSON field casing, GUID formatting, and CLR timeout sentinels need not be copied into Go. Provider wire formats still have to satisfy their protocols. Do not copy a demonstrated upstream bug merely for parity.
- Support parity findings with concrete upstream evidence available to the review. Similar names or a passing happy-path test do not establish equivalence; lack of upstream evidence does not establish a mismatch.
- Preserve public signatures and behavior unless a breaking change has explicit
maintainer agreement. Observable contracts include concrete types stored in
any, defaults, and serialized values, not just function signatures.
Ownership and execution
- Middleware and context-provider inputs are read-only. Flag writes to shared messages, slices, options, or schemas without first taking ownership. Do not request blanket defensive copies solely to protect against callers violating documented read-only contracts.
- Keep provider-specific schema and wire transformations at provider boundaries. Preserve the original schema for local validation and other providers; do not change shared schema semantics to accommodate one provider.
- Trace affected behavior through streaming/non-streaming and sequential/concurrent paths. For tool middleware, include configured tools, context-provider tools, additional tools, and provider-managed execution. Check for bypassed middleware and lost approval requirements.
- Respect error contracts: do not mask original failures with cancellation, cleanup errors, or successful-looking decoding fallbacks. Check that early stream termination and error returns release the underlying run and resources.
- Check nested calls and repeated runs for stale call/user identity, cross-session state leakage, duplicated retained history, and lost ordering, call/result pairing, metadata, or usage during stream assembly.
Tests and performance
- Prefer black-box regression tests through public APIs. Assert observable results, errors, and events rather than private state or incidental representations. Extend existing component test files instead of adding one file per bug, unless isolation or build constraints justify a separate file.
- Cover the affected failure and lifecycle paths, not only successful helpers.
For ports, adapt relevant upstream behavioral tests. Synchronize concurrency
tests with channels, wait groups, or
testing/synctest, not sleeps or arbitrary deadlines, unless timing itself is the behavior under test. - Support performance findings with a relevant benchmark/profile or a concrete cost on the affected path. Do not trade a simple implementation for extra machinery based on speculative allocation savings.
Documentation and change scope
- Public Go doc comments should explain Go behavior, defaults, and ownership, not .NET comparisons or porting history. Keep cross-language rationale in PR discussion or internal implementation comments. Use Go doc symbol links.
- Keep findings and suggested fixes within the PR's purpose. Flag unrelated additions; do not request unrelated refactors, renames, existing-test reorganization, or speculative compatibility layers.
- For generated gh-aw workflows, check that changes come from source/configuration updates or an intentional generator upgrade, rather than manual generated-file edits that the next compilation will erase.
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.

