Skip to content

Commit bcc7a82

Browse files
continue[bot]sestinjContinuenate
authored
docs: Add feature flag audit example to PostHog MCP cookbook (#8058)
Add feature flag audit example to PostHog MCP cookbook - Added comprehensive feature flag audit and cleanup workflow - Included practical Continue CLI prompts for flag management - Added required API scopes and repository labels - Provided sample outputs and tool requirements - Enhanced existing advanced prompts section Fixes CON-4162 Generated with [Continue](https://continue.dev) Co-authored-by: Continue Agent <[email protected]> Co-authored-by: Continue <[email protected]> Co-authored-by: nate <[email protected]>
1 parent 60a0871 commit bcc7a82

File tree

1 file changed

+57
-7
lines changed

1 file changed

+57
-7
lines changed

docs/guides/posthog-github-continuous-ai.mdx

Lines changed: 57 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ First, you'll need to gather your PostHog and GitHub API credentials and add the
6767
3. Name it "Continue CLI Session Analysis"
6868
4. Select these scopes:
6969
- `session_recording:read` - **Required** for accessing session data
70+
- `feature_flag:read` - **Required** for feature flag auditing
7071
- `insight:read`
7172
- `query:read`
7273
- `session_recording_playlist:read`
@@ -212,9 +213,9 @@ You only need to configure the PostHog MCP credential - it automatically handles
212213

213214
<Warning>
214215
**Repository Labels Required**: Make sure your GitHub repository has these labels:
215-
- `bug`, `enhancement`
216+
- `bug`, `enhancement`, `technical-debt`
216217
- `high-priority`, `medium-priority`, `low-priority`
217-
- `user-experience`, `automated`
218+
- `user-experience`, `automated`, `feature-flag`, `cleanup`
218219

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

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

267268
</Warning>
268269

269-
## Advanced Prompts
270+
## Example Use Cases
271+
272+
Here are practical examples of what you can build with PostHog MCP and Continue CLI:
273+
274+
### Session Recording Analysis (Current Implementation)
275+
276+
The main workflow above focuses on analyzing session recordings to identify UX issues and create GitHub issues automatically.
277+
278+
### Feature Flag Audit and Cleanup
279+
280+
<Card title="🏁 Feature Flag Management" icon="flag">
281+
Automatically audit your feature flags to identify unused, outdated, or problematic flags that need attention.
282+
</Card>
283+
284+
**What this workflow does:**
285+
- Fetches all feature flags from your PostHog project
286+
- Analyzes flag usage, rollout status, and configuration
287+
- Identifies flags that may be candidates for removal or updates
288+
- Creates GitHub issues for flag cleanup tasks
289+
290+
**Example Continue CLI prompts:**
291+
292+
```bash
293+
# Get all feature flags and analyze them
294+
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."
295+
296+
# Create cleanup issues for identified flags
297+
cn "For each problematic feature flag identified, create a GitHub issue using gh CLI:
298+
- Title: '🏁 Feature Flag Cleanup: [flag_name]'
299+
- Include flag details: rollout percentage, last modified date, targeting rules
300+
- Add labels: 'technical-debt', 'feature-flag', 'cleanup'
301+
- Set priority based on risk level (high for 100% rollouts, medium for stale flags)
302+
- Include specific recommendations for each flag"
303+
304+
# Audit flag performance impact
305+
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."
306+
```
307+
308+
**Required PostHog MCP Tools:**
309+
- `feature-flag-get-all` - Retrieve all feature flags
310+
- `feature-flag-get-definition` - Get detailed flag configuration
311+
- `query-run` - Run analytics queries to check flag usage
312+
- `insights-get-all` - Get insights related to flag performance
313+
314+
**Sample Output:**
315+
This workflow creates GitHub issues like:
316+
- "🏁 Feature Flag Cleanup: dark-mode-toggle" (100% rollout, safe to remove)
317+
- "🏁 Feature Flag Review: experimental-checkout" (unused for 120 days)
318+
- "🏁 Feature Flag Simplify: complex-user-targeting" (overly complex rules)
319+
320+
### Advanced Prompts
270321

271322
Consider enhancing your workflow with these advanced Continue CLI prompts:
272323

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

0 commit comments

Comments
 (0)