suggesting-path-cleaning-rules
Was er macht
Dieser Skill erklärt die wöchentlichen Vorschläge von PostHog, um ähnliche Seitenadressen zu gruppieren, und wie du sie prüfst. Er ist für Teams gedacht, die Vorschläge sehen wollen, bevor sich an ihren Berichten etwas ändert.
Wann du ihn nutzt
- ✓Wenn du die automatischen Vorschläge zu Seitenadressen für dein Team sehen willst.
- ✓Wenn du die vorgeschlagenen Regeln prüfen und anwenden willst.
- ✓Wenn du kontrollieren willst, ob die Vorschlagsprüfung funktioniert.
Link zum Skill
https://github.com/PostHog/posthog/blob/master/products/web_analytics/skills/suggesting-path-cleaning-rules/SKILL.mdKopiere ihn und füge ihn in deine KI ein (Claude, ChatGPT oder Cursor) mit der Bitte, den Anweisungen zu folgen.
So nutzt du ihn
Am einfachsten: Kopiere die Nachricht und füge sie in deine KI ein. Sie liest den Skill und folgt den Anweisungen.
Fertige Nachricht zum Einfügen
Für Claude Code, Codex oder Cursor: Führe den Befehl in deinem Projektordner aus, dann wird der Skill installiert.
Lade die SKILL.md herunter und lege sie in den Skills-Ordner deines Agenten.
Beispielanfrage an deine KI
“Kannst du dir die Vorschläge zum Bereinigen von Seitenadressen ansehen, die PostHog für unsere Seite gemacht hat, und erklären, welche sich lohnen?”
5 neue Skills pro Woche. 1 Minute Lesezeit.
So funktioniert es
PostHog nimmt jede Woche echte Seitenadressen als Stichprobe, bittet ein KI-Modell um Gruppierungsregeln und prüft jede Regel an den eigenen Daten des Teams. Der Agent prüft die Vorschläge. Angewendet werden sie erst, wenn eine Person sich dafür entscheidet.
Technischer Inhalt (originale SKILL.md)
Originaltext des Autors, auf Englisch, direkt von GitHub.
Suggesting path-cleaning rules
Many teams never configure path cleaning, so their Web analytics breakdowns fragment across
thousands of near-identical URLs. This feature proactively suggests cleaning rules for the
web-analytics precompute cohort: weekly, for each team, it samples real paths, asks the LLM for
{regex, alias} rules, validates them against the team's own paths, and stores them for review.
It only suggests — it never auto-applies. Applying rewrites historical numbers in every cleaned
chart, so that stays a human decision (the existing settings UI, or the --apply flag below after
review). To hand-author or directly apply rules, use the managing-path-cleaning-rules skill.
Architecture
- Core:
products/web_analytics/backend/path_cleaning_suggestions/service.pysample_pathnames/count_distinct_pathnames— top$pathnameby views via HogQL.call_llm_for_rules— one-shot call through the LLM gateway (get_llm_client(product="web_analytics", team_id=...), modelWEB_ANALYTICS_PATH_CLEANING_SUGGESTIONS_MODEL, defaultclaude-haiku-4-5).validate_and_annotate_rules— compiles each regex with re2 (the engine ClickHousereplaceRegexpAlluses) and test-applies it to the sampled paths. Rules that don't compile or match nothing are dropped; survivors get a denseorder, amatch_count, and in-memory before/afterexamples(printed by the management command, never stored — health-issue payloads are readable with justhealth_issue:readand must not leak real paths). This is the skill's "test before saving" step, automated.generate_suggestions_for_team— orchestrates the above with gating (see below); pure generation, no storage.apply_suggestions_to_team— merges rules intopath_cleaning_filters, never overwrites (dedupes by regex, continuesorder).
- Storage: a
path_cleaning_suggestionshealth issue (HealthIssue, severityinfo) — no dedicated model. One active issue per team (hash_keys=[]);payloadcarriesrules,model,sampled_path_count,distinct_path_count. Applying (or hand-configuring rules) resolves the issue on the next check run; dismissal is the health-issuedismissedflag. - Schedule:
PathCleaningSuggestionsCheck(products/web_analytics/backend/temporal/health_checks/path_cleaning_suggestions.py), a health check on the shared health-check framework, weekly (Mon 06:23 UTC), small sequential batches because each eligible team costs an LLM call. Teams with an existing active suggestion are re-emitted without a fresh LLM round trip. - Cohort:
WEB_ANALYTICS_PATH_CLEANING_SUGGESTIONS_TEAM_IDS, defaulting to the precompute enrollment listWEB_ANALYTICS_LAZY_PRECOMPUTE_TEAM_IDS.
Gating (why a team is skipped)
generate_suggestions_for_team returns a status:
skipped_inactive— team sent no$pageviewwithinvisited_within_days(default 30); we only suggest for teams actively using web analytics. Bypass with--ignore-visit-gate.skipped_configured— team already has path cleaning rules (override withinclude_configured).skipped_low_cardinality— fewer distinct paths thanmin_distinct_paths(default 50); cleaning adds no value, so we don't spend tokens.skipped_no_paths— no pageviews in the window.generated— rules produced (may be an empty list if paths are already clean; empty generations are never stored, so they can't shadow an actionable suggestion).error— sampling/LLM failed; captured per-team, never aborts the cohort sweep.
How users see and apply suggestions
- Settings banner:
PathCleaningSuggestionsBanneron/settings/project#path_cleaningshows the latestsuggestedrow as regex → alias previews with match counts; "Apply all" (project admins only) merges the rules, the close button dismisses. Driven bypathCleaningSuggestionsLogic. - Onboarding step:
OnboardingWebAnalyticsPathCleaningStep(stepKeypath_cleaning) surfaces the same banner during Web analytics onboarding. - API (
products/web_analytics/backend/api/web_analytics_path_cleaning_suggestions.py):POST /api/projects/:id/web_analytics_path_cleaning_suggestions/generate/produces and stores a fresh suggestion on demand;GET .../{issue_id}/preview/applies the rules to a fresh sample of the team's top paths and returns before/after pairs (read scope, computed on demand, never store
Häufige Fragen
Wendet PostHog die Vorschläge automatisch an?
Nein. PostHog schlägt nur Regeln vor, denn ihre Anwendung würde die Zahlen in alten Diagrammen neu schreiben.
Wer wendet die Regeln an?
Eine Person wendet sie an, entweder im Einstellungsbereich oder mit der Option zum Anwenden nach der Prüfung.
Kann ich stattdessen eigene Regeln schreiben?
Ja. Ein eigener Skill deckt das Schreiben, Testen und manuelle Anwenden von Regeln ab.
Details
Originalbeschreibung des Autors
Runs and reasons about the automated AI health check that suggests path-cleaning rules for web-analytics teams. Use when asked to generate path-cleaning suggestions for a team or cohort, to run the suggestion check, to review/apply AI-suggested rules, to inspect path_cleaning_suggestions health issues, or to extend the suggestion pipeline. Covers the suggest_path_cleaning_rules management command, the path_cleaning_suggestions health check, the cohort gating (precompute teams), and how suggestions are validated against real paths before storage. For hand-authoring or applying rules directly, u
repo: PostHog/posthog
Beliebtheit
- GitHub-Sterne
- 41k
- Platz im Ranking
- #6977
- Lizenz
- —
- Aktualisiert
- 2.11.2026
Kommentare
- …
Weitere Skills aus diesem Repository
depot-ci
41kBringt deinem Agenten bei, Depot-CI-Workflows einzurichten, bestehende Workflows zu migrieren und Laufprotokolle auszuwerten.
depot-container-builds
41kHilft deinem Agenten, Docker-Images auf Depot-Remote-Buildern zu bauen, mit Multi-Plattform-Images, Registry-Push und Fehlerbehebung.
depot-github-runners
41kLässt deinen Agenten GitHub-Actions-Jobs auf Depot-Runnern laufen, mit passender Runner-Größe und Labels, und hilft bei Einrichtungsfehlern.
editing-agents-md
41kHilft deinem Agenten zu entscheiden, ob eine Regel in AGENTS.md oder CLAUDE.md gehört, und sie so zu formulieren, dass sie hält.
Ähnliche Skills
gitcrawl
394kLässt deinen Agenten ein gespeichertes Archiv von GitHub-Issues und Pull Requests durchsuchen, Duplikate gruppieren und ihren aktuellen Status auf GitHub prüfen.
slacrawl
394kLässt deinen Agenten Nachrichten in einem lokalen Slack-Archiv durchsuchen und zählen, dessen Aktualität prüfen und es bei Bedarf auffrischen.
goplaces
394kHilft deinem Agenten, mit Google Places nach Orten zu suchen, Details und Bewertungen abzurufen und Ortsnamen aufzulösen, mit JSON-Ausgabe für Skripte.