xsai
Skill123 starsChanged 3 months agoMITView on GitHub
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.
- Reads credentials
We split this skill into the rules it gives an agent
22 rules. About 0 are common, 3 are distinctive, and 19 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
19
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 8
Use this skill for xsai code, package selection, API selection, canonical examples, and positioning.
- Distinctive: line 28
If the user has not chosen xsAI yet, confirm the task fits an OpenAI-compatible surface before recommending it.
- Very specific: line 29
Prefer the smallest package that solves the task.
- Very specific: line 30
When writing or editing code, read references/recipes.md first and start from the closest canonical example.
- Very specific: line 31
Keep examples minimal and runnable.
- Distinctive: line 33
Keep recommendations aligned with xsAI's scope: OpenAI-compatible, Fetch-based, runtime-portable, and intentionally narrow.
- Very specific: line 34
If the user is optimizing for bundle or install size, explicitly prefer granular packages such as @xsai/generate-text over xsai.
- Distinctive: line 35
If the user asks for broader provider abstraction, say xsAI intentionally does not optimize for that.
- Very specific: line 39
Read references/recipes.md when the user wants code, edits xsAI code, or needs a canonical minimal example.
- Very specific: line 40
Read references/package-selection.md when the user needs help choosing between xsai and granular packages.
- Very specific: line 41
Read references/text-stream-tools.md for generateText, streamText, tool calling, and common chat options.
- Very specific: line 42
Read references/structured-output.md for generateObject, streamObject, tool(), rawTool(), or schema guidance.
- Very specific: line 43
Read references/media-and-embeddings.md for embeddings, image generation, speech, or transcription.
- Very specific: line 44
Read references/extensions.md only when the user explicitly needs xsAI extensions such as predefined providers, the OpenAI Responses API, …
- Very specific: line 48
Use generateText for unary text generation.
- Very specific: line 49
Use streamText for incremental text, reasoning deltas, tool events, or lightweight agent loops.
- Very specific: line 50
Use generateObject for validated structured output.
- Very specific: line 51
Use streamObject when the user needs incremental object parsing.
- Very specific: line 52
Use tool() when the user has a Standard Schema library such as Zod or Valibot.
- Very specific: line 53
Use rawTool() when the user already has raw JSON Schema.
- Very specific: line 54
Use a plain Tool object only when the repo already uses that shape or when avoiding tool()'s async setup matters.
- Very specific: line 70
When comparing with ai or pi, focus on size, runtime portability, OpenAI-compatible scope, and simpler primitives.
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 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
xsAI
Use this skill for xsai code, package selection, API selection, canonical examples, and positioning.
Use xsAI when
- The user is already using
xsaior any@xsai/*package. - The user is evaluating xsAI for an OpenAI-compatible integration.
- The target API is OpenAI-compatible.
- The user wants a small runtime or package footprint.
- The user needs text generation, streaming, structured output, or tool calling without a broad framework.
- The user is comparing
xsaiwith larger SDKs such asaiorpiand wants the tradeoffs framed clearly.
Do not use xsAI when
- The user needs a universal provider abstraction beyond OpenAI-compatible APIs.
- The user wants a batteries-included AI application framework.
- The task depends on provider-specific APIs that are not exposed through an OpenAI-compatible surface.
Default workflow
- First inspect the existing dependency and import style in the repo. Preserve
xsaiversus granular@xsai/*imports unless the user asks to change them. - If the user has not chosen xsAI yet, confirm the task fits an OpenAI-compatible surface before recommending it.
- Prefer the smallest package that solves the task. Use the umbrella
xsaipackage only when the user needs several features at once or explicitly wants one dependency. - When writing or editing code, read
references/recipes.mdfirst and start from the closest canonical example. - Keep examples minimal and runnable. Include
baseURLandmodelexplicitly. For hosted providers, showapiKeywired fromprocess.envin Node.js and fromlocalStoragein the browser; omit it only when the target endpoint truly does not need one. Do not recommend hardcoding secrets. - Preserve the project's existing schema library and provider wiring unless there is a clear reason to change them.
- Keep recommendations aligned with xsAI's scope: OpenAI-compatible, Fetch-based, runtime-portable, and intentionally narrow.
- If the user is optimizing for bundle or install size, explicitly prefer granular packages such as
@xsai/generate-textoverxsai. - If the user asks for broader provider abstraction, say xsAI intentionally does not optimize for that.
References
- Read
references/recipes.mdwhen the user wants code, edits xsAI code, or needs a canonical minimal example. - Read
references/package-selection.mdwhen the user needs help choosing betweenxsaiand granular packages. - Read
references/text-stream-tools.mdforgenerateText,streamText, tool calling, and common chat options. - Read
references/structured-output.mdforgenerateObject,streamObject,tool(),rawTool(), or schema guidance. - Read
references/media-and-embeddings.mdfor embeddings, image generation, speech, or transcription. - Read
references/extensions.mdonly when the user explicitly needs xsAI extensions such as predefined providers, the OpenAI Responses API, or OTEL telemetry.
API selection rules
- Use
generateTextfor unary text generation. - Use
streamTextfor incremental text, reasoning deltas, tool events, or lightweight agent loops. - Use
generateObjectfor validated structured output. - Use
streamObjectwhen the user needs incremental object parsing. - Use
tool()when the user has a Standard Schema library such as Zod or Valibot. - Use
rawTool()when the user already has raw JSON Schema. - Use a plain
Toolobject only when the repo already uses that shape or when avoidingtool()'s async setup matters.
Key constraints
baseURLandmodelare usually required in practice for xsAI calls.apiKeyis provider-dependent. Most hosted providers need it; local or proxy endpoints may not. In Node.js, preferprocess.env. In browsers, prefer reading fromlocalStorage. Do not recommend hardcoding API keys.- xsAI is OpenAI-compatible-first. Do not imply support for non-compatible provider APIs.
streamText()returns immediately; callers consumetextStream,fullStream, and result promises asynchronously.streamObject()is async because schema conversion happens before streaming starts.stopWhencontrols repeated tool-use loops with explicit stop predicates such asstepCountAtLeast()andhasToolCall().generateObject(),streamObject(), andtool()rely onxsschema; some schema vendors need extra JSON Schema converter packages.- xsAI is designed to stay small. Avoid recommending the umbrella package when a smaller package is enough.
Positioning
- Describe xsAI as an extra-small OpenAI-compatible runtime, not as a universal AI SDK.
- When comparing with
aiorpi, focus on size, runtime portability, OpenAI-compatible scope, and simpler primitives. Do not oversell feature breadth.
Docs
- Public docs:
https://xsai.js.org/docs
Trending
Steady: 0 new projects took it in the last 4 weeks, none the 4 weeks before.thin data
Other versions3 projects use a version of this.
Word for word · 2
- moeru-ai/airi★ 51k100% same
- moeru-ai/alint★ 123100% same
Edited · 0
None found.
Wrote their own version · 1
- moeru-ai/xsai★ 664same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository4 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- pnpmSkill
- simple-englishSkill
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.

