基础工具与工作流 · cursor/plugins

setup-pstack

Configure which models pstack uses per role. Detects your available models and writes an always-applied rule that overrides the skill defaults. Use for /setup-pstack, "configure pstack models", or changing pstack's model choices.

风险提醒:蓝色 · 知晓即可AI 侦查报告
作者 cursorGitHub cursor/plugins ↗Stars 7799许可 MIT(pstack 插件自带 LICENSE,'Copyright (c) 2026 Lauren Tan';pstack/.cursor-plugin/plugin.json 声明 "license": "MIT")。cursor/plugins 仓库根目录无 LICENSE,GitHub API license 字段为 null。commit df3fb154fb
agent 宿主通常会约束 skill 执行权限;风险提醒为 AI 侦查观点,不构成质量或安全保证。第三方 skill 仅作拆解与展示,安装使用风险自负,版权归原作者。

1实现原理 · 为什么它能做到

唯一产物是一个用户级规则文件:~/.cursor/rules/pstack-models.mdc,带 alwaysApply: true,逐行声明「角色 → 模型」。

pstack/skills/setup-pstack/SKILL.md
Write `~/.cursor/rules/pstack-models.mdc`, an always-applied rule that sets pstack's model per role.
注:这里在做什么:把「哪个角色用哪个模型」从各 skill 内硬编码的默认表里抽出来,做成一份机器可读、且总是生效的 Cursor 规则;这样用户改一次模型偏好,所有 pstack 子流程(interrogate/arena/swarm/how/why/reflect…)同时生效,无需改 skill 源码。

模型发现以「本会话 Task 工具能接受哪些 slug」为唯一可靠来源,探测不到就问用户粘贴,且明令不得写入未确认的 slug。

pstack/skills/setup-pstack/SKILL.md
Enumerate the model slugs you can pass to a `Task` subagent in this session. That is the dependable source. If Cursor also exposes a models API or CLI that lists the user's entitled models, prefer it for completeness. If you cannot detect any, ask the user to paste the slugs they have access to. Never write a real slug you have not confirmed is available. The aliases `inherit-parent` and `auto` are always valid even though they are not detected slugs.
注:防幻觉的关键闸门:slug 不能凭记忆编造。`inherit-parent` 与 `auto` 被声明为「永远有效」的别名,语义是省略 Task 的 model 字段让子代理继承父会话模型(Auto 档用户因此不会被迫选具体模型)。

第二级校验独立于发现阶段:写好前再核对一次「每个真实 slug 都在探测集合内」,不在就停下重问。

pstack/skills/setup-pstack/SKILL.md
Every real slug written must be in the detected set. `inherit-parent` and `auto` always pass. If a chosen real slug is not available, stop and ask again.
注:发现(Step 1)与校验(Step 4)分两步写,中间夹着加载现状(Step 2)与映射确认(Step 3);这是刻意的双重检查,避免用户手改或模型推测产生不可用 slug。

交互以结构化选择为主(AskQuestion)而非自由文本,并把现有配置当作「当前选择」呈现给用户逐角色确认。

pstack/skills/setup-pstack/SKILL.md
Ask whether to accept as-is or change specific roles, offering the detected models plus `inherit-parent` and `auto` (both mean: this role runs on the parent chat model, which is how Auto users stay on Auto) as the options. Prefer AskQuestion over free text.
注:Step 2 规定:若文件已存在则读出来当现状,否则用默认形状起步;Step 3 把「不在探测集合里的真实 slug」显式标为需要选择。这把「配置漂移」变成可见项。

整文件覆写保证幂等:重跑不会累积出重复或矛盾的 role 行。

pstack/skills/setup-pstack/SKILL.md
Overwrite the whole file so re-runs stay idempotent. Shape:
注:写入的规则形状固定 18 行角色(feature/refactoring、bug-fix、perf-issue、hillclimb、judgment and prose、hardest tasks、how explorer/explainer、why investigators/synthesizer、reflect tooling、reflect judgment+divergent+synthesizer、arena runners、arena cross-judge pool、swarm workers、architect runners、interrogate reviewers),含注释说明「删掉一行即回落到 skill 默认」。

面板类角色的值是**列表**,列表长度直接决定子代理扇出数量——这是本 skill 最实质的语义(配置即并行度)。

pstack/skills/setup-pstack/SKILL.md
For panel roles (arena runners, architect runners, interrogate reviewers) the value is a list, and one subagent runs per entry, alias entries included, so the list length sets the count.
注:`arena cross-judge pool` 是另一种语义:列表里挑一个、且尽量选与父会话不同模型家族的;`swarm workers` 是每个 worker 的默认模型(除非 race 逐臂指定)。这些语义差异只在这段散文里定义,规则文件本身只是 `role: model` 行。

可选尾步会横向触发另一个 skill:检测项目缺少「能驱动真实应用做证明」的能力时,问一次是否生成项目内验证 skill。

pstack/skills/setup-pstack/SKILL.md
Check whether the project has a way to drive the real app for proof (a `verify-*` skill, or an existing harness). If not, offer once: "want a project-local verification skill, so agents can drive the app the way a user does and prove changes work? I can generate one with /create-verification-skill." On yes, invoke `/create-verification-skill` (resolves wherever pstack is installed: workspace, user, or plugin). On no, move on without pushing.
注:注意「offer once ... On no, move on without pushing」:只问一次、不纠缠。说 yes 会转交 /create-verification-skill,而那个 skill 会写 .cursor/skills/verify-<app>/(据 docs/guide/01-setup.md)。

生效时机被明确交代:规则对新会话生效,需要新开 chat。

pstack/docs/guide/01-setup.md
After setup, start a new chat. The model rule applies to new sessions.
注:SKILL.md Step 6 同步要求告知用户 'the rule was written and that it applies to new sessions. Re-running this skill updates it.'

2核心能力

01探测本会话可用的模型 slug(以 Task 子代理为真相源,必要时回退到用户手动粘贴)
02逐角色(18 个 role 行)映射模型,并支持 inherit-parent / auto 别名继承父会话模型
03把面板类角色的列表长度定义为子代理扇出数量(配置即并行度)
04写入前双重校验 slug 可用性,不可用则停下重问(不静默写入)
05幂等覆写用户级规则文件(重跑即更新,不累积)
06结构化交互(AskQuestion 优先)并明确呈现「现状 → 需改项」
07可选:引导生成项目内验证 skill(/create-verification-skill),只提议一次

3外部依赖

类型依赖
apiCursor Task 子代理的模型枚举(作为可用 slug 的探测源)
network用户级规则文件 ~/.cursor/rules/pstack-models.mdc(读+写)
packageAskQuestion(宿主交互工具,用于结构化询问而非自由文本)

4风险提醒 风险提醒:蓝色 · 知晓即可

风险提醒:蓝色 · 知晓即可
  • 写入用户主目录的常驻规则(跨项目生效) — ~/.cursor/rules/pstack-models.mdc 带 alwaysApply: true,会影响该用户今后所有会话中的 pstack 子代理行为,而不只是当前项目。团队里共享机器或使用多项目工作区时,需知道这是一个全局副作用;本 skill 也提醒「新会话才生效」。
  • 覆写语义可能覆盖用户手写内容 — 'Overwrite the whole file so re-runs stay idempotent.' 意味着任何用户手写在同文件里的额外角色行,若不在模板 17 行之内,会被重跑抹掉。文档给的替代做法是「删行回落默认」,但没有提到手工扩展行的持久化问题。
  • 条件性指令可能被过度执行 — 'If Cursor also exposes a models API or CLI that lists the user's entitled models, prefer it for completeness.' 是一条未点名的条件许可;在不具备该能力的环境里模型可能尝试探测不存在的 API,或反之漏掉更完整的来源。属提示词级模糊,非代码缺陷。
  • 横向触发他 skill 的写入 — 尾步可能拉起 /create-verification-skill,在项目内写 .cursor/skills/verify-<app>/。虽需用户明确 yes,但该写入不在本 skill 的目录边界内,用户容易低估其范围。
  • 模型 slug 与宿主能力强耦合 — 配置文件里的 slug(如 claude-fable-5-1-thinking-max)随供应商迭代会失效;虽然各消费者 skill 都有降级路径,但实际运行的模型组合可能与配置预期不同,且只在下次调用时才暴露。
风险提醒:蓝色,知晓即可。理由:纯提示词 skill,无脚本执行、无自带网络调用、无凭证/环境变量读取;唯一实质副作用是写用户主目录下的 Cursor 规则文件 ~/.cursor/rules/pstack-models.mdc(且为整文件覆写、幂等)。注意点:该文件 alwaysApply: true,属跨项目常驻配置,会改变后续所有会话里 pstack 子代理使用的模型与扇出规模;写坏时表现为子代理调用失败/降级,而非执行任意代码。可选尾步会把控制权交给 /create-verification-skill(另一个 skill 会在项目内写文件),需用户明确说 yes 才发生。触发条件:仅用户显式 /setup-pstack 或要求配置 pstack 模型时运行。

5第二遍独立确认

  • [ok] 「写一个 always-applied 规则」是否属实 — SKILL.md Step 5 原文给出 `alwaysApply: true`,且位于规则文件 frontmatter 形状中;docs/guide/01-setup.md 复述 'It writes `~/.cursor/rules/pstack-models.mdc`, a small rule every pstack skill reads.'。
  • [ok] 「每个真实 slug 必须已被确认可用」的双重校验 — Step 1 'Never write a real slug you have not confirmed is available.' 与 Step 4 'Every real slug written must be in the detected set. `inherit-parent` and `auto` always pass. If a chosen real slug is not available, stop and ask again.' 两处独立存在,非同一句的重复表述。
  • [ok] 本 skill 是否读取凭证或环境变量 — 全文无 API_KEY/token/secret/env 命中;模型可用性靠「本会话能否 spawn」这一运行时事实,不需读凭证。第一遍的 blue 档依据成立。
  • [ok] 首遍写入的「18 行角色」计数 — 逐行数 Step 5 模板:feature, refactoring / bug-fix / perf-issue / hillclimb / judgment and prose / hardest tasks / how explorer / how explainer / why investigators / why synthesizer / reflect tooling / reflect judgment, divergent, synthesizer / arena runners / arena cross-judge pool / swarm workers / architect runners / interrogate reviewers = 17 行(另有 2 行注释说明)。首遍写「18 行」为计数偏差,实际 17 行;已在此更正,不影响其他结论。
  • [ok] 「配置即扇出规模」的说法 — SKILL.md Step 3 明写面板角色(arena runners、architect runners、interrogate reviewers)'the value is a list, and one subagent runs per entry, alias entries included, so the list length sets the count';interrogate 的 SKILL.md 亦复述同一语义('one reviewer per entry, extending or shrinking the Reviewer A/B/C/D labels'),两端一致。
  • [ok] 尾步是否可能未经同意就动手 — 原文 'offer once ... On yes, invoke /create-verification-skill ... On no, move on without pushing',明确单次提议 + 需 yes;docs/guide 亦写 'Say yes and it writes … Say no and setup moves on.'。
  • [ok] 是否存在未披露的文件写入 — 全文写入指令只有一处(规则文件);写规则时 'Overwrite the whole file' 明确是覆写而非追加,故不会形成多处散落写入。间接写入(.cursor/skills/verify-<app>/)发生在另一个 skill 内,已单列并标注归属。
  • [ok] 元数据(license/stars/install) — license MIT 来自 pstack/LICENSE 与 plugin.json;stars 7799 / last_push 2026-09-15T03:14:54Z 来自 gh api repos/cursor/plugins(仓库根无 LICENSE,故 gh license 为 null);installs=3 取自 pool.json 的 skills.sh-hot 计数,明显为低值采样,不据此下任何结论。

6结论

  • 一次性把「模型偏好」集中成一份用户级配置,消除多个 skill 各自硬编码模型的漂移问题。
  • 防幻觉做得比多数配置类 skill 硬:只写「本会话实测可用」的 slug,双重校验,不可用就停下问人。
  • 对 Auto 档用户友好:inherit-parent / auto 作为永远有效的别名,含义是省略 model 字段继承父会话模型。
  • 幂等且可回退:整文件覆写,删行即回落默认,重跑即更新,不产生历史垃圾。
  • 把成本控制权交给用户:面板角色的列表长度就是并行子代理数量,想省钱就删条目。
  • 适合:适合正在使用 pstack 插件(Cursor 的 /add-plugin pstack)并希望按自己的模型权限与预算调优的团队/个人:一次交互就把 17 个角色的模型定好,之后 interrogate/arena/swarm/how/why/reflect 全部按此执行;Auto 档用户可用 inherit-parent/auto 保持零思考。也是「配置类 skill」的参考实现——只写一份声明式规则,不改任何执行代码。
    不适合:不适合:① 不使用 pstack 系 skill 的环境(写的规则无人读取);② 期望「按项目」而非「按用户」配置模型的场景——它固定写 ~/.cursor/rules/,是用户级;③ 完全依赖手写规则文件的用户(整文件覆写会覆盖手改内容);④ 无 Task 子代理能力、无法枚举模型的环境(会退化为让用户手动粘贴 slug)。另注意仅当显式 /setup-pstack 时运行。
    安装 agent 直装可复制
    ① 本站镜像 更新 2026-09-15
    方式 A · 人下载镜像包下载 setup-pstack.tar.gz
    sha256: 21a003c19c3e95ac…
    方式 B · JSON 格式安装指南,复制给 agent
    安装指南
    agent 读 JSON 指南后会自动从本站下载安装,无需更多说明。
    ② 上游 GitHub · 原始来源
    能访问 GitHub?直接去上游安装(实时版,可能已更新)GitHub 原始 ↗
    本页镜像锁定 commit df3fb154fb;上游为实时仓库。
    来源信息 GitHub 原始
    作者 / 仓库cursor / cursor/plugins
    原始 GitHubcursor/plugins ↗
    Stars7799
    最近推送2026-09-15
    本 skill commitdf3fb154fb
    许可MIT(pstack 插件自带 LICENSE,'Copyright (c) 2026 Lauren Tan';pstack/.cursor-plugin/plugin.json 声明 "license": "MIT")。cursor/plugins 仓库根目录无 LICENSE,GitHub API license 字段为 null。
    本站信息
    收录日期2026-09-06
    分类基础工具与工作流
    侦查报告AI 侦查 · 2 遍 · 2026-09-06
    本站镜像与 GitHub 原始是不同来源:本站锁定 commit 快照经 /r2 分发;GitHub 为实时上游,内容可能已更新。
    同分类邻近