Awesome-omni-skill safe-feature-addition
Elite guide for shipping features without breaking production. Universal patterns for JS, TS, Python, Go, Rust, and more. Implements "Additive over Destructive" development, Unified Safety Auditing, and Feature Flags.
git clone https://github.com/diegosouzapw/awesome-omni-skill
T=$(mktemp -d) && git clone --depth=1 https://github.com/diegosouzapw/awesome-omni-skill "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/development/safe-feature-addition" ~/.claude/skills/diegosouzapw-awesome-omni-skill-safe-feature-addition && rm -rf "$T"
skills/development/safe-feature-addition/SKILL.md🛡️ Safe Feature Addition: Ship Without Breaking
What This Does
This skill provides a Universal Safety Net for adding new features to production systems across any framework or language. It implements an "Additive Development" philosophy where new code lives alongside old code, protected by feature flags and gradual rollouts.
[!IMPORTANT] The Golden Rule: Always favor additive changes over destructive modifications. Existing code should remain untouched and functional.
🏗️ The Production Toolkit
This skill is powered by a unified safety engine compatible with JS, TS, Python, Go, Rust, and Ruby:
| Tool | Purpose |
|---|---|
| Ensures all flags in code are defined in config. |
| Scans git diff for destructive changes (signature breaks). |
| Central configuration for feature toggles. |
🚀 Step 1: Additive Development (Universal)
Instead of changing an existing function, extend it or create a new one.
JavaScript / TypeScript
// ✅ ELITE & ADDITIVE - Backward compatible function processPayment(amount, method = 'credit-card') { if (method === 'crypto') return crypto(amount); return legacyPayment(amount); }
Python
# ✅ ELITE & ADDITIVE - Backward compatible def process_payment(amount, method='credit_card'): if method == 'crypto': return crypto(amount) return legacy_payment(amount)
🚩 Step 2: Feature Flags (The Kill Switch)
Wrap all new logic in feature flags. This allows you to deploy code to production while it is still "dormant".
1. Define the Flag (YAML/JSON)
# feature-flags.yml new_feature_v2: enabled: false rollout_percentage: 0 # Start at 0% traffic
2. Guard the Code
// Works in React, Vue, Svelte, etc. if (flags.isEnabled('new-feature-v2', user.id)) { return <NewComponent />; } return <LegacyComponent />;
3. Verify Deployment
Before you ship, run the safety check to ensure config matches code:
python scripts/safe-feature.py verify --path ./src --config ./feature-flags.yml
🔍 Step 3: Git Safety Audit
Before merging your PR, run the Universal Safety Auditor to detect destructive changes that might break production.
# Audits your current branch against master/main python scripts/safe-feature.py audit --base main
The Auditor detects:
- Modified function signatures without default values.
- New code blocks without feature flag guards.
- Potential "Big Bang" changes that increase risk.
📈 Step 4: Gradual Rollout (Canary Schedule)
Never switch a feature to 100% on Day 1. Use an industry-standard gradual schedule:
| Phase | Traffic | Duration | Goal |
|---|---|---|---|
| Canary | 5% | 1 hour | Check for smoke/crash loops |
| Early Bird | 25% | 1 day | Check for performance bugs |
| Rollout | 50% | 2 days | Monitor business metrics |
| GA | 100% | Permanent | Complete the rollout |
🛠️ Performance & Safety Checklist
- Is the change additive? (Yes/No)
- Is there a Feature Flag? (Yes/No)
- Did you run
? (Yes/No)safe-feature verify - Is the Database Migration backward-compatible? (Yes/No)
- Is there a Kill Switch? (Yes/No)
Success = Zero Downtime + Instant Rollback. 🚀