jac-codespaces

Explains how the Jac compiler infers client, server, and native code placement.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When writing full-stack Jac applications, developers often cannot tell why a declaration landed in the JavaScript bundle, stayed on the server, or compiled to native code, leading to leaked secrets, broken imports (E5082), and runtime errors like constructing shared archetypes client-side. ## Core Features & Use Cases - Placement inference rules: Documents how JSX and string-path npm imports mark code as client, extern C declarations seed native placement, and unmarked code defaults to server. - Reference propagation semantics: Explains how helpers, globs, and imports referenced by client code join the bundle, why propagation stops at module boundaries, and how auto-shared obj/node/edge/walker archetypes cross the wire. - Explicit overrides: Covers cl/sv/na block, statement, and file-extension markers, including sv pinning for secrets and sv import for RPC and microservice boundaries. - Use Case: A developer sees error E5082 after importing a helper from a plain module into client code; this Skill explains the boundary rule and the .cl.jac pinning fix. ## Quick Start Ask the agent to explain why a specific Jac declaration compiled to the wrong codespace and how to pin it with sv or a file-extension marker.

Frequently Asked Questions about jac-codespaces

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

FAQPage Schema
How does Jac decide whether code runs on client or server?▼

Jac infers placement structurally: JSX and string-path npm imports mark code as client, unmarked code defaults to server, and references from client code pull helpers into the bundle. Explicit cl/sv/na markers override inference when needed.

How do I keep a secret or server-only helper out of the Jac client bundle?▼

Pin the declaration with the sv marker, such as sv glob API_KEY or sv def. An access tag does not pin placement; only sv prevents client reference propagation from pulling the declaration into the JavaScript bundle.

Why does Jac error E5082 say my import has no client-side presence?▼

E5082 occurs when client code imports a helper from a plain server-default module, because reference propagation does not cross module boundaries. Pin the target module with a .cl.jac extension so it gains client presence.

Can I construct a Jac node or obj archetype inside client code?▼

No. Archetypes referenced from client code are auto-shared as wire-codec classes, so receiving and reading them works, but constructing one client-side throws at runtime. Hold them as T | None = None and let the server construct them.

When does Jac compile code to the native codespace?▼

Native placement is seeded by imports whose braces declare extern C-ABI functions, and declarations using those names follow via reference propagation. Pure compatible code stays server unless you use na blocks, .na.jac files, or jac nacompile.