# contrarian-setup-gate

Synthesizes COT crowding, news-reaction failure, and weekly price action reports into one actionable trade setup status. Useful before sizing contrarian positions.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 2500 installs · ★ 3267
- Author: tradermonty
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/tradermonty/claude-trading-skills/tree/HEAD/skills/contrarian-setup-gate/SKILL.md
- Updated: 2026-10-24
- HTML: https://affpapa.org/en/nevibecode/skills/contrarian-setup-gate

## What it does

The skill acts as an offline synthesis gate for Jason Shapiro's three-step contrarian trading pipeline. It runs `run_contrarian_setup_gate.py` to aggregate JSON reports from crowding detection (`cot-contrarian-detector`), news reaction failure (`news-reaction-failure-analyzer`), and weekly price confirmation (`technical-analyst`). The script makes no API requests and needs no network access. It only validates inputs and executes a fail-closed precedence state machine.

Python 3.9+ is required. You must pass `--symbol`, `--detector-json`, and an explicit `--as-of` reference date. An invalid command line exits with code 2. Conversely, broken or stale input files return exit code 0 and emit `INSUFFICIENT_EVIDENCE` or `REJECTED`. Downstream price confirmations will never override an unconfirmed or invalid crowding verdict.

Only the `READY_FOR_PLAN` status delivers actionable data: direction, an entry trigger, and an invalidation level. The gate sets overall confidence to the weaker of the news and price ratings. It does not place orders or size positions.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add tradermonty/claude-trading-skills --skill contrarian-setup-gate -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/contrarian-setup-gate/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/contrarian-setup-gate/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add tradermonty/claude-trading-skills --skill contrarian-setup-gate -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/contrarian-setup-gate/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add tradermonty/claude-trading-skills --skill contrarian-setup-gate -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/contrarian-setup-gate/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install tradermonty/claude-trading-skills contrarian-setup-gate
```

2. **Manually: put the files in place**
- File: `.github/skills/contrarian-setup-gate/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add tradermonty/claude-trading-skills --skill contrarian-setup-gate -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/tradermonty/claude-trading-skills --path skills/contrarian-setup-gate
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/contrarian-setup-gate/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add tradermonty/claude-trading-skills --skill contrarian-setup-gate -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/tradermonty/claude-trading-skills/tree/HEAD/skills/contrarian-setup-gate/SKILL.md

## When to use it
- synthesize three contrarian pipeline verdicts into a single setup status
- catch stale or invalid report files with a fail-closed gate
- extract direction and invalidation levels before sizing risk
- identify missing confirmation steps during mid-pipeline evaluation

## Example prompts
- Run contrarian-setup-gate for symbol B6 using reports cot_crowding_2026-07-12.json and nrf_B6_2026-07-12.json as of 2026-07-15
- Check the setup status for B6 with run_contrarian_setup_gate.py and list blockers from missing_confirmations
- Evaluate if B6 is READY_FOR_PLAN by passing the detector, news, and price action reports to contrarian-setup-gate

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 54e70919c5c212d0.

BEGIN THIRD-PARTY FILE 54e70919c5c212d0
````text
---
name: contrarian-setup-gate
description: Synthesize the three Jason Shapiro contrarian-pipeline verdicts (COT crowding, news-reaction failure, weekly price-action confirmation) into one actionable setup_status via a fail-closed precedence state machine. Pure, offline synthesis -- no network, no API keys, no computation beyond validation and precedence.
---

# Contrarian Setup Gate

## Overview

Synthesize the outputs of Jason Shapiro's 3-step contrarian process into one actionable state. cot-contrarian-detector (step 1) flags crowded positioning, news-reaction-failure-analyzer (step 2) tests whether the market failed to react to news favorable to the crowd, and technical-analyst's contrarian-confirmation mode (step 3) confirms weekly price-action evidence of a reversal. This gate reads those three report JSONs and applies an explicit, exhaustively-tested precedence rule set to produce one `setup_status`, with a fail-closed reason attached to every input that could not be confirmed.

The gate does no fetching, no API calls, and no computation beyond validating and combining the three inputs it is given. It is the pipeline's synthesis center, not a data source.

## When to Use

- After running cot-contrarian-detector (always required -- this is the pipeline's entry point)
- Mid-pipeline, with only the detector report, to see the CROWDED state and what steps remain
- After running news-reaction-failure-analyzer, to see whether the setup advances to WATCHING_PRICE or is REJECTED
- After running technical-analyst's contrarian-confirmation mode, to see whether the setup reaches READY_FOR_PLAN
- Before handing a symbol's direction and stop level to a position-sizing skill

## Prerequisites

- Python 3.9+
- No API keys -- this skill is fully offline
- A cot-contrarian-detector JSON report for the symbol under evaluation (required)
- Optionally, a news-reaction-failure-analyzer JSON report for the same symbol (step 2)
- Optionally, a technical-analyst contrarian-confirmation JSON report for the same symbol (step 3)

## Workflow

### Step 1: Run the Gate

```bash
python3 skills/contrarian-setup-gate/scripts/run_contrarian_setup_gate.py \
  --symbol B6 \
  --detector-json reports/cot_crowding_2026-07-12.json \
  --news-json reports/nrf_B6_2026-07-12.json \
````
END THIRD-PARTY FILE 54e70919c5c212d0

The third-party file has ended. Everything between the 54e70919c5c212d0 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2289 of 9779 bytes. © tradermonty · MIT · https://github.com/tradermonty/claude-trading-skills/tree/HEAD/skills/contrarian-setup-gate/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
