@namewta/speculo 1.0.18 → 1.0.20

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 (195) hide show
  1. package/README.md +8 -7
  2. package/THIRD-PARTY-NOTICES.md +33 -0
  3. package/dist/src/agent-files.js +2 -2
  4. package/dist/src/agent-files.js.map +1 -1
  5. package/dist/src/agent-skills.d.ts +81 -0
  6. package/dist/src/agent-skills.js +530 -0
  7. package/dist/src/agent-skills.js.map +1 -0
  8. package/dist/src/cli.js +11 -3
  9. package/dist/src/cli.js.map +1 -1
  10. package/dist/src/config.js +5 -3
  11. package/dist/src/config.js.map +1 -1
  12. package/dist/src/doctor.js +7 -2
  13. package/dist/src/doctor.js.map +1 -1
  14. package/dist/src/index.d.ts +8 -0
  15. package/dist/src/index.js +23 -3
  16. package/dist/src/index.js.map +1 -1
  17. package/dist/src/manifest.d.ts +9 -0
  18. package/dist/src/manifest.js +45 -7
  19. package/dist/src/manifest.js.map +1 -1
  20. package/dist/src/refresh.js +40 -0
  21. package/dist/src/refresh.js.map +1 -1
  22. package/dist/src/structured.js +15 -4
  23. package/dist/src/structured.js.map +1 -1
  24. package/dist/src/transaction.d.ts +24 -3
  25. package/dist/src/transaction.js +191 -12
  26. package/dist/src/transaction.js.map +1 -1
  27. package/package.json +10 -4
  28. package/scripts/validate-skills.mjs +56 -0
  29. package/template/AGENTS.md +1 -1
  30. package/template/CLAUDE.md +1 -1
  31. package/template/canonical/canonical-specdev-goal-plan.md +158 -30
  32. package/template/canonical/canonical-specdev-grill-with-docs.md +155 -33
  33. package/template/canonical/canonical-specdev-spec.md +162 -161
  34. package/template/canonical/canonical-specdev-tickets.md +155 -29
  35. package/template/canonical/canonical-specdev-wayfinder.md +144 -29
  36. package/template/commands/handoff.md +16 -0
  37. package/template/commands/retro.md +12 -10
  38. package/template/skills/archive-and-consolidate/SKILL.md +163 -7
  39. package/template/skills/archive-and-consolidate/references/cleanup-rules.md +1 -1
  40. package/template/skills/docs-sync/references/agents/claude-redirect.md +8 -8
  41. package/template/skills/docs-sync/references/agents/content-contract.md +1 -1
  42. package/template/skills/docs-sync/references/agents/manifest-discovery.md +7 -7
  43. package/template/skills/docs-sync/references/agents/role-classification.md +4 -4
  44. package/template/skills/docs-sync/references/agents-contract.md +1 -1
  45. package/template/skills/engineering-standards-builder/SKILL.md +149 -9
  46. package/template/skills/engineering-standards-builder/agents/openai.yaml +2 -0
  47. package/template/skills/engineering-standards-builder/manifest.txt +2 -1
  48. package/template/skills/engineering-standards-builder/references/rules/09-mechanical-guardrails.md +9 -0
  49. package/template/skills/engineering-standards-builder/scripts/validate-builder.mjs +4 -7
  50. package/template/skills/git-history-squash/SKILL.md +87 -11
  51. package/template/skills/git-history-squash/agents/openai.yaml +2 -0
  52. package/template/skills/optimize-codex-config/SKILL.md +71 -11
  53. package/template/skills/retrospective/SKILL.md +43 -0
  54. package/template/skills/{speculo-retro → retrospective}/references/friction-taxonomy.md +22 -13
  55. package/template/skills/{speculo-retro → retrospective}/references/issue-drafting-sop.md +13 -21
  56. package/template/skills/source-code-zip/SKILL.md +44 -8
  57. package/template/skills/source-code-zip/references/{entry-procedure.md → cli-reference.md} +0 -43
  58. package/template/skills/upstream-fork-sync/SKILL.md +71 -8
  59. package/template/skills/{writing-great-skills → writing-for-agents}/GLOSSARY.md +1 -1
  60. package/template/skills/writing-for-agents/SKILL.md +22 -0
  61. package/template/skills/writing-for-agents/agents/openai.yaml +2 -0
  62. package/template/skills/{writing-great-skills/references/entry-procedure.md → writing-for-agents/references/authoring-principles.md} +2 -9
  63. package/template/workflows/learning/A-archive/A-archive.md +2 -5
  64. package/template/workflows/learning/A-assess-and-plan/A-assess-and-plan.md +2 -5
  65. package/template/workflows/learning/C-consolidate/C-consolidate.md +2 -5
  66. package/template/workflows/learning/G-goal/G-goal.md +5 -23
  67. package/template/workflows/learning/H-homework/H-homework.md +2 -5
  68. package/template/workflows/learning/I-init-setup/I-init-setup.md +4 -9
  69. package/template/workflows/learning/L-lesson/L-lesson.md +2 -5
  70. package/template/workflows/learning/Q-question/Q-question.md +16 -8
  71. package/template/workflows/learning/Q-question/inquiry-template.md +2 -0
  72. package/template/workflows/learning/Q-question/tools/validate-inquiry.mjs +112 -0
  73. package/template/workflows/learning/R-review/R-review.md +3 -6
  74. package/template/workflows/learning/README.md +2 -2
  75. package/template/workflows/learning/common/rules/knowledge-organization.md +1 -1
  76. package/template/workflows/learning/common/rules/mastery-policy.md +1 -1
  77. package/template/workflows/learning/common/skills/socratic-questioning/SKILL.md +1 -1
  78. package/template/workflows/ops/D-project-deploy/D-project-deploy.md +6 -2
  79. package/template/workflows/ops/H-host-manage/H-host-manage.md +10 -18
  80. package/template/workflows/ops/H-host-manage/references/host-profiles.md +21 -0
  81. package/template/workflows/ops/I-initialize/I-initialize.md +4 -4
  82. package/template/workflows/ops/README.md +22 -84
  83. package/template/workflows/ops/S-server-connect/S-server-connect.md +3 -3
  84. package/template/workflows/ops/V-inventory-view/V-inventory-view.md +2 -2
  85. package/template/workflows/ops/common/rules/deployment-layout.md +51 -0
  86. package/template/workflows/ops/common/rules/recovery.md +6 -0
  87. package/template/workflows/ops/common/rules/server-onboarding.md +6 -0
  88. package/template/workflows/ops/common/tests/test_ops.mjs +5 -8
  89. package/template/workflows/ops/common/tests/test_ops_bootstrap.mjs +71 -14
  90. package/template/workflows/ops/common/tests/test_ops_workspace.mjs +17 -8
  91. package/template/workflows/ops/common/tools/opslib/bootstrap.mjs +4 -4
  92. package/template/workflows/ops/common/tools/opslib/transport.mjs +3 -3
  93. package/template/workflows/person/M-mao-zedong-cognitive-os/M-mao-zedong-cognitive-os.md +13 -68
  94. package/template/workflows/person/S-steelman-deliberation/S-steelman-deliberation.md +11 -123
  95. package/template/workflows/person/S-steelman-deliberation/references/state-and-publication.md +86 -0
  96. package/template/workflows/specdev/A-archive-and-consolidate/A-archive-and-consolidate.md +2 -17
  97. package/template/workflows/specdev/A-archive-and-consolidate/consolidation-interview.md +13 -4
  98. package/template/workflows/specdev/C-code-review/C-code-review.md +4 -15
  99. package/template/workflows/specdev/C-code-review/code-review-template.md +4 -0
  100. package/template/workflows/specdev/D-diagnose-bugs/D-diagnose-bugs.md +4 -20
  101. package/template/workflows/specdev/G-grill-with-docs/G-grill-with-docs.md +2 -2
  102. package/template/workflows/specdev/G-grill-with-docs/references/interview-procedure.md +6 -6
  103. package/template/workflows/specdev/I-implement/I-implement.md +2 -2
  104. package/template/workflows/specdev/I-implement/evidence-template.md +8 -0
  105. package/template/workflows/specdev/I-implement/references/implementation-procedure.md +9 -43
  106. package/template/workflows/specdev/I-implement/tdd-rules.md +4 -0
  107. package/template/workflows/specdev/I-init-setup/I-init-setup.md +16 -117
  108. package/template/workflows/specdev/I-init-setup/config-template.json +5 -1
  109. package/template/workflows/specdev/I-init-setup/references/first-setup.md +46 -0
  110. package/template/workflows/specdev/INDEX.md +2 -2
  111. package/template/workflows/specdev/L-learn-change/L-learn-change.md +11 -89
  112. package/template/workflows/specdev/L-learn-change/references/lesson-format.md +47 -0
  113. package/template/workflows/specdev/P-goal-plan/P-goal-plan.md +2 -2
  114. package/template/workflows/specdev/P-goal-plan/planning-modes.md +1 -1
  115. package/template/workflows/specdev/P-prototype/P-prototype.md +7 -17
  116. package/template/workflows/specdev/P-prototype/logic-protocol.md +11 -0
  117. package/template/workflows/specdev/P-prototype/logic-template.md +27 -0
  118. package/template/workflows/specdev/P-prototype/project-preview-protocol.md +9 -0
  119. package/template/workflows/specdev/R-retro/R-retro.md +26 -0
  120. package/template/workflows/specdev/R-retro/retro-template.md +27 -0
  121. package/template/workflows/specdev/R-review-architecture/R-review-architecture.md +19 -57
  122. package/template/workflows/specdev/R-review-architecture/architecture-review-template.md +2 -1
  123. package/template/workflows/specdev/R-review-architecture/references/selected-design.md +23 -0
  124. package/template/workflows/specdev/R-review-architecture/review-rubric.md +2 -2
  125. package/template/workflows/specdev/README.md +17 -6
  126. package/template/workflows/specdev/S-spec/S-spec.md +13 -136
  127. package/template/workflows/specdev/T-tickets/T-tickets.md +6 -2
  128. package/template/workflows/specdev/T-triage/T-triage.md +32 -141
  129. package/template/workflows/specdev/T-triage/capture-protocol.md +1 -1
  130. package/template/workflows/specdev/T-triage/ci-security-protocol.md +11 -0
  131. package/template/workflows/specdev/T-triage/intake-protocol.md +29 -4
  132. package/template/workflows/specdev/T-triage/pr-delivery-protocol.md +13 -0
  133. package/template/workflows/specdev/T-triage/pr-record-template.md +39 -0
  134. package/template/workflows/specdev/T-triage/publish-protocol.md +1 -1
  135. package/template/workflows/specdev/T-triage/queue-protocol.md +7 -0
  136. package/template/workflows/specdev/T-triage/reconcile-protocol.md +1 -1
  137. package/template/workflows/specdev/T-triage/references/issue-pr-policy.md +23 -0
  138. package/template/workflows/specdev/T-triage/references/release-authentication.md +9 -0
  139. package/template/workflows/specdev/T-triage/references/release-notes-injection.md +21 -0
  140. package/template/workflows/specdev/T-triage/references/workflow-yaml-reference.md +37 -0
  141. package/template/workflows/specdev/T-triage/release-preflight.md +13 -0
  142. package/template/workflows/specdev/T-triage/release-protocol.md +12 -0
  143. package/template/workflows/specdev/T-triage/release-recovery.md +18 -0
  144. package/template/workflows/specdev/T-triage/remote-operations.md +25 -0
  145. package/template/workflows/specdev/T-triage/scripts/github-transport.mjs +208 -0
  146. package/template/workflows/specdev/T-triage/source-template.md +7 -0
  147. package/template/workflows/specdev/T-triage/triage-run-template.md +34 -0
  148. package/template/workflows/specdev/T-triage/triage-template.md +4 -1
  149. package/template/workflows/specdev/W-wayfinder/W-wayfinder.md +2 -2
  150. package/template/workflows/specdev/common/rules/artifact-contract.md +7 -0
  151. package/template/workflows/specdev/common/rules/change-completion.md +6 -0
  152. package/template/workflows/specdev/common/rules/deployment-handoff.md +23 -0
  153. package/template/workflows/specdev/common/rules/workflow-routing.md +6 -0
  154. package/template/workflows/specdev/common/rules/workflow-state-and-lifecycle.md +1 -1
  155. package/template/workflows/specdev/common/schemas/config.schema.json +137 -26
  156. package/template/workflows/specdev/common/schemas/logic-prototype.schema.json +62 -0
  157. package/template/workflows/specdev/common/schemas/pull-request.schema.json +90 -0
  158. package/template/workflows/specdev/common/schemas/retrospective.schema.json +58 -0
  159. package/template/workflows/specdev/common/schemas/triage-run.schema.json +149 -0
  160. package/template/workflows/specdev/common/schemas/triage.schema.json +117 -15
  161. package/template/workflows/specdev/common/skills/code-review/SKILL.md +5 -4
  162. package/template/workflows/specdev/common/skills/code-review/references/result-reuse.md +15 -0
  163. package/template/workflows/specdev/common/tools/delivery-artifacts.mjs +95 -0
  164. package/template/workflows/specdev/common/tools/validate-specdev.mjs +60 -19
  165. package/template/workflows/specdev/runtime-contract.json +4 -2
  166. package/template/skills/archive-and-consolidate/references/entry-procedure.md +0 -178
  167. package/template/skills/docs-sync/references/entry-procedure.md +0 -3
  168. package/template/skills/engineering-standards-builder/references/entry-procedure.md +0 -154
  169. package/template/skills/git-history-squash/references/entry-procedure.md +0 -94
  170. package/template/skills/github-npm-ops/SKILL.md +0 -19
  171. package/template/skills/github-npm-ops/references/ci-and-security-ops.md +0 -178
  172. package/template/skills/github-npm-ops/references/entry-procedure.md +0 -25
  173. package/template/skills/github-npm-ops/references/failure-recovery.md +0 -123
  174. package/template/skills/github-npm-ops/references/issue-pr-triage.md +0 -219
  175. package/template/skills/github-npm-ops/references/issue-transport.md +0 -26
  176. package/template/skills/github-npm-ops/references/package-json-checklist.md +0 -171
  177. package/template/skills/github-npm-ops/references/preflight-checklist.md +0 -39
  178. package/template/skills/github-npm-ops/references/publish-detection.md +0 -68
  179. package/template/skills/github-npm-ops/references/release-notes-injection.md +0 -238
  180. package/template/skills/github-npm-ops/references/release-pipeline.md +0 -108
  181. package/template/skills/github-npm-ops/references/setup-npm-token.md +0 -63
  182. package/template/skills/github-npm-ops/references/troubleshooting-playbook.md +0 -293
  183. package/template/skills/github-npm-ops/references/version-bump-flow.md +0 -217
  184. package/template/skills/github-npm-ops/references/workflow-yaml-reference.md +0 -268
  185. package/template/skills/github-npm-ops/scripts/issue-transport.mjs +0 -227
  186. package/template/skills/optimize-codex-config/references/entry-procedure.md +0 -78
  187. package/template/skills/speculo-retro/SKILL.md +0 -19
  188. package/template/skills/speculo-retro/references/entry-procedure.md +0 -23
  189. package/template/skills/upstream-fork-sync/references/entry-procedure.md +0 -78
  190. package/template/skills/writing-great-skills/SKILL.md +0 -23
  191. /package/template/skills/{writing-great-skills → writing-for-agents}/references/document-contract.md +0 -0
  192. /package/template/workflows/specdev/{G-grill-with-docs → common/rules}/adr-format.md +0 -0
  193. /package/template/workflows/specdev/{G-grill-with-docs → common/rules}/context-format.md +0 -0
  194. /package/template/workflows/specdev/{I-implement → common/rules}/design-it-twice.md +0 -0
  195. /package/template/workflows/specdev/{G-grill-with-docs/domain-modeling-rules.md → common/rules/domain-modeling.md} +0 -0
@@ -1,78 +0,0 @@
1
- # Entry procedure
2
-
3
- # Optimize Codex Config
4
-
5
- 以**体检**为主导词:先建立脱敏事实,再提出配置变更。默认只读;修改本机配置前必须向用户展示完整目标和脱敏 diff,并取得本次修改的明确确认。
6
-
7
- ## 1. 锁定范围与权限
8
-
9
- 1. 解析实际 `CODEX_HOME`;未显式设置时使用当前用户的 `~/.codex`。将它转成绝对路径并确认目标是目录且不是符号链接。
10
- 2. 将请求归类为只读体检、故障诊断或配置修改。只读体检和诊断不取得写权限。
11
- 3. 将本 skill 的写入边界限制为用户明确指定的本机 Codex 文件。CC Switch 数据库、远端 API、反向代理和 Nginx 只输出归因与交接建议。
12
- 4. 在任何可能写入前记录 `config.toml` 的哈希、大小和修改时间,并检查目标文件是否存在已证明的可写句柄。普通 Codex CLI、ChatGPT/Codex 应用进程及其 helper 的存在不构成 writer 证据。
13
-
14
- **完成标准:** 实际 `CODEX_HOME`、任务类型、允许写入的文件和外部边界均已明确;符号链接、已证明的活跃 writer、不明确目标,或修改任务无法取得 writer 观测时已成为 blocker。只读任务可以把不可用探针记录为 unknown 后继续。
15
-
16
- ## 2. 建立只读基线
17
-
18
- 从本 `SKILL.md` 所在目录运行:
19
-
20
- ```bash
21
- node scripts/audit-codex-config.mjs --codex-home <absolute-directory> --json
22
- ```
23
-
24
- 需要离线或可复现 fixture 时加入 `--no-command-probes`;需要缩小会话扫描范围时使用 `--since-days <N>`。先运行 `--help` 核对当前接口;CLI 不在导出的 `PATH` 中时,用 `command -v codex` 取得绝对路径并传给 `--codex-bin`。
25
-
26
- 1. 保留审计脚本的结构化结果;不得把 `auth.json` 内容、提示词、工具输出、完整接口 URL 或 bearer token复制进报告。
27
- 2. 直接查看配置时,先遮蔽 `experimental_bearer_token`、静态认证 header、环境变量值和 URL 主机。只检查 `auth.json` 的存在、文件类型、权限和 Codex 报告的认证模式,不读取或打印文件内容。
28
- 3. 对配置、供应商、认证、权限、Agent、MCP、Hook 或历史设置提出判断前,读取 [configuration contract](configuration-contract.md),并用已安装 CLI 与当前官方配置参考验证每个拟使用的键。
29
- 4. 把用户提供的既有设置视为需要保留或评估的事实,不把个人模型、认证方式或权限策略提升为通用默认值。
30
-
31
- **完成标准:** 当前版本、配置指纹、认证存储模式、供应商契约、权限、Agent、MCP、Hook、会话故障和 writer 状态均有脱敏证据;无法取得的事实被标为 unknown。
32
-
33
- ## 3. 归因故障
34
-
35
- 当请求包含 HTTP 状态码、SSE、超时或 compaction 失败时,读取 [troubleshooting](troubleshooting.md),按其中证据梯度完成归因。
36
-
37
- 1. 关联错误发生前最近一次 `token_count`,但只保留 token 数和模型上下文窗口。
38
- 2. 区分本机配置、认证、供应商 wire API、远端模型服务和前置代理。HTML 代理错误页属于代理证据,不归因给模型。
39
- 3. 对外部问题给出可复现证据、影响、临时本机缓解和服务端交接项。本 skill 不探测或修改用户未授权的远端系统。
40
-
41
- **完成标准:** 每个错误只有一个主要归属域,证据与推断分开,所有本机缓解都标明质量、成本或频率代价。
42
-
43
- ## 4. 设计目标状态
44
-
45
- 只询问审计无法发现且会改变方案的偏好:模型与推理等级、认证存储、审批与沙箱、网络访问、Agent 并发、供应商认证方式、历史保留,以及 MCP/Hook 的保留意图。
46
-
47
- 输出确认包:
48
-
49
- 1. 当前状态和问题证据;
50
- 2. 目标状态及每项理由;
51
- 3. 逐文件脱敏 diff;
52
- 4. 明确保留的未知项、MCP、Hook、profile 和兼容设置;
53
- 5. 备份名、原子写入方法、验证命令和回滚条件;
54
- 6. 不在本机范围内的外部 blocker。
55
-
56
- 只采用当前官方参考与已安装 CLI 均能验证的键。项目级 `.codex/config.toml` 不承载 provider、auth 或其他被 Codex 忽略的机器级设置。
57
-
58
- **完成标准:** 用户无需猜测任何目标值;diff 不含 secret;未关联的现有设置不会被清理;外部问题不会伪装成本机可修复项。
59
-
60
- ## 5. 确认后原子写入
61
-
62
- 只有用户在看到确认包后明确同意本次变更,才执行以下动作:
63
-
64
- 1. 重读指纹;若配置已变化、存在目标文件的可写句柄,或 writer 探针仍为 unknown,停止并重新体检。
65
- 2. 为每个待改文件创建不覆盖的 `*.pre-optimize-<YYYYMMDD-HHMMSS>.bak`,并将包含凭据的文件权限设为 `0600`。
66
- 3. 在同一目录写临时文件、解析或加载验证成功后 rename 到目标,保留与任务无关的表和注释。
67
- 4. 仅在用户明确要求且已安装 Codex 能验证格式时处理 `auth.json`。文件存储是有效选择,不强制迁移钥匙串;不得自行发明认证 JSON schema。
68
-
69
- **完成标准:** 写入前后的指纹、备份和确认可对应;目标文件是原子替换结果;没有越出已确认文件集合。
70
-
71
- ## 6. 验证与交付
72
-
73
- 1. 运行 `codex doctor --json`,再核对 `codex features list` 和 `codex debug models --bundled` 中与目标相关的能力。
74
- 2. 验证配置加载、认证模式、权限与沙箱、MCP、Hook、Agent 和旧会话恢复。只有用户授权可能计费的网络请求后,才执行最小第三方 API 请求。
75
- 3. 任一必须验证项失败时恢复备份,重跑相同检查并报告原始失败与回滚结果。
76
- 4. 报告已改变、已保留、已验证、未验证和外部 blocker;不回显任何 secret 或完整 URL。
77
-
78
- **完成标准:** 所有已确认变更通过本机验证,或已完整回滚;报告包含命令、退出码和关键脱敏证据。
@@ -1,19 +0,0 @@
1
- ---
2
- name: speculo-retro
3
- description: Extract and deduplicate friction from Speculo evidence into issue proposals; do not create issues without command confirmation.
4
- metadata: {"speculo-id": "speculo-retro", "speculo-kind": "skill", "speculo-legacy-name": "Speculo Retro"}
5
- ---
6
-
7
- # Speculo Retro
8
-
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.
10
-
11
- ## Scope
12
-
13
- - Trigger: Extract and deduplicate friction from Speculo evidence into issue proposals; do not create issues without command confirmation.
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.
16
-
17
- ## Stop
18
-
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.
@@ -1,23 +0,0 @@
1
- # Entry procedure
2
-
3
- # Speculo Retro
4
-
5
- ## 输入
6
-
7
- - 当前对话与本次使用的 commands/workflows。
8
- - `commands/<command>/*.md` 报告、active change 状态、archive 和 `INDEX.md` 声明的知识 store。
9
- - 可选已有 issues,用于语义去重。
10
-
11
- ## 流程
12
-
13
- 1. 读取 `references/friction-taxonomy.md`,穷尽扫描可用证据并列出原始摩擦。完成标准:每项都有来源路径或对话节点。
14
- 2. 按 bug、friction、missing-capability、doc-gap、ergonomics 归类,合并同一根因。完成标准:每项只属于一个根因簇,合并关系可追溯。
15
- 3. 评估影响与频率,过滤一次性噪声;低信号项标为丢弃或仅记教训。完成标准:每项都有优先级和处置理由。
16
- 4. 读取 `references/issue-drafting-sop.md`,生成 issue-ready 提案并与已有 issue 去重。完成标准:标题、证据、问题、建议、验收、影响资产和去重结论齐全。
17
-
18
- ## 输出
19
-
20
- - 按优先级排序的 `file-issue | lesson-only | discard | duplicate` 提案。
21
- - 合并/丢弃说明和调用方执行 `gh` 所需字段。
22
-
23
- 本 skill 不写文件、不调用外部 API;command 负责报告、确认和 issue 创建。
@@ -1,78 +0,0 @@
1
- # Entry procedure
2
-
3
- # Upstream Fork Sync
4
-
5
- 以**检查点**为主导词。每个仓库始终分开记录:本次观测到的 upstream tip、可选本地 mirror tip,以及已经由产品分支历史证明完成集成的 upstream checkpoint。Fetch 或 mirror 变化不能推进集成 checkpoint。
6
-
7
- ## 1. 解析上下文
8
-
9
- 1. 从当前目录向上寻找并读取 `<Path>{roots.state}/workspace.json</Path>`,验证 `path_base` 和所有 roots,再读取 `<Path>{roots.config}</Path>`;无法唯一确定项目根时停止。
10
- 2. 读取项目 `AGENTS.md` 及其作用域内规则。项目存在工程规范时读取适用入口。
11
- 3. 将本 Skill 的唯一持久化根解析为 `<Path>{roots.state}/skills/upstream-fork-sync/</Path>`。独立运行只写该根;不得创建 workflow change 或 command 报告。
12
- 4. 读取 [Repository contract](repository-contract.md),确定仓库、refs、网络刷新和副作用边界。
13
-
14
- 完成标准:项目根、Skill state 根、目标仓库集合和本次是否允许 fetch 都只有一个解释。
15
-
16
- ## 2. 建立稳定配置
17
-
18
- 读取 `<Path>{roots.state}/skills/upstream-fork-sync/repository-map.json</Path>`。不存在时,只读发现 Git 仓库、remotes、默认产品分支和 upstream tracking refs,按 [Repository contract](repository-contract.md) 创建 schema v1 配置;无法从 Git 事实唯一判断的字段一次性询问用户。配置已存在时验证,不静默改写。
19
-
20
- 读取 `<Path>{roots.state}/skills/upstream-fork-sync/customization-map.md</Path>`。不存在时创建最小稳定清单,记录 fork 必须长期保留的产品不变量和审查热点;无法从项目文档或代码证明的业务约束标记为待确认。该文件不接收运行 SHA、dirty paths、冲突或本次结论。
21
-
22
- 完成标准:每个 repository id 唯一,所有项目路径和 refs 可解析,稳定配置与动态运行事实分离。
23
-
24
- ## 3. 创建评估 change
25
-
26
- 读取 [State schema](state-schema.md) 和 [Report contract](report-contract.md),从用户主题生成小写 ASCII kebab-case topic,然后运行:
27
-
28
- ```bash
29
- node <Path>{roots.skills}/upstream-fork-sync/scripts/upstream-sync.mjs</Path> assess \
30
- --root . \
31
- --state-root <Path>{roots.state}/skills/upstream-fork-sync</Path> \
32
- --repository-map <Path>{roots.state}/skills/upstream-fork-sync/repository-map.json</Path> \
33
- --topic <topic>
34
- ```
35
-
36
- - 默认离线使用本地 refs;只有用户明确要求刷新网络 refs 时添加 `--fetch`。
37
- - 只需预览完整冻结快照时添加 `--dry-run`,此分支不写 state 或 change。
38
- - 正常运行创建 `<Path>{roots.state}/skills/upstream-fork-sync/{date}-{topic}[-NN]/</Path>`,已有目录永不覆盖。
39
-
40
- 完成标准:脚本退出 0,change 的 state 与两份报告完整发布,根 `state.json` 只在 change 发布成功后更新。
41
-
42
- ## 4. 深化风险结论
43
-
44
- 逐仓库检查报告中的 Git 确认冲突、自动合并重叠和定制风险路径。对每条高风险路径使用报告冻结的 SHA 执行精确 `git diff <base>..<target> -- <path>`,再与 `customization-map.md` 的稳定不变量映射。
45
-
46
- 只把路径级证据支持的语义结论补入本 change 的报告。保持 Git 冲突、自动合并重叠、定制合同风险和 dirty-worktree 重叠为四个类别;零文本冲突不得表述为集成安全。
47
-
48
- 完成标准:所有冲突和定制热点都有结论或明确未验证项,报告中的命令可以从冻结 SHA 复现。
49
-
50
- ## 5. 返回后续选择
51
-
52
- 返回 change 路径、仓库 checkpoint、观测 upstream SHA、风险摘要和未验证项。列出适合继续处理的已安装 Work,但不自动创建 workflow change、不调用 Work、不 merge、不 commit、不 push;后续路线由用户选择。
53
-
54
- 完成标准:本次 Skill 在评估 change 完整后停止,用户能用冻结产物自行选择下一 Work。
55
-
56
- ## 6. 记录外部集成
57
-
58
- 只有其他 Work 已完成集成且用户要求更新 checkpoint 时进入此分支。读取目标 change state,并运行:
59
-
60
- ```bash
61
- node <Path>{roots.skills}/upstream-fork-sync/scripts/upstream-sync.mjs</Path> record-integration \
62
- --root . \
63
- --state-root <Path>{roots.state}/skills/upstream-fork-sync</Path> \
64
- --repository-map <Path>{roots.state}/skills/upstream-fork-sync/repository-map.json</Path> \
65
- --change <change> \
66
- --repository <repository-id> \
67
- --merge-commit <full-sha> \
68
- --upstream-sha <full-sha> \
69
- --verification '<command>: exit 0'
70
- ```
71
-
72
- 该入口只在 merge commit 可从产品 ref 到达、目标 upstream SHA 是其精确非第一父节点且匹配 change 冻结目标时更新状态;它不执行集成。
73
-
74
- 完成标准:change state 和根 checkpoint 都已原子重读,实际 Git 历史与记录一致。
75
-
76
- ## 停止条件
77
-
78
- 目标 ref 缺失、保存的 checkpoint 不在产品历史、checkpoint 不在当前 upstream 历史、存在多个 merge-base、配置越界或状态 schema 非法时,停止且不移动 refs、不发布部分 change、不推进 checkpoint。返回准确 repository id、路径、refs 与 SHAs。
@@ -1,23 +0,0 @@
1
- ---
2
- name: writing-great-skills
3
- description: Reference guidance for explicitly requested skill authoring or review; never auto-trigger.
4
- metadata: {"speculo-id": "writing-great-skills", "speculo-kind": "skill", "speculo-invocation": "user-only"}
5
- ---
6
-
7
- # writing-great-skills
8
-
9
- Activation is explicit-only. Metadata is descriptive; enforce host permissions and obtain user authorization before effects.
10
-
11
- 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.
12
-
13
- ## Scope
14
-
15
- - Trigger: Reference guidance for explicitly requested skill authoring or review; never auto-trigger.
16
- - Output and write owner remain those declared by the entry procedure and the owning command/workflow.
17
- - Do not infer missing scope, credentials, target, or authorization.
18
-
19
- For an authorized review or rewrite of a skill/document, read [`references/document-contract.md`](references/document-contract.md) before editing. Its fidelity checks apply to any document; this does not change this skill’s explicit-only activation policy.
20
-
21
- ## Stop
22
-
23
- 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.