agentleFS
diriendirien/yet-another-agent-harness/pkg/AGENTS.md

yet-another-agent-harness / pkg

AGENTS.md19 starsChanged 8 months agoMITView on GitHub

The file

We split this AGENTS.md into the rules it gives an agent

10 rules. About 0 are common, 4 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    No external Go tools required beyond standard toolchain <!-- AGENTS-GENERATED:END setup -->

    line 62
  2. Distinctive:

    Use standard library over external deps when possible

    line 80
  3. Very specific:

    Prefer any over interface{}.

    line 86
  4. Very specific:

    Use context.Context for cancellation and timeouts

    line 92
  5. Distinctive:

    Avoid goroutine leaks: always ensure termination paths

    line 93
  6. Very specific:

    Registry pattern: Every component type has a registry with Register() and All() methods

    line 105
  7. Very specific:

    Context handling: Always pass and respect context.Context in I/O paths

    line 107
  8. Very specific:

    Check Go documentation: https://pkg.go.dev

    line 113
  9. Distinctive:

    Check root AGENTS.md for project-wide conventions

    line 115
  10. Very specific:

    Run go doc <package> for standard library help <!-- AGENTS-GENERATED:END help -->

    line 116

≈ “Common” is an estimate: at least 1 in 5 of the 40,246 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
<!-- Managed by agent: keep sections and order; edit content, not structure. Last updated: 2026-03-23 -->

AGENTS.md — pkg/

<!-- AGENTS-GENERATED:START overview -->

Overview

Core Go library for yaah. Every component follows the Interface → Registry → Generator pattern. Registries collect typed components; generators consume them to emit per-agent config files. The harness package is the top-level orchestrator.

<!-- AGENTS-GENERATED:END overview --><!-- AGENTS-GENERATED:START filemap -->

Key Files

catalog/catalog.go      -> Skill catalog types (CatalogEntry, Bundle, Category, RiskLevel)
catalog/entries.go      -> Default catalog data with all skills and bundles
catalog/search.go       -> Catalog search, filter, and resolve functions
catalog/registry.go     -> External skill registry loader + catalog merging
catalog/validate.go     -> Skill validation logic
harness/harness.go      -> Orchestrator: wires all registries, dispatches hook events
hooks/registry.go       -> Hook registry (event → handler dispatch)
hooks/handler.go        -> Handler interface contract
hooks/handlers/*.go     -> Built-in handlers: linter, command-guard, secret-scanner, comment-checker, session-logger
mcp/registry.go         -> MCP server registry
mcp/provider.go         -> Provider interface contract
mcp/providers/*.go      -> Built-in: yaah (self), context7, pulumi
lsp/registry.go         -> LSP server registry
lsp/provider.go         -> Provider interface contract
lsp/providers/*.go      -> Built-in: gopls, pyright, typescript, csharp
skills/registry.go      -> Skill registry + remote loader
skills/builtins/*.go    -> Built-in skills: commit, pr, review
agents/registry.go      -> Agent registry + remote loader
commands/registry.go    -> CLI command registry
plugins/plugin.go       -> Plugin interface, MarketplacePlugin interface, and registry
plugins/codex.go        -> OpenAI Codex plugin (marketplace: codex@openai-codex)
generator/claude.go     -> Claude Code config generator
generator/opencode.go   -> OpenCode config generator
generator/codex.go      -> Codex CLI config generator
generator/copilot.go    -> GitHub Copilot CLI config generator
schema/settings.go      -> Settings types + defaults
session/store.go        -> Session audit log persistence
gitcache/cache.go       -> Git clone/update cache for remote resources
mcpserver/server.go     -> Built-in MCP server (stdio transport, tool handlers)
<!-- AGENTS-GENERATED:END filemap --><!-- AGENTS-GENERATED:START golden-samples -->

Golden Samples (follow these patterns)

ForReferenceKey patterns
Hook handlerhooks/handlers/linter.goImplement Handler interface, CanHandle() + Handle() methods
MCP providermcp/providers/yaah.goImplement Provider interface, return MCPServer config
LSP providerlsp/providers/gopls.goImplement Provider interface, return LSPServer config
Config generatorgenerator/claude.goImplement Generator, read from registries, write native format
Built-in skillskills/builtins/commit.goSkill struct with Name, Description, Source
Registryhooks/registry.goThread-safe Register() + All() + typed iteration
Pluginplugins/codex.goImplement Plugin + MarketplacePlugin, return schema.Plugin
<!-- AGENTS-GENERATED:END golden-samples --><!-- AGENTS-GENERATED:START setup -->

Setup & environment

  • go mod download to install dependencies
  • Go 1.25+ required (see go.mod)
  • No external Go tools required beyond standard toolchain
<!-- AGENTS-GENERATED:END setup --><!-- AGENTS-GENERATED:START commands -->

Build & tests

TaskCommand
Vetgo vet ./...
Formatgofmt -w .
Testgo test ./...
Test (race)go test -race ./...
Test (single pkg)go test -v -race ./pkg/hooks/...
Buildgo build -v ./...
<!-- AGENTS-GENERATED:END commands --><!-- AGENTS-GENERATED:START code-style -->

Code style & conventions

  • Follow Go 1.25 idioms
  • Use standard library over external deps when possible
  • Errors: wrap with fmt.Errorf("context: %w", err), lowercase no punctuation
  • Naming: camelCase for private, PascalCase for exported; ID/URL/HTTP not Id/Url/Http
  • Struct tags: use canonical form (json, yaml, etc.)
  • Comments: complete sentences ending with period
  • Package docs: first sentence summarizes purpose
  • Prefer any over interface{}; use generics [T any] where appropriate
<!-- AGENTS-GENERATED:END code-style --><!-- AGENTS-GENERATED:START security -->

Security & safety

  • Validate all inputs from external sources
  • Use context.Context for cancellation and timeouts
  • Avoid goroutine leaks: always ensure termination paths
  • Sensitive data: never log or include in errors
  • File paths: validate and sanitize user-provided paths (especially in gitcache)
  • Hook handlers are security controls (command-guard, secret-scanner) — treat changes with care
<!-- AGENTS-GENERATED:END security --><!-- AGENTS-GENERATED:START examples -->

Patterns to Follow

Prefer looking at real code in this repo over generic examples. See Golden Samples section above for files that demonstrate correct patterns.

Key patterns:

  • Registry pattern: Every component type has a registry with Register() and All() methods
  • Interface contracts: Define interfaces where consumed (handler.go), implement in separate files
  • Context handling: Always pass and respect context.Context in I/O paths
  • Minimal deps: Standard library first — check go.mod before adding anything
<!-- AGENTS-GENERATED:END examples --><!-- AGENTS-GENERATED:START help -->

When stuck

  • Check Go documentation: https://pkg.go.dev
  • Review existing patterns in this codebase — every registry follows the same shape
  • Check root AGENTS.md for project-wide conventions
  • Run go doc <package> for standard library help
<!-- AGENTS-GENERATED:END help --><!-- AGENTS-GENERATED:START checklist -->

PR/commit checklist

  • go test -race ./... passes
  • go vet ./... reports no issues
  • gofmt -w . produces no diff
  • Error messages are descriptive and wrapped with %w
  • Public APIs have godoc comments
  • context.Context passed and respected in all I/O paths
  • New registries follow the NewRegistry() → Register() → All() shape
<!-- AGENTS-GENERATED:END checklist -->

House Rules (project-specific)

  • New registries must follow the same NewRegistry() → Register() → All() shape as existing ones
  • Generators must not import other generators — they are independent output targets
  • Remote resources (skills, agents) are loaded via gitcache — never vendor them into the repo

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.