Token导航 LogoToken导航TokenDH.com
开发需要联网github未标认证来源可访问许可证需确认审计通过

shadow-mode阴影模式

Agent Skill

shadow-mode 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

753

周安装

32

GitHub Stars

28

下载量

264
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:shadow-mode(阴影模式)
来源仓库:https://github.com/laurigates/claude-plugins
仓库路径:skills/shadow-mode
安装命令:
npx skills add https://github.com/laurigates/claude-plugins --skill shadow-mode
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/laurigates/claude-plugins --skill shadow-mode

简介

shadow-mode 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。

  • 可结合来源仓库、安装命令和原始 README 继续核验具体用法。
  • 安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。
  • 适用于需要自动化处理代码仓库相关任务的开发者。
  • 支持通过 npx 命令从指定 GitHub 仓库安装使用。

SKILL.md

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 serviceBoth systems need to persist writes
Testing performance under real production loadYou need the new store to be authoritative
Comparing response correctness before cutoverMigrating data stores that must stay in sync
Evaluating a new service version safelyThe new system needs to receive and store mutations
Load testing a new deployment with real trafficYou 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

ModeDescriptionUse case
Full mirror100% of traffic duplicatedFinal validation before cutover
Sampled mirrorPercentage of traffic (e.g., 10%)Early validation, capacity-constrained shadow
Selective mirrorSpecific request types or endpointsTargeted validation of changed behavior
Replay mirrorRecorded traffic replayed offlineTesting without live shadow infrastructure

Implementation Architecture

Key Components

ComponentResponsibility
Traffic splitterDuplicates requests to shadow system
Shadow routerForwards mirrored requests, manages timeouts
Response comparatorCompares prod vs shadow responses
Discrepancy loggerRecords differences with full context
Metrics collectorTracks match rates, latency, error rates
Kill switchDisables shadow traffic instantly if issues arise

Deployment Topology

TopologyHow it worksTrade-offs
Proxy-basedLoad balancer or API gateway mirrors requestsSimple setup, adds proxy hop
Application-levelApplication code sends async copy of requestFine-grained control, code coupling
Infrastructure-levelService mesh (Istio, Linkerd) mirrors trafficNo code changes, requires mesh
Log replayCapture request logs, replay against shadowNo 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 typeComparison approach
IDs, timestampsIgnore (expected to differ)
Computed valuesCompare within tolerance (e.g., floating point)
CollectionsCompare as sets (ignore ordering unless significant)
Status codesExact match required
Error responsesCategorize and compare error types
HeadersCompare relevant headers only (Content-Type, Cache-Control)

Handling Stateful Requests

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

ApproachDescription
Skip writesOnly mirror read requests to shadow
Isolated stateShadow has its own database seeded from production
Dry-run writesShadow validates the write but does not persist
Record-onlyLog what shadow would have written, compare intent

Gradual Rollout

PhaseTraffic %DurationGoal
1. Smoke test1%HoursVerify shadow receives and processes requests
2. Canary5-10%DaysIdentify obvious discrepancies
3. Validation25-50%Days-weeksBuild confidence in match rate
4. Full mirror100%Days-weeksFinal validation before cutover

Validation Metrics

MetricTargetDescription
Response match rate> 99.9%Percentage of identical responses
Shadow latency (P50)Within 2x of prodShadow performance baseline
Shadow latency (P99)MonitoredTail latency under real load
Shadow error rate< prod error rateShadow should not produce more errors
Shadow availabilityMonitoredShadow uptime (not a blocker)
Discrepancy categoriesTrending to zeroKnown differences resolved over time

Common Pitfalls

PitfallMitigation
Shadow affects production performanceAsync mirroring, independent timeouts, kill switch
Shadow writes to shared resourcesIsolate shadow databases, queues, and external services
Non-deterministic responses cause false mismatchesConfigure comparison rules to ignore timestamps, IDs, nonces
Shadow receives stale dataSeed shadow database from recent production snapshot
Traffic amplification overwhelms shadowUse sampled mirroring, auto-scaling, or circuit breakers
Request ordering differs between prod and shadowCompare request-by-request, not sequence-dependent
Authentication tokens expire for shadowMint shadow-specific tokens or bypass auth in shadow

Integration with Dual Write

Shadow mode and dual write are complementary migration techniques:

Migration phaseTechniquePurpose
Early validationShadow mode (reads)Verify the new system returns correct responses
Data syncDual writeKeep both stores authoritative during transition
Pre-cutoverBoth simultaneouslyShadow validates reads, dual write maintains data
CutoverDual write reversalNew system becomes primary, old becomes secondary
Post-cutoverShadow mode (reversed)Mirror to old system to verify nothing broke

Strangler Fig Context

Both patterns are tactics within the broader Strangler Fig migration strategy:

  1. Identify a component to migrate
  2. Shadow traffic to validate the replacement
  3. Dual write to synchronize data stores
  4. Cut over reads, then writes
  5. Decommission the old component
  6. Repeat for the next component

Kill Switch Requirements

Shadow mode must have an immediate disable mechanism:

  • Feature flag or configuration toggle (no deployment required)
  • Disables within seconds, not minutes
  • Monitored — alerts if shadow causes production impact
  • Tested before enabling shadow traffic

Monitoring Checklist

  • Production latency impact (should be zero or negligible)
  • Shadow request success rate
  • Shadow response latency distribution
  • Response match rate by endpoint
  • Discrepancy log volume and categories
  • Shadow system resource utilization
  • Kill switch status and responsiveness

Agentic Optimizations

ContextApproach
Architecture reviewVerify shadow isolation (no shared writes), kill switch exists
Code reviewCheck async mirroring does not block production path
ImplementationStart with proxy-based mirroring at 1%, increase gradually
TestingVerify kill switch works, confirm production is unaffected when shadow fails

Quick Reference

TermDefinition
Shadow systemThe new system receiving mirrored traffic
Production systemThe live system serving real users
Traffic splitterComponent that duplicates requests
Match ratePercentage of shadow responses matching production
Kill switchMechanism to instantly disable shadow traffic
Dark launchingSynonym for shadow mode — feature is live but invisible to users
Canary trafficSmall percentage of mirrored requests for initial validation
Strangler figBroader migration strategy of incrementally replacing components

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

37.37%
按下载量换算99

Claude

28.42%
按下载量换算75

Cursor

18.87%
按下载量换算50

Gemini CLI

9.37%
按下载量换算25

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills