Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 57 additions & 7 deletions docs/guides/posthog-github-continuous-ai.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ First, you'll need to gather your PostHog and GitHub API credentials and add the
3. Name it "Continue CLI Session Analysis"
4. Select these scopes:
- `session_recording:read` - **Required** for accessing session data
- `feature_flag:read` - **Required** for feature flag auditing
- `insight:read`
- `query:read`
- `session_recording_playlist:read`
Expand Down Expand Up @@ -212,9 +213,9 @@ You only need to configure the PostHog MCP credential - it automatically handles

<Warning>
**Repository Labels Required**: Make sure your GitHub repository has these labels:
- `bug`, `enhancement`
- `bug`, `enhancement`, `technical-debt`
- `high-priority`, `medium-priority`, `low-priority`
- `user-experience`, `automated`
- `user-experience`, `automated`, `feature-flag`, `cleanup`

Create missing labels in your repo at: **Settings → Labels → New label**

Expand Down Expand Up @@ -266,7 +267,57 @@ After completing this guide, you have a complete **Continuous AI system** that:

</Warning>

## Advanced Prompts
## Example Use Cases

Here are practical examples of what you can build with PostHog MCP and Continue CLI:

### Session Recording Analysis (Current Implementation)

The main workflow above focuses on analyzing session recordings to identify UX issues and create GitHub issues automatically.

### Feature Flag Audit and Cleanup

<Card title="🏁 Feature Flag Management" icon="flag">
Automatically audit your feature flags to identify unused, outdated, or problematic flags that need attention.
</Card>

**What this workflow does:**
- Fetches all feature flags from your PostHog project
- Analyzes flag usage, rollout status, and configuration
- Identifies flags that may be candidates for removal or updates
- Creates GitHub issues for flag cleanup tasks

**Example Continue CLI prompts:**

```bash
# Get all feature flags and analyze them
cn "Use PostHog MCP to fetch all feature flags with mcp__posthog__feature-flag-get-all. Then analyze each flag to identify: 1) Flags that are 100% rolled out and could be removed, 2) Flags that haven't been updated in 90+ days, 3) Flags with complex targeting that might need simplification, 4) Experimental flags that should be cleaned up."

# Create cleanup issues for identified flags
cn "For each problematic feature flag identified, create a GitHub issue using gh CLI:
- Title: '🏁 Feature Flag Cleanup: [flag_name]'
- Include flag details: rollout percentage, last modified date, targeting rules
- Add labels: 'technical-debt', 'feature-flag', 'cleanup'
- Set priority based on risk level (high for 100% rollouts, medium for stale flags)
- Include specific recommendations for each flag"

# Audit flag performance impact
cn "Cross-reference feature flags with PostHog performance metrics to identify flags that may be impacting user experience or site performance. Create performance-focused GitHub issues for flags showing negative impact."
```

**Required PostHog MCP Tools:**
- `feature-flag-get-all` - Retrieve all feature flags
- `feature-flag-get-definition` - Get detailed flag configuration
- `query-run` - Run analytics queries to check flag usage
- `insights-get-all` - Get insights related to flag performance

**Sample Output:**
This workflow creates GitHub issues like:
- "🏁 Feature Flag Cleanup: dark-mode-toggle" (100% rollout, safe to remove)
- "🏁 Feature Flag Review: experimental-checkout" (unused for 120 days)
- "🏁 Feature Flag Simplify: complex-user-targeting" (overly complex rules)

### Advanced Prompts

Consider enhancing your workflow with these advanced Continue CLI prompts:

Expand All @@ -280,13 +331,12 @@ Consider enhancing your workflow with these advanced Continue CLI prompts:
"Cross-reference JavaScript console errors with user actions to identify the
root cause of UX issues"
</Card>
<Card title="Feature Flag Analysis" icon="flag">
"Analyze how [PostHog feature flags](https://posthog.com/docs/feature-flags)
impact user behavior in session recordings"
<Card title="Feature Flag Performance Impact" icon="flag">
"Use PostHog MCP to correlate feature flag rollouts with performance metrics and user behavior changes to identify flags causing issues"
</Card>
<Card title="Custom Slack Alerts" icon="slack">
"Create Slack alerts when critical UX issues are detected in PostHog
sessions"
sessions or when feature flags need attention"
</Card>
</CardGroup>

Expand Down
Loading