Developing subscriptions
SkillProductivityGuides your agent through building or changing PostHog's subscription feature, covering schedules, delivery, retries, and limits.
Available today. Use it from your connected AI after setup.
No other account needed.
Connect ahel once, and every AI you use reads what you have installed.
Then ask your AI: use the Developing subscriptions skill
About this capability
Guides PostHog engineers through subscription product changes. Use when changing subscription resource types, destinations, schedules, delivery workflows, retry or automatic disable behavior, permissions, limits, AI summaries, AI prompt reports, delivery history, subscription APIs, MCP tools, or sub
What this skill tells your AI
The instructions your AI receives, as published by posthog/posthog-foss in .agents/skills/developing-subscriptions/SKILL.md and read by ahel’s review.
Use this skill for a change to the Subscriptions product or its delivery system.
Use the published managing-subscriptions skill to configure an existing subscription through MCP.
Use adding-product-alerting when delivery depends on a threshold, anomaly, breach, or recovery state.
1. Route the request
| Request | Primary path |
|---|---|
| Resource type, destination, schedule, delivery, lifecycle, or limits | This skill |
| Subscription API, permissions, MCP tools, or delivery history | This skill |
| Subscription creation or management UI | This skill |
| AI prompt report planning or output | This skill and integrating-with-posthog-ai |
| Threshold, anomaly, breach, recovery, or quiet hours | adding-product-alerting |
| Configure an existing subscription through MCP | Published managing-subscriptions |
Before implementation, name each affected boundary:
- Configuration and validation
- Persistence and schedule calculation
- Workflow queue and retry behavior
- Asset export or AI report generation
- Destination delivery
- Delivery history and failure notifications
- API, MCP, and frontend clients
- Billing, limits, and permissions
2. Define feature intake and acceptance criteria
Do this before implementation for a new subscription feature. Skip it for a narrow bug fix with an existing contract.
- State the user problem, intended actor, and explicit non-goals.
- State whether delivery uses a fixed schedule or a condition.
- State the supported resource types and destinations.
- State the default behavior for creation, updates, tests, pause, resume, expiration, and deletion.
- State which actions can send a real message and where the product asks for approval.
- State the project, organization, resource, and API scope requirements for reads and mutations.
- State behavior for old rows, missing owners, removed resources, invalid destinations, and exhausted schedules.
- State retry, deduplication, terminal state, and automatic disable behavior.
- State the plan limits, organization-wide limits, and billable AI behavior.
- State the acceptance criteria for success, partial recipient failure, permanent failure, and uncertain delivery.
- State the event or metric that shows adoption, delivery failure, and regression.
- Check whether the API, MCP tools, generated types, product docs, and published skill need updates.
3. Define the change contract
State these decisions before implementation:
- Name the persisted fields and the source of truth for each field.
- Define create, update, test, scheduled, pause, resume, expiration, and delete behavior.
- Define whether the operation is idempotent and how retries prevent duplicate messages.
- Define the schedule anchor, time zone, recurrence rule, and next delivery calculation.
- Define which failures retry and which failures disable the subscription.
- Define how delivery records distinguish queued, completed, failed, skipped, and partial outcomes.
- Define how email, Slack, and Microsoft Teams differ across validation, storage, display, and delivery.
- Define how the API hides credentials, recipient details, upstream errors, and query diagnostics.
- Define behavior when AI credits, AI approval, or active-summary capacity changes after setup.
- Define compatibility for the frontend, API, MCP schema, workers, and Temporal workflows during deployment.
For a new API operation, add an MCP tool for each supported action. Exclude an action only with a documented reason. Record the required OAuth scopes.
4. Implement across boundaries
- Keep serializer validation, model behavior, generated types, MCP schemas, and frontend forms consistent.
- Keep each subscription and delivery record scoped to the current team.
- Treat every test delivery and update-triggered delivery as a real external side effect.
- Keep external calls outside database transactions.
- Pass large exports and report content by reference across Temporal activity boundaries.
- Preserve safe destination labels. Never return or log a Microsoft Teams webhook URL.
- Keep retry and deduplication rules explicit at each queue and workflow boundary.
- Record enough delivery state to separate configuration success from external delivery success.
- Preserve old rows and in-flight workflows during staged deployment.
- Add meaningful product events for user actions and delivery outcomes. Do not capture recipients, prompts, report content, or credentials.
5. Test the complete path
Cover each affected path through public interfaces:
- Create, read, update, pause, resume, test, expire, and delete
- Insight, dashboard, and AI prompt resources
- Email, Slack, and Microsoft Teams destinations
- Immediate, scheduled, retried, skipped, failed, and partially successful delivery
- Duplicate requests, concurrent tests, workflow retries, and uncertain responses
- Missing owner, removed source, disconnected integration, revoked permission, and invalid webhook
- Free-plan limits, organization-wide summary limits, AI approval, and exhausted AI credits
- API scopes, resource access, secret masking, and delivery history redaction
- Old frontend with new backend and old worker with new workflow payloads
- MCP schema and generated types after serializer changes
Do not treat API acceptance or workflow queueing as delivery success. Use a mock destination or test transport for external delivery checks.
6. Code map
| Concern | Start here |
|---|---|
| API, serializers, validation, delivery history | ee/api/subscription.py |
| Subscription and delivery models | products/exports/backend/models/subscription.py |
| Delivery workflows and activities | products/exports/backend/temporal/subscriptions/ |
| Destination delivery and automatic disable behavior | ee/tasks/subscriptions/ |
| Management UI and frontend logic | products/subscriptions/frontend/ |
| MCP tool definitions | products/subscriptions/mcp/tools.yaml |
| API behavior tests | ee/api/test/test_subscription.py |
| Destination delivery tests | ee/tasks/test/subscriptions/ |
| Workflow tests | posthog/temporal/tests/test_subscriptions_workflows.py |
| Published operational guidance | products/subscriptions/skills/managing-subscriptions/ |
Companion skills
| Skill | Use when |
|---|---|
improving-drf-endpoints | Change the subscription viewset, serializer, or OpenAPI contract |
django-migrations | Change subscription or delivery persistence |
adopting-generated-api-types | Consume changed generated API types |
writing-kea-logics | Change subscription Kea logic |
integrating-with-posthog-ai | Change AI prompt planning or report generation |
adding-product-alerting | Add condition-based delivery or shared alert infrastructure |
writing-tests | Select the lowest-cost regression test |
writing-user-facing-copy | Change UI, error, notification, or documentation text |
Signals
- GitHub stars
- 715
- Forks
- 118
- Last commit
- Sep 2026
Advanced
- Catalog kind
- skill
- Gateway key
developing-subscriptions- Source
- github.com/posthog/posthog-foss