yet-another-agent-harness / pkg
AGENTS.md19 starsChanged 8 months agoMITView on GitHub
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 31,774 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 repository53 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .claude/skills/agent-rules/AGENTS.mdAGENTS.md
- .github/workflows/AGENTS.mdAGENTS.md
- agent-ready-goSkill
- agent-rulesSkill
- architecture-designerSkill
- cli-developerSkill
- cloudformation-to-pulumiSkill
- code-reviewerSkill
- commitlintSkill
- commitSkill
- csharp-developerSkill
- decideSkill
- dep-upgradeSkill
- design-principlesSkill
- devops-engineerSkill
- flux-cliSkill
- flux-operator-cliSkill
- golang-proSkill
- go-nolint-auditSkill
- javascript-proSkill
- kubernetes-specialistSkill
- lint-fixSkill
- markdownlintSkill
- prSkill
- pull-request-msg-with-ghSkill
- pulumi-arm-to-pulumiSkill
- pulumi-automation-apiSkill
- pulumi-best-practicesSkill
- pulumi-cdk-to-pulumiSkill
- pulumi-cliSkill
- pulumi-componentSkill
- pulumi-escSkill
- pulumi-goSkill
- pulumi-neoSkill
- pulumi-pythonSkill
- pulumi-terraform-to-pulumiSkill
- pulumi-typescriptSkill
- python-proSkill
- reviewSkill
- roadmapSkill
- rust-async-patternsSkill
- rust-best-practicesSkill
- rust-engineerSkill
- scoutSkill
- security-auditSkill
- spring-boot-engineerSkill
- sre-engineerSkill
- sync-websiteSkill
- tailscale-installSkill
- tech-debtSkill
- the-foolSkill
- typescript-proSkill
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
- Distinctive: line 62
No external Go tools required beyond standard toolchain <!-- AGENTS-GENERATED:END setup -->
- Distinctive: line 80
Use standard library over external deps when possible
- Very specific: line 86
Prefer any over interface{}.
- Very specific: line 92
Use context.Context for cancellation and timeouts
- Distinctive: line 93
Avoid goroutine leaks: always ensure termination paths
- Very specific: line 105
Registry pattern: Every component type has a registry with Register() and All() methods
- Very specific: line 107
Context handling: Always pass and respect context.Context in I/O paths
- Very specific: line 113
Check Go documentation: https://pkg.go.dev
- Distinctive: line 115
Check root AGENTS.md for project-wide conventions
- Very specific: line 116
Run go doc <package> for standard library help <!-- AGENTS-GENERATED:END help -->
≈ “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.
Files
<!-- 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)
| For | Reference | Key patterns |
| Hook handler | hooks/handlers/linter.go | Implement Handler interface, CanHandle() + Handle() methods |
| MCP provider | mcp/providers/yaah.go | Implement Provider interface, return MCPServer config |
| LSP provider | lsp/providers/gopls.go | Implement Provider interface, return LSPServer config |
| Config generator | generator/claude.go | Implement Generator, read from registries, write native format |
| Built-in skill | skills/builtins/commit.go | Skill struct with Name, Description, Source |
| Registry | hooks/registry.go | Thread-safe Register() + All() + typed iteration |
| Plugin | plugins/codex.go | Implement Plugin + MarketplacePlugin, return schema.Plugin |
<!-- AGENTS-GENERATED:END golden-samples --><!-- AGENTS-GENERATED:START setup -->Setup & environment
go mod downloadto 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
| Task | Command |
| Vet | go vet ./... |
| Format | gofmt -w . |
| Test | go test ./... |
| Test (race) | go test -race ./... |
| Test (single pkg) | go test -v -race ./pkg/hooks/... |
| Build | go 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:
camelCasefor private,PascalCasefor 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
anyoverinterface{}; 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.Contextfor 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()andAll()methods - Interface contracts: Define interfaces where consumed (
handler.go), implement in separate files - Context handling: Always pass and respect
context.Contextin 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 ./...passesgo vet ./...reports no issuesgofmt -w .produces no diff- Error messages are descriptive and wrapped with
%w - Public APIs have godoc comments
context.Contextpassed 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
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.

