logic-convert

logic-convert is a skill for Claude Code, Codex from NewJerseyStyle/plugin-logic-llm. It costs 0 tokens per session (1,515 once invoked), scanned A, original, MIT.

A converter that turns natural-language documents, rules, regulations, or knowledge bases into symbolic logic programs. These programs can be checked or used for automated reasoning with systems such as Prolog, Clingo, Z3, first-order logic, or Pyke.

In plain words
What is it for?
Use it to formalize policies, legal or medical rules, constraints, arithmetic conditions, and other written knowledge for automated reasoning.
Why use it?
It removes the need to translate written rules into formal logic by hand before using reasoning tools.

Skill for Claude CodeCodex

Part of the logic-llm plugin — 4 skills, 1 command, 8 agents, 2 hooks, 6 MCP servers shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/newjerseystyle/plugin-logic-llm/logic-convert
Any agent
npx skills add NewJerseyStyle/plugin-logic-llm --skill logic-convert
Clone the repo
git clone --depth 1 https://github.com/NewJerseyStyle/plugin-logic-llm

Made for: Claude Code, Codex.

Or install logic-llm, the plugin that ships this one along with the rest of its 4 skills, 1 command, 8 agents, 2 hooks, 6 MCP servers.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for logic-convert

README.md
[![agentmods](https://agentmods.dev/badge/skills/newjerseystyle/plugin-logic-llm/logic-convert.svg)](https://agentmods.dev/skills/newjerseystyle/plugin-logic-llm/logic-convert)
Your own site
<a href="https://agentmods.dev/skills/newjerseystyle/plugin-logic-llm/logic-convert"><img src="https://agentmods.dev/badge/skills/newjerseystyle/plugin-logic-llm/logic-convert.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,515 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.01515
Opus 5 $0.00000 $0.00758
Sonnet 5 $0.00000 $0.00303
Haiku 4.5 $0.00000 $0.00152

Measured 4d ago against content hash 2bca55d33877, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

logic-convert scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/logic-convert/SKILL.md · 168 lines

How it starts

The opening of the file, as written. The whole thing — 168 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/logic-convert

Convert natural language documents into symbolic logic programs.

Description

This skill translates natural language text, rules, regulations, or knowledge bases into formal logic programs that can be used for automated reasoning. It follows the Logic-LLM methodology with enhancements for persistent storage and code reuse.

Supported Formats

Format Solver Best For
prolog prolog-mcp Deductive reasoning, Horn clauses
clingo clingo-mcp Constraints, optimization, ASP
z3 z3smt-mcp Arithmetic, SMT, satisfiability
fol folprover-mcp First-order logic with quantifiers
pyke pyke-mcp Forward/backward chaining, Python

Usage

/logic-convert [options] <source>

Options

  • --format <prolog|clingo|z3|fol|pyke> - Target format (default: auto-detect)
  • --output <path> - Output file path for generated logic program
  • --append - Append to existing knowledge base instead of creating new
  • --register - Auto-register predicates in the registry
  • --domain <name> - Domain name for organizing predicates (e.g., "legal", "medical")
  • --validate - Validate generated code with solver before saving
  • --dmn-compatible - Generate DMN-compatible Prolog (only with --format prolog)
  • --test - Generate and run test cases using MCP server

Examples

/logic-convert --format prolog ./contracts/terms.txt
/logic-convert --format clingo --domain legal ./regulations/
/logic-convert --format z3 ./scheduling-constraints.txt
/logic-convert --format fol --register ./logical-premises.md
/logic-convert --format pyke ./inference-rules.txt
/logic-convert --append --register ./new-rules.md

# DMN-compatible Prolog with validation
/logic-convert --format prolog --dmn-compatible --test ./decision-table.txt
/logic-convert --format prolog --dmn-compatible --validate --output ./dmn_rules.pl ./rules.md

Format Selection Guide

Choose format based on problem type:

Problem Type Recommended Format
Deductive reasoning (if-then chains) prolog or pyke
Constraints with optimization clingo
Arithmetic constraints z3
Full first-order logic (∀, ∃) fol
Analytical reasoning (LSAT) z3
Legal/policy with exceptions clingo or prolog
Python integration needed pyke

Read the full file on GitHub · 168 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 168 lines · 0 tokens per session scan A 2bca55d33877

Subscribe to this mod's changes

logic-convert is a skill published in the GitHub repository NewJerseyStyle/plugin-logic-llm (2 stars, last pushed 7mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,515 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.