@namewta/speculo 1.0.1 → 1.0.2

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 (79) hide show
  1. package/README.md +3 -2
  2. package/package.json +2 -2
  3. package/template/AGENTS.md +12 -1
  4. package/template/canonical/canonical-specdev-goal-plan.md +10 -1
  5. package/template/canonical/canonical-specdev-grill-with-docs.md +7 -0
  6. package/template/canonical/canonical-specdev-orchestrate-implementation.md +18 -2
  7. package/template/canonical/canonical-specdev-spec.md +7 -0
  8. package/template/canonical/canonical-specdev-tickets.md +13 -6
  9. package/template/canonical/canonical-specdev-wayfinder.md +7 -0
  10. package/template/commands/archive-and-consolidate.md +1 -2
  11. package/template/commands/docs-sync.md +1 -1
  12. package/template/commands/git-repository-audit.md +1 -1
  13. package/template/commands/handoff.md +1 -1
  14. package/template/commands/retro.md +1 -1
  15. package/template/commands/status.md +1 -1
  16. package/template/skills/archive-and-consolidate/SKILL.md +9 -168
  17. package/template/skills/archive-and-consolidate/references/entry-procedure.md +170 -0
  18. package/template/skills/docs-sync/SKILL.md +9 -11
  19. package/template/skills/docs-sync/references/entry-procedure.md +18 -0
  20. package/template/skills/engineering-standards-builder/SKILL.md +9 -148
  21. package/template/skills/engineering-standards-builder/references/entry-procedure.md +154 -0
  22. package/template/skills/git-history-squash/SKILL.md +9 -88
  23. package/template/skills/git-history-squash/references/entry-procedure.md +94 -0
  24. package/template/skills/github-npm-ops/SKILL.md +9 -18
  25. package/template/skills/github-npm-ops/references/entry-procedure.md +25 -0
  26. package/template/skills/optimize-codex-config/SKILL.md +12 -72
  27. package/template/skills/optimize-codex-config/references/entry-procedure.md +78 -0
  28. package/template/skills/source-code-zip/SKILL.md +10 -559
  29. package/template/skills/source-code-zip/references/entry-procedure.md +565 -0
  30. package/template/skills/speculo-retro/SKILL.md +9 -16
  31. package/template/skills/speculo-retro/references/entry-procedure.md +23 -0
  32. package/template/skills/upstream-fork-sync/SKILL.md +10 -72
  33. package/template/skills/upstream-fork-sync/references/entry-procedure.md +78 -0
  34. package/template/skills/writing-great-skills/SKILL.md +9 -73
  35. package/template/skills/writing-great-skills/references/entry-procedure.md +79 -0
  36. package/template/workflows/learning/A-archive/A-archive.md +7 -0
  37. package/template/workflows/learning/A-assess-and-plan/A-assess-and-plan.md +7 -0
  38. package/template/workflows/learning/C-consolidate/C-consolidate.md +7 -0
  39. package/template/workflows/learning/H-homework/H-homework.md +8 -1
  40. package/template/workflows/learning/I-init-setup/I-init-setup.md +7 -0
  41. package/template/workflows/learning/INDEX.md +2 -0
  42. package/template/workflows/learning/L-lesson/L-lesson.md +7 -0
  43. package/template/workflows/learning/R-review/R-review.md +8 -1
  44. package/template/workflows/learning/README.md +3 -1
  45. package/template/workflows/learning/common/rules/activation-and-memory.md +20 -0
  46. package/template/workflows/ops/A-archive-and-learn/A-archive-and-learn.md +7 -0
  47. package/template/workflows/ops/E-execute-and-stabilize/E-execute-and-stabilize.md +8 -1
  48. package/template/workflows/ops/I-intake-and-assess/I-intake-and-assess.md +7 -0
  49. package/template/workflows/ops/INDEX.md +2 -0
  50. package/template/workflows/ops/P-plan-and-approve/P-plan-and-approve.md +8 -1
  51. package/template/workflows/ops/README.md +3 -0
  52. package/template/workflows/ops/common/rules/activation-and-memory.md +20 -0
  53. package/template/workflows/person/INDEX.md +2 -0
  54. package/template/workflows/person/M-mao-zedong-cognitive-os/M-mao-zedong-cognitive-os.md +9 -0
  55. package/template/workflows/person/M-mao-zedong-cognitive-os/books/README.md +1 -1
  56. package/template/workflows/person/S-steelman-deliberation/S-steelman-deliberation.md +7 -0
  57. package/template/workflows/person/common/rules/activation-and-memory.md +20 -0
  58. package/template/workflows/specdev/A-archive-and-consolidate/A-archive-and-consolidate.md +7 -0
  59. package/template/workflows/specdev/C-code-review/C-code-review.md +7 -0
  60. package/template/workflows/specdev/D-diagnose-bugs/D-diagnose-bugs.md +7 -0
  61. package/template/workflows/specdev/G-grill-with-docs/G-grill-with-docs.md +7 -0
  62. package/template/workflows/specdev/I-implement/I-implement.md +7 -0
  63. package/template/workflows/specdev/I-implement/execution-preflight.md +1 -1
  64. package/template/workflows/specdev/I-init-setup/I-init-setup.md +7 -0
  65. package/template/workflows/specdev/INDEX.md +2 -0
  66. package/template/workflows/specdev/L-learn-change/L-learn-change.md +7 -0
  67. package/template/workflows/specdev/O-orchestrate-implementation/O-orchestrate-implementation.md +10 -1
  68. package/template/workflows/specdev/P-goal-plan/P-goal-plan.md +10 -1
  69. package/template/workflows/specdev/P-prototype/P-prototype.md +7 -0
  70. package/template/workflows/specdev/R-review-architecture/R-review-architecture.md +7 -0
  71. package/template/workflows/specdev/README.md +3 -0
  72. package/template/workflows/specdev/S-spec/S-spec.md +7 -0
  73. package/template/workflows/specdev/T-tickets/T-tickets.md +10 -3
  74. package/template/workflows/specdev/T-tickets/ticket-template.md +2 -2
  75. package/template/workflows/specdev/T-tickets/tickets-map-template.md +1 -1
  76. package/template/workflows/specdev/T-triage/T-triage.md +7 -0
  77. package/template/workflows/specdev/W-wayfinder/W-wayfinder.md +7 -0
  78. package/template/workflows/specdev/common/README.md +1 -0
  79. package/template/workflows/specdev/common/rules/activation-and-memory.md +20 -0
@@ -1,568 +1,19 @@
1
1
  ---
2
2
  name: source-code-zip
3
- description: 使用单文件 Node.js 脚本把指定源码目录打包为精简 ZIP,并通过可编辑的 JavaScript 正则 IGNORE 规则排除 node_modules、构建产物、压缩包、.env、YAML、密钥、媒体和其他非代码文件。用户要求归档、传输、备份或提交源码目录时使用。必须优先直接使用 node 运行;不得为了运行该脚本执行 npm install
4
- ---
5
-
6
- # Source Code ZIP
7
-
8
- 把一个目录压缩为安全、精简、主要只包含源码的 ZIP。实际执行逻辑位于:
9
-
10
- ```text
11
- scripts/zip_source_code.js
12
- ```
13
-
14
- 该实现只有一个 JavaScript 文件,只使用 Node.js 内置模块:
15
-
16
- ```text
17
- fs
18
- path
19
- os
20
- crypto
21
- zlib
22
- stream
23
- util
24
- ```
25
-
26
- 不需要:
27
-
28
- - `npm install`
29
- - `package.json`
30
- - `node_modules`
31
- - Python 或 `uv`
32
- - 系统 `zip` 命令
33
- - 任何第三方 JavaScript 包
34
-
35
- 建议使用 Node.js 14 或更高版本。
36
-
37
- ## 必须遵循的运行方式
38
-
39
- 始终先确认 `node` 可用:
40
-
41
- ```bash
42
- node --version
43
- ```
44
-
45
- 然后直接运行:
46
-
47
- ```bash
48
- node scripts/zip_source_code.js "/path/to/project"
49
- ```
50
-
51
- Windows PowerShell:
52
-
53
- ```powershell
54
- node scripts/zip_source_code.js "C:\path\to\project"
55
- ```
56
-
57
- 少数 Linux 发行版可能只提供 `nodejs` 命令;只有 `node` 确实不存在时,才回退为:
58
-
59
- ```bash
60
- nodejs scripts/zip_source_code.js "/path/to/project"
61
- ```
62
-
63
- 不要为了运行本 SKILL 创建 npm 项目,也不要执行:
64
-
65
- ```text
66
- npm install
67
- pnpm install
68
- yarn install
69
- ```
70
-
71
- 脚本没有第三方依赖,上述操作没有必要,还可能额外生成需要被排除的依赖目录和锁文件。
72
-
73
- 在 macOS 或 Linux 上,也可以把脚本设为可执行文件后直接运行:
74
-
75
- ```bash
76
- chmod +x scripts/zip_source_code.js
77
- ./scripts/zip_source_code.js "/path/to/project"
78
- ```
79
-
80
- ## 标准工作流
81
-
82
- 1. 确认用户提供的是目录路径,不是单个文件;路径含空格时必须加引号。
83
- 2. 先确认 `node --version` 能正常执行。
84
- 3. 默认先运行一次 `--dry-run`;目录较大、规则刚修改或可能包含敏感信息时,同时添加 `--verbose`。
85
- 4. 检查预览结果,确认 `.env`、YAML、依赖目录、构建产物、归档文件和密钥没有被纳入。
86
- 5. 正式创建 ZIP。
87
- 6. 报告 ZIP 的绝对路径、纳入文件数、输入总大小和生成结果。
88
- 7. 除非用户明确理解风险并提出要求,不得使用 `--no-default-ignore`。
89
-
90
- 推荐预览:
91
-
92
- ```bash
93
- node scripts/zip_source_code.js "/path/to/project" --dry-run
94
- ```
95
-
96
- 查看每个项目被排除的原因:
97
-
98
- ```bash
99
- node scripts/zip_source_code.js "/path/to/project" \
100
- --dry-run \
101
- --verbose
102
- ```
103
-
104
- 正式创建:
105
-
106
- ```bash
107
- node scripts/zip_source_code.js "/path/to/project"
108
- ```
109
-
110
- 默认输出在源目录旁边:
111
-
112
- ```text
113
- <目录名>.code.zip
114
- ```
115
-
116
- 例如:
117
-
118
- ```text
119
- 源目录:/work/my-app
120
- 输出: /work/my-app.code.zip
121
- ```
122
-
123
- ## 默认过滤行为
124
-
125
- 脚本采用两层过滤:
126
-
127
- 1. `IGNORE` 正则先排除危险、庞大或明确不需要的内容。
128
- 2. 默认源码白名单只纳入常见代码扩展名、特殊构建脚本名,以及带 shebang 的无扩展名脚本。
129
-
130
- 内置 `IGNORE` 默认排除:
131
-
132
- - `.git`、`.hg`、`.svn`。
133
- - `.idea`、`.vscode` 和常见系统元数据。
134
- - `node_modules`、`node_module`、`vendor` 和常见依赖目录。
135
- - Python 虚拟环境、测试缓存、编译缓存和通用缓存目录。
136
- - `dist`、`build`、`target`、`out`、覆盖率目录和常见前端框架缓存。
137
- - `.env`、`.env.local`、`.env.production` 等环境变量文件。
138
- - `.yml` 和 `.yaml`。
139
- - ZIP、RAR、7z、TAR、GZ、JAR、WHL 等归档文件。
140
- - 可执行文件、动态库、目标文件、字节码和 WebAssembly 产物。
141
- - 证书、私钥、keystore 和常见 SSH 密钥文件名。
142
- - 图片、音频、视频、PDF 和 Office 文件。
143
- - 数据库、日志、临时文件和备份文件。
144
- - 常见依赖锁文件。
145
- - `.min.js`、`.bundle.js`、`.min.css`、`.bundle.css` 等压缩或打包产物。
146
-
147
- 默认源码白名单包括但不限于:
148
-
149
- - JavaScript、TypeScript、JSX、TSX。
150
- - Python、Java、Kotlin、Scala、Go、Rust、C、C++、C#、Swift。
151
- - Shell、PowerShell、Ruby、PHP、Perl、Lua。
152
- - HTML、CSS、SCSS、Vue、Svelte、Astro、MDX。
153
- - SQL、GraphQL、Protocol Buffers、Terraform、HCL、Nix。
154
- - Dockerfile、Makefile、CMakeLists.txt、Jenkinsfile、Bazel 和 Meson 构建文件。
155
- - 带 `#!` shebang 的无扩展名脚本。
156
-
157
- `README.md`、`package.json`、`pyproject.toml` 等普通项目文件默认不会进入 ZIP;需要时使用 `--include`。
158
-
159
- ## IGNORE 正则字段
160
-
161
- 脚本顶部包含可直接编辑的字段:
162
-
163
- ```js
164
- const IGNORE = [
165
- String.raw`(^|/)\.git(?:/|$)`,
166
- String.raw`(^|/)node_modules(?:/|$)`,
167
- String.raw`\.zip$`,
168
- String.raw`(^|/)\.env(?:\..*)?$`,
169
- String.raw`\.ya?ml$`,
170
- ];
171
- ```
172
-
173
- 实际脚本中的默认列表更完整。
174
-
175
- 匹配规则:
176
-
177
- - 匹配对象是相对于源目录的路径。
178
- - 路径分隔符统一为 `/`,即使在 Windows 上也是如此。
179
- - 路径开头没有 `/`。
180
- - 脚本使用 `new RegExp(pattern, "i")`,默认不区分大小写。
181
- - 使用的是 JavaScript 正则表达式,不是 Git `.gitignore` glob。
182
- - 不要使用 Python 独有的正则语法。
183
- - 忽略规则优先于 `--include`。
184
- - 被忽略的目录不会继续遍历。
185
-
186
- 显示全部默认规则:
187
-
188
- ```bash
189
- node scripts/zip_source_code.js --show-defaults
190
- ```
191
-
192
- 临时追加一个忽略正则,不修改脚本:
193
-
194
- ```bash
195
- node scripts/zip_source_code.js ./project \
196
- --ignore '(^|/)fixtures?(/|$)'
197
- ```
198
-
199
- 追加多个正则:
200
-
201
- ```bash
202
- node scripts/zip_source_code.js ./project \
203
- --ignore '(^|/)fixtures?(/|$)' \
204
- --ignore '(^|/)generated(/|$)'
205
- ```
206
-
207
- 也可以从 UTF-8 文本文件读取正则。每行一个规则,空行和以 `#` 开头的行会被忽略:
208
-
209
- ```bash
210
- node scripts/zip_source_code.js ./project \
211
- --ignore-from ./custom-ignore.regex
212
- ```
213
-
214
- 规则文件示例:
215
-
216
- ```text
217
- # 测试夹具
218
- (^|/)fixtures?(/|$)
219
-
220
- # 自动生成代码
221
- (^|/)generated(/|$)
222
- \.gen\.[a-z0-9]+$
223
- ```
224
-
225
- `--ignore-from` 可以重复使用。
226
-
227
- ## 纳入额外项目文件
228
-
229
- 默认只纳入源码。需要额外打包 `package.json` 时:
230
-
231
- ```bash
232
- node scripts/zip_source_code.js ./project \
233
- --include '(^|/)package\.json$'
234
- ```
235
-
236
- 同时纳入多个项目清单:
237
-
238
- ```bash
239
- node scripts/zip_source_code.js ./project \
240
- --include '(^|/)package\.json$' \
241
- --include '(^|/)pyproject\.toml$' \
242
- --include '(^|/)Cargo\.toml$'
243
- ```
244
-
245
- `--include` 只绕过源码扩展名白名单,不会绕过 `IGNORE`。例如,下列内容即使被 `--include` 匹配,仍会被默认安全规则排除:
246
-
247
- ```text
248
- .env
249
- config.yml
250
- private.key
251
- archive.zip
252
- ```
253
-
254
- 需要纳入所有未被 `IGNORE` 排除的普通文件时:
255
-
256
- ```bash
257
- node scripts/zip_source_code.js ./project --all-files
258
- ```
259
-
260
- 只有用户明确要求并理解风险时,才可同时禁用默认过滤:
261
-
262
- ```bash
263
- node scripts/zip_source_code.js ./project \
264
- --all-files \
265
- --no-default-ignore
266
- ```
267
-
268
- 该组合可能把凭据、依赖目录、密钥、大型二进制文件和已有归档打包,不得作为默认方案。
269
-
270
- ## 输出控制
271
-
272
- 指定输出位置:
273
-
274
- ```bash
275
- node scripts/zip_source_code.js ./project \
276
- --output ./artifacts/project-source.zip
277
- ```
278
-
279
- `-o` 是 `--output` 的缩写:
280
-
281
- ```bash
282
- node scripts/zip_source_code.js ./project \
283
- -o ./artifacts/project-source.zip
284
- ```
285
-
286
- 输出名称没有 `.zip` 后缀时,脚本会自动补上:
3
+ description: Create a requested source ZIP using the bundled Node script and its ignore rules; do not install dependencies.
287
4
 
288
- ```bash
289
- node scripts/zip_source_code.js ./project -o ./artifacts/project-source
290
- ```
291
-
292
- 实际输出:
293
-
294
- ```text
295
- ./artifacts/project-source.zip
296
- ```
297
-
298
- 默认拒绝覆盖已有 ZIP。确认允许覆盖后使用:
299
-
300
- ```bash
301
- node scripts/zip_source_code.js ./project \
302
- -o ./artifacts/project-source.zip \
303
- --force
304
- ```
305
-
306
- 默认 ZIP 内保留一个顶层目录:
307
-
308
- ```text
309
- project/src/main.js
310
- project/tests/main.test.js
311
- ```
312
-
313
- 需要把源目录内容直接放到 ZIP 根目录时:
314
-
315
- ```bash
316
- node scripts/zip_source_code.js ./project --contents-only
317
- ```
318
-
319
- 此时 ZIP 内路径类似:
320
-
321
- ```text
322
- src/main.js
323
- tests/main.test.js
324
- ```
325
-
326
- ## 压缩级别
327
-
328
- 压缩级别范围为 `0` 到 `9`,默认是 `9`:
329
-
330
- ```bash
331
- node scripts/zip_source_code.js ./project \
332
- --compression-level 6
333
- ```
334
-
335
- 含义:
336
-
337
- - `0`:仅存储,不执行 Deflate 压缩。
338
- - `1`:压缩更快。
339
- - `9`:通常压缩率更高,但运行时间可能更长。
340
-
341
- 脚本使用 Node.js 内置 `zlib`,不调用外部压缩程序。
342
-
343
- ## 预览和输出模式
344
-
345
- 只预览,不创建 ZIP:
346
-
347
- ```bash
348
- node scripts/zip_source_code.js ./project --dry-run
349
- ```
350
-
351
- 预览并显示每个排除原因:
352
-
353
- ```bash
354
- node scripts/zip_source_code.js ./project \
355
- --dry-run \
356
- --verbose
357
- ```
358
-
359
- 适合自动化脚本的安静模式;成功时只输出 ZIP 绝对路径:
360
-
361
- ```bash
362
- archive_path="$(node scripts/zip_source_code.js ./project --quiet)"
363
- printf '%s\n' "$archive_path"
364
- ```
365
-
366
- Windows PowerShell:
367
-
368
- ```powershell
369
- $archivePath = node scripts/zip_source_code.js "C:\work\project" --quiet
370
- $archivePath
371
- ```
372
-
373
- `--verbose` 与 `--quiet` 不能同时使用。
374
-
375
- ## 完整命令示例
376
-
377
- 安全预览:
378
-
379
- ```bash
380
- node scripts/zip_source_code.js "/work/my app" \
381
- --dry-run \
382
- --verbose
383
- ```
384
-
385
- 打包源码并额外纳入 Node 项目清单:
386
-
387
- ```bash
388
- node scripts/zip_source_code.js "/work/my app" \
389
- --include '(^|/)package\.json$' \
390
- --include '(^|/)tsconfig\.json$' \
391
- -o "/work/artifacts/my-app-source.zip"
392
- ```
393
-
394
- 排除测试夹具和自动生成目录:
395
-
396
- ```bash
397
- node scripts/zip_source_code.js ./project \
398
- --ignore '(^|/)fixtures?(/|$)' \
399
- --ignore '(^|/)generated(/|$)'
400
- ```
401
-
402
- 纳入所有非敏感普通文件,但仍保留默认安全排除:
403
-
404
- ```bash
405
- node scripts/zip_source_code.js ./project \
406
- --all-files \
407
- --dry-run
408
- ```
409
-
410
- 直接将内容写入 ZIP 根目录,并设置中等压缩级别:
411
-
412
- ```bash
413
- node scripts/zip_source_code.js ./project \
414
- --contents-only \
415
- --compression-level 6
416
- ```
417
-
418
- 目录名以 `-` 开头时,在选项后使用 `--`:
419
-
420
- ```bash
421
- node scripts/zip_source_code.js -- ./-special-project
422
- ```
423
-
424
- ## 空目录行为
425
-
426
- 默认情况下,没有任何匹配文件时脚本会报错,避免误生成看似成功但没有内容的 ZIP。
427
-
428
- 确认需要空 ZIP 时:
429
-
430
- ```bash
431
- node scripts/zip_source_code.js ./empty-project \
432
- --allow-empty
433
- ```
434
-
435
- 可以结合 `--dry-run` 检查为什么没有文件被纳入:
436
-
437
- ```bash
438
- node scripts/zip_source_code.js ./empty-project \
439
- --dry-run \
440
- --verbose \
441
- --allow-empty
442
- ```
443
-
444
- ## 安全与可靠性约束
445
-
446
- - 默认跳过所有符号链接,不跟随到源目录之外。
447
- - 忽略规则在额外纳入规则之前执行。
448
- - 默认拒绝覆盖已有 ZIP。
449
- - 输出 ZIP 位于源目录内部时,会排除该输出文件本身。
450
- - ZIP 先写入同目录的临时文件,完整写入并同步后才安装到最终路径。
451
- - 未使用 `--force` 时,最终安装采用“不覆盖已有目标”的方式,降低并发竞态造成误覆盖的风险。
452
- - 源文件逐个流式读取和压缩,不会一次性把整个目录或整个 ZIP 放入内存。
453
- - 脚本自行计算 CRC32,并生成标准 ZIP 中央目录。
454
- - 脚本支持 ZIP64 元数据,可处理中央目录偏移或条目数量超过普通 ZIP 字段范围的情况。
455
- - 若文件在扫描后变成符号链接或不再是普通文件,脚本会中止。
456
- - 默认不创建空 ZIP;需要时必须显式使用 `--allow-empty`。
457
- - 收到中断信号时会尝试删除临时 ZIP。
458
- - 修改 `IGNORE` 后,正式打包前必须重新运行 `--dry-run --verbose`。
459
-
460
- ## 常见问题
461
-
462
- ### node 命令不存在
463
-
464
- 先确认是否只有 `nodejs` 命令:
465
-
466
- ```bash
467
- nodejs --version
468
- ```
469
-
470
- 若存在,可运行:
471
-
472
- ```bash
473
- nodejs scripts/zip_source_code.js ./project
474
- ```
475
-
476
- 若两个命令都不存在,需要先按当前系统或组织规定安装 Node.js。不要因此执行 `npm install`;npm 不能代替 Node.js 运行时。
477
-
478
- ### Node.js 版本过低
479
-
480
- 脚本会显示当前版本和最低要求。升级到 Node.js 14 或更高版本后重新执行。
481
-
482
- ### 没有找到可打包文件
483
-
484
- 先查看默认规则:
485
-
486
- ```bash
487
- node scripts/zip_source_code.js --show-defaults
488
- ```
489
-
490
- 再预览全部未被忽略的普通文件:
491
-
492
- ```bash
493
- node scripts/zip_source_code.js ./project \
494
- --all-files \
495
- --dry-run
496
- ```
497
-
498
- 若只缺少少量项目文件,使用 `--include`,不要直接禁用默认忽略规则。
499
-
500
- ### package.json 没有进入 ZIP
501
-
502
- 这是默认行为,因为 JSON 不属于默认源码扩展名。显式添加:
503
-
504
- ```bash
505
- node scripts/zip_source_code.js ./project \
506
- --include '(^|/)package\.json$'
507
- ```
508
-
509
- ### YAML 没有进入 ZIP
510
-
511
- 这是默认安全规则,也是本 SKILL 的明确过滤要求。`--include` 不会绕过该规则。
512
-
513
- 只有用户明确要求改变这一行为时,才编辑脚本顶部的 `IGNORE`,或使用风险更高的 `--no-default-ignore` 并重新补充其他安全规则。
514
-
515
- ### 输出文件已存在
516
-
517
- 指定新文件名,或确认覆盖安全后添加:
518
-
519
- ```bash
520
- --force
521
- ```
522
-
523
- ### 正则无效
524
-
525
- 脚本会指出无效的命令行正则,或 `--ignore-from` 文件中的具体行号。
526
-
527
- 规则必须符合 JavaScript `RegExp` 语法。例如,Python 的某些内联标志或专用结构不能直接使用。
528
-
529
- ### ZIP 内多了一层项目目录
530
-
531
- 这是默认行为。需要直接写入目录内容时添加:
532
-
533
- ```bash
534
- --contents-only
535
- ```
5
+ ---
536
6
 
537
- ### 需要查看所有命令参数
7
+ # source-code-zip
538
8
 
539
- ```bash
540
- node scripts/zip_source_code.js --help
541
- ```
9
+ This file is the routing entry. Read [`references/entry-procedure.md`](references/entry-procedure.md) only after this skill is selected. Read a named reference there only for the active branch.
542
10
 
543
- 版本信息:
11
+ ## Scope
544
12
 
545
- ```bash
546
- node scripts/zip_source_code.js --version
547
- ```
13
+ - Trigger: Create a requested source ZIP using the bundled Node script and its ignore rules; do not install dependencies.
14
+ - Output and write owner remain those declared by the entry procedure and the owning command/workflow.
15
+ - Do not infer missing scope, credentials, target, or authorization.
548
16
 
549
- ## 参数速查
17
+ ## Stop
550
18
 
551
- ```text
552
- -o, --output <ZIP> 指定输出路径
553
- -f, --force 覆盖已有输出
554
- --ignore <REGEX> 追加忽略规则,可重复
555
- --ignore-from <FILE> 从文件读取忽略规则,可重复
556
- --include <REGEX> 额外纳入文件,可重复
557
- --all-files 关闭源码白名单
558
- --no-default-ignore 禁用默认忽略规则
559
- --contents-only ZIP 根目录直接放内容
560
- --compression-level <0-9> 压缩级别
561
- --dry-run 仅预览
562
- --allow-empty 允许空 ZIP
563
- -v, --verbose 显示跳过原因
564
- -q, --quiet 成功时只输出路径
565
- --show-defaults 显示默认规则
566
- --version 显示版本
567
- -h, --help 显示帮助
568
- ```
19
+ Stop before side effects when the required input, owner, reference, confirmation, schema, or recovery evidence is missing; report the exact blocker and preserve any dry-run evidence.