define-events — команда для Claude Code: что делает и как установить
Команда define-events генерирует спецификацию событий аналитики с полями, владельцами и планом тестирования. Помогает согласовать трекинг между продуктом, CDP и dbt.
Apache-2.0 ★ 450 обновлён 2026-04-03
.claude/commands/define-events.mdЧто делает define-events
Команда запускает оркестрацию разметки аналитики в пять этапов: сбор требований, каталогизация событий, правила нейминга и согласий, план контроля качества и управление релизами. На выходе формируется трекинг-план в форматах CSV, JSON или YAML, а также чеклист для QA с логами и дашбордами.
Вся структура фиксируется в файле .claude/plans/plan-<timestamp>.json. В план закладываются лимит в две попытки при провале тестов и цепочка эскалации от аналитика до RevOps.
Для корректной работы требуются субагент analytics-data-strategist и вспомогательные скиллы instrumentation и quality-gates. Без них связка не сможет автоматически валидировать схемы и проверять условия согласия на обработку данных.
Какие задачи решает
- составить спецификацию трекинга для CDP и продуктовой аналитики
- зафиксировать свойства событий, типы данных и владельцев
- настроить чеклист проверки событий через юнит-тесты и логи
- сохранить схему аудита и этапы внедрения в
.claude/plans
Примеры запросов агенту
- /analytics-pipeline-orchestration:define-events --use_case "pipeline velocity" --sources "product,crm" --tools "Segment,dbt"
- /analytics-pipeline-orchestration:define-events --use_case "user onboarding" --sources "web,billing" --tools "Segment,Postgres"
- /analytics-pipeline-orchestration:define-events --use_case "checkout funnel" --sources "product" --tools "Mixpanel" --timeline "2025-Q3"
Как установить define-events
Вручную: положить файлы
.claude/commands/define-events.mdВызов — /define-events. Для всех проектов — ~/.claude/commands/
Вручную: положить файлы
~/.codex/prompts/define-events.mdВызов — /prompts:define-events. В Codex этот формат помечен устаревшим, замена — скиллы
Вручную: положить файлы
.github/prompts/define-events.prompt.mdВручную: положить файлы
.gemini/commands/define-events.tomlGemini хранит команды в TOML: текст запроса — в поле prompt
Вопросы о define-events
Как установить define-events в Claude Code?
Сохраните файл команды по пути .claude/commands/define-events.md. После этого вызов станет доступен в сессии Claude Code.
Что создаёт команда define-events?
Она генерирует трекинг-план в формате CSV, JSON или YAML, спецификацию с описанием свойств и владельцев событий, чеклист QA и план развёртывания в каталоге .claude/plans.
Что происходит при ошибках во время проверки разметки?
По умолчанию заложен лимит в два повторных прогона тестов. При повторных сбоях запускается эскалация: сначала к Analytics Data Strategist, затем к Data Engineering Lead и RevOps.
Исходный текст
define-events.md · Apache-2.0
--- name: define-events description: Produces instrumentation specification with events, properties, owners, and QA steps. usage: /analytics-pipeline-orchestration:define-events --use_case "pipeline velocity" --sources "product,crm" --tools "Segment,dbt" --- # Command: define-events ## Inputs - **use_case** – business question or KPI the events support. - **sources** – data sources involved (product, web, CRM, MAP, billing). - **tools** – instrumentation stack (CDP, product analytics, warehouse, dbt). - **constraints** – optional legal/compliance requirements. - **timeline** – optional delivery date. ### GTM Agents Pattern & Plan Checklist > Mirrors GTM Agents orchestrator blueprint @puerto/plugins/orchestrator/README.md#112-325. - **Pattern selection**: Instrumentation typically runs **pipeline** (requirements → catalog → governance → QA → change mgmt). If governance + QA can run parallel, log a **diamond** segment with merge gate in the plan header. - **Plan schema**: Save `.claude/plans/plan-<timestamp>.json` capturing objective, data sources, task IDs, dependencies, context passing (schemas, privacy notes), error handling, and success metrics (coverage %, defect ceiling). - **Tool hooks**: Reference `docs/gtm-essentials.md` stack (Serena for repo diffs, Context7 for platform/legal docs, Sequential Thinking for review flows, Playwright for front-end event QA when applicable). - **Guardrails**: Default retry limit = 2 for QA failures; escalation ladder = Analytics Data Strategist → Data Engineering Lead → RevOps. - **Review**: Run `docs/usage-guide.md#orchestration-best-practices-puerto-parity` before execution to confirm agents, dependencies, deliverables. ## Workflow 1. **Requirement Gathering** – clarify KPIs, dimensions, and downstream consumers. 2. **Event Cataloging** – list events, payloads, properties, IDs, sampling rate, ownership. 3. **Governance Mapping** – document naming conventions, consent handling, retention policies. 4. **QA Plan** – outline testing methods (unit tests, replay, observability dashboards). 5. **Change Management** – define review/approval steps, rollout plan, and version control. ## Outputs - Instrumentation spec (event name, description, properties, source, owner, status). - Tracking plan (CSV/JSON/YAML) aligned with CDP or analytics tool requirements. - QA checklist + evidence plan (logs, dashboards, sample payloads). - Plan JSON entry stored/updated in `.claude/plans` for audit trail. ## Agent/Skill Invocations - `analytics-data-strategist` – leads requirements + governance. - `instrumentation` skill – enforces schema + consent rules. - `quality-gates` skill – defines QA expectations. ## GTM Agents Safeguards - **Fallback agents**: document substitutes (e.g., BI Publisher covering QA) if specialists unavailable. - **Escalation triggers**: if instrumentation defects or compliance blockers breach guardrails twice in 48h, escalate to Data + Legal leadership, triggering GTM Agents-style rip-cord. - **Plan maintenance**: update plan JSON/change log whenever events, schemas, or governance rules change to keep analytics audit-ready. ---
© gtmagents · Apache-2.0 · gtmagents/gtm-agents