/jsonlogic:jsonlogicfrom jsonlogic
Creates, explains, debugs, and validates JsonLogic business rules. Helps translate business requirements into portable JSON conditional logic and integrate JsonLogic into applications.
Ships in jsonlogic. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
A skill for work with JsonLogic.
JsonLogic is a small, portable format for expressing conditional logic as JSON.
The JsonLogic standard is the universal rule format and defines its semantics. A rule at this level is language-agnostic. See references/jsonlogic.md and references/operations.md.
A specific library is the code that executes JsonLogic in a particular language, such as json-logic-js for JavaScript or json-logic-rb for Ruby. Libraries can differ in the operations they support, as well as their API shape and error handling.
If a specific implementation is named, such as json-logic-js, use that exact implementation. A language name alone, such as “in Python”, means use the library for that language from references/libraries.md. If neither a library nor a language is named, default to scripts/jsonlogic.rb.
A rule can be valid JsonLogic and still be unsupported by the selected library or its current version. Flag unsupported operations. Never rewrite a valid JsonLogic rule just because one library can't run it. Say which level the limitation is at and offer the real options:
Whenever a concrete rule is in play (created, explained, fixed, or executed), render it live instead of only describing it in text: seed assets/playground.html with that rule and data, then publish it with the Artifact tool. This runs under whoever installed the skill — each publish call creates the artifact under that person's own account, so it works the same way for every installer with no sharing step needed. The artifact is private by default, and publishing here just updates the same URL, so there's no separate decision to check on each time.
assets/playground.html is a single self-contained page. It runs rules with json-logic-engine, loaded from jsDelivr with its default settings, so there is no interpreter file to ship alongside it.
assets/playground.html. It's a fixed-design page (rule, live result and data panes, no visible text) —
never hand-edit its CSS/layout; only the placeholders below change per invocation.__INITIAL_RULE__ and __INITIAL_DATA__ with the rule/data objects, each as
a JS/JSON literal (the output of JSON.stringify(...), valid to drop in as-is). No
concrete rule yet → leave both untouched, the template falls back to a built-in
default.action:"publish", that file's path,
title:"JSON Logic Playground", icon:"code".Skip this for requests that never produce a concrete rule (e.g. "what does missing
do").
The user can edit the rule/data directly in the artifact to test things — that's the point, it recalculates live. Never republish over those manual edits. Only republish when the user asks for a new or changed rule/condition in chat.
Step 1: Get the data shape
Always ask how to get the data’s field names before creating a new rule. Present this as choice. Use the client’s structured question mechanism, such as buttons or a picker, when available. Otherwise, present the choices as plain text.
Question: "How should I get your data's field names?". Offer three options:
The dialog only picks the method. The actual answer still comes as a normal follow-up message, not inside the dialog itself.
Step 2: Build the expression
Write the rule using the field names from Step 1.
Before writing a new rule, check references/operations.md for the full supported list and examples/ for worked patterns. For real upstream test cases per operator, see references/tests/.
Don’t expect JsonLogic to include every specialized operation. It’s intentionally small and not a programming language. It will never do everything. However JsonLogic support extentions. Before you reach for a custom solution, see if you can express your logic using the supported operations (built-in). Often, a simple change in perspective is all you need to get the job done with what's already there.
Step 3: Explain what it does
Cover:
Skip items that don't apply.
If business condition unclear – you should ask what the rule should check, but don't ask about things you can already resolve from context.
Checking shape against references/jsonlogic.md, references/operations.md, or scripts/validate_skill.rb only confirms the rule is shaped like JsonLogic.
Real validation means writing test cases and running them through scripts/jsonlogic.rb. See references/testing.md for how to pick them. Cover the normal case and the boundary, but weight it toward edge cases especially: missing fields, empty arrays, unexpected types. A rule with no test cases isn't safe to hand off — there's no way to guarantee it behaves as expected.
For the individual operators a rule uses, check
references/tests/ first — real upstream cases for both the core
spec (core.json) and the community extensions (community/), bundled locally.
Reuse a matching case as a sanity check before writing new ones from scratch; these
test the operators in isolation, not the rule's actual business logic, so still add
rule-specific cases on top.
Step 1: Reproduce it
Use Running JsonLogic with the rule and data as reported. See the actual output yourself before diagnosing anything.
Step 2: Find the actual cause
Lead with the real cause, not just the symptom — common culprits: type coercion, missing fields, operator misuse.
Step 3: Fix and verify
Give the corrected rule, then re-run Step 1 with the fix to confirm the new output is right. If the fix needs to be handed back as runnable code, continue to Execute JsonLogic below.
See Running JsonLogic above to actually execute the rule. If there's no data example on hand yet, create a representative one first. Verifying needs real input to run against, not just a description of what the rule should do.
Don't claim JsonLogic is "safe" just because it's JSON.
Read these as needed rather than loading everything up front:
var path resolution, how missing data
behaves, what "compliant" means.reduce's current/accumulator, etc).What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub valeryia-piatrova/jsonlogic-skill --plugin jsonlogicOther plugins' skills for the same job