jac-impl-files

Split Jac declarations from method bodies using impl blocks and .impl.jac annex files.

Updated Jul 26, 2026
One-click install
npx skills add https://github.com/PMN123/trapdoor --skill jac-impl-files-pmn123
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: jac-impl-files
Source: https://github.com/PMN123/trapdoor/tree/main/.agents/skills/jac-impl-files
Command: npx skills add https://github.com/PMN123/trapdoor --skill jac-impl-files-pmn123

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Jac source files grow unwieldy when declarations and method bodies live together, making public APIs hard to read and large components hard to maintain. This Skill explains how to separate declarations from implementations using impl blocks, .impl.jac annex files, and directory layouts that the Jac compiler auto-pairs by basename. ## Core Features & Use Cases - Impl file layouts: Choose between side-by-side pairing, shared impl/ directories, or mod.impl/ directories for one-to-many splits, with a decision tree based on file size and structure. - Declaration-to-impl mapping: Match every declaration form (functions, methods, walkers, enums, abstract methods, property accessors) to its correct impl syntax with exact signature rules. - Client component handler annexes: Move async handler bodies out of frontend components into paired .impl.jac files while keeping reactive state access bare (no self prefix). - Use Case: A Jac frontend component file exceeds 200 lines with fetch and mutate logic mixed into render code. Apply the handler annex pattern to keep the component as a readable state-plus-render surface while bodies live in frontend.impl.jac. ## Quick Start Split my oversized Jac module into a declaration file and an impl annex file using the correct pairing layout.

Frequently Asked Questions about jac-impl-files

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

FAQPage Schema
How do I split a Jac file into declaration and implementation files?

Keep declarations (obj, def signatures, enums) in mod.jac and move bodies into impl blocks inside mod.impl.jac, impl/mod.impl.jac, or a mod.impl/ directory. The compiler auto-pairs files by basename, so no import statement is needed between them.

How do I reduce the size of a Jac client component file?

Declare async handlers as stubs inside the def:pub component and implement them in the paired .impl.jac annex. Inside impl app.handler blocks, reactive has fields are read and written bare without self, and assignments still trigger re-renders.

Why does my Jac impl block fail to match its declaration?

The impl signature must match the declaration exactly, including parameter names, types, and return type. A bare impl fn only matches a bare def fn, and a second obj block with the same name raises duplicate declaration error E0077.

Does Jac enforce abstract method implementations in subclasses?

No. The abst keyword marks intent but is not compiler-enforced: a subclass missing the impl still passes jac check, instantiates, and silently returns None when the method is called. Subclass overrides also require the override keyword to avoid shadowing.

Do Jac packages need an __init__.jac file?

No. Any directory containing .jac files is importable directly. Add __init__.jac only as a re-export barrel so consumers can import from the package root, or for package initialization code.