Skill flagged — suspicious patterns detected

ClawHub Security flagged this skill as suspicious. Review the scan results before using.

DolphinDB 技能套件

v1.4.0

提供 DolphinDB 数据库基础操作、量化金融、流式计算及 Python 集成四大模块,支持建库建表、因子计算、实时处理及事件研究。

0· 147·1 current·1 all-time
bysuperStupidBear@ugpoor
MIT-0
Download zip
LicenseMIT-0 · Free to use, modify, and redistribute. No attribution required.
Security Scan
VirusTotalVirusTotal
Suspicious
View report →
OpenClawOpenClaw
Suspicious
medium confidence
Purpose & Capability
Name/description (DolphinDB toolkit) align with the included files: environment-detection scripts, shell wrappers, and Python SDK usage examples are expected for a DB SDK wrapper and subskills for Docker, basic CRUD, quant, and streaming.
Instruction Scope
SKILL.md requires sourcing wrapper scripts and running init_dolphindb_env.py before any operation. The scripts scan conda/system Python installs, check pip lists, set DOLPHINDB_PYTHON_BIN, and may automatically run `pip install dolphindb`. This is within scope for a 'make SDK available' workflow, but it also reads system/conda manifests and may change the system by installing packages without explicit per-run confirmation.
Install Mechanism
There is no registry install spec, but the bundled scripts perform network installs using `pip install dolphindb`. Using pip is normal but carries moderate risk (arbitrary code from package index). The scripts install silently and choose target Python interpreters (including system Python) which can lead to unexpected system changes.
Credentials
The skill requests no credentials and declares no privileged config paths. It does, however, enumerate local Python/conda environments and sets environment variables (DOLPHINDB_PYTHON_BIN, etc.). That filesystem/environment probing is heavier than minimal but reasonable for locating a Python SDK.
!
Persistence & Privilege
Although always:false, the package includes helper scripts that modify other skills (scripts/apply_template.py and update_subskills.sh) and offer to write exports into the shell environment. A user or an automated agent running those tools could change SKILL.md files across the skills workspace. Combined with automatic pip installs and autonomous invocation capability, this increases the blast radius.
What to consider before installing
This package appears to do what it says (find or install the DolphinDB Python SDK and provide wrappers), but it also probes your system Python/conda installs and may silently install the 'dolphindb' pip package into a chosen Python (including system Python). It also includes scripts that can edit other skills' SKILL.md files. Before installing or sourcing anything: 1) review the scripts (init_dolphindb_env.py, detect_dolphindb_env.sh, dolphin_wrapper.sh, apply_template.py) to confirm behavior; 2) run the detection scripts in a safe sandbox or a disposable user account first; 3) avoid letting it install into system Python — run it inside a controlled virtualenv/conda env or manually install/pin the package versions; 4) backup your ~/.jvs/.openclaw/workspace/skills directory if you plan to run apply_template.py or update_subskills.sh; and 5) if you do not want automatic changes, do not source wrapper scripts or run the update utilities without inspecting them. If you want a lower-risk alternative, manually install the DolphinDB SDK into a dedicated virtual environment and use the skill's code only for reference.

Like a lobster shell, security has layers — review code before you run it.

databasevk970w094r3jgg0ejexkr571czh842m2fdockervk977x2ts1s428w5cyhyzm7jq0s83gknpdolphindbvk970w094r3jgg0ejexkr571czh842m2flatestvk970w094r3jgg0ejexkr571czh842m2fquantvk970w094r3jgg0ejexkr571czh842m2fskillsvk977x2ts1s428w5cyhyzm7jq0s83gknpsuitevk977x2ts1s428w5cyhyzm7jq0s83gknp

License

MIT-0
Free to use, modify, and redistribute. No attribution required.

SKILL.md

DolphinDB 技能套件 v1.4.0

📘 DolphinDB 数据库套件的入口文件

本技能是 DolphinDB 套件的入口文件,为以下子技能提供统一入口:

  • dolphindb-basic - 基础 CRUD 操作
  • dolphindb-docker - Docker 容器化部署
  • dolphindb-quant-finance - 量化金融场景
  • dolphindb-streaming - 流式计算

同时提供基础 DolphinDB 读写能力,支持建库建表、数据增删改查等核心操作。


🚨 强制流程:每次调用 DolphinDB 技能前必须执行

所有 DolphinDB 相关操作,必须遵循以下流程:

1. 环境检测 → 2. 加载环境 → 3. 验证 SDK → 4. 执行操作

第一步:环境检测(必须)

# 方法 1: 使用包装器脚本(推荐)
cd ~/.jvs/.openclaw/workspace/skills/dolphindb-skills
source scripts/dolphin_wrapper.sh

# 方法 2: 手动检测
python3 scripts/init_dolphindb_env.py --export

第二步:验证环境

# 验证 SDK 已安装
$DOLPHINDB_PYTHON_BIN -c "import dolphindb; print(dolphindb.__version__)"

# 或
dolphin_python -c "import dolphindb; print(dolphindb.__version__)"

第三步:执行 Python 脚本

# 使用包装器
dolphin_python your_script.py

# 或直接使用检测到的 Python
$DOLPHINDB_PYTHON_BIN your_script.py

环境检测逻辑:

  1. 扫描 conda 环境列表 → 检查每个环境的 pip list,查找 dolphindb
  2. 扫描 Anaconda/Miniconda 路径 → 检查 $CONDA_BASE
  3. 扫描系统 Python 环境 → 检查 /usr/bin/python3
  4. 决策:找到已安装 → 导出 DOLPHINDB_PYTHON_BIN;未找到 → 自动安装

统一调用接口:

dolphin_python script.py    # 运行 Python 脚本
dolphin_pip install pkg     # 安装包

重要: 详见 USAGE_GUIDE.mdMIGRATION_GUIDE.md

重要:所有 DolphinDB 脚本在 Python 中的调用方式

import dolphindb as ddb

# 1. 建立连接
s = ddb.session()
s.connect(host="localhost", port=8848, userid="admin", password="123456")

# 2. 执行 DolphinDB 脚本(所有数据库操作都通过 s.run())
result = s.run('''
    // DolphinDB 脚本
    select * from loadTable("dfs://mydb.mytable")
    where date = 2024.01.01
''')

# 3. 转换为 pandas DataFrame(可选)
df = result.toDF()

# 4. 关闭连接
s.close()

📚 技能导航

快速选择指南

需求场景推荐技能说明
快速部署/安装dolphindb-dockerDocker 容器化部署
建库建表、增删改查dolphindb-basic数据库基础操作
因子计算、策略回测dolphindb-quant-finance量化投研场景
实时计算、流式处理dolphindb-streaming实时行情/风控

技能详情

dolphindb-docker - Docker 部署技能

🔗 技能标识: dolphindb-docker
📦 版本: 1.0.0
🏷️ 标签: dolphindb, docker, deployment, devops

功能概览

功能模块能力描述
Docker 检查检查 Docker 安装状态、版本、服务状态
Docker 安装macOS/Windows/Linux 自动安装 Docker CE
镜像管理搜索、拉取官方 DolphinDB 镜像
容器部署单机部署、端口映射 (8848)、数据持久化
高级配置Dockerfile 自定义、docker-compose 编排

核心示例

# 快速部署(一行命令)
docker run -d --name dolphindb -p 8848:8848 -p 8081:8081 \
    -v dolphindb-data:/data dolphindb/dolphindb:latest

# 使用 docker-compose
docker-compose up -d

# 连接测试(Python SDK)
dolphin_python -c "
import dolphindb as ddb
s=ddb.session()
s.connect('localhost',8848)
print(s.run('select now()'))
"

触发关键词

DolphinDB DockerDocker 安装容器化部署docker-compose快速部署一键安装Docker Hub镜像拉取端口 8848

📖 详细文档

查看完整技能:skills/dolphindb-docker/SKILL.md


dolphindb-basic - 基础操作技能

🔗 技能标识: dolphindb-basic
📦 版本: 1.2.0
🏷️ 标签: dolphindb, database, crud, quant

功能概览

功能模块能力描述
创建数据库分布式数据库(VALUE/RANGE/HASH/LIST/COMPO)、内存数据库
创建表分区表、维度表、内存表、流表
插入数据INSERT INTO、append!、tableInsert
查询数据SQL 查询、条件过滤、聚合查询、分区裁剪
更新数据UPDATE 语句、条件更新、批量更新
删除数据DELETE、DROP 表/数据库、删除分区

核心示例

import dolphindb as ddb

s = ddb.session()
s.connect(host="localhost", port=8848, userid="admin", password="123456")

# 创建数据库(通过 s.run 执行 DolphinDB 脚本)
s.run('''
    db = database(
        directory="dfs://valuedb", 
        partitionType=VALUE, 
        partitionScheme=2023.01.01..2023.12.31, 
        engine='TSDB'
    )
''')

# 创建表
s.run('''
    schema = table(1:0, `date`time`sym`price`volume, [DATE,TIME,SYMBOL,DOUBLE,LONG])
    pt = createPartitionedTable(
        dbHandle=db, 
        table=schema, 
        tableName=`stock_data, 
        partitionColumns=`date, 
        sortColumns=`sym`time
    )
''')

# 插入数据
s.run('INSERT INTO stock_data VALUES (2024.01.01, 09:30:00, `AAPL, 150.5, 1000000)')

# 查询数据
result = s.run('select * from stock_data where date=2024.01.01')
print(result.toDF())

s.close()

触发关键词

DolphinDB 建库创建数据库建表插入数据写入数据查询SELECT更新修改数据删除DROPCRUD分布式数据库内存表分区表

📖 详细文档

查看完整技能:skills/dolphindb-basic/SKILL.md


dolphindb-quant-finance - 量化金融技能

🔗 技能标识: dolphindb-quant-finance
📦 版本: 1.1.0
🏷️ 标签: dolphindb, quant, factor, backtest, finance

功能概览

功能模块能力描述
因子计算日频/分钟频/高频因子、Alpha101、TA-Lib 技术指标
策略回测股票/期货/期权回测、模拟撮合引擎
行情处理K 线合成、Level-2 数据、订单簿、复权计算
绩效归因Brinson、Campisi、因子归因分析
投资组合MVO 均值方差优化、SOCP 约束优化
实时计算实时因子、资金流、涨幅榜、波动率

核心示例

import dolphindb as ddb

s = ddb.session()
s.connect(host="localhost", port=8848, userid="admin", password="123456")

# 因子计算(通过 s.run 执行)
result = s.run('''
    use mytt
    // 计算 RSI 因子
    def getRSI(close, N=24){ return RSI(close, N) }
    
    // 批量计算因子
    select 
        sym,
        getRSI(close, 24) as rsi,
        mavg(close, 5) as ma5
    from loadTable("dfs://bars_db.bars_minute")
    where date = 2024.01.01
    context by sym
''')

# 回测配置
s.run('''
    config = dict(STRING, ANY)
    config["startDate"] = 2024.01.01
    config["cash"] = 10000000.0  // 1000 万初始资金
    config["commission"] = 0.0005
''')

# Brinson 绩效归因
s.run('use brinson')
brinson_result = s.run('''
    result = brinsonAttribution(portfolioRet, benchmarkRet, portWeights, benchWeights)
''')

s.close()

触发关键词

量化因子因子计算策略回测backtestK 线合成OHLCLevel-2订单簿绩效归因BrinsonCampisi投资组合MVOAlphalens

📖 详细文档

查看完整技能:skills/dolphindb-quant-finance/SKILL.md


dolphindb-streaming - 流式计算技能

🔗 技能标识: dolphindb-streaming
📦 版本: 1.1.0
🏷️ 标签: dolphindb, streaming, realtime, quant

功能概览

功能模块能力描述
流数据表创建、持久化、发布/订阅
流计算引擎响应式状态引擎、聚合引擎、订单簿引擎、OHLC 引擎
实时因子分钟频/高频因子、Level-2 指标
实时行情K 线合成、订单簿合成、涨跌停监控
实时风控持仓监控、盈亏计算、风险指标

核心示例

import dolphindb as ddb

s = ddb.session()
s.connect(host="localhost", port=8848, userid="admin", password="123456")

# 创建流数据表(通过 s.run 执行)
s.run('''
    share streamTable(10000:0, `time`sym`price`volume`bsFlag, 
        [TIMESTAMP,SYMBOL,DOUBLE,LONG,CHAR]) as tickStream
''')

# 创建 OHLC 引擎(实时 K 线合成)
s.run('''
    ohlcEngine = createOHLEngine(
        name=`minuteOHLC,
        streamTableNames=`tickStream,
        freq=60000,  // 1 分钟 K 线
        metrics=`open`high`low`close`volume
    )
''')

# 创建订单簿引擎
s.run('''
    obEngine = createOrderBookEngine(
        name=`orderBookEngine,
        streamTableNames=`tickStream,
        level=10,  // 10 档行情
        bsFlagColumn=`bsFlag
    )
''')

# 实时因子计算
result = s.run('''
    def calcRealtimeFactors(tickData){
        return select 
            sym,
            wap(price, volume) as vwap,
            price / last(price, 10) - 1 as momentum
        from tickData
        group by sym, time_bar(60000, time) as minute
    }
''')

s.close()

触发关键词

实时计算流式计算streaming实时行情tick 数据实时因子流数据表streamTable流计算引擎实时风控

📖 详细文档

查看完整技能:skills/dolphindb-streaming/SKILL.md


🔗 技能组合使用

复杂任务可能需要多个技能协同:

场景 1: 快速搭建量化投研环境

用户需求:"帮我快速搭建一个 DolphinDB 量化投研环境"

涉及技能:
1. dolphindb-docker: 快速部署 DolphinDB 容器
2. dolphindb-basic: 创建数据库和表结构
3. dolphindb-quant-finance: 因子计算和策略回测

场景 2: 实时因子计算系统

用户需求:"帮我搭建一个实时因子计算系统,能计算分钟频因子并实时回测"

涉及技能:
1. dolphindb-docker: 部署 DolphinDB 容器
2. dolphindb-streaming: 创建流数据表、流计算引擎
3. dolphindb-quant-finance: 因子计算公式、回测配置
4. dolphindb-basic: 创建存储结果的数据库表

场景 3: 量化投研平台

用户需求:"搭建量化投研平台,需要因子库、回测、绩效分析"

涉及技能:
1. dolphindb-docker: 容器化部署
2. dolphindb-quant-finance: 因子计算、策略回测、绩效归因
3. dolphindb-basic: 数据库管理、数据存储

场景 4: 实时行情监控系统

用户需求:"实时监控行情,合成 K 线和订单簿,检测异常波动"

涉及技能:
1. dolphindb-docker: 快速部署
2. dolphindb-streaming: OHLC 引擎、订单簿引擎、实时监控
3. dolphindb-basic: 存储历史数据

📖 官方参考文档

基础文档

主题文档链接
DolphinDB 官网https://www.dolphindb.cn/
文档中心https://docs.dolphindb.cn/zh/
Docker 部署https://docs.dolphindb.cn/zh/deploy/docker/docker_deployment.html
建库建表https://docs.dolphindb.cn/zh/db_distr_comp/db_oper/create_db_tb.html
插入数据https://docs.dolphindb.cn/zh/db_distr_comp/db_oper/insert_data.html
查询数据https://docs.dolphindb.cn/zh/db_distr_comp/db_oper/queries.html

量化金融文档

主题文档链接
量化金融范例https://docs.dolphindb.cn/zh/tutorials/quant_finance_examples.html
因子计算最佳实践https://docs.dolphindb.cn/zh/tutorials/best_practice_for_factor_calculation.html
股票回测案例https://docs.dolphindb.cn/zh/tutorials/stock_backtest.html
Brinson 绩效归因https://docs.dolphindb.cn/zh/tutorials/brinson.html
MVO 投资组合优化https://docs.dolphindb.cn/zh/tutorials/MVO.html

流式计算文档

主题文档链接
流数据教程https://docs.dolphindb.cn/zh/stream/str_intro.html
金融因子流式实现https://docs.dolphindb.cn/zh/tutorials/str_comp_fin_quant_2.html
实时高频因子https://docs.dolphindb.cn/zh/tutorials/hf_factor_streaming_2.html
订单簿引擎https://docs.dolphindb.cn/zh/tutorials/orderBookSnapshotEngine.html

📦 安装与使用

从 ClawHub 安装

# 安装单个技能
clawhub install dolphindb-docker
clawhub install dolphindb-basic
clawhub install dolphindb-quant-finance
clawhub install dolphindb-streaming

# 或安装整个套件(推荐)
clawhub install dolphindb-skills

技能版本

技能当前版本发布时间
dolphindb-docker1.0.02024-03-24
dolphindb-basic1.2.02024-03-24
dolphindb-quant-finance1.1.02024-03-24
dolphindb-streaming1.1.02024-03-24
dolphindb-skills1.3.42026-03-28

📝 更新日志

v1.3.4 (2026-03-28) - 路径安全修复

  • ✅ 修复:将所有绝对路径 ~/.jvs/.openclaw/workspace/skills/dolphindb-skills/scripts/ 改为相对路径 scripts/
  • ✅ 安全:避免暴露本地文件系统路径结构
  • ✅ 兼容:技能安装后可在任何环境中正常工作

v1.3.3 (2026-03-26) - 入口文件定位优化

  • ✅ 修订:明确 dolphindb-skills 为套件入口文件
  • ✅ 修订:说明为子技能(basic/docker/quant-finance/streaming)提供入口
  • ✅ 修订:说明同时提供基础 DolphinDB 读写能力

v1.3.0 (2026-03-26) - 去重优化版

  • ✅ 删除:dolphindb 独立技能(内容已整合到套件和其他组件)
  • ✅ 整合:环境检测脚本移至 dolphindb-skills/scripts/
  • ✅ 增强:明确所有 DolphinDB 脚本通过 Python s.run('<脚本>') 调用
  • ✅ 增强:每个组件开头添加统一的前置依赖说明
  • ✅ 去重:删除重复的官方文档链接,统一在套件索引中维护

v1.2.0 (2024-03-24)

  • ✅ 新增:dolphindb-docker 技能(Docker 容器化部署)
  • ✅ 增强:套件索引更新为 5 个技能
  • ✅ 增强:添加 Docker 部署相关的组合使用场景
  • ✅ 修复:将所有本地路径替换为 DolphinDB 官方文档链接

v1.1.0 (2024-03-24)

  • ✅ 修复:将所有本地路径替换为 DolphinDB 官方文档链接
  • ✅ 增强:basic 技能增加完整的建库建表两种方法说明
  • ✅ 增强:套件索引提供完整的技能导航和组合使用指南
  • ✅ 新增:技能组合使用场景示例

v1.0.0 (2024-03-24)

  • 🎉 初始发布:DolphinDB 技能套件

🤝 贡献与支持

Files

19 total
Select a file
Select a file to preview.

Comments

Loading comments…