ryanmccrary/PreHog
Proactively suggests and creates missing PostHog instrumentation for new features in a PR.
View on GitHubTrust Signals
- Scorecard Score
- not yet scored
- Maintenance Recency
- Stale
- License
- None
Inputs
| name | description | required | default |
|---|---|---|---|
| github-token | GITHUB_TOKEN with pull-request: write | yes | — |
| anthropic-api-key | Anthropic API key used for semantic PR analysis. | yes | — |
| posthog-personal-api-key | PostHog personal API key with project access (read events, write insights/dashboards/flags). | yes | — |
| posthog-host | PostHog host (e.g. https://us.posthog.com, https://eu.posthog.com, or self-hosted). | no | https://us.posthog.com |
| posthog-project-id | Numeric PostHog project (team) id to scope reviews against. | yes | — |
| posthog-mcp-url | PostHog MCP JSON-RPC endpoint. Default: https://mcp.posthog.com/mcp. Set empty to disable MCP and use REST only. | no | https://mcp.posthog.com/mcp |
| posthog-mcp-token | Optional separate token for the MCP endpoint. Defaults to posthog-personal-api-key. | no | — |
| enabled-reviewers | Comma-separated list of reviewers to run. One of: analytics, logs, errors, llm, flags. | no | analytics,logs,errors,llm,flags |
| create-resources | If true, proactively create insights / dashboards. If false, suggest only. | no | true |
| insight-budget-small | Max insights to create for a "small" feature. | no | 3 |
| insight-budget-large | Max insights to create for a "large" feature. | no | 5 |
| enable-inline-suggestions | When true, post Greptile-style line-anchored suggestion blocks for mechanical changes (new/extended events, log inserts, error captures, LLM wraps, flag register/gate sites). | no | true |
| suggestion-confidence-threshold | Minimum bot-self-rated confidence (0..1) for a suggestion to be posted inline. Lower-confidence ones fall back to the summary comment. | no | 0.65 |
| suggestion-max | Cap on inline suggestions posted in a single review. | no | 12 |
| slack-bot-token | Optional Slack bot token used to offer a follow-up notification with results. | no | — |
| model | Anthropic model id. | no | claude-opus-4-7 |
| pr-merged | Set 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. | no | false |
Outputs
no outputs