simulator-ai-plugin
AGENTS.md62 starsChanged 4 days agoMITView on GitHub
Guidance for coding agents (Codex, Claude Code, etc.) working in the simulator-ai-plugin repository. Humans: see the root README.md (usage) and docs/ARCHITECTURE.md (design). A plugin for Claude Code, Codex, and AWS Kiro that connects the Simulator.Company platform (backend: pong-server / control-api) to the host via MCP. It bundles: - a Go MCP server (plugins/simulator/mcp-server/) that exposes the Simulator /papi/1.0 public API as a curated, typed set of ~95 MCP tools (declared in Go, not a generic spec passthrough), scoped to the…
- Reads credentials
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 repository3 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- public/llms.txtllms.txt
- commitSkill
The file
We split this AGENTS.md into the rules it gives an agent
7 rules. About 0 are common, 0 are distinctive, and 7 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.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 18
Read docs/ARCHITECTURE.md before making non-trivial changes.
- Very specific: line 57
Run the server directly (hosts launch mcp-server/run.sh: prebuilt release binary, or go run with SIMULATOR_MCP_DEV=1 / as the fallback — …
- Very specific: line 69
Before committing Go changes, run make build && make vet && make test.
- Very specific: line 123
In a PR: do not touch the version. Append a one-line entry under the ## [Unreleased] section at the top of CHANGELOG.md (under ### Added / …
- Very specific: line 126
At release (promoting
develop→main): run make release VERSION=x.y.z. - Very specific: line 153
Add an Operation to the relevant internal/tools/<domain>.go slice (method, path template, typed params), matching the backend's operationId.
- Very specific: line 156
Document it in the root README.md tool table and docs/ARCHITECTURE.md §4.
≈ “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
AGENTS.md
Guidance for coding agents (Codex, Claude Code, etc.) working in the simulator-ai-plugin
repository. Humans: see the root README.md (usage) and
docs/ARCHITECTURE.md (design).
What this repo is
A plugin for Claude Code, Codex, and AWS Kiro that connects the Simulator.Company platform
(backend: pong-server / control-api) to the host via MCP. It bundles:
- a Go MCP server (
plugins/simulator/mcp-server/) that exposes the Simulator/papi/1.0public API as a curated, typed set of ~95 MCP tools (declared in Go, not a generic spec passthrough), scoped to the core scenarios; - 14 skills (
plugins/simulator/skills/) — markdown that teaches the model the platform's entity model and common workflows.
Read docs/ARCHITECTURE.md before making non-trivial changes.
Layout (the parts you'll touch)
plugins/simulator/mcp-server/ Go MCP server (Go 1.27.4+, mark3labs/mcp-go)
cmd/server/ entry point: profile → apiclient → tools → stdio
cmd/gendiscovery/ regenerate public/ discovery artifacts
cmd/evalrunner/ behavioural eval (opt-in; needs ANTHROPIC_API_KEY)
internal/config/ cloud presets + local/prod profiles (env + profiles.json overridable)
internal/apiclient/ HTTP client: base URL, auth header, accId, timeouts, errors
internal/tools/ curated typed Operation registry (op.go) + per-domain files
testdata/ papi-openapi.json (drift gate) + eval-scenarios.json
internal/engines/ graph sync, layout, prune, placements, upload, chart
app/auth/ set-environment (public config → account URL) + OAuth2 PKCE + .env credential storage
plugins/simulator/skills/ 14 skills (markdown only, ship with the plugin)
plugins/simulator/docs/ entity & user-flow reference (ships with the plugin)
docs/ contributor docs (ARCHITECTURE.md, INTEGRATION.md) — repo-level
public/ generated AI-discovery artifacts (do not hand-edit)Commands
All make targets run from the repo root (recipes cd into the module):
make build # go build ./...
make vet # go vet ./...
make lint # golangci-lint run ./... (golangci-lint v2; gosec clean, style backlog open)
make test # go test ./... — config, apiclient, tools (scenarios, -race, drift, eval), engines
make vuln # govulncheck (pinned) — reachable known vulnerabilities; CI job + release gate
make discovery # regenerate public/llms.txt + public/.well-known/skills/index.json
make run-local # go run ./cmd/server --profile local (dev pong-server :9000)
make run-prod # go run ./cmd/server --profile prod
make eval # behavioural eval, dry — model picks tools, canned fixtures (opt-in)
make eval-skills # behavioural eval, dry, with the SKILL.md files injected as system prompt
make eval-live # behavioural eval executing tools against the backend (throwaway workspace)Run the server directly (hosts launch mcp-server/run.sh: prebuilt release binary, or go run with
SIMULATOR_MCP_DEV=1 / as the fallback — README → "How the MCP server starts"):
cd plugins/simulator/mcp-server
go run ./cmd/server --profile local # targets pong-server :9000; logs to stderrThe local profile (--profile local or SIMULATOR_PROFILE=local) targets a
pong-server on :9000 and makes set-environment offer the local preset
(localhost:9000); the default prod profile hides it (cloud mw/sim + custom URL only).
Before committing Go changes, run make build && make vet && make test.
Dev loop in Claude Code: load the plugin from the repo with claude --plugin-dir <repo>
(or a local marketplace install, or the project-scoped root .mcp.json — pick one).
Set the profile either by prefixing the launch (SIMULATOR_PROFILE=local claude --plugin-dir
<repo> — the server inherits it) or in plugins/simulator/mcp-server/.env
(SIMULATOR_PROFILE=local). After editing
code/tools/skills/.env, run /reload-plugins to relaunch the MCP server — no
reinstall. Verify with /mcp. Full guide: README → "Local development".
Conventions & gotchas
- No binary in the repo. Hosts launch
mcp-server/run.sh, which runsSIMULATOR_MCP_DEV=1→go run, else a localsimulator-mcp(gitignored; not version-checked — rebuild it after a pull), else the release binary for the manifest version (SHA-256 checked, cached in~/.cache/simulator-mcp/), elsego run. The Release workflow builds those binaries; don't commit a compiled binary. SetSIMULATOR_MCP_DEV=1while editing Go code, or/reload-pluginskeeps starting the release binary. - Tools are declared in Go, curated. Each domain file under
internal/tools/(forms.go,actors.go, …) declares a slice of typedOperations;build.goregisters them. The server exposes ~95 tools, not the full REST surface — keep it curated. - Drift gate.
internal/tools/drift_test.govalidates every declared op (method, path, operationId) againstinternal/tools/testdata/papi-openapi.json(the backend contract, dumped by pong-serveryarn dump-openapi). After changing tools or the backend, refresh that spec and rungo test ./internal/tools/ -run TestSpecDrift. - operationIds live at the backend source.
pong-serverdeclares them on its/papiroute schemas; the plugin matches them. Keep names in sync across both repos. public/is generated. EditSKILL.mdfrontmatter, thenmake discovery.- Skill language: English-first, trilingual in practice. We work mainly in three
languages — English (primary), Ukrainian, Russian. Write all skill/doc prose and
behavioural instructions in English (one maintainable source). Never hardcode a
non-English sentence for Claude to say — instead instruct it to reply in the user's own
language. Two deliberate exceptions stay multilingual: (1) activation triggers in
description:frontmatter may include uk/ru example phrases (they improve auto-activation when users type in those languages); (2) product/UI terms are kept verbatim (e.g. the Account-Template alias «Шаблон рахунків»). Example data values should be language-neutral. - Entity/user-flow docs must stay under
plugins/simulator/docs/. Skills reference them as$CLAUDE_PLUGIN_ROOT/docs/...and onlyplugins/simulator/is copied on install. Contributor/architecture docs go in the repo-rootdocs/. The token name is host-imposed: Claude Code and Codex both resolve$CLAUDE_PLUGIN_ROOTvia text substitution at skill-load time (anthropics/claude-code#48230, #47789, #44057). Renaming it breaks both hosts. AWS Kiro doesn't substitute the token at all —install-kiro.shand the release generator hard-copy the skills andsed-replace the token with the absolute plugin path at install time instead. MCP subprocesses are not skill loading: Codex does not exposeCLAUDE_PLUGIN_ROOTthere, so.mcp.jsonmust keep the user'sPWDasSIMULATOR_WORK_DIRand resolve the installed plugin root separately. - Branching model.
developis the integration branch and the default base for every feature/fix PR;mainis release-only and receives changes solely by promotingdevelop(or arelease/*/hotfix/*branch). Never open a feature/fix PR againstmain— a CI guard (.github/workflows/guard-base-branch.yml) rejects any PR intomainwhose head isn'tdevelop,release/*, orhotfix/*. - Versioning & releases. The version is minted at release time, not per PR — many PRs
land on
developduring the week, so a per-PR bump just makes contributors collide on the same number.- In a PR: do not touch the version. Append a one-line entry under the
## [Unreleased]section at the top ofCHANGELOG.md(under### Added/### Changed/### Fixed). Appending a bullet avoids the merge conflicts a version bump causes. - At release (promoting
develop→main): runmake release VERSION=x.y.z. It rewrites## [Unreleased]into a dated## [x.y.z]section (and starts a fresh emptyUnreleased), then bumps the version in lockstep across the six files that carry it:plugins/simulator/.claude-plugin/plugin.json,plugins/simulator/.codex-plugin/plugin.json,plugins/simulator/.kiro-plugin/plugin.json,.claude-plugin/marketplace.json,.agents/plugins/marketplace.json,POWER.md(frontmatter). The script does not commit/tag/push — review the diff, commit, merge tomain, then tagvx.y.z. TheReleaseworkflow reads the## [x.y.z]CHANGELOG section for the GitHub release notes, so the section must exist before the tag.
- In a PR: do not touch the version. Append a one-line entry under the
- Linter.
make lintruns golangci-lint v2 (configplugins/simulator/mcp-server/.golangci.yml, shared with sibling Go services).gosecis clean (real findings fixed; trusted-input taint false positives are documented in thegosec.excludeslist). The broaderdefault: allset still has a style/modernization backlog, so lint is advisory — not yet in the pre-commitbuild && vet && testgate. - TLS is verified by default.
--insecureis only for self-signed on-prem gateways. - Graph sync (
internal/engines/sync_graph.go+push_graph.go, ~1.5k LOC) is the most delicate logic — change it carefully. Core helpers and the diff / inject paths now have unit tests (graphsync_test.go: form-id/UUID/name-cache helpers,injectMassLinkData,injectManageLayerData,fetchHierarchyEdgeTypeID,updateGraphActor, layer-actor pagination, plus an end-to-endpushGraphdelete path viahttptest). The full create/recreate orchestration and edge-placement branches are only partly covered — extend coverage when you touch them.
Adding a curated MCP tool
- Add an
Operationto the relevantinternal/tools/<domain>.goslice (method, path template, typed params), matching the backend'soperationId. make build && make vet && make test(the drift gate confirms it matches the backend).- Document it in the root
README.mdtool table anddocs/ARCHITECTURE.md§4. - Add an eval scenario in
internal/tools/testdata/eval-scenarios.json— every curated tool should have at least one. The structural test (eval_test.go) fails if a scenario names a tool that isn't registered (or anargChecks.toolnot listed intools). UseargChecks(mustContain/mustNotContain/mustMatch) to assert on the model's arguments where the shape matters (data keys, value discriminators, regression guards). Scenario knobs for robustness:- A
toolsentry may be an any-of group"a|b"— satisfied if the model calls either (for genuinely interchangeable tools, e.g."getTransfer|getTransferByRef"). dryOnlyToolslists follow-up tools required only in dry mode — the second step of a real-dependency flow (e.g.finalizeTransactionafter authorize) that dry fixtures let the model reach but a placeholder-id 404 stops it from reaching live. AnargCheckcan carry"dryOnly": truefor the same reason.- For live (
make eval-live): the runner scores tool selection, not backend success (a 404 still counts as "called"). Give prompts concrete ids/refs (or have them discover real entities viagetUsers/getForms) so the model actually issues the call; add a dry fixture inevalrunner/main.gofor any new read tool a multi-step chain reads from.
- A
For a multi-call/computational tool, add it under internal/engines/ and register it in
engines/register.go instead.
CI
.github/workflows/ci.yml runs on every push (main/develop) and PR:
gate(required, no secrets):make build→vet→test→ discovery freshness (make discoverythengit diff --exit-code -- public/— a PR that editedSKILL.mdfrontmatter but forgotmake discoveryfails here) →make lint(advisory,continue-on-error).Release(.github/workflows/release.yml, on av*tag): atestjob runsmake build→vet→teston the tagged commit, and the binaries are built and published only if it passes — the tag push does not wait for the branch CI run.behavioural-eval(opt-in,workflow_dispatchonly — it spends Anthropic credits):make evalwithANTHROPIC_API_KEYfrom repo secrets.
Security
This repo touches OAuth tokens (stored in .env, mode 0600) and user-supplied API keys
(SIMULATOR_API_SECRET, read-only to the plugin). Never log token or key values, never write
SIMULATOR_API_SECRET to .env, never commit a .env, and keep TLS verification on by
default. Auth-mode logging reports the mode name only — never a value, length, prefix or
fingerprint.
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.

