English README. For the Chinese version, see README.zh-CN.md.
A repo-aware agent skill for auditing, installing, comparing, aligning, and fixing TikTok Pixel + Meta Pixel integrations.
Analytics SDK work usually fails for boring reasons: snippets get pasted into the wrong place, the same platform gets initialized twice, TikTok and Meta drift apart, and privacy-sensitive behavior gets enabled without a clear policy.
This project packages that experience into a reusable skill for repo-aware coding agents. Instead of treating analytics as a copy-paste task, it treats it as an engineering and governance problem.
- Repo-aware, not snippet-first — inspect the real codebase before editing.
- Dual-platform by design — reason about TikTok and Meta together, not as two unrelated patches.
- Execution-mode driven — force the agent to choose between direct implementation, planning, or questions first.
- Privacy-conservative by default — do not invent CSP, LDU, consent, or PII behavior.
- Structured outputs — support questions-first, plan-first, and direct-implementation deliverables.
The easiest way to try this skill is with the skills CLI.
Install this skill into a Claude Code project from a local path:
npx skills add ./analytics-sdk-setup -a claude-codeInstall from a GitHub repository source:
npx skills add Peter-WF/analytics-sdk-setup -a claude-codeVerify what is installed:
npx skills list -a claude-codeFor Claude Code, the skills CLI supports both project and global installation scopes.
| Scope | Flag | Claude Code path | Use case |
|---|---|---|---|
| Project | default | .claude/skills/ |
Share with the project and commit if needed |
| Global | -g |
~/.claude/skills/ |
Reuse across projects |
Example global install:
npx skills add ./analytics-sdk-setup -g -a claude-codeThis skill is designed for coding agents that need to work on tracking code inside a real repository.
It helps agents:
- audit an existing TikTok / Meta setup
- compare the two platforms and identify drift
- fix duplicate initialization
- align event timing and event semantics
- review bootstrap ownership and source of truth
- respect consent, CSP, LDU, and Advanced Matching guardrails
The skill forces a repo-aware workflow instead of allowing the agent to jump straight into code.
Before doing anything, the agent must:
- classify the execution mode
- output the chosen mode explicitly
- justify the choice in 1–2 lines
- Mode A — Direct implementation: use when the repo, scope, config source, and privacy constraints are all clear.
- Mode B — Plan first: use when the task is still architecture-heavy, broad, or governance-oriented.
- Mode C — Questions first: use when key blockers such as Pixel ID, consent behavior, route scope, or ownership are still unclear.
The skill uses a dual-platform decision frame:
- per-platform correctness
- cross-platform consistency
- ownership and source of truth
- governance over local fixes
That means it does not only ask “Is TikTok working?” It also asks whether TikTok and Meta stay aligned, whether duplicate init exists, whether ownership is clear, and whether privacy-sensitive changes are actually allowed.
analytics-sdk-setup/
├── README.md
├── README.zh-CN.md
├── SKILL.md
├── SKILL.zh-CN.md
├── agent-system-prompt.md
├── agent-system-prompt.zh-CN.md
├── evals/
│ └── evals.json
└── references/
├── install-and-events.md
├── install-and-events.zh-CN.md
├── privacy-and-csp.md
└── privacy-and-csp.zh-CN.md
SKILL.md— canonical skill specagent-system-prompt.md— compact runtime summary for environments that want a single prompt blockevals/evals.json— lightweight regression prompts for mode selection and trigger behaviorreferences/install-and-events.md— bootstrap placement, event mapping, payloads, and verificationreferences/privacy-and-csp.md— consent, CSP, LDU, Advanced Matching / PII guardrails*.zh-CN.md— Chinese companion versions for review and team adoption
Use the main README to understand the project, then go deeper with the docs below.
Use this skill for requests like:
- “Compare TikTok and Meta tracking in this repo and tell me where they drift.”
- “Fix duplicate Pixel initialization and keep TikTok and Meta aligned.”
- “Add Purchase tracking for TikTok and Meta using the same business moment and shared contract.”
- “Audit ownership, consent gating, and source of truth for TikTok and Meta events.”
You can also use it for narrower requests such as:
- fixing duplicate init in one app shell
- adding one concrete event at a known success point
- reviewing whether CSP changes are really required
These examples are useful for checking whether the skill activates in the right situations.
User prompt:
Compare TikTok and Meta tracking in this repo and tell me where they drift.
Expected first move:
- classify execution mode first
- inspect repo ownership, shared bootstrap, and event drift before suggesting edits
User prompt:
Fix the duplicate Pixel initialization in our checkout app shell, but do not change unrelated tracking.
Expected first move:
- choose direct implementation only if ownership and privacy blockers are already clear
- keep the fix localized and avoid broad refactors
User prompt:
Add TikTok + Meta Purchase tracking, but I am not sure whether consent gating or Pixel IDs are already configured.
Expected first move:
- switch to questions-first
- ask only the minimum blocking questions instead of inventing IDs or privacy behavior
After installation, validate the skill in a lightweight way:
- Confirm the skill is installed:
npx skills list -a claude-code
- Trigger it with one audit prompt and one blocker-heavy prompt.
- Check that the first response explicitly chooses
Mode A,Mode B, orMode C. - Check that plan/questions modes do not jump straight into patches.
- Check that the response stays privacy-conservative and treats TikTok + Meta as a shared governance problem when both are in scope.
This skill is intentionally conservative.
- It does not assume Pixel IDs, consent rules, CSP allowlists, LDU rules, or PII sources.
- It does not enable Advanced Matching / PII by default.
- It prefers reusing existing analytics and privacy abstractions in the repo.
- It treats privacy-sensitive behavior as a blocker when policy is unclear.
For installation verification, use the skills CLI itself:
npx skills list -a claude-codeFor runtime verification, the most important checks are:
- bootstrap initializes once per platform
- page-view behavior is not duplicated
- target events fire once at the real business moment
- privacy gates behave as intended