@yiyi_zhang/laoshi 0.0.0-stage → 0.1.1

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 (351) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/LICENSE +21 -0
  3. package/README.md +60 -2
  4. package/SCOPE.md +13 -0
  5. package/adapters/dsh/adapter.ts +75 -0
  6. package/adapters/dsh/dsh-runtime.ts +242 -0
  7. package/adapters/dsh/install.mjs +97 -0
  8. package/adapters/dsh/intranet/install.mjs +15 -0
  9. package/adapters/dsh/intranet/make-sample.mjs +52 -0
  10. package/adapters/dsh/plugin/channel.d.mts +2 -0
  11. package/adapters/dsh/plugin/channel.mjs +31 -0
  12. package/adapters/dsh/plugin/index.d.mts +3 -0
  13. package/adapters/dsh/plugin/index.mjs +292 -0
  14. package/adapters/dsh/plugin/package.json +18 -0
  15. package/adapters/paseo/adapter.ts +96 -0
  16. package/adapters/paseo/daemon-check.ts +80 -0
  17. package/adapters/paseo/daemon-version.ts +64 -0
  18. package/adapters/paseo/doctor.ts +161 -0
  19. package/adapters/paseo/install.mjs +30 -0
  20. package/adapters/paseo/paseo-json.ts +73 -0
  21. package/adapters/paseo/paseo-profiles.ts +127 -0
  22. package/adapters/paseo/paseo-runtime.ts +507 -0
  23. package/adapters/paseo/settings.ts +22 -0
  24. package/adapters/paseo/skill/setup.md +26 -0
  25. package/adapters/paseo/skill/templates/copy-local-files.mjs +32 -0
  26. package/adapters/paseo/skill/templates/with-port.mjs +36 -0
  27. package/adapters/paseo/smoke-test.ts +203 -0
  28. package/bin/bootstrap.mjs +170 -0
  29. package/bin/install.mjs +245 -0
  30. package/bin/locate.mjs +22 -0
  31. package/bin/req-docs.d.mts +5 -0
  32. package/bin/req-docs.mjs +167 -0
  33. package/bin/req-doctor.mjs +21 -0
  34. package/bin/req.mjs +236 -0
  35. package/bin/start-pipeline +21 -0
  36. package/bin/start-pipeline.mjs +22 -0
  37. package/config.example.json +134 -0
  38. package/contracts/README.md +21 -0
  39. package/contracts/agent-runtime.md +83 -0
  40. package/contracts/cli-json.md +76 -0
  41. package/contracts/feature-files.md +148 -0
  42. package/contracts/notifier-event.md +90 -0
  43. package/contracts/result-file.md +21 -0
  44. package/contracts/spec.md +37 -0
  45. package/contracts/state.md +69 -0
  46. package/contracts/usage-record.md +72 -0
  47. package/contracts/verify.md +41 -0
  48. package/docs/adr/0001-new-repo-core-and-adapters.md +20 -0
  49. package/docs/adr/0002-two-orchestration-modes.md +20 -0
  50. package/docs/adr/0003-generate-once-then-lock.md +20 -0
  51. package/docs/adr/0004-external-contracts-stay-stable.md +19 -0
  52. package/docs/adr/0005-skill-names.md +26 -0
  53. package/docs/adr/0006-deterministic-engine-platform-capabilities.md +42 -0
  54. package/docs/adr/0007-one-install-many-repos.md +63 -0
  55. package/docs/adr/0008-capability-sources-and-platform-plugin.md +81 -0
  56. package/docs/adr/README.md +14 -0
  57. package/docs/design/adapter-guide.md +90 -0
  58. package/docs/design/architecture.md +104 -0
  59. package/docs/design/builtin-capabilities.md +72 -0
  60. package/docs/design/compat-migration.md +65 -0
  61. package/docs/design/dsh-adapter.md +145 -0
  62. package/docs/design/in-chat-orchestration.md +67 -0
  63. package/docs/design/init-bootstrap.md +83 -0
  64. package/docs/design/internal-platform-adapter.md +76 -0
  65. package/docs/design/platform-discovery.md +117 -0
  66. package/docs/design/platform-vocabulary.md +44 -0
  67. package/docs/design/state-v2.md +71 -0
  68. package/docs/guide//344/275/277/347/224/250/350/200/205/346/214/207/345/215/227.md +130 -0
  69. package/docs/guide//345/256/211/350/243/205/344/270/216/345/215/207/347/272/247.md +211 -0
  70. package/docs/guide//347/273/264/346/212/244/350/200/205/346/214/207/345/215/227.md +86 -0
  71. package/docs/guide//351/241/271/347/233/256/345/256/232/345/210/266/344/270/216/350/277/220/350/241/214/350/247/204/345/210/231.md +595 -0
  72. package/docs/intranet/install-verify.md +278 -0
  73. package/engine/prompts/00-shared-context.md +107 -0
  74. package/engine/prompts/02-spec-review.md +46 -0
  75. package/engine/prompts/03-design.md +77 -0
  76. package/engine/prompts/03a-design-proposal.md +30 -0
  77. package/engine/prompts/04-design-review.md +73 -0
  78. package/engine/prompts/04b-design-revise.md +56 -0
  79. package/engine/prompts/05-implement.md +72 -0
  80. package/engine/prompts/06-code-review.md +81 -0
  81. package/engine/prompts/07-review-fix.md +41 -0
  82. package/engine/prompts/07b-handoff.md +45 -0
  83. package/engine/prompts/08-service-start.md +59 -0
  84. package/engine/prompts/09-verify.md +90 -0
  85. package/engine/prompts/10-defect-fix.md +41 -0
  86. package/engine/prompts/10b-reverify.md +43 -0
  87. package/engine/prompts/11-report.md +112 -0
  88. package/engine/prompts/browser-verify.md +14 -0
  89. package/engine/prompts/incremental.md +24 -0
  90. package/engine/prompts/joint.md +55 -0
  91. package/engine/prompts/managed-services.md +9 -0
  92. package/engine/prompts/panel-member.md +38 -0
  93. package/engine/prompts/related-repos.md +7 -0
  94. package/engine/prompts/review-axis-spec.md +10 -0
  95. package/engine/prompts/review-axis-standards.md +11 -0
  96. package/engine/prompts/types/assessment.md +41 -0
  97. package/engine/prompts/types/defect.md +55 -0
  98. package/engine/prompts/types/refactor.md +39 -0
  99. package/engine/prompts/ui-check.md +15 -0
  100. package/engine/prompts/verify-deployed.md +14 -0
  101. package/engine/skill-fragments/setup-builtin.md +24 -0
  102. package/engine/src/activity.ts +131 -0
  103. package/engine/src/api.ts +655 -0
  104. package/engine/src/builtin/index.ts +30 -0
  105. package/engine/src/builtin/project-services.ts +66 -0
  106. package/engine/src/builtin/service-runner.mjs +35 -0
  107. package/engine/src/builtin/services.ts +264 -0
  108. package/engine/src/builtin/setup-runner.mjs +26 -0
  109. package/engine/src/builtin/workspace.ts +139 -0
  110. package/engine/src/card-cmd.ts +505 -0
  111. package/engine/src/card.ts +541 -0
  112. package/engine/src/checklist-cmd.ts +37 -0
  113. package/engine/src/checklist.ts +254 -0
  114. package/engine/src/cli-args.ts +228 -0
  115. package/engine/src/code-review.ts +421 -0
  116. package/engine/src/codeowners.ts +87 -0
  117. package/engine/src/config-view.ts +310 -0
  118. package/engine/src/config.ts +862 -0
  119. package/engine/src/configure.ts +343 -0
  120. package/engine/src/control.ts +257 -0
  121. package/engine/src/danger-guard.ts +180 -0
  122. package/engine/src/digest.ts +141 -0
  123. package/engine/src/doctor.ts +410 -0
  124. package/engine/src/estimate.ts +95 -0
  125. package/engine/src/eval.ts +325 -0
  126. package/engine/src/factory.ts +545 -0
  127. package/engine/src/features.ts +311 -0
  128. package/engine/src/gate.ts +157 -0
  129. package/engine/src/git.ts +30 -0
  130. package/engine/src/identity.ts +72 -0
  131. package/engine/src/index-cmd.ts +34 -0
  132. package/engine/src/integration-cmd.ts +161 -0
  133. package/engine/src/integrations.ts +485 -0
  134. package/engine/src/joint.ts +173 -0
  135. package/engine/src/launch.ts +443 -0
  136. package/engine/src/lessons.ts +74 -0
  137. package/engine/src/locations.ts +83 -0
  138. package/engine/src/main.ts +390 -0
  139. package/engine/src/messages.ts +472 -0
  140. package/engine/src/notifiers.ts +114 -0
  141. package/engine/src/notify-test.ts +108 -0
  142. package/engine/src/outcomes.ts +145 -0
  143. package/engine/src/paths.ts +10 -0
  144. package/engine/src/pipeline.ts +2517 -0
  145. package/engine/src/platform.ts +121 -0
  146. package/engine/src/playbooks.ts +46 -0
  147. package/engine/src/preflight.ts +352 -0
  148. package/engine/src/prompts.ts +76 -0
  149. package/engine/src/queue.ts +61 -0
  150. package/engine/src/records.ts +403 -0
  151. package/engine/src/reply.ts +81 -0
  152. package/engine/src/review-assets/app.css +339 -0
  153. package/engine/src/review-assets/app.html +107 -0
  154. package/engine/src/review-assets/app.js +958 -0
  155. package/engine/src/review-assets/check.css +12 -0
  156. package/engine/src/review-assets/check.html +61 -0
  157. package/engine/src/review-assets/check.js +341 -0
  158. package/engine/src/review-assets/code.css +16 -0
  159. package/engine/src/review-assets/code.html +58 -0
  160. package/engine/src/review-assets/code.js +497 -0
  161. package/engine/src/review-assets/rk-icons.js +98 -0
  162. package/engine/src/review-assets/rk-tokens.css +252 -0
  163. package/engine/src/review-assets/rk.css +254 -0
  164. package/engine/src/review.ts +771 -0
  165. package/engine/src/runtime-loader.ts +110 -0
  166. package/engine/src/runtime.ts +186 -0
  167. package/engine/src/scan-guard.ts +132 -0
  168. package/engine/src/schedule-time.ts +51 -0
  169. package/engine/src/secret-scan.ts +177 -0
  170. package/engine/src/semver.ts +31 -0
  171. package/engine/src/skills-render.ts +104 -0
  172. package/engine/src/spec-review.ts +99 -0
  173. package/engine/src/state.ts +506 -0
  174. package/engine/src/stats.ts +810 -0
  175. package/engine/src/steps.ts +269 -0
  176. package/engine/src/try.ts +135 -0
  177. package/engine/src/ui-check-page.js +208 -0
  178. package/engine/src/ui-check.ts +366 -0
  179. package/engine/src/usage.ts +67 -0
  180. package/engine/src/watchdog.ts +139 -0
  181. package/engine/src/words.ts +95 -0
  182. package/engine/src/worktree.ts +227 -0
  183. package/notifiers/im-template.mjs +86 -0
  184. package/package.json +78 -4
  185. package/principles/INDEX.md +11 -0
  186. package/site-dist/404.html +27 -0
  187. package/site-dist/assets/app.Df99UgrJ.js +1 -0
  188. package/site-dist/assets/changelog.md.Df8vFhjK.js +1 -0
  189. package/site-dist/assets/changelog.md.Df8vFhjK.lean.js +1 -0
  190. package/site-dist/assets/chunks/@localSearchIndexroot.n-0kN-N0.js +1 -0
  191. package/site-dist/assets/chunks/VPLocalSearchBox.IEhP6Gw5.js +9 -0
  192. package/site-dist/assets/chunks/framework.BetZR81g.js +20 -0
  193. package/site-dist/assets/chunks/theme.DHubfO7g.js +2 -0
  194. package/site-dist/assets/guide_dsh.md.0X-eYB87.js +5 -0
  195. package/site-dist/assets/guide_dsh.md.0X-eYB87.lean.js +5 -0
  196. package/site-dist/assets/guide_getting-started.md.BZTWiHhH.js +1 -0
  197. package/site-dist/assets/guide_getting-started.md.BZTWiHhH.lean.js +1 -0
  198. package/site-dist/assets/guide_how-it-works.md.CkvlSgxO.js +25 -0
  199. package/site-dist/assets/guide_how-it-works.md.CkvlSgxO.lean.js +1 -0
  200. package/site-dist/assets/guide_index.md.D67QX_Vi.js +1 -0
  201. package/site-dist/assets/guide_index.md.D67QX_Vi.lean.js +1 -0
  202. package/site-dist/assets/guide_install.md.D7NiiOPu.js +19 -0
  203. package/site-dist/assets/guide_install.md.D7NiiOPu.lean.js +19 -0
  204. package/site-dist/assets/guide_intranet.md.Bz0sAHK0.js +9 -0
  205. package/site-dist/assets/guide_intranet.md.Bz0sAHK0.lean.js +9 -0
  206. package/site-dist/assets/guide_maintainer.md.C-Vt-DdK.js +1 -0
  207. package/site-dist/assets/guide_maintainer.md.C-Vt-DdK.lean.js +1 -0
  208. package/site-dist/assets/guide_phases.md.Cw0A9Vb1.js +1 -0
  209. package/site-dist/assets/guide_phases.md.Cw0A9Vb1.lean.js +1 -0
  210. package/site-dist/assets/guide_project.md.BIcaDhdS.js +77 -0
  211. package/site-dist/assets/guide_project.md.BIcaDhdS.lean.js +77 -0
  212. package/site-dist/assets/guide_user.md.B66TQvIA.js +1 -0
  213. package/site-dist/assets/guide_user.md.B66TQvIA.lean.js +1 -0
  214. package/site-dist/assets/index.md.CrBM3tiI.js +1 -0
  215. package/site-dist/assets/index.md.CrBM3tiI.lean.js +1 -0
  216. package/site-dist/assets/inter-italic-cyrillic-ext.r48I6akx.woff2 +0 -0
  217. package/site-dist/assets/inter-italic-cyrillic.By2_1cv3.woff2 +0 -0
  218. package/site-dist/assets/inter-italic-greek-ext.1u6EdAuj.woff2 +0 -0
  219. package/site-dist/assets/inter-italic-greek.DJ8dCoTZ.woff2 +0 -0
  220. package/site-dist/assets/inter-italic-latin-ext.CN1xVJS-.woff2 +0 -0
  221. package/site-dist/assets/inter-italic-latin.C2AdPX0b.woff2 +0 -0
  222. package/site-dist/assets/inter-italic-vietnamese.BSbpV94h.woff2 +0 -0
  223. package/site-dist/assets/inter-roman-cyrillic-ext.BBPuwvHQ.woff2 +0 -0
  224. package/site-dist/assets/inter-roman-cyrillic.C5lxZ8CY.woff2 +0 -0
  225. package/site-dist/assets/inter-roman-greek-ext.CqjqNYQ-.woff2 +0 -0
  226. package/site-dist/assets/inter-roman-greek.BBVDIX6e.woff2 +0 -0
  227. package/site-dist/assets/inter-roman-latin-ext.4ZJIpNVo.woff2 +0 -0
  228. package/site-dist/assets/inter-roman-latin.Di8DUHzh.woff2 +0 -0
  229. package/site-dist/assets/inter-roman-vietnamese.BjW4sHH5.woff2 +0 -0
  230. package/site-dist/assets/reference_adr_0001-new-repo-core-and-adapters.md.CjNHHmrf.js +1 -0
  231. package/site-dist/assets/reference_adr_0001-new-repo-core-and-adapters.md.CjNHHmrf.lean.js +1 -0
  232. package/site-dist/assets/reference_adr_0002-two-orchestration-modes.md.CHD05agO.js +1 -0
  233. package/site-dist/assets/reference_adr_0002-two-orchestration-modes.md.CHD05agO.lean.js +1 -0
  234. package/site-dist/assets/reference_adr_0003-generate-once-then-lock.md.BaRiZfXT.js +1 -0
  235. package/site-dist/assets/reference_adr_0003-generate-once-then-lock.md.BaRiZfXT.lean.js +1 -0
  236. package/site-dist/assets/reference_adr_0004-external-contracts-stay-stable.md.DUJ7CTV1.js +1 -0
  237. package/site-dist/assets/reference_adr_0004-external-contracts-stay-stable.md.DUJ7CTV1.lean.js +1 -0
  238. package/site-dist/assets/reference_adr_0005-skill-names.md.DuBVd1tl.js +1 -0
  239. package/site-dist/assets/reference_adr_0005-skill-names.md.DuBVd1tl.lean.js +1 -0
  240. package/site-dist/assets/reference_adr_0006-deterministic-engine-platform-capabilities.md.Dcrnx1-L.js +1 -0
  241. package/site-dist/assets/reference_adr_0006-deterministic-engine-platform-capabilities.md.Dcrnx1-L.lean.js +1 -0
  242. package/site-dist/assets/reference_adr_0007-one-install-many-repos.md.C78cd4_P.js +1 -0
  243. package/site-dist/assets/reference_adr_0007-one-install-many-repos.md.C78cd4_P.lean.js +1 -0
  244. package/site-dist/assets/reference_adr_0008-capability-sources-and-platform-plugin.md.B4vBkIDS.js +1 -0
  245. package/site-dist/assets/reference_adr_0008-capability-sources-and-platform-plugin.md.B4vBkIDS.lean.js +1 -0
  246. package/site-dist/assets/reference_adr_index.md.Dx8sPsjs.js +1 -0
  247. package/site-dist/assets/reference_adr_index.md.Dx8sPsjs.lean.js +1 -0
  248. package/site-dist/assets/reference_commands.md.BFJRjNju.js +1 -0
  249. package/site-dist/assets/reference_commands.md.BFJRjNju.lean.js +1 -0
  250. package/site-dist/assets/reference_config.md.Dt_TJ2y9.js +6 -0
  251. package/site-dist/assets/reference_config.md.Dt_TJ2y9.lean.js +1 -0
  252. package/site-dist/assets/reference_contracts_agent-runtime.md.Bu8q-uGl.js +1 -0
  253. package/site-dist/assets/reference_contracts_agent-runtime.md.Bu8q-uGl.lean.js +1 -0
  254. package/site-dist/assets/reference_contracts_cli-json.md.Bonk0m6-.js +1 -0
  255. package/site-dist/assets/reference_contracts_cli-json.md.Bonk0m6-.lean.js +1 -0
  256. package/site-dist/assets/reference_contracts_feature-files.md.9n332kF_.js +26 -0
  257. package/site-dist/assets/reference_contracts_feature-files.md.9n332kF_.lean.js +26 -0
  258. package/site-dist/assets/reference_contracts_index.md.dqNwNs6U.js +1 -0
  259. package/site-dist/assets/reference_contracts_index.md.dqNwNs6U.lean.js +1 -0
  260. package/site-dist/assets/reference_contracts_notifier-event.md.D6we9wWS.js +24 -0
  261. package/site-dist/assets/reference_contracts_notifier-event.md.D6we9wWS.lean.js +24 -0
  262. package/site-dist/assets/reference_contracts_result-file.md.BmCaSlEu.js +1 -0
  263. package/site-dist/assets/reference_contracts_result-file.md.BmCaSlEu.lean.js +1 -0
  264. package/site-dist/assets/reference_contracts_spec.md.CDQYgJz7.js +8 -0
  265. package/site-dist/assets/reference_contracts_spec.md.CDQYgJz7.lean.js +8 -0
  266. package/site-dist/assets/reference_contracts_state.md.DVHC4opX.js +1 -0
  267. package/site-dist/assets/reference_contracts_state.md.DVHC4opX.lean.js +1 -0
  268. package/site-dist/assets/reference_contracts_usage-record.md.CQI2chqh.js +10 -0
  269. package/site-dist/assets/reference_contracts_usage-record.md.CQI2chqh.lean.js +10 -0
  270. package/site-dist/assets/reference_contracts_verify.md.CkJy8LXk.js +29 -0
  271. package/site-dist/assets/reference_contracts_verify.md.CkJy8LXk.lean.js +29 -0
  272. package/site-dist/assets/reference_design_adapter-guide.md.BSziZJSM.js +16 -0
  273. package/site-dist/assets/reference_design_adapter-guide.md.BSziZJSM.lean.js +16 -0
  274. package/site-dist/assets/reference_design_architecture.md.Bfoc-F2B.js +23 -0
  275. package/site-dist/assets/reference_design_architecture.md.Bfoc-F2B.lean.js +23 -0
  276. package/site-dist/assets/reference_design_builtin-capabilities.md.CZYtjo_v.js +7 -0
  277. package/site-dist/assets/reference_design_builtin-capabilities.md.CZYtjo_v.lean.js +7 -0
  278. package/site-dist/assets/reference_design_platform-vocabulary.md.xWGv5QO8.js +3 -0
  279. package/site-dist/assets/reference_design_platform-vocabulary.md.xWGv5QO8.lean.js +3 -0
  280. package/site-dist/assets/reference_scope.md.aUo6vISB.js +1 -0
  281. package/site-dist/assets/reference_scope.md.aUo6vISB.lean.js +1 -0
  282. package/site-dist/assets/style.BX2ZxxqY.css +1 -0
  283. package/site-dist/changelog.html +30 -0
  284. package/site-dist/favicon.svg +10 -0
  285. package/site-dist/guide/dsh.html +34 -0
  286. package/site-dist/guide/getting-started.html +30 -0
  287. package/site-dist/guide/how-it-works.html +54 -0
  288. package/site-dist/guide/index.html +30 -0
  289. package/site-dist/guide/install.html +48 -0
  290. package/site-dist/guide/intranet.html +38 -0
  291. package/site-dist/guide/maintainer.html +30 -0
  292. package/site-dist/guide/phases.html +30 -0
  293. package/site-dist/guide/project.html +106 -0
  294. package/site-dist/guide/user.html +30 -0
  295. package/site-dist/hashmap.json +1 -0
  296. package/site-dist/index.html +30 -0
  297. package/site-dist/logo-light.svg +6 -0
  298. package/site-dist/logo.svg +6 -0
  299. package/site-dist/reference/adr/0001-new-repo-core-and-adapters.html +30 -0
  300. package/site-dist/reference/adr/0002-two-orchestration-modes.html +30 -0
  301. package/site-dist/reference/adr/0003-generate-once-then-lock.html +30 -0
  302. package/site-dist/reference/adr/0004-external-contracts-stay-stable.html +30 -0
  303. package/site-dist/reference/adr/0005-skill-names.html +30 -0
  304. package/site-dist/reference/adr/0006-deterministic-engine-platform-capabilities.html +30 -0
  305. package/site-dist/reference/adr/0007-one-install-many-repos.html +30 -0
  306. package/site-dist/reference/adr/0008-capability-sources-and-platform-plugin.html +30 -0
  307. package/site-dist/reference/adr/index.html +30 -0
  308. package/site-dist/reference/commands.html +30 -0
  309. package/site-dist/reference/config.html +35 -0
  310. package/site-dist/reference/contracts/agent-runtime.html +30 -0
  311. package/site-dist/reference/contracts/cli-json.html +30 -0
  312. package/site-dist/reference/contracts/feature-files.html +55 -0
  313. package/site-dist/reference/contracts/index.html +30 -0
  314. package/site-dist/reference/contracts/notifier-event.html +53 -0
  315. package/site-dist/reference/contracts/result-file.html +30 -0
  316. package/site-dist/reference/contracts/spec.html +37 -0
  317. package/site-dist/reference/contracts/state.html +30 -0
  318. package/site-dist/reference/contracts/usage-record.html +39 -0
  319. package/site-dist/reference/contracts/verify.html +58 -0
  320. package/site-dist/reference/design/adapter-guide.html +45 -0
  321. package/site-dist/reference/design/architecture.html +52 -0
  322. package/site-dist/reference/design/builtin-capabilities.html +36 -0
  323. package/site-dist/reference/design/platform-vocabulary.html +32 -0
  324. package/site-dist/reference/scope.html +30 -0
  325. package/site-dist/vp-icons.css +1 -0
  326. package/skills/acceptance-criteria/SKILL.md +61 -0
  327. package/skills/laoshi/SKILL.md +108 -0
  328. package/skills/laoshi/playbooks/accept.md +65 -0
  329. package/skills/laoshi/playbooks/change.md +51 -0
  330. package/skills/laoshi/playbooks/incident.md +55 -0
  331. package/skills/laoshi/playbooks/new.md +96 -0
  332. package/skills/laoshi/playbooks/small.md +48 -0
  333. package/skills/laoshi/playbooks/status.md +41 -0
  334. package/skills/laoshi/playbooks/takeover.md +51 -0
  335. package/skills/laoshi/playbooks/unattended.md +101 -0
  336. package/skills/laoshi/playbooks/verify.md +57 -0
  337. package/skills/laoshi-doctor/SKILL.md +36 -0
  338. package/skills/laoshi-retro/SKILL.md +81 -0
  339. package/skills/laoshi-setup/SKILL.md +107 -0
  340. package/skills/laoshi-setup/templates/copy-local-files.mjs +32 -0
  341. package/skills/principle-delete-before-add/SKILL.md +33 -0
  342. package/skills/principle-dont-block-on-humans/SKILL.md +35 -0
  343. package/skills/principle-fix-root-cause/SKILL.md +33 -0
  344. package/skills/principle-prove-it-works/SKILL.md +33 -0
  345. package/skills/principle-report-honestly/SKILL.md +33 -0
  346. package/skills/principle-speak-to-reader/SKILL.md +33 -0
  347. package/skills/principle-this-requirement-only/SKILL.md +33 -0
  348. package/skills/requirement-interview/SKILL.md +97 -0
  349. package/skills/result-report/SKILL.md +34 -0
  350. package/skills/spec-writing/SKILL.md +58 -0
  351. package/skills/spec-writing/spec-template.md +109 -0
@@ -0,0 +1,161 @@
1
+ // The Paseo sections of `doctor` (moved from engine/src/doctor.ts in laoshi M2a): the daemon
2
+ // (connection, versions, providers, profiles, quota, each agent), the Paseo SDK's version, and
3
+ // paseo.json in the project.
4
+
5
+ import { execFileSync } from "node:child_process";
6
+ import fs from "node:fs";
7
+ import path from "node:path";
8
+ import type { PipelineConfig } from "../../engine/src/config.js";
9
+ import { findDependency, KIT_ROOT } from "../../engine/src/locations.js";
10
+ import type { DoctorTools } from "../../engine/src/platform.js";
11
+ import { satisfies } from "../../engine/src/semver.js";
12
+ import { checkProfile, connect } from "./daemon-check.js";
13
+ import { daemonVersion } from "./daemon-version.js";
14
+ import { type DaemonSettings, daemonOf } from "./settings.js";
15
+ import { type PaseoJson, paseoJsonIssues } from "./paseo-json.js";
16
+ import { describeAgentProfile, ProfileResolutionError, profilesFromDaemonConfig, resolveConfigProfiles, usesPaseoProfiles } from "./paseo-profiles.js";
17
+
18
+ function readPaseoRange(): string | null {
19
+ try {
20
+ const pkg = JSON.parse(fs.readFileSync(path.join(KIT_ROOT, "package.json"), "utf8")) as { reqKit?: { paseo?: string } };
21
+ return pkg.reqKit?.paseo ?? null;
22
+ } catch {
23
+ return null;
24
+ }
25
+ }
26
+
27
+ /** Daemon address from the raw file, so the daemon can be checked even when the agents are not filled in yet. */
28
+ function daemonSettings(configPath: string): DaemonSettings {
29
+ try {
30
+ return daemonOf(JSON.parse(fs.readFileSync(configPath, "utf8")));
31
+ } catch {
32
+ return daemonOf(null);
33
+ }
34
+ }
35
+
36
+ export async function doctorPlatform({ config, configPath, tools }: { config: PipelineConfig | null; configPath: string; tools: DoctorTools }): Promise<void> {
37
+ const { report, info } = tools;
38
+ const pkg = path.join(findDependency("@getpaseo/client") ?? path.join(KIT_ROOT, "node_modules", "@getpaseo", "client"), "package.json");
39
+ const range = readPaseoRange();
40
+ if (fs.existsSync(pkg) && range) {
41
+ const sdk = (JSON.parse(fs.readFileSync(pkg, "utf8")) as { version: string }).version;
42
+ if (satisfies(sdk, range)) report("ok", `Paseo SDK ${sdk}(本版本支持 ${range})`);
43
+ else report("warn", `Paseo SDK ${sdk} 不在本版本支持的范围 ${range} 内`, "确认 Paseo 与 laoshi 版本匹配,必要时升级 laoshi");
44
+ }
45
+ const settings = config ? daemonOf(config) : daemonSettings(configPath);
46
+ let client;
47
+ try {
48
+ client = await connect(settings);
49
+ } catch (error) {
50
+ report(
51
+ "fail",
52
+ `无法连接 daemon ${settings.daemonUrl}:${(error as Error).message}`,
53
+ `确认 Paseo 桌面端或 daemon 正在运行;设置了密码时,确认环境变量 ${settings.daemonPasswordEnv} 已设置`,
54
+ );
55
+ return;
56
+ }
57
+ try {
58
+ report("ok", `已连接 ${settings.daemonUrl}`);
59
+ const range = readPaseoRange();
60
+ const version = await daemonVersion(settings.daemonUrl, process.env[settings.daemonPasswordEnv]).catch(() => null);
61
+ if (version && range) {
62
+ if (satisfies(version, range)) report("ok", `Paseo ${version}(本版本支持 ${range})`);
63
+ else report("warn", `Paseo ${version} 不在本版本 laoshi 支持的范围 ${range} 内`, "升级到支持这个 Paseo 版本的 laoshi(laoshi upgrade)");
64
+ }
65
+ const snapshot = await client.providers.waitForReady({ timeoutMs: 30_000 });
66
+ const providers = snapshot.entries.map((e) => `${e.provider}(${e.status})`).join("、");
67
+ report("ok", `可用的 provider:${providers || "(无)"}`);
68
+ const daemonConfig = await client.config.get().then((r) => r.config as Record<string, unknown>).catch(() => null);
69
+ const paseoProfiles = daemonConfig ? profilesFromDaemonConfig(daemonConfig) : null;
70
+ if (paseoProfiles && paseoProfiles.length > 0) {
71
+ report("ok", `Paseo agent profiles:${paseoProfiles.map((p) => `「${p.name}」`).join("、")}(配置中可以用 "platformProfile": "<名称>" 引用)`);
72
+ } else if (paseoProfiles) {
73
+ info("Paseo 中还没有 agent profile。可选:在 设置 → Agents → Agent profiles 中建好\"实现\"\"评审\"等 profile,配置中用 platformProfile 引用,之后换模型只需改 Paseo");
74
+ }
75
+ if (daemonConfig) {
76
+ const mcp = daemonConfig.mcp as { injectIntoAgents?: boolean } | undefined;
77
+ const browser = daemonConfig.browserTools as { enabled?: boolean } | undefined;
78
+ info(
79
+ mcp?.injectIntoAgents
80
+ ? "Paseo 工具已开启:步骤 agent 可以重启 Paseo 管理的服务"
81
+ : "Paseo 工具未开启(设置 → Agents → Enable Paseo tools)。不影响运行;开启后步骤 agent 可以自己重启 Paseo 管理的服务",
82
+ );
83
+ info(browser?.enabled ? "浏览器工具已开启(桌面端)" : "浏览器工具未开启(不影响运行)");
84
+ }
85
+ if (config && usesPaseoProfiles(config)) {
86
+ try {
87
+ config = resolveConfigProfiles(config, paseoProfiles);
88
+ report("ok", `Paseo profile 已解析:builder ${describeAgentProfile(config.agents.builder)};reviewer ${describeAgentProfile(config.agents.reviewer)}`);
89
+ } catch (error) {
90
+ if (!(error instanceof ProfileResolutionError)) throw error;
91
+ report("fail", error.message, "在 Paseo 中建好这个 profile,或修改配置中的 platformProfile");
92
+ config = null;
93
+ }
94
+ }
95
+ if (config) {
96
+ const used = [...new Set([config.agents.builder, config.agents.reviewer].map((p) => (p.provider ?? "").split("/")[0]))];
97
+ const usage = await client.providers.listUsage().catch(() => null);
98
+ for (const p of usage?.providers ?? []) {
99
+ if (!used.includes(p.providerId) || p.status !== "available" || p.windows.length === 0) continue;
100
+ info(`${p.displayName} 额度:${p.windows.map((w) => `${w.label} 已用 ${typeof w.usedPct === "number" ? `${Math.round(w.usedPct)}%` : "?"}`).join(",")}`);
101
+ }
102
+ }
103
+ if (config) {
104
+ for (const role of ["builder", "reviewer"] as const) await checkProfile(client, role, config.agents[role], report);
105
+ if (config.reviewPanel.enabled) {
106
+ for (const [i, member] of config.reviewPanel.members.entries()) {
107
+ await checkProfile(client, `评审小组·${member.name ?? `成员 ${i + 1}`}`, member, report);
108
+ }
109
+ }
110
+ if (config.designProposals.enabled) {
111
+ for (const [i, member] of config.designProposals.members.entries()) {
112
+ await checkProfile(client, `方案提案·${member.name ?? `成员 ${i + 1}`}`, member, report);
113
+ }
114
+ }
115
+ } else {
116
+ report("warn", "配置不完整,跳过 agent 检查", "修好配置后再运行一次");
117
+ }
118
+ } catch (error) {
119
+ report("fail", `检查 daemon 时出错:${(error as Error).message}`);
120
+ } finally {
121
+ await client.close().catch(() => undefined);
122
+ }
123
+ }
124
+
125
+ /** paseo.json: worktree setup and the services Paseo can run for the pipeline. */
126
+ export function doctorProject({ repo, isRepo, tools }: { repo: string; isRepo: boolean; tools: DoctorTools }): void {
127
+ const { report, info } = tools;
128
+ const file = path.join(repo, "paseo.json");
129
+ if (!fs.existsSync(file)) {
130
+ info("没有 paseo.json。可选:/laoshi-setup 可以生成它,让 Paseo 在新建 worktree 时自动安装依赖,并由 Paseo 管理服务和端口(几个需求同时验证也不会端口冲突)");
131
+ return;
132
+ }
133
+ let raw: PaseoJson;
134
+ try {
135
+ raw = JSON.parse(fs.readFileSync(file, "utf8")) as typeof raw;
136
+ } catch (error) {
137
+ report("fail", `paseo.json 不是合法的 JSON:${(error as Error).message}`, "修正 paseo.json");
138
+ return;
139
+ }
140
+ const scripts = Object.entries(raw.scripts ?? {});
141
+ const services = scripts.filter(([, s]) => s.type === "service");
142
+ report(
143
+ "ok",
144
+ `paseo.json:${raw.worktree?.setup ? "新建 worktree 时自动准备环境;" : ""}脚本 ${scripts.length} 个${services.length ? `,其中服务 ${services.map(([n]) => n).join("、")}(由流水线通过 Paseo 启动)` : ""}`,
145
+ );
146
+ for (const [name, s] of services) {
147
+ if (s.port === undefined && !/PASEO_PORT|\{PORT\}|with-port/.test(String(s.command ?? ""))) {
148
+ report("warn", `paseo.json 中的服务 ${name} 没有使用 Paseo 分配的端口(PASEO_PORT),几个工作区同时运行时会端口冲突`, `让服务监听 Paseo 分配的端口,例如 "node scripts/paseo/with-port.mjs npm run dev -- --port {PORT}"(/laoshi-setup 会写入这个脚本)`);
149
+ }
150
+ }
151
+ for (const issue of paseoJsonIssues(raw)) {
152
+ if (issue.kind === "fails") report("warn", issue.text, issue.fix);
153
+ else info(`${issue.text}。团队都用同一种系统时可以不改;否则:${issue.fix}`);
154
+ }
155
+ if (!isRepo) return;
156
+ try {
157
+ execFileSync("git", ["ls-files", "--error-unmatch", "paseo.json"], { cwd: repo, stdio: "ignore" });
158
+ } catch {
159
+ report("warn", "paseo.json 还没有提交:Paseo 新建 worktree 时读取的是已提交的版本", "提交 paseo.json");
160
+ }
161
+ }
@@ -0,0 +1,30 @@
1
+ // laoshi installer, Paseo part (bin/install.mjs): Paseo's agents read skills from the user-level
2
+ // skills directories, as req-kit installed them. The Paseo plugin (requirement views in Paseo)
3
+ // still comes with paseo-req-kit.
4
+ import fs from "node:fs";
5
+ import os from "node:os";
6
+ import path from "node:path";
7
+
8
+ export const id = "paseo";
9
+ export const options = {};
10
+
11
+ export function platformConfig() {
12
+ return { adapter: "paseo" };
13
+ }
14
+
15
+ /** Placeholders the configuration wizard (`laoshi configure`) replaces with Paseo's agents. */
16
+ export const defaultAgents = { builder: { provider: "CHANGE-ME/model" }, reviewer: { provider: "CHANGE-ME/model" } };
17
+
18
+ export function skillTargets() {
19
+ const home = os.homedir();
20
+ const roots = [{ dir: path.join(home, ".agents", "skills"), label: "通用目录 ~/.agents/skills(Codex、Pi、OpenCode 等)" }];
21
+ if (fs.existsSync(path.join(home, ".claude"))) roots.push({ dir: path.join(home, ".claude", "skills"), label: "Claude Code ~/.claude/skills" });
22
+ return roots;
23
+ }
24
+
25
+ export function setup({ report }) {
26
+ report("info", "Paseo 的需求插件仍由 paseo-req-kit 提供(req plugin install)");
27
+ return ["在终端运行 laoshi configure,选择 builder 和 reviewer 用的 agent"];
28
+ }
29
+
30
+ export function uninstall() {}
@@ -0,0 +1,73 @@
1
+ // paseo.json checks shared by the doctor.
2
+ //
3
+ // Paseo 0.11 runs project commands with a different shell on each system:
4
+ // worktree.setup: bash (macOS, Linux) / powershell -ExecutionPolicy Bypass (Windows)
5
+ // scripts: the terminal's shell, $SHELL or /bin/sh (macOS, Linux) / cmd.exe (Windows)
6
+ // paseo.json is committed and shared, so commands should work in all of them: plain program
7
+ // invocations, with environment variables read by the program (see /laoshi-setup's helpers).
8
+
9
+ export type PaseoJson = { worktree?: { setup?: unknown }; scripts?: Record<string, { type?: string; command?: string; port?: number }> };
10
+
11
+ export type ShellStyle = "posix" | "powershell" | "cmd";
12
+
13
+ const STYLE_NAMES: Record<ShellStyle, string> = { posix: "bash/sh", powershell: "PowerShell", cmd: "cmd.exe" };
14
+
15
+ /** Shell-specific syntax found in a command (empty: works the same everywhere). */
16
+ export function shellStyles(command: string): ShellStyle[] {
17
+ const styles = new Set<ShellStyle>();
18
+ if (/\$env:[A-Za-z_]/i.test(command) || /\b(Test-Path|Copy-Item|Set-Location|Get-ChildItem|Remove-Item)\b/.test(command)) styles.add("powershell");
19
+ if (/%[A-Za-z_][A-Za-z0-9_]*%/.test(command)) styles.add("cmd");
20
+ if (/(^|[^:\w`])\$\{?(?!env:)[A-Za-z_]/i.test(command) || /\[\s+-[a-z]\s/.test(command) || /(^|\s)(cp|mv|rm|export)\s/.test(command) || /\|\||&&/.test(command)) {
21
+ // `&&` works in cmd and PowerShell 7 too, but not in Windows PowerShell 5.1, which Paseo uses for setup.
22
+ styles.add("posix");
23
+ }
24
+ return [...styles];
25
+ }
26
+
27
+ function setupCommands(raw: PaseoJson): string[] {
28
+ const setup = raw.worktree?.setup;
29
+ if (Array.isArray(setup)) return setup.map(String);
30
+ return typeof setup === "string" ? setup.split(/\r?\n/).filter((l) => l.trim()) : [];
31
+ }
32
+
33
+ export interface PaseoJsonIssue {
34
+ /** "fails": the command will not work on this machine; "portable": it only works on some systems. */
35
+ kind: "fails" | "portable";
36
+ text: string;
37
+ fix: string;
38
+ }
39
+
40
+ const FIX =
41
+ "改成各系统都一样的写法:准备命令用 node scripts/paseo/copy-local-files.mjs .env,服务用 node scripts/paseo/with-port.mjs npm run dev -- --port {PORT}(/laoshi-setup 会写入这两个脚本)";
42
+
43
+ /** Problems of the project's paseo.json for the system Paseo runs on (process.platform by default). */
44
+ export function paseoJsonIssues(raw: PaseoJson, platform: NodeJS.Platform = process.platform): PaseoJsonIssue[] {
45
+ const windows = platform === "win32";
46
+ const setupShell: ShellStyle = windows ? "powershell" : "posix";
47
+ const scriptShell: ShellStyle = windows ? "cmd" : "posix";
48
+ const issues: PaseoJsonIssue[] = [];
49
+ const check = (where: string, command: string, shell: ShellStyle) => {
50
+ const styles = shellStyles(command);
51
+ if (styles.length === 0) return;
52
+ const short = command.length > 60 ? `${command.slice(0, 60)}…` : command;
53
+ const foreign = styles.filter((s) => s !== shell);
54
+ if (foreign.length > 0) {
55
+ issues.push({
56
+ kind: "fails",
57
+ text: `${where}「${short}」是 ${foreign.map((s) => STYLE_NAMES[s]).join("、")} 写法,这台机器上 Paseo 用 ${STYLE_NAMES[shell]} 执行,会失败`,
58
+ fix: FIX,
59
+ });
60
+ } else {
61
+ issues.push({
62
+ kind: "portable",
63
+ text: `${where}「${short}」用了 ${STYLE_NAMES[shell]} 的写法,在这台机器上可以用,换到其他系统(Windows 和 macOS/Linux 之间)会失败`,
64
+ fix: FIX,
65
+ });
66
+ }
67
+ };
68
+ for (const cmd of setupCommands(raw)) check("paseo.json 的 worktree.setup 中", cmd, setupShell);
69
+ for (const [name, s] of Object.entries(raw.scripts ?? {})) {
70
+ check(`paseo.json 的${s.type === "service" ? "服务" : "脚本"} ${name}`, String(s.command ?? ""), scriptShell);
71
+ }
72
+ return issues;
73
+ }
@@ -0,0 +1,127 @@
1
+ // Paseo agent profiles: named launch bundles (provider, model, mode, thinking level,
2
+ // features) that people set up once in Paseo's settings. req-kit roles and review
3
+ // panel members can name one instead of spelling the settings out:
4
+ //
5
+ // "builder": { "platformProfile": "实现" }
6
+ // "reviewer": { "platformProfile": "评审", "thinkingOptionId": "high" } // own fields win
7
+ //
8
+ // The names are resolved against the daemon when a run starts, so changing the
9
+ // profile in Paseo changes the next run without touching req-kit's config.
10
+
11
+ import type { AgentProfile, PipelineConfig } from "../../engine/src/config.js";
12
+ import type { PlatformProfile } from "../../engine/src/runtime.js";
13
+
14
+ /** The fields of Paseo's AgentProfile that req-kit uses (protocol/src/agent-profile.ts): the core's PlatformProfile. */
15
+ export type PaseoProfile = PlatformProfile;
16
+
17
+ export class ProfileResolutionError extends Error {
18
+ constructor(message: string) {
19
+ super(message);
20
+ this.name = "ProfileResolutionError";
21
+ }
22
+ }
23
+
24
+ export function findPaseoProfile(name: string, available: PaseoProfile[]): PaseoProfile | null {
25
+ const wanted = name.trim();
26
+ return (
27
+ available.find((p) => p.name === wanted) ??
28
+ available.find((p) => p.name.toLowerCase() === wanted.toLowerCase()) ??
29
+ available.find((p) => p.id === wanted) ??
30
+ null
31
+ );
32
+ }
33
+
34
+ /**
35
+ * Turns a role that names a Paseo profile into concrete agent settings. Settings
36
+ * written next to `platformProfile` override the profile's; feature values are merged.
37
+ * Roles without `platformProfile` are returned unchanged.
38
+ */
39
+ export function resolveAgentProfile(label: string, profile: AgentProfile, available: PaseoProfile[] | null): AgentProfile {
40
+ if (!profile.platformProfile) return profile;
41
+ if (available === null) {
42
+ throw new ProfileResolutionError(`${label} 使用 Paseo profile「${profile.platformProfile}」,但无法从 daemon 读取 profile 列表`);
43
+ }
44
+ const found = findPaseoProfile(profile.platformProfile, available);
45
+ if (!found) {
46
+ const names = available.map((p) => `「${p.name}」`).join("、") || "(还没有任何 profile)";
47
+ throw new ProfileResolutionError(
48
+ `${label} 使用的 Paseo profile「${profile.platformProfile}」不存在。现有的 profile:${names}。在 Paseo 的 设置 → Agents → Agent profiles 中查看或新建`,
49
+ );
50
+ }
51
+ if (!found.model) {
52
+ throw new ProfileResolutionError(`Paseo profile「${found.name}」没有选择模型,laoshi 需要明确的模型。请在 Paseo 设置中为它选择模型`);
53
+ }
54
+ const resolved: AgentProfile = { ...profile, provider: profile.provider ?? `${found.provider}/${found.model}` };
55
+ const modeId = profile.modeId ?? found.modeId;
56
+ const thinking = profile.thinkingOptionId ?? found.thinkingOptionId;
57
+ const features = found.featureValues || profile.featureValues ? { ...found.featureValues, ...profile.featureValues } : undefined;
58
+ if (modeId) resolved.modeId = modeId;
59
+ if (thinking) resolved.thinkingOptionId = thinking;
60
+ if (features) resolved.featureValues = features;
61
+ return resolved;
62
+ }
63
+
64
+ /** "Paseo profile「实现」→ claude/opus(模式 bypassPermissions)" */
65
+ export function describeAgentProfile(profile: AgentProfile): string {
66
+ if (!profile.provider) return `Paseo profile「${profile.platformProfile}」(运行时从 Paseo 读取设置)`;
67
+ const settings = `${profile.provider}${profile.modeId ? `(模式 ${profile.modeId})` : ""}`;
68
+ return profile.platformProfile ? `Paseo profile「${profile.platformProfile}」→ ${settings}` : settings;
69
+ }
70
+
71
+ /** Reads the daemon's profiles from its config. Null when the daemon does not say. */
72
+ export function profilesFromDaemonConfig(config: unknown): PaseoProfile[] | null {
73
+ if (typeof config !== "object" || config === null) return null;
74
+ const list = (config as { agentProfiles?: unknown }).agentProfiles;
75
+ if (list === undefined) return [];
76
+ if (!Array.isArray(list)) return null;
77
+ return list.filter(
78
+ (p): p is PaseoProfile =>
79
+ typeof p === "object" && p !== null && typeof (p as PaseoProfile).name === "string" && typeof (p as PaseoProfile).provider === "string",
80
+ );
81
+ }
82
+
83
+ /** Whether any role or panel member names a Paseo profile. */
84
+ export function usesPaseoProfiles(config: PipelineConfig): boolean {
85
+ return [
86
+ config.agents.builder,
87
+ config.agents.reviewer,
88
+ ...(config.agents.fallback ? [config.agents.fallback] : []),
89
+ ...config.reviewPanel.members,
90
+ ...config.designProposals.members,
91
+ ...Object.values(config.phases.verify.agents),
92
+ ].some((p) =>
93
+ Boolean(p.platformProfile),
94
+ );
95
+ }
96
+
97
+ /** The config with every Paseo profile name replaced by its settings. Throws ProfileResolutionError. */
98
+ export function resolveConfigProfiles(config: PipelineConfig, available: PaseoProfile[] | null): PipelineConfig {
99
+ return {
100
+ ...config,
101
+ agents: {
102
+ builder: resolveAgentProfile("agents.builder", config.agents.builder, available),
103
+ reviewer: resolveAgentProfile("agents.reviewer", config.agents.reviewer, available),
104
+ ...(config.agents.fallback ? { fallback: resolveAgentProfile("agents.fallback", config.agents.fallback, available) } : {}),
105
+ },
106
+ reviewPanel: {
107
+ ...config.reviewPanel,
108
+ members: config.reviewPanel.members.map((m, i) => ({ ...m, ...resolveAgentProfile(`reviewPanel.members[${i}]`, m, available) })),
109
+ },
110
+ designProposals: {
111
+ ...config.designProposals,
112
+ members: config.designProposals.members.map((m, i) => ({
113
+ ...m,
114
+ ...resolveAgentProfile(`designProposals.members[${i}]`, m, available),
115
+ })),
116
+ },
117
+ phases: {
118
+ ...config.phases,
119
+ verify: {
120
+ ...config.phases.verify,
121
+ agents: Object.fromEntries(
122
+ Object.entries(config.phases.verify.agents).map(([role, p]) => [role, resolveAgentProfile(`phases.verify.agents.${role}`, p, available)]),
123
+ ),
124
+ },
125
+ },
126
+ };
127
+ }