pyprod
Skill41 starsChanged 3 months agoMITView on GitHub
Use when creating or modifying InterSystems IRIS interoperability production components in Python — Business Services, Business Processes, Business Operations, Adapters, Messages, or Production definitions.
In this repository40 other files it gives its agents.
- AGENTS.mdAGENTS.md
- skills/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- iris-coverage-runSkill
- iris-coverage-setupSkill
- aihub-eapSkill
- ensemble-productionSkill
- iris-agentic-devSkill
- iris-ai-hubSkill
- iris-connectivitySkill
- iris-container-graceful-shutdownSkill
- iris-cpf-mergeSkill
- iris-devtesterSkill
- iris-docsSkill
- iris-embedded-pythonSkill
- irishealth-containerSkill
- iris-linux-dockerSkill
- iris-objectscript-evalSkill
- iris-pgwireSkill
- iris-product-featuresSkill
- irispython-connectorSkill
- iris-sqlSkill
- iris-vector-aiSkill
- iris-vscode-objectscriptSkill
- iris-windows-iis-setupSkill
- objectscript-coverageSkill
- objectscript-debuggingSkill
- objectscript-fewshot-fixesSkill
- objectscript-guardrailsSkill
- objectscript-list-patternsSkill
- objectscript-loop-patternsSkill
- objectscript-mac-routinesSkill
- objectscript-navigationSkill
- objectscript-repairSkill
- objectscript-reviewSkill
- objectscript-sql-patternsSkill
- objectscript-tddSkill
- objectscript-unit-testSkill
- opencode-introspectSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 19
Import from intersystems_pyprod — not grongier.pex or any other package.
- Distinctive: line 21
Import only what your component needs — do not copy-paste the full import list into every file:
- Very specific: line 101
Rule: Every async dispatch with response_required=1 must have a matching on_response in the same class.
- Very specific: line 163
Every callback returns Status as its first element.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Building with pyprod
Read this skill once, then write all required files in one pass. Do not re-read between writes.
pyprod is the InterSystems Python library for IRIS interoperability productions.
Import from intersystems_pyprod — not grongier.pex or any other package.
Import only what your component needs — do not copy-paste the full import list into every file:
| Component | Typical imports |
| Message | Column, JsonSerialize (or PickleSerialize) |
| BusinessService | IRISParameter, IRISProperty, BusinessService, IRISLog, Status |
| BusinessProcess | IRISProperty, BusinessProcess, IRISLog, Status |
| BusinessOperation | IRISParameter, IRISProperty, BusinessOperation, IRISLog, Status |
Set the IRIS package name at module level (applies to all classes in the file):
iris_package_name = "MyPackage"Messages
Messages passed between Business Hosts must subclass JsonSerialize or
PickleSerialize. Use Column() for fields that should be SQL-queryable — a plain
Python attribute is not persisted as a separate column.
class OrderMessage(JsonSerialize):
order_id: str = Column(index=True) # SQL column, indexed
amount = Column(datatype=int) # SQL column, integer
note = "default" # NOT a Column — not SQL-queryableColumn(default=None, datatype=None, description=None, index=False) — string and
numeric types only.
BusinessService
Receives input from an adapter (or direct call), packages it as a message, routes forward.
class MyService(BusinessService):
ADAPTER = IRISParameter("MyPackage.MyAdapter") # omit → adapterless (set pool_size=0)
target = IRISProperty(
settings="Target:selector?context={Ens.ContextSearch/ProductionItems?targets=1&productionName=@productionId}"
)
def on_process_input(self, input):
request = OrderMessage(input)
status, response = self.send_request_sync(self.target, request, timeout=-1)
return status, responsesend_request_async on BusinessService: (target, request, description="") — no
response_required.
BusinessProcess
Orchestrates logic. New instance per message — no persistent state.
class MyProcess(BusinessProcess):
target = IRISProperty(
settings="Target:selector?context={Ens.ContextSearch/ProductionItems?targets=1&productionName=@productionId}"
)
def on_request(self, request):
# response_required=1 (integer, not True) — MUST also implement on_response below
status = self.send_request_async(self.target, request, response_required=1)
return status, None
# ⚠ REQUIRED — omitting on_response causes NotImplementedError at runtime
def on_response(self, request, response, call_request, call_response, completion_key):
return Status.OK(), responseRule: Every async dispatch with response_required=1 must have a matching
on_response in the same class. No exceptions. If you only want fire-and-forget,
pass response_required=0 and omit on_response. Never use True/False — integer
only.
For sync dispatch:
status, response = self.send_request_sync(self.target, request, timeout=-1)
return status, responseBusinessOperation
Receives typed requests, dispatches via MessageMap.
class MyOperation(BusinessOperation):
ADAPTER = IRISParameter("MyPackage.MyAdapter") # optional
connection_url = IRISProperty(default="http://localhost", description="Target URL")
MessageMap = {
"MyPackage.OrderMessage": "handle_order", # key = iris_package_name.ClassName
"MyPackage.CancelMessage": "handle_cancel",
}
def handle_order(self, request):
IRISLog.Info(f"Processing order to {self.connection_url}")
return Status.OK(), None
def handle_cancel(self, request):
return Status.OK(), None
def on_message(self, request): # optional fallback for unmatched types
return Status.OK()send_request_async on BusinessOperation: (target, request, description="") — no
response_required.
IRISProperty vs IRISParameter
IRISProperty | IRISParameter | |
| Purpose | Operator-configurable instance value (shows in production UI) | Class-level constant |
| Mutable | Yes, per-instance | No |
| Use for | URLs, targets, credentials, timeouts | Adapter class name (ADAPTER) |
ADAPTER = IRISParameter("MyPackage.MyAdapter") # constant — links adapter class
timeout = IRISProperty(default=30, description="Timeout in seconds") # UI-editableStatus and Logging
Every callback returns Status as its first element. Use a tuple return in all
message-handling methods:
return Status.OK(), response # handler: success, pass response back
return Status.OK(), None # handler: success, no response to pass back
return Status.ERROR("message"), None # handler: failureon_message (BusinessOperation fallback only) may return bare Status.OK().
IRISLog.Info("message")
IRISLog.Warning("message")
IRISLog.Error("message")Common Mistakes
| Mistake | Effect | Fix |
Plain attribute instead of Column() | Field not SQL-queryable | Use Column(datatype=...) |
response_required=True (bool) | Runtime error | Use integer 1 |
send_request_async(response_required=1) without on_response | NotImplementedError at runtime | Always implement on_response alongside the async call |
IRISParameter for UI-editable value | Not visible in production UI | Use IRISProperty |
IRISProperty on BusinessProcess | State lost (new instance per message) | Use only on adapters, services, operations |
| Wrong MessageMap key package | Messages not dispatched | Key must match iris_package_name of the message module |
pool_size=1 for adapterless service | Hangs | Use pool_size=0 |
Import from grongier.pex | Wrong library | Import from intersystems_pyprod |
Production Definition and Director
See [[pyprod-production-definition]] for the Production class and item types.
See [[pyprod-director]] for start/stop/inject via Director.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

