From iris-dev
Provides MAC routine syntax rules, label-based structure, #include directives, $ZTRAP error handling, and extrinsic functions. Use when working with .mac files, legacy CHUI apps, or pre-class IRIS code.
How this skill is triggered — by the user, by Claude, or both
Slash command
/iris-dev:objectscript-mac-routinesThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Before generating any `.MAC` code, verify all 8 items:
Before generating any .MAC code, verify all 8 items:
| # | Check | Wrong | Right |
|---|---|---|---|
| 1 | Routine entry | MYROUTINE() (parens) | MYROUTINE (no parens) |
| 2 | Label indentation | LABEL { (braces) | LABEL then tab-indented body |
| 3 | Include syntax | Include %occStatus | #include %occStatus |
| 4 | Extrinsic call | ##class(X).Method() | $$LABEL(args) or $$LABEL^RTN(args) |
| 5 | Error trap | Try { } Catch e { } | Set $ZTRAP="ERRHAN" ... ERRHAN Set err=$ZE |
| 6 | Cross-routine call | .Method() | Do LABEL^ROUTINE or $$FUNC^ROUTINE(args) |
| 7 | Variable scope | Method-scoped (class) | New var to create local scope |
| 8 | Return from subroutine | Return | Quit (no value) in a DO label |
MYROUTINE
;Entry point - no parens, no braces
Set x = $$CALC(3,4)
Quit
;
CALC(a,b) ;Extrinsic function - called with $$CALC(a,b)
Quit a+b
;
HELPER ;Subroutine - called with Do HELPER
Write "done",!
Quit
MYROUTINE
Set $ZTRAP = "ERRHAN"
; ... code that might error ...
Quit
;
ERRHAN
Set err = $ZE
Set $ZTRAP = ""
Write "Error: ",err,!
Quit
iris_read_document("MYROUTINE.mac") → returns full source
iris_write_document("MYROUTINE.mac", fixedCode) → writes + compiles
iris_list_documents(filter="PATH*", category="MAC") → lists routines
result used after a For loop but never initialized → <UNDEFINED> if no rows#include file not found → check ^%INCLUDE global or .inc file spelling$$FUNC vs Do LABEL confusion: $$ for functions returning values, Do for subroutinesQuit value in a Do-called subroutine → exits subroutine cleanly; Quit with no value for voidnpx claudepluginhub intersystems-community/iris-agentic-devCompile-test-fix loop for ObjectScript development. Guides writing, compiling, and testing ObjectScript classes with common error fixes.
Implements Crystal macros for compile-time metaprogramming, code generation, DSLs, AST manipulation, and type-safe abstractions.
Reviews Rust macro code for hygiene issues, fragment misuse, compile-time impact, and procedural macro patterns. Used for macro_rules!, proc-macro, derive, or attribute macro review.