suggesting-path-cleaning-rules
Fungsinya
Skill ini menjelaskan saran mingguan PostHog untuk mengelompokkan alamat halaman yang mirip dan cara meninjaunya. Skill ini untuk tim yang ingin melihat saran aturan sebelum apa pun mengubah laporan mereka.
Kapan dipakai
- βSaat Anda ingin melihat saran otomatis alamat halaman untuk tim Anda.
- βSaat Anda ingin meninjau dan menerapkan aturan yang disarankan.
- βSaat Anda perlu memastikan pemeriksaan saran itu berjalan dengan baik.
Link skill
https://github.com/PostHog/posthog/blob/master/products/web_analytics/skills/suggesting-path-cleaning-rules/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
βBisakah Anda melihat saran pembersihan jalur yang dibuat PostHog untuk situs kami dan menjelaskan mana yang layak diterapkan?β
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Setiap minggu PostHog mengambil sampel alamat halaman yang sebenarnya, meminta model AI membuat aturan pengelompokan, dan memeriksa setiap aturan terhadap data tim itu sendiri. Agent meninjau saran tersebut, dan saran hanya diterapkan saat seseorang memutuskannya.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari 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
Pertanyaan umum
Apakah PostHog menerapkan saran secara otomatis?
Tidak. PostHog hanya menyarankan aturan, karena menerapkannya akan menulis ulang angka pada grafik masa lalu.
Siapa yang menerapkan aturannya?
Seseorang yang menerapkannya, baik di layar pengaturan maupun dengan opsi terapkan setelah meninjaunya.
Bisakah saya menulis aturan sendiri?
Bisa. Skill terpisah membahas cara menulis, menguji, dan menerapkan aturan secara manual.
Detail
Deskripsi asli dari pembuat
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
Popularitas
- Bintang GitHub
- 41k
- Peringkat
- #6977
- Lisensi
- β
- Diperbarui
- 2/11/2026
Komentar
- β¦
Skill lain dari repositori ini
depot-ci
41kMembantu agent Anda menyiapkan dan menjalankan alur kerja Depot CI, alternatif GitHub Actions, termasuk memigrasikan alur kerja yang ada dan membaca log eksekusi.
depot-container-builds
41kMembantu agent Anda membangun image Docker di builder jarak jauh Depot, termasuk image multi-platform, pengiriman ke registry, dan perbaikan kegagalan build.
depot-github-runners
41kMembantu agent Anda memindahkan job GitHub Actions ke runner yang dikelola Depot, memilih ukuran dan label runner, serta memecahkan masalah pengaturan runner.
editing-agents-md
41kMembantu agent Anda memutuskan apakah sebuah aturan layak masuk ke berkas AGENTS.md atau CLAUDE.md, dan menulisnya agar tetap dipatuhi tanpa membuat berkas membengkak.
Skill serupa
gitcrawl
394kMemungkinkan agent Anda mencari arsip issue dan pull request GitHub yang tersimpan, mengelompokkan yang duplikat, dan memeriksa status terkininya di GitHub.
slacrawl
394kMemungkinkan agent Anda mencari dan menghitung pesan di arsip Slack lokal, memeriksa seberapa baru arsip itu, dan menyegarkannya bila diperlukan.
goplaces
394kMembantu agent Anda mencari tempat, mendapatkan detail dan ulasannya, serta menentukan nama tempat memakai Google Places, dengan keluaran JSON untuk skrip.