Agent skill

Quantdb Data Structure

by qusong0627 in qusong0627/QuantMind

QuantDB 服务器数据结构与读取口径 — 数据目录组织(1klinedata~6mldatasets)、Hive 分区规律(dt=YYYYMMDD 整数)、单文件 {symbol}.parquet、parquet 后缀式代码 600519.SH 与 PG 前缀式 SH600519 的转换口径、quantdbhub.py 单一读取入口与 DuckDB…

AGPL-3.0Auto-check passedData & Analytics

Install Quantdb Data Structure

skills CLI
$ npx skills add qusong0627/QuantMind --skill quantdb-data-structure -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install qusong0627/QuantMind quantdb-data-structure --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/qusong0627/QuantMind.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/quantdb-data-structure .claude/skills/quantdb-data-structure && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
quantdb-data-structure
GitHub stars
1.7k
Token cost
~1.3k tokens
SKILL.md length
234 words
Files
1
Skills in repo
27
Repo updated
First seen
Licence
AGPL-3.0

At a glance

QuantDB 服务器数据结构与读取口径 — 数据目录组织(1klinedata~6mldatasets)、Hive 分区规律(dt=YYYYMMDD 整数)、单文件 {symbol}.parquet、parquet 后缀式代码 600519.SH 与 PG 前缀式 SH600519 的转换口径、quantdbhub.py 单一读取入口与 DuckDB…

  • Works in 4 steps: 分区型:<数据集>/dt=YYYYMMDD/data.parquet。dt 是… → 单文件型:<数据集>/{symbol}.parquet(财务报表、分钟K)或整表单… → 混合格式:6_ml_datasets/l1_factors/ 同时存在平铺… → …
  • Tasks that involve DataFrames
  • SKILL.md covers 一、路径映射(先定位数据), 二、顶层数据集目录, 三、文件组织规律(决定查询写法) and 四、代码格式口径(最高频踩坑点), plus 3 more sections
  • Calls docker; needs QUANTDB_API_KEY

What it does

Quantdb Data Structure is an agent skill from qusong0627/QuantMind. QuantDB 服务器数据结构与读取口径 — 数据目录组织(1klinedata~6mldatasets)、Hive 分区规律(dt=YYYYMMDD 整数)、单文件 {symbol}.parquet、parquet 后缀式代码 600519.SH 与 PG 前缀式 SH600519 的转换口径、quantdbhub.py 单一读取入口与 DuckDB 视图清单、服务器路径映射(/opt/quantmind/data/quantdb → 容器 /data/quantdb)。凡需要读写/探查/补数/验证 QuantDB 本地 parquet 数据、查目录结构、写 DuckDB 查询、排查查不到数据问题时使用。触发词:quantdb 结构、数据目录、dt 分区、hive 分区、parquet 路径、数据在哪里、600519.SH、代码格式、qdb 视图、quantdbhub、增量同步、数据缺失排查

Its SKILL.md is about 1.3k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Data & Analytics, covering DataFrames. It works with DuckDB. The repository describes itself as: QuantMind(量化大脑)开源版是一款面向个人开发者与投研团队的 AI 原生多市场量化交易平台。深度集成微软 Qlib、RD-Agent 因子演化与 QuantBot全能工作台,提供从 300+ 维因子挖掘、13 种机器学习与深度学习模型工场、Qlib 高性能回测、截面批量推理、7x24… The licence is AGPL-3.0.

When your agent uses it

  • Tasks that involve DataFrames

Example prompts

  • “/quantdb-data-structure”

Requirements

  • Docker
  • A credential in QUANTDB_API_KEY

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. 分区型:<数据集>/dt=YYYYMMDD/data.parquet。dt 是 Hive 分区列,整数(如 20260828),DuckDB 过滤 WHERE dt BETWEEN 20260101 AND 20260828 可走谓词下推,不要写字符串。
  2. 单文件型:<数据集>/{symbol}.parquet(财务报表、分钟K)或整表单文件(instrument_detail.parquet),用 pd.read_parquet 直读。
  3. 混合格式:6_ml_datasets/l1_factors/ 同时存在平铺 l1_factors_YYYYMMDD.parquet 与 dt=YYYYMMDD/ 分区——只读 dt=* 分区目录,避免混入平铺文件。
  4. 北向资金特殊:2_base_sector/hsgt_north/ 日频在 daily_freq/*.parquet(无分区),季度快照用 quarter=YYYYQN Hive 分区(2024-08 起季度披露)。

What it can do on your machine

Read from SKILL.md and the folder at commit 17c9e29. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • docker

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use docker, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • QUANTDB_API_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Quantdb Data Structure loads about 1.3k tokens when it runs. Until then it costs about 108 tokens; SKILL.md has 234 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~108
When it runs · the whole SKILL.md, loaded when a task matches
~1.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from qusong0627/QuantMind at commit 17c9e29, republished under its AGPL-3.0 licence (© qusong0627). 234 words, ~1,282 tokens.

Download SKILL.mdSave it as .claude/skills/quantdb-data-structure/SKILL.md (or your agent's skills folder).
name
quantdb-data-structure
description
QuantDB 服务器数据结构与读取口径 — 数据目录组织(1_kline_data~6_ml_datasets)、Hive 分区规律(dt=YYYYMMDD 整数)、单文件 {symbol}.parquet、parquet 后缀式代码 600519.SH 与 PG 前缀式 SH600519 的转换口径、quantdb_hub.py 单一读取入口与 DuckDB 视图清单、服务器路径映射(/opt/quantmind/data/quantdb → 容器 /data/quantdb)。凡需要读写/探查/补数/验证 QuantDB 本地 parquet 数据、查目录结构、写 DuckDB 查询、排查查不到数据问题时使用。触发词:quantdb 结构、数据目录、dt 分区、hive 分区、parquet 路径、数据在哪里、600519.SH、代码格式、qdb_ 视图、quantdb_hub、增量同步、数据缺失排查

⚙️ 本技能遵循公共运行环境契约(最高优先级,先于本文其余内容执行): 详见 _shared/env-contract.md,执行前先读它。

quantdb-data-structure — QuantDB 数据结构与读取口径

写任何触碰 QuantDB 本地数据的代码/查询前必读。字段单位与口径陷阱另见 skills/quantdb-fields/SKILL.md(本技能管「数据在哪、怎么组织、怎么读」)。

一、路径映射(先定位数据)

位置路径
生产服务器宿主机/opt/quantmind/data/quantdb
容器内(./data:/data bind mount)/data/quantdb
本地仓库<项目根>/data/quantdb
用户自定义数据集(产出区)/data/quantcustom(宿主机 /opt/quantmind/data/quantcustom)

⚠️ quantdb/ 是官方只读数据;quantcustom/ 是用户/挖掘产出(因子挖掘、因子工厂的落盘区,QM_QUANTCUSTOM_DATA_DIR)。两者结构同为 6 大类,但写入一律进 quantcustom,不要污染 quantdb。

数据目录解析优先级(quantdb_hub.py._resolve_data_dir): 环境变量 QM_QUANTDB_DATA_DIR → /data/quantdb → /app/data/quantdb → D:/quant_data → 项目根 data/quantdb。

二、顶层数据集目录

目录内容组织方式
1_kline_data/日K(daily_forward/backward/unadjusted 三种复权)、index_daily、min1_kline、min5_kline、tick日K/指数=分区;分钟线=单文件
2_base_sector/instrument_detail、sector_concept、trading_calendar、index_weights、margin_trading、hsgt_north混合
3_financial_data/balance/income/cashflow/股本/分红因子等财务报表单文件为主
4_bond_etf/债券 / ETF单文件
5_technical_derived/valuation(估值)、technical_indicators、market_sentiment分区
6_ml_datasets/features_daily、l1_factors、l2_factors、l1_l2_factors、alpha_library(Alpha101+GTJA191+Alpha158 三库因子)分区

辅助文件:releases/(数据包版本)、.sync_state / quantdb_sync.sqlite(增量同步状态)、.qlib_cache、_meta。

用户自定义数据集 quantcustom/6_ml_datasets/

挖掘产物统一落 data/quantcustom/6_ml_datasets/<数据集>/(结构与 quantdb 一致,按 dt=YYYYMMDD/ 分区):

数据集来源附加文件
l1_factors① RD-Agent 因子 export ② 因子工厂(backend/scripts/factor_factory.py)MANIFEST.csv(factor_name/expression/ic/icir/coverage/kept)、PROPOSALS.json
  • 读取入口:QuantDBFactorReader(mode="CUSTOM")(QM_QUANTCUSTOM_DATA_DIR,默认 /data/quantcustom)。
  • 只读展示:GET /api/v1/alpha-agent/factory-factors(读 l1_factors/MANIFEST.csv,只回显不回测)。
  • 历史补全/落库路径:backend/services/api/routers/admin/alpha_factor_pipeline.py。

三、文件组织规律(决定查询写法)

  1. 分区型:<数据集>/dt=YYYYMMDD/data.parquet。dt 是 Hive 分区列,整数(如 20260828),DuckDB 过滤 WHERE dt BETWEEN 20260101 AND 20260828 可走谓词下推,不要写字符串。
  2. 单文件型:<数据集>/{symbol}.parquet(财务报表、分钟K)或整表单文件(instrument_detail.parquet),用 pd.read_parquet 直读。
  3. 混合格式:6_ml_datasets/l1_factors/ 同时存在平铺 l1_factors_YYYYMMDD.parquet 与 dt=YYYYMMDD/ 分区——只读 dt=* 分区目录,避免混入平铺文件。
  4. 北向资金特殊:2_base_sector/hsgt_north/ 日频在 daily_freq/*.parquet(无分区),季度快照用 quarter=YYYYQN Hive 分区(2024-08 起季度披露)。

四、代码格式口径(最高频踩坑点)

存储位置格式示例
QuantDB parquet 的 symbol/wind_code后缀式600519.SH、000001.SZ
PG 表 stock_daily_latest 等内部表前缀式SH600519、SZ000001
  • 查 QuantDB parquet 前必须转换:后端用 backend/shared/stock_utils.py 的 StockCodeUtil.to_suffix(code);前端 normalizeStockCode。
  • 反面教训:把前缀式代码原样传进 parquet 查询会静默返回空、不报错,快路径还会悄悄跌入兜底数据源(复权口径随之失效)。写完新链路必须实测两种复权参数下首/末根数值真正分化,并核对响应的 source_used 字段。

五、读取入口与 DuckDB 视图清单

唯一推荐入口:backend/services/engine/data_platform/quantdb_hub.py(QuantDBDataHub)——懒加载、线程安全、自动做列名映射(time→trade_date、wind_code→symbol、volinstock/vol_in_stock→volume)。不要绕过它自己拼 parquet 路径,除非做数据巡检。

分区数据集挂载的 DuckDB 视图(hive_partitioning=1, union_by_name=true):

视图数据
qdb_daily_forward / qdb_daily_backward / qdb_daily_unadjusted前复权 / 后复权 / 不复权日K
qdb_index_daily指数日K
qdb_valuation估值
qdb_technical_indicators技术指标
qdb_market_sentiment市场情绪
qdb_features_daily每日特征
qdb_margin_trading融资融券
qdb_l2_factors / qdb_l1_l2_factorsL2 / L1+L2 因子
qdb_l1_factorsL1 因子(仅当存在 dt=* 分区时挂载)
qdb_alpha_library三库因子 429 列(训练直读)
qdb_hsgt_north_daily / qdb_hsgt_north北向资金日频 / 季度

临时探查可直接 DuckDB 查文件:

sql
SELECT * FROM read_parquet('/data/quantdb/1_kline_data/daily_forward/dt=20260828/data.parquet')
WHERE symbol = '600519.SH';

六、服务器核查命令速查

bash
# 目录与体量
ls /opt/quantmind/data/quantdb && du -sh /opt/quantmind/data/quantdb/*

# 容器内可见性
docker exec quantmind ls /data/quantdb

# 某交易日数据是否到位(以日K为例)
ls /opt/quantmind/data/quantdb/1_kline_data/daily_forward/dt=20260828/

数据更新后服务未感知时:docker compose restart quantmind celery-worker(数据走 bind mount,无需重建镜像)。增量同步需先在【个人中心】→【数据平台】绑定 QUANTDB_API_KEY 后 docker exec 触发。

七、写代码前的自查清单

  • 用的是 QM_QUANTDB_DATA_DIR/默认目录解析,而不是写死路径?
  • 分区过滤用的是整数 dt,范围合理(不跨年全表扫)?
  • 查 parquet 的代码已转后缀式?查 PG 内部表保持前缀式?
  • 查询结果为空时验证过不是「格式错配静默查空」,而是真的无数据?
  • 涉及字段单位(成交量/成交额/市值/股息率)时已对照 quantdb-fields 技能?

© qusong0627, AGPL-3.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/quantdb-data-structure of qusong0627/QuantMind.

Open the folder on GitHubat commit 17c9e29

Compare with similar skills

Quantdb Data Structure next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Quantdb Data Structure compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Quantdb Data Structure this skillqusong0627/QuantMind1.7k—~1.3kAutomated safety check: PassAGPL-3.0
Investigate Datawalkthru-earth/geocoding-playground153—~935Automated safety check: PassCC-BY-4.0
Centia Snapshot Catalogmapcentia/geocloud2152—~2.3kAutomated safety check: PassAGPL-3.0
Querying Big Datasetsflyrank-bih/flyrank-ml-internship-starter140—~750Automated safety check: PassCustom licence
Hybrid-Engine Data Analysiscode-yeongyu/oh-my-openagent70k—~1.4kAutomated safety check: PassCustom licence
Exploring Dataoaustegard/claude-skills150—~1.7kAutomated safety check: PassMIT

Similar skills

  • Investigate Data

    walkthru-earth/geocoding-playground

    Investigates geocoder data quality issues by querying live S3 parquet files via MotherDuck MCP.

    153 GitHub stars~935 tokensUpdated 3 mo ago
    Data & AnalyticsAuto-check passed
  • Centia Snapshot Catalog

    mapcentia/geocloud2

    Analyse GC2/Centia Parquet snapshots with DuckDB by walking the STAC catalog.json in the snapshot store — find datasets, decide whether a dataset has geometry (and in which CRS), read one snapshot…

    152 GitHub stars~2.3k tokensUpdated yesterday
    Data & AnalyticsAuto-check passed
  • Querying Big Datasets

    flyrank-bih/flyrank-ml-internship-starter

    Works with datasets far too big to download or load in pandas — SQL over remote Parquet with DuckDB, aggregate-then-model, iterate on samples.

    140 GitHub stars~750 tokensUpdated 1 mo ago
    Data & AnalyticsAuto-check passed
  • Hybrid-Engine Data Analysis

    code-yeongyu/oh-my-openagent

    Analyzes CSV, Parquet and JSON data with DuckDB, Polars, numpy and matplotlib, preferring a persistent kernel over repeated one-shot processes.

    70k GitHub stars~1.4k tokensUpdated today
    Data & AnalyticsAuto-check passed
  • Exploring Data

    oaustegard/claude-skills

    Exploratory data analysis. An agent skill from oaustegard/claude-skills.

    150 GitHub stars~1.7k tokensUpdated 5 days ago
    Data & AnalyticsAuto-check passed
  • Data Cleaning

    ericrisco/rsc-harness

    A skill your agent uses when a raw table is too dirty to trust — nulls, sentinels, duplicate rows, category sprawl, mixed types, bad dates — and you need a re-runnable clean() plus a schema gate…

    156 GitHub stars~3.6k tokensUpdated today
    Data & AnalyticsAuto-check passed

More from qusong0627/QuantMind

All 27 skills in this repo
  • A-Share Daily Review

    qusong0627/QuantMind

    Produces a post-market review report for the China A-share market from local QuantDB data, news sentiment and model signals, ending in a next-day direction call.

    1.7k GitHub stars~1.9k tokensUpdated yesterday
    Auto-check passed
  • Queries Futu quotes, options, fundamentals and accounts and places orders through the Futu OpenAPI Python SDK, defaulting to simulated trading.

    1.7k GitHub stars~3.3k tokensUpdated yesterday
    Auto-check: notes
  • Turns a plain-language model training request into a validated QuantMind training config file that can be imported from the Model Training page.

    1.7k GitHub stars~1.5k tokensUpdated yesterday
    Auto-check passed
  • Tiger Brokers OpenAPI SDK

    qusong0627/QuantMind

    Covers the Tiger Brokers OpenAPI Python SDK for market data, stock, futures and options trading, push subscriptions, a CLI and an MCP server, defaulting to paper trading.

    1.7k GitHub stars~1.4k tokensUpdated yesterday
    Auto-check passed
  • Tiger Brokers C++ OpenAPI SDK

    qusong0627/QuantMind

    Guides an agent through the Tiger Brokers OpenAPI C++ SDK for build setup, market data, orders and real-time push, defaulting to paper trading.

    1.7k GitHub stars~942 tokensUpdated yesterday
    Auto-check passed
  • Tiger Brokers OpenAPI C# SDK

    qusong0627/QuantMind

    Guides building C# and .NET apps on the Tiger Brokers OpenAPI SDK: setup, market data, orders, accounts, options and real-time push, defaulting to paper trading.

    1.7k GitHub stars~1k tokensUpdated yesterday
    Auto-check passed

Works with

Questions about Quantdb Data Structure

What does Quantdb Data Structure do?

QuantDB 服务器数据结构与读取口径 — 数据目录组织(1klinedata~6mldatasets)、Hive 分区规律(dt=YYYYMMDD 整数)、单文件 {symbol}.parquet、parquet 后缀式代码 600519.SH 与 PG 前缀式 SH600519 的转换口径、quantdbhub.py 单一读取入口与 DuckDB…. Quantdb Data Structure is an agent skill from qusong0627/QuantMind.

When should I use Quantdb Data Structure?

Quantdb Data Structure fits situations like: tasks that involve DataFrames.

How do I install Quantdb Data Structure in Claude Code?

Run `npx skills add qusong0627/QuantMind --skill quantdb-data-structure -a claude-code`. Or copy the skill folder (skills/quantdb-data-structure in qusong0627/QuantMind) into .claude/skills/quantdb-data-structure in your project. Claude Code loads it when a task matches its description.

How do I install Quantdb Data Structure in Codex?

Run `npx skills add qusong0627/QuantMind --skill quantdb-data-structure -a codex`. Or copy the skill folder (skills/quantdb-data-structure in qusong0627/QuantMind) into .agents/skills/quantdb-data-structure in your project. Codex loads it when a task matches its description.

Can I use Quantdb Data Structure in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add qusong0627/QuantMind --skill quantdb-data-structure -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/quantdb-data-structure, .gemini/skills/quantdb-data-structure, .github/skills/quantdb-data-structure and .opencode/skills/quantdb-data-structure in your project.

What does Quantdb Data Structure need to run?

Going by SKILL.md and its folder, Quantdb Data Structure needs the command-line tools its instructions call (docker) and credentials named QUANTDB_API_KEY. Our summary lists: Docker; A credential in QUANTDB_API_KEY.

Does Quantdb Data Structure access the network?

SKILL.md contains no URLs. Its commands use docker, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Quantdb Data Structure safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Quantdb Data Structure use?

Quantdb Data Structure is published under the AGPL-3.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Quantdb Data Structure use?

About 1.3k tokens (SKILL.md is roughly 5.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Quantdb Data Structure?

Skills that share tags, products or a category with Quantdb Data Structure: Investigate Data (walkthru-earth/geocoding-playground, 153 stars), Centia Snapshot Catalog (mapcentia/geocloud2, 152 stars), Querying Big Datasets (flyrank-bih/flyrank-ml-internship-starter, 140 stars) and Hybrid-Engine Data Analysis (code-yeongyu/oh-my-openagent, 70k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Quantdb Data Structure?

qusong0627 (a GitHub user) maintains it in qusong0627/QuantMind, which has 1,711 GitHub stars. The repository holds 27 skills in this directory. The repository was last updated on October 6, 2026.

Source: qusong0627/QuantMind on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.