walkeros-create-cmp-so…
A CMP source is a specialized walkerOS source that listens to a consent management platform's events and translates consent…
Transformers are middleware for **validating**, **enriching**, and **redacting** events in the walkerOS pipeline. They run in chains at configurable points between sources, collector, and destinations.
Claude Code
$ npx -y skills add elbwalker/walkerOS --skill walkeros-understanding-transformers --agent claude-code
Codex
$ npx skills add elbwalker/walkerOS --skill walkeros-understanding-transformers -a codex -y
Cursor
$ npx skills add elbwalker/walkerOS --skill walkeros-understanding-transformers -a cursor -y
Gemini CLI
$ npx skills add elbwalker/walkerOS --skill walkeros-understanding-transformers -a gemini-cli -y
GitHub Copilot
$ npx skills add elbwalker/walkerOS --skill walkeros-understanding-transformers -a github-copilot -y
OpenCode
$ npx skills add elbwalker/walkerOS --skill walkeros-understanding-transformers -a opencode -y
Windsurf
$ npx skills add elbwalker/walkerOS --skill walkeros-understanding-transformers -a windsurf -y
name: walkeros-understanding-transformers description: Use when working with walkerOS transformers, understanding event validation/enrichment/redaction, or learning about transformer chaining. Covers interface, return values, and pipeline integration.
Transformers are middleware for **validating**, **enriching**, and **redacting** events in the walkerOS pipeline. They run in chains at configurable points between sources, collector, and destinations.
**Core principle:** Transformers transform events. They don't capture (sources) or deliver (destinations); they modify events in-flight.
| Use Case | Purpose | Example | | ------------ | ----------------------------------------- | ------------------------ | | **Validate** | Ensure events match schema contracts | JSON Schema validation | | **Enrich** | Add server-side data to events | User segments, geo data | | **Redact** | Remove sensitive data before destinations | Strip PII, anonymize IPs |
| Package | Env | Purpose | | ------------------------------------------ | ------ | -------------------------------------------------- | | `@walkeros/transformer-validate` | both | Enforce JSON Schema contracts on events at runtime | | `@walkeros/transformer-ga4` | both | Decode GA4 Measurement Protocol hits into events | | `@walkeros/server-transformer-bot` | server | Annotate an automation score and client category | | `@walkeros/server-transformer-fingerprint` | server | Hash request fields into a rotating visitor id | | `@walkeros/server-transformer-file` | server | Serve static files from a store |
`@walkeros/server-transformer-file` owns the paths inside `settings.prefix` (`"/"` owns every routed path; without a prefix it owns none). A hit answers with the file, a miss inside the prefix answers 404, and a failing store read answers 503. A missing store stops the flow at startup. Route only file requests to a step that owns `/`, as flow-complete does with a `.js` case: any other path routed to it answers 404 and its event stops there.
`@walkeros/transformer-validate` is the runtime arm of a [contract](../../website/docs/getting-started/flow/contract.mdx). Event shapes live in the top-level `contract` block; the transformer references one via `$contract.<name>` in its `contract` setting and validates the canonical event. `mode: "strict"` drops invalid events (chain-stop); `mode: "pass"` (default) annotates `event.source.valid` and continues so a downstream step can route on the verdict. `format: true` additionally checks the canonical `WalkerOS.Event` structure. Filtering is the same mechanism: an inline schema that rejects the unwanted events plus `mode: "strict"`; there is no separate `ignore` field. See [Website: Validate transformer](../../website/docs/transformers/validate.mdx).
See [packages/core/src/types/transformer.ts](../../packages/core/src/types/transformer.ts) for canonical interface.
Transformers use a context-based initialization pattern:
import type { Transformer } from '@walkeros/core';
export const transformerMyTransformer: Transformer.Init<Types> = (context) => {
const { config = {}, env, logger, id } = context;
// Apply defaults inline: flow.json is developer-controlled, so no
// runtime validation. Shape checks live in ./schemas and are used by
// `walkeros validate` and dev tooling, never at runtime.
const userSettings = config.settings || {};
const settings = {
...userSettings,
// example default: threshold: userSettings.threshold ?? 100,
};
return {
type: 'my-transformer',
config: { ...config, settings },
push(event, pushContext) {
// Process event
return { event };
},
};
};**Init Context contains:**
| Property | Type | Purpose | | ----------- | -------------------- | --------------------------------------- | | `config` | `Transformer.Config` | Settings, mapping, next chain | | `env` | `Types['env']` | Environment deps (stores via `$store.`) | | `logger` | `Logger` | Logging functions | | `id` | `string` | Transformer identifier | | `collector` | `Collector.Instance` | Reference to collector | | `ingest` | `Ingest` | Empty (`_meta` only); see Push Context |
| Member | Purpose | Required | | --------- | ------------------------------------ | ------------ | | `type` | Transformer type identifier | **Required** | | `config` | The transformer's config | **Required** | | `push` | Process event, return modified/false | **Required** | | `init` | One-time initialization | Optional | | `destroy` | Cleanup resources | Optional |
The `push` function controls event flow:
| Return | Behavior | | -------------------- | --------------------------------------------------------------------- | | `{ event }` | Continue chain with modified event | | `void` | Continue chain, event unchanged | | `false` | Stop chain, event dropped | | `{ event, next }` | Route via `next` in place of its own `next`, then the chain continues | | `{ event, respond }` | Continue chain with wrappe
From browser to BigQuery and ad platforms - warehouse-native, and ready for AI agents via MCP.
A CMP source is a specialized walkerOS source that listens to a consent management platform's events and translates consent…
Use when creating a new walkerOS destination to send events to a vendor or API (GA4/gtag, Meta/Facebook Pixel, Mixpanel,…
Use when creating a new walkerOS source to capture events (browser source, dataLayer interception, server/HTTP source, webhook…
| Symptom | Likely Cause | Check | | ---------------------------------- | ---------------------------- |…
Read [understanding-mapping](../walkeros-understanding-mapping/SKILL.md) first for core concepts.
Use this skill to extract structured Markdown/JSON from PDFs and document images—tables with cell-level precision, formulas as…
Estimates intracellular metabolic fluxes from steady-state carbon-13 isotope-tracing measurements using validated atom maps,…