Skip to content

docs: ship agent guides and skills from every published package - #310

Open
WiktorStarczewski wants to merge 6 commits into
nextfrom
docs/agents-md-for-consumers
Open

docs: ship agent guides and skills from every published package#310
WiktorStarczewski wants to merge 6 commits into
nextfrom
docs/agents-md-for-consumers

Conversation

@WiktorStarczewski

Copy link
Copy Markdown
Collaborator

Why

Someone installs the web SDK, opens their AI agent, and asks it to build something Miden-related. Today the agent answers from training data, which for a pre-1.0 SDK is usually a version or two stale.

The blocker is that no agent auto-loads instruction files from node_modules — Claude Code walks up from cwd for CLAUDE.md, Cursor and Codex read AGENTS.md from the project, and none descend into dependencies. So this splits into a part we ship and a part that has to reach the consumer's repo. This PR is the first: the substrate.

What ships

Every published package now carries an AGENTS.md index plus a skills/ directory inside its tarball:

Package Skills
@miden-sdk/miden-sdk web-client-usage, frontend-pitfalls, signer-integration
@miden-sdk/react react-sdk-patterns, testing-patterns
@miden-sdk/vite-plugin vite-wasm-setup

Because they ship with the code, they're version-matched: a consumer pinned to 0.15 gets 0.15 guidance, not whatever HEAD says.

@miden-sdk/miden-sdk also ships its README.md for the first time — it previously published neither a readme nor any documentation, so its npm page was blank.

Each readme gains a marker-delimited block to paste into a project's root AGENTS.md, which is the part that actually makes an agent read any of this. A command to inject it automatically follows in a separate PR.

Consolidating three drifting copies

These skills already existed in agent-tools and were copied into frontend-template. Every shared skill had drifted:

skill agent-tools frontend-template
react-sdk-patterns 386 560
testing-patterns 237 338
frontend-pitfalls 202 186
signer-integration 196 186
frontend-source-guide 174 165
vite-wasm-setup 140 134
miden-concepts 116 110

Writing fresh files here would have made a third copy. Instead the drifted pairs are reconciled into one canonical version each, taking agent-tools as the base and merging the sections frontend-template had accumulated and never upstreamed (five in react-sdk-patterns, two in testing-patterns), with the template's directory layout generalized out.

The split is by what the knowledge is about, which turns out to be measurable — the SDK skills cite @miden-sdk/* and never crates/, the internals skills cite crates/ and never @miden-sdk/*:

  • Here, shipped: anything documenting our public API. Now an API change and its documentation are the same PR, which is what stops the drift recurring.
  • Here, not shipped: idxdb-patterns, wasm-bridge — internals, so they sit in .claude/skills/.
  • agent-tools: everything cross-cutting — MASM, rust-sdk-*, miden-concepts, local-node-validation, slash commands.

Follow-up PRs drop the copies from agent-tools and frontend-template and point them at the published packages.

Also

  • Root CLAUDE.mdAGENTS.md, with CLAUDE.md reduced to an @AGENTS.md import so Claude Code still loads it. Same for packages/react-sdk/.
  • Root AGENTS.md documents the ownership boundary and the rule that a public-API change updates the shipped skill in the same PR.

Test plan

  • npm pack --dry-run confirms AGENTS.md, README.md and skills/ land in all three tarballs
  • CI green

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant