Skip to content

Add "Feature Flag Audit and Cleanup Agent" check#4

Open
continue[bot] wants to merge 1 commit into
mainfrom
add-check/feature-flag-audit-and-cleanup-agent-1778987601571
Open

Add "Feature Flag Audit and Cleanup Agent" check#4
continue[bot] wants to merge 1 commit into
mainfrom
add-check/feature-flag-audit-and-cleanup-agent-1778987601571

Conversation

@continue
Copy link
Copy Markdown
Contributor

@continue continue Bot commented May 17, 2026

Adds the Feature Flag Audit and Cleanup Agent check to this repository.

This check will be synced from .continue/checks/feature-flag-audit-and-cleanup-agent.md and can be customized by editing the file directly.


Opened via Continue Hub

Summary by Sourcery

Add a configurable Feature Flag Audit and Cleanup Agent check for PostHog feature flags, including criteria, workflows, and templates for auditing and cleanup.

New Features:

  • Introduce a Feature Flag Audit and Cleanup Agent check definition under .continue/checks for automated review of PostHog feature flags.
  • Provide standardized GitHub issue and audit summary templates for feature flag cleanup and reporting.
  • Define scheduling guidelines and success metrics for ongoing feature flag audits.

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented May 17, 2026

Reviewer's Guide

Adds a new Continue check configuration defining a "Feature Flag Audit and Cleanup Agent" that audits PostHog feature flags, classifies them, and guides GitHub issue creation and reporting workflows.

Sequence diagram for Feature Flag Audit and Cleanup Agent workflow

sequenceDiagram
    actor Agent
    participant PostHog_MCP as PostHog_MCP
    participant GitHub

    Agent->>PostHog_MCP: mcp__posthog__feature-flag-get-all
    Agent->>PostHog_MCP: mcp__posthog__feature-flag-get-definition
    Agent->>PostHog_MCP: mcp__posthog__query-run
    Agent->>PostHog_MCP: mcp__posthog__insights-get-all

    Agent->>Agent: [classify flags by triage decision tree]

    loop For each flag needing action
        Agent->>GitHub: gh issue create
    end
Loading

Flow diagram for feature flag triage decision tree

flowchart TD
    A[100% rollout for 90+ days?] -->|YES| B[Ready for Removal]
    A -->|NO| C[Modified in last 120 days?]
    C -->|NO| D[Rollout <50%?]
    D -->|YES| E[Stale Experimental]
    C -->|YES| F[5+ targeting rules?]
    F -->|YES| G[Complex Targeting]
    F -->|NO| H[Performance issues?]
    H -->|YES| I[Performance Impact]
    H -->|NO| J[No code refs?]
    J -->|YES| K[Cleanup Required]
Loading

File-Level Changes

Change Details Files
Introduce a new Continue check configuration for the "Feature Flag Audit and Cleanup Agent".
  • Add a markdown-based check definition under .continue/checks with name, tools, and purpose metadata.
  • Define multi-phase execution steps for discovering, classifying, and analyzing PostHog feature flags using PostHog MCP tools.
  • Specify a triage decision tree and classification criteria for different feature-flag states (ready for removal, stale experimental, complex targeting, performance impact, cleanup required).
  • Provide reusable GitHub markdown templates for per-flag issues, audit summaries, and standardized commit messages for flag removal.
  • Document the mapping of PostHog MCP tools, required GitHub labels, recommended audit schedule, and success metrics for feature flag hygiene.
.continue/checks/feature-flag-audit-and-cleanup-agent.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • The priority labels used in the gh issue create example ([priority]) and the Required GitHub Labels section (high-priority, medium-priority) don’t align with the issue template’s HIGH/MEDIUM values—consider standardizing the priority naming and mapping across these sections.
  • The PostHog MCP tools table lists short names like feature-flag-get-all, but the execution steps reference mcp__posthog__feature-flag-get-all; updating the table or steps so the tool identifiers are consistent with the actual MCP configuration will avoid confusion.
  • The GitHub issue template and audit summary include several placeholder tokens (e.g., [Category], [flag_name], [date])—it may help to briefly document which fields should be auto-populated by the agent versus filled in manually to ensure consistent usage.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The priority labels used in the `gh issue create` example (`[priority]`) and the `Required GitHub Labels` section (`high-priority`, `medium-priority`) don’t align with the issue template’s `HIGH/MEDIUM` values—consider standardizing the priority naming and mapping across these sections.
- The PostHog MCP tools table lists short names like `feature-flag-get-all`, but the execution steps reference `mcp__posthog__feature-flag-get-all`; updating the table or steps so the tool identifiers are consistent with the actual MCP configuration will avoid confusion.
- The GitHub issue template and audit summary include several placeholder tokens (e.g., `[Category]`, `[flag_name]`, `[date]`)—it may help to briefly document which fields should be auto-populated by the agent versus filled in manually to ensure consistent usage.

Fix all in Cursor


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants