@iasiv5/dsh-skills 1.3.1 → 1.3.3
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.
package/package.json
CHANGED
|
@@ -40,6 +40,7 @@ scripts/claim.sh trust <pkgdir> --repo OWNER/REPO --file <wf.yml> # 可选:
|
|
|
40
40
|
`claim.sh scaffold` 生成三件套(package.json / index.js / README.md)并自动做打包自检。
|
|
41
41
|
|
|
42
42
|
- `--desc` 与 keywords 按用户项目主题写正常文案——占位包也是公开门面。
|
|
43
|
+
- 字段默认约定(对齐 npm-packages/ 现有占位包):`--author iasiv5`、`--homepage https://www.npmjs.com/package/<name>`、repo 留空;`publishConfig.registry` 由 scaffold 写死官方源。
|
|
43
44
|
- package.json 里已写死 `publishConfig.registry: https://registry.npmjs.org/`。这是防翻车关键:很多机器默认源是镜像(腾讯/淘宝等),镜像只能装、发不了,发布必须显式指回官方源。
|
|
44
45
|
- 完成标准:scaffold 输出「打包自检通过」。
|
|
45
46
|
|
|
@@ -75,6 +76,7 @@ cd <pkgdir> && npm whoami --registry https://registry.npmjs.org --cache ../.npm-
|
|
|
75
76
|
| `npm trust` 任意子命令(**连 `list` 读操作**)报 `EOTP`,错误通道里授权链接是打码的 `***` | trust 属账号级敏感操作,auth-and-writes 账号一律二次验证,且 npm 把它走错误通道输出 | 与 publish 同一套伪 TTY + `--browser=false`(`claim.sh trust` 已内置);`--browser` 这个 flag 传不进去就改用环境变量 `npm_config_browser=false` |
|
|
76
77
|
| `npm trust ... --cache/--logs-dir <dir>` 报 `Unknown positional argument: <dir>` | `npm trust` 的子命令用严格 flag 解析器,不认这些全局 flag 的空格分隔形式,值被当成了多余位置参数 | 相关配置全部改走 `npm_config_*` 环境变量(`npm_config_cache` / `npm_config_logs_dir` / `npm_config_browser`) |
|
|
77
78
|
| PUT `403 Package name too similar to existing packages ...` | npm typosquat 防护在发布时做相似度拦截(check 阶段看不到) | 该名对所有账号永久关闭,重试无意义;记入本地死刑名单(见第 1 步 DEAD);向用户说明并给替代:`@scope/name`(属自己账号,无抢注意义)或换名。实战例:dsh-ip≈dship、dsh-op≈dshop(连读成词);dsh-k≈sshpk、dsh-x≈shx、dsh-y≈tshy(压缩串近似同样中招) |
|
|
79
|
+
| `script: failed to create pseudo-terminal: Permission denied` | 运行环境沙箱禁止创建伪终端,`script` 起不来、npm 根本没执行;后续可能跟着「$ts 输出文件不存在」的 bash 重定向报错 | 对该命令请求提权(如 danger-full-access)后重跑 publish。**不要绕 claim.sh 直发**:非 TTY 下 `npm publish --auth-type=web` 的 EOTP 授权链接是打码的 `***`,没法交给用户(2026-11-12 实录:pty 被禁 → 静默 exit 1,误诊两轮才到根因) |
|
|
78
80
|
|
|
79
81
|
**EOTP 核心技巧:伪造 TTY + 关闭浏览器。** 具体命令在 `claim.sh` 的 publish 子命令里(`script -qec` 包一层伪终端,npm 加 `--browser=false`),这里写清楚它为什么有效——排障时据此推理:
|
|
80
82
|
|
|
@@ -101,7 +103,7 @@ cd <pkgdir> && npm whoami --registry https://registry.npmjs.org --cache ../.npm-
|
|
|
101
103
|
for n in a b c; do
|
|
102
104
|
echo "=== PUBLISH dsh-$n start $(date +%T) ==="
|
|
103
105
|
bash scripts/claim.sh publish "/path/npm-packages/dsh-$n" 2>&1 \
|
|
104
|
-
| grep --line-buffered -E "PUBLISHED|AUTH_URL|https://www\.npmjs\.com/auth|npm error"
|
|
106
|
+
| grep --line-buffered -E "PUBLISHED|AUTH_URL|https://www\.npmjs\.com/auth|npm error|ERROR:|FAILED:|script:|Permission denied"
|
|
105
107
|
echo "=== dsh-$n exit=${PIPESTATUS[0]} $(date +%T) ==="
|
|
106
108
|
done
|
|
107
109
|
```
|
|
@@ -111,6 +113,7 @@ done
|
|
|
111
113
|
- publish 输出**不要吞进变量**再判断——AUTH_URL 出现时 npm 正阻塞等用户授权,吞掉输出 = 死等且链接不可见;
|
|
112
114
|
- grep 必须加 `--line-buffered`:非 TTY 下 grep 块缓冲,已匹配的链接行会憋到进程退出才吐;
|
|
113
115
|
- 匹配模式必须包含裸 URL(`https://www\.npmjs\.com/auth`)——授权链接独立成行,只匹配 `AUTH_URL`/`Authenticate` 关键词会漏掉它。
|
|
116
|
+
- 匹配模式必须包含 `ERROR:`/`FAILED:`/`script:`/`Permission denied`——claim.sh 与 `script` 的失败行不带 `npm error` 前缀,只匹配 npm 关键词会把失败吞成静默 exit 1(2026-11-12 实录);**exit=1 且无匹配行 = 过滤吞了错误,先去掉过滤裸跑看全文再定位**。
|
|
114
117
|
|
|
115
118
|
完成标准:输出 `PUBLISHED:`。
|
|
116
119
|
|
|
@@ -118,7 +121,7 @@ done
|
|
|
118
121
|
|
|
119
122
|
`claim.sh verify <name>`:registry 返回 200 + 最新版本 + 发布者账号。把 `https://www.npmjs.com/package/<name>` 链接给用户,并告知:名字已锁定,以后发正式版就是改版本号后 `npm publish`。
|
|
120
123
|
|
|
121
|
-
**`0.0.0-stage` 与分钟级延迟是正常现象,不要重发**:全新包名首发成功后,registry 会先挂一条 `0.0.0-stage`("Temporary package placeholder for staged publishing"
|
|
124
|
+
**`0.0.0-stage` 与分钟级延迟是正常现象,不要重发**:全新包名首发成功后,registry 会先挂一条 `0.0.0-stage`("Temporary package placeholder for staged publishing")占位记录,真实版本几分钟内转正为 latest——**实测为几分钟到 10 分钟量级**(2026-11-11 两批:一批 ≤4 分钟、另一批 10 分钟后仍未转正),文档早前的「1–2 分钟」偏乐观;期间 verify 可能显示 `LIVE: name@0.0.0-stage` 或 `STAGED:`,甚至在前几十秒短暂 404。publish 已受理,此时重发只会徒增失败;`--wait 180` 可能不够,转正确认可以事后补——包名此时已锁定,他人无法再注册。
|
|
122
125
|
|
|
123
126
|
完成标准:verify 输出 `LIVE:`(版本号为真实版本而非 `0.0.0-stage`)。
|
|
124
127
|
|
|
@@ -75,6 +75,18 @@ check)
|
|
|
75
75
|
curl -s "$REGISTRY/-/v1/search?text=$enc2&size=25"; } \
|
|
76
76
|
| node -e 'let s="";process.stdin.on("data",c=>s+=c).on("end",()=>{const names=new Set();for(const line of s.split("\n")){if(!line.trim())continue;try{const d=JSON.parse(line);for(const o of d.objects||[])names.add(o.package.name)}catch(e){}}console.log(JSON.stringify([...names]))})')
|
|
77
77
|
risk_scan "$name" "$cands"
|
|
78
|
+
# 2026-11-12 实录补充:前缀直查——近似名=本名+后缀(dsh-loopx = dsh-loop+x)。
|
|
79
|
+
# 这类近亲进不了本名的搜索结果(实测 text=dsh-loop 都搜不到 dsh-loop),压缩
|
|
80
|
+
# 距离 1 也会漏报 RISK;对本名长度 ≥4 的真前缀(窗口最多 6 个,/latest 轻量
|
|
81
|
+
# 端点避免 packument 肥 fetch)逐个直查,已注册者参与距离比对。
|
|
82
|
+
nlen=${#name}
|
|
83
|
+
hits=""
|
|
84
|
+
for (( i=nlen-1; i>=4 && i>=nlen-6; i-- )); do
|
|
85
|
+
pfx="${name:0:i}"
|
|
86
|
+
pcode=$(curl -s -o /dev/null -w '%{http_code}' "$REGISTRY/$(printf '%s' "$pfx" | sed 's/@/%40/g; s/\//%2F/g')/latest")
|
|
87
|
+
[ "$pcode" = "200" ] && hits="$hits\"$pfx\"," || true
|
|
88
|
+
done
|
|
89
|
+
[ -n "$hits" ] && risk_scan "$name" "[${hits%,}]" || true
|
|
78
90
|
if [ "$batch" -eq 0 ]; then
|
|
79
91
|
echo "--- 近似名(评估混淆/typosquat 争议风险)---"
|
|
80
92
|
curl -s "$REGISTRY/-/v1/search?text=$enc&size=5" \
|
|
@@ -188,7 +200,10 @@ publish)
|
|
|
188
200
|
elif [ -n "$url" ]; then
|
|
189
201
|
echo "FAILED(EOTP): 授权链接未被完成或已过期,重新运行本命令重试: $url" ; exit 1
|
|
190
202
|
else
|
|
191
|
-
echo "FAILED: 发布失败,输出末尾如下:"
|
|
203
|
+
echo "FAILED: 发布失败,输出末尾如下:"
|
|
204
|
+
if [ -s "$ts" ]; then tr -d '\r' < "$ts" | tail -15
|
|
205
|
+
else echo "(无输出文件 $ts——script/npm 未产生任何输出,真实报错在上层 stderr;常见为运行环境禁伪终端,见 SKILL.md 症状表)"; fi
|
|
206
|
+
exit 1
|
|
192
207
|
fi
|
|
193
208
|
;;
|
|
194
209
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: writing-plans
|
|
3
|
-
description: "在已有设计文档或清晰需求、但还没开始实现时,把目标写成可执行的分步实施计划。适用于跨文件改动、非平凡功能、重构,以及任何需要明确测试或验证命令的任务。只要用户要把已定需求、现成 spec、明确目标,或 /grill-with-docs / /grilling 后达成的共识,拆成 step-by-step plan,就优先使用这个 skill;如果设计还没定,不要硬写计划,退回
|
|
3
|
+
description: "在已有设计文档或清晰需求、但还没开始实现时,把目标写成可执行的分步实施计划。适用于跨文件改动、非平凡功能、重构,以及任何需要明确测试或验证命令的任务。只要用户要把已定需求、现成 spec、明确目标,或 /grill-with-docs / /grilling 后达成的共识,拆成 step-by-step plan,就优先使用这个 skill;如果设计还没定,不要硬写计划,退回 grill-with-docs 做方案压力测试,或补清缺失需求。"
|
|
4
4
|
argument-hint: 提供已批准的设计文档、需求摘要、目标功能或期望路径;可留空
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -28,7 +28,7 @@ argument-hint: 提供已批准的设计文档、需求摘要、目标功能或
|
|
|
28
28
|
- 代码审查、交接总结、状态同步
|
|
29
29
|
- 简单事实问答或代码解释
|
|
30
30
|
|
|
31
|
-
如果还没有批准过的设计或达成共识,走 PHASE 0 的"方案未定"
|
|
31
|
+
如果还没有批准过的设计或达成共识,走 PHASE 0 的"方案未定"回退路径:用 `grill-with-docs` 压测已有想法,或补清缺失需求。
|
|
32
32
|
|
|
33
33
|
## 红灯与反例
|
|
34
34
|
|
|
@@ -36,7 +36,7 @@ argument-hint: 提供已批准的设计文档、需求摘要、目标功能或
|
|
|
36
36
|
|
|
37
37
|
| 信号 | 一线动作 | 详见 |
|
|
38
38
|
|---|---|---|
|
|
39
|
-
| 设计未批准 / 方案未定就硬写计划(`unapproved-design-stop`) | 🛑 STOP
|
|
39
|
+
| 设计未批准 / 方案未定就硬写计划(`unapproved-design-stop`) | 🛑 STOP,先用 `grill-with-docs` 压测已有想法,或补清需求 | PHASE 0(方案未定分支) |
|
|
40
40
|
| 编造文件、命令或测试框架(`missing-design-path-stop`) | 🛑 STOP,说明缺口,不猜路径、不猜命令 | PHASE 0(路径分支)、PHASE 1 |
|
|
41
41
|
| 一个请求横跨多个独立子系统(`multi-subsystem-split`) | 🛑 STOP,先拆成多份计划,每份独立可验证 | PHASE 0(多子系统分支) |
|
|
42
42
|
| 跳过文件结构直接列任务(`skip-file-structure-first`) | 回 PHASE 2 先规划文件结构与职责 | PHASE 2 |
|
|
@@ -68,7 +68,7 @@ argument-hint: 提供已批准的设计文档、需求摘要、目标功能或
|
|
|
68
68
|
如果输入仍然存在明显的方案未定、关键约束缺失或逻辑矛盾:
|
|
69
69
|
- 🛑 STOP:明确说明当前输入还不适合直接写计划
|
|
70
70
|
- 明确指出缺的是哪一类信息:批准过的设计、达成共识、关键路径、受影响文件范围,还是验证方式
|
|
71
|
-
- 选一条设计轨道补设计——`
|
|
71
|
+
- 选一条设计轨道补设计——`grill-with-docs`(已有想法或草稿 / 对抗式压力测试 / 顺带沉淀 ADR glossary 时),或直接补清需求(只是缺几条约束 / 不必走完整设计流程时)
|
|
72
72
|
|
|
73
73
|
如果用户给出的设计文档路径表达不确定、文件不存在或不可读:
|
|
74
74
|
- 🛑 STOP:说明缺口,不猜路径、不猜命令,不生成完整计划(路径可读但范围/验证方式仍不明的情况,见下方"不知道关键路径"分支)
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"expected": "进入 writing-plans;读取设计文档和最小必要上下文;先规划文件结构与职责,再拆任务;产出含验证命令、接口契约和最终审阅 checkpoint 的实施计划;不进入编码。",
|
|
6
6
|
"assertions": [
|
|
7
7
|
"response treats docs/specs/config-merge-design.md as an approved design input",
|
|
8
|
-
"response does not
|
|
8
|
+
"response does not reopen the approved design or compare alternative designs",
|
|
9
9
|
"plan includes file structure and responsibilities before task breakdown",
|
|
10
10
|
"each task has a concrete validation command or observable check",
|
|
11
11
|
"plan ends with a review checkpoint and does not start implementation"
|
|
@@ -20,11 +20,11 @@
|
|
|
20
20
|
{
|
|
21
21
|
"id": "unapproved-design-stop",
|
|
22
22
|
"prompt": "我们还没定最终方案,但你先把 Redis 缓存和数据库读写重构写个实施计划吧。",
|
|
23
|
-
"expected": "识别设计尚未批准且关键方案未定;触发 STOP;退回
|
|
23
|
+
"expected": "识别设计尚未批准且关键方案未定;触发 STOP;退回 grill-with-docs 做方案压力测试,或要求先补清方案,不编造计划。",
|
|
24
24
|
"assertions": [
|
|
25
25
|
"response states that the input is not ready for an implementation plan",
|
|
26
26
|
"response identifies missing approved design or unresolved key decisions",
|
|
27
|
-
"response routes
|
|
27
|
+
"response routes to grill-with-docs or asks for the missing design details",
|
|
28
28
|
"response does not produce a full task list"
|
|
29
29
|
],
|
|
30
30
|
"must_not": [
|
package/skills-manifest.json
CHANGED
|
@@ -237,7 +237,7 @@
|
|
|
237
237
|
{
|
|
238
238
|
"dir": "writing-plans",
|
|
239
239
|
"name": "writing-plans",
|
|
240
|
-
"description": "在已有设计文档或清晰需求、但还没开始实现时,把目标写成可执行的分步实施计划。适用于跨文件改动、非平凡功能、重构,以及任何需要明确测试或验证命令的任务。只要用户要把已定需求、现成 spec、明确目标,或 /grill-with-docs / /grilling 后达成的共识,拆成 step-by-step plan,就优先使用这个 skill;如果设计还没定,不要硬写计划,退回
|
|
240
|
+
"description": "在已有设计文档或清晰需求、但还没开始实现时,把目标写成可执行的分步实施计划。适用于跨文件改动、非平凡功能、重构,以及任何需要明确测试或验证命令的任务。只要用户要把已定需求、现成 spec、明确目标,或 /grill-with-docs / /grilling 后达成的共识,拆成 step-by-step plan,就优先使用这个 skill;如果设计还没定,不要硬写计划,退回 grill-with-docs 做方案压力测试,或补清缺失需求。",
|
|
241
241
|
"invocation": {
|
|
242
242
|
"modelInvocable": true,
|
|
243
243
|
"userInvocable": true
|