agentleFS
alint-devalint-dev/alint/.agents/skills/xsai/SKILL.md

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
  1. Very specific:

    Use this skill for xsai code, package selection, API selection, canonical examples, and positioning.

    line 8
  2. Distinctive:

    If the user has not chosen xsAI yet, confirm the task fits an OpenAI-compatible surface before recommending it.

    line 28
  3. Very specific:

    Prefer the smallest package that solves the task.

    line 29
  4. Very specific:

    When writing or editing code, read references/recipes.md first and start from the closest canonical example.

    line 30
  5. Very specific:

    Keep examples minimal and runnable.

    line 31
  6. Distinctive:

    Keep recommendations aligned with xsAI's scope: OpenAI-compatible, Fetch-based, runtime-portable, and intentionally narrow.

    line 33
  7. Very specific:

    If the user is optimizing for bundle or install size, explicitly prefer granular packages such as @xsai/generate-text over xsai.

    line 34
  8. Distinctive:

    If the user asks for broader provider abstraction, say xsAI intentionally does not optimize for that.

    line 35
  9. Very specific:

    Read references/recipes.md when the user wants code, edits xsAI code, or needs a canonical minimal example.

    line 39
  10. Very specific:

    Read references/package-selection.md when the user needs help choosing between xsai and granular packages.

    line 40
  11. Very specific:

    Read references/text-stream-tools.md for generateText, streamText, tool calling, and common chat options.

    line 41
  12. Very specific:

    Read references/structured-output.md for generateObject, streamObject, tool(), rawTool(), or schema guidance.

    line 42
  13. Very specific:

    Read references/media-and-embeddings.md for embeddings, image generation, speech, or transcription.

    line 43
  14. Very specific:

    Read references/extensions.md only when the user explicitly needs xsAI extensions such as predefined providers, the OpenAI Responses API, …

    line 44
  15. Very specific:

    Use generateText for unary text generation.

    line 48
  16. Very specific:

    Use streamText for incremental text, reasoning deltas, tool events, or lightweight agent loops.

    line 49
  17. Very specific:

    Use generateObject for validated structured output.

    line 50
  18. Very specific:

    Use streamObject when the user needs incremental object parsing.

    line 51
  19. Very specific:

    Use tool() when the user has a Standard Schema library such as Zod or Valibot.

    line 52
  20. Very specific:

    Use rawTool() when the user already has raw JSON Schema.

    line 53
  21. Very specific:

    Use a plain Tool object only when the repo already uses that shape or when avoiding tool()'s async setup matters.

    line 54
  22. Very specific:

    When comparing with ai or pi, focus on size, runtime portability, OpenAI-compatible scope, and simpler primitives.

    line 70

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

xsAI

Use this skill for xsai code, package selection, API selection, canonical examples, and positioning.

Use xsAI when

  • The user is already using xsai or 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 xsai with larger SDKs such as ai or pi and 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 xsai versus 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 xsai package only when the user needs several features at once or explicitly wants one dependency.
  • When writing or editing code, read references/recipes.md first and start from the closest canonical example.
  • Keep examples minimal and runnable. Include 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.
  • 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-text over xsai.
  • If the user asks for broader provider abstraction, say xsAI intentionally does not optimize for that.

References

  • Read references/recipes.md when the user wants code, edits xsAI code, or needs a canonical minimal example.
  • Read references/package-selection.md when the user needs help choosing between xsai and granular packages.
  • Read references/text-stream-tools.md for generateText, streamText, tool calling, and common chat options.
  • Read references/structured-output.md for generateObject, streamObject, tool(), rawTool(), or schema guidance.
  • Read references/media-and-embeddings.md for embeddings, image generation, speech, or transcription.
  • Read references/extensions.md only when the user explicitly needs xsAI extensions such as predefined providers, the OpenAI Responses API, or OTEL telemetry.

API selection rules

  • Use generateText for unary text generation.
  • Use streamText for incremental text, reasoning deltas, tool events, or lightweight agent loops.
  • Use generateObject for validated structured output.
  • Use streamObject when 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 Tool object only when the repo already uses that shape or when avoiding tool()'s async setup matters.

Key constraints

  • 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.
  • xsAI is OpenAI-compatible-first. Do not imply support for non-compatible provider APIs.
  • 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.
  • 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 ai or pi, focus on size, runtime portability, OpenAI-compatible scope, and simpler primitives. Do not oversell feature breadth.

Docs

  • Public docs: https://xsai.js.org/docs

Download now (ZIP)

Trending

Steady: 0 new projects took it in the last 4 weeks, none the 4 weeks before.thin data

Week of Aug 30: 0 new projectsWeek of Sep 6: 0 new projectsWeek of Sep 13: 0 new projectsWeek of Sep 20: 0 new projectsWeek of Sep 27: 0 new projectsWeek of Oct 4: 0 new projectsWeek of Oct 11: 0 new projectsWeek of Oct 18: 0 new projects
Aug 2026Sep 2026Oct 2026
New projects taking a version of this file each week, over the 8 weeks our latest run read: only 0 in all, so this is a hint, not a trend.
  • Other versions3 projects use a version of this.

    Word for word · 2

    1. moeru-ai/airi★ 51k100% same
    2. moeru-ai/alint★ 123100% same

    Edited · 0

    None found.

    Wrote their own version · 1

    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.

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.