mcpField
S
setup-pstack

setup-pstack

github.com/cursorAgent 工作流14.5k4.1k 次安装今天更新
代码仓库

关于 setup-pstack

用于配置 pstack 的技能,会检测可用模型、询问推理预算,并将各角色的模型选择写入 Cursor 规则文件。它还可选提供项目验证技能的设置。

主要功能

  1. 01检测可用的 Task 模型标识
  2. 02为各角色设置推理预算
  3. 03检查并确认角色模型分配
  4. 04写入始终应用的 Cursor 规则
  5. 05可选生成验证技能

适用场景

  1. 01为新的配置设置 pstack 模型
  2. 02调整角色模型并保留自定义选择
  3. 03配置评审组和 worker 角色的模型

安装

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

$npx skills add https://github.com/cursor/plugins --skill setup-pstack

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

详细介绍

设置 pstack

编写 ~/.cursor/rules/pstack-models.mdc,创建一条始终应用的规则,为 pstack 的各个角色指定模型。

步骤

1. 检测可用模型

枚举本次会话中可传递给 Task 子 Agent 的模型 slug。这是可靠的数据来源。如果 Cursor 也提供列出用户有权使用的模型的 API 或 CLI,优先使用以确保完整性。如果无法检测到任何模型,请让用户粘贴其有权使用的 slug。切勿填写未经确认可用的真实 slug。别名 inherit-parent 和 auto 始终有效,即使它们不是检测到的 slug。

2. 加载当前状态

默认的角色到模型映射采用下方第 5 步展示的规则格式。如果 ~/.cursor/rules/pstack-models.mdc 已存在,请读取该文件,并将其 # budget 行和各角色的值视为当前选项。否则,使用这些默认值。若某一行中的角色未出现在第 5 步中(例如 how critics),则该角色已停用,应删除该行。

3. 设置预算、映射并确认

(a) 询问预算。 优先使用 AskQuestion,而不是自由文本。提供以下四个选项,标签必须完全一致;如果规则中记录了当前预算,也要说明当前预算。如果没有规则,则说明 large 与技能默认值相符。

  • unlimited — max reasoning
  • large — xhigh reasoning
  • medium — high reasoning
  • small — medium reasoning

(b) 应用预算。 根据技能默认值建立工作表;重新运行时,保留你按系列、列表或别名(inherit-parent、auto)修改过的角色。unlimited、large、medium 和 small 会分别将所有真实 slug(包括面板条目)的推理强度标记设为 max、xhigh、high 或 medium。推理强度标记是最后一个 token,或者在末尾带有 fast 时,是倒数第二个 token。等级从高到低依次为 max > xhigh > high > medium > low。如果结果不是已检测到的 slug,则使用同一系列中不高于目标等级的最高已检测 slug;如果没有符合条件的 slug,则标记该角色需要选择。inherit-parent 和 auto 不变。因此,unlimited 会将 claude-opus-5-5-xhigh 变为 claude-opus-5-5-max。Grok slug 的最高等级是 xhigh,因此在 unlimited 下,回退选择会将 Grok 设为 xhigh,并保持 grok-4.7-xhigh-fast 不变。large 会保留两个默认值。small 会将它们分别变为 claude-opus-5-5-medium 和 grok-4.7-medium-fast。

(c) 显示角色并确认。 显示每个角色及其模型,并将不在已检测集合中的真实 slug 标记为需要选择。同时列出第 2 步删除的每一行。询问用户是接受当前设置,还是更改指定角色;可选项为已检测到的模型,以及 inherit-parent 和 auto(两者都表示该角色使用父级聊天模型,这样使用 Auto 的用户就能继续使用 Auto)。优先使用 AskQuestion,而不是自由文本。对于面板角色(arena runners、architect runners、interrogate reviewers),其值是一个列表,每个条目(包括别名条目)都会运行一个子 Agent,因此列表长度决定数量。arena cross-judge pool 也是列表,但 Arena 会从中选择一个与父级模型系列不同的值(如果可能)。swarm workers 是所有工作线程的默认模型,除非某个竞赛或比较为每个参赛方指定了其他模型。

4. 验证

写入的每个真实 slug 都必须属于已检测集合。inherit-parent 和 auto 始终有效。如果所选真实 slug 不可用,请停止并重新询问。

5. 写入规则

写入 ~/.cursor/rules/pstack-models.mdc,设置 alwaysApply: true,添加一行 # budget,写明所选标签及其目标推理强度,并为每个角色写一行,标签格式与 poteto-mode 使用的相同。覆盖整个文件,确保重新运行时结果保持幂等。格式如下:

---
description: pstack per-role model choices (overrides skill defaults)
alwaysApply: true
---
# pstack model configuration. One line per role. Delete a line to fall back to the skill default.
# `inherit-parent` or `auto` as a value: the role runs on the parent chat model (omit Task `model`). Alias entries in a panel list still count toward its fan-out.
# budget: large (xhigh)
feature, refactoring: grok-4.7-xhigh-fast
bug-fix: grok-4.7-xhigh-fast
perf-issue: grok-4.7-xhigh-fast
hillclimb: grok-4.7-xhigh-fast
judgment and prose: claude-opus-5-5-xhigh
hardest tasks: claude-opus-5-5-xhigh
how explorer: grok-4.7-xhigh-fast
how explainer: claude-opus-5-5-xhigh
why investigators: grok-4.7-xhigh-fast
why synthesizer: claude-opus-5-5-xhigh
reflect tooling: grok-4.7-xhigh-fast
reflect judgment, divergent, synthesizer: claude-opus-5-5-xhigh
arena runners: claude-opus-5-5-xhigh, grok-4.7-xhigh-fast
arena cross-judge pool: claude-opus-5-5-xhigh, grok-4.7-xhigh-fast
swarm workers: grok-4.7-xhigh-fast
architect runners: claude-opus-5-5-xhigh, grok-4.7-xhigh-fast
interrogate reviewers: claude-opus-5-5-xhigh, grok-4.7-xhigh-fast
6. 确认

告知用户规则已写入,并会应用于新会话。重新运行此技能即可更新规则。

7. 提供验证技能(可选)

检查项目是否有办法驱动实际应用来验证效果(verify-* 技能或现有的测试框架)。如果没有,只询问一次:“想要一个项目本地的验证技能,让 Agent 能像用户一样操作应用并证明更改有效吗?我可以使用 /create-verification-skill 生成一个。”如果对方同意,调用 /create-verification-skill(会在 pstack 的安装位置解析:工作区、用户级或插件)。如果对方不同意,继续下一步,不要施压。

8. 提供形式化验证技能(可选)

检查项目是否已有形式化验证技能(针对代码运行模型检查器、证明或其他验证器的项目技能)。如果没有,只询问一次:“想要一个形式化验证技能,让 Agent 能证明代码的某个关键属性在适用范围内的所有情况下都成立,而不只是测试覆盖到的情况吗?我可以使用 /create-formal-verification-skill 生成一个。”如果对方同意,调用 /create-formal-verification-skill(会在 pstack 的安装位置解析:工作区、用户级或插件)。如果对方不同意,继续下一步,不要施压。

评论

支持 Markdown