Create Your Own Transformer
Build custom transformers for validation, enrichment, or redaction.
The transformer interface
Transformers are functions that receive a context object and return a transformer instance:
The context contains:
The returned instance must implement:
Return values
| Return | Behavior |
|---|---|
{ event } | Continue chain with modified event |
void | Continue chain, event unchanged |
false | Stop chain, event dropped |
{ event, next } | Redirect to a different chain (fan-out) |
{ event, respond } | Continue chain with wrapped respond function |
Minimal example
Push context
The push function receives an event and a push context:
config: Transformer configurationenv: Environment dependencieslogger: Scoped logger for outputid: Transformer identifiercollector: Access to collector instanceingest: Request metadata from source (optional)
Examples
Enrich: add server-side data
Validate: custom check
Using your transformer
Testing
Package convention
Every walkerOS package includes machine-readable metadata for tooling and discovery.
walkerOS field in package.json
| Field | Required | Description |
|---|---|---|
walkerOS | Yes | Object with type metadata (and platform for sources/destinations) |
Build-time generation
Use buildDev() from the shared tsup config to auto-generate walkerOS.json:
This file contains your package's JSON Schemas and examples, enabling MCP tools and the CLI to validate configurations without installing your package.
Optional: Hints
Packages can export a hints record from src/dev.ts to provide lightweight, actionable context beyond schemas and examples, such as validation behavior, enrichment patterns, or troubleshooting tips. Hints are serialized into walkerOS.json and surfaced via MCP tools. See the walkeros-create-transformer skill for details.
Publishing checklist
-
walkerOSfield in package.json - Keywords include
walkerosandwalkeros-transformer -
buildDev()in tsup.config.ts -
dist/walkerOS.jsongenerated on build -
npm run testpasses -
npm run lintpasses
Next steps
- Review Validator source as reference
- Learn about creating sources
- Learn about creating destinations