feature-flags-architect
Skill này làm gì
Skill này quản lý toàn bộ vòng đời của feature flag, từ lúc ra mắt đến lúc gỡ bỏ. Skill dành cho lập trình viên và đội sản phẩm dùng flag để phát hành thay đổi an toàn và tránh tình trạng flag bừa bộn.
Khi nào nên dùng
- ✓Khi bạn thêm một feature flag mới và cần kế hoạch rollout dần.
- ✓Khi codebase của bạn có nhiều flag cũ nên được dọn dẹp.
- ✓Khi bạn ra mắt một tính năng rủi ro và cần một kill switch đáng tin cậy.
Liên kết skill
https://github.com/alirezarezvani/claude-skills/blob/main/engineering/feature-flags-architect/skills/feature-flags-architect/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Lên kế hoạch rollout theo vòng trong 14 ngày cho flag thanh toán mới, và kiểm tra xem chúng tôi có kill switch được ghi lại không.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent lên kế hoạch rollout theo nhóm người dùng và thời lượng, quét codebase để tìm flag cũ và kiểm tra mỗi flag rủi ro có kill switch được ghi lại không. Nó cũng phân loại flag theo loại để quyết định mỗi flag nên tồn tại bao lâu.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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:
- Walk
--repofor code references matching common flag-call patterns:flag("..."),isFlagEnabled("..."),featureFlag("..."),getFlag("...")client.variation("...", ...),unleash.isEnabled("..."),growthbook.feature("...")
- For each unique flag identifier, find the oldest commit that introduced it (
git log --diff-filter=A -S <name>). - Flag as DEBT if introduced >
--max-age-daysago AND used in ≤--min-usesplaces.
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:
- Every code-discovered flag has an entry in
--flag-doc - Each entry declares: owner, type, kill-switch trigger, monitoring dashboard
- Reports flags missing docum
Câu hỏi thường gặp
Kill switch là gì?
Đó là cách tắt nhanh một tính năng khi nó gây ra vấn đề.
Nợ flag là gì?
Đó là sự bừa bộn từ các flag cũ, không dùng nữa, và các nhánh code chết tích tụ khi flag không bao giờ được gỡ.
Nó nhắc đến những nhà cung cấp flag nào?
LaunchDarkly, GrowthBook, Statsig, Unleash và Flipt, hoặc một hệ thống tự xây.
Chi tiết
Mô tả gốc của tác giả
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.
Độ phổ biến
- Sao GitHub
- 29k
- Vị trí xếp hạng
- #9556
- Giấy phép
- MIT
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
agent-launcher-orchestrator
29kGiúp agent của bạn lên kế hoạch, xây dựng, kiểm thử và lên lịch một Claude managed agent trong tài khoản riêng, từng bước một, bắt đầu từ một mục tiêu rõ ràng.
grade-iterate
29kCho phép agent của bạn chấm kết quả một managed AI agent theo bảng tiêu chí và cải thiện qua số vòng cố định, nên không bao giờ lặp vô tận.
interview
29kCho phép agent của bạn phỏng vấn bạn về ý tưởng agent AI và biến câu trả lời thành một kế hoạch xây dựng đơn giản trước khi khởi chạy bất cứ điều gì.
run-without-you
29kGiúp agent của bạn thiết lập một managed AI agent chạy theo lịch hoặc khi có sự kiện xảy ra, với thời gian cron được kiểm tra trước khi khởi chạy.
Skill tương tự
openclaw-update
394kGiúp agent của bạn cập nhật OpenClaw Gateway đang có, chọn cách cập nhật phù hợp với cách cài đặt và giữ phiên làm việc của bạn hoạt động.
diagnose-gateway
394kGiúp agent của bạn tìm hiểu vì sao OpenClaw Gateway bị lỗi bằng cách kiểm tra cài đặt, kênh và cổng mà không thay đổi gì.
crabbox-apps
394kGiúp agent của bạn mở và chạy một app trên máy đám mây tạm thời, rồi hiển thị giao diện của nó trong thanh bên của chat.