unbounded / helpers
AGENTS.md46 starsChanged 9 days agoApache-2.0View on GitHub
Small helpers that two or more components share. Each helper is its own package, such as internal/helpers/statusmsg. A helper must meet all of these: - Two or more components import it directly. Two packages from the same component count once. Count packages in internal/ and pkg/ toward their owner. Ignore hack/. If only one component uses the helper, move it there. - Helpers may use public types from api/. Keep component-specific decisions in the component that owns them. - Small.…
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 33,398 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 repository5 other files it gives its agents.
- AGENTS.mdAGENTS.md
- cmd/inventory/AGENTS.mdAGENTS.md
- cmd/orca/AGENTS.mdAGENTS.md
- internal/AGENTS.mdAGENTS.md
- unbounded-agent-qemu-vm-e2eSkill
The file
We split this AGENTS.md into the rules it gives an agent
2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 16
Not an agreement between components: If one component writes a value and another checks it, the writer owns that code (rule 3 in …
- Very specific: line 19
If a helper stops meeting these rules, move it into the component that needs the change, or make it a convention (internal/<name>.
≈ “Common” is an estimate: at least 1 in 5 of the 43,423 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
internal/helpers/
Small helpers that two or more components share. Each helper is its own package, such as
internal/helpers/statusmsg.
What belongs here
A helper must meet all of these:
- Two or more components import it directly. Two packages from the same component count once. Count packages in
internal/andpkg/toward their owner. Ignorehack/. If only one component uses the helper, move it there. - Helpers may use public types from
api/. Keep component-specific decisions in the component that owns them. - Small. Functions and constants only. No types with methods, goroutines, global variables or
init. One exception: a function that registers something with a third-party library, if calling it twice is safe and its comment says so, such asdockermedia.RegisterParsers. - Not an agreement between components. If one component writes a value and another checks it, the writer owns that
code (rule 3 in
internal/AGENTS.md). Do not put it here.
If a helper stops meeting these rules, move it into the component that needs the change, or make it a convention
(internal/<name>; ask first).
Find direct users
Replace <name> with the helper's package name:
go list -f '{{range .Imports}}{{if eq . "github.com/Azure/unbounded/internal/helpers/<name>"}}{{$.ImportPath}}{{"\n"}}{{end}}{{end}}' ./...Naming and API
- Package name: one lowercase word for the concept, such as
statusmsg,dockermediaorociregistry. Notutil,utils,common,misc,shared,typesorhelpers, and nothing ending inutil. - Don't repeat the package name:
statusmsg.Truncate, notstatusmsg.TruncateStatusMessage. - Export the function, not its limit:
statusmsg.TruncateCondition(msg), with the limit unexported, unless callers need the number. - Function names: a verb for functions that do something (
Truncate,ConfigurePlainHTTP),IsorHasfor ones that answer yes or no, andParseandFormatfor converting from and to strings. - Units in constant names:
conditionMaxBytes, notconditionMax. Usetime.Durationfor durations, never an integer number of seconds. - Parameters: at most three. Beyond that, take one
Optionsstruct. No functional options. - Error types:
<Condition>Error.
Documentation and tests
- A package comment that says what the helper is for and why components share it.
- A doc comment on every exported name, starting with the name. Say which inputs panic, as
statusmsg.Truncatedoes for a negative limit. - Tests for every exported function, including limits and edge cases. Write new tests table-driven.
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.

