agent-instructions
Use when writing project instructions for a coding agent (CLAUDE.md, AGENTS.md, or equivalent). Covers what belongs in them, what does not, structure, and…
Use when assessing the internal health of a market advance or decline. Covers advance-decline lines, new highs versus new lows, percentage above moving averages, and divergence between the index and its constituents.
$ npx -y skills add nimadorostkar/Claude-Skills-collection --skill market-breadth --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/market-breadthContext preview
The summary Claude sees to decide when to auto-load this skill.
Use when assessing the internal health of a market advance or decline. Covers advance-decline lines, new highs versus new lows, percentage above moving averages, and divergence between the index and its constituents.
name: market-breadth description: Use when assessing the internal health of a market advance or decline. Covers advance-decline lines, new highs versus new lows, percentage above moving averages, and divergence between the index and its constituents. metadata: category: finance version: 1.0.0 tags: [breadth, market-internals, divergence, participation]
Determine whether a market move is broad or narrow. An index at a new high driven by five stocks while most constituents are falling is a different market from an index at a new high with broad participation — and the index price alone cannot tell you which one you are in.
1. **Compare the index with the equal-weight version** — Cap-weighted rising while equal-weighted falls means a handful of large constituents are carrying the index. This is the fastest breadth read available and requires two data series. 2. **Track the advance-decline line** — Cumulative advancers minus decliners. When it diverges from the index — the index makes a new high, the A/D line does not — participation is narrowing. 3. **Watch new highs versus new lows** — In a healthy advance, new highs expand. New highs contracting while the index rises is deterioration. 4. **Measure the percentage above the 200-day** — A broad advance has most constituents above their long-term average. An index at a high with 45% of constituents above their 200-day is being carried. 5. **Act on the divergence, not on the level** — Breadth is a warning system, not a timing tool. Narrowing breadth can persist for months. It argues for reduced size, not for a short.
**The essential breadth comparison:**
def breadth_summary(constituents: pd.DataFrame, index: pd.Series) -> BreadthReport:
ma200 = constituents.rolling(200).mean()
ma50 = constituents.rolling(50).mean()
pct_above_200 = (constituents.iloc[-1] > ma200.iloc[-1]).mean()
pct_above_50 = (constituents.iloc[-1] > ma50.iloc[-1]).mean()
# 52-week highs and lows among constituents.
new_highs = (constituents.iloc[-1] >= constituents.rolling(252).max().iloc[-1]).sum()
new_lows = (constituents.iloc[-1] <= constituents.rolling(252).min().iloc[-1]).sum()
# The core question: is the index the market, or is it a handful of names?
equal_weight = constituents.pct_change().mean(axis=1).add(1).cumprod()
cap_weight = index / index.iloc[0]
divergence_63d = (
(cap_weight.iloc[-1] / cap_weight.iloc[-63] - 1)
- (equal_weight.iloc[-1] / equal_weight.iloc[-63] - 1)
)
return BreadthReport(
pct_above_200=pct_above_200,
pct_above_50=pct_above_50,
new_highs=int(new_highs),
new_lows=int(new_lows),
cap_vs_equal_63d=divergence_63d,
state=(
"narrowing" if divergence_63d > 0.03 and pct_above_200 < 0.50 else
"broadening" if divergence_63d < -0.01 and pct_above_200 > 0.60 else
"neutral"
),
)**A breadth read that changes what you do:**
S&P 500, as of the close:
Index : at a 52-week high.
Equal-weight (RSP) : 6.1% below ITS 52-week high.
Cap vs equal, 63 days : +7.4% <- the index is being carried
% above 200-day MA : 47% <- fewer than half of constituents are in
a long-term uptrend, at an index high
% above 50-day MA : 41%
New 52-week highs : 22
New 52-week lows : 38 <- more constituents at lows than at highs,
with the index at a high
Read: the advance is narrow and deteriorating. Fewer than half of the index's
constituents are above their 200-day average while the index prints a new high.
More names are making new lows than new highs.
Implication: reduce gross exposure and tighten stops. NOT a short signal —
narrow advances have persisted for a year or more. This is a position-sizing
input, not a directional one.A curated library of 137 production-grade skills for Claude and other AI coding agents. Every skill follows one structure, speaks with one voice, and earns its place by changing what the agent does.
Repo: nimadorostkar/Claude-Skills-collection
Use when writing project instructions for a coding agent (CLAUDE.md, AGENTS.md, or equivalent). Covers what belongs in them, what does not, structure, and…
Use when an agent needs state that survives a session or a context compaction. Covers what to persist, file-based memory, structuring notes for retrieval, and…
Use when automating agent behavior with lifecycle hooks. Covers hook events, deterministic enforcement of rules the model should not be trusted to remember,…
Use when packaging skills, commands, hooks, and MCP servers into a distributable plugin. Covers manifest structure, bundling, versioning, testing, and…
Use when writing a new skill for an AI agent. Covers scoping, description writing for reliable triggering, progressive disclosure, and the difference between a…
Use when reviewing or improving an existing agent skill. Covers triggering accuracy, content quality, redundancy with the base model, and measuring whether the…