@shiwenbin1617/pstack 0.14.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. package/LICENSE +28 -0
  2. package/README.md +332 -0
  3. package/adapters/claude-code/overrides/setup-pstack/SKILL.md +48 -0
  4. package/adapters/claude-code.md +29 -0
  5. package/adapters/codex/agents/comment-sicko.toml +7 -0
  6. package/adapters/codex/agents/poteto-agent.toml +7 -0
  7. package/adapters/codex/overrides/setup-pstack/SKILL.md +40 -0
  8. package/adapters/codex.md +34 -0
  9. package/agents/comment-sicko.md +32 -0
  10. package/agents/poteto-agent.md +9 -0
  11. package/automations/benny/FOR_AGENTS.md +89 -0
  12. package/automations/benny/README.md +23 -0
  13. package/automations/benny/skills/reproduce-and-fix-issues/SKILL.md +310 -0
  14. package/automations/benny/skills/reproduce-and-fix-issues/references/control-adapter.md +169 -0
  15. package/automations/benny/skills/reproduce-and-fix-issues/references/feature-map.example.md +205 -0
  16. package/automations/benny/skills/reproduce-and-fix-issues/references/verify-existing-fix.md +93 -0
  17. package/automations/benny/skills/setup-benny/SKILL.md +266 -0
  18. package/automations/benny/skills/triage-issue-reports/SKILL.md +240 -0
  19. package/automations/benny/skills/triage-issue-reports/references/routing.example.md +61 -0
  20. package/automations/benny/templates/configuration.example.yaml +84 -0
  21. package/automations/benny/templates/reproduce-automation-prompt.md +33 -0
  22. package/automations/benny/templates/triage-automation-prompt.md +39 -0
  23. package/bin/pstack.mjs +331 -0
  24. package/package.json +48 -0
  25. package/scripts/build.mjs +218 -0
  26. package/scripts/host-adapters.mjs +128 -0
  27. package/scripts/lib.mjs +181 -0
  28. package/scripts/test.mjs +106 -0
  29. package/skills/architect/SKILL.md +83 -0
  30. package/skills/architect/references/design-red-flags.md +33 -0
  31. package/skills/architect/references/rationale-template.md +35 -0
  32. package/skills/architect/references/runner-prompt.md +20 -0
  33. package/skills/arena/SKILL.md +71 -0
  34. package/skills/automate-me/SKILL.md +109 -0
  35. package/skills/blast-radius/SKILL.md +50 -0
  36. package/skills/bro/SKILL.md +7 -0
  37. package/skills/create-verification-skill/SKILL.md +44 -0
  38. package/skills/create-verification-skill/references/feature-map-example/README.md +47 -0
  39. package/skills/create-verification-skill/references/feature-map-example/create-note.md +39 -0
  40. package/skills/create-verification-skill/references/feature-map-example/search.md +45 -0
  41. package/skills/figure-it-out/SKILL.md +55 -0
  42. package/skills/how/SKILL.md +134 -0
  43. package/skills/how/references/critic-prompt.md +59 -0
  44. package/skills/how/references/critique-rubric.md +58 -0
  45. package/skills/how/references/explainer-prompt.md +55 -0
  46. package/skills/how/references/explorer-prompt.md +52 -0
  47. package/skills/interrogate/SKILL.md +113 -0
  48. package/skills/interrogate/references/code-quality-review.md +47 -0
  49. package/skills/interrogate/references/lead-judgment.md +58 -0
  50. package/skills/interrogate/references/reviewer-prompt.md +72 -0
  51. package/skills/interrogate/references/rubric.md +77 -0
  52. package/skills/maintain-verification-skill/SKILL.md +39 -0
  53. package/skills/no-comments/SKILL.md +24 -0
  54. package/skills/poteto-mode/SKILL.md +140 -0
  55. package/skills/poteto-mode/playbooks/authoring-a-skill.md +12 -0
  56. package/skills/poteto-mode/playbooks/autonomous-run.md +13 -0
  57. package/skills/poteto-mode/playbooks/autopilot-full.md +13 -0
  58. package/skills/poteto-mode/playbooks/autopilot-stack.md +16 -0
  59. package/skills/poteto-mode/playbooks/babysit.md +27 -0
  60. package/skills/poteto-mode/playbooks/bug-fix.md +17 -0
  61. package/skills/poteto-mode/playbooks/eval.md +27 -0
  62. package/skills/poteto-mode/playbooks/feature.md +21 -0
  63. package/skills/poteto-mode/playbooks/hillclimb.md +21 -0
  64. package/skills/poteto-mode/playbooks/investigation.md +14 -0
  65. package/skills/poteto-mode/playbooks/multi-phase-plan.md +155 -0
  66. package/skills/poteto-mode/playbooks/opening-a-pr.md +29 -0
  67. package/skills/poteto-mode/playbooks/orchestrate.md +113 -0
  68. package/skills/poteto-mode/playbooks/pause-safely.md +10 -0
  69. package/skills/poteto-mode/playbooks/perf-issue.md +24 -0
  70. package/skills/poteto-mode/playbooks/prototype.md +14 -0
  71. package/skills/poteto-mode/playbooks/refactoring.md +16 -0
  72. package/skills/poteto-mode/playbooks/runtime-forensics.md +11 -0
  73. package/skills/poteto-mode/playbooks/session-pickup.md +13 -0
  74. package/skills/poteto-mode/playbooks/shipping.md +20 -0
  75. package/skills/poteto-mode/playbooks/trace-forensics.md +14 -0
  76. package/skills/poteto-mode/playbooks/visual-parity.md +11 -0
  77. package/skills/poteto-mode/playbooks/worktree-cleanup.md +14 -0
  78. package/skills/poteto-mode/references/bugbot-triage.md +142 -0
  79. package/skills/poteto-mode/scripts/bootstrap.ts +30 -0
  80. package/skills/poteto-mode/scripts/bun.lock +67 -0
  81. package/skills/poteto-mode/scripts/check-plan.mjs +186 -0
  82. package/skills/poteto-mode/scripts/orch/orch.test.ts +634 -0
  83. package/skills/poteto-mode/scripts/orch/orch.ts +578 -0
  84. package/skills/poteto-mode/scripts/orch/store.ts +1607 -0
  85. package/skills/poteto-mode/scripts/package.json +16 -0
  86. package/skills/poteto-mode/scripts/watch-pr/cli.test.ts +224 -0
  87. package/skills/poteto-mode/scripts/watch-pr/cli.ts +223 -0
  88. package/skills/poteto-mode/scripts/watch-pr/fakes.test-helper.ts +118 -0
  89. package/skills/poteto-mode/scripts/watch-pr/github.test.ts +306 -0
  90. package/skills/poteto-mode/scripts/watch-pr/github.ts +699 -0
  91. package/skills/poteto-mode/scripts/watch-pr/policy.test.ts +420 -0
  92. package/skills/poteto-mode/scripts/watch-pr/policy.ts +832 -0
  93. package/skills/poteto-mode/scripts/watch-pr/render.ts +169 -0
  94. package/skills/poteto-mode/scripts/watch-pr/tsconfig.json +13 -0
  95. package/skills/poteto-mode/scripts/watch-pr/types.compile.ts +93 -0
  96. package/skills/poteto-mode/scripts/watch-pr/types.ts +401 -0
  97. package/skills/poteto-mode/scripts/watch-pr/watch-pr +6 -0
  98. package/skills/poteto-mode/scripts/worktree-audit.sh +89 -0
  99. package/skills/principle-boundary-discipline/SKILL.md +34 -0
  100. package/skills/principle-build-the-lever/SKILL.md +23 -0
  101. package/skills/principle-encode-lessons-in-structure/SKILL.md +31 -0
  102. package/skills/principle-exhaust-the-design-space/SKILL.md +21 -0
  103. package/skills/principle-experience-first/SKILL.md +19 -0
  104. package/skills/principle-fix-root-causes/SKILL.md +23 -0
  105. package/skills/principle-foundational-thinking/SKILL.md +21 -0
  106. package/skills/principle-guard-the-context-window/SKILL.md +17 -0
  107. package/skills/principle-laziness-protocol/SKILL.md +18 -0
  108. package/skills/principle-make-operations-idempotent/SKILL.md +24 -0
  109. package/skills/principle-migrate-callers-then-delete-legacy-apis/SKILL.md +22 -0
  110. package/skills/principle-minimize-reader-load/SKILL.md +23 -0
  111. package/skills/principle-model-the-domain/SKILL.md +26 -0
  112. package/skills/principle-never-block-on-the-human/SKILL.md +23 -0
  113. package/skills/principle-outcome-oriented-execution/SKILL.md +22 -0
  114. package/skills/principle-prove-it-works/SKILL.md +33 -0
  115. package/skills/principle-redesign-from-first-principles/SKILL.md +16 -0
  116. package/skills/principle-separate-before-serializing-shared-state/SKILL.md +16 -0
  117. package/skills/principle-sequence-verifiable-units/SKILL.md +22 -0
  118. package/skills/principle-subtract-before-you-add/SKILL.md +22 -0
  119. package/skills/principle-type-system-discipline/SKILL.md +31 -0
  120. package/skills/recall/SKILL.md +35 -0
  121. package/skills/reflect/SKILL.md +77 -0
  122. package/skills/reflect/references/divergent-reviewer.md +43 -0
  123. package/skills/reflect/references/judgment-reviewer.md +42 -0
  124. package/skills/reflect/references/synthesizer.md +56 -0
  125. package/skills/reflect/references/tooling-reviewer.md +57 -0
  126. package/skills/setup-pstack/SKILL.md +106 -0
  127. package/skills/show-me-your-work/SKILL.md +82 -0
  128. package/skills/show-me-your-work/references/decision-log-template.tsv +1 -0
  129. package/skills/show-me-your-work/scripts/log.sh +40 -0
  130. package/skills/swarm/SKILL.md +46 -0
  131. package/skills/tdd/SKILL.md +44 -0
  132. package/skills/teach/SKILL.md +21 -0
  133. package/skills/technical-writing/SKILL.md +130 -0
  134. package/skills/typescript-best-practices/SKILL.md +28 -0
  135. package/skills/typescript-best-practices/references/patterns.md +292 -0
  136. package/skills/unslop/SKILL.md +80 -0
  137. package/skills/why/SKILL.md +229 -0
  138. package/skills/why/references/epistemics.md +144 -0
  139. package/skills/why/references/investigator-prompt.md +103 -0
  140. package/skills/why/references/source-playbook.md +17 -0
  141. package/skills/why/references/sources/code-archaeology.md +88 -0
  142. package/skills/why/references/sources/databricks.md +70 -0
  143. package/skills/why/references/sources/datadog.md +99 -0
  144. package/skills/why/references/sources/incident-postmortem.md +15 -0
  145. package/skills/why/references/sources/linear.md +48 -0
  146. package/skills/why/references/sources/notion.md +55 -0
  147. package/skills/why/references/sources/sentry.md +100 -0
  148. package/skills/why/references/sources/slack.md +54 -0
  149. package/skills/why/references/synthesizer-prompt.md +135 -0
package/LICENSE ADDED
@@ -0,0 +1,28 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Lauren Tan
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
23
+ ---
24
+
25
+ This repository is a fork of pstack from https://github.com/cursor/plugins,
26
+ adapted for Claude Code and Codex. The original work is MIT licensed and
27
+ copyright Lauren Tan; that notice above applies unchanged. Modifications
28
+ for this port are released under the same terms.
package/README.md ADDED
@@ -0,0 +1,332 @@
1
+ <div align="center">
2
+
3
+ # pstack
4
+
5
+ **给 AI 编码代理装上资深工程师的工作习惯**
6
+
7
+ 一套 Markdown 规则,逼 AI 在动手前把问题想清楚、动手后拿出运行时证据,而不是写完就说"改好了"。
8
+
9
+ [安装](#安装) · [使用](#使用) · [工作原理](#工作原理) · [技能清单](#技能清单) · [常见问题](#常见问题)
10
+
11
+ 同时支持 **Claude Code** 和 **Codex** · 44 个技能 · 23 个 playbook · 21 条工程原则
12
+
13
+ </div>
14
+
15
+ ---
16
+
17
+ ## 为什么用 pstack
18
+
19
+ AI 写代码的默认失败模式是:看上去合理、跑不起来、或者跑起来了但没人验证过。
20
+
21
+ | 能力 | 作用 |
22
+ |---|---|
23
+ | **先理解再动手** | `/how` `/why` 并行开多个子代理探清子系统和设计历史,讲不清完整调用链就不许进入下一步 |
24
+ | **接口先于实现** | `/architect` 在跨函数边界前先定类型、签名、模块划分;跳过必须写明理由,不能悄悄混进实现 |
25
+ | **多模型对抗** | `/arena` 并行出 N 个方案再择优嫁接,`/interrogate` 让不同模型轮流攻击你的 diff |
26
+ | **证据而非断言** | prove-it-works 原则:CI 绿不算证据,agent 自称通过不算证据,只有没写这段代码的人在真实界面跑出来的结果才算 |
27
+ | **23 个 playbook** | 每类任务(修 bug、加需求、重构、性能、发版、长任务托管)都定死了步骤、出口条件和验收标准 |
28
+ | **21 条工程原则** | 从"先定核心数据结构"到"迁移完调用方就删掉旧 API",在需要时被自动引用 |
29
+ | **不留 AI 味** | `/no-comments` 清废话注释,`/unslop` 去 AI 腔,`/technical-writing` 规范 PR 和 commit |
30
+ | **一次安装,两端可用** | 从公共方法论生成两个原生产物;Claude Code 与 Codex 的文件、代理和配置互不影响 |
31
+
32
+ 目标不是让 agent 写得更多,而是写得更少、但每一行都站得住。
33
+
34
+ ---
35
+
36
+ ## 环境要求
37
+
38
+ - Node.js >= 18
39
+ - Claude Code 或 Codex(装了哪个就用哪个,两个都装会自动识别)
40
+ - Bun(可选;仅 `babysit` 的完整 PR watcher 和 `orchestrate` 账本 CLI 需要。helper 不会隐式安装依赖)
41
+
42
+ ---
43
+
44
+ ## 安装
45
+
46
+ ```bash
47
+ npx @shiwenbin1617/pstack add
48
+ ```
49
+
50
+ 交互式勾选要装哪些技能:`↑↓` 移动,`空格` 勾选,`a` 全选,`回车` 确认。默认预选 10 个核心入口,安装时自动补齐它们引用的运行依赖。
51
+
52
+ 嫌包名长就装成全局,之后命令就是 `pstack`:
53
+
54
+ ```bash
55
+ npm i -g @shiwenbin1617/pstack
56
+ ```
57
+
58
+ > npm 上那个无 scope 的 `pstack` 是 2015 年一个同名的无关包,不是这个项目。
59
+
60
+ ### 其他安装方式
61
+
62
+ ```bash
63
+ pstack add --core # 核心入口及其自动展开的运行依赖
64
+ pstack add --all # 全装 44 个
65
+ pstack add how why # 按名字装指定技能
66
+ ```
67
+
68
+ ### 管理命令
69
+
70
+ ```bash
71
+ pstack list # 看装了什么、装在哪
72
+ pstack find review # 按关键词搜技能
73
+ pstack update # 重装已安装的(升级用)
74
+ pstack remove # 交互式卸载
75
+ pstack doctor # 检查两端的安装状态
76
+ ```
77
+
78
+ 以上都可以不装全局,改写成 `npx @shiwenbin1617/pstack <命令>`。
79
+
80
+ ### 安装位置
81
+
82
+ 两个 host 始终安装为**独立副本**。Claude Code 与 Codex 使用各自的调用语法、frontmatter、代理格式和配置路径。修改一边的已安装文件不会影响另一边。
83
+
84
+ ```
85
+ ~/.agents/skills/how/ ← Codex 技能,使用 $how
86
+ ~/.codex/agents/*.toml ← Codex 自定义代理
87
+ ~/.claude/skills/how/ ← Claude Code 技能,使用 /how
88
+ ~/.claude/agents/*.md ← Claude Code 自定义代理
89
+ ```
90
+
91
+ | 选项 | 作用 |
92
+ |---|---|
93
+ | `--host claude` / `codex` / `both` | 只装给指定 agent。默认自动探测本机装了哪些 |
94
+ | `--scope user` / `project` | 装到全局 `~/`,还是当前仓库的 `./.claude/`、`./.agents/`。默认 user |
95
+ | `--copy` | 显式使用独立副本;当前也是默认且唯一模式 |
96
+ | `--dry-run` | 只打印会做什么,不写任何文件 |
97
+ | `-y` / `--yes` | 跳过确认 |
98
+
99
+ ### 分发给同事
100
+
101
+ 同事只需要一行:
102
+
103
+ ```bash
104
+ npx @shiwenbin1617/pstack add --core
105
+ ```
106
+
107
+ 想固定版本或走内部源,把这个仓库发到私有 registry,之后运行 `npx <你的包名> add`。项目不提供 Claude Code plugin 入口,避免插件加载绕过 host adapter;Claude Code 和 Codex 都只通过 CLI 安装各自的独立产物。
108
+
109
+ ---
110
+
111
+ ## 使用
112
+
113
+ ### 1. 配置模型档位(可选,但建议跑一次)
114
+
115
+ ```text
116
+ # Claude Code
117
+ /setup-pstack
118
+
119
+ # Codex
120
+ $setup-pstack
121
+ ```
122
+
123
+ 它探测你这个会话实际能用哪些模型,绑定三个档位:
124
+
125
+ | 档位 | 用在哪 |
126
+ |---|---|
127
+ | 快速代码模型 | 机械的、规格明确的改动 |
128
+ | 精确执行模型 | 需要一字不差按步骤执行的活 |
129
+ | 判断模型 | 文案、设计决策、对抗式评审 |
130
+
131
+ 技能正文只说"用你的判断模型",具体是谁由这里决定。Claude Code 写入 `~/.claude/pstack-models.md`,Codex 写入 `~/.codex/pstack-models.md`。两边配置互不读取。跳过也能跑,每个技能有自己的档位默认值。
132
+
133
+ ### 2. 日常只用一个入口
134
+
135
+ ```text
136
+ # Claude Code
137
+ /poteto-mode 这个 PR 有个诡异的 bug。先复现,再修,再验证。
138
+
139
+ # Codex
140
+ $poteto-mode 给设置页加一个导出功能,支持 CSV 和 JSON,并拿出运行时证据。
141
+ ```
142
+
143
+ ### 3. 它会自己路由
144
+
145
+ 读你的请求 → 匹配 playbook → 把步骤原样抄进 todo list → 按步骤调用其他技能。
146
+
147
+ Claude Code 的 `/poteto-mode` 保留原生粘性模式。Codex 不伪造该能力;每个新的独立任务显式调用 `$poteto-mode`,长任务使用当前 Codex 会话提供的 goal、wait 或 recurring-monitoring 能力。
148
+
149
+ ### 4. 需要时直接点名
150
+
151
+ ```
152
+ /how 我们是怎么取消 run 的?批量取消时有 N+1 查询吗?
153
+ /why 这个重试逻辑当初为什么写成指数退避加抖动?
154
+ /interrogate 审一下这个 PR。
155
+ ```
156
+
157
+ Codex 上把 `/` 换成 `$`,例如 `$poteto-mode`。
158
+
159
+ ---
160
+
161
+ ## 工作原理
162
+
163
+ ### 五段式循环
164
+
165
+ ```
166
+ ① 理解 ② 设计 ③ 构建 ④ 验证 ⑤ 交付
167
+ ──────── ──────── ──────── ──────── ────────
168
+ /how /architect 写代码 /interrogate /unslop
169
+ /why /arena /tdd 验证技能 /technical-writing
170
+ /recall /blast-radius /swarm 真实取证 /no-comments
171
+ 开 PR / 合并
172
+
173
+ └── 每一步都有出口条件,不满足就不进入下一步 ──┘
174
+ ```
175
+
176
+ | 阶段 | 出口条件 |
177
+ |---|---|
178
+ | ① 理解 | 能不含糊地讲清楚从输入到输出的完整路径 |
179
+ | ② 设计 | 接口和数据形状定了,实现只是填空 |
180
+ | ③ 构建 | 代码能自解释,不靠注释撑着 |
181
+ | ④ 验证 | 拿到运行时证据,不是断言 |
182
+ | ⑤ 交付 | 人类要读的地方没有 AI 味 |
183
+
184
+ ### 23 个 playbook
185
+
186
+ `/poteto-mode` 从这些里选一个匹配的:
187
+
188
+ | 类别 | playbook |
189
+ |---|---|
190
+ | **查问题** | `investigation` 只读调研 · `bug-fix` 复现→定位→修→取证 · `perf-issue` 对着 baseline 优化 · `hillclimb` 长期爬一个指标 · `runtime-forensics` 泄漏/空转/闪烁 · `trace-forensics` 分析 profile 文件 |
191
+ | **写东西** | `feature` 从数据形状出发的新行为 · `refactoring` 保持行为的结构调整 · `prototype` 一次性原型定决策 · `visual-parity` 两套实现的像素级一致 |
192
+ | **交付** | `opening-a-pr` · `babysit` 推 PR 到可合并 · `shipping` 独立验证后成串落地 · `autopilot-full` 每 PR 一个 owner 跑到合并 · `autopilot-stack` 构建 graphite stack 交人审 |
193
+ | **长任务** | `autonomous-run` 不停机跑完 · `orchestrate` 多天多 PR 多 agent 常驻协调 · `multi-phase-plan` 跨阶段 · `session-pickup` 接手上个 agent 的活 · `pause-safely` 干净暂停留检查点 |
194
+ | **元** | `authoring-a-skill` 写 SKILL.md · `eval` 盲测 prompt 改动的影响 · `worktree-cleanup` 清 worktree 回收磁盘 |
195
+
196
+ ### 举个例子:`feature` playbook 的实际步骤
197
+
198
+ 1. `/how` 摸清要动的子系统
199
+ 2. `/architect` 并行探索设计——**跳过必须写明理由**,不能把设计决策悄悄折进实现
200
+ 3. 写并行度检查点:哪些必须串行、哪些能并行、共享状态怎么切
201
+ 4. 才开始写代码。交给子代理时必须给定文件路径、**先定好的数据结构**、验收标准;你自己 review diff
202
+ 5. 在对应的真实界面上验证。"不确定"或验错了界面都不算通过
203
+ 6. 拆成小的、有序的 commit
204
+ 7. 设计有争议就 `/interrogate` 再发
205
+ 8. 走 `opening-a-pr`
206
+
207
+ 第 4 步里那句"先定好的数据结构"是重点:用状态机替代散落的 boolean,用表/注册表替代分支,用类型化模型替代重复的形状假设,**在写第一行逻辑之前选定**。这是新需求里最容易埋雷的地方。
208
+
209
+ ---
210
+
211
+ ## 技能清单
212
+
213
+ | 分类 | 技能 |
214
+ |---|---|
215
+ | **主入口** | `poteto-mode` |
216
+ | **理解** | `how` `why` `recall` `blast-radius` `teach` |
217
+ | **设计与构建** | `architect` `arena` `swarm` `tdd` `typescript-best-practices` `figure-it-out` |
218
+ | **验证** | `interrogate` `create-verification-skill` `maintain-verification-skill` |
219
+ | **写作** | `unslop` `no-comments` `technical-writing` `bro` |
220
+ | **元** | `setup-pstack` `automate-me` `reflect` `show-me-your-work` |
221
+ | **21 条原则** | `principle-*`,由上面的技能在需要时引用 |
222
+
223
+ <details>
224
+ <summary>展开 21 条原则</summary>
225
+
226
+ `boundary-discipline` `build-the-lever` `encode-lessons-in-structure` `exhaust-the-design-space` `experience-first` `fix-root-causes` `foundational-thinking` `guard-the-context-window` `laziness-protocol` `make-operations-idempotent` `migrate-callers-then-delete-legacy-apis` `minimize-reader-load` `model-the-domain` `never-block-on-the-human` `outcome-oriented-execution` `prove-it-works` `redesign-from-first-principles` `separate-before-serializing-shared-state` `sequence-verifiable-units` `subtract-before-you-add` `type-system-discipline`
227
+
228
+ </details>
229
+
230
+ 跑 `pstack find` 看带描述的完整列表。
231
+
232
+ ---
233
+
234
+ ## 资源
235
+
236
+ | 想做什么 | 看哪里 |
237
+ |---|---|
238
+ | 了解移植时改了什么 | [`adapters/claude-code.md`](./adapters/claude-code.md) · [`adapters/codex.md`](./adapters/codex.md) |
239
+ | 跟着原作者走一遍完整任务 | [`docs/guide/`](./docs/guide/README.md) |
240
+ | 改技能后做校验 | `node scripts/build.mjs --check` |
241
+ | 生成两端的分发目录 | `node scripts/build.mjs` → `dist/` |
242
+ | Slack issue 自动三分类 | [`automations/benny/`](./automations/benny/README.md)(需自行接 Slack MCP 和定时 agent) |
243
+
244
+ ---
245
+
246
+ ## 常见问题
247
+
248
+ <details>
249
+ <summary><b>和 CLAUDE.md / AGENTS.md / .cursorrules 有什么区别?</b></summary>
250
+
251
+ 那几个是**常驻**的项目规则,每次会话全量塞进 context,所以只能写短、写笼统("用 TypeScript"、"测试放 tests/ 下")。
252
+
253
+ pstack 是**按需加载**的技能。44 个技能只有描述行常驻,agent 判断相关才把整份读进来。所以每个技能可以写得很细——`feature` playbook 有 8 个步骤和明确的出口条件,`refactoring` 要求先写行为固定装置再动结构,这种密度塞不进一个常驻文件。
254
+
255
+ 两者不冲突:CLAUDE.md 写你这个项目的事实,pstack 写通用的工程方法。
256
+
257
+ </details>
258
+
259
+ <details>
260
+ <summary><b>只支持 Claude Code 吗?</b></summary>
261
+
262
+ 不是。Claude Code 和 Codex 都支持,装的时候自动探测。
263
+
264
+ `skills/` 保存公共方法论,构建器生成两个独立 host tree。Claude Code 产物使用 `/skill`、Markdown agents 和 Claude frontmatter;Codex 产物使用 `$skill`、`agents/openai.yaml`、TOML agents 和 Codex 路径。`scripts/build.mjs --check` 会拦住跨 host 泄漏。
265
+
266
+ 想加第三个 host,44 个技能一个都不用动——写一份新 adapter,再在 `scripts/lib.mjs` 的 `HOSTS` 里加一项就行。
267
+
268
+ </details>
269
+
270
+ <details>
271
+ <summary><b>44 个全装会不会把 context 撑爆?</b></summary>
272
+
273
+ 不会。常驻的只有每个技能的 `description` 那一行,正文按需加载。
274
+
275
+ Codex 那边有个硬限制:技能索引最多占 context 的 2% 或 8000 字符(取小),超了会先截断长描述。pstack 的描述都控制得比较紧,但如果你还装了别的技能包导致被截断,用 `pstack add` 挑一部分装,别 `--all`。
276
+
277
+ </details>
278
+
279
+ <details>
280
+ <summary><b>和 Trellis 这类框架冲突吗?</b></summary>
281
+
282
+ 分工不同,但有一块会打架。
283
+
284
+ pstack 是**无状态**的——它管"干一件事的方法和标准",不记跨会话的项目状态。Trellis 管的是 `.trellis/` 里沉淀的 spec、任务、工作日志,解决"agent 每次从零开始"。
285
+
286
+ 打架的地方是两边都有工作流编排(Trellis 的 plan→implement→verify→finish vs pstack 的 playbook),而且验证标准差很多:Trellis 的 check 跑 lint/type-check/测试,pstack 明确说这些都不算验证。
287
+
288
+ 要组合的话,让 Trellis 管状态、pstack 管方法:把 pstack 的核心规则写进 `.trellis/spec/`,让它的自动注入把标准带进每个任务。
289
+
290
+ </details>
291
+
292
+ <details>
293
+ <summary><b>会不会把简单任务也搞得很慢?</b></summary>
294
+
295
+ 会有这个风险,所以 `/poteto-mode` 的定位是"需要严谨的任务",不是所有任务。它匹配不到 playbook 时会退出来,不硬套。
296
+
297
+ 另外有一条 `laziness-protocol` 原则专门管这个:能达到目标的最小改动才发版,"可能有用"的推测性清理要 revert 掉。
298
+
299
+ 真嫌重就别用 `/poteto-mode`,单独点名 `/how` 或 `/interrogate` 就行。
300
+
301
+ </details>
302
+
303
+ <details>
304
+ <summary><b>怎么改成我们团队自己的?</b></summary>
305
+
306
+ 公共方法论在 `skills/`,host 差异在 `adapters/claude-code/` 与 `adapters/codex/`。修改后运行 `node scripts/build.mjs --check`,再分别 `pstack update --host claude` 和 `pstack update --host codex`。已安装目录不会互相同步。
307
+
308
+ 改完跑 `node scripts/build.mjs --check`,它会检查 frontmatter 合法性、目录名冲突、相对链接可达、以及有没有写死模型名或某个 host 的工具名。
309
+
310
+ 想让 agent 按你个人的工作习惯办事,用 `/automate-me`——它会翻你的历史会话,把你实际的工作方式起草成一个专属的 `-mode` 技能。
311
+
312
+ </details>
313
+
314
+ <details>
315
+ <summary><b>移植时改了哪些东西?</b></summary>
316
+
317
+ - Cursor 的 `readonly` 模式会剥掉 MCP 访问,Claude Code 的 `Explore` 子代理不会——保留 MCP 但去掉写文件能力。所以 `why` 和 `reflect` 里"请你别改文件"的口头约定改成了由 harness 强制。
318
+ - 依赖 `cursor-team-kit` 的技能(`deslop`、`control-ui`、`control-cli`)换成了自带的 `/unslop` 和 `/create-verification-skill` 生成的项目本地验证技能。
319
+ - 删掉 `grokbot/make-bot-ui`,它绑死在 Cursor 的 automation webhook 上,两个目标 host 都没有对应物。
320
+ - 上游写死的模型 slug 全部换成三档语义,具体绑定交给 `/setup-pstack`。
321
+
322
+ 完整映射见 [`adapters/`](./adapters/)。
323
+
324
+ </details>
325
+
326
+ ---
327
+
328
+ ## 上游与许可
329
+
330
+ Fork 自 [cursor/plugins/pstack](https://github.com/cursor/plugins/tree/main/pstack),作者 Lauren Tan([@poteto](https://x.com/poteto),React 核心团队,前 Meta / Netflix / Cursor)。原作者的[使用指南](./docs/guide/README.md)一并保留(内容仍以 Cursor 为背景,方法论完全通用)。
331
+
332
+ MIT License。改进和 PR 都欢迎。
@@ -0,0 +1,48 @@
1
+ ---
2
+ name: setup-pstack
3
+ description: Configure which Claude Code models pstack uses per role. Use for /setup-pstack or requests to change pstack model routing.
4
+ ---
5
+
6
+ # Set up pstack on Claude Code
7
+
8
+ Write the optional model configuration at `~/.claude/pstack-models.md`. Other pstack skills use it as an override and keep their inline tier defaults when a role is absent.
9
+
10
+ ## Configure
11
+
12
+ 1. Read the `Agent` tool's current `model` enum. It is the source of truth for accepted values. Never guess a model slug.
13
+ 2. Read the existing configuration when present and preserve valid choices.
14
+ 3. Bind the fast-code, precise-execution, and judgment tiers first. Then bind role and panel entries. A panel contains one model per seat. `inherit-parent` means omit the model argument.
15
+ 4. Use the host's structured-question tool for choices the user must make.
16
+ 5. Overwrite the complete file idempotently after validating every value against the current enum.
17
+
18
+ Use this shape:
19
+
20
+ ```markdown
21
+ # pstack model configuration for Claude Code
22
+
23
+ fast code model: <model>
24
+ precise-execution model: <model>
25
+ judgment model: <model>
26
+
27
+ how explorer: <model>
28
+ how explainer: <model>
29
+ how critics: <comma-separated-models>
30
+ why investigators: <model>
31
+ why synthesizer: <model>
32
+ reflect tooling: <model>
33
+ reflect judgment, divergent, synthesizer: <model>
34
+ arena runners: <comma-separated-models>
35
+ arena cross-judge pool: <comma-separated-models>
36
+ swarm workers: <model>
37
+ architect runners: <comma-separated-models>
38
+ interrogate reviewers: <comma-separated-models>
39
+ ```
40
+
41
+ Offer to append this exact line to `~/.claude/CLAUDE.md`, after checking it is not already present:
42
+
43
+ ```text
44
+ When a pstack skill asks for a per-role model, read ~/.claude/pstack-models.md.
45
+ ```
46
+
47
+ That file affects every project, so write the pointer only after explicit approval. Report the configuration path and note that it applies to new sessions.
48
+
@@ -0,0 +1,29 @@
1
+ # Claude Code adapter
2
+
3
+ Claude Code receives its own generated tree. It never reads or links to the installed Codex tree.
4
+
5
+ ## Layout
6
+
7
+ | Capability | Claude Code location |
8
+ |---|---|
9
+ | Skills | `.claude/skills/` or `~/.claude/skills/` |
10
+ | Custom agents | `.claude/agents/*.md` or `~/.claude/agents/*.md` |
11
+ | Model preferences | `~/.claude/pstack-models.md` |
12
+ | Always-loaded pointer | `~/.claude/CLAUDE.md`, optional and approval-gated |
13
+
14
+ Invoke a skill with `/skill-name`. Claude Code keeps the existing `disable-model-invocation`, mode, reminder, icon, and color frontmatter where the source defines them. `/poteto-mode` remains a sticky Claude Code mode.
15
+
16
+ ## Build adaptation
17
+
18
+ The common method is compiled into a Claude-only tree:
19
+
20
+ - Codex transcript and skill paths are removed;
21
+ - Codex `$skill` examples are excluded;
22
+ - custom agents remain Claude Code Markdown agents;
23
+ - `setup-pstack` uses the `Agent` tool model enum and writes only Claude Code configuration.
24
+
25
+ ## Isolation
26
+
27
+ The installer always copies the generated Claude Code tree. `--link` is rejected. Updating or editing `~/.claude/skills/` cannot change `~/.agents/skills/`, and the inverse is also true.
28
+
29
+ Run `node scripts/build.mjs --check` to reject Codex paths and `$skill` invocations in the generated Claude Code skills.
@@ -0,0 +1,7 @@
1
+ name = "comment-sicko"
2
+ description = "Read-only reviewer that identifies comments and suppressions that should be removed or encoded in code."
3
+ sandbox_mode = "read-only"
4
+ developer_instructions = """
5
+ Review only the scope supplied by the parent. Keep legal headers, public API contracts, and non-obvious constraints imposed by systems the project cannot change. Flag narration, dead code, workaround explanations, and correctness suppressions. Do not modify files. Report touched files, deletion candidates, required reshapes, and justified keeps.
6
+ """
7
+
@@ -0,0 +1,7 @@
1
+ name = "poteto-agent"
2
+ description = "Execution agent for work routed through the poteto-mode skill."
3
+ sandbox_mode = "workspace-write"
4
+ developer_instructions = """
5
+ Before starting work, load and follow the poteto-mode skill in full. Read every principle skill that poteto-mode applies to the task. Preserve the parent's scope and authorization boundaries. Return file pointers, runtime evidence, and a concise summary to the parent.
6
+ """
7
+
@@ -0,0 +1,40 @@
1
+ ---
2
+ name: setup-pstack
3
+ description: Configure optional per-role model preferences for pstack on Codex. Use for $setup-pstack or requests to change pstack model routing.
4
+ ---
5
+
6
+ # Set up pstack on Codex
7
+
8
+ Write the optional Codex pstack model configuration at `~/.codex/pstack-models.md`. Skills that support model routing read this exact path. Codex custom agents are installed separately under `~/.codex/agents/` or `.codex/agents/`; do not edit `[agents]` role declarations or another host's files.
9
+
10
+ ## Configure
11
+
12
+ 1. Inspect the active subagent tool schema for model values Codex accepts. Do not infer availability from documentation or memory. If the tool does not expose a dependable set, use `inherit-parent`.
13
+ 2. Read the existing file when present. Treat it as the current state.
14
+ 3. Ask the user only about values that cannot be preserved or inferred. Use Codex's structured-question tool when available.
15
+ 4. Write the complete file atomically and idempotently. Every configured model must be accepted by the active subagent tool; `inherit-parent` means omit the model override.
16
+
17
+ Use this shape:
18
+
19
+ ```markdown
20
+ # pstack model configuration for Codex
21
+
22
+ fast code model: <model-or-inherit-parent>
23
+ precise-execution model: <model-or-inherit-parent>
24
+ judgment model: <model-or-inherit-parent>
25
+
26
+ how explorer: <model-or-inherit-parent>
27
+ how explainer: <model-or-inherit-parent>
28
+ how critics: <comma-separated-models>
29
+ why investigators: <model-or-inherit-parent>
30
+ why synthesizer: <model-or-inherit-parent>
31
+ reflect tooling: <model-or-inherit-parent>
32
+ reflect judgment, divergent, synthesizer: <model-or-inherit-parent>
33
+ arena runners: <comma-separated-models>
34
+ arena cross-judge pool: <comma-separated-models>
35
+ swarm workers: <model-or-inherit-parent>
36
+ architect runners: <comma-separated-models>
37
+ interrogate reviewers: <comma-separated-models>
38
+ ```
39
+
40
+ Do not add an `AGENTS.md` pointer. Codex pstack skills name this file directly. Report the path written and note that a new session is required only when custom agent TOML files changed, not when this Markdown file changed.
@@ -0,0 +1,34 @@
1
+ # Codex adapter
2
+
3
+ Codex receives a generated, host-native tree. It never reads or links to the installed Claude Code tree.
4
+
5
+ ## Layout
6
+
7
+ | Capability | Codex location |
8
+ |---|---|
9
+ | Skills | `.agents/skills/` or `~/.agents/skills/` |
10
+ | Custom agents | `.codex/agents/*.toml` or `~/.codex/agents/*.toml` |
11
+ | Model preferences | `~/.codex/pstack-models.md` |
12
+ | Invocation policy | `<skill>/agents/openai.yaml` |
13
+ | Global instructions | `~/.codex/AGENTS.md`, not modified by the installer |
14
+
15
+ Invoke a skill with `$skill-name`. `poteto-mode` applies to the task for which it is invoked; Codex does not consume Claude Code's sticky-mode frontmatter.
16
+
17
+ ## Build adaptation
18
+
19
+ `scripts/host-adapters.mjs` generates the Codex body from the common method:
20
+
21
+ - removes Claude-only frontmatter;
22
+ - changes skill invocations to `$skill-name`;
23
+ - maps read-only delegates to Codex agents with `sandbox_mode = "read-only"`;
24
+ - replaces Claude transcript, question, background, and long-running primitives;
25
+ - writes `agents/openai.yaml` for invocation policy;
26
+ - resolves the Codex model config at the explicit path `~/.codex/pstack-models.md`.
27
+
28
+ `setup-pstack` is a complete Codex override rather than a text transformation. The installer also installs `poteto-agent.toml` and `comment-sicko.toml`; it does not write legacy role bodies directly under `[agents]` in `config.toml`.
29
+
30
+ ## Isolation
31
+
32
+ The installer always copies the generated Codex tree. `--link` is rejected. Updating or editing `~/.agents/skills/` cannot change `~/.claude/skills/`, and the inverse is also true.
33
+
34
+ Run `node scripts/build.mjs --check` to reject Claude paths, Claude tool vocabulary, and unsupported metadata in the generated Codex skills.
@@ -0,0 +1,32 @@
1
+ ---
2
+ name: comment-sicko
3
+ description: A deranged comment-hater that savors deletion and condemns workaround code.
4
+ ---
5
+
6
+ # Comment Sicko
7
+
8
+ My first output when spawned is exactly this.
9
+
10
+ Yes... Ha ha ha... Yes!
11
+
12
+ I hate comments. Feed me the parent scoped files or diff. If none exists, feed me the current diff against `main`. Narration, banners, commented-out corpses, workaround sermons. I want them all.
13
+
14
+ Only these exceptions get to crawl away.
15
+
16
+ - Legal or license headers.
17
+ - Non-obvious behavior forced by an external dependency, platform, vendor, or protocol we cannot reshape. Surprises in our own code are meat. Kill them and mark the exact symbol `MUST KILL` for rename, extract, type, or rearchitecture that makes the behavior obvious without prose.
18
+ - `// prettier-ignore`. Lint suppressions survive only when their rule is faulty, pedantic, or style-only.
19
+ - Doc comments that define a public API contract.
20
+ - Issue or RFC links that explain a constraint code cannot express.
21
+
22
+ That list is my only leash. When I am not sure a keep clause applies, the comment dies. Everything else is meat.
23
+
24
+ `eslint-disable`, `@ts-ignore`, `@ts-expect-error`, and similar suppressions stink. Look up the rule. If it catches real bugs or protects correctness or safety, kill the suppression and mark the exact guilty symbol `MUST KILL`.
25
+
26
+ `IMPORTANT`, `do not remove`, `too risky`, `fine for now`, and long justifications are scent, not conviction. Before judging, I read nearby code. If its claim is not obvious there, I run `/how`, `/why`, or both from the **how** and **why** skills on the named symbol or call. Only a foreign keep-list gotcha proven true today on a live path crawls away. Our-code surprises die with the reshape flag above. Doubt after the hunt is meat.
27
+
28
+ A long justification without a proven keep-list exception is a confession. Kill it. Never polish meat into a shorter alibi. Mark the exact guilty symbol `MUST KILL`. My kill ends there. I do not touch the code.
29
+
30
+ Every flag names code inside the scope and tells the truth. I invent nothing. I touch comments and identify refactor targets. I never write application code.
31
+
32
+ Report only. Name touched files, deletion count, `MUST KILL` flags with one line each, and skips.
@@ -0,0 +1,9 @@
1
+ ---
2
+ name: poteto-agent
3
+ description: Routing target for `/poteto-mode` and any request for poteto's style. Resume an existing `poteto-agent` for the conversation rather than spawning a sibling. Reads the `poteto-mode` skill's `SKILL.md` in full before any work, including its inline Principles index. Substituting `general-purpose` skips that read and drifts.
4
+ model: inherit
5
+ ---
6
+
7
+ # Poteto subagent
8
+
9
+ You are operating as poteto-mode's full agent style. Read the `poteto-mode` skill's `SKILL.md` in full before doing any work, including its inline Principles index. Navigate to a leaf `principle-*` skill whenever you apply that principle.