Logic Register
npx machina-cli add skill NewJerseyStyle/plugin-logic-llm/logic-register --openclaw/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 rulessearch- Search for existing predicateslist- List registered itemsupdate- Update predicate descriptions or metadatalink- Link related predicates across domainsexport- 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:
- Checking for exact name matches
- Checking for semantic similarity in descriptions
- Suggesting existing predicates when creating new ones
- 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-registryMCP server for storage- Semantic similarity for duplicate detection
- File system for backup/export
Best Practices
- Always search before adding new predicates
- Use descriptive names following domain conventions
- Include examples for complex predicates
- Link related predicates for better query resolution
- 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
- Step 1: /logic-register add --domain legal "canAccess(Person, Resource) ::: Person is authorized to access Resource"
- Step 2: /logic-register search "access"
- 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