adding-product-alerting

Guides engineers adding or extending product alerting on PostHog's shared alerts platform.

713|118|Updated Aug 11, 2020
One-click install
npx skills add https://github.com/PostHog/posthog-foss --skill adding-product-alerting
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: adding-product-alerting
Source: https://github.com/PostHog/posthog-foss/tree/main/.agents/skills/adding-product-alerting
Command: npx skills add https://github.com/PostHog/posthog-foss --skill adding-product-alerting

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Adding alerting to a PostHog product touches lifecycle state machines, destinations, delivery, scheduling, email, and frontend editors, and building a product-local framework duplicates shared infrastructure and breaks platform invariants.

Core Features & Use Cases

  • Adoption routing: Directs engineers to the right reference for adopting platform alerting, extending shared infrastructure, or building the alert frontend.
  • Platform invariants: Enforces rules such as one lifecycle state machine, a single product mutator, allowlisted destinations, and dispatch-persistence agreement.
  • End-to-end verification: Requires testing configuration, routing, and delivery as one contract across management APIs, workers, and UI.
  • Use Case: When adding alerting to a new PostHog product, follow the adoption reference to compose the shared state machine, HogFunction destinations, scheduling helpers, and shared editor components instead of building a parallel framework.

Quick Start

Ask the agent to add alerting to a PostHog product using the shared alerts platform and follow the routed reference for the adoption path.

Frequently Asked Questions about adding-product-alerting

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add alerting to a PostHog product?

Compose the shared platform instead of building a product-local framework: define the product contract, add persistence, build a lifecycle adapter over the shared state machine, configure HogFunction destinations, and reuse shared scheduling helpers. The adopting-platform-alerting reference walks through each step.

When should I extend the shared alerts platform instead of keeping code product-local?

Extend shared infrastructure only when a real second adopter needs the same capability. Keep changes product-owned when there is no second use case, when a helper would need product-name branches, or when the option leaks product model fields into the shared state machine.

Does the shared state machine allow direct model mutation?

No. The lifecycle module in products/alerts/backend/state_machine.py is pure Python with no Django imports. Every persisted state or consecutive_failures write must go through the product adapter's single apply_outcome function, enforced by a semgrep rule.

How does HogFunction delivery stay consistent with lifecycle state?

Produce internal events, flush once per batch, then check producer acknowledgement before persisting notification-dependent transitions. Restore pre-check outcomes for unacknowledged events, since acknowledgement confirms production to the transport, not downstream destination delivery.

What are the limitations of the current alerts platform?

There is no generic alert base model, product registry, push-mode submit_check, generic scheduler runner, or generic Temporal harness. Non-insight products keep evaluation, persistence, due queries, history, and orchestration product-owned until a shared contract lands.