/iris-dev:objectscript-unit-testfrom iris-dev
Generates %UnitTest.TestCase subclasses for ObjectScript classes using live IRIS introspection. Use when asked to write tests for any ObjectScript class or method.
Ships in iris-dev. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
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.
Tool: iris_generate_test
Inputs: class_name (e.g. "MyApp.Utils"), method_name (optional, generates all if omitted), test_directory (default "tests")
Returns: test class code + suggested output path
The tool uses docs_introspect to read the live class definition — method signatures, return types, class vs instance methods — and generates appropriate test scaffolds.
Each generated test method follows this pattern:
Method TestMyMethod()
{
// Arrange
Set tObj = ##class(MyApp.Utils).%New()
// Act
Set tResult = tObj.MyMethod()
// Assert
Do $$$AssertEquals(tResult, expectedValue, "MyMethod should return expected value")
}
For %Status-returning methods, assertions use $$$AssertStatusOK:
Do $$$AssertStatusOK(tSC, "MyMethod should succeed")
Put the class on the server and compile it there. iris_compile only recompiles source IRIS already holds; it does not read local files.
iris_doc(mode="put", name="Test.MyApp.Utils.cls", content="...", compile=true)
iris_test(pattern=":Test.MyApp.Utils")
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.
The scaffold generates placeholder assertions. Replace them with meaningful expected values based on the method's documented behavior or known inputs/outputs.
| Element | Convention |
|---|---|
| Test class | Test.<OriginalPackage>.<ClassName> |
| Test method | Test<OriginalMethodName> |
| Output file | tests/Test/<Package>/<ClassName>.cls |
%New() + method call##class() call%Status returns: $$$AssertStatusOK assertion$$$AssertEquals placeholder assertion% or marked Private)✅ Generated test class
Test.MyApp.Utils—Ntest methods Output path:tests/Test/MyApp/Utils.clsNext: put and compile withiris_doc(mode="put", ..., compile=true), then runiris_test(pattern=":Test.MyApp.Utils")
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub intersystems-community/iris-agentic-dev --plugin iris-dev40 skills in this plugin
/ensemble-productionManage and observe IRIS Interoperability productions — lifecycle, logs, queues, and message tracing. Covers pyprod Python API, ObjectScript Ens.Director, and MCP tool flow./iris-agentic-devConfigure, connect, and troubleshoot the iris-agentic-dev MCP server (iris_execute/iris_query/iris_doc/docs_introspect/kb/etc.) against an IRIS container or instance. Use when its tools return IRIS_UNREACHABLE, when pointing it at a new IRIS, or when a connection edit "isn't taking effect." Covers the .iris-agentic-dev.toml config, live file-watch reload, the OrbStack port-discovery gotcha, and the docker-exec fallback./iris-agentic-dev-setupOther plugins' skills for the same job