agentleFS
viksantviksant/swe-skills/skills/analytics-cleaner/SKILL.md

analytics-cleaner

Skill4 starsChanged 5 months agoMITView on GitHub

Safely removes analytics, tracking, and telemetry code (mixpanel, segment, amplitude, datadog, newrelic, google analytics, track_event, log_user_action, send_telemetry, @track_performance, @monitor, log_metric) with MANDATORY user approval and zero functionality impact. Use when the user explicitly asks to "remove analytics", "strip tracking", "delete telemetry", "get rid of mixpanel/segment/amplitude", or clean out instrumentation code. NOT for: general dead-code cleanup (use the code-deletion skill), refactoring, or removing critical SYSTEM metrics — and do NOT auto-invoke to delete any code unless the user explicitly asks for analytics/tracking removal.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use these lists to seed the reference search.

    line 44
  2. Distinctive:

    Verify no broken imports

    line 102

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Analytics & Telemetry Cleaner

Core: Safely remove unwanted analytics/tracking/telemetry code with MANDATORY user approval.

Target: "$ARGUMENTS"

REQUIRED SUB-SKILL — removal mechanics: the general "map 100% of references, then delete surgically" machinery lives in the code-deletion skill (Mode A for active features, the 11-level verification for dead code). This skill does NOT re-derive it — it applies that discipline to the analytics domain and adds the pattern catalog below. REQUIRED CLOSE-OUT: run the verification-before-completion discipline before claiming the cleanup is done (imports resolve, tests pass, system still runs).


Safety first

NEVER delete without explicit user approval. Always preserve system functionality.

Analytics/telemetry is often tangled with code that is NOT tracking (a metrics.py may hold both user-tracking AND critical system health gauges). One false positive — deleting a metric the system depends on — is worse than leaving instrumentation in place.


Target patterns (the analytics catalog)

Use these lists to seed the reference search. They are the domain asset of this skill; map every hit to the code-deletion reference-mapping discipline before removing anything.

# Analytics imports to eliminate
ANALYTICS_IMPORTS = [
    "analytics", "mixpanel", "segment", "amplitude",
    "google.analytics", "datadog", "newrelic"
]

# Tracking functions to remove
TRACKING_FUNCTIONS = [
    "track_event", "log_user_action", "send_telemetry",
    "record_interaction", "analytics.track"
]

# Monitoring patterns (non-critical)
MONITORING_PATTERNS = [
    "@track_performance", "@monitor", "@measure",
    "performance.measure", "log_metric"
]

Cleanup protocol

Step 1: DISCOVERY

**Analytics Code Found:**
- [ ] `file.py:line` - [Function/import] - [Purpose]
- [ ] `file.py:line` - [Function/import] - [Purpose]

**Dependencies:**
- [What else uses this code]

**Impact Assessment:**
- Functionality affected: [None/Minor/Major]

Step 2: PRESENT TO USER (MANDATORY)

## Proposed Removals

**Will Remove:**
- [ ] `file.py:50-80` - Analytics tracking function
- [ ] `file.py:10` - Import statement

**Will Preserve:**
- `metrics.py` - Critical system metrics (NOT user tracking)

**Impact:** Zero functionality loss

WAITING FOR USER APPROVAL

Step 3: EXECUTE (only after approval)

  1. Remove approved items
  2. Verify no broken imports
  3. Run tests
  4. Confirm system still works

Success criteria

  1. User approved all removals
  2. Zero functionality impact
  3. System tests pass
  4. No orphaned references

Now analyzing analytics code in: $ARGUMENTS

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.