Skillpedia
النشر والسحابة (DevOps)29k · #9556

feature-flags-architect

ما الذي تفعله

تدير هذه المهارة دورة حياة مفاتيح الميزات كاملة، من الإطلاق حتى الإزالة. وهي للمطورين وفرق المنتجات الذين يستخدمون المفاتيح لإطلاق التغييرات بأمان ويريدون تجنب فوضى المفاتيح.

متى تستخدمها

  • ✓عندما تضيف مفتاح ميزة جديدًا وتحتاج إلى خطة إطلاق تدريجي.
  • ✓عندما تحتوي شيفرتك على مفاتيح قديمة كثيرة يجب تنظيفها.
  • ✓عندما تطلق ميزة محفوفة بالمخاطر وتحتاج إلى مفتاح إيقاف موثوق.

رابط المهارة

https://github.com/alirezarezvani/claude-skills/blob/main/engineering/feature-flags-architect/skills/feature-flags-architect/SKILL.md

انسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.

طريقة الاستخدام

أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.

رسالة جاهزة للصق

استخدم هذه المهارة لمساعدتي: https://github.com/alirezarezvani/claude-skills/blob/main/engineering/feature-flags-architect/skills/feature-flags-architect/SKILL.md اقرأ ملف SKILL.md في هذا الرابط ونفّذ تعليماته لمهمتي.
تريد أن يجد الذكاء الاصطناعي مهارات مثل هذه بنفسه؟ثبّت خادم Skillpedia MCP المجاني: سطر واحد، ويبحث في 15,000+ مهارة قبل كل مهمة.ثبّته في دقيقة واحدة →

مثال على ما تطلبه من الذكاء الاصطناعي

“خطط لإطلاق حلقي مدته 14 يومًا لمفتاح الدفع الجديد، وتحقق مما إذا كان لدينا مفتاح إيقاف موثق.”

5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.

كيف تعمل

يخطط الوكيل للإطلاق حسب نسبة المستخدمين والمدة، ويفحص الشيفرة بحثًا عن المفاتيح القديمة، ويتحقق من أن لكل مفتاح محفوف بالمخاطر مفتاح إيقاف موثقًا. ويرتب المفاتيح حسب نوعها لتحديد مدة بقاء كل منها.

المحتوى التقني (ملف SKILL.md الأصلي)

النص الأصلي من المؤلف، مباشرة من GitHub.

Feature Flags Architect

End-to-end discipline for feature flags: classify them, ship them, ramp them, and retire them. Most teams treat flags as throwaway if-statements; this skill treats them as a controlled lifecycle with measurable debt.

When to use

  • Adding a new flag and need a rollout plan
  • Auditing a codebase for stale or orphaned flags
  • Choosing a flag provider (LaunchDarkly vs GrowthBook vs Statsig vs Unleash vs Flipt vs build-your-own)
  • Designing a kill-switch path for a risky launch
  • Cleaning up flag debt before a release freeze
  • Reviewing whether a feature should ship behind a flag at all

Core principle: flags are a lifecycle, not an if

request → design → ship → ramp → cleanup → archive

Flags that skip cleanup become debt: dead branches, stale defaults, untested code paths, unbounded blast radius. The three scripts in this skill enforce the lifecycle.

Quick start

# 1. Audit the repo for flag debt
python scripts/flag_debt_scanner.py --repo . --max-age-days 90

# 2. Plan a progressive rollout for a new flag
python scripts/rollout_planner.py --population 100000 --target-percent 100 --duration-days 14 --strategy ring

# 3. Verify every flag has a documented kill switch
python scripts/kill_switch_audit.py --repo . --flag-doc docs/feature-flags.md

The 4 flag types (taxonomy)

Different flag types have different lifespans and ownership. Misclassifying creates debt.

Type Purpose Typical lifespan Owner Cleanup trigger
Release Hide unfinished features in production days–weeks Eng 100% rollout reached
Experiment A/B test variants weeks Product/Marketing Test concluded; winner picked
Operational Circuit breakers, perf toggles, kill switches months–years Eng/SRE Replaced by autoscaling/feature retirement
Permission Entitlements per user/account/plan years (permanent) Product Plan/role removed

Only Release and Experiment flags should be on a debt-scanner watchlist. Operational and Permission flags are by design long-lived. See references/flag_taxonomy.md for decision tree.

The 3 Python tools

All three are stdlib-only. Run with --help.

flag_debt_scanner.py

Finds flags older than --max-age-days with low usage, suggesting candidates for cleanup.

python scripts/flag_debt_scanner.py --repo . --max-age-days 90 --format text
python scripts/flag_debt_scanner.py --repo . --max-age-days 60 --format json > debt.json

Detection heuristic:

  1. Walk --repo for code references matching common flag-call patterns:
    • flag("..."), isFlagEnabled("..."), featureFlag("..."), getFlag("...")
    • client.variation("...", ...), unleash.isEnabled("..."), growthbook.feature("...")
  2. For each unique flag identifier, find the oldest commit that introduced it (git log --diff-filter=A -S <name>).
  3. Flag as DEBT if introduced > --max-age-days ago AND used in ≤--min-uses places.

Outputs flag name, age in days, file references, suggested action. JSON mode is CI-friendly.

rollout_planner.py

Generates a phased rollout schedule from population size, target percent, duration, and strategy.

python scripts/rollout_planner.py --population 100000 --target-percent 100 --duration-days 14 --strategy ring
python scripts/rollout_planner.py --population 50000 --target-percent 25 --duration-days 7 --strategy linear
python scripts/rollout_planner.py --population 1000000 --target-percent 100 --duration-days 30 --strategy log

Strategies:

  • ring: 1% → 5% → 25% → 50% → 100%, evenly spaced. Default for risky launches.
  • linear: constant rate per day. Default for medium-risk.
  • log: rapid early, slow tail. Default for low-risk launches with confidence.
  • cohort: by named cohort (internal → beta → free → paid → all).

Outputs a markdown table with date, percent, expected user count, abort criteria, and verification step per phase.

kill_switch_audit.py

Cross-references code-discovered flags against documentation to verify each has a kill switch path written down.

python scripts/kill_switch_audit.py --repo . --flag-doc docs/feature-flags.md
python scripts/kill_switch_audit.py --repo . --flag-doc runbooks/flags.md --format json

What it checks:

  1. Every code-discovered flag has an entry in --flag-doc
  2. Each entry declares: owner, type, kill-switch trigger, monitoring dashboard
  3. Reports flags missing docum
الأسئلة الشائعة

ما مفتاح الإيقاف الطارئ؟

هو وسيلة لإيقاف الميزة بسرعة إذا تسببت في مشكلات.

ما الدَّين الناتج عن المفاتيح؟

هو تراكم المفاتيح القديمة غير المستخدمة ومسارات الشيفرة الميتة عندما لا تُزال المفاتيح أبدًا.

ما مزودو المفاتيح الذين يذكرهم؟

LaunchDarkly وGrowthBook وStatsig وUnleash وFlipt، أو نظام داخلي مبني خصيصًا.

التفاصيل

الوصف الأصلي من المؤلف

Use before adding, rolling out or retiring a feature flag or kill switch, or when flag debt piles up. Plans the rollout with rollout_planner.py, finds stale flags with flag_debt_scanner.py and audits kill switches with kill_switch_audit.py.

repo: alirezarezvani/claude-skills

الشعبية

نجوم GitHub
29k
الترتيب
#9556
الترخيص
MIT
آخر تحديث
2‏/11‏/2026

هل هذه المهارة مفيدة؟

0

سجّل الدخول للتصويت.

التعليقات

  • …

المزيد من المهارات من هذا المستودع

مهارات مشابهة