rulespec for Openclaw

A specialized CLI tool for defining, managing, and compiling structured business rules into AI-ready system prompts and skills.

pallaoro
v1.0.7
Apr 12, 2026
1
749
0

Install & Download

1. ClawHub CLI

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

npx clawhub@latest install rulespec

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 rulespec 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 rulespec?

rulespec is a robust framework designed to manage business rules for AI agents without compromising existing configurations. Unlike manual prompt engineering, rulespec treats every policy, constraint, and guardrail as an independent, validated unit. It allows developers to add, edit, or remove individual rules via a CLI, ensuring that global instructions remain stable and scalable. By using this tool within the ecosystem of Openclaw Skills, you can transform plain-language business requirements into structured YAML data that compiles directly into agent-loadable markdown files.

rulespec Use Cases

  • Enforcing compliance and regulatory guardrails within AI agent workflows.
  • Managing complex refund policies, escalation rules, and approval thresholds for customer service bots.
  • Setting content moderation rules and operational constraints for automated systems.
  • Standardizing business logic across multiple LLM prompts using a single source of truth.
  • Creating LLM-ready SKILL.md files for Openclaw Skills deployment.

How rulespec Works

  1. Initialize a new business domain using the CLI to generate a base configuration file.
  2. Define data sources and schemas that the AI agent will interact with.
  3. Add individual rules with specific intent levels such as enforce, inform, or suggest.
  4. Attach golden standard examples to validate rule adherence and provide few-shot context.
  5. Run validation checks to ensure the YAML structure meets technical specifications.
  6. Compile and emit the final SKILL.md file for integration into an AI agent environment.

rulespec Setup

The tool is designed to run via npx, requiring no permanent global installation. Start by initializing your project:

npx rulespec init --domain "your-domain-name"

To add your first rule:

npx rulespec add --id unique-id --rule "Description of rule" --intent enforce

To generate the final documentation for Openclaw Skills:

npx rulespec emit

rulespec Data Schema & Taxonomy

rulespec organizes data through a structured rulespec.yaml file which defines the relationship between sources, rules, and examples.

Component Description
Domain The high-level category or business unit for the skill.
Sources Definitions of data inputs (PDF, JSON, API, DB) the rules apply to.
Rules Individual units containing an ID, plain-language text, context, and intent level.
Examples Input/Output pairs used for validation and agent training.
Intent Metadata (enforce/inform/suggest) that dictates the tone of the generated prompt.

rulespec Advanced Features

  • Intent-based compilation: Automatically translates rules into directive, neutral, or soft language based on intent levels.
  • Programmatic API: Import loadRules in TypeScript to inject compiled rules directly into LLM prompts at runtime.
  • Safe Find-and-Replace: The replace command automatically validates and recompiles the entire rule set after text updates.
  • Multi-format Input Resolution: Supports inline JSON, file paths, and complex document types for example data.
  • Decoupled Examples: Keep sensitive training data out of production SKILL.md files while maintaining them in the source config.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*