logic-query

A way to ask questions of a symbolic knowledge base, either in everyday language or formal logic. It can use systems such as Prolog, Clingo, Z3, and theorem provers to produce answers or reasoning traces.

In plain words
What is it for?
It is for yes-or-no questions, finding values or all solutions, checking whether rules can be satisfied, finding proofs, and querying loaded knowledge-base files.
Why use it?
It removes the need to translate every question into solver-specific syntax and helps inspect how an answer was reached.

Skill for Claude CodeCodex

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-query
Any agent
npx skills add NewJerseyStyle/plugin-logic-llm --skill logic-query
Clone the repo
git clone --depth 1 https://github.com/NewJerseyStyle/plugin-logic-llm

Made for: Claude Code, Codex.

Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 946 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.00946
Opus 5 $0.00000 $0.00473
Sonnet 5 $0.00000 $0.00189
Haiku 4.5 $0.00000 $0.00095

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

Security

Grade A, and why

logic-query 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 2d 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-query/SKILL.md · 137 lines

How it starts

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

/logic-query

Query symbolic knowledge bases using natural language or formal logic syntax.

Description

This skill enables querying knowledge bases that have been created through /logic-convert or manually. It translates natural language questions into formal queries and returns human-readable answers using the appropriate solver.

Supported Solvers

Solver MCP Server Query Types
Prolog prolog-mcp Yes/no, find values, find all
Clingo clingo-mcp Answer sets, optimization
Z3 z3smt-mcp Satisfiability, models, proofs
FOL folprover-mcp Theorem proving
Pyke pyke-mcp Goal proving, variable bindings

Usage

/logic-query [options] <question>

Options

  • --format <prolog|clingo|z3|fol|pyke> - Query format (auto-detected if KB loaded)
  • --kb <path> - Path to knowledge base file(s) to load
  • --session <name> - Use named session (persists loaded facts/rules)
  • --explain - Show reasoning trace/proof
  • --all - Return all solutions/answer sets/models
  • --timeout <ms> - Query timeout in milliseconds

Examples

/logic-query "Is John allowed to access the confidential files?"
/logic-query --kb ./legal/rules.pl --explain "Can contractors view salary data?"
/logic-query --format clingo --all "What are the valid schedules?"
/logic-query --format z3 "Is it possible to assign all tasks within budget?"
/logic-query --format fol --explain "Does mortality follow from the premises?"
/logic-query --format pyke --session hr "Who reports to the CEO?"

Query Types by Solver

Prolog Queries

# Yes/No
?- can_access(john, file_a).

# Find values
?- can_access(john, What).

# Find all
?- findall(X, can_access(X, confidential), People).

Clingo Queries

# Check satisfiability (answer sets exist?)
# Find all answer sets
# Optimization (minimize/maximize)

Z3 Queries

# Satisfiability check
s.check()

# Get model
s.model()

# Prove theorem
prove(theorem)

Read the full file on GitHub · 137 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. 2d ago First seen · 137 lines · 0 tokens per session scan A d17aec86ed44

Subscribe to this mod's changes

logic-query 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 946 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.

Related

Other skills, from other repositories

agent-platform-model-registry

Agent Platform Model Registry Management. Use when you need to upload, list, describe, update, or delete machine learning models (and their versions) in the Agent Platform Model Registry. Don't use for model training, model deployment to endpoints, or managing non-Agent Platform models.

google/skills · 60 tokens

bigquery-ai-ml

Leverages BigQuery's built-in machine learning and GenAI capabilities for advanced data analytics. Use when you need to write SQL queries that perform time-series forecasting, predict values, detect outliers or anomalies, find key drivers, perform semantic search or vector search, classify text, calculate similarity…

google/skills · 104 tokens

ondb

A logical analysis and reasoning tool for AI. Use when decomposing documents into structured knowledge, querying entities and relations, validating consistency, or indexing files. Trigger on "remember", "what do I know about", "link X to Y", "show dependencies", "analyze this document", entity CRUD, or cross-skill…

x-cmd/x-cmd · 71 tokens

neuron-evaluation-engineer

Create and run AI evaluations with datasets, assertions, and output drivers in Neuron AI. Use this skill whenever the user mentions evaluation, testing AI systems, creating evaluators, dataset-driven testing, assertion-based validation, or wants to measure AI system performance. Also trigger for tasks involving…

neuron-core/neuron-ai · 77 tokens

mixed-precision

Use FP16/BF16 mixed precision to accelerate training and reduce memory. Use when optimizing GPU performance.

aiming-lab/AutoResearchClaw · 25 tokens

sparse-autoencoder-training

Provides guidance for training and analyzing Sparse Autoencoders (SAEs) using SAELens to decompose neural network activations into interpretable features. Use when discovering interpretable features, analyzing superposition, or studying monosemantic representations in language models.

Orchestra-Research/AI-Research-SKILLs · 58 tokens