SharpClawCode
AGENTS.md110 starsChanged 3 months agoMITView on GitHub
SharpClaw Code is a C#-native coding-agent harness inspired by the current Rust claw-code surface. Primary stack: This repository should grow into a production-grade, cross-platform agent runtime with strong Windows compatibility. Favor concrete, maintainable architecture over framework-heavy indirection. The repository may begin sparse or empty. Before implementing anything: Do not scaffold broad placeholder trees with no executable value. The solution is expected to contain these primary projects: The solution should also include dedicated test coverage for: If the exact project layout…
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 35,266 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.
- docs/agents.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
36 rules. About 1 is common, 28 are distinctive, and 7 are very specific to this project.
≈1
Common · estimate
Many files like this have a rule of this kind.
≈28
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 26
If the intended architecture is not present yet, create the smallest real vertical slice that establishes it cleanly.
- Distinctive: line 28
Do not scaffold broad placeholder trees with no executable value.
- Distinctive: line 33
Prefer clear, explicit, strongly typed code over clever abstractions.
- Very specific: line 34
Use async/await end-to-end anywhere I/O or external process work exists.
- Distinctive: line 35
Use records for immutable contracts where appropriate.
- Distinctive: line 36
Use interfaces for infrastructure seams and runtime orchestration seams.
- Distinctive: line 37
Avoid unnecessary repository patterns and avoid overengineered CQRS.
- Distinctive: line 38
Keep domain and protocol contracts dependency-light.
- Very specific: line 39
Use System.Text.Json, never Newtonsoft.Json.
- Very specific: line 40
Use Microsoft.Extensions.Logging abstractions for logging.
- Common: line 47
Do not hardcode secrets, API keys, tokens, or machine-specific paths.
- Distinctive: line 48
Add concise XML docs for all public APIs and major internal services.
- Very specific: line 49
Add TODO comments only when paired with a concrete reason.
- Distinctive: line 80
If the exact project layout differs slightly in the live repository, follow the existing naming and folder conventions unless the user asks …
- Distinctive: line 84
Use these boundaries when deciding where code belongs:
- Very specific: line 106
Keep Protocol as central and minimally dependent as possible.
- Distinctive: line 115
When in doubt, prefer adding a narrowly scoped service in the correct project over introducing a new cross-cutting abstraction.
- Distinctive: line 119
Prefer constructor injection over service location.
- Distinctive: line 121
Keep public contracts explicit and version-tolerant where they may be serialized or persisted.
- Distinctive: line 123
Keep JSON payloads and machine-readable outputs stable unless the user asks for breaking changes.
- Distinctive: line 124
Prefer named types over anonymous or weakly typed dictionaries for important runtime state.
- Very specific: line 125
Use enum or discriminated-style typed models only when the state machine is truly finite and worth modeling explicitly.
- Distinctive: line 126
Keep file and class names aligned to their primary responsibility.
- Distinctive: line 130
Add concise XML docs to public APIs and major internal services.
- Distinctive: line 131
Document invariants, lifecycle expectations, and permission-sensitive behavior close to the code.
- Distinctive: line 132
Keep comments high-signal.
- Distinctive: line 138
Prefer incremental, reviewable changes over broad speculative scaffolding.
- Distinctive: line 139
After changes, run builds and tests for the affected scope and fix obvious issues.
- Distinctive: line 140
When adding files, keep the folder structure intentional and minimal.
- Distinctive: line 141
If a requested feature is large, implement the vertical slice that makes the architecture real instead of adding disconnected stubs.
- Very specific: line 146
Do not introduce Newtonsoft.Json.
- Distinctive: line 147
Do not hide important runtime behavior behind clever abstractions.
- Distinctive: line 148
Do not add repository layers or CQRS patterns unless the user explicitly needs them.
- Distinctive: line 149
Do not let CLI code become the application core.
- Distinctive: line 150
Do not bypass permission checks for shell, file mutation, or similarly dangerous actions.
- Distinctive: line 151
Do not introduce fake completeness through placeholder projects, empty handlers, or dead extension points.
≈ “Common” is an estimate: at least 1 in 5 of the 45,344 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
AGENTS.md
Project Identity
SharpClaw Code is a C#-native coding-agent harness inspired by the current Rust claw-code surface.
Primary stack:
- .NET 10
- C# 13
- Microsoft Agent Framework
System.CommandLineSpectre.ConsoleSystem.Text.JsonMicrosoft.Extensions.Hosting- idiomatic Microsoft dependency injection
This repository should grow into a production-grade, cross-platform agent runtime with strong Windows compatibility. Favor concrete, maintainable architecture over framework-heavy indirection.
Current Repository State
The repository may begin sparse or empty. Before implementing anything:
- Inspect the current solution and folder layout.
- Align new work to what already exists unless the user explicitly asks for restructuring.
- If the intended architecture is not present yet, create the smallest real vertical slice that establishes it cleanly.
Do not scaffold broad placeholder trees with no executable value.
Non-Negotiable Engineering Rules
- Target
.NET 10andC# 13. - Prefer clear, explicit, strongly typed code over clever abstractions.
- Use
async/awaitend-to-end anywhere I/O or external process work exists. - Use records for immutable contracts where appropriate.
- Use interfaces for infrastructure seams and runtime orchestration seams.
- Avoid unnecessary repository patterns and avoid overengineered CQRS.
- Keep domain and protocol contracts dependency-light.
- Use
System.Text.Json, neverNewtonsoft.Json. - Use
Microsoft.Extensions.Loggingabstractions for logging. - Prefer file-scoped namespaces.
- Favor small, testable classes with focused responsibilities.
- Preserve machine-readable state and JSON output support across major features.
- Route dangerous shell execution or file mutation through an explicit permission policy layer.
- Model long-running or lifecycle-managed subsystems explicitly and use hosted services where appropriate.
- Build for cross-platform support, with strong Windows behavior and path/process compatibility.
- Do not hardcode secrets, API keys, tokens, or machine-specific paths.
- Add concise XML docs for all public APIs and major internal services.
- Add
TODOcomments only when paired with a concrete reason.
Architecture Direction
The solution is expected to contain these primary projects:
SharpClaw.Code.CliSharpClaw.Code.ProtocolSharpClaw.Code.RuntimeSharpClaw.Code.AgentsSharpClaw.Code.CommandsSharpClaw.Code.ProvidersSharpClaw.Code.ToolsSharpClaw.Code.PermissionsSharpClaw.Code.SessionsSharpClaw.Code.MemorySharpClaw.Code.GitSharpClaw.Code.WebSharpClaw.Code.McpSharpClaw.Code.PluginsSharpClaw.Code.SkillsSharpClaw.Code.TelemetrySharpClaw.Code.Infrastructure
The solution should also include dedicated test coverage for:
- unit tests
- integration tests
- mock provider behavior
- parity harness coverage
If the exact project layout differs slightly in the live repository, follow the existing naming and folder conventions unless the user asks to normalize them.
Project Responsibilities
Use these boundaries when deciding where code belongs:
SharpClaw.Code.Protocol: central contracts, DTOs, envelopes, event shapes, request/response models, and dependency-light shared abstractions. Keep this project near the center of the dependency graph.SharpClaw.Code.Cli: command-line entrypoints, option binding, console wiring, startup composition. Keep it thin.SharpClaw.Code.Commands: application-facing command handlers and command orchestration invoked by the CLI.SharpClaw.Code.Runtime: turn execution, context assembly, lifecycle coordination, recovery, retries, and orchestration flow.SharpClaw.Code.Agents: Microsoft Agent Framework integration plus primary, reviewer, advisor, and sub-agent implementations.SharpClaw.Code.Tools: tool definitions and execution adapters. Tool execution must pass throughSharpClaw.Code.Permissions.SharpClaw.Code.Permissions: policy evaluation, approvals, dangerous-action gates, and permission-aware execution decisions.SharpClaw.Code.Sessions: durable session state, snapshots, append-only event logs, resume/recovery data.SharpClaw.Code.Memory: memory extraction, indexing, recall, summarization boundaries, and retention policies.SharpClaw.Code.Providers: model/provider integrations and provider-specific runtime adapters.SharpClaw.Code.Git: git inspection and git-aware workspace operations.SharpClaw.Code.Web: web fetch, browser-facing integrations, and web-specific execution concerns.SharpClaw.Code.Mcp: MCP client integration, server registration, transport concerns, and typed lifecycle state.SharpClaw.Code.Plugins: plugin discovery, activation, manifest handling, and typed lifecycle state.SharpClaw.Code.Skills: skill discovery, loading, packaging, and execution metadata.SharpClaw.Code.Telemetry: structured, event-first telemetry contracts, sinks, correlation, and emission helpers.SharpClaw.Code.Infrastructure: implementation details that do not belong in the domain-oriented projects above.
Dependency Guidelines
- Keep
Protocolas central and minimally dependent as possible. Clishould delegate toCommandsandRuntime, not absorb business logic.Runtimeowns orchestration and lifecycle, not the CLI.Agentsshould integrate the Microsoft Agent Framework without leaking provider or transport details across the solution.Toolsmust not bypass permissions.Sessionsmust support both durable snapshots and append-only event logs.Telemetryshould be structured and event-first, not string-first.- MCP and plugin lifecycle states must be explicit, typed, and observable.
When in doubt, prefer adding a narrowly scoped service in the correct project over introducing a new cross-cutting abstraction.
Code Style Expectations
- Prefer constructor injection over service location.
- Pass
CancellationTokenthrough async call paths where work may block, wait, stream, or invoke I/O. - Keep public contracts explicit and version-tolerant where they may be serialized or persisted.
- Favor immutable options/configuration objects once bound.
- Keep JSON payloads and machine-readable outputs stable unless the user asks for breaking changes.
- Prefer named types over anonymous or weakly typed dictionaries for important runtime state.
- Use
enumor discriminated-style typed models only when the state machine is truly finite and worth modeling explicitly. - Keep file and class names aligned to their primary responsibility.
Documentation Expectations
- Add concise XML docs to public APIs and major internal services.
- Document invariants, lifecycle expectations, and permission-sensitive behavior close to the code.
- Keep comments high-signal. Explain why when it is not obvious from the code.
Delivery Rules For Future Codex Runs
- Inspect the current repository layout before implementing.
- For non-trivial tasks, write a short plan before making edits.
- Prefer incremental, reviewable changes over broad speculative scaffolding.
- After changes, run builds and tests for the affected scope and fix obvious issues.
- When adding files, keep the folder structure intentional and minimal.
- If a requested feature is large, implement the vertical slice that makes the architecture real instead of adding disconnected stubs.
- Preserve existing machine-readable output, JSON contracts, persistence formats, and permission behavior unless the task explicitly changes them.
What To Avoid
- Do not introduce
Newtonsoft.Json. - Do not hide important runtime behavior behind clever abstractions.
- Do not add repository layers or CQRS patterns unless the user explicitly needs them.
- Do not let CLI code become the application core.
- Do not bypass permission checks for shell, file mutation, or similarly dangerous actions.
- Do not introduce fake completeness through placeholder projects, empty handlers, or dead extension points.
Default Implementation Bias
For this repository, prefer:
- explicit orchestration over magic
- typed contracts over ad hoc blobs
- durable state over implicit in-memory assumptions
- hosted lifecycle services over unmanaged background threads
- cross-platform behavior with deliberate Windows-safe handling
- pragmatic architecture with clean seams over pattern collection
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.

