搜索

PythonReactSEOPDF
OpenClaw

Startclaw Optimizer

OpenClaw Optimizer Skill

idanmann100 来源安装数☆ 0 仓库 Stars

安装与使用

请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。

SkillHub CLI

skillhub install idanmann10/startclaw-optimizer

打开来源仓库,查看说明和兼容环境后,按来源提供的命令或步骤安装。

将来源链接提供给你的 Agent,让它先读取说明、核对依赖,并向你说明将执行的安装步骤。

查看来源 ↗使用指南

技能说明

OpenClaw Optimizer Skill

Overview

The OpenClaw Optimizer is a comprehensive performance and cost optimization skill designed to enhance the efficiency of Clawdbot's subagent workflows.

Core Components

1. Task Router
  • Intelligent model selection based on task complexity
  • Automatic routing between Haiku, Sonnet, and Opus models
  • Cost prediction and optimization
2. Scheduler
  • Robust task execution with retry mechanism
  • Configurable preflight and postflight hooks
  • Timeout and exponential backoff handling
3. Browser Governor
  • Browser tab serialization
  • Concurrent tab management
  • Circuit breaker for preventing runaway processes
4. Context Compaction
  • Automatic token tracking
  • Summarization at 50,000 token threshold
  • Preserves critical context
5. Real-time Dashboard
  • Monitor daily budget
  • Track task execution
  • Visualize model distribution
  • Circuit breaker status

Expected Savings

Before Optimization: $90/day After Optimization: $3-5/day Savings: 95%

Installation

npm install @startclaw/openclaw-optimizer

Usage

const { TaskRouter, OptimizerScheduler, BrowserGovernor } = require('@startclaw/openclaw-optimizer');

const router = new TaskRouter();
const scheduler = new OptimizerScheduler();
const browserGovernor = new BrowserGovernor();

// Automatic model and cost optimization
const modelSelection = router.selectModel(taskDescription);
await scheduler.execute(task, modelSelection);

Monitoring

# Real-time dashboard
python3 scripts/dashboard.py watch

License

StartClaw Internal Use License

来源信息

Source
github
Repository
openclaw/skills
Path
skills/idanmann10/startclaw-optimizer
Version
—
Commit
589085f1f61bb7e80e63a8b04ec3c62f9efcd61a
分类来源
rules
状态
active
可见性
public

这些信息来自收录时的来源分析,可能滞后;使用前请核对最新来源文件。

README

OpenClaw Optimizer: Context Compaction for Subagents

Context Compaction Feature

Key Capabilities
  • Automatic token tracking across sessions
  • Auto-summarization at 50,000 token threshold
  • Preserves critical context and task intent
  • Cost-effective summarization using Haiku model
Usage Example
const { SubagentContextCompactor } = require('./context-compaction');

// Initialize compactor
const compactor = new SubagentContextCompactor({
  tokenThreshold: 50000,
  summaryModel: 'claude-3-5-haiku'
});

// Before spawning subagent
const preparedContext = await compactor.prepareForSubagent(fullContext, sessionKey);
sessions_spawn({
  context: preparedContext,
  // other spawn parameters
});
How It Works
  1. Tracks token usage across main and subagent sessions
  2. Detects when context approaches 50,000 tokens
  3. Extracts and preserves critical information
  4. Generates a concise summary using Haiku
  5. Maintains session continuity
Performance Impact
  • Minimal overhead
  • Reduces API costs by 70-90%
  • Prevents runaway context growth

Logging and Telemetry

Compaction events are logged with:

  • Session Key
  • Original Token Count
  • Compacted Token Count
  • Detected Key Themes

Customization

  • Adjust token threshold
  • Modify critical information patterns
  • Configure preservation of recent exchanges

来源内容

SKILL.md
# OpenClaw Optimizer Skill

## Overview

The OpenClaw Optimizer is a comprehensive performance and cost optimization skill designed to enhance the efficiency of Clawdbot's subagent workflows.

## Core Components

### 1. Task Router
- Intelligent model selection based on task complexity
- Automatic routing between Haiku, Sonnet, and Opus models
- Cost prediction and optimization

### 2. Scheduler
- Robust task execution with retry mechanism
- Configurable preflight and postflight hooks
- Timeout and exponential backoff handling

### 3. Browser Governor
- Browser tab serialization
- Concurrent tab management
- Circuit breaker for preventing runaway processes

### 4. Context Compaction
- Automatic token tracking
- Summarization at 50,000 token threshold
- Preserves critical context

### 5. Real-time Dashboard
- Monitor daily budget
- Track task execution
- Visualize model distribution
- Circuit breaker status

## Expected Savings

**Before Optimization:** $90/day
**After Optimization:** $3-5/day
**Savings:** 95%

## Installation

```bash
npm install @startclaw/openclaw-optimizer
```

## Usage

```javascript
const { TaskRouter, OptimizerScheduler, BrowserGovernor } = require('@startclaw/openclaw-optimizer');

const router = new TaskRouter();
const scheduler = new OptimizerScheduler();
const browserGovernor = new BrowserGovernor();

// Automatic model and cost optimization
const modelSelection = router.selectModel(taskDescription);
await scheduler.execute(task, modelSelection);
```

## Monitoring

```bash
# Real-time dashboard
python3 scripts/dashboard.py watch
```

## License

StartClaw Internal Use License
README
# OpenClaw Optimizer: Context Compaction for Subagents

## Context Compaction Feature

### Key Capabilities
- Automatic token tracking across sessions
- Auto-summarization at 50,000 token threshold
- Preserves critical context and task intent
- Cost-effective summarization using Haiku model

### Usage Example

```javascript
const { SubagentContextCompactor } = require('./context-compaction');

// Initialize compactor
const compactor = new SubagentContextCompactor({
  tokenThreshold: 50000,
  summaryModel: 'claude-3-5-haiku'
});

// Before spawning subagent
const preparedContext = await compactor.prepareForSubagent(fullContext, sessionKey);
sessions_spawn({
  context: preparedContext,
  // other spawn parameters
});
```

### How It Works
1. Tracks token usage across main and subagent sessions
2. Detects when context approaches 50,000 tokens
3. Extracts and preserves critical information
4. Generates a concise summary using Haiku
5. Maintains session continuity

### Performance Impact
- Minimal overhead
- Reduces API costs by 70-90%
- Prevents runaway context growth

## Logging and Telemetry
Compaction events are logged with:
- Session Key
- Original Token Count
- Compacted Token Count
- Detected Key Themes

## Customization
- Adjust token threshold
- Modify critical information patterns
- Configure preservation of recent exchanges

相关技能

OpenClaw

xint

0xnyk

X Intelligence CLI — search, monitor, analyze, and engage on X/Twitter. TypeScript + Bun. AI agent skill.

OpenClaw

bambu-studio-ai

heyixuan2

Bambu Lab 3D printer control and automation. Activate when user mentions: printer status, 3D printing, slice, analyze model, generate 3D, AMS filament, print monitor, Bambu Lab, or any 3D printing task. Full pi...

OpenClaw

flightclaw

jackculpan

Track flight prices from Google Flights with this OpenClaw skill. Search routes, monitor prices, and get alerts when prices drop.

OpenClaw

openclaw-trading-assistant

openclaw-trade

openclaw trading assistant| openclaw trading skill | nof1.ai & openclaw [moltbot] collaboration | We get the best practices from alpha arena trading seasons and bring it to clawdbot All top AI agents, realtime...