intersystems-community/iris-agentic-dev/objectscript-mac-routines
Claude Code and agent skill by intersystems-community/iris-agentic-dev
- community
Checking that the SKILL.md file is still in the repository.
MAC routine syntax — label-based structure, #include, $ZTRAP error traps, extrinsic functions, and Quit vs Return. Use when working with .mac files, legacy CHUI applications, or any pre-class ObjectScript code.
Install
npx vskill@latest install intersystems-community/iris-agentic-dev/objectscript-mac-routinesSKILL.md
MAC Routine Hard Gate — Check BEFORE Writing Code
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 | none | Try { } Catch e { } or Set $ZTRAP="ERRHAN" | |
| 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 | none | Quit or Return |
Correct MAC Structure
$ZTRAP Error Handling (legacy pattern)
Reading and writing .MAC via Atelier
VS Code's isfs:// provider does not always expose routines, so go at the Atelier REST API directly. The document name includes the .mac extension.
Without the CLI, call Atelier with curl -K -, which reads the credential from stdin so it stays out of the process list. IRIS_SCHEME is https for an HTTPS endpoint:
A PUT to the same URL with ?ignoreConflict=1 overwrites regardless of the server timestamp.
A PUT does not compile — follow it with POST /action/compile and a body of ["MYROUTINE.mac"], or use the iris_compile MCP tool. Always re-read after writing; the PUT response body is not a reliable confirmation. See the compile skill.
Common Bugs in Legacy MAC Code
resultused after a For loop but never initialized →<UNDEFINED>if no rows#includefile not found → check^%INCLUDEglobal or.incfile spelling$$FUNCvsDo LABELconfusion:$$for functions returning values,Dofor subroutinesQuit valuein aDo-called subroutine → exits subroutine cleanly;Quitwith no value for void
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/skills/objectscript-mac-routines/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/intersystems-community/iris-agentic-dev/objectscript-mac-routines)