npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@diawest82/openclaw-skill

v0.1.0

Published

OpenClaw skill for automatic prompt optimization via Fortress Token Optimizer API

Downloads

141

Readme

@fortress-optimizer/openclaw-skill

OpenClaw skill for automatic prompt optimization via the Fortress Token Optimizer API. Reduces token usage by 15-30% without changing meaning.

Zero runtime dependencies. Uses native fetch (Node 22+).

Installation

# Via ClawHub
clawhub install fortress-optimizer

# Via npm
npm install @fortress-optimizer/openclaw-skill

Quick Start

import { registerSkill } from '@fortress-optimizer/openclaw-skill';

const skill = registerSkill({
  apiKey: process.env.FORTRESS_API_KEY,
});

// Use as OpenClaw context engine
const { contextEngine, hooks } = skill;

Standalone Client

import { FortressClient } from '@fortress-optimizer/openclaw-skill';

const client = new FortressClient({
  apiKey: 'fk_your_key_here',
  baseUrl: 'https://api.fortress-optimizer.com',
  level: 'balanced',
  provider: 'openai',
  timeout: 10_000,
  gracefulDegradation: true,
  minPromptLength: 50,
});

const result = await client.optimize('Your prompt text here...');
console.log(result.tokens.savings_percentage); // e.g. 23
console.log(result.optimization.optimized_prompt);

Configuration

Set via constructor options or environment variables:

| Option | Env Variable | Default | Description | |--------|-------------|---------|-------------| | apiKey | FORTRESS_API_KEY | (required) | Your API key from fortress-optimizer.com | | baseUrl | FORTRESS_BASE_URL | https://api.fortress-optimizer.com | API endpoint | | level | FORTRESS_LEVEL | balanced | conservative, balanced, or aggressive | | provider | FORTRESS_PROVIDER | openai | LLM provider hint | | timeout | - | 10000 | Request timeout in ms | | gracefulDegradation | - | true | Return original prompt on API failure | | minPromptLength | - | 50 | Skip optimization for short prompts |

Optimization Levels

  • conservative - Light optimization, ~5% savings. Safe for all prompts.
  • balanced - Deduplication + compression, ~15% savings. Good default.
  • aggressive - Maximum optimization, ~30% savings. May rephrase.

Architecture

Your App
  |
  v
OpenClaw Skill (this package)
  |-- contextEngine  --> ingest/assemble flow
  |-- hooks          --> before-tool-call interception
  |-- client         --> HTTP calls to Fortress API
  |
  v
Fortress API (api.fortress-optimizer.com)
  |-- phrase compression
  |-- semantic deduplication
  |-- meta-removal
  |-- sentence optimization

Security

  • HTTPS enforced (rejects non-HTTPS URLs except localhost)
  • Response validation against prompt injection attacks
  • Bearer token authentication
  • No data stored client-side

API

registerSkill(config?)

Factory that returns { contextEngine, hooks } for OpenClaw integration.

FortressClient

  • optimize(prompt) - Optimize a prompt, returns OptimizeResponse
  • getUsage() - Get token usage stats, returns UsageResponse
  • healthCheck() - Check API availability, returns boolean

FortressContextEngine

Implements the OpenClaw ContextEngine interface:

  • bootstrap() - Health check (non-fatal on failure)
  • ingest(content) - Queue content for optimization
  • assemble() - Optimize and return result
  • afterTurn(stats?) - Accumulate usage statistics
  • getStats() - Get cumulative optimization stats

createBeforeToolCallHook(client, config)

Returns a hook that intercepts tool calls with prompt-like arguments and optimizes them before execution.

License

MIT