Skill Preflight for Openclaw

A local-first plugin that automatically injects relevant skills and protocols into agent context using vector similarity.

thekhemistai
v1.0.5
Mar 27, 2026
0
731
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install skill-preflight

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install skill-preflight using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Skill Preflight?

Skill Preflight is a high-performance, local-first plugin designed for the OpenClaw ecosystem. It optimizes agent interactions by automatically scanning your local directories for documentation and injecting only the most relevant snippets into the agent's context window. By leveraging local embeddings, it ensures that your AI agents have the specific knowledge they need to execute tasks without overwhelming them with irrelevant data.

This tool is a cornerstone for developers building complex workflows within Openclaw Skills, as it eliminates the manual effort of managing context. It utilizes Ollama and the nomic-embed-text model to provide a completely free, offline-capable RAG (Retrieval-Augmented Generation) solution, ensuring your data remains private while significantly reducing token waste on non-essential information.

Skill Preflight Use Cases

  • Reducing token consumption by only providing agents with contextually relevant documentation.
  • Enforcing custom coding protocols or house rules across different AI agent sessions.
  • Managing large libraries of Openclaw Skills without manual context switching.
  • Operating AI agents in offline or air-gapped environments where external embedding APIs are restricted.
  • Improving agent accuracy by providing high-similarity technical documentation and examples.

How Skill Preflight Works

  1. The plugin scans configured protocol and skill directories to build a local document index.
  2. When an agent run is triggered, the user prompt is processed using the nomic-embed-text model via a local Ollama instance.
  3. A cosine similarity search is performed to rank indexed documents against the current prompt.
  4. Relevant documents exceeding the defined similarity threshold are selected and deduplicated.
  5. The selected content is formatted and prepended to the agent's context, ensuring the AI is primed with the right instructions.

Skill Preflight Setup

To integrate this into your workflow for Openclaw Skills, follow these steps:

  1. Install and run Ollama from ollama.com.
  2. Download the required embedding model:
ollama pull nomic-embed-text
  1. Start the Ollama server:
ollama serve
  1. Update your openclaw.json configuration to enable the plugin:
{
  "plugins": {
    "skill-preflight": {
      "enabled": true,
      "config": {
        "minScore": 0.3,
        "maxResults": 3,
        "protocolDirs": ["memory/protocols"],
        "skillsDirs": ["skills"]
      }
    }
  }
}

Skill Preflight Data Schema & Taxonomy

Skill Preflight organizes information based on file location and optional frontmatter metadata:

Data Type Source Directory File Requirements
Skills skills/ SKILL.md or loose .md files
Protocols memory/protocols/ Markdown files (1 level deep)
Pinned Docs Config-defined Always injected regardless of score

Documents are indexed using their Markdown content; if frontmatter is absent, the first heading serves as the title. Documents marked with status: deprecated are automatically excluded from the index.

Skill Preflight Advanced Features

  • Local-first privacy ensures prompts and documents never leave your machine when using a local Ollama endpoint.
  • Pinned Documents allow critical rules to be permanently injected into every agent session.
  • Configurable similarity thresholds (minScore) allow fine-tuning of how permissive the context injection is.
  • Automatic deduplication prevents redundant information from being sent to the LLM in a single session.
  • Smart caching of documents and embeddings reduces disk I/O and latency during high-frequency agent runs.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*