Skip to content
Skills Library
DevOps & cloud · Learning & explanation

bai-agent

/bai-agent

Answer a Backend.AI question, or do a Backend.AI task, from this checkout with the `bai-agent` CLI — the manual, the GraphQL schema, the i18n stores and the live manager. Trigger on: what a Backend.AI concept, field or status value means ("what does session status PENDING mean", "what is a resource group", "what does this field mean"), "find it in the manual", "search the docs", "query the manager", "run a GraphQL query", "how many sessions are running", "show me my sessions / folders / agents / users", "give me the WebUI link for this session", "where do I see that folder in the WebUI", or "b

Licence
LGPL
Last repository change
28.10.2026

Assessment and security

85/ 100Class: good
Format20 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content25 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
2
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 28.10.2026, without references to retired models or APIs.

Licence

LGPL, otwarta.

What it does and when to use it

Answer a Backend.AI question, or do a Backend.AI task, from this checkout with the `bai-agent` CLI — the manual, the GraphQL schema, the i18n stores and the live manager. Trigger on: what a Backend.AI concept, field or status value means ("what does session status PENDING mean", "what is a resource group", "what does this field mean"), "find it in the manual", "search the docs", "query the manager", "run a GraphQL query", "how many sessions are running", "show me my sessions / folders / agents / users", "give me the WebUI link for this session", "where do I see that folder in the WebUI", or "b

Triggers from the description

what does session status PENDING meanwhat is a resource groupwhat does this field meanfind it in the manualsearch the docsquery the managerrun a GraphQL queryhow many sessions are running
Original author description

Answer a Backend.AI question, or do a Backend.AI task, from this checkout with the `bai-agent` CLI — the manual, the GraphQL schema, the i18n stores and the live manager. Trigger on: what a Backend.AI concept, field or status value means ("what does session status PENDING mean", "what is a resource group", "what does this field mean"), "find it in the manual", "search the docs", "query the manager", "run a GraphQL query", "how many sessions are running", "show me my sessions / folders / agents / users", "give me the WebUI link for this session", "where do I see that folder in the WebUI", or "b

How it works

  1. Preflight
  2. Answer, or link
  3. Neighbours
  4. Gotchas the CLI cannot warn you about
  5. Cookbook
  6. Keeping this in sync (maintainers, in a checkout)
Original SKILL.md headings · 106 lines, 1,229 words
SKILL.md preview
---
name: bai-agent
description: >
  Answer a Backend.AI question, or do a Backend.AI task, from this checkout with the
  `bai-agent` CLI — the manual, the GraphQL schema, the i18n stores and the live manager.
  Trigger on: what a Backend.AI concept, field or status value means ("what does session
  status PENDING mean", "what is a resource group", "what does this field mean"),
  "find it in the manual", "search the docs", "query the manager", "run a GraphQL query",
  "how many sessions are running", "show me my sessions / folders / agents / users",
  "give me the WebUI link for this session", "where do I see that folder in the WebUI",
  or "bai-agent".
  Use `backend-ai-guide` instead for platform architecture with no live data, and
  `docs-lead` for writing the manual rather than reading it.
---

# bai-agent

`bai-agent` answers Backend.AI questions from a WebUI checkout — the one you
are in, or the data copy `bai-agent init` synced — and points the user at the
WebUI page for what it found. The workflow contract is the generated
`BAI-AGENT` block: in a checkout it is in `CLAUDE.md`, and an installed copy
of this skill carries it as `references/agent-block.md`. Read it there, it is
not repeated here. This file is the parts the CLI cannot tell you: when to log
in, when to answer versus link, and which neighbour owns what.

## Preflight

Run `bai-agent doctor --brief` once, from wherever you already are — never
`cd` first. It is the one-step preflight: checkout-vs-synced-data and
session/auth in one line each. Fall back to `bai-agent doctor --json` only
when you need a specific field out of it. Run `bai-agent whoami` only when
the auth check is `warn`.

The workflow contract is already loaded: in a checkout it is the `BAI-AGENT`
block in `CLAUDE.md`; installed, it is `references/agent-block.md`. Read
whichever applies — don't `cat` it unless the block is absent — and don't grep
for a CLAUDE.md outside a checkout; there isn't one.

**When `whoami` says `auth_required` (exit 3):**

- Get the endpoint and the account from the **`webui-connection-info`** skill
  (`fw` plugin; it reads the team's dev server catalog). Without that skill,
  the endpoint is the one `init` recorded (`doctor` prints it). Never ask the user for a password, and never put one in a
  command.
- Browser on this machine: `bai-agent login --endpoint <url>`, then confirm on
  the `/cli-login` page it opens. That page is the WebUI's; in a checkout it
  is the dev server, elsewhere the endpoint's own origin — pass
  `--webui <origin>` when the UI lives somewhere else.
- Browser anywhere else, or a tunnelled/HTTPS tab: `bai-agent login --paste
--endpoint <url>` and paste the session id the page reveals.
- `bai-agent logout` when you are done with a borrowed session.

**`search`, `docs show`, `schema show` and `explain` need no session at all.**
A "what does X mean" question never requires logging in — go straight to it.

## Answer, or link

| The user wants                                           | Do this                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| -------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| to understand a status value ("what does status X mean") | Try `explain <Type>.<field>=<VALUE>` first — e.g. `explain ComputeSessionNode.status=PENDING`, `explain UserNode.status=before-verification`. Fall back to `explain <Type>.<field>` (no value) or `docs show` for a term or field in general.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| to understand a term or field                            | `explain` (meaning) or `docs show` (the manual). Answer in the words the UI uses, and cite the deployed-docs `url` the CLI returned.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| a count, a list, a value                                 | Start every live query from `bai-agent cookbook <root field>` (or `--list`) — never search the filesystem for the cookbook; a `schema_mismatch` error names the entry to read. Adapt it, never invent a shape. Summarise the rows; do not paste the raw envelope.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| to see it, or act on it                                  | Give the `webui_url` (or `webui_path`) `query` already annotated onto the row, under `data.links`, so the user can open it themselves. **Say so when the link carries `requires`** — `admin` / `superadmin` / `projectAdmin` is the role that page gates on, so hand it over as "…, which is admin-only" rather than as a link that may bounce them; no `requires` means any signed-in account can open it. When you post-process the `--json` envelope yourself, also print `data.links` — the link must reach the user. Never describe a click path you could report directly. If `data.links` is empty for a result, say the resource has no addressable page — do not compose a path by hand, not even for a field whose rows are plainly the caller's own (`myKeypairs` gets no link because the only keypair list is the admin-only credentials tab); but a row carrying `webui_link_hint` instead means the id you selected cannot build one, so re-run selecting `row_id`. When several rows share a name, pick the link by `id`, never by name. |
| something destructive                                    | Give them the `hint` page from the refusal and stop. A `mutation_refused` (exit 4) is the answer, not an obstacle to route around.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |

`explain` prints `MISSING` for a piece nothing curates. Say it is not documented
and offer the SDL entry — never fill the gap from memory. If the answer would be
better as a curated sentence, that is a `mappings/<Type>.yaml` change, not a
guess at runtime.

## Neighbours

| Skill                                 | Owns                                                                                                              | Not this                                                                                                  |
| ------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
| `webui-connection-info` (`fw` plugin) | Which dev server is up and its URL; which dev Backend.AI server and test account to use, from the team's catalog. | It does not read data — it tells you where to point `login`.                                              |
| `backend-ai-guide`                    | Backend.AI architecture and product Q&A with no live data: what Sokovan is, how the agent talks to the manager.   | The moment the question is about _this_ deployment's data or a schema field's meaning, it is `bai-agent`. |
| `docs-lead`                           | Writing and maintaining the user manual, terminology, translations, screenshots.                                  | Reading the manual to answer a question is `bai-agent search` / `docs show`.                              |
| `bai-cli` (backend repo)              | `./bai`, the backend's own REST CLI, inside a `backend.ai` checkout.                                              | In **this** repo use `bai-agent`; `./bai` does not exist here.                                            |

## Gotchas the CLI cannot warn you about

- **Search in English UI terms.** The index is English-only. A Korean or
  Japanese query is normalised through the i18n stores, not translated, so
  "Resource Group" beats "scaling group" and both beat a paraphrase.
- **One pagination mode per connection.** `first`+`after` XOR `last`+`before`
  XOR `limit`+`offset`. The local SDL accepts a mix; the `*V2` connections
  reject it at runtime (the checkout's `.claude/rules/graphql-pagination.md`).
- **`--allow-mutation` is not a bypass.** The field must also be on the CLI's
  mutation allow-list (`src/mutation-allowlist.ts` in the package). Widening
  that list is a reviewed PR, never an in-session decision.
- **Session detail views share one URL.** `/session?sessionDetail=<id>` is a
  drawer, the only addressable surface — there is no per-row session link to
  offer beyond that.

The block's RULES apply beyond these (session file, empty `data.links`, no
React source in a synced copy, never `cd` before `doctor`, and more) — read
them there rather than restated here.

## Cookbook

`bai-agent cookbook --list` names every entry; `bai-agent cookbook <n>` and
`bai-agent cookbook <root field>` print one, prose and document. That command
is how you read it — it locates the file itself, so never search the
filesystem for a path and never `cat` one. The entries are 11 documents that
validate against the SDL, one per resource, plus the allow-listed mutation and
the refused destructive one; a test re-validates them, so a stale one fails CI,
not a user. Maintainers edit
`packages/backend.ai-agent-cli/skill/references/query-cookbook.md`.

## Keeping this in sync (maintainers, in a checkout)

Re-run `pnpm --filter backend.ai-agent-cli build && pnpm run bai-agent init
--features agents --write` after any change to the CLI, and re-sync the
`BAI-AGENT` block in `CLAUDE.md`. This directory ships in the npm package
as-is, so an installed copy updates on the next `bai-agent init`; it is not
a repository-level skill — install it with `bai-agent init --skill`. Rules
are linked from here, never copied: if you find
yourself restating what `manifest --json`, the block or `--help` already
says, delete it instead.
Files in this package (2)
  • SKILL.md 14 KB
  • references/query-cookbook.md 8 KB

Versions

The database has no other skills named bai-agent.

Database snapshot: 13.11.2026 · package version d619804000e3 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100docs-lead
    Use whenever the user mentions docs, the manual, documentation, terminology, translations, or screenshots — including indirect mentions like "이 PR 문서 영향 봐줘", "문서 점검", "용어 통일", "/docs-lead", or any phrasing about updating the Backend.AI WebUI user manual under…
  • 100backend-ai-guide
    Expert guide for Backend.AI distributed computing platform. Automatically activates when users ask about: - Backend.AI architecture, components (Manager, Agent, Storage Proxy, Webserver, App Proxy) - Features (session scheduling, Sokovan orchestrator, multi-tenancy, resource…
  • 82webui-reference
    Use when writing or reviewing WebUI application or framework code. Load the application's installed reference or the WebUI source checkout's canonical reference.
  • 100graphql-inspector-ci
    Use when setting up GraphQL Inspector in CI/CD pipelines, GitHub Actions, or GitLab CI for automated schema validation.
  • 95webui-page-builder
    Guide users to create, develop, hide, or delete WebUI page plugins that appear in the WebUI left navigation under Home, with live preview and no restart required. Also guide development of page-scoped backend APIs through the WebUI Page Backend API Runtime when built-in APIs are…
  • 90aionui-webui-setup
    AionUi WebUI configuration expert: Helps users configure AionUi WebUI mode for remote access through the settings interface. Supports LAN connection, Tailscale VPN, and server deployment. Use when users need to set up AionUi WebUI, configure remote access, troubleshoot WebUI…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.