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

yet-another-agent-harness

AGENTS.md19 starsChanged 8 months agoMITView on GitHub

Precedence: the closest AGENTS.md to the files you're changing wins. Root holds global defaults only. If commands fail, verify against go.mod or ask user to update.

  • Installs packages

The file

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

11 rules. About 1 is common, 9 are distinctive, and 1 is very specific to this project.

  • ≈1

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈9

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before coding: Read nearest AGENTS.md + check Golden Samples for the area you're touching

    line 26
  2. Distinctive:

    After each change: Run the smallest relevant check (typecheck → single test)

    line 27
  3. Distinctive:

    Before committing: Run full test suite if changes affect >2 files or touch shared code

    line 28
  4. Distinctive:

    Before claiming done: Run verification and show output as evidence — never say "try again" or "should work now" without proof

    line 29
  5. Distinctive:

    Run pre-commit checks before committing

    line 148
  6. Distinctive:

    Add tests for new code paths

    line 149
  7. Very specific:

    Use conventional commit format: type(scope): subject

    line 150
  8. Distinctive:

    Follow Go 1.25 conventions and idioms

    line 151
  9. Common:

    Commit secrets, credentials, or sensitive data

    line 164
  10. Distinctive:

    Commit go.sum without go.mod changes

    line 167
  11. Distinctive:

    Remove or weaken hook handlers without discussion (they're security controls)

    line 168

≈ “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
<!-- FOR AI AGENTS - Human readability is a side effect, not a goal --><!-- Managed by agent: keep sections and order; edit content, not structure --><!-- Last updated: 2026-03-23 | Last verified: 2026-03-23 -->

AGENTS.md

Precedence: the closest AGENTS.md to the files you're changing wins. Root holds global defaults only.

Commands (verified)

Source: go.mod + CI (.github/workflows/ci.yaml) — CI-sourced commands are most reliable

<!-- AGENTS-GENERATED:START commands -->
TaskCommand~Time
Typecheckgo build -v ./...~15s
Formatgofmt -w .~5s
Test (single)go test -v -race ./path/to/pkg~2s
Test (all)go test -v -race -short ./...~30s
Buildgo build -v ./cmd/yaah~15s
Install locallygo install ./cmd/yaah~15s
<!-- AGENTS-GENERATED:END commands -->

If commands fail, verify against go.mod or ask user to update.

Workflow

  1. Before coding: Read nearest AGENTS.md + check Golden Samples for the area you're touching
  2. After each change: Run the smallest relevant check (typecheck → single test)
  3. Before committing: Run full test suite if changes affect >2 files or touch shared code
  4. Before claiming done: Run verification and show output as evidence — never say "try again" or "should work now" without proof

File Map

<!-- AGENTS-GENERATED:START filemap -->
cmd/yaah/           -> CLI entry point (cobra root command)
pkg/catalog/        -> Skill catalog, bundles, discovery, and validation
pkg/harness/        -> Top-level orchestrator wiring all registries
pkg/hooks/          -> Hook registry + handler interface
pkg/hooks/handlers/ -> Built-in handlers (linter, command-guard, secret-scanner, comment-checker, session-logger)
pkg/mcp/            -> MCP server registry + provider interface
pkg/mcp/providers/  -> Built-in MCP providers (yaah, context7, pulumi)
pkg/lsp/            -> LSP registry + provider interface
pkg/lsp/providers/  -> Built-in LSP providers (gopls, pyright, typescript, csharp)
pkg/skills/         -> Skill registry + loader
pkg/skills/builtins/-> Built-in skill definitions (commit, pr, review)
pkg/agents/         -> Agent registry + loader
pkg/commands/       -> Custom CLI command registry
pkg/plugins/        -> Plugin registry
pkg/generator/      -> Per-agent config generators (claude, opencode, codex, copilot)
pkg/schema/         -> Settings types + defaults
pkg/session/        -> Session audit log store
pkg/gitcache/       -> Git-based caching for remote skills/agents
pkg/mcpserver/      -> Built-in MCP server runtime (stdio transport)
internal/cli/       -> CLI wiring (cobra commands, flag parsing)
docs/               -> Component deep-dive + configuration reference
website/            -> Static marketing site (auto-deployed to GitHub Pages)
.claude/skills/     -> Generated + remote skill definitions
.claude/agents/     -> Generated + remote agent definitions
.github/workflows/  -> CI (ci.yaml) + Pages deploy (deploy-pages.yaml)
<!-- AGENTS-GENERATED:END filemap -->

Golden Samples (follow these patterns)

<!-- AGENTS-GENERATED:START golden-samples -->
ForReferenceKey patterns
Hook handlerpkg/hooks/handlers/linter.goImplement hooks.Handler interface, register in defaultHarness()
MCP providerpkg/mcp/providers/yaah.goImplement mcp.Provider interface, return server config
LSP providerpkg/lsp/providers/gopls.goImplement lsp.Provider interface, return LSP config
Generatorpkg/generator/claude.goImplement Generator interface, emit agent-native config
CLI commandinternal/cli/generate.goCobra command wired in internal/cli/root.go
Skill definitionpkg/skills/builtins/commit.goSkill struct with Name, Description, Source fields
Catalog entrypkg/catalog/entries.goCatalogEntry struct with ID, Category, Tags, Risk
Pluginpkg/plugins/codex.goImplement plugins.Plugin + MarketplacePlugin interfaces
<!-- AGENTS-GENERATED:END golden-samples -->

Utilities (check before creating new)

<!-- AGENTS-GENERATED:START utilities -->
NeedUseLocation
Git clone/cache remote repogitcache.CloneOrUpdate()pkg/gitcache/
Session audit loggingsession.Storepkg/session/
Settings defaultsschema.DefaultSettings()pkg/schema/
Hook event dispatchharness.HandleHookEvent()pkg/harness/
MCP server stdiomcpserver.Serve()pkg/mcpserver/
<!-- AGENTS-GENERATED:END utilities -->

Heuristics (quick decisions)

<!-- AGENTS-GENERATED:START heuristics -->
WhenDo
Adding a new hook handlerCreate in pkg/hooks/handlers/, register in internal/cli/generate.go default harness
Adding a new MCP providerCreate in pkg/mcp/providers/, register in default harness
Adding a new pluginCreate in pkg/plugins/, implement Plugin interface, register in default harness
Adding a new agent targetCreate generator in pkg/generator/, add to generate command
Adding a CLI commandCreate cobra command in internal/cli/, wire in root.go
Adding a new skillAdd to pkg/skills/builtins/ or as remote in harness config
Adding a skill to catalogAdd entry in pkg/catalog/entries.go, optionally add to a bundle
Searching for skillsUse yaah skills search <query> or yaah skills list --tag <tag>
Changing website contentEdit website/index.html directly — auto-deploys on push to main
CommittingUse Conventional Commits (feat:, fix:, docs:, etc.)
Adding dependencyAsk first — we minimize deps
Unsure about patternCheck Golden Samples above
<!-- AGENTS-GENERATED:END heuristics -->

Architecture (registry pattern)

The project uses a consistent Interface → Registry → Generator pattern:

Harness (orchestrator)
├── hooks.Registry        → hooks.Handler interface
├── mcp.Registry          → mcp.Provider interface
├── lsp.Registry          → lsp.Provider interface
├── skills.Registry       → skills.Skill struct
├── agents.Registry       → agents.Agent struct
├── commands.Registry     → commands.Command struct
├── plugins.Registry      → plugins.Plugin struct
├── session.Store         → audit trail
└── generator.*           → per-agent config output

Each registry collects components; generators consume registries to emit agent-native config files.

Repository Settings

<!-- AGENTS-GENERATED:START repo-settings -->
  • Default branch: main
  • Merge strategy: squash, merge, rebase
  • CI: GitHub Actions (go test ./... on all branches/PRs, GoReleaser on tags)
  • Deployment: Website auto-deploys via deploy-pages.yaml on website/** changes
  • Release: GoReleaser with cosign signing + SBOM generation
  • Homebrew: dirien/tap/yaah
<!-- AGENTS-GENERATED:END repo-settings -->

Key Decisions

<!-- AGENTS-GENERATED:START key-decisions -->
DecisionWhy
Go library, not YAML/JSON configType safety, IDE completion, composability
One generator per agentEach agent has its own config format — no lowest-common-denominator abstraction
Remote skills via gitSkills evolve independently; gitcache handles caching
Pinned action SHAs in CISupply-chain security — no tag-based resolution
Website on main, not orphan branchVersion-controlled alongside code, auto-deploys via actions/deploy-pages
<!-- AGENTS-GENERATED:END key-decisions -->

Boundaries

Always Do

  • Run pre-commit checks before committing
  • Add tests for new code paths
  • Use conventional commit format: type(scope): subject
  • Follow Go 1.25 conventions and idioms
  • Pin GitHub Action SHAs with version comments in workflow files
  • Show test output as evidence before claiming work is complete

Ask First

  • Adding new dependencies
  • Modifying CI/CD configuration
  • Changing public API signatures (registry interfaces, handler contracts)
  • Running full e2e test suites
  • Repo-wide refactoring or rewrites
  • Changes to the generator output format (breaks downstream agent configs)

Never Do

  • Commit secrets, credentials, or sensitive data
  • Modify vendor/ or generated files by hand
  • Push directly to main/master branch
  • Commit go.sum without go.mod changes
  • Remove or weaken hook handlers without discussion (they're security controls)

Terminology

TermMeans
HarnessTop-level orchestrator that wires all registries together
HandlerA hook implementation that reacts to agent lifecycle events
ProviderAn MCP or LSP server configuration
GeneratorEmits config files in one agent's native format
RegistryTyped collection of components (hooks, MCP, LSP, skills, agents, commands, plugins)
Remote skillSkill definition loaded from a git repository via gitcache
SessionAudit trail of tool calls, blocked commands, and security findings

Index of scoped AGENTS.md

<!-- AGENTS-GENERATED:START scope-index -->
DirectoryFocus
pkg/AGENTS.mdGo package conventions, interface contracts, registry pattern
.github/workflows/AGENTS.mdGitHub Actions workflows and CI/CD automation
<!-- AGENTS-GENERATED:END scope-index -->

Agents: When you read or edit files in a listed directory, you must load its AGENTS.md first. It contains directory-specific conventions that override this root file.

When instructions conflict

The nearest AGENTS.md wins. Explicit user prompts override files.

  • For Go-specific patterns, defer to language idioms and standard library conventions

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.