agentleFS
clawdotnetclawdotnet/SharpClawCode/AGENTS.md

SharpClawCode

AGENTS.md97 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 checking a change actually works.

    Of the AGENTS.md files we read, the 11,736 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.

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
  1. Distinctive:

    If the intended architecture is not present yet, create the smallest real vertical slice that establishes it cleanly.

    line 26
  2. Distinctive:

    Do not scaffold broad placeholder trees with no executable value.

    line 28
  3. Distinctive:

    Prefer clear, explicit, strongly typed code over clever abstractions.

    line 33
  4. Very specific:

    Use async/await end-to-end anywhere I/O or external process work exists.

    line 34
  5. Distinctive:

    Use records for immutable contracts where appropriate.

    line 35
  6. Distinctive:

    Use interfaces for infrastructure seams and runtime orchestration seams.

    line 36
  7. Distinctive:

    Avoid unnecessary repository patterns and avoid overengineered CQRS.

    line 37
  8. Distinctive:

    Keep domain and protocol contracts dependency-light.

    line 38
  9. Very specific:

    Use System.Text.Json, never Newtonsoft.Json.

    line 39
  10. Very specific:

    Use Microsoft.Extensions.Logging abstractions for logging.

    line 40
  11. Common:

    Do not hardcode secrets, API keys, tokens, or machine-specific paths.

    line 47
  12. Distinctive:

    Add concise XML docs for all public APIs and major internal services.

    line 48
  13. Very specific:

    Add TODO comments only when paired with a concrete reason.

    line 49
  14. Distinctive:

    If the exact project layout differs slightly in the live repository, follow the existing naming and folder conventions unless the user asks …

    line 80
  15. Distinctive:

    Use these boundaries when deciding where code belongs:

    line 84
  16. Very specific:

    Keep Protocol as central and minimally dependent as possible.

    line 106
  17. Distinctive:

    When in doubt, prefer adding a narrowly scoped service in the correct project over introducing a new cross-cutting abstraction.

    line 115
  18. Distinctive:

    Prefer constructor injection over service location.

    line 119
  19. Distinctive:

    Keep public contracts explicit and version-tolerant where they may be serialized or persisted.

    line 121
  20. Distinctive:

    Keep JSON payloads and machine-readable outputs stable unless the user asks for breaking changes.

    line 123
  21. Distinctive:

    Prefer named types over anonymous or weakly typed dictionaries for important runtime state.

    line 124
  22. Very specific:

    Use enum or discriminated-style typed models only when the state machine is truly finite and worth modeling explicitly.

    line 125
  23. Distinctive:

    Keep file and class names aligned to their primary responsibility.

    line 126
  24. Distinctive:

    Add concise XML docs to public APIs and major internal services.

    line 130
  25. Distinctive:

    Document invariants, lifecycle expectations, and permission-sensitive behavior close to the code.

    line 131
  26. Distinctive:

    Keep comments high-signal.

    line 132
  27. Distinctive:

    Prefer incremental, reviewable changes over broad speculative scaffolding.

    line 138
  28. Distinctive:

    After changes, run builds and tests for the affected scope and fix obvious issues.

    line 139
  29. Distinctive:

    When adding files, keep the folder structure intentional and minimal.

    line 140
  30. Distinctive:

    If a requested feature is large, implement the vertical slice that makes the architecture real instead of adding disconnected stubs.

    line 141
  31. Very specific:

    Do not introduce Newtonsoft.Json.

    line 146
  32. Distinctive:

    Do not hide important runtime behavior behind clever abstractions.

    line 147
  33. Distinctive:

    Do not add repository layers or CQRS patterns unless the user explicitly needs them.

    line 148
  34. Distinctive:

    Do not let CLI code become the application core.

    line 149
  35. Distinctive:

    Do not bypass permission checks for shell, file mutation, or similarly dangerous actions.

    line 150
  36. Distinctive:

    Do not introduce fake completeness through placeholder projects, empty handlers, or dead extension points.

    line 151

≈ “Common” is an estimate: at least 1 in 5 of the 16,597 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

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.CommandLine
  • Spectre.Console
  • System.Text.Json
  • Microsoft.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:

  1. Inspect the current solution and folder layout.
  2. Align new work to what already exists unless the user explicitly asks for restructuring.
  3. 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 10 and C# 13.
  • Prefer clear, explicit, strongly typed code over clever abstractions.
  • Use async/await end-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, never Newtonsoft.Json.
  • Use Microsoft.Extensions.Logging abstractions 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 TODO comments only when paired with a concrete reason.

Architecture Direction

The solution is expected to contain these primary projects:

  • SharpClaw.Code.Cli
  • SharpClaw.Code.Protocol
  • SharpClaw.Code.Runtime
  • SharpClaw.Code.Agents
  • SharpClaw.Code.Commands
  • SharpClaw.Code.Providers
  • SharpClaw.Code.Tools
  • SharpClaw.Code.Permissions
  • SharpClaw.Code.Sessions
  • SharpClaw.Code.Memory
  • SharpClaw.Code.Git
  • SharpClaw.Code.Web
  • SharpClaw.Code.Mcp
  • SharpClaw.Code.Plugins
  • SharpClaw.Code.Skills
  • SharpClaw.Code.Telemetry
  • SharpClaw.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 through SharpClaw.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 Protocol as central and minimally dependent as possible.
  • Cli should delegate to Commands and Runtime, not absorb business logic.
  • Runtime owns orchestration and lifecycle, not the CLI.
  • Agents should integrate the Microsoft Agent Framework without leaking provider or transport details across the solution.
  • Tools must not bypass permissions.
  • Sessions must support both durable snapshots and append-only event logs.
  • Telemetry should 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 CancellationToken through 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 enum or 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

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.