intersystems-community/iris-agentic-dev/objectscript-unit-test
Claude Code and agent skill by intersystems-community/iris-agentic-dev
- community
Checking that the SKILL.md file is still in the repository.
Generates %UnitTest.TestCase subclasses for ObjectScript classes using live IRIS introspection. Use when asked to write tests for any ObjectScript class or method.
Install
npx vskill@latest install intersystems-community/iris-agentic-dev/objectscript-unit-testSKILL.md
Purpose
Generate idiomatic IRIS %UnitTest.TestCase test scaffolds grounded in live class introspection — not guessed from code. Each generated test compiles and runs against a real IRIS instance.
When to Use
- Writing tests for a new or existing ObjectScript class
- Adding coverage for a specific method before refactoring
- Validating that a bug fix doesn't regress
Workflow
Step 1 — Generate Test Class
The tool uses docs_introspect to read the live class definition — method signatures, return types, class vs instance methods — and generates appropriate test scaffolds.
Step 2 — Review Generated Scaffold
Each generated test method follows this pattern:
For %Status-returning methods, assertions use $$$AssertStatusOK:
Step 3 — Compile and Run
Put the class on the server and compile it there. iris_compile only recompiles source IRIS already holds; it does not read local files.
The leading colon runs one class. Only methods whose names start with Test run. A method named CheckSum or VerifySub is skipped without a word. If no method runs, %UnitTest still prints All PASSED; iad returns NO_TESTS_FOUND instead. Treat NO_TESTS_FOUND as a failure, not a pass.
Fix any compile errors, then confirm all generated tests pass before adding assertions.
Run tests through iris_test, not by calling %UnitTest.Manager in iris_execute. The manager checks messages.log after each test class and when it closes; if the log grew, it opens it, reads it, closes it, and leaves $IO on $PRINCIPAL. Under iris_execute that loses the output, or corrupts the whole answer if it happens mid-test, and any process writing to messages.log sets it off. iris_test runs the manager in a background job, which it cannot harm. If you must call the manager yourself, do it in a Job and read ^UnitTest.Result afterwards.
Step 4 — Add Real Assertions
The scaffold generates placeholder assertions. Replace them with meaningful expected values based on the method's documented behavior or known inputs/outputs.
Naming Conventions
| Element | Convention | |
|---|---|---|
| Test class | Test.<OriginalPackage>.<ClassName> | |
| Test method | Test<OriginalMethodName> | |
| Output file | tests/Test/<Package>/<ClassName>.cls |
What Gets Generated
- One test method per public, non-private method in the class
- Instance methods:
%New()+ method call - Class methods: direct
##class()call %Statusreturns:$$$AssertStatusOKassertion- All other returns:
$$$AssertEqualsplaceholder assertion - Private methods: skipped (prefix
%or markedPrivate)
Output Format
✅ Generated test classTest.MyApp.Utils—Ntest methodsOutput path:tests/Test/MyApp/Utils.clsNext: put and compile withiris_doc(mode="put", ..., compile=true), then runiris_test(pattern=":Test.MyApp.Utils")
Related skills
- objectscript-tdd — the compile-test-fix loop that uses the tests you write here
- objectscript-coverage — measure how well your test suite exercises the code
- objectscript-debugging — when a test fails with a runtime error and you need to trace it
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/skills/objectscript-unit-test/SKILL.md
Popularity
- Repository stars
- 44
- Repository forks
- 18
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. 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-unit-test)