/kairos:bootstrap [deployment URL]from kairos
Wire this repo and engineer to a Kairos deployment — MCP endpoint config, auth check, repository detection from the git remote, board discovery, and the wiring (a project entry in ~/.config/kairos/config.toml).
Ships in kairos. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Connect the current repo to a Kairos deployment so every other kairos skill (and the SessionStart hook) knows which repository this checkout is (KAIROS-A-0019) and which board is the queue: the delivery board of the team of the principal that connects (COLLIERY-A-0023). Idempotent: re-running updates the existing configuration in place.
The MCP connection belongs to the user, not to the repository. The default is the server of the plugin (agent-key path) or a user-scope entry (OAuth path). Write a project .mcp.json, or run claude mcp add with the local or project scope, only when the user asks for a connection in this repository only, for example for a second deployment. Do not write one to fix a connection that does not answer: find the cause (step 1, at the end).
On a re-run, recover what is already known before asking: KAIROS_URL, the kairos entries of claude mcp list, and kairos config show (the project entry and [default]; each value names its source). Ask the user only for what is missing or being changed (or take it from the arguments):
https://acme.kairos.example or http://localhost:41080. Strip any trailing slash. The MCP endpoint is <deployment-url>/mcp.X-Tenant header on every request.Check the deployment before you write anything. Fetch <deployment-url>/healthz and expect ok. Then fetch <deployment-url>/api/config, which needs no authentication. If a fetch fails, show the user what failed, confirm the URL with them, and stop.
Read issuer and local_auth in the /api/config response. They decide the path:
issuer | local_auth | Path |
|---|---|---|
| a URL | false or absent | OAuth, if the authorization server lets the MCP client register (below). Else agent key. |
null | true | Agent key. OAuth is not available. Tell the user, then do AGENT-KEY.md in place of step 2. |
| a URL | true | OAuth is the default, if the authorization server lets the MCP client register (below). The agent-key path is the alternative for an agent that must run with no browser. |
When issuer is a URL, check that the MCP client can register before you choose OAuth:
<deployment-url>/.well-known/oauth-protected-resource/mcp. It is the RFC 9728 metadata that names the authorization server, in authorization_servers.<server>/.well-known/oauth-authorization-server (RFC 8414). If that fails, fetch <server>/.well-known/openid-configuration.registration_endpoint (RFC 7591 dynamic client registration). The MCP client registers itself there before the browser flow.If there is no registration_endpoint, the MCP client cannot register, and the browser flow fails with "Incompatible auth server: does not support dynamic client registration". Google is such a server. Tell the user, then do AGENT-KEY.md in place of step 2. Do not write a kairos entry with no Authorization header, and do not run claude mcp add for it.
Before you write any MCP config, look for the kairos server of the plugin. It is plugin:kairos:kairos in claude mcp list, and its tools are mcp__plugin_kairos_kairos__*. It reads KAIROS_URL and KAIROS_MCP_KEY from the environment, and connects in each repository with no file in the repository. If it answers whoami, the connection is complete: write no MCP config, and continue with step 3.
On a re-run, a kairos entry with an Authorization header shows the agent-key path. Do not change it to OAuth and do not add a second kairos entry. If the kairos tools answer, continue with step 3. If the session has no kairos tools, or each call fails, look for the cause before you change the config. The kairos server of the plugin runs kairos mcp-proxy: its instructions in /mcp, or the error of a call, name the fault. Run kairos config show in the session folder: it gives the deployment of the folder and the source of each value.
kairos is not on PATH. Tell the user to install the CLI, then start a new session.mcp-proxy. Tell the user to run kairos self-update, then start a new session.kairos config show gives no deployment, KAIROS_URL is not set, and the CLI has no login, or more than one. Write the project entry (step 4), or tell the user to run kairos login --url <deployment>.config.toml does not parse: kairos config show refuses and names the file. Show the user the message and the path that kairos config path gives, and let the user correct the file.KAIROS_URL names a different deployment from the project entry. KAIROS_URL comes first, and kairos config show says so. Tell the user to correct or unset it, then start a new session.KAIROS_MCP_KEY is not set in the session, or the key is revoked, expired, or of a different deployment. Tell the user to set a key of this deployment (AGENT-KEY.md) and start a new session..claude/kairos.local.md. The file is retired: no command and no hook reads it, so its values do not bind the folder. With the user's go, run kairos config migrate in the checkout, check the result with kairos config show, and tell the user to remove the file..mcp.json. Tell the user to start Claude Code there.kairos in /mcp.kairos entry both connect. Each tool is there 2 times. Tell the user to remove the project entry, unless they asked for this repository only.kairos entry in .mcp.json, or claude mcp list shows one in the local scope, and the user did not ask for it. It is from an earlier bootstrap. Offer to remove it, and use the plugin server or a user-scope entry.kairos entry with no Authorization header in the user or local scope (claude mcp list) overrides the project entry. It is from an earlier OAuth attempt. Tell the user to remove it with claude mcp remove kairos -s user (or -s local).This step is for the OAuth path. On the agent-key path, AGENT-KEY.md writes the config.
Add a kairos entry in the user scope. It connects in each repository of the user, and it writes no file in the repository. Give the user this command:
claude mcp add --scope user --transport http kairos https://acme.kairos.example/mcp
With a dev tenant slug, append: --header "X-Tenant: <slug>". Always send --scope user: with no scope, claude mcp add writes the local scope, which is this repository only.
The plugin server has an Authorization header, which turns off the OAuth flow. On this path, KAIROS_URL stays unset, and the user can disable the plugin server in /mcp.
On a re-run, change the URL or the headers of the existing user-scope entry (claude mcp remove kairos -s user, then add it again). Do not add a second server.
Only when the user asks for this repository only (for example, a second deployment): create or update the kairos entry in the project .mcp.json of the repository root, and preserve other servers. Then ask the user: commit the file, or add .mcp.json to .gitignore.
{
"mcpServers": {
"kairos": {
"type": "http",
"url": "https://acme.kairos.example/mcp"
}
}
}
With a dev tenant slug, add: "headers": { "X-Tenant": "<slug>" }.
On the OAuth path, authentication is client-driven: the MCP client opens the browser flow the first time it connects — the skill never handles tokens. If the kairos MCP tools are not available in this session yet (config just written), tell the user to run /mcp to connect and authenticate, then re-run /kairos:bootstrap to finish; the re-run picks up here.
On the agent-key path, the agent key of the user authenticates the client and acts as the user (KAIROS-A-0024). AGENT-KEY.md is the only source for that path. The skill never handles the key.
Once connected:
whoami — confirms auth; names the principal (a person or a service account) and gives its org, teams, the repositories their teams own, and the boards where they hold capabilities.my_boards — boards grouped by level; the user's delivery boards are marked [mine] and include column names and per-column item counts.Run git remote get-url origin. Normalize the remote to (forge, full_name):
| Remote | forge | full_name |
|---|---|---|
[email protected]:acme/payments-api.git | github | acme/payments-api |
https://github.com/acme/payments-api | github | acme/payments-api |
[email protected]:acme/portal/web.git | gitlab | acme/portal/web |
https://gitlab.example.com/acme/web.git | gitlab (any host containing gitlab) | acme/web |
| anything else | other | path after the host, .git stripped |
Strip a trailing .git and any leading /. Then match on forge + full_name against list_repositories (the MCP directory carries both fields; whoami's repository list does not show the forge), or over HTTP with GET /api/repositories?forge=<forge>&name=<full_name> (items has one row or none).
slug is the repository. The repository is a link: it does not choose the team board. Confirm with the user only if the remote matched more than one entry (it cannot: the pair is unique).get_repository prints (no description yet). Offer to write one: draft it as in step 3 of "Add this repository", show it to the user, and on a yes call update_repository (repository, description).add_repository. See "Add this repository" below.--repository and say what unblocks it. Everything else still works; the session is just board-scoped instead of repo-scoped. With no remote, the entry of step 4 has path (see "A board folder, or a checkout with no remote").Do this when the directory does not have the repository of the checkout. add_repository is for a member of the owner team or an organization admin.
Owner team. One team in whoami → that team. More than one → ask the user which team owns this repository. No team → do not call the tool. Say that an organization admin must add the principal to a team, or add the repository. Leave out --repository.
Values from git.
| Argument | Source |
|---|---|
forge, repo_full_name | The normalized remote, from the table above. |
repo_url | The browser URL of the remote: https://<host>/<full_name>, with no .git and no credentials. |
default_branch | git symbolic-ref --short refs/remotes/origin/HEAD, without the origin/ prefix. If the command fails, ask the user. |
team | The slug of the owner team. |
slug | Omit it. Kairos makes the slug from the full name (acme/payments-api gives acme-payments-api). Send a slug only if the user wants a different one. |
Draft the description. It is the "how to work here" text that each agent reads with get_repository. Read the README and the task runner of the checkout (for example .angreal/, Makefile, justfile, the scripts of package.json). Write a short text: what the repository is, the commands to build, test and lint, and the rules for a branch and a pull request. Write only what the files say.
Show, then call. Show the user each argument and the full description. Call add_repository only after the user agrees. Use the text that the user agreed to.
Read the result. The result gives the slug: Added repository <slug>: …. That slug is the --repository of step 4.
If the tool refuses, tell the user the message and do not try again with different values of your own:
| Refusal | What to do |
|---|---|
FORBIDDEN | The principal is not a member of the owner team. The message names the team. Leave out --repository. |
CONFLICT | A repository has the slug already. Ask the user for a different slug. |
VALIDATION | The message names the value that is not correct. Correct it with the user. |
update_repository changes the description, the default branch, the URL, the slug and the owner team later; a new slug breaks the repository of the project entry of each checkout, so run this bootstrap again after it. delete_repository removes a repository from the directory.
The team board is the delivery board of the team of the principal that connects. The owner of the repository does not decide it.
whoami → that team is the delivery stream. Its delivery board is the team board: the [mine] delivery board in my_boards (the default slug is <team>-delivery).[mine].--delivery-stream and --team-board. Say that an organization admin must add the principal to a team.From the results pick, confirming with the user whenever there is more than one candidate:
my_boards, the ADR board that names the team (ADR board of the team <team>). If the team has no ADR board, the ADR board of the organization. A team ADR board is for the delivery ADRs of the team (COLLIERY-T-3102).If auth is declined or fails, or there are no boards yet (fresh tenant, no memberships): keep the step 2 config, proceed to step 4 regardless, and give in the report (step 5) what is missing and what unblocks it (authenticate via /mcp; on the agent-key path, set KAIROS_MCP_KEY; ask an org admin for team/board membership). Do not fail the bootstrap.
The wiring binds the repository to a deployment and to the boards of a team (KAIROS-A-0014). The SessionStart hook, the skills, the CLI and the kairos MCP server read it.
By default, write a [[project]] to the config of the user (#270). It is in ~/.config/kairos/config.toml, keyed by the origin remote, so every clone and worktree of the repository has it, and the repository gets no file and no ignore rule. Run this in the checkout, with the discovered values (leave out a flag whose value is unknown):
kairos config project --deployment https://acme.kairos.example --tenant acme --repository payments-api --delivery-stream platform --team-board platform-delivery --initiative-board initiatives --adr-board platform-adrs
The command adds the entry and keeps the rest of the file. If the file has an entry for the remote with other values, the command refuses: show the user kairos config show and the path that kairos config path gives, and let the user edit the entry. Check the result with kairos config show: each value says where it comes from.
When the kairos CLI is not on PATH, or it is older and has no config verb, stop and tell the user to install or update the CLI (kairos self-update), then run this bootstrap again. The plugin needs the CLI for its kairos server too.
Do not write .claude/kairos.local.md. The file is retired (KAIROS-T-0710), and no command and no hook reads it (KAIROS-T-0742). When a checkout has the file, run kairos config migrate with the user's go: it writes the values of the file to the project entry. Check with kairos config show, then tell the user to remove the file.
Use the slugs that my_boards and the directory give: repository is the slug (KAIROS-A-0019); team_board, initiative_board and adr_board are board slugs (what board_items resolves — never display names); delivery_stream and team_board come from the team of the principal, also when a different team owns the repository. Leave out a flag whose value is not known.
A board folder holds the clones of a team and is not a git checkout. A checkout with no origin remote has no remote to match. In these folders, kairos config project writes a [[project]] with path, the folder (KAIROS-T-0707). Do not write [default]: [default] binds no folder, so the hooks stay silent there.
Leave out --repository: a board folder holds more than one repository, and a checkout with no remote has no match.
Run the command in the folder, with the board values:
kairos config project --deployment https://acme.kairos.example --tenant acme --delivery-stream platform --team-board platform-delivery --initiative-board initiatives --adr-board platform-adrs
Check the result with kairos config show: bound is true.
Write no .claude/kairos.local.md and no exclude: the folder gets no file.
The entry applies to the folder and to each folder below it. A clone under the board folder that has a [[project]] of its own uses its own entry. From the next session on, the SessionStart hook lists the clones of the board folder.
Tell the user: where the wiring is (the project entry in config.toml, from kairos config path), deployment/tenant, who they are connected as, the repository matched (or why not), the boards chosen, and — if anything was skipped (offline, unauthenticated, a repository that is not in the directory, boardless) — exactly what to do to finish. Mention that from the next session on, the SessionStart hook injects this wiring and pulls this repository's queue automatically.
On the agent-key path, tell the user these three facts also:
env section of the user's Claude Code settings, as KAIROS_MCP_KEY. It is in no file of the repository.kairos keys create, put it in KAIROS_MCP_KEY, then revoke the old key with kairos keys revoke <KEY_ID> --confirm: https://colliery-io.github.io/kairos/how-to/give-an-agent-your-key.html.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub colliery-io/kairos --plugin kairos28 skills in this plugin
/architecture-reviewReview the codebase's architecture — scan, classify by altitude, present deepening candidates as an HTML report, then grill through the one you pick./cancel-ralphStop the Ralph loop of this session, or of this folder after /clear. Then the Stop hook lets the session stop./codebase-designShared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary./code-reviewReview the changes since a fixed point (commit, branch, tag, or merge-base) along two axes — repo Standards and the originating Kairos item's Spec — and post the record back to the item. Use when the user wants to review a branch, a PR, or work-in-progress changes, or asks to "review since X"./decomposeBreak an initiative, plan, or PRD into independently-grabbable Kairos tasks using tracer-bullet vertical slices./diagnosing-bugsDiagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something broken/throwing/failing/slow.