Use this checklist when creating or changing Jaiph programs. Jaiph turns an agent’s usual mix of prompts, Bash or sed, Python, Node, and other tools into a repeatable program. Keep workflow control in Jaiph, deterministic implementation in scripts, and judgment-driven work in prompts. This skill is not a language reference. Exact syntax lives at https://jaiph.org/reference/grammar; semantics live at https://jaiph.org/reference/language. When this page and the compiler disagree, the compiler wins.
Classify every operation before writing code:
| Need | Use |
|---|---|
| Composition, branching, loops, concurrency, recovery, or data flow | Native Jaiph in a def |
| Deterministic computation, filesystem/process access, or an existing CLI/library | script in Bash, Python, Node, or another interpreter |
| Work requiring model judgment or generation | prompt; capture the result with const, and use typed returns when downstream steps need fields |
| Decoupled message dispatch | channel and send |
When a task would normally produce nested one-off Python, sed, Node, or Bash calls, lift each repeatable operation into a small named script and compose those scripts with prompts in a def. The result should run again without reconstructing the command chain. Reuse imported modules and nearby definitions before adding another implementation. Do not use a prompt for deterministic work.
Native orchestration includes if, match, for, async, stdin pipelines, catch, recover, return, logging, and failure. Read Language before recreating any of these inside a script.
Scripts and tool-capable prompts run as the user who launched Jaiph; Jaiph is not a process sandbox. Use a container, pod, CI runner, or dedicated user when isolation is required. See Deploy Jaiph.
script extension_counts = '''python3
import collections
import pathlib
import sys
root = pathlib.Path(sys.argv[1])
counts = collections.Counter(
path.suffix or "<none>" for path in root.rglob("*") if path.is_file()
)
for suffix, count in sorted(counts.items()):
print(f"{suffix}: {count}")
'''
script write_report = '''node
const fs = require("fs");
const chunks = [];
process.stdin.on("data", chunk => chunks.push(chunk));
process.stdin.on("end", () => {
fs.writeFileSync(process.argv[2], Buffer.concat(chunks));
});
'''
export def main(root, output) {
const counts = extension_counts(root)
const report = prompt """
Explain this source-tree composition and identify likely maintenance risks:
${counts}
"""
stdin report -> write_report(output)
return report
}
This keeps sequencing and data flow in Jaiph, deterministic inspection in Python, model judgment in a prompt, and file writing in Node. For script fences, arguments, prompt capture, and data transfer, follow Language.
Calls return an output handle. Before capturing, interpolating, passing, or streaming one, follow Value types and Arguments and stdin.
The same .jh program can run from the CLI, expose tools over MCP, or serve an HTTP API. Treat exported def names, comments, and parameters as a public interface.
jaiph run <file.jh> [args…] for a command-line program with export def main; see CLI.jaiph mcp <file.jh> to expose exported defs as MCP tools over stdio; see MCP server in 30 seconds.jaiph serve <file.jh> to expose exported defs through REST, OpenAPI, Swagger UI, and HTTP MCP; see Serve defs over HTTP..jh and *.test.jh files for reusable imports, defs, scripts, prompts, and project conventions.jaiph format <file…>.jaiph compile <file-or-dir>. Fix every reported diagnostic.*.test.jh coverage. Mock every prompt, then run jaiph test <file-or-dir>.jaiph run <file.jh> [args…] for an end-to-end check when its external effects and agent calls are intended..jaiph/runs/ when debugging or validating behavior; see Save artifacts.Do not claim completion until formatting, compilation, and relevant tests pass. The full command surface and flags live at CLI.
This skill is published independently of the Jaiph repository. Open the absolute owner URL; do not resolve a relative path.
() on a definition or call site — see https://jaiph.org/reference/grammar.const, or rebinding an immutable name — see https://jaiph.org/reference/language.$name, $(…), or ${var:-default} in an orchestration string instead of a script body — see https://jaiph.org/reference/language.stdin — see https://jaiph.org/reference/language.impl(task), not impl()) — see https://jaiph.org/reference/language.use clause plus a matching --env grant — see https://jaiph.org/reference/env-vars.*.test.jh file — see https://jaiph.org/how-to/testing.*.test.jh tests.