This prompt is for platform engineering teams that own feature flag infrastructure and need to prevent flag accumulation from becoming a reliability and cognitive load problem. The job-to-be-done is a structured lifecycle audit: given a list of flags, their metadata, and deployment history, the prompt produces a phase assessment (birth, ramp, full rollout, cleanup, sunset) for each flag, identifies ownership handoff gaps, and flags stale or abandoned flags that should be scheduled for removal. The ideal user is a staff engineer, platform architect, or release engineering lead who understands the flagging system's operational semantics and can provide accurate flag metadata as input.
Prompt
Feature Flag Lifecycle Management Prompt

When to Use This Prompt
Define the job, reader, and constraints for the Feature Flag Lifecycle Management Prompt.
Use this prompt when your organization has more than a handful of long-lived feature flags, when flags persist in code months after full rollout, or when ownership of flags has shifted across teams without explicit handoff. The prompt is designed for periodic hygiene reviews—weekly, per-sprint, or pre-release—rather than real-time flag evaluation during request processing. It assumes you can supply a structured input with flag names, creation dates, rollout percentages, owning teams, last-modified timestamps, and any associated cleanup tickets. The output is a lifecycle stage classification and a set of actionable recommendations, not a runtime flag evaluation decision.
Do not use this prompt for runtime flag evaluation, for flag creation workflows, or as a substitute for a flag management UI. It does not make targeting decisions, does not validate flag code, and does not replace your feature flag service's admin panel. If your flag data is incomplete—missing ownership history, no last-modified dates, or unclear rollout status—the prompt will produce low-confidence assessments that require manual verification. For regulated environments where flag removal has compliance implications, always pair the prompt's output with a human review step and evidence grounding before scheduling cleanup. The next section provides the copy-ready prompt template you can adapt to your flag inventory format.
Use Case Fit
Where this prompt works, where it fails, and the operational preconditions required before you put it into a release pipeline.
Good Fit: Structured Lifecycle Audits
Use when: you have a documented flag creation process and need a consistent review across birth, ramp, rollout, cleanup, and sunset phases. Guardrail: Provide the flag catalog, ownership registry, and deployment timeline as structured input to prevent hallucinated lifecycle states.
Bad Fit: Real-Time Kill Switch Decisions
Avoid when: an incident is active and you need an immediate override decision. This prompt is for proactive lifecycle management, not runtime circuit-breaking. Guardrail: Route production kill-switch decisions to a dedicated operational runbook prompt with strict latency and authorization checks.
Required Input: Flag Inventory and Ownership Map
What to watch: Without a current flag inventory, team ownership assignments, and creation dates, the model will invent plausible but incorrect flags and owners. Guardrail: Require a machine-readable flag manifest as a hard input. Reject the run if the manifest is missing or older than the defined staleness threshold.
Required Input: Deployment and Ramp History
What to watch: The model cannot determine if a flag is stuck in a partial rollout without actual ramp percentages and deployment event logs. Guardrail: Ingest deployment event streams or release markers. If history is unavailable, the prompt must explicitly flag uncertainty and refuse to guess ramp status.
Operational Risk: Stale Flag Accumulation Blindness
What to watch: The model may fail to detect flags that are technically active but have zero traffic or are permanently set to 100%. These accumulate as technical debt. Guardrail: Add a post-generation validation step that cross-references the flag manifest against recent evaluation logs to identify zero-traffic flags before the review is finalized.
Operational Risk: Ownership Handoff Gaps
What to watch: Flags that outlive their original team create orphaned configuration. The model may assign ownership based on stale data. Guardrail: Integrate with the team directory or service catalog. If a flag's assigned owner has left the team or company, escalate for human reassignment before proceeding with lifecycle recommendations.
Copy-Ready Prompt Template
A reusable prompt template with square-bracket placeholders for generating a structured feature flag lifecycle review.
This prompt template is the core engine for generating a Feature Flag Lifecycle Management review. It is designed to be copied directly into your prompt library or orchestration layer. The template uses square-bracket placeholders, such as [FLAG_CATALOG] and [PLATFORM_CONTEXT], which your application must populate with real data before sending the request to the model. The structure forces the model to act as a platform architect auditing a flag's journey from creation to deprecation, rather than just describing what feature flags are.
textYou are a platform architect reviewing the lifecycle of feature flags in a production system. Your goal is to produce a structured audit that identifies risks, ownership gaps, and stale flags across the entire lifecycle: birth, ramp, full rollout, cleanup, and sunset. ## Flag Catalog [FLAG_CATALOG] ## Platform Context - Flagging system used: [FLAG_SYSTEM] - Deployment cadence: [DEPLOYMENT_CADENCE] - Team ownership model: [OWNERSHIP_MODEL] ## Review Constraints [CONSTRAINTS] ## Output Schema Return your analysis as a JSON object with the following structure: { "flags": [ { "flag_name": "string", "lifecycle_stage": "birth | ramping | full_rollout | cleanup_pending | sunset", "created_date": "YYYY-MM-DD", "owner_team": "string", "target_removal_date": "YYYY-MM-DD | null", "risk_score": "low | medium | high | critical", "findings": [ { "category": "ownership_gap | stale_flag | missing_cleanup_plan | ramp_duration | kill_switch_missing | other", "severity": "low | medium | high | critical", "description": "string", "recommendation": "string" } ] } ], "systemic_risks": [ { "pattern": "string", "affected_flags": ["string"], "description": "string", "remediation": "string" } ], "summary": "string" } ## Instructions 1. For each flag in the catalog, determine its lifecycle stage based on creation date, rollout percentage, and cleanup status. 2. Identify ownership handoff gaps where the creating team no longer owns the flag but no new owner is documented. 3. Flag any flag that has been at 100% rollout for more than [STALE_THRESHOLD_DAYS] days without a cleanup plan. 4. Check for missing kill switch configurations on ramping or fully rolled out flags. 5. Surface systemic patterns, such as a team consistently failing to deprecate flags. 6. If the risk level is [RISK_LEVEL] or higher, include a specific recommendation for immediate action. 7. Do not invent flag names, dates, or configurations. Only analyze the provided catalog.
To adapt this template for your environment, replace the placeholders with concrete data. For [FLAG_CATALOG], provide a structured list of flags, including their creation date, rollout percentage, owner, and targeting rules. The [STALE_THRESHOLD_DAYS] should be set to your organization's policy, such as 30 or 60 days. The [RISK_LEVEL] variable controls the sensitivity of the review; setting it to medium will generate actionable recommendations for more flags. After running the prompt, always validate the output JSON against the schema before piping the results into your cleanup automation or ticketing system.
Prompt Variables
Required inputs for the Feature Flag Lifecycle Management Prompt. Each placeholder must be populated before the prompt is assembled and sent. Validation notes describe how to programmatically check that the input is well-formed before incurring model cost.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[FLAG_IDENTIFIER] | Unique key or name of the feature flag under review | checkout-v2-redesign | Must match the flag key format used in the flag management system. Regex check against allowed characters and length limits. |
[FLAG_OWNER_TEAM] | Team responsible for the flag's lifecycle and eventual cleanup | platform-checkout | Must resolve to a valid team slug in the service catalog. Null allowed if ownership is unassigned, which should trigger an ownership gap alert. |
[FLAG_CREATION_DATE] | Timestamp when the flag was first created in the system | 2025-01-15T09:30:00Z | Must parse as ISO 8601. If older than the organization's stale-flag threshold, the prompt should flag for cleanup review. |
[FLAG_CURRENT_STATE] | Current lifecycle phase of the flag | ramp-50-percent | Must be one of the enumerated lifecycle states: birth, ramp, full-rollout, cleanup-pending, sunset, deprecated. Enum check before prompt assembly. |
[TARGETING_RULES_SNAPSHOT] | Current targeting configuration as structured JSON or DSL | {"rules":[{"attribute":"tenant","op":"in","values":["tenant-a","tenant-b"]}]} | Must parse as valid JSON. Schema validation against the flag system's targeting rule schema. If empty object, flag is globally applied. |
[DEPENDENT_SERVICES] | List of services or code paths that read this flag | ["api-gateway","billing-svc","cart-renderer"] | Must be a JSON array of service identifiers. Each identifier must exist in the service registry. Empty array is valid and should trigger a dependency gap check. |
[CLEANUP_TICKET_REF] | Reference to the ticket or issue tracking flag removal | PLAT-2841 | Must match the organization's ticket ID pattern. Null allowed if no cleanup ticket exists, which should trigger a process gap alert in the evaluation. |
Implementation Harness Notes
How to wire the Feature Flag Lifecycle Management Prompt into an automated platform workflow with validation, retries, and human review gates.
This prompt is designed to be called by a platform automation system—such as a CI/CD pipeline, a flag management service, or an internal developer portal—not by a human copying and pasting into a chat window. The harness should supply the flag metadata, ownership records, and usage telemetry as structured inputs, then parse the model's output into actionable lifecycle recommendations. Because stale flags cause production incidents and technical debt accumulation, the harness must treat the model's output as advisory and route high-risk recommendations (e.g., flag removal, ownership transfer) through a human approval step before any automated action is taken.
The implementation should follow a validate → retry → review → act pattern. First, validate the model's output against a strict JSON schema that enforces required fields: flag_id, lifecycle_phase, recommended_action, risk_level, evidence, and deadline. If validation fails, retry once with the error message appended to the prompt context. If the retry also fails, log the failure and escalate to the flag owner. For recommendations with risk_level: high or actions like deprecate or remove, route to a human review queue with a pre-formatted approval payload. For low-risk actions like add_cleanup_task_to_backlog, the harness can auto-create a ticket in the team's backlog system. Use a model with strong JSON mode support (e.g., GPT-4o, Claude 3.5 Sonnet) and set temperature=0 to maximize output consistency across runs.
Log every invocation with the flag ID, model version, input telemetry snapshot, raw output, validation result, and final action taken. This audit trail is essential for demonstrating flag hygiene governance to engineering leadership and for debugging cases where the model misclassifies a flag's lifecycle phase. Avoid wiring the prompt directly to a flag deletion API—the harness should always require explicit human approval for destructive actions. Start with a weekly batch job that processes all flags older than 30 days, then tighten the cadence as the team builds confidence in the model's recommendations and the review workflow.
Expected Output Contract
Defines the shape, types, and validation rules for the Feature Flag Lifecycle Management Prompt output. Use this contract to parse, validate, and store the generated lifecycle review before integrating it into a flag management dashboard or CI pipeline.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
flag_id | string | Must match the [FLAG_ID] input exactly. No transformations allowed. | |
lifecycle_phase | enum: ['birth', 'ramp', 'full_rollout', 'cleanup', 'sunset'] | Must be one of the five allowed enum values. Case-sensitive. | |
ownership_handoff_gaps | array of objects: {from_team: string, to_team: string, gap_description: string, severity: enum['low','medium','high','critical']} | Array must not be empty if phase is 'cleanup' or 'sunset'. Each object must include all four fields. severity must be a valid enum value. | |
stale_flag_accumulation_risk | object: {is_at_risk: boolean, stale_flags_count: integer, oldest_flag_age_days: integer, recommendation: string} | is_at_risk must be true if stale_flags_count > 0. oldest_flag_age_days must be a positive integer. recommendation must be a non-empty string. | |
ramp_progress | object: {current_percentage: integer, target_percentage: integer, ramp_duration_days: integer, health_checks_passing: boolean} | Required only when lifecycle_phase is 'ramp'. current_percentage must be between 0 and 100. ramp_duration_days must be a positive integer. | |
cleanup_plan | object: {code_removal_pr_link: string|null, config_removal_ticket: string|null, target_sprint: string|null, blocking_dependencies: array of strings} | Required only when lifecycle_phase is 'cleanup'. code_removal_pr_link and config_removal_ticket must be valid URLs or null. blocking_dependencies must be an array, empty if none. | |
sunset_verification | object: {flag_removed_from_codebase: boolean, config_purged: boolean, monitoring_alert_removed: boolean, verification_date: string|null} | Required only when lifecycle_phase is 'sunset'. All boolean fields must be true for a complete sunset. verification_date must be ISO 8601 format or null if not yet verified. | |
recommendations | array of strings | Must contain at least one actionable recommendation. Each string must be a complete sentence with a clear action verb. No empty strings allowed. |
Common Failure Modes
What breaks first when using a Feature Flag Lifecycle Management Prompt and how to guard against it.
Stale Flag Blindness
What to watch: The prompt fails to identify flags that are fully rolled out but never scheduled for cleanup, treating them as active lifecycle entities. This accumulates technical debt silently. Guardrail: Always provide a flag creation date and last-modified timestamp in the input context. Add an explicit instruction to flag any rule older than 90 days without a sunset date.
Ownership Handoff Gaps
What to watch: The prompt assumes continuous ownership and misses the transition when a flag moves from the delivery team to the platform team for cleanup. This creates orphaned flags no one is responsible for. Guardrail: Require an owner field for each lifecycle stage in the input schema. Add a validation step that checks for missing or unchanged owners across stage transitions.
Untested Flag Combination Explosion
What to watch: The prompt reviews flags in isolation, ignoring the combinatorial risk of multiple flags interacting in production. A safe flag alone can be dangerous when combined with another. Guardrail: Include a dependent_flags or flag_group field in the input context. Instruct the prompt to flag any lifecycle stage change that alters a flag's interaction surface with other active flags.
Kill Switch Latency Overconfidence
What to watch: The prompt treats a kill switch as an instant rollback mechanism without evaluating the propagation delay in the flag evaluation system. This leads to overestimating recovery speed during incidents. Guardrail: Require the flag evaluation architecture context (polling interval, SDK cache TTL, event-driven vs. polling) as a required input. Instruct the prompt to calculate and report the maximum propagation delay for any kill switch action.
Sunset Checklist Incompleteness
What to watch: The prompt generates a sunset plan that removes the flag from the codebase but misses related artifacts like documentation, runbooks, monitoring dashboards, and QA test suites. Guardrail: Provide a mandatory related_artifacts input list. Add a post-generation validation step that checks the sunset plan against every artifact type in the input list.
Ramp Decision Without Metric Grounding
What to watch: The prompt recommends increasing the rollout percentage based on a generic time-based schedule without requiring evidence from observability signals. This automates a bad release decision. Guardrail: Require a health_signals input block with current metric values and thresholds. Instruct the prompt to refuse a ramp recommendation if health signal data is missing or below threshold.
Evaluation Rubric
Use this rubric to test the Feature Flag Lifecycle Management Prompt before integrating it into a release pipeline. Each criterion targets a specific failure mode common in lifecycle reviews.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Phase Completeness | Output identifies all five lifecycle phases: birth, ramp, full rollout, cleanup, sunset. | Missing one or more lifecycle phases in the structured output. | Schema check: verify [OUTPUT_SCHEMA] contains a non-null entry for each phase. |
Ownership Assignment | Every lifecycle phase has an explicit owner team or role, with no unresolved [OWNER] placeholders. | Ownership field is null, empty, or contains a generic placeholder like 'TBD'. | Parse check: iterate phase objects and assert |
Stale Flag Detection | Flags inactive for longer than [STALE_THRESHOLD_DAYS] are explicitly flagged for cleanup with a recommended action. | A flag with | Logic test: inject a flag record with a stale timestamp and assert output phase is 'cleanup' or 'sunset'. |
Handoff Gap Identification | Output lists specific gaps where ownership transitions between phases lack a documented handoff trigger. | The review reports zero handoff gaps when a simulated gap exists between 'ramp' and 'full rollout'. | Adversarial test: provide a flag config missing a promotion gate and assert |
Deprecation Dependency Check | Sunset recommendation includes a check for downstream dependencies before recommending removal. | Sunset action is 'remove flag' without a corresponding dependency scan or warning. | Keyword assertion: verify the sunset recommendation text contains 'dependency' or 'downstream'. |
Evidence Grounding | Every finding references a specific flag ID, config file, or log entry from [INPUT_CONTEXT]. | A lifecycle finding contains a claim with no source reference or a hallucinated file path. | Citation check: parse output and assert each finding object has a non-null |
Output Schema Validity | Output strictly conforms to [OUTPUT_SCHEMA] with all required fields present and correctly typed. | JSON parsing fails or required fields like | Automated schema validation: validate output against the JSON Schema provided in [OUTPUT_SCHEMA]. |
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Adapt This Prompt
How to adapt
Start with the base lifecycle review prompt but relax strict schema requirements. Focus on flag birth, ramp, and cleanup phases. Use a simple checklist format instead of full JSON output. Accept free-text responses for ownership and sunset criteria.
codeReview this feature flag lifecycle for [FLAG_NAME]: - Creation date: [CREATION_DATE] - Current phase: [PHASE] - Owner: [OWNER] List any lifecycle gaps you see.
Watch for
- Missing ownership handoff detection
- Overly optimistic cleanup timelines
- No stale flag accumulation checks
- Vague phase transition criteria

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us