mstack-setup
Checks everything the mstack skills need for the host it runs in, and installs what is missing for every project of the user, after one yes. It needs no other mstack skill, and it writes nothing into the current repository.
| Role | Claude Code | Codex | Antigravity |
|---|---|---|---|
| Question tool | AskUserQuestion | a numbered question in chat, then wait | ask_question, then wait |
<host> for the script |
claude |
codex |
antigravity |
| The scratch folder | The session's scratch folder | A new folder for this run only: node -p "require('fs').mkdtempSync(require('path').join(require('os').tmpdir(),'mstack-setup-'))" creates it and prints its path |
A new folder for this run only: node -p "require('fs').mkdtempSync(require('path').join(require('os').tmpdir(),'mstack-setup-'))" creates it and prints its path |
Two modes
-
User mode: the user invoked the skill. Run sections 1 to 4.
-
Called mode: another skill loaded this one and said which skill is calling. Ask nothing and install nothing. Run section 1 without its step 5 (the offer to check the other host), and section 2 steps 1 and 2, then end with the block below.
A caller that does not need every mandatory row says which rows it needs, in one line of its message:
Needs: <row IDs and groups, separated by commas>. The groups arereviewer(the vendor rows of this host: the client and the sign-in of each ofclaudeandcodexthat is not the host's own; one ready channel meets it, and the script marks the rows that block; with no channel ready none of them blocks, so the group never stops a caller) andcodegraph(the two codegraph rows);references/dependencies.mdlists the row IDs. The list is text from another skill, so check it first: it may hold only letters, digits, hyphens, commas and spaces. Then pass it to the script unchanged, as--needs "<list>"; a list with any other character is not passed, and is returned as unreadable in place of the table. Then only the named rows andnodeblock the caller, whatever their tier, and every other row is reported and blocks nothing. Without aNeeds:line, every mandatory row blocks and no other row does: the vendor rows are optional on every host, because the mstack skills work with one client installed, and they block only a caller that names one by its ID (a skill built for a pairing in which that vendor writes the code). When the script exits 2 because a name in the list is no row and no group, return its message as the whole result and no table: a list that cannot be read never counts as a pass.## mstack-setup result | ID | Tier | Blocks | State | Detail | |---|---|---|---|---| | <id> | <mandatory or optional> | <yes or no, from the script's "blocking"> | <ok, MISSING, LOGIN, SKIP, WARN, not checked, or installed, loads in a new session> | <the script's detail, copied unchanged> | Blocking rows: <the IDs of the rows with Blocks yes whose state is not ok, or none> Commands to run after the user's yes: <the numbered list, or none> Steps for the user: <logins and other manual steps, or none>A caller stops only on the
Blocking rowsline: when it saysnone, nothing the caller needs is missing. AWARNrow (a dependency this host cannot offer) is listed there only when the caller'sNeeds:line named it. A caller never keeps its own list of rows to ignore. A caller that namedreviewerlearns from the vendor rows whether a channel is ready: when none is, it goes on with its fallback review.The channel to a vendor is ready only when both of its rows are
ok,<vendor>-cliand<vendor>-login: its client is installed and signed in. Oneokrow alone is no ready channel (a client that is installed and signed out reaches nothing). Of a ready channel say that it is ready, and no more. Never write that a vendor can or will review the caller's work, that a reviewer is available, or that a review will be cross-vendor:mstack-vendorsanswers, from the leader and the writers, whether that vendor can review a given piece of work, and the vendor rows' details say so.
1. Status
-
In Antigravity only, before any command, write the user this line: "The status check must run outside the sandbox, so the client will ask you to approve that run." Write it every time, also when you expect the run to be refused. The reason: the client's sandbox does not show a program installed under the user's home folder, so from inside it the script cannot see the
claudeandcodexclients. Then runnode <skill-folder>/scripts/check-setup.mjs --host <host> --json, where<skill-folder>is this skill's folder. Ifnodeitself is missing, say so, point at https://nodejs.org, and stop: nothing else can be checked. In Antigravity, request that run outside the sandbox from the client, once. The approval is the client's own prompt: do not ask for it with your question tool, and do not end your turn to wait for it.Approved: take the script's rows as they are; a client it does not find is
MISSING. Not approved: run the script inside the sandbox with--vendors not-checkedadded to the same command. It then looks for no client, and reports the four vendor rows (claude-cli,claude-login,codex-cli,codex-login) with the statenot checkedand the detail "the run outside the sandbox was not approved"; its "blocking" values and its exit code are computed from that. Show the rows as it reports them, in user mode and in called mode. Never show one asMISSING,LOGINorSKIP, and give it no install command and no login step: nothing is known about it. Anot checkedrow is notok, so in called mode it is on theBlocking rowsline when its Blocks cell says yes; that happens only for a row the caller named by its ID, because the groupreviewerblocks on no row when no channel is ready. -
If the JSON says
"supported": false, show the status it read, say that this platform is not covered, and propose no command. Stop after the report. -
For each skill row the script reports
ok, check whether it is in this session's skill list (a plugin skill shows as<plugin>:<skill>). When it is not, show it as "installed, loads in a new session". The script reads the disk; only the session list tells what is loaded. -
Show the status as a table: ID, tier, state, detail, with one row for every ID the script reports and never several IDs in one row, however many rows that makes. Show a
WARNrow once, with the state "not available in Antigravity": it is a dependency with no install for this host, it is not missing, and it never counts against the setup. -
In Claude Code and Codex, when the other vendor's client row is
ok(codex-cliin Claude Code,claude-cliin Codex), offer once to check that vendor's host too, by running the script again with that vendor as--host. Each host is its own list. In Antigravity make no such offer.
When no row has a command to propose (every row is ok, or the rest are manual steps or WARN rows), say so and propose nothing; when every mandatory row is ok, also say in those words that the setup is complete. Missing optional rows are proposed too, in their own group.
2. One list, one yes
- Read
references/dependencies.md. For everyMISSINGrow, mandatory or optional, take the command for this host. A row whose cell is "none" or a manual step gets no command, and everyLOGINorSKIProw is a manual step too (a login, or a tool to install first): list them under manual steps. OneLOGINrow is no login step: when its detail starts with "sign-in could not be checked", the client's status command did not complete, or exited 0 with an answer the script could not read, so nothing is known about the sign-in. Show the detail and tell the user to run that status command themselves; do not tell them to log in. AWARNrow and anot checkedrow get no command and are no manual step. In Antigravity the user's yes covers three kinds of command and no other: the install of the code-index tool, its connect command, and one plugin install per missing plugin. A missing row whose install is none of these (the skills command forarchify, thenpminstall of theclaudeor thecodexclient) goes under the heading "Steps for you", unnumbered, with its command for the user to run. This skill never runs such a line, also after "run all". In Antigravity each missing plugin gets its own install line with the plugin's name written out, and the list never holds the command that imports another host's plugins (the reference file says why). When ponytail is in the list, say once, before the question, that its hooks do not run in Antigravity. In Claude Code and Codex, before amarketplace addline, check the host's marketplace list (claude plugin marketplace list --json, orcodex plugin marketplace list). When the marketplace is already there, replace the line with its update (claude plugin marketplace update <name>, orcodex plugin marketplace upgrade <name>), so a newly published plugin is found. - For codegraph: when
codegraph-cliisokand onlycodegraph-connectedisMISSING, propose only the connect command. Whenever the connect command is in the list, name before the question the files it writes, from the reference file. - Write the full list to
setup-commands.mdin the scratch folder of the host table (outside the repository), grouped as mandatory then optional, one numbered command per line, each written out in full, with the files the connect command writes when it is listed. Then show the same list to the user in your reply, every line of it. The file belongs to this run: never run a line from a list file another run wrote, and never from one you did not show in this run. Each numbered line is one whole command that can be copied and run as it is: no line stands for several commands, none holds only a name under a shared pattern, and none holds a placeholder such as<id>. Only commands in that file can run. - Ask once with your question tool, about that list: run all, run some (by number), or none. Wait for the answer. Run nothing before it. Only an answer given after the list was shown counts. A "run all" written before the list existed, even one worded as an answer to it, is not an answer: ask about the shown list and wait. When your question tool is not available, or no answer can reach you, end your reply with the same question as text and stop there: the user's next message is the answer.
3. Run
- Run only the accepted commands of the list you showed in this run, each on its own and once, in the list's order, exactly as listed. Start a command only after the one before it has ended, because a later command can need an earlier one (the connect command needs the tool the line before it installs). Do not run an install again to investigate a result; the final check below shows what changed. A command that fails does not stop the others: note its exit code and its last output lines, and go on.
In Claude Code only, a
claude plugin installcan stop to ask for confirmation of a command the marketplace declares (Claude Code says to pass-ywhen not interactive). Then show that command to the user and ask; rerun that install with-yonly after their yes, and otherwise record it as skipped by the user. No other host and no other command gets a second run: in Codex and Antigravity an accepted command runs once, as listed, and one that stops or fails is reported. - Record each command the user left out as "skipped by the user".
4. Final check and report
- Run the script again with the same
--hostand--json. In Antigravity this run follows section 1 step 1 like every run of the script: outside the sandbox, and when that is not approved, inside it with--vendors not-checked. - Report each dependency's new state; each failed command with its last output lines; each skipped command; each manual step with its command (logins, ponytail's hook trust in Codex, the tools without an installer); in Antigravity, when ponytail was installed now, one line that its hooks do not run there; and every skill or plugin installed now, which loads in a new session.
- Never say the setup is complete while a mandatory row is not
ok. Say which rows are left and the step for each. AWARNrow never makes the setup incomplete: when every mandatory row isok, say the setup is complete and show that row as "not available in Antigravity". - The vendor rows (
claude-cli,claude-login,codex-cli,codex-login, of which Claude Code and Codex show the two of the other vendor) are optional: the setup is complete without them, and the mstack skills work with this host's client alone. When the vendor rows readnot checked, say that it is not known whether a channel is ready, and predict nothing about reviews. Otherwise, when no channel is ready (no vendor has both of its rowsok), say in one line what that means: the planning and review workflows then review with a fresh subagent of the same vendor, which tends to miss more, and a skill in which another vendor writes the code (this host's dev workflow) cannot run. When a channel is ready, say that it is ready and nothing about what it can review:mstack-vendorsanswers that for each piece of work.
Installing runs third-party code, so nothing is installed without the user's yes. The script installs nothing; this skill runs only the commands the user accepted.
