agentleFS
minipuftminipuft/claude-prompts-mcp/AGENTS.md

claude-prompts-mcp

AGENTS.md192 starsChanged 31 days agoMITView on GitHub

- Edit CLAUDE.md and .claude/rules/*.md; do not edit this generated file. - This compact file is the default Codex/OpenCode context. It preserves the project-wide decisions that change most tasks while staying within Codex's documented default 32 KiB project guidance budget. - Claude Code applies rule paths: natively. Codex and OpenCode do not, so use the dispatch table below: when a task touches a matching path, read that canonical rule before editing. - For project details not projected here, consult CLAUDE.md…

  • Commits and pushes
  • 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 35,337 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 repositoryOne other file it gives its agents.

The file

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

7 rules. About 0 are common, 4 are distinctive, and 3 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.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Do not edit this downstream compatibility file.

    line 4
  2. Distinctive:

    ONLY sanctioned plan mention and it asserts that this PR advances the plan it names: the gate FAILS when the PR closes none of that plan's …

    line 56
  3. Distinctive:

    Leave it to an adoption PR.

    line 74
  4. Distinctive:

    Read the relevant doc before editing.

    line 108
  5. Very specific:

    MCP Contract Dev: Verify upstream first (rg "paramName" src/mcp/tools src/modules src/engine).

    line 161
  6. Very specific:

    Framework validity: Always frameworkManager.getFramework(id) -- never hardcode framework lists.

    line 165
  7. Very specific:

    Pipeline state: Use context.gates, context.frameworkAuthority, context.diagnostics -- never mutate arrays directly.

    line 168

≈ “Common” is an estimate: at least 1 in 5 of the 45,344 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
<!-- GENERATED by scripts/sync-project-guidance.js. Source of truth: CLAUDE.md and .claude/rules/*.md. This is a compact semantic projection, not a concatenation. Do not edit this downstream compatibility file. -->

Agent Rules · Claude Prompts MCP

Canonical ownership and loading

  • Edit CLAUDE.md and .claude/rules/*.md; do not edit this generated file.
  • This compact file is the default Codex/OpenCode context. It preserves the project-wide decisions that change most tasks while staying within Codex's documented default 32 KiB project guidance budget.
  • Claude Code applies rule paths: natively. Codex and OpenCode do not, so use the dispatch table below: when a task touches a matching path, read that canonical rule before editing.
  • For project details not projected here, consult CLAUDE.md and its documentation pointers.

Core Principles

  1. MCP Tooling -- Prompts, templates, chains flow through MCP tools.
  2. Contract ownership -- Hand-written schemas in src/mcp/tools/schemas/ own runtime validation; tooling/contracts/*.json own descriptions/parameter metadata generated into src/mcp/contracts/schemas/_generated/. Run npm run generate:contracts, never edit _generated/. config.schema.json <- ConfigFile (generate:config-schema).
  3. Transport Parity -- Runtime changes must work in STDIO and Streamable HTTP. The two differ in instance lifetime, and that difference is load-bearing: STDIO pins one McpServer per connection, while HTTP builds a fresh one per request. A change that mutates a registered instance passes STDIO and silently no-ops over HTTP. HTTP+SSE was removed in the SDK v2 upgrade.
  4. Docs/Code Lockstep -- Update relevant doc in docs/ when behavior changes.
  5. Validation Discipline -- CI owns the full test suite; local checks are a subset chosen by who is running them. A change's own check (the test, validator or probe that reads what the change wrote) runs with the change, and nothing wider. Before a push: npm run typecheck && npm run lint:ratchet && npm run typecheck:tests:ratchet && npm run validate:all. test:all (unit, integration and e2e) runs once, in CI, at the pull request; a red run is fixed on the branch, never merged around. Run test:all locally only to reproduce a CI failure or when no pull request will carry the change. typecheck:tests:ratchet is not optional: tsconfig.json excludes tests/, so typecheck is blind to every call site a signature change breaks. test:ci is an alias for test:unit and says nothing about the integration or e2e jobs. Owner ruling 2026-10-05, after a profile measured the full suite running three times in series per change while CI was green on 32 of 33 pull requests. (flips when a defect reaches main that a local test:all would have caught and the pull request's CI did not)

Node.js Support Boundaries

SurfaceSupported Node.jsEnforcement
MCP server and desktop extension>=22.13.0server/package.json, manifest.json, CI on 22.13.0 and 24
Standalone CPM CLI>=18.18.0cli/package.json and CLI runtime validation
Local development and publishing24.node-version and publish workflows

The server floor is where node:sqlite is available without an experimental flag. The standalone CLI remains a separate, self-contained compatibility surface.

Pull Request Boundary

npm run pr:check is the whole local gate, and it is a subset of CI by construction.

PR Conventions is a required context whose gating steps on a non-bot PR are: three positive controls, the body against .github/pull_request_template.md, the squash commit against the parser release-please reads it with, and commitlint on the title. Run every one of them before gh pr create, from the repo root:

TITLE="feat(scope): outcome"
npm run pr:body -- --out /tmp/pr-body.md     # seed it; never author a body from scratch
$EDITOR /tmp/pr-body.md
npm run pr:check -- --body-file /tmp/pr-body.md --title "$TITLE"

The template requires ## Demonstration (consumer-observable before/after, or n/a: <reason>), a ## How it was verified TABLE (claim · probe · baseline -> measured · the mutation that fails it -- a count with no baseline is noise), and ## Notes for Reviewers, under a 400-word above-the-fold budget that fenced blocks, tables and <details> do not count against. The Plan: footer is the ONLY sanctioned plan mention and it asserts that this PR advances the plan it names: the gate FAILS when the PR closes none of that plan's open rows, when it closes the last row without retiring the plan in the same PR, or when the file does not exist. The footer is also the join key a reader greps to assemble a multi-PR initiative (ADR 0003); a Decision: ADR-NNNN trailer must name an existing ADR. The scripts that enforce this are managed by the fleet delivery contract (.delivery-contract.json); validate:delivery-contract fails on any local edit to them, and a newer contract is adopted with delivery-contract update (CONTRIBUTING.md §Pull Request Process).

The squash check exists because release-please leaves out, silently, any commit its parser rejects -- no changelog line, no version bump, no BREAKING CHANGE note -- and what it parses is not the body as written: GitHub re-flows the body at 72 columns, so a long line can open name( and close it on the next line. That dropped #501 (a breaking change) and #503 from a release although both bodies passed every other check. On a refusal, put the example on one line inside a fenced block, reword the line, or add a BEGIN_COMMIT_OVERRIDE block to the body -- the marker counts anywhere in the body, even quoted in backticks, so never mention it in prose.

One more step warns and never gates: scripts/warn-contract-lag.mjs annotates a PR when .delivery-contract.json trails a repository-standards release that changed the contract template. Leave it to an adoption PR.

Parity is enforced rather than documented: scripts/pr-check.mjs names each workflow step it mirrors and server/tests/unit/scripts/pr-check-ci-parity.test.ts reads pr-conventions.yml and fails when the two sets diverge. Both exist because following the documented steps once still shipped an unchecked title (#283) and a hand-written body cost a second CI run (#312).

This section is projected into AGENTS.md (PROJECTED_HANDBOOK_SECTIONS in scripts/sync-project-guidance.js); Codex and OpenCode also reach it through CONTRIBUTING.md §Pull Request Process and the usage text pr-check.mjs prints without arguments.

Documentation Map

TopicDoc
Architecture & runtimedocs/architecture/overview.md
SQLite persistencedocs/architecture/sqlite-persistence.md
Configuration file, precedence, startup refusalsdocs/reference/configuration.md
Workspaces, overlays, resource pathsdocs/guides/custom-resources.md
MCP tools & symbolic commandsdocs/reference/mcp-tools.md
MCP contract maintenancedocs/guides/mcp-contract-maintenance.md
Prompt authoringdocs/tutorials/build-first-prompt.md
Chains lifecycledocs/concepts/chains-lifecycle.md
Gatesdocs/guides/gates.md
Injection controldocs/guides/injection-control.md
Identity & scopedocs/guides/identity-scope.md
Skills Syncdocs/guides/skills-sync.md
Telemetry & observabilitydocs/guides/telemetry-observability.md
Troubleshootingdocs/guides/troubleshooting.md
Retired spellings (generated)docs/reference/upgrading.md
Contributing & PR processCONTRIBUTING.md
README charter (root README authoring rules)docs/portfolio/readme-charter.md
Release highlightsCHANGELOG.md

Read the relevant doc before editing. Update docs when behavior changes.

Command Reference (run inside server/)

CommandPurpose
npm run buildesbuild bundle -> dist/index.js
npm run verify:mcpSpawn a server from dist/ and prove all 3 MCP tools answer — use instead of restarting Claude Code to check a build. Refuses to run against a stale dist/
npm run typecheckStrict TS type validation — src/ only, tsconfig.json excludes tests/
npm testFull Jest suite
npm run lint:ratchetFail if ESLint violations increased or decreased without lowering the baseline
npm run typecheck:tests:ratchetFail if tests/ type errors increased or decreased without a baseline update. Covers call sites typecheck misses — a broken test file can otherwise land green
npm run generate:contractsRegenerate MCP schemas from contracts
npm run validate:lockfile-syncFail when a tracked package-lock.json (root or server/) has drifted from its installed node_modules — compares npm's own node_modules/.package-lock.json, so no output parsing
npm run setup:pythonInstall the pinned Ruff/Pyrefly/Pytest/PyYAML from requirements-dev.txt — the same file CI installs from
npm run validate:allFull validation suite
npm run validate:archDependency Cruiser architecture rules
npm run validate:contractsVerify generated artifacts in sync
npm run validate:domain-ownershipCheck the Domain Ownership Matrix against every module's owns declaration, both directions
npm run validate:tool-parameter-readsFail when a tool command declares a parameter its code never reads, or its code reads a parameter the command does not declare, on all three tools. A read is a property read reaching the handler, processor or pipeline stage — never a name in a string, and never a destructured key that is not used
npm run validate:retirementsJoin retirements.json to its refusal sites, test drivers, docs and generated page; warn past forgetAfter
npm run retirements:listPrint each retired spelling with its dates and refusal sites
npm run test:integrationFIRST for new features
npm run test:coverageBaseline coverage (target: >80%)
npm run skills:exportExport skills from skills-sync.yaml

Domain Ownership Matrix (ENFORCED)

Stages are thin orchestration. Domain logic lives in owner services.

validate:domain-ownership checks this table both ways against each module's module.yaml owns block -- a row and its declaration must change together, and a row naming a symbol nobody exports, or a path the symbol is not defined in, fails.

If you need...Owner ServiceStage May Only
Gate normalizationGateService (gates/services/)Call gateService.normalize()
Gate enhancementGateEnhancementServiceCall enhancementService.enhance*()
Gate selectionGateManager (gates/gate-manager.ts)Call gateManager.selectGates()
Gate enforcement moderesolveEnforcementMode (execution/pipeline/decisions/gates/)Call resolveEnforcementMode(mode) -- a pure import, because context.gateEnforcement is optional and ?. would silently relax enforcement
Gate verdict processingGateVerdictProcessor (gates/services/)Call processor.handleGateAction()
Inline gate parsingInlineGateProcessor (gates/services/)Call processor.processInlineGates()
Prompt resolutionPromptRegistry (prompts/registry.ts)Call registry.get()
Command parsingUnifiedCommandParser (execution/parsers/command-parser.ts)Call parser.parseCommand()
Step captureStepCaptureService (execution/capture/)Call captureService.captureStep()
Response assemblyResponseAssembler (execution/formatting/)Call assembler.format*()
Framework selectionFrameworkManager (frameworks/)Call frameworkManager.selectFramework()
Framework validityFrameworkManagerCall frameworkManager.getFramework(id) -- never hardcode
Injection decisionsInjectionDecisionService (execution/pipeline/decisions/injection/)Call service.decide()
Style resolutionStyleManager (modules/formatting/style-manager.ts)Call styleManager.getStyle()
Delegation handoff evidenceresolveHandoffEvidence (execution/delegation/handoff-contract.ts)Call resolveHandoffEvidence(input) -- a pure import, never re-parse the HANDOFF RESULT trailer inline
Detached report routingresolveDetachedReport (execution/delegation/detached.ts)Call resolveDetachedReport(input) -- a pure import; a late result lands on the node its trailer names, never on the current step

Key Constraints

  • MCP Contract Dev: Verify upstream first (rg "paramName" src/mcp/tools src/modules src/engine). Contract, schema, generated metadata, router, manager/types, and service must agree.
  • The server executes shell commands, under operator-held controls. shell_verify gate criteria and the inline :: verify:"..." operator run through sh -c (shared/utils/process.ts); script tools run an author-supplied file through a fixed interpreter. Ground-truth verification by exit code is the feature. What bounds it: MCP_SHELL_VERIFY_ALLOWLIST over WHICH command (unset refuses every shell verification with a message naming the variable; never a degrade-to-advisory), MCP_SHELL_VERIFY_ALLOWED_DIRS over WHERE (unset means the server's own directory), and an unconditional refusal of resource-supplied environment keys that decide what a command resolves to (PATH, LD_*, NODE_OPTIONS, PYTHONPATH, BASH_ENV, IFS and siblings). Both transports reach the same sink. Entry format, the UNSAFE_ALLOW_ALL sentinel and the refused-key list: docs/guides/gates.md §shell_verify.
  • Instruction surface (accepted, documented): a prompt's systemMessage, userMessageTemplate, description and argument descriptions ARE instruction to the client LLM. Two surfaces deliver that text before anyone invokes anything: prompts/list (fetched at connect) carries every description, and resource_manager list detail:"full" returns every systemMessage. Treat a prompt pack as a dependency, not a config file. The HTTP catalog route is credential-gated; the MCP surface is not, because the operator chose the client.
  • Guidance owner: PromptGuidanceService remains the central framework-guidance service. Do not introduce a parallel coordinator/orchestrator with overlapping responsibility.
  • Framework validity: Always frameworkManager.getFramework(id) -- never hardcode framework lists.
  • Consolidation over addition: Enhance existing systems vs creating new ones.
  • Retired spellings: a retired spelling is refused, never accepted with a note. It has one entry in tooling/contracts/registries/retirements.json; its refusal site reads the entry's member from the generated shared/utils/_generated/retirement-notices.ts (namespace import; npm run generate:retirements-doc writes it), or, outside TypeScript (a shipped resource script, a hook), the entry's refusalSites names the file and a marker it holds; validate:retirements joins the two. Guides never name it: only the generated docs/reference/upgrading.md does. Wording that calls a form old but still accepted (still works, legacy, deprecated) fails the same gate in docs and in strings the product shows, outside the dated exemptions in server/scripts/retirement-wording.json. So does a sentence in a user-facing or architecture doc that promises a change (a scheduled release, a default about to flip, a temporary state): a doc says what the product does today, and a planned change is written in a plan. -> CONTRIBUTING.md §Retiring a Spelling
  • Pipeline state: Use context.gates, context.frameworkAuthority, context.diagnostics -- never mutate arrays directly.
  • Module organization: import the defining module directly. Banned is the compat re-export shim -- a file whose whole body is export ... from AND which carries a back-compat marker, giving a symbol a second import path rg misses (ESLint claude/no-compat-reexport-shim). A markerless barrel is not banned (~60 exist) but prefer direct imports: validate:arch expresses layer and cycle boundaries as paths, and a barrel spanning layers launders the real edge. Dead barrels are found by npx knip, not validate:arch. Use internal/ for a genuinely private region.
  • Concurrent sessions: work in a linked worktree created with npm run worktree:create -- <path> <branch> --from origin/main, never a second session in this checkout and never Claude Code's --worktree/EnterWorktree (CONTRIBUTING.md §Working in a second worktree records why, including the shared node_modules symlinks). Set a distinct PORT if two trees run servers.
  • Commit convention: Conventional Commits enforced. Scopes (commitlint.config.mjs is the enforced list; keep this and CONTRIBUTING.md in lockstep with it): server, cli, runtime, pipeline, gates, frameworks, prompts, chains, styles, scripts, hooks, resources, mcp-tools, contracts, parsers, ci, deps, config, logging, metrics, docs, tests, semantic, execution.
  • Environment (paths): MCP_WORKSPACE roots resources and state; MCP_RUNTIME_ROOT/MCP_CONFIG_PATH override theirs. One ordered list per type, earlier wins (getResourceLocations): project .claude-prompts/ (STDIO), the workspace folder (the write root without a project folder), paths.resources entries with "bundled" where listed (no list: last; left out: no shipped content). Unusable paths refuse startup; the plugin sets no path env, Codex's mcp.json keeps ${PLUGIN_ROOT}. -> docs/reference/configuration.md · docs/guides/custom-resources.md
  • Environment (secrets): MCP_CATALOG_READ_TOKEN gates executable prompt detail/history/compare; MCP_CATALOG_WRITE_TOKEN independently gates preview/apply/rollback and every legacy /api/v1/tools/* mutation. Either unset value refuses its surface (503), equal read/write values disable writes, and authentication runs before prompt lookup/body parsing. MCP_HTTP_ALLOWED_ORIGINS is a comma-separated allowlist for requests carrying Origin; absent Origin remains valid for server-side clients. HTTP transport only — STDIO reads none of these values.

-> .claude/rules/mcp-contracts.md for critical contract constraints (path-loaded) -> .claude/rules/sqlite-persistence.md for critical persistence constraints (path-loaded) -> docs/guides/mcp-contract-maintenance.md for the full contract procedure -> docs/architecture/sqlite-persistence.md for the table map, scope split, and schema history -> docs/architecture/overview.md for architecture, pipeline stages, subsystems -> docs/reference/mcp-tools.md for MCP tool workflows, symbolic command language -> docs/guides/injection-control.md for injection types, frequency, hierarchy -> docs/guides/gates.md for gate/framework structure and hot-reload -> /testing skill for test patterns and project-specific coverage

Conditional project guidance

  • Multi-Platform Extension Alignment (hooks/**, .claude-plugin/**, manifest.json, mcp.json, server/scripts/synchronize-downstream-lock.js) -> before editing a matching path, read .claude/rules/extension-alignment.md and treat it as mandatory project guidance.
  • MCP Contract Maintenance Standards (server/tooling/contracts/**/*.json, server/src/mcp/contracts/schemas/_generated/**, server/src/mcp/tools/**/*.ts, server/scripts/generate-contracts.ts, docs/reference/mcp-tools.md) -> before editing a matching path, read .claude/rules/mcp-contracts.md and treat it as mandatory project guidance.
  • state.db Persistence Rules (server/src/infra/database/**, server/src/**/*-store.ts, server/src/**/*-registry.ts, server/src/**/*-indexer.ts, server/scripts/validate-table-contracts.ts, server/scripts/validate-no-phantom-columns.ts) -> before editing a matching path, read .claude/rules/sqlite-persistence.md and treat it as mandatory project guidance.

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.