Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

shadow-mode

БесплатноБез исполняемых скриптовНе проверен

Shadow mode / dark-launch for validating new systems under production load. Use when testing replacement services, comparing behavior, or planning traffic…

laurigatesот laurigates★ 61 звезда на GitHub

Об этом скилле

Shadow Mode Migration Pattern

Shadow mode mirrors production traffic to a new system without affecting users. The shadow system's responses are discarded — only the production response reaches the user — but both responses are logged and compared to validate correctness.

When to Use This Skill

Use this skill when... Use dual-write instead when...
Validating read behavior of a replacement service Both systems need to persist writes
Testing performance under real production load You need the new store to be authoritative
Comparing response correctness before cutover Migrating data stores that must stay in sync
Evaluating a new service version safely The new system needs to receive and store mutations
Load testing a new deployment with real traffic You need strong consistency between systems

Core Concepts

Traffic Flow

Client Request
    │
    ▼
┌─────────────┐
│   Router /   │
│   Proxy      │
├──────┬──────┤
│      │      │
▼      │      ▼
Prod   │   Shadow
System │   System
│      │      │
▼      │      ▼
Prod   │   Shadow
Response│   Response
│      │      │
▼      │   (discard)
Client │      │
       │      ▼
       │   Compare &
       │   Log
       ▼

Shadow Modes

Mode Description Use case
Full mirror 100% of traffic duplicated Final validation before cutover
Sampled mirror Percentage of traffic (e.g., 10%) Early validation, capacity-constrained shadow
Selective mirror Specific request types or endpoints Targeted validation of changed behavior
Replay mirror Recorded traffic replayed offline Testing without live shadow infrastructure

Implementation Architecture

Key Components

Component Responsibility
Traffic splitter Duplicates requests to shadow system
Shadow router Forwards mirrored requests, manages timeouts
Response comparator Compares prod vs shadow responses
Discrepancy logger Records differences with full context
Metrics collector Tracks match rates, latency, error rates
Kill switch Disables shadow traffic instantly if issues arise

Deployment Topology

Topology How it works Trade-offs
Proxy-based Load balancer or API gateway mirrors requests Simple setup, adds proxy hop
Application-level Application code sends async copy of request Fine-grained control, code coupling
Infrastructure-level Service mesh (Istio, Linkerd) mirrors traffic No code changes, requires mesh
Log replay Capture request logs, replay against shadow No live infrastructure needed, not real-time

Implementation Patterns

Proxy-Based Mirroring

Configure the load balancer or API gateway to:

  1. Forward the original request to the production backend
  2. Clone the request and send it to the shadow backend
  3. Return only the production response to the client
  4. Shadow response is logged but never returned
  5. Shadow request timeout is independent of production

Application-Level Mirroring

  1. Intercept the incoming request at the application layer
  2. Process the request normally through the production path
  3. Asynchronously send a copy of the request to the shadow service
  4. Do not block the production response on the shadow response
  5. Compare responses in a background worker

Response Comparison Strategy

Compare responses field by field with configurable rules:

Field type Comparison approach
IDs, timestamps Ignore (expected to differ)
Computed values Compare within tolerance (e.g., floating point)
Collections Compare as sets (ignore ordering unless significant)
Status codes Exact match required
Error responses Categorize and compare error types
Headers Compare relevant headers only (Content-Type, Cache-Control)

Handling Stateful Requests

Shadow mode works best with read-only requests. For stateful (write) requests:

Approach Description
Skip writes Only mirror read requests to shadow
Isolated state Shadow has its own database seeded from production
Dry-run writes Shadow validates the write but does not persist
Record-only Log what shadow would have written, compare intent

Gradual Rollout

Phase Traffic % Duration Goal
1. Smoke test 1% Hours Verify shadow receives and processes requests
2. Canary 5-10% Days Identify obvious discrepancies
3. Validation 25-50% Days-weeks Build confidence in match rate
4. Full mirror 100% Days-weeks Final validation before cutover

Validation Metrics

Metric Target Description
Response match rate > 99.9% Percentage of identical responses
Shadow late
Полный SKILL.md на GitHub

Установить shadow-mode в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Read
Grep
Glob
Edit
Write
TodoWrite

FAQ

Что делает скилл shadow-mode?

Shadow mode / dark-launch for validating new systems under production load. Use when testing replacement services, comparing behavior, or planning traffic mirroring for migrations.

Как установить скилл shadow-mode?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл shadow-mode запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить shadow-mode с