Token导航 LogoToken导航

Agent Skill · 开发

traffical(traffical 命令行)

traffical 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

traffical 是开发类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为接触敏感数据;许可证信息还不明确,第三方扫描有未通过项,按安装量在开发类的 21,746 个 Skill 里排第 18,889。

总安装 309周安装 13GitHub Stars 公开资料未说明下载 108核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:traffical(traffical 命令行)
来源仓库:https://github.com/traffical/skills
仓库路径:skills/traffical
安装命令:
npx skills add https://github.com/traffical/skills --skill traffical
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/traffical/skills --skill traffical

这个 Skill 是做什么的

开发类 Skill 面向写代码、改代码和排查问题,一般会读写仓库文件,部分还会执行构建或测试命令。

用于 GitHub 仓库状态跟踪与协作流程管理,帮助开发者快速掌握项目动态。可获取 Issue、PR 更新及提交历史,辅助任务分配与进度同步。通过 npx 命令直接安装并使用,无需复杂配置即可接入现有工作流。执行时需绑定有效 GitHub token,确保有权限访问目标仓库信息。

注意频繁调用可能受 API 速率限制,建议合理控制查询频率。

来源仓库内路径:skills/traffical

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/traffical/skills --skill traffical;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要接触敏感数据,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

traffical 怎么安装?

在终端执行 npx skills add https://github.com/traffical/skills --skill traffical。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

traffical 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

traffical 需要什么权限?

权限级别是接触敏感数据。该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

traffical 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

traffical 用的人多吗?

公开数据是累计安装 309 次,近一周安装 13 次,下载 108 次。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

traffical 安全吗?

第三方扫描有未通过项,风险较高。除非你确认过源码,否则不建议直接安装到常用环境。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。

先想清楚的地方

  • 需要接触敏感数据,装到常用环境前要先评估影响面。
  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理开发类任务、又不想每次都手写提示词的人。

不太适合

  • 环境里有大量密钥、凭证,不方便给第三方 Skill 读取的人。
  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

开发类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
skill-vetter

技能审查员 · OpenClaw

8,779,018986操作浏览器MIT-0通过
ontology

本体论 · OpenClaw

6,636,960576只读MIT-0通过
entra-app-registration

内部应用程序注册 · Codex、Claude

6,631,872764接触敏感数据未明确通过
entra-app-registration

内部应用程序注册 · Codex、Claude

3,757,680201接触敏感数据未明确通过
nano-banana-pro

纳米香蕉专业版 · OpenClaw

3,526,898364接触敏感数据MIT-0有提醒
traffical

traffical 命令行 · 本页

309—接触敏感数据未明确未通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Traffical

Traffical is a parameter-first experimentation and optimization platform. It unifies feature flags, A/B testing, and contextual bandits into a single system. SDKs resolve parameters locally at the edge — no per-request API calls, sub-millisecond latency, works offline.

Mental Model

Traffical is parameter-first. You define parameters with defaults, and Traffical handles the rest.

┌─────────────────────────────────────────────────────────────────────┐
│  Your Code                                                          │
│                                                                     │
│  1. Define parameters with defaults                                 │
│  2. Use the resolved values                                         │
│  3. Track events on conversion                                      │
└─────────────────────────────────────────────────────────────────────┘
                              ▲
                              │  (hidden from you)
                              ▼
┌─────────────────────────────────────────────────────────────────────┐
│  Traffical                                                          │
│                                                                     │
│  • Layers & policies for mutual exclusivity                         │
│  • Bucket assignment & deterministic hashing                        │
│  • Thompson Sampling & contextual bandits                           │
│  • Statistical analysis & optimization                              │
└─────────────────────────────────────────────────────────────────────┘

Key insights:

  1. Parameters, Not Experiments — You define parameters with defaults. Experiments, feature flags, and optimizations are policies that control parameter assignment. Your code doesn't need to know which.
  2. Resolution Is Local — The SDK fetches a config bundle once and caches it. Every resolution call is synchronous from cache — no network latency, no render flicker.
  3. Decisions Are Tracked Automatically — When you call useTraffical() or decide(), a decision event is automatically sent to Traffical (enabled by default via trackDecisions: true). This connects parameter resolution to conversion events for intent-to-treat analysis. No manual setup needed.
  4. Track Events for Learning — Call track() when valuable actions happen (purchase, signup, etc.). Traffical uses this data for adaptive optimization.

When to Use Traffical

ScenarioAction
Adding a new featureWrap in feature flag for gradual rollout
Changing existing UIA/B test against current implementation
Modifying conversion pathsExperiment with success metrics
Updating algorithms/logicTest impact before full rollout
Anything affecting revenueAlways experiment first

Recommended Workflow

Always use the Traffical CLI to manage parameters. The CLI is the primary tool for setting up and syncing configuration. Do not skip it.

  1. Initialize — Run npx @traffical/cli init --api-key <management-key> --framework <name> --yes to set up the project non-interactively (or check for an existing .traffical/ directory). The user must provide a Management Key or Full Access key from the dashboard. Always pass --framework and --yes to avoid interactive prompts.
  2. Define parameters — Add parameters and events to .traffical/config.yaml
  3. Sync — Run npx @traffical/cli push to sync parameters to the Traffical platform
  4. Install SDK — Add the appropriate SDK package to your project
  5. Use in code — Resolve parameters and track events using the SDK
  6. Verify — Run npx @traffical/cli status to confirm everything is in sync

The Traffical CLI

The CLI (@traffical/cli) is how you initialize projects, define parameters, and keep local config in sync with the Traffical platform. You can run it via npx (no global install required):

npx @traffical/cli <command>

Or install globally for shorter commands:

npm install -g @traffical/cli
traffical <command>

Check for existing setup

Look for a .traffical/ directory or traffical.yaml in the project root. If it exists, the project is already initialized — check the config for existing parameters before creating new ones.

Initialize a new project

If no .traffical/ directory exists, initialize Traffical:

Important: The --api-key flag requires a real Management Key or Full Access key. Never fabricate or guess API keys. If no key is available in environment variables (TRAFFICAL_API_KEY) or ~/.trafficalrc, ask the user to provide one from https://app.traffical.io/settings/api-keys.
# Basic init (will auto-detect framework and prompt if needed):
npx @traffical/cli init --api-key <management-key>

# Fully non-interactive init (recommended for AI agents and CI/CD):
npx @traffical/cli init --api-key <management-key> --framework react --yes

Available flags for init:

FlagDescription
--api-key <key>Management or Full Access key (falls back to TRAFFICAL_API_KEY env var or ~/.trafficalrc)
--framework <name>Skip framework detection. Values: react, nextjs, svelte, sveltekit, vue, nuxt, node
--project <id>Use a specific project (skips project selection prompt, useful with org-scoped keys)
-y, --yesAuto-accept all detected defaults — no interactive prompts
--no-sdk-keySkip automatic SDK key creation
For AI agents: Always pass --framework and --yes to avoid interactive prompts that will hang in non-TTY environments.

This creates:

.traffical/
├── config.yaml      # Parameter and event definitions (committed)
├── .env             # TRAFFICAL_API_KEY=... (gitignored, auto-generated SDK key)
├── .gitignore       # Ensures .env is never committed
├── AGENTS.md        # AI agent integration guide (project-specific)
└── TEMPLATES.md     # Framework-specific code templates

The CLI auto-detects your framework (React, Next.js, Svelte, SvelteKit, Vue, Nuxt, Node.js) and generates appropriate templates. Existing synced parameters and events are imported into config.yaml automatically.

After init, add TRAFFICAL_API_KEY from .traffical/.env to your project's .env or hosting environment for runtime SDK use. The auto-generated key has sdk:read and sdk:write scopes — just enough for parameter resolution and event tracking.

Managing parameters with the CLI

After initialization, use the CLI to keep local config and the Traffical platform in sync:

# After adding or modifying parameters in config.yaml — push to platform
npx @traffical/cli push

# Before writing code — check what parameters exist and their sync status
npx @traffical/cli status

# Pull latest parameters from the platform into local config
npx @traffical/cli pull

# Bidirectional sync (local wins for conflicts)
npx @traffical/cli sync

# Import specific parameters from the dashboard (supports wildcards)
npx @traffical/cli import "ui.*"

# Validate config without pushing (dry run)
npx @traffical/cli push --dry-run

Always run npx @traffical/cli push after modifying .traffical/config.yaml. This syncs your changes to the platform and prevents drift.

Authentication

Traffical uses different API key types for different purposes:

Key TypePrefixPurposeScopes
SDK Keytraffical_sk_*Runtime SDKs — fetch config, send eventssdk:read, sdk:write
Management Keytraffical_sk_*CLI, CI/CD — create/modify entities, push/pull/syncmgmt:read, mgmt:write
Full Access Keytraffical_sk_*Administrative — all operationssdk:*, mgmt:*, admin

How init handles keys

  1. You provide a Management Key (or Full Access key) via --api-key or ~/.trafficalrc
  2. The CLI authenticates and selects org/project
  3. The CLI auto-creates a project-scoped SDK key via the API and saves it to .traffical/.env
  4. The .traffical/.gitignore is created/updated to ensure .env is never committed

This means:

  • The Management Key stays in ~/.trafficalrc (for CLI operations like push/pull/sync)
  • The SDK Key goes into .traffical/.env (for runtime use in your app)
  • Only the least-privileged key (SDK) is used at runtime — no risk of leaking management access

SDK key location

The SDK key auto-generated by init is stored in:

.traffical/.env
# Contains: TRAFFICAL_API_KEY=traffical_sk_...

Copy this value to your project's .env or hosting environment variables for your SDK to use at runtime.

SDK configuration values

After traffical init, the .traffical/config.yaml contains project.id and project.orgId. Use these values (along with an env like "production") when initializing the SDK. The SDK key is in .traffical/.env as TRAFFICAL_API_KEY.

Install an SDK

PackageUse case
@traffical/reactReact and Next.js apps
@traffical/svelteSvelte and SvelteKit apps
@traffical/nodeServer-side Node.js (Express, Fastify, etc.)
@traffical/js-clientAny browser environment
# Pick the one matching your framework
npm install @traffical/react
# or
npm install @traffical/svelte
# or
npm install @traffical/node

SDK Usage

React / Next.js

Provider setup (wrap your app once):

import { TrafficalProvider } from "@traffical/react";

function App() {
  return (
    <TrafficalProvider
      config={{
        orgId: "org_xxx",
        projectId: "proj_xxx",
        env: "production",
        apiKey: "pk_live_your_public_key",
      }}
      // Optional: provide unitKeyFn for logged-in users
      // unitKeyFn: () => currentUser.id,
    >
      <MyApp />
    </TrafficalProvider>
  );
}

Use in components:

import { useTraffical } from "@traffical/react";

function CheckoutButton() {
  const { params, track } = useTraffical({
    defaults: {
      "checkout.button.color": "#1E6EFB",
      "checkout.button.label": "Buy now",
    },
  });

  return (
    <button
      style={{ backgroundColor: params["checkout.button.color"] }}
      onClick={() => track("checkout_click")}
    >
      {params["checkout.button.label"]}
    </button>
  );
}

Svelte / SvelteKit

Layout setup:

<!-- src/routes/+layout.svelte -->
<script>
  import { setTrafficalContext } from "@traffical/svelte";

  setTrafficalContext({
    orgId: "org_xxx",
    projectId: "proj_xxx",
    env: "production",
    apiKey: "pk_live_your_public_key",
    context: { userId: data.user?.id ?? "anonymous" },
  });
</script>

<slot />

Use in components (params and track are Svelte stores — use $ prefix):

<script>
  import { getTraffical } from "@traffical/svelte";

  const { params, track } = getTraffical({
    defaults: {
      "checkout.button.color": "#1E6EFB",
      "checkout.button.label": "Buy now",
    },
  });
</script>

<button
  style="background-color: {$params['checkout.button.color']}"
  on:click={() => $track("checkout_click")}
>
  {$params["checkout.button.label"]}
</button>

Node.js (Server-side)

import { createTrafficalClient } from "@traffical/node";

const traffical = await createTrafficalClient({
  orgId: "org_xxx",        // from .traffical/config.yaml
  projectId: "proj_xxx",   // from .traffical/config.yaml
  env: "production",
  apiKey: process.env.TRAFFICAL_API_KEY!,  // from .traffical/.env
});

// Resolve parameters (synchronous, from cached bundle)
const params = traffical.getParams({
  context: { userId: "user_789", locale: "en-US" },
  defaults: {
    "checkout.button.color": "#1E6EFB",
    "pricing.discount_pct": 0,
  },
});

// Track events (value goes in properties, unitKey in options)
traffical.track("purchase", { value: 49.99 }, { unitKey: "user_789" });

Node.js (CLI / Scripts)

For non-web contexts like CLI tools, batch jobs, or scripts, you can use @traffical/node without a web server. Use a machine or job identifier instead of a user ID:

import { createTrafficalClient } from "@traffical/node";

const traffical = await createTrafficalClient({
  orgId: "org_xxx",        // from .traffical/config.yaml
  projectId: "proj_xxx",   // from .traffical/config.yaml
  env: "production",
  apiKey: process.env.TRAFFICAL_API_KEY!,
});

const params = traffical.getParams({
  context: { unitKey: "batch-job" },
  defaults: {
    "feature.new_algorithm": false,
    "processing.batch_size": 100,
  },
});

if (params["feature.new_algorithm"]) {
  // Use new algorithm
}

track() API

The track() signature differs between client-side and server-side SDKs:

  • React/Svelte (client-side): track(event, properties?) — The decisionId and unitKey are automatically bound from the provider context. Just call track("purchase", {value: 49.99}).
  • Node.js (server-side): track(event, properties?, options?) — You must provide unitKey in the third argument: traffical.track("purchase", {value: 49.99}, {unitKey: userId}). Optionally pass decisionId for explicit attribution.

Config-as-Code

Parameters and events are defined in .traffical/config.yaml (or traffical.yaml). This file is the source of truth — version-control it alongside your code.

version: "1.0"
project:
  id: proj_xxx
  orgId: org_xxx

parameters:
  checkout.button.color:
    type: string
    default: "#1E6EFB"
    description: Primary CTA button color

  checkout.show_trust_badges:
    type: boolean
    default: false

  pricing.discount_pct:
    type: number
    default: 0

events:
  purchase:
    valueType: currency
    unit: USD
    description: User completes a purchase

  add_to_cart:
    valueType: count
    description: User adds item to cart

Parameter types

TypeUse case
stringColors, labels, URLs, template names
numberPrices, percentages, thresholds, timeouts
booleanFeature flags, simple toggles
jsonStructured config (multiple related settings)

Event value types

Value TypeUse case
currencyMonetary values (revenue, order value)
countNumeric counts (clicks, items, views)
ratePercentages or ratios
booleanBinary events (happened or not)

Adding events to config.yaml

Define events in the events: block of .traffical/config.yaml:

events:
  purchase:
    valueType: currency
    unit: USD
    description: User completes a purchase

  signup:
    valueType: boolean
    description: User creates an account

  page_view:
    valueType: count
    description: User views a page

Each event has:

  • valueType (required): currency, count, rate, or boolean
  • unit (optional): unit label for currency events (e.g., USD, EUR)
  • description (optional but recommended): human-readable explanation

After adding events, run npx @traffical/cli push to sync them to the platform.

Events discovered at runtime (via track() calls) will appear in the dashboard even without config definitions, but defining them in config gives you descriptions, value types, and keeps the config file as the source of truth.

Namespaces

Namespaces are optional organizational groupings for parameters. They help organize parameters in the dashboard but do not affect how you use them in code.

parameters:
  bookmarks.max_stored:
    type: number
    default: 100
    namespace: bookmarks   # optional organizational grouping
    description: Maximum bookmarks per user
  • The "main" namespace is the default and is omitted from config
  • When parameters are imported from the dashboard (via npx @traffical/cli pull or during init), they may include namespace: <name> — this is normal
  • Namespace is independent of dot-notation naming (e.g., bookmarks.max_stored can be in namespace bookmarks, but this is a convention, not enforced)
  • You do not need to specify a namespace when creating new parameters — they will use the default namespace

Parameter Naming Conventions

Use dot notation: category.subcategory.name

CategoryExamplesUse case
feature.*feature.new_checkout, feature.dark_modeFeature flags (boolean)
ui.*ui.cta.text, ui.hero.variantVisual variations
pricing.*pricing.discount, pricing.tier_multiplierPricing experiments
copy.*copy.headline, copy.cta_textCopywriting tests
experiment.*experiment.checkout.variantExplicit variant names

Best Practices

  1. Always use the CLI — Run npx @traffical/cli push after editing config. Run npx @traffical/cli status to check sync state. Never skip the CLI — it is the bridge between your config files and the Traffical platform.
  2. Check existing parameters first — Look in .traffical/config.yaml (or traffical.yaml) before creating new ones. Run npx @traffical/cli status to see what's already defined. Reuse existing parameters where possible.
  3. Define parameters in config, then push — Add new parameters to .traffical/config.yaml and run npx @traffical/cli push to sync them. This keeps the config file as the source of truth and prevents drift with the dashboard.
  4. Always provide in-code defaults — Defaults appear in two places: in config.yaml (the source of truth for the dashboard and experiment setup) and in your getParams()/useTraffical() calls (the offline fallback). In-code defaults are what the SDK returns when the config bundle hasn't loaded yet or is unreachable. The bundle's resolved value always takes precedence when available.
  5. Track events at conversion points — Call track() on purchases, signups, and other valuable actions. This enables adaptive optimization.
  6. Group related parameters — Keep correlated params in one useTraffical() / getTraffical() / getParams() call for proper attribution.
  7. Use meaningful param names — Follow dot notation: category.subcategory.name. Be descriptive.

What You Don't Need to Know

These are internal concepts handled by Traffical automatically:

  • Layers, policies, allocations — Experiment infrastructure is managed in the dashboard
  • Bucket assignment and hashing — Deterministic user assignment happens automatically
  • Whether an A/B test vs. optimization is running — Your code is the same either way
  • Statistical significance calculations — Traffical handles analysis in the background
  • Decision deduplication — Multiple resolution calls are handled efficiently

Just parametrize your app, track conversions, and let Traffical handle the rest.

Documentation

平台分布

Codex

31.95%
按下载量换算35

Claude

29.69%
按下载量换算32

Cursor

20.61%
按下载量换算22

Gemini CLI

9.2%
按下载量换算10

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

未通过

权限和风险

接触敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills