/walkeros:walkeros-create-transformerfrom walkeros
Guides creating a walkerOS transformer to validate, enrich, or redact events in a pipeline. Covers research, scaffolding, implementation with TDD, and documentation.
Ships in walkeros. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Before starting, read these skills:
| Category | Purpose | Example |
|---|---|---|
| Validate | Check event structure/content | JSON Schema, required fields |
| Enrich | Add data to events | Server timestamps, geo data |
| Redact | Remove/mask sensitive data | Strip PII, anonymize IPs |
1. Research → Understand use case (validate/enrich/redact)
2. Examples → Create event before/after examples FIRST
3. Scaffold → Copy template, configure package.json
4. Convention → Add walkerOS.json metadata and buildDev
5. Implement → Build transformer with TDD
6. Test → Verify against example transformations
7. Document → Write README
This skill includes reference files you can copy:
step.ts, events.ts
(which its unit tests read) and config.ts (sample configs)Copy them into a package as Phase 3 lays it out: index.ts to
src/transformer.ts, types.ts to src/types.ts, schemas.ts to
src/schemas/index.ts, index.test.ts to src/__tests__/stepExamples.test.ts,
conformance.test.ts to src/__tests__/ and examples/ to src/examples/.
Goal: Understand what the transformer needs to do.
# Reference implementation
ls packages/server/transformers/fingerprint/
# Transformer types
cat packages/core/src/types/transformer.ts
Goal: Define event transformations in dev entry FIRST.
mkdir -p packages/server/transformers/[name]/src/{examples,schemas}
Write one step example per case in src/examples/step.ts: events that pass
through (modified or not), the expected output after processing, and events that
are blocked (for validators). Each export is one Flow.StepExample:
// examples/step.ts
import type { Flow } from '@walkeros/core';
export const orderPasses: Flow.StepExample = {
title: 'Order passes',
description: 'An order event passes through unchanged.',
in: { name: 'order complete', data: { id: 'ORD-123' } },
out: [
['return', { event: { name: 'order complete', data: { id: 'ORD-123' } } }],
],
};
export const debugFiltered: Flow.StepExample = {
public: false,
description: 'A debug event is dropped.',
in: { name: 'debug test', data: { message: 'noise' } },
out: [['return', false]], // the transformer drops this event
};
in is a walkerOS event; out is the ['return', value] effect: the result
the transformer returns ({ event }), or false for an event it drops. A
failure example sets outcome instead (see Phase 6). Set title +
description for public examples; mark test-only fixtures with public: false.
src/examples/index.ts exports them with export * as step from './step';. See
using-step-examples for the Three
Type Zones.
export * as schemas from './schemas';
export * as examples from './examples';
npm run build)Template transformer: packages/server/transformers/fingerprint/ (a server
transformer). A platform-neutral transformer lives in packages/transformers/
(for example validate, ga4).
cp -r packages/server/transformers/fingerprint packages/server/transformers/[name]
cd packages/server/transformers/[name]
# Update package.json: name, description, repository.directory
Directory structure:
packages/server/transformers/[name]/
├── src/
│ ├── index.ts # Main export
│ ├── transformer.ts # Transformer implementation
│ ├── types.ts # Settings, Types interfaces
│ ├── dev.ts # Exports schemas and examples
│ ├── examples/
│ │ ├── index.ts # export * as step from './step'
│ │ └── step.ts # Step examples
│ ├── schemas/
│ │ └── index.ts # Zod schemas for settings
│ └── __tests__/ # stepExamples.test.ts, conformance.test.ts
├── package.json
├── tsconfig.json
├── tsup.config.ts
├── jest.config.mjs
└── README.md
Every walkerOS package ships a walkerOS.json file for CDN-based schema
discovery.
walkerOS field to package.json{
"walkerOS": {
"type": "transformer"
},
"keywords": ["walkerOS", "walkerOS-transformer", ...]
}
buildDev() in tsup.config.tsKeep buildDev() in the defineConfig array (the template package's
tsup.config.ts has it):
import { buildDev } from '@walkeros/config/tsup';
// In defineConfig array:
buildDev(),
It builds src/dev.ts and writes dist/walkerOS.json from the schemas,
examples and hints it exports.
If your transformer has capabilities, behaviors, or troubleshooting patterns not
obvious from schemas alone, add hints. See walkeros-writing-documentation
skill for full guidelines.
Create src/hints.ts:
import type { Hint } from '@walkeros/core';
export const hints: Hint.Hints = {
'validation-behavior': {
text: 'Describes how validation works. See settings schema for options.',
code: [{ lang: 'json', code: '{ "settings": { ... } }' }],
},
};
Export from src/dev.ts:
export * as schemas from './schemas';
export * as examples from './examples';
export { hints } from './hints';
Guidelines:
walkerOS field in package.json with type: "transformer"buildDev() in tsup.config.tsdist/walkerOS.jsonwalkerOS and walkerOS-transformerA third-party npm dependency that cannot be ESM-bundled (uses __dirname,
ships a .node binary, etc.) needs no declaration: server bundles are traced
with nft, which copies every file the bundle reaches at runtime. Do not add a
walkerOS.bundle field to package.json: the CLI ignores it and warns
still declares walkerOS.bundle.<keys>; this is ignored. See
walkeros-using-cli: server bundles use nft tracing.
Now write code to transform examples as expected.
See templates/validation/types.ts for the
pattern. Define Settings and Types interfaces.
Transformers use the context pattern - they receive a single context
object containing config, env, logger, id, and collector.
See templates/validation/index.ts for a complete implementation example.
Key patterns:
config, logger, id from init contextwalkeros validate, walkerOS.json and the docs; the
transformer applies its defaults inline and does not parse settings at
runtimepush function gets event + push context{ event } (continue), void (passthrough), false
(cancel on purpose: a deliberate drop, not a failure; the push answers
ok: true), or an array of results to fork the event (see
understanding-transformers)StepError from @walkeros/core with a
code. missing-input is the code for an event or an ingest that lacks the
input the transformer needs (do not drop it silently); config for a missing
setting. init throws instead of returning false or returning early, and a
transformer never logs a failure itself: the collector turns the throw into
ok: false with the transformer named and writes the one ERROR line. A
transformer that throws a plain error fails with the code transformer.src/index.ts:
export { transformerRedact } from './transformer';
export type { Settings, Types } from './types';
npm run build passesnpm run verify:touched -- <platform>-transformer-<name> passes (L1:
typecheck + lint + test; the argument is the package name after
@walkeros/, transformer-<name> for a platform-neutral one)Verify implementation produces expected outputs.
See templates/validation/index.test.ts for a complete test suite showing:
createTransformerContext() helper - a typed init context for unit
tests, defined in the test filecreatePushContext() helper - the same for the push contextevent, void, or false returnsconformance('transformer', transformer, options) from
@walkeros/collector/dev (profile transformer) runs it on a real
collector, see
packages/server/transformers/fingerprint/src/__tests__/conformance.test.ts.
A transformer needs no page. A transformer whose input is the ingest and
not an event declares its failure with a missing-input example (an event as
in, out: [], an outcome and a description).npm run verify:touched -- <platform>-transformer-<name> passes (L1)Follow the writing-documentation skill for:
Key requirements for transformer documentation:
Beyond
understanding-development
requirements (build, test, lint, no any):
dev.ts exports schemas (with settings; z.object({}) when the step
has none) and exampleswalkerOS.exports): exportExamples
and exportSchemas in dev.ts list exactly those exports, the default
included, and every exportSchemas entry has settings; the build fails
otherwise (see
using-step-examples)StepError (missing-input for absent input),
init throws instead of returning false, conformance test passeswalkerOS.json generated at build timewalkerOS field in package.json| What | Where |
|---|---|
| Template | packages/server/transformers/fingerprint/ |
| Types | packages/core/src/types/transformer.ts |
| Chaining logic | packages/collector/src/transformer.ts |
TESTING.md (opens in a new tab)examples/config.ts (opens in a new tab)examples/events.ts (opens in a new tab)examples/index.ts (opens in a new tab)examples/step.ts (opens in a new tab)templates/validation/conformance.test.ts (opens in a new tab)templates/validation/index.test.ts (opens in a new tab)templates/validation/index.ts (opens in a new tab)templates/validation/schemas.ts (opens in a new tab)templates/validation/types.ts (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub elbwalker/walkeros --plugin walkeros22 skills in this plugin
/walkeros-create-cmp-sourceUse when creating a new walkerOS CMP (consent management platform) source. Structured fill-in-the-blanks workflow that turns any CMP's consent API into a walkerOS source package. Covers CookieFirst, Usercentrics, CookiePro/OneTrust patterns and generalizes to any CMP./walkeros-create-destinationUse when creating a new walkerOS destination to send events to a vendor or API (GA4/gtag, Meta/Facebook Pixel, Mixpanel, Amplitude, a custom HTTP API, Measurement Protocol), web or server-side. Example-driven workflow: research the vendor SDK and define step examples before implementing the destination interface, env pattern, and mappings./walkeros-create-sourceUse when creating a new walkerOS source to capture events (browser source, dataLayer interception, server/HTTP source, webhook receiver, event capture), web or server-side. Example-driven workflow: research the input format and define step examples before implementing the push interface, createTrigger, and env pattern./walkeros-debuggingUse when walkerOS events aren't reaching destinations, debugging event flow, or troubleshooting mapping issues. Covers common problems and debugging strategies./walkeros-mapping-configurationUse when configuring walkerOS event mappings for specific use cases. Provides recipes for GA4, Meta, custom APIs, and common transformation patterns./walkeros-mcp-actionsUse when an AI agent calls walkerOS MCP tools from code (code execution / Code Mode, a Worker, or an app sandbox) to validate, simulate, bundle, or inspect flows and packages, and wants to filter large results in code instead of issuing many separate tool calls.Other plugins' skills for the same job