tradermonty/claude-trading-skills

data-quality-checker

Validate data quality in market analysis documents and blog articles before publication.

查看源码

使用方法

  1. 复制安装命令,在自己的智能体环境安装前先检查源码包。
  2. 从原始文档核对所需工具、凭据和支持的宿主。
  3. 说明输入材料与期望交付物,并对照来源检查输出。
npx skills add https://github.com/tradermonty/claude-trading-skills --skill data-quality-checker

开始前需了解

  • 安装不包含模型订阅、API 额度或访问文件的权限。
  • 仓库星数和安装量反映活跃情况,不等于独立质量或安全测试。
仓库原始内容

按源仓库内容呈现,保留标题、案例、代码、表格、链接以及原文引用的演示图片。

Overview

Detect common data quality issues in market analysis documents before publication. The checker validates five categories: price scale consistency, instrument notation, date/weekday accuracy, allocation totals, and unit usage. All findings are advisory -- they flag potential issues for human review rather than blocking publication.

When to Use

  • Before publishing a weekly strategy blog or market analysis report
  • After generating automated market summaries
  • When reviewing translated documents (English/Japanese) for data accuracy
  • When combining data from multiple sources (FRED, FMP, FINVIZ) into one report
  • As a pre-flight check for any document containing financial data

Prerequisites

  • Python 3.9+
  • No external API keys required
  • No third-party Python packages required (uses only standard library)

Workflow

Step 1: Receive Input Document

Accept the target markdown file path and optional parameters:

  • --file: Path to the markdown document to validate (required)
  • --checks: Comma-separated list of checks to run (optional; default: all)
  • --as-of: Reference date for year inference in YYYY-MM-DD format (optional)
  • --output-dir: Directory for report output (optional; default: reports/)

Step 2: Execute Validation Script

Run the data quality checker script:

bash
python3 skills/data-quality-checker/scripts/check_data_quality.py \
  --file path/to/document.md \
  --output-dir reports/

To run specific checks only:

bash
python3 skills/data-quality-checker/scripts/check_data_quality.py \
  --file path/to/document.md \
  --checks price_scale,dates,allocations

To provide a reference date for year inference (useful for documents without explicit year in dates):

bash
python3 skills/data-quality-checker/scripts/check_data_quality.py \
  --file path/to/document.md \
  --as-of 2026-02-28

Step 3: Load Reference Standards

Read the relevant reference documents to contextualize findings:

  • references/instrument_notation_standard.md -- Standard ticker notation,

digit-count hints, and naming conventions for each instrument class

  • references/common_data_errors.md -- Catalog of frequently observed errors

including FRED data delays, ETF/futures scale confusion, holiday oversights, allocation total pitfalls, and unit confusion patterns

Use these references to explain findings and suggest corrections.

Step 4: Review Findings

Examine each finding in the output:

  • ERROR -- High confidence issues (e.g., date-weekday mismatches verified

by calendar computation). Strongly recommend correction.

  • WARNING -- Likely issues that need human judgment (e.g., price scale

anomalies, notation inconsistencies, allocation sums off by more than 0.5%).

  • INFO -- Informational notes (e.g., mixed bp/% usage that may be

intentional).

Step 5: Generate Quality Report

The script produces two output files:

  1. JSON report (data_quality_YYYY-MM-DD_HHMMSS.json): Machine-readable

list of findings with severity, category, message, line number, and context.

  1. Markdown report (data_quality_YYYY-MM-DD_HHMMSS.md): Human-readable

report grouped by severity level.

Present the findings to the user with explanations referencing the knowledge base. Suggest specific corrections for each issue.

Output Format

JSON Finding Structure

json
{
  "severity": "WARNING",
  "category": "price_scale",
  "message": "GLD: $2,800 has 4 digits (expected 2-3 digits)",
  "line_number": 5,
  "context": "GLD: $2,800"
}

Markdown Report Structure

markdown
# Data Quality Report
**Source:** path/to/document.md
**Generated:** 2026-02-28 14:30:00
**Total findings:** 3

## ERROR (1)
- **[dates]** (line 12): Date-weekday mismatch: January 1, 2026 (Monday) -- actual weekday is Thursday

## WARNING (2)
- **[price_scale]** (line 5): GLD: $2,800 has 4 digits (expected 2-3 digits)
  > `GLD: $2,800`
- **[allocations]**: Allocation total: 110.0% (expected ~100%)

Resources

  • scripts/check_data_quality.py -- Main validation script
  • references/instrument_notation_standard.md -- Notation and price scale reference
  • references/common_data_errors.md -- Common error patterns and prevention

Key Principles

  1. Advisory mode: All findings are warnings for human review. The script

always exits with code 0 on successful execution, even when findings are present. Exit code 1 is reserved for script failures (file not found, parse errors).

  1. Section-aware allocation checking: Only percentages within allocation

sections (identified by headings like "配分", "Allocation", or table columns like "ウェイト", "目安比率") are checked. Random percentages in body text (probability, RSI, YoY growth) are ignored.

  1. Bilingual support: Handles both English and Japanese date formats,

weekday names, and section headings. Full-width characters (%, 〜, en-dash) are normalized before processing.

  1. Year inference: For dates without an explicit year, the checker infers

the year using (in priority order): the --as-of option, a YYYY pattern found in the document title/metadata, or the current year with a 6-month cross-year heuristic.

  1. Digit-count heuristic: Price scale validation uses digit counts (number

of digits before the decimal point) rather than absolute price ranges. This approach is resilient to price changes over time while still catching ETF/futures confusion errors.

Supported weekday checks

The checker accepts YYYY-MM-DD, YYYY/MM/DD, M/D and Japanese M月D日 dates followed by a weekday. Numeric dates accept English three-letter or full names (case-insensitive), or Japanese 火 / 火曜日 style labels. Use matching ASCII (Tue) or full-width (火) parentheses, optionally preceded by spaces or tabs. Japanese weekday labels also accept mixed-width parentheses for compatibility. Dates accept Unicode decimal digits, including full-width digits. Tight ranges such as 11/10(火)-11/12(水) and 12/9-12/10(金) check every dated endpoint. A year prefix written as 2025-11/10(水) is ambiguous, so the weekday is reported only when it is wrong for both that year and the inferred year. Invalid calendar dates and unrecognized labels are outside this weekday check and are skipped, not reported as valid dates. An explicit numeric year always wins. Yearless forms reuse --as-of year inference (including the existing six-month rollover), then document year, filename year, or current year. Supply --as-of for reproducible checks. Every computed mismatch is an advisory ERROR, including Japanese forms that previously produced WARNING. Findings still leave the CLI exit status 0.

来自同一仓库

更多 Skills

全部 Skills
tradermonty
社区

crypto-regime-analyzer

Quantifies crypto market regime health using free, keyless public data (CoinGecko + Binance funding). Generates a 0-100 composite score across 6 components (100 = risk-on) with a posture recommendation. No API key required. Use when user asks about crypto market conditions, whether it's alt season, BTC dominance, crypto risk-on vs risk-off, funding rates, or whether crypto exposure should be increased or reduced.

1小时安装量
4
GitHub Stars
5327
最近更新
11月15日
tradermonty
社区

drawdown-circuit-breaker

Evaluate account-level drawdown circuit breaker rules from trader-memory-core state and decide whether new trade risk is allowed today. Uses realized P&L, losing-streak cooldowns, and weekly/monthly drawdown limits without any external API.

1小时安装量
3
GitHub Stars
5327
最近更新
11月15日
tradermonty
社区

edge-strategy-designer

Convert abstract edge concepts into strategy draft variants and optional exportable ticket YAMLs for edge-candidate-agent export/validation.

1小时安装量
3
GitHub Stars
5327
最近更新
11月15日
tradermonty
社区

edge-strategy-reviewer

Critically review strategy drafts from edge-strategy-designer for edge plausibility, overfitting risk, sample size adequacy, and execution realism. Use when strategydrafts/.yaml exists and needs quality gate before pipeline export. Outputs PASS/REVISE/REJECT verdicts with confidence scores.

1小时安装量
3
GitHub Stars
5327
最近更新
11月15日