본문으로 건너뛰기
Skillpedia
분석 및 스프레드시트41k · #6977

suggesting-path-cleaning-rules

하는 일

이 스킬은 PostHog가 비슷한 페이지 주소를 묶기 위해 매주 내놓는 제안과 그 검토 방법을 설명합니다. 무엇도 바뀌기 전에 제안된 규칙을 보고 싶은 팀을 위한 스킬입니다.

사용하는 경우

  • ✓팀을 위해 PostHog가 낸 자동 페이지 주소 제안을 보고 싶을 때.
  • ✓제안된 규칙을 검토하고 적용하고 싶을 때.
  • ✓제안 점검이 작동하는지 확인해야 할 때.

스킬 링크

https://github.com/PostHog/posthog/blob/master/products/web_analytics/skills/suggesting-path-cleaning-rules/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/PostHog/posthog/blob/master/products/web_analytics/skills/suggesting-path-cleaning-rules/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“PostHog가 우리 사이트에 대해 낸 경로 정리 제안을 보고, 적용할 가치가 있는 것을 설명해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

PostHog는 매주 실제 페이지 주소를 샘플링해 AI 모델에 그룹화 규칙을 요청하고, 각 규칙을 팀의 데이터로 검사합니다. 에이전트가 제안을 검토하며, 사람이 결정했을 때만 적용됩니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 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.py
    • sample_pathnames / count_distinct_pathnames — top $pathname by views via HogQL.
    • call_llm_for_rules — one-shot call through the LLM gateway (get_llm_client(product="web_analytics", team_id=...), model WEB_ANALYTICS_PATH_CLEANING_SUGGESTIONS_MODEL, default claude-haiku-4-5).
    • validate_and_annotate_rules — compiles each regex with re2 (the engine ClickHouse replaceRegexpAll uses) and test-applies it to the sampled paths. Rules that don't compile or match nothing are dropped; survivors get a dense order, a match_count, and in-memory before/after examples (printed by the management command, never stored — health-issue payloads are readable with just health_issue:read and 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 into path_cleaning_filters, never overwrites (dedupes by regex, continues order).
  • Storage: a path_cleaning_suggestions health issue (HealthIssue, severity info) — no dedicated model. One active issue per team (hash_keys=[]); payload carries rules, model, sampled_path_count, distinct_path_count. Applying (or hand-configuring rules) resolves the issue on the next check run; dismissal is the health-issue dismissed flag.
  • 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 list WEB_ANALYTICS_LAZY_PRECOMPUTE_TEAM_IDS.

Gating (why a team is skipped)

generate_suggestions_for_team returns a status:

  • skipped_inactive — team sent no $pageview within visited_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 with include_configured).
  • skipped_low_cardinality — fewer distinct paths than min_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: PathCleaningSuggestionsBanner on /settings/project#path_cleaning shows the latest suggested row as regex → alias previews with match counts; "Apply all" (project admins only) merges the rules, the close button dismisses. Driven by pathCleaningSuggestionsLogic.
  • Onboarding step: OnboardingWebAnalyticsPathCleaningStep (stepKey path_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
자주 묻는 질문

PostHog가 제안을 자동으로 적용하나요?

아니요. 규칙을 적용하면 차트의 과거 수치가 다시 쓰이므로, PostHog는 제안만 합니다.

누가 규칙을 적용하나요?

사람이 설정 화면에서 적용하거나, 검토한 뒤 적용 옵션으로 적용합니다.

대신 직접 규칙을 쓸 수 있나요?

네. 별도의 스킬이 규칙을 직접 작성, 테스트, 적용하는 방법을 다룹니다.

상세 정보

작성자의 원본 설명

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

인기도

GitHub 스타
41k
순위
#6977
라이선스
—
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬