Install
.traffical/ directory.
What it does
Set up from zero
Installs the CLI, logs in (device flow), finds or creates a project, and scaffolds
.traffical/ — including a browser-safe SDK key.Wire the SDK
Installs the right
@traffical/* package and wires the provider/client for your framework — React, Next.js, Svelte, Node, React Native, and more.Parametrize code
Lifts hardcoded values — prices, copy, thresholds, colors — into typed parameters you can control without a deploy.
Author config-as-code
Edits
.traffical/config.yaml, runs push, and keeps generated types in sync — without inventing CLI commands or keys.Place events correctly
Adds
track() at the real conversion point (not on click or render), with the right signature for each SDK.Audit a codebase
Scans for hardcoded values and hand-rolled flags (env toggles,
if (FLAG), LaunchDarkly/Split/Unleash) and proposes a prioritized migration.Parametrize, don’t flag
The skill is built around one core habit, and it’s the one that pays off the most: parametrize the real values — don’t just wrap them in on/off flags. A boolean feature flag only buys you on/off. A typed parameter buys you on/off and every value in between — controllable and experimentable forever, from the dashboard or via the API, without another code change. This is the “parametrize once, control forever” idea: the moment a value lives in Traffical, anyone — an engineer, a PM in the dashboard, or an automated optimizer — can change it, ramp it, or test it.| Boolean flag | Typed parameter | |
|---|---|---|
| What it controls | on / off | on/off and any value |
| Change without a deploy | toggle only | every value (copy, price, threshold, color…) |
| Experiment | A/B the flag | A/B/n, gradual rollouts, bandit optimization on the value |
| Who can change it | an engineer + a deploy | anyone, from the dashboard or API |
- Flag-first (weak)
- Parametrize the substance (what the skill does)
feature.* booleans for things that are genuinely binary — a true kill switch, or a feature that’s simply present or absent — and reaches for a typed value parameter everywhere else. When it sees a boolean about to gate a block of hardcoded values, it lifts those values into parameters instead. See Feature flags for where booleans still fit.
How it helps with the work
New features, built experiment-ready
When you ask the agent to build something new, the skill makes it build it parametrized and rollout-ready by default — typed parameters with in-code defaults, read through the SDK, with a conversion event wired in. You can ship it dark, ramp it, or A/B test it later without revisiting the code.Existing codebases
Point the agent at code you already have:- Audit — it produces a prioritized list of what to move into Traffical (hardcoded values, magic numbers, hand-rolled flags), with a ready-to-paste
config.yamlsketch and a rollout order — without changing your code until you ask. - Parametrize — it turns a specific hardcoded value into a parameter: defines it in config with the default equal to the current value (so behavior is unchanged on day one), runs
push, then replaces the literal with an SDK read. - Migrate flags — it converts env-var toggles or third-party flags into Traffical parameters, usually richer than a 1:1 boolean (e.g. a
NEXT_PUBLIC_NEW_HEROenv flag becomes aui.hero.variantenum pluscopy.hero.headline, so you can test layouts and copy, not just on/off).
Wiring and correctness
The skill knows the per-framework provider setup, the exacttrack() signature for each SDK, identity binding (unitKeyFn / identify() for logged-in users), SSR hydration, and how to keep config-as-code in sync. Because it’s checked against the real SDK, it doesn’t drift into wrong package names, exports, or key formats.
Example prompts
The skill triggers on natural requests — you don’t name it. A few examples:| You say | The agent does |
|---|---|
| ”Set us up with Traffical and put the checkout button color behind it.” | Logs in, inits the project, installs @traffical/react, defines checkout.button.color, wires the provider, reads it via the SDK, and pushes. |
| ”Go through this repo and tell me what we should move into Traffical.” | Writes a prioritized TRAFFICAL_AUDIT.md — hand-rolled flags, revenue levers, untracked conversions — with a config sketch and rollout order. No code changed. |
| ”Make the pricing card’s discount, CTA, and highlight color controllable without a redeploy.” | Lifts each value into a typed parameter (number with constraints, strings), reads them via the SDK with in-code defaults, and pushes. |
| ”We’re flying blind on checkout — nothing fires when an order completes.” | Defines a purchase currency event and fires track() at the success point (with flushEvents() before navigation, where relevant). |
Benefits
- Right the first time — convention-following parameter names, correct event placement, correct SDK wiring.
- Parametrize-first — your code becomes controllable and experimentable without redeploys, by design.
- Faster — setup, SDK wiring, and config authoring that would take several docs pages happen in one pass.
- Safe — config-as-code stays the source of truth; the skill never fabricates keys or commands and respects the boundary (it parametrizes and tracks; experiments and policies stay in the dashboard).
- Consistent — every parameter and event follows the same conventions across your team.
Next steps
CLI
The config-as-code commands the skill drives.
Configuration file
Every field in
config.yaml, project.yaml, and metrics.yaml.Parameters
Typed values with defaults — what the skill parametrizes into.
Quickstart
Resolve a parameter and track an event by hand.