meshkit
AGENTS.md233 starsChanged 3 months agoApache-2.0View on GitHub
MeshKit is the shared Go library of the Meshery ecosystem: structured errors, logging, database wrappers (GORM over SQLite/Postgres), MeshModel registration and registry, encoding, converters, broker clients, tracing, and general utilities. Nearly every ecosystem service (Meshery Server, Meshery Cloud, adapters, operators, CLIs) depends on it, so changes fan out downstream and must be coordinated with consumers. - Structured errors: concrete errors in each package's error.go; code symbols match ^Err[A-Z].+Code$; create with errors.NewV2(...); keep description/cause/remediation text as string literals. After adding or…
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,700 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 repository15 other files it gives its agents.
- .github/copilot-instructions.mdCopilot instructions
- chrome-devtools-axiSkill
- gh-axiSkill
- iterate-prSkill
- lavishSkill
- quota-axiSkill
- agent-md-refactorSkill
- command-creatorSkill
- cut-releaseSkill
- database-schema-designerSkill
- find-skillsSkill
- gepettoSkill
- iterate-prSkill
- qa-test-plannerSkill
- reducing-entropySkill
The file
We split this AGENTS.md into the rules it gives an agent
8 rules. About 0 are common, 1 is distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
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
- Very specific: line 22
After adding or modifying errors, run make errorutil (reads helpers/component_info.json, emits artifacts under helpers/).
- Distinctive: line 43
Tests accompany every behavioral change: Run every locally-runnable test before requesting review.
- Very specific: line 52
Schema-aware changes: run cd ../schemas && make validate-schemas && make consumer-audit before pushing.
- Very specific: line 58
Use the gh-axi CLI tool to interact with GitHub.
- Very specific: line 59
Use chrome-devtools-axi for browser automation (navigate, snapshot, click, fill forms, run JS, inspect console/network) in place of raw …
- Very specific: line 60
Run quota-axi to check local agent-provider quota windows before long-running work.
- Very specific: line 61
Use the lavish skill (lavish-axi CLI) to turn a plan, comparison, or report into a reviewable HTML artifact.
- Very specific: line 108
Then delete the
hooksblock from the restored file: - after the restore, not before, because restoring the whole backup reinstates the …
≈ “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
MeshKit - Agent Instructions
MeshKit is the shared Go library of the Meshery ecosystem: structured errors, logging, database wrappers (GORM over SQLite/Postgres), MeshModel registration and registry, encoding, converters, broker clients, tracing, and general utilities. Nearly every ecosystem service (Meshery Server, Meshery Cloud, adapters, operators, CLIs) depends on it, so changes fan out downstream and must be coordinated with consumers.
Commands
make test-go test --short ./... -race -coverprofile=coverage.txt -covermode=atomicmake check-golangci-lint run -c .golangci.yml -v ./...make tidy-go mod tidy; fails ifgo.modorgo.sumchangemake errorutil- update structured error codes and export artifactsmake errorutil-analyze- analyze structured errors without rewriting themmake build-errorutil- build thecmd/errorutilbinary- Single test:
go test ./path/to/package -run TestName -count=1
Critical Rules
- Structured errors: concrete errors in each package's
error.go; code symbols match^Err[A-Z].+Code$; create witherrors.NewV2(...); keep description/cause/remediation text as string literals. After adding or modifying errors, runmake errorutil(readshelpers/component_info.json, emits artifacts underhelpers/). - Ecosystem ownership: MeshKit owns shared errors, logging, and common utilities for the ecosystem -
downstream repos must not duplicate them. Shared data and API contracts belong in
meshery/schemas, not here. - Registration pipeline: one model definition per imported package/directory; ingestion is permissive (nested archives, YAML normalized to JSON) and mutates SVG fields to file paths.
Identifier Naming
Wire is camelCase everywhere; DB is snake_case; Go fields follow Go idiom; the ORM layer is the sole translation boundary.
- Authoritative source:
meshery/schemas/AGENTS.md § Casing rules at a glance - Reader-friendly directory: https://github.com/meshery/schemas/blob/master/docs/identifier-naming-contributor-guide.md
- The contract is not optional; deviations block PRs via the schemas consumer-audit CI gate. On
any conflict, schemas wins - file discrepancies as issues against
meshery/schemas, not locally. Id(camelCase), neverID, in URL params, JSON tags, and TypeScript properties.- meshkit: Go-only surface. Struct fields follow Go idiom (UserID); json tags are camelCase;
db/gorm column mappings are snake_case. MeshKit is NOT the schema source of truth - types that
mirror schema constructs come from
github.com/meshery/schemas; do not redeclare them locally.
Required on Every PR
- Tests accompany every behavioral change. Run every locally-runnable test before requesting review; never defer runnable coverage to reviewers or follow-up PRs.
- Documentation accompanies every behavioral change, in both forms:
- External, user-facing: docs.meshery.io (source: meshery/meshery docs; the error-code reference at docs.meshery.io/reference/error-codes is generated from this repo's error registries) - update whenever the change is user-visible.
- Internal, developer-facing: this repo's
docs/- update whenever architecture, workflows, or contracts change.
- Schema-aware changes: run
cd ../schemas && make validate-schemas && make consumer-auditbefore pushing. - Sign off every commit (
git commit -s). - No AI attribution in commits, PR descriptions, comments, or code.
AXI Agent Tooling
- Use the
gh-axiCLI tool to interact with GitHub. Prefergh-axiovergh. - Use
chrome-devtools-axifor browser automation (navigate, snapshot, click, fill forms, run JS, inspect console/network) in place of raw Playwright/chrome-devtools MCP for ad hoc tasks. - Run
quota-axito check local agent-provider quota windows before long-running work. - Use the
lavishskill (lavish-axiCLI) to turn a plan, comparison, or report into a reviewable HTML artifact. - Work in a treehouse worktree, never in the main clone. Other agent sessions and the
no-mistakes pipeline share the main clone. Take a worktree with
treehouse get --lease -b <branch>(it prints the path;--base <branch>starts it from another branch), work there, and release it withtreehouse return <path>once the change has merged.treehouse statuslists the pool. Never make one withgit worktree addor a second clone. - Land every change through no-mistakes, at most three runs per pull request. Commit in
the worktree, then run
no-mistakes axi run --intent "<goal>"(a clone without ano-mistakesremote needsno-mistakes initonce).no-mistakes axi statusshows the step and its findings, andno-mistakes axi respondanswers a review gate. The pipeline reviews, tests, pushes and opens the pull request. After the third run, merge the pull request as it stands and open an issue for anything still flagged. A run that stopped on a usage limit counts; one cancelled before it did anything does not.
Claude Code Settings
.claude/settings.jsonis tracked shared config: hook registrations every contributor gets from a fresh clone. Everycommandpath in it must resolve to a script that exists - a registration pointing at a missing script is a guard the repo silently never runs..claude/settings.local.jsonis git-ignored per-developer state. Claude Code rewrites it on every session, so tracking it produces spurious diffs and truncation. Keep MCP server toggles,permissions, andadditionalDirectories(e.g.../schemas) there.- Of the registered guards, only
no-ai-attribution.shis active repo-wide.meshkit-errors.shandguard-local-models.shmatchserver/**, which MeshKit does not have, andsession-start.shruns only whenCLAUDE_CODE_REMOTE=true- do not assume they enforce anything here.session-start.shenforces nothing, but it is not inert. WhenCLAUDE_CODE_REMOTE=trueit overwrites your global git identity -git config --global user.nameanduser.email, resolved from the authenticatedghuser - and shallow-clones sibling repos such asmeshery/schemasinto the parent directory. Decide whether you want both before it runs.
- The tracked
.claude/hookify.*.local.mdrule files are a second, independent guard mechanism, read directly by the hookify plugin and not wired throughsettings.jsonat all.hookify.no-ai-attribution-bash.local.mdandhookify.no-ai-attribution-file.local.mdcarry no path filter and do fire here;hookify.meshkit-errors.local.mdrequiresfile_pathmatching/server/.*\.go$and is inert in MeshKit, the same dead-guard pattern as above. So three guards are live in this repo, not one.
Already have this repo cloned? .claude/settings.local.json used to be tracked and carried the
hook registrations that now live in .claude/settings.json. Migrate in exactly this order:
- Back up
.claude/settings.local.jsonbefore pulling - required, not precautionary. The file goes from tracked to ignored here, so the pull removes it from your working tree, and may first abort with a modify/delete conflict if you have local modifications (common - Claude Code rewrites this file constantly). Skip the backup and your MCP server selection,permissions, andadditionalDirectoriesare gone for good. - After pulling, restore the backup to
.claude/settings.local.json. The pull removed it. The path is git-ignored from here on, so the restored file stays local and is never tracked again. - Then delete the
hooksblock from the restored file - after the restore, not before, because restoring the whole backup reinstates the stale block. Claude Code mergessettings.jsonandsettings.local.jsonadditively, so leaving the block in place fires every promoted guard twice, a symptom you will not connect to a settings change days later. Deleting the whole block is also what drops the deadPostToolUseregistration pointing attools/hooks/helm-chart-audit.py- that path does not exist in this repo, which is why the tracked file omits it. - Keep everything else in the restored file:
enabledMcpjsonServers/disabledMcpjsonServers,permissions, andadditionalDirectories(e.g.../schemas) are per-machine and belong there.
The same pull also untracks six generated __pycache__/*.pyc files under .claude/ and
.agents/. If Python rewrote yours since you cloned, the pull aborts naming those paths - delete
the __pycache__ directories and pull again. They are git-ignored from here on and regenerate on
next use.
Detailed Docs
- architecture - orientation: package map, the two core pipelines, cross-cutting packages.
- errors - read before adding or changing any error: conventions, errorutil workflow, code allocation.
- registration - read before touching
models/registration/ormodels/meshmodel/registry/. - testing - make targets, flags, single-test forms, lint and tidy discipline.
- naming-conventions - full identifier-naming contract and authority links.
- event-streaming - read when working on events, broadcasters, or the
Event/EventBuildertypes shared with Meshery Server. - git-walkers - read before touching
utils/walker/: the hybrid GitHub Trees crawl, its go-git fallbacks, and the ranked interesting-file API.
CLAUDE.md is a symlink to this file.
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.

