Build and run agent-generated TypeScript workflows for Opentrons Flex robots using this repository as the reference implementation. Use when users ask to discover robots, check status/health, inspect hardware, capture camera images, or compose protocol/run automation code.
Use this skill to generate practical, local-execution TypeScript for Opentrons Flex robots.
@y3rsh/flex-client as the default API layer.try/catch and actionable logging for operational clarity.packages/flex-client/README.mdpackages/flex-client/src/discovery/FlexDiscoveryClient.tspackages/flex-client/src/http.tspackages/flex-client/src/index.tspackages/flex-client/tests/When producing code for users:
main() function.FLEX_HOST, FLEX_PORT).import { FlexClient } from "@y3rsh/flex-client";
async function main(): Promise<void> {
const host = process.env.FLEX_HOST ?? "192.168.0.20";
const port = Number(process.env.FLEX_PORT ?? "31950");
try {
const robot = new FlexClient({ host, port });
const health = await robot.health.get();
console.log(JSON.stringify(health, null, 2));
} catch (error) {
const message = error instanceof Error ? error.message : String(error);
console.error(`[flex] operation failed at ${host}:${port}: ${message}`);
process.exitCode = 1;
}
}
void main();
For additional patterns and response shaping guidance, see:
references/REFERENCE.md