Command Palette

Search for a command to run...

UnylyUnyly
Back to skills

ae-generate-tracking-code

FreeNo executable scriptsNot checked

Generate or insert AE SDK tracking code, LogBus2 configuration, and debug scripts from a tracking plan. Choose insert or snippet output for each platform…

ThinkingAIAgenticEngineby ThinkingAIAgenticEngine★ 24 GitHub stars

About this skill

ae-generate-tracking-code

Conversation language: This skill document is in English, but all output to the user MUST be in the user's input language. English input → English reply; Chinese input → Chinese reply; Japanese input → Japanese reply. If uncertain, default to English. This applies to all output: section titles, phase names, template prompts, code comments, etc. ⚠️ CRITICAL: Many reference documents (wiki SDK docs, code examples) contain Chinese text. When reading Chinese source material to answer an English/Japanese user, you MUST translate headings, descriptions, and comments to the user's language. The source document's language is NOT the user's language. Use the Terminology Glossary above to map terms accurately. Do NOT copy Chinese text verbatim from this document into English/Japanese replies.

Document link language: When providing official documentation URLs, use lan=zh-CN for Chinese users, lan=en-US for all others.

Terminology Glossary

中文 English Notes
埋点方案 Tracking Plan AE project-level event/property definitions
代码埋点 Tracking Code Generation Generating SDK/LogBus code from a plan
埋点代码 Tracking Code The generated SDK init + track() calls + helpers
输出方式 Output Mode insert (inject) or snippet (file delivery)
插入 Insert Direct code injection into the user's project
片段 / 代码片段 Snippet Code delivered as files under .ae-cli/output/
采集端 Collection Platform / Platform Where events are sent from: client, server, or both
客户端 Client Client-side SDK (Android/iOS/Web/etc.)
服务端 Server Server-side SDK (Java/Python/Go/etc.)
两端都采集 Both Events collected from both client and server
SDK 集成模式 SDK Integration Mode client_only / server_only / both
用户体系 User Identity System distinct_id / account_id strategy
校验脚本 Validation / Debug Script Test code to verify tracking works
LogBus2 配置 LogBus2 Configuration daemon.json for LogBus2 log sync tool
LoggerConsumer LoggerConsumer Server SDK consumer that writes events to local log files
BatchConsumer BatchConsumer Server SDK consumer that uploads events in batches
公共属性 Super Property Properties attached to all events automatically. ⚠️ The correct Chinese AE term is "公共属性" or "公共事件属性". Never translate "Super Property" as "超级属性" — that is NOT a valid AE term.
预置属性 Preset Property System properties prefixed with # (e.g. #device_id, #time)
事件属性 Event Property Custom properties on specific events
用户属性 User Property Properties set on the user profile
上报地址 SERVER_URL Data ingestion endpoint (different from web URL!)
APP_ID APP_ID Application ID from AE Admin → "Integration Config"
project_id Project ID AE project identifier (≠ APP_ID)
自动采集 Auto-track Auto-collected events (app install, start, view, click)
埋点方案上传 Plan Upload Upload tracking plan xlsx to AE

When to Trigger

Trigger when user says: "generate tracking code / help me add web tracking / generate logbus config / server-side reporting code" etc. Supports multiple platforms with independent output mode selection per platform.

Phase 0 — Anchor (one question per message)

Pre-check: Read existing configuration from draft.json

First, check if .ae-cli/draft.json exists and read existing configuration:

Config Item draft.json Field Handling
AE projectId meta.project_id Has value → confirm; missing → ask
AE web address meta.host Has value → confirm; missing → ask
SERVER_URL meta.server_url Has value → confirm; missing → try lookup from project config, then ask if unavailable
APP_ID meta.app_id Has value → confirm; missing → try lookup from accessible project list, then ask if unavailable
SDK integration mode meta.sdk_integration_mode Has value → use directly
Client SDK type meta.client_platforms (preferred) or meta.client_sdk_type Has value → use directly
Server language meta.server_language Has value → use directly
User identity system meta.user_identity Has value → use directly

Important: project_id ≠ APP_ID, and host ≠ SERVER_URL. Even if project_id and host are already set, SERVER_URL and APP_ID must still be resolved and confirmed separately. Prefer lookup first; ask the user only when lookup is unavailable or ambiguous.

Multi-platform support:

  • If client_platforms exists (array): multi-platform scenario — generate code for each platform
  • If only client_sdk_type exists: single platform (backward compatible)
  • Example: client_platforms: ["android", "openharmony"] → generate code for Android + OpenHarmony

Language support:

  • Android SDK: supports Java / Kotlin (can generate both)
  • iOS SDK: supports Objective-C / Swift (can generate both)
  • Other SDKs: fixed language, no selection
Full SKILL.md on GitHub

Install ae-generate-tracking-code in Claude Code & Claude Desktop

Sign up to install this skill

Create a free account to reveal the install command and save the skill to your library.

  • Reveal the one-line install command
  • Save skills to your synced library
  • Get notified when skills update
Sign up freeI already have an account

Allowed tools

Tools this skill is permitted to call.

No restriction — this skill can use any tool.

Bundled files

references/autotrack-enum.mdreferences/client-sdk-insert.mdreferences/datax-config.mdreferences/debug-script.mdreferences/logbus-config.mdreferences/modes.mdreferences/restful-call.mdreferences/sdk-index.mdreferences/server-sdk-insert.mdreferences/snippet-delivery.mdreferences/te-api.md

FAQ

What does the ae-generate-tracking-code skill do?

Generate or insert AE SDK tracking code, LogBus2 configuration, and debug scripts from a tracking plan. Choose insert or snippet output for each platform. Server-side generation defaults to LoggerConsumer with LogBus2.

How do I install the ae-generate-tracking-code skill?

Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.

Does the ae-generate-tracking-code skill run scripts?

No, this skill is instructions only (SKILL.md) with no executable scripts.

Related skills

Compare ae-generate-tracking-code with