Opscotch LLM Skill
Implementation-focused guidance for engineers authoring Opscotch bootstraps, workflows, processors, resources, tests, packaging, and runtime integrations.
Scope
Use this skill to:
- decide whether a requirement fits Opscotch's real execution model
- separate bootstrap responsibilities from workflow responsibilities
- structure workflows, steps, triggers, processors, and reusable resources
- choose the right JavaScript context, validation path, and testing path
- apply packaging, cryptography, licensing, persistence, and delivery rules without inventing runtime behavior
Do not use this file as a complete API catalog. For exact context functions, signatures, and examples, use:
/llm/apireference-index.json/llm/apireference.json/llm/patterns.json
Primary provenance:
docs/src/llm/processed/docs/workflow.md->https://docs.opscotch.co/docs/current/workflowdocs/src/llm/processed/docs/patterns.mddocs/src/llm/processed/docs/resource-documentation-with-doc.mddocs/src/llm/processed/introduction/getting-started-full.md->https://docs.opscotch.co/docs/current/introduction/getting-started-fulldocs/src/llm/processed/administrating/testing.md->https://docs.opscotch.co/docs/current/administrating/testingdocs/src/llm/processed/administrating/packaging.md->https://docs.opscotch.co/docs/current/administrating/packagingdocs/src/llm/processed/administrating/licensing.md->https://docs.opscotch.co/docs/current/administrating/licensingdocs/src/llm/processed/administrating/cryptography.md->https://docs.opscotch.co/docs/current/administrating/cryptographydocs/docs/workflow.md->https://docs.opscotch.co/docs/current/workflow
Canonical MCP Use
The canonical schema, context-discovery, and validation surface is the Opscotch Coder MCP endpoint:
https://mcp.opscotch.ai/mcp
When the MCP server is available:
- call
get_guidance(role=system)first - call
get_guidance(role=architect)before drafting structure - call
get_guidance(role=engineer)before implementation details - read the MCP resource list before making schema-derived claims
- use
lookupwhen you do not know the exact schema, pattern, context, or function yet - use
list_context,get_context, andget_context_functionbefore asserting JavaScript context behavior - use
resolve_operational_contextwhenever a claim depends on whatcontextmeans in a specific processor - use the most specific validator available before claiming a generated object is valid
Canonical schema resources include:
opscotch://schemas/bootstrapopscotch://schemas/bootstrap-errorhandlingopscotch://schemas/bootstrap-hostopscotch://schemas/bootstrap-keyopscotch://schemas/bootstrap-packagingopscotch://schemas/bootstrap-recordopscotch://schemas/bootstrap-workflowopscotch://schemas/processoropscotch://schemas/triggeropscotch://schemas/workflowopscotch://schemas/workflow-step
Canonical discovery and validation tools include:
get_guidanceget_schemaget_patternslookuplist_contextget_contextget_context_functionget_context_function_signaturesresolve_operational_contextvalidate_processorvalidate_triggervalidate_stepvalidate_workflowvalidate_workflow_filevalidate_bootstrap_filevalidate_bootstrap_errorhandlingvalidate_bootstrap_hostvalidate_bootstrap_keyvalidate_bootstrap_packagingvalidate_bootstrap_recordvalidate_bootstrap_workflow
Primary provenance:
- Opscotch Coder MCP resources, guidance, and context-discovery tools
Non-Negotiable Rules
- Do not invent APIs, runtime objects, or execution semantics.
- Do not assume Express-style request or response wrappers such as
context.requestorcontext.response. - Do not assume undocumented ambient globals such as
data,request,response, or mutable shared step state. - Treat processor hooks such as
resultsProcessor,urlGenerator,payloadGenerator,authenticationProcessor,splitGenerator, anditemResultProcessoras Opscotch processor objects. - Treat processor
scriptas an inline JavaScript string, not an alternate nested code container. - Treat schema validity and runtime correctness as separate checks.
- Prefer documented
contextAPIs such assetUrl(...),setBody(...),setHttpMethod(...),setHttpMultipartType(...), andsendToStep(...)over invented conventions. - Prefer cautious, source-bounded guidance whenever the corpus does not fully define a behavioral edge case.
Primary provenance:
docs/src/llm/operations/context/prompt-imperatives.mddocs/src/llm/operations/context/processing-rules.mddocs/src/llm/processed/docs/workflow.md->https://docs.opscotch.co/docs/current/workflow
Core Mental Model
Opscotch separates operator-controlled runtime permissioning from remotely updateable solution logic.
- Bootstrap defines what the runtime is allowed to do.
- Workflow defines how those allowed capabilities are used.
- A workflow contains steps.
- A step is the execution boundary.
- Processors are JavaScript hooks attached to a step lifecycle.
- Resources hold reusable processor code that can be packaged into an app.
Use bootstrap for:
- host access
- file access
- HTTP listener permission
- deployment access
- persistence root
- licensing
- packaging trust
- keys
- deployment-specific data
Use workflow for:
- trigger selection
- step flow
- processor composition
- data overrides
- persistence usage
- orchestration between steps
Primary provenance:
docs/src/llm/processed/docs/workflow.md->https://docs.opscotch.co/docs/current/workflowdocs/src/llm/processed/introduction/getting-started-full.md->https://docs.opscotch.co/docs/current/introduction/getting-started-fulldocs/src/llm/processed/docs/patterns.md
Feasibility First
Before authoring config, map the requirement onto Opscotch's supported runtime model.
Check:
- trigger path:
http,timer,tcp,fileWatcher,runOnce, ordeploymentAccess - input path: trigger payload, bootstrap or host
data,context.files(...),context.getStream(), queue access, or outbound HTTP - output path: HTTP response, metrics, logs, OTEL trace data, file writes, queue writes, or outbound HTTP
- processor constraints: synchronous JavaScript only, no imports, no Node.js modules, no
await, noPromise, no callback-based async
If the design depends on arbitrary libraries, arbitrary runtime mutation, unsupported triggers, or async JavaScript inside one processor, redesign around bootstrap permissions plus multi-step orchestration.
Primary provenance:
docs/src/llm/processed/docs/workflow.md->https://docs.opscotch.co/docs/current/workflowdocs/src/llm/processed/introduction/problem-to-plan.md->https://docs.opscotch.co/docs/current/introduction/problem-to-plandocs/docs/workflow.md->https://docs.opscotch.co/docs/current/workflow
Bootstrap Authoring
The bootstrap root is an array of records. Each record requires:
deploymentIdremoteConfiguration
Important bootstrap rules:
- bootstrap configuration is immutable after startup
- bootstrap records are schema-closed to undeclared properties
frequency: 0means load once only- when
frequency > 0,remoteConfigurationTimeoutmust be less thanfrequency startupPrioritycontrols activation order, with lower values starting first
Important permissioning areas:
allowExternalHostAccessfor outbound HTTPallowFileAccessfor file reads, writes, packaging resources, and file watching scopeallowHttpServerAccessfor inbound HTTP listeners and packaged static servingallowDeploymentAccessfor cross-deployment callspersistenceRootfor durable workflow statelicensing,packaging, andkeysfor commercial and cryptographic controls
Authoring guidance:
- define the smallest set of permissions that makes the workflow feasible
- keep environment-specific values in bootstrap
data - treat bootstrap changes as operational changes that usually require restart
- preload cryptographic keys in bootstrap when the workflow must reference them by ID at runtime
- configure
licensing.licenseHostandlicensing.licenseHostPoolIdwhen the runtime should obtain licenses from a licensing app instead of relying on embedded package licensing
Primary provenance:
docs/src/llm/processed/docs/workflow.md->https://docs.opscotch.co/docs/current/workflowdocs/src/llm/processed/administrating/agent.md->https://docs.opscotch.co/docs/current/administrating/agentdocs/src/llm/processed/administrating/licensing.md->https://docs.opscotch.co/docs/current/administrating/licensingdocs/src/llm/processed/administrating/cryptography.md->https://docs.opscotch.co/docs/current/administrating/cryptographydocs/src/llm/processed/blog/2026-03-24-licensing.md->https://docs.opscotch.co/blog/licensingdocs/src/llm/processed/blog/2025-02-03-allow-file-access.md->https://docs.opscotch.co/blog/allow-file-accessdocs/src/llm/processed/blog/2025-02-03-allow-http-server-access.md->https://docs.opscotch.co/blog/allow-http-server-accessdocs/src/llm/processed/blog/2025-02-04-allow-external-host-access.md->https://docs.opscotch.co/blog/allow-external-host-access
Workflow And Step Authoring
The workflow root requires workflows. Common root-level fields include:
datamessagesdefaultStepPropertiescommenttestData
Each workflow requires:
namesteps
Each step requires:
stepId
Common step fields include:
typetriggerdatasingleThreadedhttpTimeoutpersistenceorpersistenceFile- processor hooks such as
urlGenerator,payloadGenerator,authenticationProcessor,splitGenerator,itemResultProcessor,resultsProcessor,httpConnectFailedProcessor, andhttpStatusHandling
Use comment to capture intent and flow. Use defaultStepProperties to centralize shared step settings instead of duplicating them.
Pattern guidance:
- use controller steps to orchestrate and worker steps to perform focused work
- keep authentication in dedicated auth flows
- use explicit registration and activation steps in composite deployments
- use
defaultStepPropertiesonly when the shared settings are genuinely part of one design shape
Primary provenance:
docs/src/llm/processed/docs/workflow.md->https://docs.opscotch.co/docs/current/workflowdocs/src/llm/processed/docs/patterns.mddocs/src/llm/processed/introduction/getting-started-full.md->https://docs.opscotch.co/docs/current/introduction/getting-started-full
Processor And Context Guidance
Processor forms:
- inline
script resource- composite
processors
Guidance:
- prefer resources for reusable or non-trivial logic
- prefer inline
scriptonly for small local behavior - do not mix
processorswith a single-sourcescriptorresourceform - if both
resourceandscriptare present,scriptoverridesresource - validate the standalone processor shape when the MCP validator is available
Operational-context guidance:
- normal workflow logic runs in
JavascriptContext authenticationProcessorruns inAuthenticationJavascriptContext- any processor on a
scripted-authstep runs inAuthenticationJavascriptContext sendToStep(...)returnsJavascriptStateContext, which is read-only and intended for inspection
Useful JavascriptContext capabilities confirmed through the API corpus and MCP include:
- HTTP shaping:
setUrl(...),setBody(...),setHttpMethod(...),setHeader(...),setHttpMultipartType(...) - step orchestration:
sendToStep(...),sendToStepAndForget(...),end() - persistence:
setPersistedItem(...),getPersistedItem(...) - error handling:
addUserError(...),addSystemError(...),isErrored(),getUserErrors(),getSystemErrors() - file access:
files(...) - bytes and streams:
bytes(),getStream(),setStream(...),setStreamFromString(...) - crypto and telemetry:
crypto(),diagnostic(),sendMetric(...) - queue access:
queue()
Primary provenance:
docs/src/llm/processed/docs/workflow.md->https://docs.opscotch.co/docs/current/workflowdocs/src/llm/processed/docs/patterns.mddocs/src/llm/processed/apireference.mddocs/src/llm/processed/blog/2025-11-08-send-to-step.md->https://docs.opscotch.co/blog/send-to-step- Opscotch Coder MCP
list_context,get_context, andresolve_operational_context
Data, Persistence, Errors, And Step Flow
Resolved data guidance:
- merge order is broader to narrower: bootstrap, host, workflow, step, processor
- more specific values win
- primitives overwrite
- objects and arrays merge additively
Persistence guidance:
- persistence is step-scoped durable state, not free shared memory
- stored values should be treated as strings unless you serialize explicitly
- prefer bootstrap
persistenceRootwhen state must survive restart or redeploy
Error guidance:
- use
addUserError(...)for caller or operator fixable problems - use
addSystemError(...)for code, configuration, or unexpected runtime failures - inspect returned
JavascriptStateContextbefore trusting downstream output - fire-and-forget forwarding requires a separate observation path if downstream failure visibility matters
Step-flow guidance:
- use
sendToStep(...)when the caller needs the downstream result - use
sendToStepAndForget(...)when the caller should continue immediately - use
context.end()for deliberate early termination, notreturnalone
Primary provenance:
docs/src/llm/processed/docs/workflow.md->https://docs.opscotch.co/docs/current/workflowdocs/src/llm/processed/docs/patterns.mddocs/src/llm/processed/blog/2025-11-08-send-to-step.md->https://docs.opscotch.co/blog/send-to-stepdocs/src/llm/processed/blog/2025-11-08-context-errors.md->https://docs.opscotch.co/blog/context-errors
HTTP, Streams, Bytes, And Telemetry
Inbound and outbound HTTP guidance:
- use
trigger.httpwith explicitserver,method, andpath - put outbound request construction in
urlGeneratorandpayloadGenerator - use
authenticationProcessorimmediately before outbound HTTP for secret-bearing request mutation - clear inherited headers with
removeAllHeaders()before building an HTTP response when the flow started from an inbound HTTP event
Multipart and binary guidance:
- enable multipart uploads with
trigger.http.multiPartUploadByteLimit - multipart requests use
bodyfor text andstreamfor binary content context.getBody()returns a stringcontext.getStream()returns aByteReader- use
ByteContextfor low-level binary manipulation, encoding conversion, compression, and stream-adjacent operations
Telemetry guidance:
- enable OTEL with
OPSCOTCH_OTEL_PROPERTIES - enrich the active trace with
context.diagnostic().setAttribute(...),.event(...), and.errored(...) - use trigger-level
noTraceonly where the source or schema supports it; do not generalize beyond documented trigger shapes
Primary provenance:
docs/src/llm/processed/docs/workflow.md->https://docs.opscotch.co/docs/current/workflowdocs/src/llm/processed/docs/patterns.mddocs/src/llm/processed/blog/2025-11-08-multipart-http-uploads.md->https://docs.opscotch.co/blog/multipart-http-uploadsdocs/src/llm/processed/blog/2025-11-08-byte-manipulation.md->https://docs.opscotch.co/blog/byte-manipulationdocs/src/llm/processed/blog/2025-11-08-otel.md->https://docs.opscotch.co/blog/otel
Resource Contracts With doc
Use doc when a resource is reusable enough that another engineer, workflow, or AI system should understand its contract without reverse-engineering the JavaScript.
Recommended contract shape:
description(...)for the resource roleinSchema(...)for payload consumed fromcontext.getBody()orcontext.getPassedMessageAsString()dataSchema(...)for configuration consumed fromcontext.getData(...)outSchema(...)when the resource returns a stable output envelopeasUserErrors()when validation failures should be treated as caller mistakesrun(...)for the implementation
Rules:
doc.run(...)must fully enclose the processor codedocmethods belong at the JavaScript root- input and data validation happen before the processor runs
- output validation happens after the processor runs
- schema problems are raised at workflow load time
Use doc less aggressively for tiny one-off scripts with no meaningful contract.
Primary provenance:
docs/src/llm/processed/docs/resource-documentation-with-doc.mddocs/src/llm/processed/blog/2025-11-10-doc.md->https://docs.opscotch.co/blog/validation- Opscotch Coder MCP
list_contextandget_context_function
Testing
Testing guidance:
- when authoring a workflow, also author a test case
- treat tests as executable documentation of the intended flow
- prefer mocked service interactions during development
- understand the target external interaction before building the workflow
- keep reusable processor logic in resource files so it can be unit tested separately
Choose the right test path:
- use the test harness or
opscotch-testrunner-singlefor workflow integration tests - use
opscotch-resource-testkitfor JavaScript resource unit tests - for local harness runs, resolve
resourceDirsandtestDirsrelative to the test runner working directory, not the executable path or config path
Primary provenance:
docs/src/llm/processed/introduction/getting-started-full.md->https://docs.opscotch.co/docs/current/introduction/getting-started-fulldocs/src/llm/processed/administrating/testing.md->https://docs.opscotch.co/docs/current/administrating/testing
Packaging, Cryptography, And Licensing
Packaging guidance:
- package workflows as
.oappwhen you need immutable deployable artifacts - packaging is an HTTP API workflow, not a documented CLI flow
- resource files are loaded into the packaged workflow during packaging, so packaged apps do not depend on those files at runtime
- packaged updates require rebuild and redeploy
- unpackaged JSON workflow files can reload from disk without agent restart
- use
/workflow-compilewhen you need post-preprocessing JSON rather than a package artifact - use
/workflow-hashwhen you need a stable pre-deploy comparison point - use
/package-envelopewhen you need a new outer signature or encryption envelope without rebuilding the inner workflow package
Cryptography guidance:
- use
CryptoContextwithByteContext - register or preload keys for the correct
purposeandtype - keep keys out of logs
- use signatures for authenticity, authenticated encryption for confidentiality plus sender identity, anonymous encryption for recipient-only secrecy, and symmetric encryption for shared-secret cases
Licensing guidance:
- the current model supports centrally managed hierarchical licensing instead of requiring embedded licenses in every package
- runtimes can obtain licensing from a licensing app through bootstrap licensing settings
- embedded package licensing still exists in the documented 3.1.1 material, but is described as a legacy path
Primary provenance:
docs/src/llm/processed/administrating/packaging.md->https://docs.opscotch.co/docs/current/administrating/packagingdocs/src/llm/processed/administrating/cryptography.md->https://docs.opscotch.co/docs/current/administrating/cryptographydocs/src/llm/processed/administrating/licensing.md->https://docs.opscotch.co/docs/current/administrating/licensingdocs/src/llm/processed/blog/2026-03-24-packaging.md->https://docs.opscotch.co/blog/packagingdocs/src/llm/processed/blog/2026-03-24-licensing.md->https://docs.opscotch.co/blog/licensingdocs/src/llm/processed/blog/2025-11-08-crypto-context.md->https://docs.opscotch.co/blog/crypto-context
Working Loop
Use this loop when building or modifying an Opscotch solution:
- Check feasibility against supported triggers, inputs, outputs, and processor constraints.
- Decide what belongs in bootstrap versus workflow.
- Discover the exact context functions, patterns, and schemas before assuming behavior.
- Build the smallest working slice first.
- Validate the most specific object shape available.
- Test behavior separately from schema validity.
- Package, license, and deploy only after the workflow behavior is already grounded.
Primary provenance:
docs/src/llm/processed/docs/workflow.md->https://docs.opscotch.co/docs/current/workflowdocs/src/llm/processed/introduction/getting-started-full.md->https://docs.opscotch.co/docs/current/introduction/getting-started-fulldocs/src/llm/processed/administrating/testing.md->https://docs.opscotch.co/docs/current/administrating/testingdocs/src/llm/processed/administrating/packaging.md->https://docs.opscotch.co/docs/current/administrating/packaging