Install
openclaw skills install okx-strategy-factoryAgent Team 工厂:协调 5 个 AI Agent(Strategy/Backtest/Infra/Publish/Iteration)完成 OKX OnchainOS 链上交易策略的全生命周期——开发、回测、部署、发布、迭代。支持多策略并行,每个策略独立状态管理。触发词:策略开发、agent team、回测、迭代策略、发布 skill、部署策略。
openclaw skills install okx-strategy-factory协调 5 个专家 Agent 完成交易策略全生命周期。Lead 只协调不写代码。
Strategy → Backtest → Infra(deploy) → LIVE
↑ ↑ (parallel)
│ Publish → GitHub Release
│
Iteration ← (定时/手动复盘)
这是文件夹 Skill。按需读取 roles/、references/、assets/,不要一次性加载全部。
Lead 启动 Pipeline 时必须指定策略名称 {strategy},所有路径和状态按策略隔离。
grid-trading、cl-lp-rebalancerStrategy/{strategy}/ 工作空间Strategy/{strategy}/state.json,互不干扰{strategy} 名称,读 roles/lead.md,spawn strategy + backtestroles/backtest.md,指定 {strategy}roles/infra.md,指定 {strategy}roles/publish.md,指定 {strategy}roles/iteration.md,指定 {strategy}{strategy} 后协调示例:
"启动 grid-trading 策略的回测"
"为 cl-lp-rebalancer 执行全流程 Pipeline"
"新建策略 momentum-breakout,从 Step 1 开始"
CRITICAL RULE: Steps MUST execute in order. Do NOT skip steps or proceed past a gate.
Load: roles/lead.md(第一跳流程)+ roles/strategy.md + references/api-interfaces.md + references/strategy-lessons.md
Actions:
templates/requirements.md 模板,写入 Strategy/{strategy}/requirements.mdStrategy/{strategy}/Script/v{version}/Gate (ALL must pass):
strategy.js 或 .ts 存在,无硬编码参数config.json 存在,所有可调参数已外置risk-profile.json 存在且字段完整(校验 references/risk-schema.json)README.md 存在,含收益预期和适用市场条件Load: roles/backtest.md
Input: Step 1 输出的 Strategy/{strategy}/Script/v{version}/
Actions:
Strategy/{strategy}/Backtest/v{version}/risk-profile.json 声明值Gate:
Load: roles/infra.md
Input: 通过回测的策略版本
Actions:
./deploy.sh {strategy} validate — 3 tick dry-run,验证启动 + RPC + 钱包./deploy.sh {strategy} production — 部署到 VPSVERSIONGate (Local):
Gate (Production):
Load: roles/publish.md + assets/product-skill-template/
Input: 通过回测的策略 + deploy 成功确认
Actions:
assets/product-skill-template/ 读取产品 Skill 模板{strategy}/(仓库根目录下,与策略同名)Gate:
manifest.json 存在(Single Source of Truth)install.sh 存在且可执行Load: roles/iteration.md
Input: 链上交易记录 + 行情数据
Actions:
Strategy/{strategy}/Iteration/v{version}-review-{date}.mdGate:
每个策略独立维护状态,互不影响。
DRAFT → BACKTEST → PASSED → LOCAL_VALIDATING → LOCAL_VALIDATED → DEPLOYING → LIVE → ITERATION_REVIEW
→ FAILED → DRAFT (revision)
→ CONDITIONAL → (user decides)
LOCAL_VALIDATING → LOCAL_FAILED → DRAFT (fix issues)
DEPLOYING → DEPLOY_FAILED → rollback + DRAFT or retry
ITERATION_REVIEW → APPROVED → DRAFT (new version, must re-backtest)
→ REJECTED → LIVE (keep current)
Track in Strategy/{strategy}/state.json。Log every transition: [STATE] {strategy} v{ver}: {OLD} → {NEW} | {reason}
IF Step N fails for strategy {strategy}:
1. Log failure reason to Strategy/{strategy}/state.json
2. Step 2 fail → 退回 Step 1(Strategy 修订),附失败详情
3. Step 3 fail → Infra 自动回滚到上一版本
4. Step 4 fail → 不影响线上运行,可重试 Publish
5. Step 5 fail → 保持当前版本,通知用户
6. DO NOT proceed to next step
| Pattern | Problem |
|---|---|
| Lead 自己写代码 | Lead 只协调,代码由 Strategy agent 写 |
| 跳过 Backtest 直接部署 | 包括 Iteration 新版本也必须回测 |
| 自动执行 Iteration 优化 | 必须用户确认 |
| risk-profile.json 缺失 | 直接 reject,不要"帮忙补全" |
| 同时部署两个版本 | 同一策略同一时间只有一个 DEPLOYING |
| 修改已发布版本目录 | 版本不可变,只能创建新版本 |
| 2 次迭代未改善仍继续 | 应建议暂停策略或重新设计 |
| 启动 Pipeline 未指定策略名 | Lead 必须先明确 {strategy},否则拒绝执行 |