Get the FREE Ultimate OpenClaw Setup Guide →

Logic Register

npx machina-cli add skill NewJerseyStyle/plugin-logic-llm/logic-register --openclaw
Files (1)
SKILL.md
2.8 KB

/logic-register

Register and manage predicates, facts, and rules in the logic knowledge registry.

Description

This skill manages the central registry that tracks all predicates, facts, and rules across the knowledge base. It ensures naming consistency, prevents duplicates, and enables code reuse across conversions.

Usage

/logic-register [command] [options]

Commands

  • add - Register new predicates or rules
  • search - Search for existing predicates
  • list - List registered items
  • update - Update predicate descriptions or metadata
  • link - Link related predicates across domains
  • export - Export registry to file

Options

  • --domain <name> - Filter by domain
  • --type <predicate|fact|rule> - Filter by type
  • --format <json|prolog|clingo> - Output format

Examples

/logic-register add --domain legal "canAccess(Person, Resource) ::: Person is authorized to access Resource"
/logic-register search "access"
/logic-register list --domain legal --type predicate
/logic-register export --format json ./registry-backup.json

Registry Structure

Each registry entry contains:

{
  "name": "canAccess",
  "arity": 2,
  "domain": "legal",
  "type": "predicate",
  "signature": "canAccess(Person, Resource)",
  "description": "Person is authorized to access Resource",
  "arguments": [
    {"name": "Person", "type": "entity", "description": "The person requesting access"},
    {"name": "Resource", "type": "entity", "description": "The resource being accessed"}
  ],
  "examples": ["canAccess(john, confidential_files)"],
  "source": "contracts/access-policy.txt",
  "created": "2024-01-15T10:30:00Z",
  "aliases": ["hasAccess", "isAuthorized"],
  "related": ["hasRole", "resourceClassification"]
}

Deduplication

The registry prevents duplicate predicates by:

  1. Checking for exact name matches
  2. Checking for semantic similarity in descriptions
  3. Suggesting existing predicates when creating new ones
  4. Maintaining aliases for the same concept

Cross-Domain Linking

Predicates can be linked across domains:

/logic-register link legal.canAccess hr.hasEmploymentStatus

This enables queries that span multiple knowledge domains.

Integration

This skill uses:

  • logic-registry MCP server for storage
  • Semantic similarity for duplicate detection
  • File system for backup/export

Best Practices

  1. Always search before adding new predicates
  2. Use descriptive names following domain conventions
  3. Include examples for complex predicates
  4. Link related predicates for better query resolution
  5. Regularly export backups of the registry

Notes

  • The registry persists across sessions in data/registry/
  • Registry entries include provenance (source document)
  • Use aliases to handle synonyms and variations
  • The registry supports versioning for predicate evolution

Source

git clone https://github.com/NewJerseyStyle/plugin-logic-llm/blob/main/skills/logic-register/SKILL.mdView on GitHub

Overview

Logic Register maintains the central registry that tracks all predicates, facts, and rules across the knowledge base. It enforces naming consistency, prevents duplicates, and enables code reuse across conversions.

How This Skill Works

Entries are stored in a logic-registry MCP-backed store and accessed via /logic-register commands (add, search, list, update, link, export). It uses semantic similarity to detect duplicates and supports cross-domain linking to connect related predicates.

When to Use It

  • Onboarding new predicates or rules in a domain and adding them with a clear domain, type, and signature
  • Preventing duplicates by checking exact name matches and semantic similarity before adding new items
  • Linking related predicates across domains to enable cross-domain queries
  • Exporting the registry to a file for backups or migrations
  • Searching the registry to discover existing predicates before reuse or modification

Quick Start

  1. Step 1: /logic-register add --domain legal "canAccess(Person, Resource) ::: Person is authorized to access Resource"
  2. Step 2: /logic-register search "access"
  3. Step 3: /logic-register export --format json ./registry-backup.json

Best Practices

  • Always search before adding new predicates to avoid duplicates
  • Use descriptive, domain-conventional names and consistent arity
  • Include concrete examples in complex predicates to illustrate usage
  • Link related predicates to improve query resolution and discoverability
  • Regularly export backups of the registry for safety and recovery

Example Use Cases

  • Add a legal predicate canAccess(Person, Resource) with a clear description and signature
  • Search for predicates containing 'access' to find related access-control rules
  • List all registered predicates in the legal domain to review coverage
  • Link legal.canAccess with hr.hasEmploymentStatus to enable cross-domain checks
  • Export the registry to registry-backup.json for offline storage

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers