ryanmccrary/PreHog

Proactively suggests and creates missing PostHog instrumentation for new features in a PR.

View on GitHub

Trust Signals

Scorecard Score
not yet scored
Maintenance Recency
Stale
License
None
namedescriptionrequireddefault
github-tokenGITHUB_TOKEN with pull-request: writeyes
anthropic-api-keyAnthropic API key used for semantic PR analysis.yes
posthog-personal-api-keyPostHog personal API key with project access (read events, write insights/dashboards/flags).yes
posthog-hostPostHog host (e.g. https://us.posthog.com, https://eu.posthog.com, or self-hosted).nohttps://us.posthog.com
posthog-project-idNumeric PostHog project (team) id to scope reviews against.yes
posthog-mcp-urlPostHog MCP JSON-RPC endpoint. Default: https://mcp.posthog.com/mcp. Set empty to disable MCP and use REST only.nohttps://mcp.posthog.com/mcp
posthog-mcp-tokenOptional separate token for the MCP endpoint. Defaults to posthog-personal-api-key.no
enabled-reviewersComma-separated list of reviewers to run. One of: analytics, logs, errors, llm, flags.noanalytics,logs,errors,llm,flags
create-resourcesIf true, proactively create insights / dashboards. If false, suggest only.notrue
insight-budget-smallMax insights to create for a "small" feature.no3
insight-budget-largeMax insights to create for a "large" feature.no5
enable-inline-suggestionsWhen true, post Greptile-style line-anchored suggestion blocks for mechanical changes (new/extended events, log inserts, error captures, LLM wraps, flag register/gate sites).notrue
suggestion-confidence-thresholdMinimum bot-self-rated confidence (0..1) for a suggestion to be posted inline. Lower-confidence ones fall back to the summary comment.no0.65
suggestion-maxCap on inline suggestions posted in a single review.no12
slack-bot-tokenOptional Slack bot token used to offer a follow-up notification with results.no
modelAnthropic model id.noclaude-opus-4-7
pr-mergedSet to "true" when the workflow is firing for a merged PR (pull_request event with action=closed and pull_request.merged==true). Activates the bot's promote-on-merge path: 1. Scan the merged diff for posthog.capture(...) / property-add patterns matching events the bot previously suggested. 2. POST /event_definitions/ (and /property_definitions/) for each match — idempotent, ignores 409 from PostHog when the def already exists. 3. Re-run the analytics reviewer; insights whose Waiting-for prefix referenced a now-registered event get updated in place. 4. Record the merge commit sha in the bot's autonomy-state. Wire it from the consumer workflow file (NOT here in action.yml — GitHub evaluates github.* expressions inside any action.yml string and they fail validation in this context). See the bundled .github/workflows/pr-review.yml in the action's repo for the ready-to-copy one-liner that derives this from the close event. nofalse

no outputs