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/PMN123/trapdoor --skill jac-codespaces-pmn123
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: jac-codespaces
Source: https://github.com/PMN123/trapdoor/tree/main/.agents/skills/jac-codespaces
Command: npx skills add https://github.com/PMN123/trapdoor --skill jac-codespaces-pmn123

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When writing Jac full-stack applications, developers need to know which code runs on the server, which ships to the browser, and which compiles to native — and why the compiler placed a declaration where it did. This Skill explains the inference rules so you can predict placement, fix misplaced code, and pin declarations explicitly when inference gets it wrong. ## Core Features & Use Cases - Inference rules: JSX and string-path npm imports mark code as client, extern C declarations seed native placement, and everything else defaults to server, with reference propagation pulling helpers along within a module. - Placement guarantees: def:pub endpoints, walkers, and node/edge archetypes never relocate; shared objects referenced from both sides become auto-shared wire types. - Explicit overrides: Use cl/sv/na block, statement, or file-extension markers to pin placement, such as keeping secrets server-side with sv glob. - Use Case: A client component throws JobProgress is not defined at mount because it constructs a shared archetype client-side — this Skill explains why and shows the T | None = None fix. ## Quick Start Ask the AI to explain why a Jac declaration landed in the wrong bundle or how to pin a helper server-side with sv.

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, extern C declarations seed native, and everything else defaults to server. References propagate placement to helpers within a module, but never across module boundaries.

How do I keep a Jac helper or secret on the server?

Pin the declaration with the `sv` marker, for example `sv glob API_KEY` or `sv def summarize(...)`. Client calls to sv-pinned functions compile to RPC bridge calls instead of shipping the code in the JS bundle.

Why does my Jac client import fail with error E5082?

E5082 means a client module imported a helper from a plain server-default module, and inference does not cross module boundaries. Pin the target module with the `.cl.jac` extension so it gains client-side presence.

Can I construct shared Jac objects inside client components?

No. Shared archetypes referenced from client code get a wire-codec class for receiving and reading, but constructing one client-side throws at mount. Hold them as `T | None = None` and let the server construct instances.

Do I still need cl/sv/na markers in Jac code?

Markers are optional overrides, not requirements — markerless code compiles byte-identical to marker-annotated equivalents. Use them when you want the boundary visible in source or need to override inference, such as pinning secrets server-side.