ask-matt
MAmattpocock/skills337k4,978 new stars in the last 7 days
Generate a one-page Market Posture summary with net exposure ceiling, growth-vs-value bias, participation breadth, and new-entry-allowed vs cash-priority recommendation by integrating signals from breadth, regime, and flow analysis skills.
Exposure Coach synthesizes outputs from market-breadth-analyzer, uptrend-analyzer, macro-regime-detector, market-top-detector, ftd-detector, theme-detector, sector-analyst, and institutional-flow-tracker into a unified control-plane decision. The skill answers the solo trader's core question: "How much capital should I commit to equities right now?" before any individual stock analysis begins.
FMP_API_KEY environment variable) for institutional-flow-tracker dataargparse, json, datetimeCollect the most recent JSON outputs from integrated skills. Each file provides a specific signal dimension:
| Skill | Output File Pattern | Signal Provided |
|---|---|---|
| market-breadth-analyzer | breadth_*.json | Advance/decline ratios, new highs/lows |
| uptrend-analyzer | uptrend_*.json | Uptrend participation percentage |
| macro-regime-detector | regime_*.json | Current regime (Concentration, Broadening, etc.) |
| market-top-detector | top_risk_*.json | Distribution day count, top probability score |
| ftd-detector | ftd_*.json | Follow-Through Day quality (market bottom confirmation) |
| theme-detector | theme_detector_*.json or theme_*.json | Active investment themes and rotation |
| sector-analyst | sector_rotation_*.json | Sector uptrend ratios and trend direction |
| institutional-flow-tracker | institutional_*.json | Net institutional buying/selling |
Execute the exposure scoring script with paths to upstream outputs:
python3 skills/exposure-coach/scripts/calculate_exposure.py \
--breadth reports/breadth_latest.json \
--uptrend reports/uptrend_latest.json \
--regime reports/regime_latest.json \
--top-risk reports/top_risk_latest.json \
--ftd reports/ftd_latest.json \
--theme reports/theme_latest.json \
--sector reports/sector_latest.json \
--institutional reports/institutional_latest.json \
--output-dir reports/
The script accepts partial inputs; missing files reduce confidence but do not block execution.
When an input declares evaluation_coverage, require valid schema 1.0 counts and
verdict: complete. Partial, not-evaluable or malformed coverage is excluded from
scoring, with a stderr warning; never restore its score or bias manually.
Legacy inputs without the block remain supported without a coverage guarantee.
Canonical macro-regime reports must include nested regime.confidence and
composite.data_quality with valid integer component counts. Missing or malformed
availability metadata, very_low confidence, and zero usable components are
treated as missing critical input. They do not contribute a regime score or bias,
and the normal missing-input haircut and confidence cap apply. Never override this
degradation by manually copying the report's regime label into the exposure decision.
Theme input contract: Consume canonical report_type: theme_detector reports
from themes.all once; ignore duplicate sorted groups. Require finite numeric
non-boolean heat in [0,100], bullish/bearish direction, and data_quality with
ok/warning status and string-list flags. The consumer maps to
round(50 + mean(signed_heat)/2) (bullish positive, bearish negative; nearest
integer, ties to even). This is an uncalibrated integration heuristic, not a
forecast or freshness guarantee. Legacy numeric theme_score and recognized
theme_strength labels remain supported; see references/exposure_framework.md.
Sector input contract: Pass the unchanged JSON from
analyze_sector_rotation.py --json --save to --sector. Require all 11 known
sectors exactly once in ranking, finite non-boolean ratio in [0,1], a slope
that is null or in [-1,1], and a string trend label; a null slope or a label that
disagrees with the slope gets no adjustment and a warning. Require
trends counts and sector lists to match those rows, plus valid meta freshness
metadata or unknown freshness. Reject the whole input on invalid required data;
do not repair it by inserting legacy fields.
Use the consumer-owned sector_uptrend_health_v1 mapping: apply Uptrend Analyzer's
absolute ratio bands, add +5 for Up with positive slope, -5 for Down with
negative slope and 0 otherwise, clamp each
unrounded value to [0,100], then average all 11 sectors equally and round once
(nearest integer, ties to even). This uncalibrated heuristic uses neither
groups.score nor a low-dispersion bonus. See the Sector Score section of
references/exposure_framework.md for the bands and validation contract.
Canonical sector input contributes to the composite score only; bias and
participation use other accepted inputs. Supported legacy sector_score and
dispersion/leadership inputs retain their scoring and validated context rules.
Inspect sector_integration for the mapping version, per-sector calculation,
and source_freshness. A producer's is_fresh: true is a recorded claim, not a
current freshness check. Without --as-of, freshness_verified remains false
and stale or unknown freshness produces warnings without excluding otherwise
usable sector data.
With --as-of, the sector source date (meta.freshness.date) is also
age-gated: it is compared with the evaluation date in America/New_York, and a
source date after that date or older than --max-age-days excludes sector as
unusable. In --require-provenance mode, unknown freshness and undated legacy
sector input are excluded too. An excluded sector never stops the run; it is
reported in inputs_unparseable, input_warnings, Markdown and stderr. A
passing check sets freshness_verified: true and records freshness_check.
Outside strict mode, an --as-of that is not timezone-aware or a negative
--max-age-days does not stop the run: the sector age gate is skipped with a
sector warning.
Verification pitfall: Inspect inputs_provided, inputs_missing,
inputs_unparseable and input_warnings (diagnostic fields appear only when
nonempty). Omitted theme or sector input is missing; a supplied but
invalid/unreadable input is unparsable, excluded and warned on stderr. Never fold
a rejected input into exposure manually. Upstream quality flags remain visible
in JSON/Markdown/stderr. Confidence measures input completeness, not freshness,
verified quality, independent evidence or prediction accuracy. Sector Analyst
and Uptrend Analyzer share upstream data; counting both does not establish two
independent confirmations.
Market status cap overlay: When the ftd-detector JSON carries a combined
market_state.market_status, it caps the result instead of joining the weighted
average. The composite score stays untouched and
exposure_ceiling_pct = min(composite ceiling, cap).
market_in_correction (CORRECTION, RALLY_ATTEMPT, FTD_WINDOW, RALLY_FAILED,
FTD_INVALIDATED): cap 20%; NEW_ENTRY_ALLOWED becomes REDUCE_ONLY, and
CASH_PRIORITY stays CASH_PRIORITY.confirmed_uptrend with FTD_CONFIRMED: cap by ftd_invalidation.days_since_ftd,
40% under 5 sessions, 60% for 5-14, 80% for 15 or more, 60% when the age is
unknown. The recommendation is unchanged.confirmed_uptrend with UPTREND_RESUMED: cap 80%, labelled a new-high resume,
not an FTD.uptrend_under_pressure: one band (20 points) below the confirmed cap, minimum
20%; the rationale says to be selective and lists cycle.pressure_reasons.--ftd: no overlay and no new keys.Inspect the market_status_overlay block (status, legacy_state, cap_pct,
applied, reason, days_since_ftd, per_index, pressure_reasons), also shown
in the Markdown report. The caps are uncalibrated, IBD-inspired model choices.
IBD's own guidance is cited only from secondary reports
(risk management rules,
after a follow-through day).
A maintainer test found that varying exposure by these signals barely changed
index-level returns (S&P 500, Nasdaq, RSP, SPY, QQQ) versus holding the same
average exposure. The ceiling judges whether the environment supports adding
individual-stock positions; it is not an index trading signal. See
references/exposure_framework.md.
Review the generated posture report containing:
Map the posture recommendation to portfolio actions:
| Recommendation | Action |
|---|---|
| NEW_ENTRY_ALLOWED | Proceed with stock-level analysis and new positions |
| REDUCE_ONLY | No new entries; trim existing positions on strength |
| CASH_PRIORITY | Raise cash aggressively; avoid all new commitments |
{
"schema_version": "1.0",
"generated_at": "2026-03-16T07:00:00Z",
"exposure_ceiling_pct": 70,
"bias": "GROWTH",
"participation": "BROAD",
"recommendation": "NEW_ENTRY_ALLOWED",
"confidence": "HIGH",
"component_scores": {
"breadth_score": 65,
"uptrend_score": 72,
"regime_score": 80,
"top_risk_score": 25,
"ftd_score": 10,
"theme_score": 68,
"sector_score": 70,
"institutional_score": 75
},
"inputs_provided": ["breadth", "uptrend", "regime", "top_risk", "ftd", "theme", "sector", "institutional"],
"inputs_missing": [],
"rationale": "Broad participation with low top risk supports elevated exposure."
}
The markdown report provides a one-page summary suitable for quick review:
# Market Posture Summary
**Date:** 2026-03-16 | **Confidence:** HIGH
## Exposure Ceiling: 70%
| Dimension | Score | Status |
|-----------|-------|--------|
| Breadth | 65 | Healthy |
| Uptrend Participation | 72% | Broad |
| Regime | Broadening | Favorable |
| Top Risk | 25 | Low |
## Recommendation: NEW_ENTRY_ALLOWED
**Bias:** Growth > Value
**Participation:** Broad (healthy internals)
### Rationale
Broad participation with low distribution day count supports elevated equity exposure.
New positions allowed within the 70% ceiling.
Reports are saved to reports/ with filenames exposure_posture_YYYY-MM-DD_HHMMSS.{json,md}.
scripts/calculate_exposure.py -- Main orchestrator that scores and synthesizes inputsscripts/sector_contract.py -- Sector input validation and versioned score translationreferences/exposure_framework.md -- Scoring rules and threshold definitionsreferences/regime_exposure_map.md -- Regime-to-exposure ceiling mappingsAdd --require-provenance --run-id daily-20261017-unique --as-of 2026-10-17T13:00:00Z --max-age-days 3 to validate breadth and uptrend
before scoring. Both producers must receive the same unique run ID; pass their
exact printed JSON paths. --as-of is the timezone-aware evaluation instant,
not an override of the source business date.
The gate checks schema 1.0, expected run ID, UTC retrieval no later than evaluation, nonfuture source date and configured age. Default three calendar days is a conservative policy, not an exchange holiday calendar. Failure stops before report output. Successful output records accepted lineage and verification limits. Optional top-risk/other inputs and auxiliary summary dates remain outside this gate; unknown quality flags stay false. Legacy mode retains its existing schema. Run IDs are consistency markers, not authenticity or point-in-time proof.
MAmattpocock/skills337k4,978 new stars in the last 7 days
MAmattpocock/skills337k4,978 new stars in the last 7 days
MAmattpocock/skills337k4,978 new stars in the last 7 days
OBobra/superpowers331k4,772 new stars in the last 7 days
AFaffaan-m/ECC315k4,381 new stars in the last 7 days
AFaffaan-m/ECC315k4,381 new stars in the last 7 days