jac-core-cheatsheet

Documents Jac language core syntax including imports, match statements, lambdas, and error codes.

Updated Jul 26, 2026
One-click install
npx skills add https://github.com/nihalnihalani/jachacks-sf-2026 --skill jac-core-cheatsheet-nihalnihalani
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: jac-core-cheatsheet
Source: https://github.com/nihalnihalani/jachacks-sf-2026/tree/main/plugins/jac-codex/skills/jac-core-cheatsheet
Command: npx skills add https://github.com/nihalnihalani/jachacks-sf-2026 --skill jac-core-cheatsheet-nihalnihalani

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing Jac code requires knowing its strict-typed, Python-flavored syntax and its differences from Python, and small mistakes like trailing semicolons on brace imports or lowercase booleans produce confusing compiler errors. ## Core Features & Use Cases - Core Syntax Reference: Covers imports, control flow, match statements, enums, lambdas, glob variables, entry points, and string formatting with runnable Jac examples. - Pitfall Catalog: Documents reserved keywords, backtick escaping, unused-name warnings (W2003), missing pass statement, and misleading error codes like E1002 and E0067. - Import Semantics: Explains project-root absolute imports versus dotted relative imports, client/server code inference, and with entry versus with entry:__main__ execution. - Use Case: When an AI assistant writes Jac code that fails jac check with E0030 or E0001, load this Skill to identify the exact syntax rule violated and apply the correct form. ## Quick Start Load the jac-core-cheatsheet skill and explain why my Jac match statement with braced case bodies fails to parse.

Frequently Asked Questions about jac-core-cheatsheet

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write a match statement in Jac?▼

Jac match statements use colon plus indented case bodies, not braces. Writing `case 0 { ... }` is a parse error (E0001). Guards like `case int() as n if n < 0:` and destructuring patterns for sequences, dicts, and classes work as in Python.

How do Jac imports work compared to Python?▼

Plain module imports take a semicolon (`import os;`) while selective brace imports take none (`import from math { pi }`). No-dot imports resolve from the project root at any depth, while dotted relative imports are mainly for client code resolved by the bundler.

Why does my Jac code fail with E0030 on an import?▼

E0030 occurs when a brace import ends with a semicolon, such as `import from X { Y };`. Remove the trailing semicolon; only plain module imports like `import X;` require one.

Can I use Python reserved words as variable names in Jac?▼

No. Python reserved words cannot name `has` fields or parameters even with backtick escaping, failing with E0067. Jac-only keywords like `visit` or `node` can be escaped with a single leading backtick.

Why does Jac warn about unused variables with W2003?▼

Jac warns on any unused bound name, including validation-only bindings. Prefix intentionally unused names with underscore, discard values with `_ = expr;`, or drop the exception binding with `except ValueError { ... }`.

Does Jac have a pass statement for empty blocks?▼

No, Jac has no `pass` statement and using one raises E0010. Write empty braces `{}` for an intentionally empty block instead.