From routecraft-skills
Guides creation of new Routecraft adapters (source, destination, transformer, or multi-role) for integrations, connectors, and exchange producers/consumers.
How this skill is triggered — by the user, by Claude, or both
Slash command
/routecraft-skills:create-adapterThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Adapters are how Routecraft talks to the outside world. A source produces exchanges, a destination consumes them, and a transformer changes the body in flight. Many adapters fill more than one role.
Adapters are how Routecraft talks to the outside world. A source produces exchanges, a destination consumes them, and a transformer changes the body in flight. Many adapters fill more than one role.
You are writing this adapter for the user. Treat the linter (bun run lint) as authoritative once you have written the code: if it disagrees, the linter wins.
Use this skill when the user asks to:
process() calls with a reusable adapterIf the user only needs a one-shot data transformation inside a single capability, use .transform() or .process() directly instead. If the work is reusable across capabilities, it belongs in an adapter.
Before writing, confirm answers to these questions. Ask the user only the ones that are not already obvious from context.
.from(...)), Destination (.to(...), .enrich(...), .tap(...)), Transformer (.transform(...)), or several of these?body look like for sources you produce, and what does body need to look like for destinations you consume?First read reference/adapter-structure.md. It is the file layout, single-factory, class-naming, and options-naming convention every adapter follows; the rest of this skill assumes it.
Then read reference/examples-index.md and pick the row that best matches the answers above. The index maps intent to the relevant public doc page and the closest existing adapter on GitHub.
Then, in this order:
WebFetch the linked doc page (raw markdown variant on routecraft.dev/raw/docs/...)WebFetch the linked example adapter source on GitHub (use the raw.githubusercontent.com URL)Read packages/routecraft/src/adapters/<closest>/ end to end. Pay attention to file layout, the factory, the tagAdapter call, and the types moduleDo not write the adapter from memory. The patterns are precise and the examples are short. Read first.
Create the adapter under packages/routecraft/src/adapters/<concept>/ if you are inside this monorepo, or under your project's adapters/<concept>/ folder otherwise. Follow reference/adapter-structure.md for the file layout, the single per-concept factory and how it dispatches by payload, class naming, and the options-naming convention, and mirror the example you read.
The remaining authoring rules to keep in mind while writing:
tagAdapter(instance, factory, factoryArgs(...)), at every return path. The eslint plugin and tests rely on thisSymbol.for("routecraft.adapter.<concept>.<key>") so keys survive duplicate package copies in the same process{ ...exchange, body: newBody }). Do not mutate the incoming exchangerc error code from @routecraft/routecraft. Capabilities catch and surface these via the capability-level error handlerTests live in the package's test/ directory: packages/<pkg>/test/<name>.test.ts. Do not colocate tests next to source. Every test must have a JSDoc with @case, @preconditions, @expectedResult. Prefer the helpers from @routecraft/testing:
testContext() to build an isolated contextspy() for destinations whose payload you want to assert onpseudo("name", options) for a stand-in source or destinationmockAdapter(factory, {...}) to assert how a factory was calledFor the full pattern, fetch:
https://routecraft.dev/raw/docs/introduction/testing.md
Run, in this order, until each is clean:
bun run typecheck
bun run lint
bun run test
Use bun run <script> (not bun <script>) so Bun invokes the package.json script rather than its built-in test runner. If bun run lint complains, fix the code rather than silencing the rule. The linter encodes Routecraft's authoring rules; it is allowed to be stricter than this skill. If the linter does not catch something the user expected it to catch, that is a follow-up for the lint package, not a workaround here.
npx claudepluginhub routecraftjs/routecraft --plugin routecraft-skillsProvides CDSS development patterns for drug interaction checking, dose validation, clinical scoring (NEWS2, qSOFA), and alert classification integrated into EMR workflows.