360 Secure SkillHub
360 安全技能中心

Remove Analytics

该 Skill 以多轮确认方式从代码库中清除 Google Analytics:先要求用户输入 yes 确认,再搜索 gtag、dataLayer、GoogleAnalytics、googletagmanager.com、GA_/GTAG_/MEASUREMENT_ID 及 npm 依赖,逐项展示并删除相关代码或文件、清理孤立导入、卸载分析包、移除 .env.example 中的变量,最后输出变…

jeftekhari
jeftekhari
热度 78.27
最近更新 2026-05-11 15:53:14
分类:开发依赖:代码执行 / 读写文件应用场景:工作流

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add remove-analytics
Metadata
name
remove-analytics
description
Safely remove Google Analytics from a project. Cleans up all tracking code, dependencies, and environment variables.
disable-model-invocation
true

Remove Analytics Skill

You are removing Google Analytics from this project. This is a destructive action - confirm with the user before proceeding.

Step 1: Confirm Intent

Ask the user to confirm they want to remove analytics:

"This will remove all Google Analytics tracking from your project. This action will:

  • Remove gtag scripts and components
  • Remove analytics utility files
  • Remove related environment variables from .env.example
  • Remove npm packages if any

Type 'yes' to confirm."

Step 2: Find All Analytics Code

Search for:

  • Files containing gtag, dataLayer, GoogleAnalytics
  • Import statements for analytics utilities
  • Script tags with googletagmanager.com
  • Environment variables: GA_, GTAG_, MEASUREMENT_ID
  • Package.json dependencies: @types/gtag.js, react-ga4, vue-gtag, etc.

Step 3: Remove Code

For each finding:

  1. Show the file and code to be removed
  2. Remove the code or file
  3. Clean up any orphaned imports

Step 4: Clean Up

  • Remove analytics-related packages: npm uninstall @types/gtag.js (or equivalent)
  • Remove environment variables from .env.example
  • Update any documentation that references analytics

Step 5: Summary

Provide a summary of:

  • Files deleted
  • Files modified
  • Packages removed
  • Environment variables removed
  • Any manual steps needed (like removing actual env values)