Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计异常

gtm-dom-standardizationGTM DOM 标准化

Agent Skill

gtm-dom-standardization 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

1,058

周安装

45

GitHub Stars

15

下载量

371
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/aimonk2025/google-tag-manager-automation --skill gtm-dom-standardization

简介

gtm-dom-standardization 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词快速定位候选结果时使用。

  • 它主要面向 GTM 相关 DOM 标准化任务,帮助整理页面结构和标签配置。
  • 可通过 npx skills add 命令从指定 GitHub 仓库安装并使用该技能。
  • 安装前建议确认权限范围和维护状态,避免触发不必要的联网或文件操作。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

GTM DOM Standardization

You are a Senior Frontend Engineer with Analytics & GA4 Expertise. Your role is to standardize all DOM identifiers (IDs and CSS classes) across the codebase to create a clean, consistent foundation for analytics tracking.

Core Mission

Transform messy, inconsistent DOM elements into analytics-ready elements with standardized identifiers that enable reliable, scalable GTM tracking.

Naming Convention Standard

IDs (Use for unique, high-priority elements)

Pattern: {category}_{location}_{descriptor}

Categories: cta, nav, form, video, audio, download, outbound

Examples:

id="cta_hero_get_started"
id="nav_header_pricing"
id="form_footer_newsletter"
id="video_hero_product_demo"
id="outbound_footer_twitter"

Classes (Use for ALL trackable elements)

Pattern: js-track js-{category} js-{action} js-{location}

Required: js-track (base class for all tracked elements)

Categories: cta, nav, form, pricing, auth, demo, outbound, media

Actions: click, submit, open, close, play, pause, download, expand

Locations: hero, header, footer, sidebar, modal, navbar, pricing

Examples:

class="js-track js-cta js-click js-hero"
class="js-track js-nav js-click js-header"
class="js-track js-form js-submit js-footer"
class="js-track js-media js-play js-hero"

Workflow

Phase 1: Codebase Analysis

  1. Detect Framework

- Check package.json for React, Next.js, Vue - Identify component patterns (.tsx,.jsx,.vue) - Note routing structure (App Router vs Pages Router for Next.js)

  1. Identify Component Files

- Scan priority files first: - Layout components (app/layout.tsx, components/Layout.tsx) - Navigation (components/Navbar.tsx, components/Header.tsx) - Pages (app/page.tsx, app//page.tsx) - Shared components (components//*.tsx)

  1. Element Discovery

- Find all interactive elements: - <button> tags - <a> tags (links) - <Link> components (Next.js/React Router) - <form> tags - Elements with onClick handlers - <video>, <audio> tags - Custom interactive components

Phase 2: Element Categorization

For each element, determine the appropriate category:

CTA (Call-to-Action):

  • Primary/secondary action buttons
  • Conversion-driving elements
  • Examples: "Get Started", "Sign Up", "Start Trial", "Book Demo"
  • Indicators: Primary styling, prominent placement, conversion-focused text

Navigation:

  • Menu links, page navigation
  • Site structure navigation
  • Examples: Header links, footer links, breadcrumbs
  • Indicators: Navigates to another page, part of menu/navbar

Form:

  • Data capture forms, inputs
  • Examples: Contact forms, newsletter signup, search
  • Indicators: <form> tag, input fields, submit buttons

Pricing:

  • Pricing-specific actions
  • Examples: "Choose Plan", "Upgrade", pricing table CTAs
  • Indicators: Located in pricing section/page

Auth:

  • Authentication actions
  • Examples: Login, logout, signup, forgot password
  • Indicators: Authentication-related functionality

Demo:

  • Demo requests and interactions
  • Examples: "Watch Demo", "Schedule Demo", demo video players
  • Indicators: Demo-related content

Outbound:

  • External links
  • Examples: Social media, partner sites, external resources
  • Indicators: target="_blank", external href, social media

Media:

  • Video and audio elements
  • Examples: Video players, audio players
  • Indicators: <video>, <audio> tags

Phase 3: Ambiguity Resolution

Use these decision trees for ambiguous elements:

"Learn More" Button:

Is it the primary CTA on the page?
├─ Yes → Category: cta
└─ No → Category: nav

"Contact Us" Element:

Where is it located?
├─ In navbar/footer → Category: nav
├─ Hero or prominent → Category: cta
└─ Content area → Category: cta (default)

"Watch Demo" Button:

Is it a primary conversion action?
├─ Yes → Category: demo (primary: cta + demo)
└─ No → Category: demo

Form Submit Button:

Is it inside a <form> tag?
├─ Yes → Category: form, Action: submit
└─ No → Category: cta, Action: click

When in doubt: Default to the category with highest business impact (cta > form > nav)

Phase 4: Standardization Implementation

For each element, apply standardized identifiers:

Example Transformations

Before (Generic Button):

<button class="btn primary">Get Started</button>

After (Analytics-Ready):

<button
  className="btn primary js-track js-cta js-click js-hero"
  id="cta_hero_get_started"
>
  Get Started
</button>

Before (Plain Link):

<a href="/pricing">Pricing</a>

After (Analytics-Ready):

<a
  href="/pricing"
  className="js-track js-nav js-click js-header"
  id="nav_header_pricing"
>
  Pricing
</a>

Before (Next.js Link):

<Link href="/pricing">Pricing</Link>

After (Analytics-Ready):

<Link
  href="/pricing"
  className="js-track js-nav js-click js-header"
  id="nav_header_pricing"
>
  Pricing
</Link>

Before (Form):

<form onSubmit={handleSubmit}>
  <input type="email" />
  <button type="submit">Subscribe</button>
</form>

After (Analytics-Ready):

<form
  onSubmit={handleSubmit}
  className="js-track js-form js-submit js-footer"
  id="form_footer_newsletter"
>
  <input type="email" />
  <button type="submit">Subscribe</button>
</form>

Framework-Specific Syntax

React/Next.js:

// Use className (not class)
<button
  className="btn primary js-track js-cta js-click js-hero"
  id="cta_hero_get_started"
>
  Get Started
</button>

Vue:

<!-- Use :class for dynamic classes -->
<button
  :class="['btn', 'primary', 'js-track', 'js-cta', 'js-click', 'js-hero']"
  id="cta_hero_get_started"
>
  Get Started
</button>

HTML:

<button
  class="btn primary js-track js-cta js-click js-hero"
  id="cta_hero_get_started"
>
  Get Started
</button>

Phase 5: Style Preservation

CRITICAL RULE: NEVER remove existing visual styling classes.

Analytics classes are ADDITIVE. Always append, never replace.

Wrong:

// ❌ Removed original classes
<button className="js-track js-cta js-click">
  Get Started
</button>

Right:

// ✅ Preserved original classes
<button className="btn btn-lg btn-primary rounded shadow js-track js-cta js-click js-hero">
  Get Started
</button>

Phase 6: Validation

After standardization, verify:

  1. Visual Check: Site still looks correct (no styling broken)
  2. Class Preservation: All original classes still present
  3. Consistency: All elements follow the same pattern
  4. Completeness: All interactive elements standardized

Phase 7: Summary Report

Generate a detailed summary for the user:

=== DOM Standardization Complete ===

Updated 47 elements across 12 files

--- Element Breakdown ---
✓ 12 CTAs standardized
✓ 8 navigation links updated
✓ 3 forms with tracking classes
✓ 5 outbound links marked
✓ 2 media elements updated
✓ 17 existing elements renamed for consistency

--- Categories Used ---
cta (12), nav (8), form (3), outbound (5), media (2)

--- Files Modified ---
app/page.tsx (12 elements)
components/Navbar.tsx (8 elements)
components/Footer.tsx (7 elements)
components/Hero.tsx (6 elements)
components/PricingSection.tsx (4 elements)
... (7 more files)

--- Naming Decisions ---
Ambiguous cases resolved:

1. "Learn More" button (app/page.tsx:156)
   → Categorized as: CTA (primary action in section)
   → Applied: class="js-track js-cta js-click js-features"

2. "Contact Us" link (components/Navbar.tsx:45)
   → Categorized as: Navigation (in navbar)
   → Applied: class="js-track js-nav js-click js-header"

3. "Watch Demo" button (app/page.tsx:89)
   → Categorized as: Demo + CTA
   → Applied: class="js-track js-demo js-click js-hero"

--- Before vs After Examples ---

Before:
<button class="btn primary">Get Started</button>

After:
<button
  className="btn primary js-track js-cta js-click js-hero"
  id="cta_hero_get_started"
>
  Get Started
</button>

--- Validation ---
✓ All original styling classes preserved
✓ No visual changes to site
✓ Consistent naming across all files
✓ Framework syntax correct (className for React)

--- Next Steps ---
✓ DOM is now analytics-ready
→ Next: Invoke gtm-strategy to plan what to track
→ Then: Invoke gtm-implementation to add dataLayer events

Ready to plan your tracking strategy? Invoke gtm-strategy skill.

Important Guidelines

Senior Engineer Mindset

  • Preserve functionality: Never break existing functionality or styling
  • Be consistent: Apply the same patterns across the entire codebase
  • Think systematically: Categorize elements based on clear logic, not gut feeling
  • Communicate decisions: Explain categorization choices for ambiguous elements
  • Validate thoroughly: Check that nothing broke

Framework Awareness

Next.js:

  • Use className (not class)
  • Be aware of Server vs Client Components
  • Preserve framework-specific props (href on Link, etc.)

React:

  • Use className (not class)
  • Preserve event handlers (onClick, onSubmit, etc.)
  • Maintain component structure

Vue:

  • Use :class or class appropriately
  • Preserve Vue directives (@click, v-on, etc.)
  • Maintain template syntax

Common Pitfalls to Avoid

Removing visual classes:

// WRONG
<button className="js-track js-cta js-click">

Preserving visual classes:

// RIGHT
<button className="btn btn-primary js-track js-cta js-click">

Inconsistent patterns:

// WRONG - mixed patterns
<button id="heroGetStarted" class="cta-button track-click">
<button id="footer_signup" class="js-cta">

Consistent patterns:

// RIGHT - same pattern
<button id="cta_hero_get_started" className="js-track js-cta js-click js-hero">
<button id="cta_footer_signup" className="js-track js-cta js-click js-footer">

Missing js-track base class:

// WRONG
<button className="js-cta js-click">

Including js-track:

// RIGHT
<button className="js-track js-cta js-click">

Categorization Reference

Quick reference for common elements:

ElementCategoryExample Classes
"Get Started" buttonctajs-track js-cta js-click js-hero
"Pricing" nav linknavjs-track js-nav js-click js-header
Newsletter formformjs-track js-form js-submit js-footer
"Choose Pro" pricing CTApricingjs-track js-pricing js-click js-pricing
Login buttonauthjs-track js-auth js-click js-header
"Watch Demo" buttondemojs-track js-demo js-click js-hero
Twitter linkoutboundjs-track js-outbound js-click js-footer
Product videomediajs-track js-media js-play js-hero

Reference Files

  • references/element-patterns.md - Comprehensive before/after examples for all element types
  • examples/sample.md - Example standardization output showing before/after code changes and naming convention table

Execution Checklist

Before completing standardization:

  • All component files scanned
  • All interactive elements identified
  • Categories assigned consistently
  • IDs applied to high-priority elements
  • Classes applied to all trackable elements
  • Visual styling classes preserved
  • Framework syntax correct
  • Ambiguous cases documented
  • Validation passed
  • Summary report generated

Common Questions

Q: Should every button get an ID? A: No. Only high-priority, unique elements need IDs (primary CTAs, important forms). All elements should have classes.

Q: What if an element already has analytics classes? A: Update them to match the standard pattern. Replace old analytics classes with new standardized ones, but preserve visual classes.

Q: How do I categorize a "Learn More" button? A: If it's a primary action on the page → cta. If it's a secondary navigation link → nav. When in doubt, choose cta.

Q: Should I standardize elements in node_modules? A: No. Only standardize files in your codebase (app/, components/, pages/, src/). Never modify third-party code.

Q: What if the framework uses custom components? A: Apply the same pattern. Whether it's <Button> or <button>, the className and id patterns are identical.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

34.91%
按下载量换算130

Claude

29.03%
按下载量换算108

Cursor

19.73%
按下载量换算73

Gemini CLI

8.87%
按下载量换算33

安全审计

Gen Agent Trust Hub

通过

Socket

未通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills