This skill helps you write, verify and test business rules in the feelc language
(DMN paradigm: a graph of linked decisions, each one a decision table or an expression,
all in FEEL). feelc compiles the source into a deterministic engine: at runtime, no LLM,
reproducible and auditable decisions. Your role = writing the DSL; the feelc binary is
the deterministic oracle (compilation + verification + evaluation). NEVER decide a rule
outcome "in your head": always run feelc.
When to use it
- The user wants to encode a business policy (eligibility, scoring, pricing, scale, discounts, rights/benefits…) as executable rules.
- They want a verified decision table (no gap, no conflict) that is replayable.
- They mention DMN, FEEL, "rule engine", or
feelc.
Prerequisite: the feelc binary
All commands go through the portable wrapper scripts/feelc-skill.mjs, which locates
feelc (the FEELC_BIN variable, PATH, a sibling checkout, or a build via go build). Check first:
node scripts/feelc-skill.mjs version
If this fails, the wrapper prints how to provide feelc (see references/install.md).
You can also call feelc directly if it is on the PATH.
The flow (red → green, driven by the oracle)
Create one todo per step and follow them in order.
- Interview (do not guess). Establish: the inputs (Input Data) and their domains
(
in [a..b],>= 0,in {…}), the decisions and their dependencies, the hit policy of each table, the edge cases. Seereferences/authoring.md. - Write the
.rulesfile. Stay STRICTLY within the supported subset (references/feel.md) — any out-of-scope construct makes the compilation fail, this is intentional. Use the 4 templates inreferences/examples.mdas starting points. - Compile + verify (deterministic gate):
node scripts/feelc-skill.mjs verify --rules model.rules --json- Compilation errors (type, reference, syntax) → with
--json, they come out as a structured object{file,line,col,code,message,suggestion}on stdout: useline/colto locate andsuggestionto fix, then re-run. Stable code catalog:references/error-schema.md. - Verification blockers (
severity: "error": completeness gap with counter-example, UNIQUE/ANY conflict) → fix. Readreferences/verify.md.
- Compilation errors (type, reference, syntax) → with
- Test on concrete cases (including the edge cases from the interview):
Compare with the expected result. Iterate until they match.node scripts/feelc-skill.mjs run --rules model.rules --decision <name> --input '{…}' --json - (Optional) Semantic Layer-2 gate — verify that the rules really say what the requirement
wanted. Break down the spec/requirement into atomic claims
{decision, input, expect}(YOUR AI work), write them in aclaims.json({"claims":[…]}), then let the VM decide:node scripts/feelc-skill.mjs check --rules model.rules --claims claims.json --jsonsupported= the rule confirms the claim;contradicted/error= blocking (the rule does not do what the requirement said, or your claim is false → fix one or the other). "The LLM proposes, the VM disposes": never invent a threshold to make a claim pass. - Iterate until the stopping criterion.
Stopping criterion: "zero blocker, not zero finding"
- Buildable =
verifyreturns no blocker (severity: "error"). Thewarning(shadowed rule…) andinfo(useless default…) findings should be reported, not necessarily fixed. - Convergent =
runreproduces the reference/edge cases validated with the user.
Never invent a threshold or a value to "make it pass": if an ambiguity in the requirement is irreducible, raise the question with the user.
What NOT to do
- ❌ Do not compute a rule result yourself — run
feelc run. - ❌ Do not use constructs outside the subset (multi-arg FEEL functions,
for/some/every, lists/higher-order functions, regex, time-of-day/date-times/timezones, lambdas): it does not compile. (if c then a else b,date/duration, single-argfloor/ceiling/round, units, brackets, applicability and BKM ARE supported — seereferences/feel.md.) - ❌ Do not leave a single-hit table (FIRST/UNIQUE/ANY/PRIORITY) incomplete without an assumed
default:verifywill report a gap with a counter-example. - ❌ Do not dress up a
warning/infoas a success, and do not delete a rule just to silence a diagnostic without understanding why.
References (progressive disclosure)
references/authoring.md— the interview and the structure of a model.references/feel.md— the supported DSL/FEEL subset (and what is not).references/verify.md— readingfeelc verify, blockers vs. remarks.references/examples.md— the 4 reference models as templates.references/forbidden-patterns.md— classic pitfalls (overlap, missing default…).references/install.md— providing thefeelcbinary.references/error-schema.md— structured compilation errors and stable codes.