@niujiajie/freespec 0.0.0-stage → 1.15.0

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 (308) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +58 -2
  3. package/bin/freespec.js +5 -0
  4. package/dist/cli/index.d.ts +25 -0
  5. package/dist/cli/index.js +359 -0
  6. package/dist/commands/shared-output.d.ts +18 -0
  7. package/dist/commands/shared-output.js +61 -0
  8. package/dist/commands/workflow/default-schema.d.ts +2 -0
  9. package/dist/commands/workflow/default-schema.js +4 -0
  10. package/dist/commands/workflow/index.d.ts +13 -0
  11. package/dist/commands/workflow/index.js +10 -0
  12. package/dist/commands/workflow/instructions.d.ts +39 -0
  13. package/dist/commands/workflow/instructions.js +565 -0
  14. package/dist/commands/workflow/new-change.d.ts +19 -0
  15. package/dist/commands/workflow/new-change.js +135 -0
  16. package/dist/commands/workflow/shared.d.ts +94 -0
  17. package/dist/commands/workflow/shared.js +169 -0
  18. package/dist/commands/workflow/status.d.ts +18 -0
  19. package/dist/commands/workflow/status.js +201 -0
  20. package/dist/core/artifact-graph/graph.d.ts +72 -0
  21. package/dist/core/artifact-graph/graph.js +165 -0
  22. package/dist/core/artifact-graph/index.d.ts +9 -0
  23. package/dist/core/artifact-graph/index.js +14 -0
  24. package/dist/core/artifact-graph/instruction-loader.d.ts +208 -0
  25. package/dist/core/artifact-graph/instruction-loader.js +268 -0
  26. package/dist/core/artifact-graph/outputs.d.ts +19 -0
  27. package/dist/core/artifact-graph/outputs.js +351 -0
  28. package/dist/core/artifact-graph/resolver.d.ts +89 -0
  29. package/dist/core/artifact-graph/resolver.js +342 -0
  30. package/dist/core/artifact-graph/schema.d.ts +27 -0
  31. package/dist/core/artifact-graph/schema.js +160 -0
  32. package/dist/core/artifact-graph/state.d.ts +12 -0
  33. package/dist/core/artifact-graph/state.js +31 -0
  34. package/dist/core/artifact-graph/types.d.ts +40 -0
  35. package/dist/core/artifact-graph/types.js +59 -0
  36. package/dist/core/available-tools.d.ts +18 -0
  37. package/dist/core/available-tools.js +49 -0
  38. package/dist/core/change-layout.d.ts +17 -0
  39. package/dist/core/change-layout.js +30 -0
  40. package/dist/core/change-metadata/index.d.ts +2 -0
  41. package/dist/core/change-metadata/index.js +2 -0
  42. package/dist/core/change-metadata/schema.d.ts +23 -0
  43. package/dist/core/change-metadata/schema.js +46 -0
  44. package/dist/core/change-status-policy.d.ts +49 -0
  45. package/dist/core/change-status-policy.js +50 -0
  46. package/dist/core/command-generation/adapters/amazon-q.d.ts +17 -0
  47. package/dist/core/command-generation/adapters/amazon-q.js +32 -0
  48. package/dist/core/command-generation/adapters/antigravity.d.ts +13 -0
  49. package/dist/core/command-generation/adapters/antigravity.js +27 -0
  50. package/dist/core/command-generation/adapters/atomcode.d.ts +24 -0
  51. package/dist/core/command-generation/adapters/atomcode.js +46 -0
  52. package/dist/core/command-generation/adapters/auggie.d.ts +13 -0
  53. package/dist/core/command-generation/adapters/auggie.js +28 -0
  54. package/dist/core/command-generation/adapters/bob.d.ts +18 -0
  55. package/dist/core/command-generation/adapters/bob.js +33 -0
  56. package/dist/core/command-generation/adapters/claude.d.ts +13 -0
  57. package/dist/core/command-generation/adapters/claude.js +32 -0
  58. package/dist/core/command-generation/adapters/cline.d.ts +14 -0
  59. package/dist/core/command-generation/adapters/cline.js +27 -0
  60. package/dist/core/command-generation/adapters/codeassistant.d.ts +15 -0
  61. package/dist/core/command-generation/adapters/codeassistant.js +29 -0
  62. package/dist/core/command-generation/adapters/codebuddy.d.ts +13 -0
  63. package/dist/core/command-generation/adapters/codebuddy.js +29 -0
  64. package/dist/core/command-generation/adapters/codestudio.d.ts +13 -0
  65. package/dist/core/command-generation/adapters/codestudio.js +27 -0
  66. package/dist/core/command-generation/adapters/command-code.d.ts +19 -0
  67. package/dist/core/command-generation/adapters/command-code.js +34 -0
  68. package/dist/core/command-generation/adapters/continue.d.ts +13 -0
  69. package/dist/core/command-generation/adapters/continue.js +33 -0
  70. package/dist/core/command-generation/adapters/costrict.d.ts +13 -0
  71. package/dist/core/command-generation/adapters/costrict.js +28 -0
  72. package/dist/core/command-generation/adapters/crush.d.ts +13 -0
  73. package/dist/core/command-generation/adapters/crush.js +30 -0
  74. package/dist/core/command-generation/adapters/cursor.d.ts +14 -0
  75. package/dist/core/command-generation/adapters/cursor.js +31 -0
  76. package/dist/core/command-generation/adapters/devin.d.ts +19 -0
  77. package/dist/core/command-generation/adapters/devin.js +36 -0
  78. package/dist/core/command-generation/adapters/easycode.d.ts +17 -0
  79. package/dist/core/command-generation/adapters/easycode.js +28 -0
  80. package/dist/core/command-generation/adapters/factory.d.ts +13 -0
  81. package/dist/core/command-generation/adapters/factory.js +28 -0
  82. package/dist/core/command-generation/adapters/gemini.d.ts +13 -0
  83. package/dist/core/command-generation/adapters/gemini.js +27 -0
  84. package/dist/core/command-generation/adapters/gigacode.d.ts +17 -0
  85. package/dist/core/command-generation/adapters/gigacode.js +31 -0
  86. package/dist/core/command-generation/adapters/github-copilot.d.ts +13 -0
  87. package/dist/core/command-generation/adapters/github-copilot.js +27 -0
  88. package/dist/core/command-generation/adapters/iflow.d.ts +13 -0
  89. package/dist/core/command-generation/adapters/iflow.js +30 -0
  90. package/dist/core/command-generation/adapters/index.d.ts +40 -0
  91. package/dist/core/command-generation/adapters/index.js +40 -0
  92. package/dist/core/command-generation/adapters/junie.d.ts +13 -0
  93. package/dist/core/command-generation/adapters/junie.js +27 -0
  94. package/dist/core/command-generation/adapters/kilocode.d.ts +14 -0
  95. package/dist/core/command-generation/adapters/kilocode.js +23 -0
  96. package/dist/core/command-generation/adapters/kiro.d.ts +13 -0
  97. package/dist/core/command-generation/adapters/kiro.js +27 -0
  98. package/dist/core/command-generation/adapters/lingma.d.ts +13 -0
  99. package/dist/core/command-generation/adapters/lingma.js +30 -0
  100. package/dist/core/command-generation/adapters/oh-my-pi.d.ts +21 -0
  101. package/dist/core/command-generation/adapters/oh-my-pi.js +42 -0
  102. package/dist/core/command-generation/adapters/opencode.d.ts +14 -0
  103. package/dist/core/command-generation/adapters/opencode.js +38 -0
  104. package/dist/core/command-generation/adapters/pi.d.ts +18 -0
  105. package/dist/core/command-generation/adapters/pi.js +39 -0
  106. package/dist/core/command-generation/adapters/qoder.d.ts +13 -0
  107. package/dist/core/command-generation/adapters/qoder.js +30 -0
  108. package/dist/core/command-generation/adapters/qwen.d.ts +17 -0
  109. package/dist/core/command-generation/adapters/qwen.js +31 -0
  110. package/dist/core/command-generation/adapters/roocode.d.ts +14 -0
  111. package/dist/core/command-generation/adapters/roocode.js +27 -0
  112. package/dist/core/command-generation/adapters/trae.d.ts +13 -0
  113. package/dist/core/command-generation/adapters/trae.js +28 -0
  114. package/dist/core/command-generation/adapters/zcode.d.ts +16 -0
  115. package/dist/core/command-generation/adapters/zcode.js +33 -0
  116. package/dist/core/command-generation/generator.d.ts +29 -0
  117. package/dist/core/command-generation/generator.js +43 -0
  118. package/dist/core/command-generation/index.d.ts +22 -0
  119. package/dist/core/command-generation/index.js +24 -0
  120. package/dist/core/command-generation/invocation.d.ts +73 -0
  121. package/dist/core/command-generation/invocation.js +77 -0
  122. package/dist/core/command-generation/registry.d.ts +36 -0
  123. package/dist/core/command-generation/registry.js +114 -0
  124. package/dist/core/command-generation/toml.d.ts +19 -0
  125. package/dist/core/command-generation/toml.js +39 -0
  126. package/dist/core/command-generation/types.d.ts +63 -0
  127. package/dist/core/command-generation/types.js +8 -0
  128. package/dist/core/command-generation/yaml.d.ts +36 -0
  129. package/dist/core/command-generation/yaml.js +48 -0
  130. package/dist/core/command-surface.d.ts +15 -0
  131. package/dist/core/command-surface.js +33 -0
  132. package/dist/core/config-prompts.d.ts +9 -0
  133. package/dist/core/config-prompts.js +56 -0
  134. package/dist/core/config-schema.d.ts +98 -0
  135. package/dist/core/config-schema.js +308 -0
  136. package/dist/core/config.d.ts +50 -0
  137. package/dist/core/config.js +122 -0
  138. package/dist/core/file-state.d.ts +36 -0
  139. package/dist/core/file-state.js +144 -0
  140. package/dist/core/file-view.d.ts +13 -0
  141. package/dist/core/file-view.js +14 -0
  142. package/dist/core/global-config.d.ts +101 -0
  143. package/dist/core/global-config.js +182 -0
  144. package/dist/core/id.d.ts +17 -0
  145. package/dist/core/id.js +30 -0
  146. package/dist/core/index.d.ts +6 -0
  147. package/dist/core/index.js +7 -0
  148. package/dist/core/init.d.ts +57 -0
  149. package/dist/core/init.js +836 -0
  150. package/dist/core/list.d.ts +11 -0
  151. package/dist/core/list.js +197 -0
  152. package/dist/core/migration.d.ts +121 -0
  153. package/dist/core/migration.js +540 -0
  154. package/dist/core/onboarding-commands.d.ts +30 -0
  155. package/dist/core/onboarding-commands.js +38 -0
  156. package/dist/core/openspec-root.d.ts +47 -0
  157. package/dist/core/openspec-root.js +196 -0
  158. package/dist/core/planning-home.d.ts +16 -0
  159. package/dist/core/planning-home.js +67 -0
  160. package/dist/core/profile-sync-drift.d.ts +31 -0
  161. package/dist/core/profile-sync-drift.js +201 -0
  162. package/dist/core/profiles.d.ts +19 -0
  163. package/dist/core/profiles.js +33 -0
  164. package/dist/core/project-config.d.ts +132 -0
  165. package/dist/core/project-config.js +519 -0
  166. package/dist/core/references.d.ts +10 -0
  167. package/dist/core/references.js +46 -0
  168. package/dist/core/root-selection.d.ts +59 -0
  169. package/dist/core/root-selection.js +132 -0
  170. package/dist/core/shared/allowed-tools.d.ts +12 -0
  171. package/dist/core/shared/allowed-tools.js +12 -0
  172. package/dist/core/shared/ide-restart.d.ts +26 -0
  173. package/dist/core/shared/ide-restart.js +42 -0
  174. package/dist/core/shared/index.d.ts +11 -0
  175. package/dist/core/shared/index.js +11 -0
  176. package/dist/core/shared/skill-content-equivalence.d.ts +7 -0
  177. package/dist/core/shared/skill-content-equivalence.js +45 -0
  178. package/dist/core/shared/skill-files.d.ts +7 -0
  179. package/dist/core/shared/skill-files.js +43 -0
  180. package/dist/core/shared/skill-generation.d.ts +49 -0
  181. package/dist/core/shared/skill-generation.js +125 -0
  182. package/dist/core/shared/skill-paths.d.ts +13 -0
  183. package/dist/core/shared/skill-paths.js +23 -0
  184. package/dist/core/shared/tool-detection.d.ts +99 -0
  185. package/dist/core/shared/tool-detection.js +318 -0
  186. package/dist/core/shared-skill-target.d.ts +51 -0
  187. package/dist/core/shared-skill-target.js +239 -0
  188. package/dist/core/store/errors.d.ts +20 -0
  189. package/dist/core/store/errors.js +22 -0
  190. package/dist/core/store/index.d.ts +2 -0
  191. package/dist/core/store/index.js +2 -0
  192. package/dist/core/styles/palette.d.ts +7 -0
  193. package/dist/core/styles/palette.js +8 -0
  194. package/dist/core/templates/optional-workflow.d.ts +69 -0
  195. package/dist/core/templates/optional-workflow.js +140 -0
  196. package/dist/core/templates/types.d.ts +19 -0
  197. package/dist/core/templates/types.js +5 -0
  198. package/dist/core/templates/workflows/personal.d.ts +22 -0
  199. package/dist/core/templates/workflows/personal.js +225 -0
  200. package/dist/core/update-plan.d.ts +127 -0
  201. package/dist/core/update-plan.js +390 -0
  202. package/dist/core/update.d.ts +154 -0
  203. package/dist/core/update.js +723 -0
  204. package/dist/core/version-check.d.ts +188 -0
  205. package/dist/core/version-check.js +906 -0
  206. package/dist/core/zod-issues.d.ts +4 -0
  207. package/dist/core/zod-issues.js +10 -0
  208. package/dist/index.d.ts +3 -0
  209. package/dist/index.js +3 -0
  210. package/dist/prompts/searchable-multi-select.d.ts +35 -0
  211. package/dist/prompts/searchable-multi-select.js +188 -0
  212. package/dist/telemetry/config.d.ts +37 -0
  213. package/dist/telemetry/config.js +148 -0
  214. package/dist/telemetry/index.d.ts +39 -0
  215. package/dist/telemetry/index.js +217 -0
  216. package/dist/telemetry/opt-out.d.ts +17 -0
  217. package/dist/telemetry/opt-out.js +27 -0
  218. package/dist/ui/ascii-patterns.d.ts +16 -0
  219. package/dist/ui/ascii-patterns.js +133 -0
  220. package/dist/ui/welcome-screen.d.ts +18 -0
  221. package/dist/ui/welcome-screen.js +199 -0
  222. package/dist/utils/change-metadata.d.ts +116 -0
  223. package/dist/utils/change-metadata.js +324 -0
  224. package/dist/utils/change-utils.d.ts +79 -0
  225. package/dist/utils/change-utils.js +121 -0
  226. package/dist/utils/ci.d.ts +12 -0
  227. package/dist/utils/ci.js +16 -0
  228. package/dist/utils/command-references.d.ts +104 -0
  229. package/dist/utils/command-references.js +190 -0
  230. package/dist/utils/date.d.ts +8 -0
  231. package/dist/utils/date.js +13 -0
  232. package/dist/utils/executable-path.d.ts +5 -0
  233. package/dist/utils/executable-path.js +44 -0
  234. package/dist/utils/file-system.d.ts +58 -0
  235. package/dist/utils/file-system.js +432 -0
  236. package/dist/utils/index.d.ts +6 -0
  237. package/dist/utils/index.js +9 -0
  238. package/dist/utils/interactive.d.ts +85 -0
  239. package/dist/utils/interactive.js +174 -0
  240. package/dist/utils/item-discovery.d.ts +15 -0
  241. package/dist/utils/item-discovery.js +33 -0
  242. package/dist/utils/line-endings.d.ts +34 -0
  243. package/dist/utils/line-endings.js +46 -0
  244. package/dist/utils/match.d.ts +3 -0
  245. package/dist/utils/match.js +22 -0
  246. package/dist/utils/nested-change.d.ts +35 -0
  247. package/dist/utils/nested-change.js +185 -0
  248. package/dist/utils/shell-detection.d.ts +20 -0
  249. package/dist/utils/shell-detection.js +94 -0
  250. package/dist/utils/task-progress.d.ts +67 -0
  251. package/dist/utils/task-progress.js +184 -0
  252. package/package.json +74 -4
  253. package/schemas//351/273/230/350/256/244/schema.yaml +68 -0
  254. package/schemas//351/273/230/350/256/244/templates//344/273/273/345/212/241/346/270/205/345/215/225.md +25 -0
  255. package/schemas//351/273/230/350/256/244/templates//346/265/213/350/257/225/347/224/250/344/276/213.md +34 -0
  256. package/schemas//351/273/230/350/256/244/templates//350/256/276/350/256/241/346/226/207/346/241/243.md +172 -0
  257. package/schemas//351/273/230/350/256/244/templates//351/234/200/346/261/202/346/226/207/346/241/243.md +19 -0
  258. package/skill-files//344/273/273/345/212/241/references//346/212/244/346/240/217.md +43 -0
  259. package/skill-files//344/273/273/345/212/241/references//347/262/222/345/272/246.md +23 -0
  260. package/skill-files//344/273/273/345/212/241/references//347/272/246/346/235/237.md +8 -0
  261. package/skill-files//344/273/273/345/212/241/scripts/check-tasks.mjs +83 -0
  262. package/skill-files//345/206/231Java/references/Java/350/247/204/350/214/203.md +25 -0
  263. package/skill-files//345/206/231Java/references//345/215/261/351/231/251/345/206/231/346/263/225.md +27 -0
  264. package/skill-files//345/206/231Java/references//345/256/214/346/210/220/345/257/271/347/205/247.md +15 -0
  265. package/skill-files//345/206/231Java/references//346/212/244/346/240/217.md +35 -0
  266. package/skill-files//345/206/231Java/references//347/272/246/346/235/237.md +8 -0
  267. package/skill-files//345/206/231Java/references//350/270/251/345/235/221.md +17 -0
  268. package/skill-files//345/256/241Java/references//346/212/244/346/240/217.md +19 -0
  269. package/skill-files//345/256/241Java/references//347/244/272/344/276/213.md +23 -0
  270. package/skill-files//345/256/241Java/references//347/272/246/346/235/237.md +7 -0
  271. package/skill-files//345/256/241Java/references//350/247/204/345/210/231.md +23 -0
  272. package/skill-files//345/256/241Java/references//351/242/206/345/237/237/346/243/200/351/241/271.md +58 -0
  273. package/skill-files//345/256/241/346/226/207/346/241/243/references//346/212/244/346/240/217.md +18 -0
  274. package/skill-files//345/256/241/346/226/207/346/241/243/references//347/272/246/346/235/237.md +8 -0
  275. package/skill-files//345/256/241/346/226/207/346/241/243/references//347/273/264/345/272/246.md +17 -0
  276. package/skill-files//345/256/241/346/226/207/346/241/243/references//350/270/251/345/235/221.md +11 -0
  277. package/skill-files//346/226/260/345/273/272/references//344/272/244/346/216/245.md +11 -0
  278. package/skill-files//346/226/260/345/273/272/references//346/212/244/346/240/217.md +14 -0
  279. package/skill-files//346/226/260/345/273/272/references//347/272/246/346/235/237.md +7 -0
  280. package/skill-files//346/267/261/346/200/235/config/prompts.yaml +114 -0
  281. package/skill-files//346/267/261/346/200/235/references//344/270/211/346/226/271/346/240/270/345/257/271.md +72 -0
  282. package/skill-files//346/267/261/346/200/235/references//344/276/213/345/255/220.md +39 -0
  283. package/skill-files//346/267/261/346/200/235/references//346/200/216/344/271/210/346/203/263.md +61 -0
  284. package/skill-files//346/267/261/346/200/235/references//346/212/244/346/240/217.md +26 -0
  285. package/skill-files//346/267/261/346/200/235/references//347/202/271/351/200/211/346/217/220/351/227/256.md +66 -0
  286. package/skill-files//346/267/261/346/200/235/references//347/231/273/350/256/260.md +45 -0
  287. package/skill-files//346/267/261/346/200/235/references//347/272/246/346/235/237.md +9 -0
  288. package/skill-files//347/224/250/344/276/213/references//346/200/216/344/271/210/345/206/231.md +13 -0
  289. package/skill-files//347/224/250/344/276/213/references//346/212/244/346/240/217.md +42 -0
  290. package/skill-files//347/224/250/344/276/213/references//347/272/246/346/235/237.md +5 -0
  291. package/skill-files//347/224/250/344/276/213/scripts/check-cases.mjs +70 -0
  292. package/skill-files//350/256/276/350/256/241/references//345/207/206/345/244/207.md +25 -0
  293. package/skill-files//350/256/276/350/256/241/references//346/212/244/346/240/217.md +134 -0
  294. package/skill-files//350/256/276/350/256/241/references//346/226/207/351/243/216.md +17 -0
  295. package/skill-files//350/256/276/350/256/241/references//347/225/214/351/235/242.md +18 -0
  296. package/skill-files//350/256/276/350/256/241/references//347/261/273/345/236/213.md +19 -0
  297. package/skill-files//350/256/276/350/256/241/references//347/272/246/346/235/237.md +25 -0
  298. package/skill-files//350/256/276/350/256/241/scripts/_smoke.mjs +72 -0
  299. package/skill-files//350/256/276/350/256/241/scripts/check-design.mjs +331 -0
  300. package/skill-files//351/234/200/346/261/202/references//346/212/244/346/240/217.md +26 -0
  301. package/skill-files//351/234/200/346/261/202/references//346/226/207/351/243/216.md +23 -0
  302. package/skill-files//351/234/200/346/261/202/references//346/267/261/346/200/235/346/221/204/345/205/245.md +21 -0
  303. package/skill-files//351/234/200/346/261/202/references//347/272/246/346/235/237.md +8 -0
  304. package/skill-files//351/234/200/346/261/202/references//351/234/200/346/261/202/345/276/205/345/256/232.md +13 -0
  305. package/skill-files//351/234/200/346/261/202/scripts/check-requirements.mjs +60 -0
  306. package/skill-files//351/252/214/346/224/266/references//346/212/244/346/240/217.md +27 -0
  307. package/skill-files//351/252/214/346/224/266/references//346/240/270/345/257/271.md +17 -0
  308. package/skill-files//351/252/214/346/224/266/references//347/272/246/346/235/237.md +7 -0
@@ -0,0 +1,225 @@
1
+ const VOICE = `正文和对话必须是简体中文、白话。先写结论,再写原因。句子要短。
2
+
3
+ 禁止黑话,禁止自创缩略。不要用只有作者懂的二字、三字当动词,例如:写边、选桶、查 bind、物化、对账、抽会话、封尾。键名、类名、路径、协议可以保留,旁边必须用完整中文说明在干什么。缩写第一次出现先写全称。
4
+
5
+ 禁止电报句。不要写「两类可配置;缓存处置;独有优先」这种压缩句。要写清是哪几类、各做什么、谁写入、谁读取。读者不看后文也能懂这一句。
6
+
7
+ 禁止这些词:优化、提升、赋能、闭环、拉通、完善、大概、可能、后续再看。专业词第一次出现,后面补半句人话。
8
+
9
+ 不要把对话过程、试错流水、自我纠正写进正文。
10
+
11
+ 落盘后只报路径和还没拍板的点,不要把全文贴进对话。文件已经存在时,只改走样的地方,不要整篇重写。已经勾选的任务保留。`;
12
+ const PLACE = `变更目录在 \`freespec/<名称>变更/\`。
13
+
14
+ 做完就停。
15
+
16
+ 结束的话固定三样:写到哪个文件、还剩什么没定或没做、请人审阅后再决定下一步。不要替人决定下一步,不要说「接下来写设计」「接下来实现」。
17
+
18
+ 细则在本技能目录的 \`references/\`。
19
+ 必须项只写在 \`references/护栏.md\`。护栏挂在动作上:写到哪一步,就查哪一步,不靠回头翻清单。
20
+ \`references/约束.md\` 只写尽量项。做不到就在对话里说一句。`;
21
+ const WRITE = `四份文件都可选,没有先后顺序:\`需求文档.md\`、\`设计文档.md\`、\`任务清单.md\`、\`测试用例.md\`。缺哪份都不必补,也不要因此判失败。
22
+
23
+ 写需求文档时,会改功能点但还没定的,写进需求待定,把文档写完,不要停下来重问。写设计、任务、用例时,读到这种还没定、又会改变做法的,停下来问,不要补。
24
+
25
+ 目录不存在时,先运行 \`freespec new change "<名称>"\`。\`登录改造\` 和 \`登录改造变更\` 都会建成 \`freespec/登录改造变更/\`。名称用中文,可以加数字和连字符。传给命令的名称可以不带「变更」,命令会补上。
26
+
27
+ 需求文档和设计文档按 \`freespec instructions\` 返回的模板章节写。需求文档只用模板里的四个标题。设计文档只写这次涉及的章,没用到的整章删掉。正文模板只看这次命令返回的那一份。`;
28
+ const CODE = `实现时的语言规范只在「写Java」和「审Java」。本仓库里已经有的写法,优先于技能里的默认约定。`;
29
+ function skill(name, description, instructions) {
30
+ return {
31
+ name,
32
+ description,
33
+ instructions,
34
+ compatibility: '需要 freespec CLI。',
35
+ metadata: { author: 'freespec', version: '1.0' },
36
+ };
37
+ }
38
+ function command(name, description, content) {
39
+ return {
40
+ name,
41
+ description,
42
+ category: 'Workflow',
43
+ tags: ['freespec'],
44
+ content,
45
+ };
46
+ }
47
+ export function getNewSkillTemplate() {
48
+ return skill('新建', '创建 freespec 下的中文变更目录。用户要新建变更、开一个需求文件夹时使用。', `只创建变更目录,不写四份文档。
49
+
50
+ ${PLACE}
51
+
52
+ 先读 \`references/交接.md\`、\`references/约束.md\`。
53
+
54
+ 1. 从用户的话得出中文名称。拿不准就用一句话问。名称可以不带「变更」,命令会补上。
55
+ 2. 运行 \`freespec new change "<名称>"\`。目录已经存在就按交接问,不要另建。
56
+ 3. 读 \`references/护栏.md\`。过了再用一两句中文说明目录路径,然后停下。`);
57
+ }
58
+ export function getNewCommandTemplate() {
59
+ return command('新建', '创建变更目录', getNewSkillTemplate().instructions);
60
+ }
61
+ export function getAskSkillTemplate() {
62
+ return skill('深思', '从用户的问题出发,把漏洞补上,把答案写全。用户说深思、想透、深度思考时使用。', `从用户的问题出发,往深处想,也往旁边想。把问题里的漏洞补上,把答案写全。
63
+
64
+ 能从用户原话、已有材料和仓库补上的,直接写进答案。只有会改答案、又不能代用户定的,才拿去点选。点选方式写在 \`references/点选提问.md\`。一次把这一批题交出,让人点选。
65
+
66
+ 这次只把答案和登记写进该变更目录的 \`深思/\`。
67
+
68
+ ${PLACE}
69
+
70
+ ${VOICE}
71
+
72
+ 先读 \`references/怎么想.md\`、\`references/三方核对.md\`、\`references/点选提问.md\`、\`references/登记.md\`、\`references/例子.md\`、\`references/约束.md\`。
73
+
74
+ \`config/prompts.yaml\` 是往深处和旁边想时要看的漏洞。能补上的写进答案。补不上、而且会改答案的,才做成点选项。页面、表、接口不在这份清单里,只按三方核对做。
75
+
76
+ 1. 确定中文变更名。目录不存在就先 \`freespec new change "<名称>"\`。
77
+ 2. 用一两句复述用户要回答的问题。复述和用户要的不是一回事,就先点选确认问题,再往下想。
78
+ 3. 按 \`references/怎么想.md\` 把漏洞找出来。点了名的页面、表、接口,按 \`references/三方核对.md\` 对实物。对得上的写进答案。对不上的收成点选题。
79
+ 4. 能补上的漏洞写进答案,并写依据。不要再拿去问人。
80
+ 5. 补不上、而且会改答案的,按 \`references/点选提问.md\` 一次点选。人点完就写入答案。工具单次有道数上限时,点完立刻再出下一张。
81
+ 6. 答案写到 \`freespec/<名称>变更/深思/记录.md\`,登记写到同目录的 \`registry.json\`。
82
+ 7. 读 \`references/护栏.md\`。过了再停下。`);
83
+ }
84
+ export function getAskCommandTemplate() {
85
+ return command('深思', '把问题想透并写全答案', getAskSkillTemplate().instructions);
86
+ }
87
+ export function getRequirementsSkillTemplate() {
88
+ return skill('需求', '按四个标题写需求文档.md。用户说写需求、需求文档时使用。', `只写 \`需求文档.md\`。会改功能点但还没定的,写进需求待定,把这份文档写完。不要停下来重问,也不要编一个结果填进功能点。
89
+
90
+ ${PLACE}
91
+
92
+ ${VOICE}
93
+
94
+ ${WRITE}
95
+
96
+ 先读 \`references/文风.md\`、\`references/需求待定.md\`、\`references/深思摄入.md\`、\`references/约束.md\`。
97
+
98
+ 1. 有深思记录就先读。已定的写进背景、描述或功能点。未决写进需求待定。不要重问。
99
+ 2. 运行 \`freespec instructions requirements --change "<名称>" --json\`。二级标题按返回的 template,只用那四个,顺序不要换。句子怎么写按文风。返回的说明和文风不一致时,以文风和需求待定为准。
100
+ 3. 读 \`references/护栏.md\`。用本技能目录的 \`scripts/check-requirements.mjs\` 检查刚写的需求文档。退出码不是 0 就按缺项改文件,再跑,直到通过。
101
+ 4. 通过后只报路径和需求待定里还要人拍板的条目。停下,不要写设计。`);
102
+ }
103
+ export function getRequirementsCommandTemplate() {
104
+ return command('需求', '写需求文档', getRequirementsSkillTemplate().instructions);
105
+ }
106
+ export function getDesignSkillTemplate() {
107
+ return skill('设计', '按涉及范围选用章节写设计文档.md。用户说写设计、设计文档时使用。', `只写 \`设计文档.md\`。没有需求文档也可以写。
108
+
109
+ ${PLACE}
110
+
111
+ ${VOICE}
112
+
113
+ ${WRITE}
114
+
115
+ 先读 \`references/准备.md\`、\`references/类型.md\`、\`references/文风.md\`、\`references/约束.md\`。有页面再读 \`references/界面.md\`。
116
+
117
+ 1. 先判断涉及范围:纯前端、前后端、纯后端、仅数据或配置。拿不准就问一句。
118
+ 2. 运行 \`freespec instructions design --change "<名称>" --json\`。章名、节名、表头按返回的 template 写。用到的章才写,从第一章连续编号。
119
+ 3. 写数据、页面、接口、服务之前,先按护栏把改动清单里的引用追溯写完。追不全就不要写后面的章。
120
+ 4. 读 \`references/护栏.md\`。用本技能目录的 \`scripts/check-design.mjs\` 检查刚写的设计文档。退出码不是 0 就按缺项改文件,再跑,直到通过。
121
+ 5. 通过后再停下。`);
122
+ }
123
+ export function getDesignCommandTemplate() {
124
+ return command('设计', '写设计文档', getDesignSkillTemplate().instructions);
125
+ }
126
+ export function getTasksSkillTemplate() {
127
+ return skill('任务', '按设计章节写可勾选的任务清单.md。用户说写任务、任务清单时使用。', `只写 \`任务清单.md\`。没有需求文档或设计文档也可以写。
128
+
129
+ ${PLACE}
130
+
131
+ ${VOICE}
132
+
133
+ ${WRITE}
134
+
135
+ 先读 \`references/粒度.md\`、\`references/约束.md\`。
136
+
137
+ 1. 运行 \`freespec instructions tasks --change "<名称>" --json\`,按返回的 template 写。
138
+ 2. 读 \`references/护栏.md\`。用本技能目录的 \`scripts/check-tasks.mjs\` 检查刚写的任务清单。退出码不是 0 就按缺项改文件,再跑,直到通过。
139
+ 3. 通过后再停下。`);
140
+ }
141
+ export function getTasksCommandTemplate() {
142
+ return command('任务', '写任务清单', getTasksSkillTemplate().instructions);
143
+ }
144
+ export function getCasesSkillTemplate() {
145
+ return skill('用例', '写测试用例.md,只描述输入、操作和期望。用户说写用例、测试用例时使用。', `只写 \`测试用例.md\`。每条写输入、操作和期望。
146
+
147
+ ${PLACE}
148
+
149
+ ${VOICE}
150
+
151
+ ${WRITE}
152
+
153
+ 先读 \`references/怎么写.md\`、\`references/约束.md\`。
154
+
155
+ 1. 先写核算表:每条功能点对上哪条用例、还缺什么。列不出不写正文。
156
+ 2. 运行 \`freespec instructions cases --change "<名称>" --json\`,按返回的 template 写。
157
+ 3. 读 \`references/护栏.md\`。用本技能目录的 \`scripts/check-cases.mjs\` 检查刚写的用例。退出码不是 0 就按缺项改文件,再跑,直到通过。
158
+ 4. 通过后再停下。`);
159
+ }
160
+ export function getCasesCommandTemplate() {
161
+ return command('用例', '写用例说明', getCasesSkillTemplate().instructions);
162
+ }
163
+ export function getReviewDocsSkillTemplate() {
164
+ return skill('审文档', '只读评审已经存在的需求、设计、任务和用例。用户说审文档时使用。', `只读。
165
+
166
+ ${PLACE}
167
+
168
+ ${VOICE}
169
+
170
+ 先读 \`references/维度.md\`、\`references/踩坑.md\`、\`references/约束.md\`。
171
+
172
+ 读 \`references/护栏.md\` 后再给结论。结论用:通过、有条件通过、不通过。然后停下。`);
173
+ }
174
+ export function getReviewDocsCommandTemplate() {
175
+ return command('审文档', '评审已有文档', getReviewDocsSkillTemplate().instructions);
176
+ }
177
+ export function getCheckSkillTemplate() {
178
+ return skill('验收', '对照已有文档、测试和代码,看这件事做完没有。用户说验收、核对实现时使用。', `只读。
179
+
180
+ ${PLACE}
181
+
182
+ ${VOICE}
183
+
184
+ 先读 \`references/核对.md\`、\`references/约束.md\`。写完读 \`references/护栏.md\`。结论用:通过、有条件通过、不通过。过了再停下。`);
185
+ }
186
+ export function getCheckCommandTemplate() {
187
+ return command('验收', '核对实现', getCheckSkillTemplate().instructions);
188
+ }
189
+ export function getJavaImplSkillTemplate() {
190
+ return skill('写Java', '用 Java 实现当前变更。用户说写Java、实现 Java 时使用。', `只写 Java。不改需求、设计、任务、用例的正文,除非用户明确要求改文档。
191
+
192
+ ${PLACE}
193
+
194
+ ${VOICE}
195
+
196
+ ${CODE}
197
+
198
+ 先读 \`references/Java规范.md\`、\`references/踩坑.md\`、\`references/危险写法.md\`、\`references/完成对照.md\`、\`references/约束.md\`。
199
+
200
+ 1. 读这个变更目录里已经有的文件。缺的不用补。
201
+ 2. 有 \`测试用例.md\` 时,先写成会失败的 Java 测试并运行,说明现在是失败的,再写实现,直到这些测试通过。
202
+ 3. 有 \`任务清单.md\` 时,一次做一条,对照一条,再改成 \`- [x]\`。没有测试用例就按任务写。
203
+ 4. 两份都没有时,按对话里已经说清的内容实现,并写明假设。
204
+ 5. 读 \`references/护栏.md\`。过了再停下。`);
205
+ }
206
+ export function getJavaImplCommandTemplate() {
207
+ return command('写Java', '用 Java 实现', getJavaImplSkillTemplate().instructions);
208
+ }
209
+ export function getJavaReviewSkillTemplate() {
210
+ return skill('审Java', '只读评审 Java 改动。用户说审Java、看 Java 代码时使用。', `只评 Java 改动。
211
+
212
+ ${PLACE}
213
+
214
+ ${VOICE}
215
+
216
+ ${CODE}
217
+
218
+ 先读 \`references/规则.md\`、\`references/示例.md\`、\`references/约束.md\`。diff 沾到 SQL、事务、循环、并发时再读 \`references/领域检项.md\`。
219
+
220
+ 读 \`references/护栏.md\` 后再给结论。结论用:通过、有条件通过、不通过。然后停下。`);
221
+ }
222
+ export function getJavaReviewCommandTemplate() {
223
+ return command('审Java', '评审 Java 代码', getJavaReviewSkillTemplate().instructions);
224
+ }
225
+ //# sourceMappingURL=personal.js.map
@@ -0,0 +1,127 @@
1
+ /**
2
+ * Update Plan
3
+ *
4
+ * The write seam `update` uses for every file it generates or removes.
5
+ *
6
+ * A real run forwards to the filesystem. A dry run records what the same call
7
+ * would have done and writes nothing, so the preview and the real update come
8
+ * from one code path instead of two descriptions of it.
9
+ */
10
+ import type { FileView } from './file-view.js';
11
+ export type UpdatePlanAction = 'add' | 'update' | 'delete';
12
+ export interface UpdatePlanChange {
13
+ /** Project-relative POSIX path, or an absolute path (home collapsed to `~`) for files outside the project. */
14
+ path: string;
15
+ action: UpdatePlanAction;
16
+ /**
17
+ * Tool the file belongs to, as configured (e.g. `claude`), or `freespec`
18
+ * for FreeSpec's own files: the global config and legacy-artifact cleanup.
19
+ */
20
+ tool: string;
21
+ }
22
+ /**
23
+ * What the plan cannot settle by itself: a step a terminal user is asked
24
+ * about, which the plan lists as a non-interactive run makes it. Stable
25
+ * identifiers, for a caller that branches on them.
26
+ */
27
+ export type UpdatePlanNoteCode = 'legacy-tool-directories' | 'legacy-artifacts';
28
+ export interface UpdatePlanNote {
29
+ code: UpdatePlanNoteCode;
30
+ message: string;
31
+ }
32
+ export interface UpdatePlanFailure {
33
+ tool: string;
34
+ error: string;
35
+ }
36
+ export interface UpdatePlan {
37
+ changes: UpdatePlanChange[];
38
+ /**
39
+ * Steps a terminal user would be asked about. `changes` lists them as a
40
+ * non-interactive run makes them. Empty for an ordinary refresh.
41
+ */
42
+ notes: UpdatePlanNote[];
43
+ /**
44
+ * Tools the real update would fail on. Reported rather than thrown: one
45
+ * broken tool must not cost the caller the rest of the plan.
46
+ */
47
+ failures: UpdatePlanFailure[];
48
+ }
49
+ /** Every filesystem mutation `update` makes while generating artifacts. */
50
+ export interface UpdateFileOps {
51
+ writeFile(filePath: string, content: string, tool: string): Promise<void>;
52
+ removeFile(filePath: string, tool: string): Promise<void>;
53
+ removeDirectory(dirPath: string, tool: string): Promise<void>;
54
+ /** Removes a directory already known to be empty. */
55
+ removeEmptyDirectory(dirPath: string): Promise<void>;
56
+ }
57
+ export declare const realFileOps: UpdateFileOps;
58
+ export declare class UpdatePlanRecorder implements UpdateFileOps {
59
+ private readonly projectPath;
60
+ private readonly notes;
61
+ private readonly failures;
62
+ /**
63
+ * The tree as the real update would have it so far: absolute path to planned
64
+ * content, a moved directory, or null once planned away (a removed directory
65
+ * takes everything under it). Steps that read what an earlier step left
66
+ * behind read this through `view`.
67
+ */
68
+ private readonly staged;
69
+ /** Every file path the plan has touched, with the tool that touched it last. */
70
+ private readonly touched;
71
+ constructor(projectPath: string);
72
+ writeFile(filePath: string, content: string, tool: string): Promise<void>;
73
+ removeFile(filePath: string, tool: string): Promise<void>;
74
+ removeEmptyDirectory(dirPath: string): Promise<void>;
75
+ removeDirectory(dirPath: string, tool: string): Promise<void>;
76
+ /**
77
+ * A rename, as the legacy-root migration makes it: whatever the entry is
78
+ * moves, a directory with everything in it.
79
+ */
80
+ moveFile(source: string, destination: string, tool: string): Promise<void>;
81
+ /**
82
+ * The tree with every planned write, move and removal applied. A path the
83
+ * plan has not touched answers exactly as the disk does.
84
+ */
85
+ readonly view: FileView;
86
+ addNote(code: UpdatePlanNoteCode, message: string): void;
87
+ addFailure(tool: string, error: string): void;
88
+ /**
89
+ * Each touched path, compared as it is on disk now with how the plan leaves
90
+ * it. A file written and then removed, or rewritten with the bytes it
91
+ * already had, is no change at all.
92
+ */
93
+ getPlan(): UpdatePlan;
94
+ private stage;
95
+ /**
96
+ * What the plan has put at a path: content, a moved directory, null once
97
+ * planned away, or undefined when the plan has not touched it.
98
+ */
99
+ private stagedEntry;
100
+ /** Whether the plan has put any file or directory below `directory`. */
101
+ private hasStagedDescendant;
102
+ /** Files under a directory in the tree as planned: those on disk, and those the plan added. */
103
+ private filesUnder;
104
+ /**
105
+ * What is at a path in the tree as planned, and whether that is what is on
106
+ * disk (so its permissions are real).
107
+ */
108
+ private entryKind;
109
+ /**
110
+ * Fails the way the real write would, without writing: a directory where the
111
+ * file belongs, a file where one of its directories belongs, or no
112
+ * permission. Recording the write instead would plan past the point where
113
+ * the real update stops for this tool, listing files it never writes.
114
+ */
115
+ private probeWrite;
116
+ /** Fails the way unlinking the file would. */
117
+ private probeRemove;
118
+ /**
119
+ * The nearest existing ancestor has to be a directory the update can create
120
+ * entries in; anything it would create below that starts out empty.
121
+ */
122
+ private probeCreatableIn;
123
+ private toDisplayPath;
124
+ }
125
+ /** Human-readable rendering of a dry-run plan. */
126
+ export declare function formatUpdatePlan(plan: UpdatePlan): string;
127
+ //# sourceMappingURL=update-plan.d.ts.map