AD

ads-network-killswitch

Provides an emergency killswitch to toggle ad networks on or off without deleting configuration data.

Install

mkdir -p .claude/skills/ads-network-killswitch && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/15239" && unzip -o skill.zip -d .claude/skills/ads-network-killswitch && rm skill.zip

Installs to .claude/skills/ads-network-killswitch

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Network killswitch: per-network enable/disable. Use when: disabling problematic networks, emergency ad shutoff, toggling networks without deletion.
147 chars✓ has a “when” trigger
Beginner

Key capabilities

  • Globally disable all ads via a master switch
  • Enable or disable individual ad networks
  • Perform emergency shutdown of all ad networks
  • Toggle networks for A/B testing without data loss
  • Check if the ads system is globally active

How it works

This skill controls ad network activation through settings models, using a master switch for global control and individual toggles for specific networks. Changes take effect immediately.

Inputs & outputs

You give it
A network ID and an enabled status (boolean) or a reason for emergency shutdown
You get back
The updated AdNetwork object or the count of disabled networks

When to use ads-network-killswitch

  • Emergency disable problematic networks
  • Toggle ad networks for A/B testing
  • Global ad system shutdown
  • Safe network management

About this skill

Network Killswitch

When to Use

  • Emergency disabling a network serving malvertising
  • Toggling networks on/off for A/B testing
  • Implementing master ads killswitch via AdsSettings.ads_enabled
  • Per-network enable/disable without data loss

Rules

  • AdsSettings.ads_enabled is the master switch — if False, ALL ads stop
  • AdsSettings.ad_networks_enabled controls whether network waterfall runs
  • AdNetwork.is_enabled is the per-network toggle
  • Never delete a network to disable it — use is_enabled = False
  • Killswitch changes take effect immediately — no cache delay

Patterns

Master Killswitch Check

# apps/ads/services.py
from apps.ads.models import AdsSettings

def is_ads_active() -> bool:
    """Check if ads system is globally enabled."""
    settings = AdsSettings.get_solo()
    return settings.ads_enabled and settings.ad_networks_enabled

Per-Network Toggle

def toggle_network(*, network_id: int, enabled: bool) -> AdNetwork:
    network = AdNetwork.objects.get(pk=network_id)
    network.is_enabled = enabled
    network.save(update_fields=["is_enabled", "updated_at"])
    return network

Emergency Shutdown Service

def emergency_shutdown_all_networks(*, reason: str) -> int:
    """Disable all networks immediately. Returns count of disabled networks."""
    count = AdNetwork.objects.filter(is_enabled=True).update(
        is_enabled=False,
        sync_status=f"Emergency shutdown: {reason}",
    )
    settings = AdsSettings.get_solo()
    settings.ads_enabled = False
    settings.save(update_fields=["ads_enabled"])
    return count

Template Guard

{% load ads_tags %}
{% if ads_enabled %}
  {% include "ads/fragments/placement.html" with placement=sidebar_ad %}
{% endif %}

Anti-Patterns

  • Deleting AdNetwork records instead of disabling — loses historical data
  • Caching killswitch state for long TTLs — must be near-real-time
  • Checking only AdNetwork.is_enabled without checking master AdsSettings.ads_enabled

Quality Gate

& .\.venv\Scripts\python.exe -m ruff check . --fix
& .\.venv\Scripts\python.exe -m ruff format .
& .\.venv\Scripts\python.exe manage.py check --settings=app.settings_dev

When not to use it

  • When deleting AdNetwork records instead of disabling them
  • When caching killswitch state for long durations
  • When checking only AdNetwork.is_enabled without AdsSettings.ads_enabled

Limitations

  • Killswitch changes take effect immediately , no cache delay
  • Never delete a network to disable it , use is_enabled = False
  • AdsSettings.ads_enabled is the master switch , if False, ALL ads stop

How it compares

This skill provides immediate, granular control over ad network activation without data loss, unlike manual deletion or delayed updates.

Compared to similar skills

ads-network-killswitch side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
ads-network-killswitch (this skill)04moNo flagsBeginner
netalertx-plugin-run-development16moReviewIntermediate
vastai-webhooks-events027dReviewIntermediate
sms-inbox-manager01moReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

Search skills

Search the agent skills registry