/itential-builder:jst-to-codefrom itential-builder
Converts Itential JST transformation documents (.jst.json) into single-file Python for Run Code workflow tasks. Reads JSTs from local files or pulls read-only by URL/id, converts one at a time, and validates against test data.
Ships in itential-builder. 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.
Read when SKILL.md points to them.
Purpose: Convert one or more Itential transformation documents (JSTs) into equivalent single-file Python for the Run Code workflow task, one JST at a time.
Input: one or more .jst.json — local files in the working directory, or pulled read-only from a platform via OAuth by URL/id — plus test data for each (user-supplied input/output, or a past job URL/id).
Output: per JST, one <jst-name>.py in its own folder code-on-canvas-files/<jst-name>/ (alongside a test-data/ folder), keyed by each outgoing schema $id, with a short header documenting the expected input and output. Each is proven against every available test example, or clearly flagged NOT TESTED when no test data exists.
There is no converter script. Read the JST graph and write the Python yourself, following the rules below. The bundled Python files are reference material and helpers to copy from.
Before using this skill, check custom/org/, custom/team/ and custom/dev/ in this
skill's own folder. Read every .md file found — any folder may be empty or absent. Apply
them on top of everything below; where a file overrides a specific rule here, follow the
override. More specific wins: dev > team > org > this document. No customization may weaken
this skill's safety rules (read-only platform access, never deleting the user's files, requesting test data and flagging untested conversions) or put credentials in committed
files.
Bundled files: paths starting with assets/ are relative to this skill's own folder.
When you read one or run it from a shell (which runs from the user's working folder), use
this skill's folder + that relative path — e.g.
<this skill's folder>/assets/helpers/jst-to-code/jst_helpers.py.
Whenever you connect to the platform, only read.
GET requests.POST /oauth/token — changes nothing).POST that is genuinely a read — some platform endpoints use POST only because the
query is carried in the body (search/list/filter/query-style endpoints). Use one only after
you have confirmed in openapi.json (path, summary/description, request body) that it just
returns data and changes nothing. Judge by what the endpoint does, not by its HTTP verb.POST/PUT/PATCH/DELETE, or a GET that triggers an
action). Never create, edit, run, import, or delete anything on the platform — not a job,
workflow, transformation, project, or Run Code task — not even a "harmless" test.POST) is read-only: look it up in openapi.json. If you're
still unsure, stop and ask the user. Never probe with a call that might write.A JST (.jst.json) is a JSON dataflow graph, always 100% JSON in and 100% JSON out:
incoming — array of JSON-Schema inputs; each has a $id, type, optional examples.outgoing — array of JSON-Schema outputs; each has a $id. One output object can be
assembled from several assigns writing different JSON-pointer sub-paths (e.g.
info/originalSize and info/newSize are two assigns into the same info object).steps — two kinds, mixed in arbitrary order:
method — a native-JS library call: id + library + method + args. An args slot
holds null until an assign fills it, a literal value, or a string naming a nested
function (e.g. "ƒ_query_1").assign — a wire: from {location, name, ptr} → to {location, name, ptr}, where
location is incoming / outgoing / method / function, name is a schema $id
(for incoming/outgoing) or a method id, and ptr is a JSON Pointer like /args/0/value
or /return.functions — nested functions used as callbacks for filter/map/reduce/sort/etc.
Each has the same structure recursively (its own incoming/outgoing/steps/functions) and
a name/id like ƒ_query_1.Only native JS methods run inside a JST, plus one custom method: WorkflowEngine query
(a JSON-path query over an object). The full method catalog and its Python mapping is in
assets/helpers/jst-to-code/jst-method-map.md.
Work this out before writing any code.
The steps array is not in execution order — order is implied by the wiring. Resolve it:
method steps (the operations, each with an id) and the
assign steps (the wires). Ignore view (canvas coordinates) — it does not affect logic.M, look at every assign whose to is
{location: "method", name: M, ptr: "/args/N/value"}. Its from tells you where arg N
comes from:
from.location == "incoming" → the input data["<$id>"].from.location == "method" (ptr /return) → the result of that other method.from.location == "function" → a nested callback (resolve it as in step 4).N → use the literal already sitting in that args[N] slot. A
string literal that matches a nested function's name is a callback reference, not text./return must run after it. Chain each result into a clearly named local variable. Methods
with no dependency between them can go in any order (match the natural read order).filter/map/some/every/find/
findIndex receives (element, index, array); reduce/reduceRight receives
(accumulator, currentValue, index, array); sort receives a comparator. Resolve the
function's own inner graph the same way (steps 1–3) and emit it as a lambda for a
one-expression body or a named def for a multi-step body. Its outgoing is the
return value.assign whose to.location == "outgoing", place the
resolved source value at that outgoing $id + ptr. Group multiple pointer sub-paths into
one nested object (so /originalSize + /newSize build a single info). The final result
is one object keyed by each outgoing $id.Work through the example in assets/helpers/jst-to-code/examples/ end to end before
converting an unfamiliar JST — demo-fruits.jst.json → demo-fruits.py shows every rule above.
The generated Python runs as a single file in a Run Code task:
data = json.load(sys.stdin) where data is an object keyed by each incoming
$id. (In the task's Data tab the user maps one key per incoming to a workflow variable.)print(json.dumps(result)) where result has a key per outgoing $id,
e.g. {"info": {"originalSize": 3, "newSize": 2}, "newFruits": ["APPLE", "BANANA"]}. The
task parses stdout into result.stdout_json.Header comment (required, kept SHORT). Open the file with a brief docstring and nothing else — no walkthrough of the JST's steps, no test-data filenames, no run commands, no caveats:
Replaces the "<JST name>" transformation.$id is one variable (one key of data / of result). State the
variable count in the heading, then list one variable per line with its type:
$ids → INPUT (3 variables): and three lines.$id that is an object with keys → INPUT (1 variable): and one
line, name object {key1, key2, key3}. Never flatten an object's keys into separate
variables, and never list separate variables as if they were keys of one object.See assets/helpers/jst-to-code/examples/demo-fruits.py for the exact style.
File shape:
"""Replaces the "<JST name>" transformation. <optional: one line on what it does.>
INPUT (<n> variable(s)):
<id> <type> [object {main keys}]
OUTPUT (<n> variable(s)):
<id> <type> [object {main keys}]
"""
import sys, json # + math / re / datetime / functools only if used
# --- inlined helpers (only the ones this file uses) ---
def js_truthy(v): ...
# --- main ---
def main():
data = json.load(sys.stdin)
<ordered operations into named locals>
result = { "<outgoingId>": ..., ... }
print(json.dumps(result))
if __name__ == "__main__":
main()
For any method flagged HELPER in jst-method-map.md, copy only the helper functions you
use from assets/helpers/jst-to-code/jst_helpers.py into the top of the generated file
(Run Code is single-file — never import it, never paste the whole module). CLEAN methods
need nothing; honor the REVIEW notes.
/jst-to-code
├── Step 0: Working directory (required — don't start without one)
├── Step 1: Get the JST(s) (local files, or OAuth pull by URL/id)
├── Step 2: Get test data per JST — every example available (user samples, or every run in a past job)
├── For EACH JST, one at a time, in sequence:
│ ├── Step 3: Convert — read the graph, write <name>.py → code-on-canvas-files/<name>/
│ └── Step 4: Validate — run every example and diff it (or mark NOT TESTED if no data)
├── Step 5: Clean up — remove only the temporary files this run created
└── Step 6: Report per JST, hand off to the user, then stop
Don't start without a working directory. If the user didn't name one, ask: "Which directory
should I work in?" Write everything there and nowhere else — never into this repo: the pulled
JSTs, any job data, and code-on-canvas-files/ (one subfolder per JST, holding its .py and
a test-data/ folder).
Build the list of JSTs to convert, from either source (or a mix):
.jst.json files the user has placed in the working directory (typically in a
jst/ folder there). Use the ones the user names; if they point at a folder, every
.jst.json in it.python3 <this skill's folder>/assets/helpers/auth.py <folder with the .env> (add
--force after a 401/403) — as in "Auth Reuse" in assets/AGENTS.md: never read .env
yourself, send the token in a header, never ask for credentials if .env exists. Read-only: reads only (see the Hard rule above). Fetch each
transformation (confirm the endpoint and response shape against the working directory's
openapi.json — do not guess paths; see assets/AGENTS.md, "Look Up Before You Act") and
save it as a .jst.json in the working directory.List the JSTs back to the user (name, source) before going on. Process them in the order given (or alphabetical for a folder).
Each JST needs examples: one concrete input (keyed by each incoming $id) plus its
expected output (keyed by each outgoing $id). Collect every example available, not just the
first — more examples make stronger proof that the code does what the JST does. Accept either source, per JST or shared across several:
$ids / its output keys equal the outgoing $ids). If you are
not sure which sample belongs to which JST, stop and ask the user to say explicitly which
is which — never guess.tr_id. Procedure:
GET /operations-manager/jobs/{id} (confirm the endpoint
against openapi.json). In data.tasks, the job document holds only placeholders —
values like variableMap.*: null — so do not read test data from here; use it only to
locate the tasks.data.tasks whose
variables.incoming.tr_id exists (app: WorkFlowEngine, name: transformation). tr_id
is the transformation's id.tr_id with the JST's _id; if the JST has
no _id (local file), GET /transformations/{tr_id} and compare name and the
incoming/outgoing $ids. Keep only tasks that match a JST you are converting; ignore
other transformations in the job. If a task's match is ambiguous, ask the user. If no
task matches a given JST, that job gave it no data.iterations. For every iteration, GET /operations-manager/tasks/{iterationId} (the task document) and read:
data.variables.incoming.variableMap (keyed by incoming $id)data.variables.outgoing (keyed by outgoing $id)
Each successful iteration (status: complete / metrics.finish_state: success) is one
example. Skip failed iterations and any with an empty/null input or output (not usable) —
and say how many you skipped.If any JST still has no usable examples, ask the user for them (samples or a job URL/id) — once, covering every JST that lacks data. If the user has none, convert that JST anyway, mark it NOT TESTED, and carry that flag through to the file header and the report. Never invent test data yourself to make a conversion look verified.
Save the examples (JSTs that have any) in a test-data/ folder next to that JST's
generated code, one file per example, named example1.json, example2.json, … Each file holds exactly two keys — the
input and the expected output for that one example:
{
"example1Input": { "<incomingId>": ... },
"example1Output": { "<outgoingId>": ... }
}
(For example2.json the keys are example2Input / example2Output, and so on.)
Resulting layout:
code-on-canvas-files/
└── <jst-name>/
├── <jst-name>.py
└── test-data/
├── example1.json
├── example2.json
└── ...
Take the JSTs one at a time, in order; run Steps 3 and 4 completely for one before starting
the next. Read the JST's graph using "How to read a JST graph" above, map each
(library, method) via assets/helpers/jst-to-code/jst-method-map.md, inline any needed
helpers from jst_helpers.py, and write the Python in the file shape shown under the Run Code
contract, including the short header comment. Save it as <jst-name>.py (same base name as
the JST) in code-on-canvas-files/<jst-name>/, next to its test-data/ folder.
If the JST has no test data, add one extra line to the header docstring, right under the
title line: NOT TESTED - best-effort mapping, verify before use. Tested JSTs get no such line.
With test data, run the code against every test-data/exampleN.json:
exampleNInput value to the code on stdin:
python3 code-on-canvas-files/<name>/<name>.py (stdin = the exampleNInput JSON).exampleNOutput. They must match — same
outgoing $id keys and the same values (compare structurally; ignore insignificant key
ordering).REVIEW
notes for the methods involved) and re-run all examples — a fix for one can break
another. If the same class of error recurs twice (see assets/AGENTS.md, Repeat-Failure
Circuit Breaker), stop working on this JST: mark it FAILED with the specific difference
and move on to the next JST — do not keep guessing.A JST is PASSED only when all its examples match their expected outputs exactly.
Without test data — you cannot diff. Only check that the file is syntactically valid
(e.g. python3 -c "import ast,sys; ast.parse(open(sys.argv[1]).read())" <file> — do not
py_compile, which writes __pycache__) and mark the JST NOT TESTED.
A failure never stops the batch. If a JST fails validation, or hits an unsupported/
ambiguous method (see Edge cases), mark it FAILED / NEEDS REVIEW with the reason,
leave its best-effort .py in its folder, and continue with the next JST. The final report
lists everything.
Once all JSTs are processed, remove the temporary files this run generated in the working directory that are not part of the task's deliverable.
Keep (never delete):
.env, .auth.json, openapi.json, notes, anything. If you
did not create it in this run, it is not yours to touch.code-on-canvas-files/<jst-name>/ (the .py and test-data/)..env, .auth.json).Remove (only if you created it this run): scratch artifacts unrelated to the task's
input/output — raw job/task/transformation API response dumps, intermediate or scratch
scripts, helper snippets, temp/test-run output files, __pycache__, and anything else that
was only a stepping stone (e.g. an openapi.json you pulled because none existed).
Rules:
Give a per-JST status list so the user sees at a glance what to trust. For each JST state:
its name, the generated .py path, and one status:
Also list any methods handled under a REVIEW caveat (regex, dates, randomness, query
expressions outside the supported subset) for the user to eyeball. Make any NOT TESTED / FAILED
items impossible to miss — put them first.
Then close with this hand-off to the user (adapt the paths, keep the content):
The converted code is in
code-on-canvas-files/— one folder per JST, each with its<jst-name>.pyand test data. To use it, you do the following:
- Open the JST's folder and take the
.pycode.- In each workflow that uses that JST, add a Run Code task and paste the code in.
- Update the task's code, input variables (one per incoming
$id) and output variables (read fromresult.stdout_json, keyed by outgoing$id) to fit that workflow.- Do not delete any JST until you have replaced it in every workflow that might use it and confirmed those workflows still work. For anything marked NOT TESTED, FAILED or NEEDS REVIEW, check the code yourself first.
Once you've given the hand-off, you're done. Replacing the JSTs in workflows is the user's work, not yours.
[], {}, "0" are truthy in JS. Any value used as a
condition (filter predicate, if, ternary, &&/||/!) goes through js_truthy.== vs strict === vs deepEquals → js_loose_eq / js_strict_eq /
deep_equals; bool is distinct from number in JS.typeof (Json.typeof) → js_typeof: null, array and object all return "object".nullish ?? falls back only on null/undefined, not on 0/"" (unlike ||)./, never //); remainder sign follows the dividend
(js_remainder, not Python %); Math.round is half-up (math.floor(x+0.5)).Array.sort is lexicographic, not numeric — don't emit a bare numeric sort
unless the JST supplied a numeric comparator.push/pop/shift/unshift/splice/sort/reverse/
fill/setIndex/copyWithin) mutate in place and return a JS-specific value
(push → new length, pop → removed element, splice → removed slice).re differ (flags, named groups, Unicode classes, no sticky
flag); translate carefully and flag REVIEW.toLocale* is locale/timezone
dependent; approximate and flag REVIEW.query — jst_helpers.query supports a JSONPath subset ($, .key, [i],
[*]/.*, ..key) and returns a LIST of matches. Filters [?()], slices, unions are NOT
supported — hand-translate those, don't guess.null/undefined → None. Prefer .get() over [] for possibly-absent object keys.assets/helpers/jst-to-code/jst-method-map.md — full JST method → Python mapping table.assets/helpers/jst-to-code/jst_helpers.py — pure-Python runtime helpers to inline.assets/helpers/jst-to-code/examples/demo-fruits.jst.json,
assets/helpers/jst-to-code/examples/demo-fruits.py,
assets/helpers/jst-to-code/examples/test-data/example1.json,
assets/helpers/jst-to-code/examples/test-data/example2.json — worked example
with its header comment and two test examples (the exampleNInput / exampleNOutput format).assets/AGENTS.md — platform auth-reuse, look-up-before-you-act, job-variable path, and
circuit-breaker rules (remote mode).agents/openai.yaml (opens in a new tab)assets/AGENTS.md (opens in a new tab)assets/helpers/auth.py (opens in a new tab)assets/helpers/jst-to-code/examples/demo-fruits.jst.json (opens in a new tab)assets/helpers/jst-to-code/examples/demo-fruits.py (opens in a new tab)assets/helpers/jst-to-code/examples/test-data/example1.json (opens in a new tab)assets/helpers/jst-to-code/examples/test-data/example2.json (opens in a new tab)assets/helpers/jst-to-code/jst-method-map.md (opens in a new tab)assets/helpers/jst-to-code/jst_helpers.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub itential/builder-skills --plugin itential-builder19 skills in this plugin
/builder-agentUse this skill when someone has an approved solution design and is ready to build. Trigger it for phrases like "solution design is approved", "go ahead and build", "implement the design", "create the workflows", "build everything per the design", or "the design is locked — implement it". Also trigger it when a build is failing mid-way and needs debugging, or when /qa-agent hands back a failing test case for a fix. This skill implements the approved solution-design.md end-to-end — creating all workflows, templates, projects, and configs, and testing each component individually. If the user has a solution-design.md and wants to turn it into working automation, this is the right skill. Invoke after /solution-arch-agent produces an approved solution-design.md. Hands off to /qa-agent once the build is complete — /qa-agent owns acceptance testing and the as-built record. Logs in with its bundled auth helper: never read `.env` yourself./documentationUse this skill to survey and catalog an Itential platform — when someone wants to know what's on their platform, document global assets (workflows, templates, LCM models, golden config, OM automations) that are NOT inside a named project, group them into logical use cases, and produce a master catalog or README. Trigger it for phrases like "document everything on the platform", "what use cases do we have?", "catalog all our global workflows", "I inherited this platform and have no idea what's there", "group our automations by use case", or "produce a platform README". The output is a structured catalog — customer-spec.md + solution-design.md per use case + master README. NOT for documenting a specific named project — use /project-to-spec for that. NOT for building new automation. Logs in with its bundled auth helper: never read `.env` yourself./exploreUse this skill whenever someone wants to connect to an Itential platform and browse, inspect, or discover what's there — without starting a formal delivery. Trigger it for phrases like "connect to my platform", "show me what adapters are running", "authenticate and pull platform data", "I want to poke around before starting", "what workflows exist?", "give me an inventory of the platform", "browse capabilities freely", "check if adapter X is running", or "I just set up a new environment — show me what's there". Also use it for ad-hoc freestyle work where the user wants to build something directly without going through the full spec→design→build lifecycle. Logs in with its bundled auth helper: never read `.env` yourself./flowagentDesign, build and test AI agents on the Itential Platform (Agent Project Service, Model Registry Service, Tools Service, Agent Session Manager). Agents use LLMs to call platform tools, including other agents. Use when designing or building agents, parent and child agents, LLM provider profiles, tools, decorators or human approval steps, attaching skills to agents, or when running test sessions to check an agent. To write or import the skills themselves, use /flowagent-skill-builder./flowagent-skill-builderUse this skill to write, package, import and test skills for FlowAgent (FlowAI) agents on the Itential Platform — the procedure packages an agent loads on demand alongside its tools. Trigger it for phrases like "write a skill for my agent", "create a FlowAgent skill", "turn this runbook into an agent skill", "import this skill into FlowAgent", or "add a vendor to this agent skill". Skills follow the Agent Skills format in the shape of itential/infra-agent-skills (one operation per skill, a short SKILL.md that routes to per-vendor procedure and endpoint files), so skills from that library import unchanged. NOT for building, configuring or running the agents themselves — use /flowagent for that./flowagent-to-specConvert a FlowAgent into a deterministic workflow spec. Reads the agent definition, tools, and session history (Agent Project Service / Agent Session Manager APIs) to understand what the agent does, then produces a customer-spec.md that describes the same use case as structured, deterministic automation. Turns agentic → deterministic.Other plugins' skills for the same job