Token导航 LogoToken导航

Agent Skill · 运维

lean-engine(精益发动机)

lean-engine 用于辅助前端页面、组件、样式和交互逻辑开发,适合在 OpenClaw 中需要维护前端项目、生成组件或检查界面实现时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

lean-engine 是运维类 Agent Skill,可用宿主为 OpenClaw,通过ClawHub获取,权限为接触敏感数据;许可证为 MIT-0,第三方扫描已通过,按安装量在运维类的 954 个 Skill 里排第 451。

总安装 8,232周安装 343GitHub Stars 1下载 2,744核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT-0
版本
1.1.0

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:lean-engine(精益发动机)
来源仓库:https://github.com/cylqqqcyl/lean-engine
安装命令:
openclaw skills install lean-engine
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install lean-engine

这个 Skill 是做什么的

运维类 Skill 处理部署、监控、日志和云资源,多数需要较高的执行权限。

运行 QuantConnect LEAN 回测引擎管理股票算法开发。支持美国股票市场策略回溯测试与分析。适用于量化交易系统开发与维护任务。lean-engine 属于运维类 Skill,可作为该场景下的辅助能力补充。安装命令:openclaw skills install lean-engine。

注意金融数据访问许可与计算资源消耗问题。

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 OpenClaw;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 openclaw skills install lean-engine;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要接触敏感数据,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

lean-engine 怎么安装?

在终端执行 openclaw skills install lean-engine。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

lean-engine 支持哪些 AI 工具?

公开资料标注支持 OpenClaw。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

lean-engine 需要什么权限?

权限级别是接触敏感数据。该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

lean-engine 是免费的吗?

来源标注的许可证是 MIT-0。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

lean-engine 用的人多吗?

公开数据是累计安装 8,232 次,近一周安装 343 次,下载 2,744 次,GitHub 1 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

lean-engine 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 专注 OpenClaw 一种宿主,触发方式和使用习惯不用来回切换。
  • 许可证明确为 MIT-0,商用和分发边界好判断。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 需要接触敏感数据,装到常用环境前要先评估影响面。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 OpenClaw,想直接扩展它能力的人。
  • 需要处理运维类任务、又不想每次都手写提示词的人。
  • 需要许可证清楚、并且有第三方扫描结果的团队项目。

不太适合

  • 环境里有大量密钥、凭证,不方便给第三方 Skill 读取的人。
  • 需要厂商级技术支持和 SLA 的生产系统。

运维类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
docker-essentials

Docker 基础 · OpenClaw

1,005,15130接触敏感数据MIT-0通过
playwright-scraper-skill

Playwright scraper 技能 · OpenClaw

923,55754接触敏感数据MIT-0有提醒
moltguard

moltguard 搜索 · OpenClaw

825,096110接触敏感数据MIT-0通过
finance-news

财经新闻 · OpenClaw

275,51210需要联网MIT-0有提醒
security-monitor

安全监视器 · OpenClaw

224,1695需要联网MIT-0有提醒
lean-engine

精益发动机 · 本页

8,2321接触敏感数据MIT-0通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

name
lean
description
Run QuantConnect LEAN backtests and manage US equity algorithm development. Use when asked to backtest a trading strategy, run a LEAN algorithm, analyze backtest results, download market data, or deploy to Interactive Brokers TWS. Covers algorithm creation, data management, config editing, and result analysis.
metadata

LEAN Engine — QuantConnect Algorithmic Trading

Prerequisites & Setup

Required Environment Variables

VariablePurposeExample
LEAN_ROOTPath to cloned LEAN repository/home/user/lean
DOTNET_ROOTPath to .NET SDK installation/home/user/.dotnet
PYTHONNET_PYDLLPath to Python shared library (required by LEAN's pythonnet)$LEAN_ROOT/.libs/libpython3.11.so.1.0

All three must be set before using this skill. Add to your shell profile:

export LEAN_ROOT="$HOME/lean"
export DOTNET_ROOT="$HOME/.dotnet"
export PATH="$PATH:$DOTNET_ROOT"
export PYTHONNET_PYDLL="$LEAN_ROOT/.libs/libpython3.11.so.1.0"
Note: LEAN bundles its own Python shared library in $LEAN_ROOT/.libs/. If you built LEAN from source, the library should be there after dotnet build. If not, install libpython3.11-dev and point PYTHONNET_PYDLL to your system's libpython3.11.so.

First-Time Setup

  1. Install .NET 8 SDK:
   # Linux/macOS
   wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh
   chmod +x dotnet-install.sh
   ./dotnet-install.sh --channel 8.0
   export DOTNET_ROOT="$HOME/.dotnet"
   export PATH="$PATH:$DOTNET_ROOT"
  1. Clone and build LEAN:
   git clone https://github.com/QuantConnect/Lean.git "$LEAN_ROOT"
   cd "$LEAN_ROOT"
   dotnet build QuantConnect.Lean.sln -c Debug
  1. Download initial market data:
   pip install yfinance pandas
   python3 {baseDir}/scripts/download_us_universe.py --symbols sp500 --start 2020-01-01 --data-dir "$LEAN_ROOT/Data"
  1. Verify setup:
   ls "$LEAN_ROOT/Data/equity/usa/daily/"  # Should list .zip files
   ls "$LEAN_ROOT/Launcher/bin/Debug/"      # Should contain QuantConnect.Lean.Launcher.dll

Environment

  • LEAN source: $LEAN_ROOT/
  • Launcher (pre-built): $LEAN_ROOT/Launcher/bin/Debug/
  • Config: $LEAN_ROOT/Launcher/config.json
  • Python algos: $LEAN_ROOT/Algorithm.Python/
  • Market data: $LEAN_ROOT/Data/
  • dotnet: $DOTNET_ROOT/dotnet (add to PATH: export PATH="$PATH:$DOTNET_ROOT")

Quick Reference

Run a Backtest

  1. Place algorithm in $LEAN_ROOT/Algorithm.Python/YourAlgo.py
  2. Edit config to point to it:
   # Update config.json — set these fields:
   # "algorithm-type-name": "YourClassName"
   # "algorithm-language": "Python"
   # "algorithm-location": "../../../Algorithm.Python/YourAlgo.py"
  1. Run:
   export PATH="$PATH:$DOTNET_ROOT"
   cd "$LEAN_ROOT/Launcher/bin/Debug"
   dotnet QuantConnect.Lean.Launcher.dll
  1. Results appear in stdout + $LEAN_ROOT/Results/

Or use the helper script:

bash {baseDir}/scripts/run_backtest.sh YourClassName YourAlgo.py

Config Editing

Edit $LEAN_ROOT/Launcher/config.json with these key fields:

FieldPurposeExample
algorithm-type-namePython class name"MyStrategy"
algorithm-languageLanguage"Python"
algorithm-locationPath to .py file"../../../Algorithm.Python/MyStrategy.py"
data-folderMarket data path"../Data/"
environmentMode"backtesting" or "live-interactive"

For IB live trading, set environment to "live-interactive" and configure the ib-* fields (account, username, password, host, port, trading-mode).

Data Management

Check available data:

ls "$LEAN_ROOT/Data/equity/usa/daily/"

Data format: ZIP files containing CSV. Each line: YYYYMMDD HH:MM,Open*10000,High*10000,Low*10000,Close*10000,Volume

Prices are stored as integers (multiply by 10000). LEAN handles conversion internally.

Download more data:

python3 {baseDir}/scripts/download_us_universe.py --symbols sp500 --data-dir "$LEAN_ROOT/Data"

See {baseDir}/references/data-download.md for additional methods to expand the universe.

Writing Algorithms

LEAN Python algorithms inherit from QCAlgorithm:

from AlgorithmImports import *

class MyAlgo(QCAlgorithm):
    def Initialize(self):
        self.SetStartDate(2024, 1, 1)
        self.SetEndDate(2025, 1, 1)
        self.SetCash(100_000)
        self.AddEquity("SPY", Resolution.Daily)
        self.SetBenchmark("SPY")
        self.SetBrokerageModel(BrokerageName.InteractiveBrokersBrokerage,
                               AccountType.Margin)

    def OnData(self, data):
        if not self.Portfolio.Invested:
            self.SetHoldings("SPY", 1.0)

Key API patterns:

  • self.History(symbol, periods, resolution) — get historical bars
  • self.SetHoldings(symbol, weight) — target portfolio weight
  • self.Liquidate(symbol) — close position
  • self.AddUniverse(coarse_fn, fine_fn) — dynamic universe selection
  • self.Schedule.On(date_rule, time_rule, action) — scheduled events
  • self.Debug(msg) — log output

Analyzing Results

After a backtest run, check:

ls "$LEAN_ROOT/Results/"
# Key files: *-log.txt, *-order-log.txt, *.json (statistics)

Rebuild LEAN (if source changes)

export PATH="$PATH:$DOTNET_ROOT"
cd "$LEAN_ROOT"
dotnet build QuantConnect.Lean.sln -c Debug

Security Notes

Config.json Safety

The run_backtest.sh script does NOT modify your original config.json. Instead, it:

  1. Reads the original config as a template (read-only)
  2. Creates a separate config.backtest.json with only algorithm fields changed (class name, file path, language, environment=backtesting)
  3. Temporarily swaps it in for the LEAN run, then restores the original via a trap cleanup handler

The configure_algo.py helper performs the field substitution in an isolated output file. Your original config — including any Interactive Brokers credentials for live trading — is never modified.

Modified fields (in the temp copy only):

  • algorithm-type-name — set to the requested class name
  • algorithm-language — set to Python
  • algorithm-location — set to the requested .py file path
  • environment — set to backtesting

Network Access

The setup instructions involve network downloads:

  • git clone from GitHub (QuantConnect/Lean repository)
  • dotnet build may restore NuGet packages
  • pip install yfinance pandas installs Python packages from PyPI
  • download_us_universe.py fetches market data from Yahoo Finance

All downloads are from well-known public sources. For maximum isolation, run setup in a container or VM.

Environment Variables

This skill requires the following environment variables at runtime:

  • LEAN_ROOT — path to your cloned LEAN repository
  • DOTNET_ROOT — path to your .NET SDK installation
  • PYTHONNET_PYDLL — path to Python shared library (auto-detected from $LEAN_ROOT/.libs/ if not set)

These are declared in the skill metadata and must be set before use.

Troubleshooting

  • "No data files found" → Check data-folder in config.json points to correct path
  • Python import errors → LEAN bundles its own Python; check python-venv config if using custom packages
  • Slow backtest → Reduce universe size or date range; check Resolution (Minute >> Daily)
  • IB connection issues → Verify TWS/Gateway is running, port matches config (default 4002 for Gateway)
  • LEAN_ROOT not set → Add export LEAN_ROOT="$HOME/lean" to your shell profile
  • dotnet not found → Add export PATH="$PATH:$DOTNET_ROOT" to your shell profile
  • Runtime.PythonDLL was not set → Set PYTHONNET_PYDLL to the Python shared library path (see env var table above)

平台分布

OpenClaw

77.1%
按下载量换算2,116

安全审计

VirusTotal

通过

ClawScan

通过

Static analysis

通过

权限和风险

接触敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills