← Back to Skills Marketplace
kaiyuelv

Business Rule Engine

by Lv Lancer · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
67
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install business-rule-engine
Description
轻量级业务规则引擎,支持规则定义、规则执行、规则链编排和动态规则加载。 Lightweight business rule engine supporting rule definition, execution, chain orchestration and dynamic rule loading.
README (SKILL.md)

Business Rule Engine | 业务规则引擎

灵活的业务规则管理解决方案,支持复杂的业务逻辑编排和执行。

A flexible business rule management solution supporting complex business logic orchestration and execution.

核心功能 | Core Features

  • 📋 规则定义 | Rule Definition - 声明式规则定义语法
  • 规则执行 | Rule Execution - 高性能规则执行引擎
  • 🔗 规则链 | Rule Chain - 支持规则链编排
  • 🔄 动态加载 | Dynamic Loading - 运行时动态加载规则
  • 📊 规则评估 | Rule Evaluation - 条件表达式和动作执行
  • 🧩 可扩展 | Extensible - 插件式规则扩展

快速开始 | Quick Start

Python API

from business_rule_engine import RuleEngine, Rule

# 创建规则引擎 | Create rule engine
engine = RuleEngine()

# 定义规则 | Define rule
rule = Rule(
    name="discount_rule",
    condition="order_amount > 100 and vip_level >= 2",
    action={"type": "apply_discount", "value": 0.9}
)

# 添加规则 | Add rule
engine.add_rule(rule)

# 执行规则 | Execute rule
result = engine.evaluate({
    "order_amount": 200,
    "vip_level": 3
})

测试 | Tests

python -m pytest tests/ -v
Usage Guidance
This package appears coherent and implements the claimed business rule engine. The main security consideration is that ExpressionEvaluator uses eval() on expressions assembled from rule text and substituted variables — this is expected for a rule engine but is unsafe if rule text or the evaluation context can be provided by untrusted users. Before using in production: (1) ensure rules and context come from trusted sources or sandbox/evaluate in a restricted environment; (2) run the included unit tests (pytest) to validate behavior; (3) review the remaining (truncated) portions of scripts/rule_engine.py for any file, network, or subprocess usage (none were evident in the visible parts); and (4) consider replacing eval-based evaluation with a safe expression parser (ast parsing, boolean-expression library, or dedicated expression evaluator) if you need to accept rules from untrusted users. If you want, I can scan the remaining truncated sections for any hidden I/O, network calls, or other risks.
Capability Analysis
Type: OpenClaw Skill Name: business-rule-engine Version: 1.0.0 The skill bundle implements a business rule engine that contains a critical security vulnerability in `scripts/rule_engine.py`. The `ExpressionEvaluator` class uses Python's `eval()` function to process rule conditions, which allows for arbitrary code execution if rule definitions are sourced from untrusted input. While the implementation attempts to restrict the environment by clearing `__builtins__`, this is a notoriously weak sandbox that can be bypassed. No evidence of intentional malice or data exfiltration was found, but the use of `eval()` for expression parsing without a robust AST-based evaluator is a high-risk practice.
Capability Assessment
Purpose & Capability
Name/description match the provided code, examples, and unit tests. The files implement a rule engine, DSL parsing, rule chains and JSON loading — all consistent with the declared purpose. There are no declared env vars, binaries, or unrelated dependencies.
Instruction Scope
SKILL.md only documents usage, tests, and examples for the rule engine — it does not instruct the agent to read unrelated files, access environment variables, or send data externally. However, the runtime code (ExpressionEvaluator) constructs and eval()s expressions derived from rule text/variables; that is intrinsic to the product but becomes unsafe if rules or contexts come from untrusted sources.
Install Mechanism
No install specification is provided (instruction-only metadata), and requirements.txt only lists pytest/test tooling. Nothing is downloaded or written by an installer in the metadata provided.
Credentials
The skill requests no environment variables, credentials, or config paths. The code operates on in-memory structures and JSON strings only; there are no surprising secret requests or external service credentials.
Persistence & Privilege
The skill does not request persistent or elevated platform privileges. always is false and there is no install script or behavior that modifies agent/system configuration or other skills.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install business-rule-engine
  3. After installation, invoke the skill by name or use /business-rule-engine
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial release of the business-rule-engine skill. - Provides a lightweight, flexible business rule engine. - Supports rule definition, execution, rule chain orchestration, and dynamic rule loading. - Includes extensible plugin architecture and condition/action-based rule evaluation. - Python API for defining, adding, and evaluating business rules. - Quick start guide and test instructions included.
Metadata
Slug business-rule-engine
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is Business Rule Engine?

轻量级业务规则引擎,支持规则定义、规则执行、规则链编排和动态规则加载。 Lightweight business rule engine supporting rule definition, execution, chain orchestration and dynamic rule loading. It is an AI Agent Skill for Claude Code / OpenClaw, with 67 downloads so far.

How do I install Business Rule Engine?

Run "/install business-rule-engine" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Business Rule Engine free?

Yes, Business Rule Engine is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Business Rule Engine support?

Business Rule Engine is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Business Rule Engine?

It is built and maintained by Lv Lancer (@kaiyuelv); the current version is v1.0.0.

💬 Comments