skills/xsai/SKILL.md
Use this skill when the user is building with `xsai` or any `@xsai/*` package, or is evaluating xsAI for a small OpenAI-compatible workflow with text generation, streaming, tool calling, structured output, embeddings, image generation, speech synthesis, or transcription.
npx skillsauth add moeru-ai/xsai xsaiInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Use this skill for xsai code, package selection, API selection, canonical examples, and positioning.
xsai or any @xsai/* package.xsai with larger SDKs such as ai or pi and wants the tradeoffs framed clearly.xsai versus granular @xsai/* imports unless the user asks to change them.xsai package only when the user needs several features at once or explicitly wants one dependency.references/recipes.md first and start from the closest canonical example.baseURL and model explicitly. For hosted providers, show apiKey wired from process.env in Node.js and from localStorage in the browser; omit it only when the target endpoint truly does not need one. Do not recommend hardcoding secrets.@xsai/generate-text over xsai.references/recipes.md when the user wants code, edits xsAI code, or needs a canonical minimal example.references/package-selection.md when the user needs help choosing between xsai and granular packages.references/text-stream-tools.md for generateText, streamText, tool calling, and common chat options.references/structured-output.md for generateObject, streamObject, tool(), rawTool(), or schema guidance.references/media-and-embeddings.md for embeddings, image generation, speech, or transcription.references/extensions.md only when the user explicitly needs xsAI extensions such as predefined providers, the OpenAI Responses API, or OTEL telemetry.generateText for unary text generation.streamText for incremental text, reasoning deltas, tool events, or lightweight agent loops.generateObject for validated structured output.streamObject when the user needs incremental object parsing.tool() when the user has a Standard Schema library such as Zod or Valibot.rawTool() when the user already has raw JSON Schema.Tool object only when the repo already uses that shape or when avoiding tool()'s async setup matters.baseURL and model are usually required in practice for xsAI calls.apiKey is provider-dependent. Most hosted providers need it; local or proxy endpoints may not. In Node.js, prefer process.env. In browsers, prefer reading from localStorage. Do not recommend hardcoding API keys.streamText() returns immediately; callers consume textStream, fullStream, and result promises asynchronously.streamObject() is async because schema conversion happens before streaming starts.stopWhen controls repeated tool-use loops with explicit stop predicates such as stepCountAtLeast() and hasToolCall().generateObject(), streamObject(), and tool() rely on xsschema; some schema vendors need extra JSON Schema converter packages.ai or pi, focus on size, runtime portability, OpenAI-compatible scope, and simpler primitives. Do not oversell feature breadth.https://xsai.js.org/docstools
Use when work should span one or more detached tasks but still behave like one job with a single owner context. TaskFlow is the durable flow substrate under authoring layers like Lobster, ACPX, plugins, or plain code. Keep conditional logic in the caller; use TaskFlow for flow identity, child-task linkage, waiting state, revision-checked mutations, and user-facing emergence.
tools
# Lobster Lobster executes multi-step workflows with approval checkpoints. Use it when: - User wants a repeatable automation (triage, monitor, sync) - Actions need human approval before executing (send, post, delete) - Multiple tool calls should run as one deterministic operation ## When to use Lobster | User intent | Use Lobster? | | ------------------------------------------------------ | --------------------------
tools
# Lobster Lobster executes multi-step workflows with approval checkpoints. Use it when: - User wants a repeatable automation (triage, monitor, sync) - Actions need human approval before executing (send, post, delete) - Multiple tool calls should run as one deterministic operation ## When to use Lobster | User intent | Use Lobster? | | ------------------------------------------------------ | --------------------------
tools
A CLI tool for making authenticated requests to the X (Twitter) API. Use this skill when you need to post tweets, reply, quote, search, read posts, manage followers, send DMs, upload media, or interact with any X API v2 endpoint.