mcpField
M
mstack-setup

mstack-setup

github.com/mubeda其他011 次安装今天更新
代码仓库

关于 mstack-setup

适用于 Claude Code 和 Codex 的设置技能,用于检查 mstack 技能所需依赖,并提议为用户的各个项目安装缺失项。它只运行用户批准的命令,不会写入当前仓库。

主要功能

  1. 01检查主机对应的依赖
  2. 02按必需和可选项分组
  3. 03运行命令前征求批准
  4. 04安装后重新检查状态
  5. 05设置文件保存在仓库之外

适用场景

  1. 01检查 mstack 技能的前置条件
  2. 02安装选定的缺失依赖
  3. 03查看另一受支持主机的设置状态

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/mubeda/mstack --skill mstack-setup

安装后在 Claude Code 中输入/mstack-setup确认已加载。

包含的文件

除 SKILL.md 外,安装时一起下载的参考资料和脚本。

LICENSE
THIRD_PARTY_NOTICES.md
evals/complete-machine/
case.yaml
place-files.sh
prompt.md
evals/complete-machine/graders/
01-all-installed.md
02-new-session.md
03-no-command.md
04-no-install-call.md
evals/failing-install/
case.yaml
place-files.sh
prompt.md
evals/failing-install/graders/
01-list-first.md
02-continued.md
03-failure-reported.md
04-not-complete.md
evals/not-connected/
case.yaml
place-files.sh
prompt.md
evals/not-connected/graders/
01-connect-only.md
02-files-named.md
03-no-npm.md
references/
dependencies.md
scripts/
check-setup.mjs

README 原文English

来自项目 README

README 暂无中文译文,以下为英文原文;中文介绍见上方。

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.

RoleClaude CodeCodex
Question toolAskUserQuestiona numbered question in chat, then wait
<host> for the scriptclaudecodex
The scratch folderThe session's scratch folderA folder mstack-setup under the folder node -p "require('os').tmpdir()" prints

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 this block:

    ## mstack-setup result
    
    | ID | Tier | State | Detail |
    |---|---|---|---|
    | <id> | <mandatory or optional> | <ok, MISSING, LOGIN, SKIP, or installed, loads in a new session> | <detail> |
    
    Commands to run after the user's yes: <the numbered list, or none>
    Steps for the user: <logins and other manual steps, or none>
    

1. Status

  1. Run node <skill-folder>/scripts/check-setup.mjs --host <host> --json, where <skill-folder> is this skill's folder. If node itself is missing, say so, point at https://nodejs.org, and stop: nothing else can be checked.
  2. 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.
  3. 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.
  4. Show the status as a table: ID, tier, state, detail.
  5. When the other host's command-line tool is ok (reviewer-cli), offer once to check that host too, by running the script again with the other --host. Each host is its own list.

When no row has a command to propose (every row is ok, or the rest are manual steps), say so and propose nothing. Missing optional rows are proposed too, in their own group.

2. One list, one yes

  1. Read references/dependencies.md. For every MISSING row, mandatory or optional, take the command for this host. A row whose cell is "none" or a manual step gets no command, and every LOGIN or SKIP row is a manual step too (a login, or a tool to install first): list them under manual steps. Before a marketplace add line, check the host's marketplace list (claude plugin marketplace list --json, or codex plugin marketplace list). When the marketplace is already there, replace the line with its update (claude plugin marketplace update <name>, or codex plugin marketplace upgrade <name>), so a newly published plugin is found.
  2. For codegraph: when codegraph-cli is ok and only codegraph-connected is MISSING, 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.
  3. Write the full list to setup-commands.md in the scratch folder of the host table (outside the repository), grouped as mandatory then optional, one numbered command per line, with the files the connect command writes when it is listed. Then show the same list to the user in your reply. Only commands in that file can run.
  4. 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. A "run all" written before the list existed is not an answer to it: ask again. An answer the user gave for the list once it is shown ("when you show the list, run all") counts. When no answer can reach you, stop after showing the list and report it.

3. Run

  1. Run only the accepted commands, each on its own and once, in the list's order. 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. A plugin install can stop to ask for confirmation of a command the marketplace declares (Claude Code says to pass -y when not interactive). Then show that command to the user and ask; rerun the install with -y only after their yes, and otherwise record it as skipped by the user.
  2. Record each command the user left out as "skipped by the user".

4. Final check and report

  1. Run the script again with the same --host and --json.
  2. 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); and every skill or plugin installed now, which loads in a new session.
  3. Never say the setup is complete while a mandatory row is not ok. Say which rows are left and the step for each.

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.

评论

支持 Markdown