@rse/ase 1.0.7 → 2.0.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 (279) hide show
  1. package/dst/ase-agent-definition-api.d.ts +184 -0
  2. package/dst/ase-agent-definition-api.js +6 -0
  3. package/dst/ase-agent-definition-builtin/condenser.js +42 -0
  4. package/dst/ase-agent-definition-builtin/editor.js +45 -0
  5. package/dst/ase-agent-definition-builtin/estimator.js +98 -0
  6. package/dst/ase-agent-definition-builtin/implementer.js +121 -0
  7. package/dst/ase-agent-definition-builtin/integrator.js +56 -0
  8. package/dst/ase-agent-definition-builtin/qualifier.js +61 -0
  9. package/dst/ase-agent-definition-builtin/rebooter.js +41 -0
  10. package/dst/ase-agent-definition-builtin/researcher.js +77 -0
  11. package/dst/ase-agent-definition-core.js +827 -0
  12. package/dst/ase-agent-fleet.js +772 -0
  13. package/dst/ase-agent-process.js +232 -0
  14. package/dst/ase-agent-relay-client.js +509 -0
  15. package/dst/ase-agent-relay-core.js +213 -0
  16. package/dst/ase-agent-relay-server-bind.js +242 -0
  17. package/dst/ase-agent-relay-server-cli.js +50 -0
  18. package/dst/ase-agent-runtime-claim.js +189 -0
  19. package/dst/ase-agent-runtime-engine.js +1100 -0
  20. package/dst/ase-agent-runtime-exec.js +275 -0
  21. package/dst/ase-agent-runtime-phase.js +581 -0
  22. package/dst/ase-agent-runtime-request.js +272 -0
  23. package/dst/ase-agent-runtime-tool.js +207 -0
  24. package/dst/ase-agent-runtime.js +1316 -0
  25. package/dst/ase-agent.js +65 -0
  26. package/dst/ase-artifact.js +6 -5
  27. package/dst/ase-config-core.js +465 -0
  28. package/dst/ase-config-schema.js +357 -0
  29. package/dst/ase-config-scope.js +172 -0
  30. package/dst/ase-config.js +25 -585
  31. package/dst/ase-hook.js +228 -111
  32. package/dst/ase-lib-daemon-cli.js +130 -0
  33. package/dst/ase-lib-hash.js +20 -0
  34. package/dst/{ase-log.js → ase-lib-log.js} +40 -7
  35. package/dst/ase-lib-server-bind.js +115 -0
  36. package/dst/ase-lib-server-cli.js +474 -0
  37. package/dst/{ase-table.js → ase-lib-table.js} +1 -1
  38. package/dst/{ase-version.js → ase-lib-version.js} +8 -1
  39. package/dst/ase-man.js +96 -0
  40. package/dst/ase-mcp.js +166 -13
  41. package/dst/{ase-getopt.js → ase-service-getopt.js} +82 -80
  42. package/dst/{ase-markdown.js → ase-service-markdown.js} +18 -11
  43. package/dst/ase-service-otel.js +1246 -0
  44. package/dst/{ase-skills.js → ase-service-skills.js} +29 -64
  45. package/dst/ase-service-state.js +101 -0
  46. package/dst/ase-service.js +269 -81
  47. package/dst/ase-setup-common.js +141 -0
  48. package/dst/ase-setup-mcp.js +359 -0
  49. package/dst/ase-setup-settings.js +837 -0
  50. package/dst/ase-setup.js +113 -869
  51. package/dst/ase-spec.js +31 -19
  52. package/dst/ase-statusline.js +108 -43
  53. package/dst/ase-task-board-core.js +739 -0
  54. package/dst/ase-task-board-filter.js +127 -0
  55. package/dst/ase-task-board-flow.js +237 -0
  56. package/dst/ase-task-board-graph.js +497 -0
  57. package/dst/ase-task-board-stats.js +263 -0
  58. package/dst/ase-task-board-tui-control.js +775 -0
  59. package/dst/ase-task-board-tui-model.js +1008 -0
  60. package/dst/ase-task-board-tui-popup.js +626 -0
  61. package/dst/ase-task-board-tui-style.js +106 -0
  62. package/dst/ase-task-board-tui-view.js +847 -0
  63. package/dst/ase-task-board-tui.js +189 -0
  64. package/dst/ase-task-board-web-client.css +1 -0
  65. package/dst/ase-task-board-web-client.html +20 -0
  66. package/dst/ase-task-board-web-client.js +81 -0
  67. package/dst/ase-task-board-web-server.js +823 -0
  68. package/dst/ase-task-board.js +134 -0
  69. package/dst/ase-task-format.js +757 -0
  70. package/dst/ase-task-request.js +208 -0
  71. package/dst/ase-task-store-client.js +495 -0
  72. package/dst/ase-task-store-core.js +804 -0
  73. package/dst/ase-task-store-issues.js +237 -0
  74. package/dst/ase-task-store-plugin-api.js +6 -0
  75. package/dst/ase-task-store-plugin-ase.js +484 -0
  76. package/dst/ase-task-store-plugin-delegate.js +137 -0
  77. package/dst/ase-task-store-plugin-gitea.js +666 -0
  78. package/dst/ase-task-store-plugin-github.js +696 -0
  79. package/dst/ase-task-store-plugin-gitlab.js +668 -0
  80. package/dst/ase-task-store-server-bind.js +538 -0
  81. package/dst/ase-task-store-server-cli.js +154 -0
  82. package/dst/ase-task.js +1335 -357
  83. package/dst/{ase-compat.js → ase-util-compat.js} +2 -2
  84. package/dst/{ase-diagram.js → ase-util-diagram.js} +107 -32
  85. package/dst/{ase-meta.js → ase-util-meta.js} +2 -2
  86. package/dst/{ase-metric.js → ase-util-metric.js} +2 -2
  87. package/dst/{ase-mint.js → ase-util-mint.js} +19 -12
  88. package/dst/{ase-worktree.js → ase-util-worktree.js} +30 -19
  89. package/dst/ase-util.js +20 -0
  90. package/dst/ase.js +108 -32
  91. package/dst/man/ase-agent-adhoc.1 +515 -0
  92. package/dst/man/ase-agent-condenser.1 +193 -0
  93. package/dst/man/ase-agent-editor.1 +212 -0
  94. package/dst/man/ase-agent-estimator.1 +214 -0
  95. package/dst/man/ase-agent-fleet.1 +185 -0
  96. package/dst/man/ase-agent-implementer.1 +233 -0
  97. package/dst/man/ase-agent-integrator.1 +213 -0
  98. package/dst/man/ase-agent-qualifier.1 +214 -0
  99. package/dst/man/ase-agent-rebooter.1 +193 -0
  100. package/dst/man/ase-agent-relay.1 +128 -0
  101. package/dst/man/ase-agent-researcher.1 +217 -0
  102. package/dst/man/ase-agent.1 +264 -0
  103. package/dst/man/ase-artifact-list.1 +38 -0
  104. package/dst/man/ase-artifact-name.1 +39 -0
  105. package/dst/man/ase-artifact.1 +56 -0
  106. package/dst/man/ase-config-delete.1 +45 -0
  107. package/dst/man/ase-config-edit.1 +48 -0
  108. package/dst/man/ase-config-get.1 +46 -0
  109. package/dst/man/ase-config-init.1 +60 -0
  110. package/dst/man/ase-config-list.1 +42 -0
  111. package/dst/man/ase-config-set.1 +52 -0
  112. package/dst/man/ase-config.1 +231 -0
  113. package/dst/man/ase-hook-permission-request.1 +36 -0
  114. package/dst/man/ase-hook-pre-tool-use.1 +59 -0
  115. package/dst/man/ase-hook-session-end.1 +47 -0
  116. package/dst/man/ase-hook-session-persona.1 +37 -0
  117. package/dst/man/ase-hook-session-start.1 +81 -0
  118. package/dst/man/ase-hook-stop.1 +34 -0
  119. package/dst/man/ase-hook-user-prompt-submit.1 +34 -0
  120. package/dst/man/ase-hook.1 +51 -0
  121. package/dst/man/ase-man.1 +67 -0
  122. package/dst/man/ase-mcp.1 +61 -0
  123. package/dst/man/ase-service-log.1 +43 -0
  124. package/dst/man/ase-service-send.1 +47 -0
  125. package/dst/man/ase-service-start.1 +54 -0
  126. package/dst/man/ase-service-status.1 +46 -0
  127. package/dst/man/ase-service-stop.1 +37 -0
  128. package/dst/man/ase-service.1 +85 -0
  129. package/dst/man/ase-setup-disable.1 +44 -0
  130. package/dst/man/ase-setup-enable.1 +45 -0
  131. package/dst/man/ase-setup-install.1 +73 -0
  132. package/dst/man/ase-setup-mcp.1 +124 -0
  133. package/dst/man/ase-setup-status.1 +60 -0
  134. package/dst/man/ase-setup-statusline.1 +92 -0
  135. package/dst/man/ase-setup-telemetry.1 +92 -0
  136. package/dst/man/ase-setup-uninstall.1 +59 -0
  137. package/dst/man/ase-setup-update.1 +64 -0
  138. package/dst/man/ase-setup.1 +93 -0
  139. package/dst/man/ase-spec-export.1 +62 -0
  140. package/dst/man/ase-spec-lint.1 +40 -0
  141. package/dst/man/ase-spec-preview.1 +40 -0
  142. package/dst/man/ase-spec.1 +46 -0
  143. package/dst/man/ase-statusline.1 +189 -0
  144. package/dst/man/ase-task-assign.1 +71 -0
  145. package/dst/man/ase-task-board.1 +384 -0
  146. package/dst/man/ase-task-delete.1 +35 -0
  147. package/dst/man/ase-task-edit.1 +46 -0
  148. package/dst/man/ase-task-idscheme.1 +65 -0
  149. package/dst/man/ase-task-lifecycle.1 +57 -0
  150. package/dst/man/ase-task-list.1 +47 -0
  151. package/dst/man/ase-task-load.1 +36 -0
  152. package/dst/man/ase-task-newid.1 +61 -0
  153. package/dst/man/ase-task-purge.1 +37 -0
  154. package/dst/man/ase-task-rename.1 +44 -0
  155. package/dst/man/ase-task-request.1 +61 -0
  156. package/dst/man/ase-task-save.1 +48 -0
  157. package/dst/man/ase-task-status.1 +55 -0
  158. package/dst/man/ase-task-store.1 +194 -0
  159. package/dst/man/ase-task-view.1 +40 -0
  160. package/dst/man/ase-task.1 +160 -0
  161. package/dst/man/ase-util-compat.1 +25 -0
  162. package/dst/man/ase-util-diagram.1 +76 -0
  163. package/dst/man/ase-util-meta.1 +45 -0
  164. package/dst/man/ase-util-metric.1 +54 -0
  165. package/dst/man/ase-util-mint.1 +59 -0
  166. package/dst/man/ase-util-worktree.1 +72 -0
  167. package/dst/man/ase-util.1 +50 -0
  168. package/dst/man/ase.1 +124 -0
  169. package/package.json +81 -21
  170. package/plugin/.claude-plugin/plugin.json +1 -1
  171. package/plugin/.codex-plugin/plugin.json +1 -1
  172. package/plugin/.github/plugin/plugin.json +1 -1
  173. package/plugin/agents/ase-meta-diagram.md +12 -8
  174. package/plugin/agents/ase-repo-review.md +322 -0
  175. package/plugin/hooks/hooks-codex.json +5 -0
  176. package/plugin/hooks/hooks-copilot.json +5 -0
  177. package/plugin/hooks/hooks.json +8 -0
  178. package/plugin/meta/ase-common-approach.md +117 -0
  179. package/plugin/meta/ase-common-changeset.md +256 -0
  180. package/plugin/meta/ase-common-code.md +10 -173
  181. package/plugin/meta/ase-common-grill.md +317 -0
  182. package/plugin/meta/ase-common-resolve.md +305 -0
  183. package/plugin/meta/ase-common-task.md +83 -4
  184. package/plugin/meta/ase-constitution.md +0 -2
  185. package/plugin/meta/ase-format-specbook.md +208 -25
  186. package/plugin/meta/ase-format-specbook.yaml +242 -851
  187. package/plugin/meta/ase-format-task.md +669 -125
  188. package/plugin/meta/ase-persona.md +3 -4
  189. package/plugin/meta/ase-skill.md +9 -0
  190. package/plugin/mods/ase-mods.ts +409 -0
  191. package/plugin/mods/claude-code.d.ts +13417 -0
  192. package/plugin/skills/ase-arch-analyze/SKILL.md +1 -1
  193. package/plugin/skills/ase-arch-analyze/help.md +2 -2
  194. package/plugin/skills/ase-code-analyze/SKILL.md +59 -8
  195. package/plugin/skills/ase-code-analyze/help.md +29 -4
  196. package/plugin/skills/ase-code-edit/SKILL.md +107 -181
  197. package/plugin/skills/ase-code-edit/help.md +118 -31
  198. package/plugin/skills/ase-code-lint/SKILL.md +64 -13
  199. package/plugin/skills/ase-code-lint/help.md +32 -2
  200. package/plugin/skills/ase-docs-proofread/SKILL.md +4 -4
  201. package/plugin/skills/ase-docs-proofread/help.md +1 -1
  202. package/plugin/skills/ase-docs-refine/SKILL.md +4 -4
  203. package/plugin/skills/ase-docs-shorten/SKILL.md +4 -4
  204. package/plugin/skills/ase-help-intent/data.md +2164 -1087
  205. package/plugin/skills/ase-help-intent/help.md +1 -1
  206. package/plugin/skills/ase-help-skill/catalog.md +12 -9
  207. package/plugin/skills/ase-meta-brainstorm/SKILL.md +1 -1
  208. package/plugin/skills/ase-meta-config/SKILL.md +3 -4
  209. package/plugin/skills/ase-meta-config/help.md +31 -10
  210. package/plugin/skills/ase-meta-mint/SKILL.md +5 -5
  211. package/plugin/skills/ase-meta-mint/help.md +10 -5
  212. package/plugin/skills/ase-meta-why/help.md +1 -1
  213. package/plugin/skills/ase-meta-workflow/SKILL.md +7 -7
  214. package/plugin/skills/ase-meta-workflow/help.md +4 -4
  215. package/plugin/skills/ase-meta-workflow/sample.md +3 -3
  216. package/plugin/skills/ase-meta-workflow/workflow.txt +22 -18
  217. package/plugin/skills/{ase-meta-changelog → ase-repo-changelog}/SKILL.md +4 -3
  218. package/plugin/skills/{ase-meta-changelog → ase-repo-changelog}/help.md +5 -5
  219. package/plugin/skills/{ase-meta-commit → ase-repo-commit}/SKILL.md +6 -6
  220. package/plugin/skills/{ase-meta-commit → ase-repo-commit}/help.md +5 -5
  221. package/plugin/skills/{ase-meta-diff → ase-repo-diff}/SKILL.md +6 -6
  222. package/plugin/skills/{ase-meta-diff → ase-repo-diff}/help.md +8 -8
  223. package/plugin/skills/{ase-code-dissect → ase-repo-dissect}/SKILL.md +19 -19
  224. package/plugin/skills/{ase-code-dissect → ase-repo-dissect}/help.md +10 -12
  225. package/plugin/skills/ase-repo-merge/SKILL.md +346 -0
  226. package/plugin/skills/ase-repo-merge/help.md +107 -0
  227. package/plugin/skills/ase-repo-resolve/SKILL.md +158 -0
  228. package/plugin/skills/ase-repo-resolve/help.md +102 -0
  229. package/plugin/skills/ase-repo-review/SKILL.md +406 -0
  230. package/plugin/skills/ase-repo-review/help.md +181 -0
  231. package/plugin/skills/ase-spec-edit/SKILL.md +117 -183
  232. package/plugin/skills/ase-spec-edit/help.md +107 -26
  233. package/plugin/skills/ase-sync-reconcile/help.md +1 -1
  234. package/plugin/skills/ase-task-assign/SKILL.md +111 -0
  235. package/plugin/skills/ase-task-assign/help.md +119 -0
  236. package/plugin/skills/ase-task-condense/SKILL.md +21 -21
  237. package/plugin/skills/ase-task-condense/help.md +12 -10
  238. package/plugin/skills/ase-task-delete/SKILL.md +1 -1
  239. package/plugin/skills/ase-task-dissect/SKILL.md +71 -48
  240. package/plugin/skills/ase-task-dissect/help.md +10 -9
  241. package/plugin/skills/ase-task-edit/SKILL.md +379 -94
  242. package/plugin/skills/ase-task-edit/help.md +95 -22
  243. package/plugin/skills/ase-task-estimate/SKILL.md +492 -0
  244. package/plugin/skills/ase-task-estimate/help.md +158 -0
  245. package/plugin/skills/ase-task-grill/SKILL.md +246 -138
  246. package/plugin/skills/ase-task-grill/help.md +129 -26
  247. package/plugin/skills/ase-task-id/SKILL.md +8 -1
  248. package/plugin/skills/ase-task-id/help.md +6 -3
  249. package/plugin/skills/ase-task-implement/SKILL.md +535 -145
  250. package/plugin/skills/ase-task-implement/help.md +138 -47
  251. package/plugin/skills/ase-task-integrate/SKILL.md +549 -0
  252. package/plugin/skills/ase-task-integrate/help.md +187 -0
  253. package/plugin/skills/ase-task-list/SKILL.md +55 -23
  254. package/plugin/skills/ase-task-list/help.md +45 -21
  255. package/plugin/skills/ase-task-reboot/SKILL.md +84 -43
  256. package/plugin/skills/ase-task-reboot/help.md +28 -8
  257. package/plugin/skills/ase-task-rename/SKILL.md +10 -2
  258. package/plugin/skills/ase-task-research/SKILL.md +386 -0
  259. package/plugin/skills/ase-task-research/help.md +102 -0
  260. package/plugin/skills/ase-task-status/SKILL.md +137 -0
  261. package/plugin/skills/ase-task-status/help.md +80 -0
  262. package/plugin/skills/ase-task-view/SKILL.md +49 -24
  263. package/plugin/skills/ase-task-view/help.md +19 -9
  264. package/plugin/agents/ase-meta-review.md +0 -187
  265. package/plugin/skills/ase-code-craft/SKILL.md +0 -264
  266. package/plugin/skills/ase-code-craft/help.md +0 -122
  267. package/plugin/skills/ase-code-refactor/SKILL.md +0 -232
  268. package/plugin/skills/ase-code-refactor/help.md +0 -109
  269. package/plugin/skills/ase-code-resolve/SKILL.md +0 -289
  270. package/plugin/skills/ase-code-resolve/help.md +0 -116
  271. package/plugin/skills/ase-meta-review/SKILL.md +0 -210
  272. package/plugin/skills/ase-meta-review/help.md +0 -96
  273. package/plugin/skills/ase-task-preflight/SKILL.md +0 -166
  274. package/plugin/skills/ase-task-preflight/help.md +0 -82
  275. /package/dst/{ase-ignore.js → ase-lib-ignore.js} +0 -0
  276. /package/dst/{ase-stdio.js → ase-lib-stdio.js} +0 -0
  277. /package/dst/{ase-kv.js → ase-service-kv.js} +0 -0
  278. /package/dst/{ase-sleep.js → ase-service-sleep.js} +0 -0
  279. /package/dst/{ase-timestamp.js → ase-service-timestamp.js} +0 -0
@@ -0,0 +1,256 @@
1
+
2
+ Change Set Common Steps
3
+ =======================
4
+
5
+ <define name="changeset-context">
6
+
7
+ Prepare the *origin working copy* -- the Git working copy the skill
8
+ was started in, which the `worktree` values of the `Source` and
9
+ `Target` concepts refer to -- and the *context worktree* -- the Git
10
+ working copy which the `worktree` value of the `Changeset` concept
11
+ refers to and in which the skill operates -- from the value <arg1/> of
12
+ the `--worktree <name/>[:<branch/>]` option, where <arg2/> is the skill
13
+ chrome of the status lines, <arg3/> is `true` if the `:<branch/>` part
14
+ is permitted (or `false` otherwise), <arg4/> is `true` if a missing
15
+ context worktree may be created (or `false` otherwise), and <arg5/> is
16
+ the *start point* (a commit or branch) of a branch created together
17
+ with the context worktree (or empty for `HEAD`). It sets
18
+ <origin-dir/> to the absolute directory of the origin working copy,
19
+ <context-dir/> to the absolute directory of the context worktree, and
20
+ <context-label/> to its display label. Do not output anything, except
21
+ for the templates below.
22
+
23
+ 1. Set <origin-dir/> to the output of the command
24
+ `git rev-parse --show-toplevel` (taken exactly as given). If this
25
+ command fails, only output the following <template/> and then
26
+ immediately *STOP* processing the entire current skill:
27
+
28
+ <template>
29
+ ⧉ **ASE**: <arg2/>, ▶ ERROR: no Git repository
30
+ </template>
31
+
32
+ <if condition="<arg1/> is empty">
33
+ The context worktree is the origin working copy itself: set
34
+ <context-dir><origin-dir/></context-dir> and
35
+ <context-label>.</context-label>, and *skip* all remaining
36
+ sub-steps of this definition.
37
+ </if>
38
+
39
+ 2. Split <arg1/> at its *first* `:` character into <context-name/>
40
+ (the part before) and <context-branch/> (the part after, or empty
41
+ if there is no `:`). The <context-name/> is *valid* only if it is
42
+ non-empty and consists of the characters `A-Z`, `a-z`, `0-9`, `_`,
43
+ and `-` only. A non-empty <context-branch/> is *valid* only if it
44
+ is a valid branch name according to the `changeset-value`
45
+ definition below and <arg3/> is `true`. If one of them is not
46
+ valid, only output the following <template/> and then immediately
47
+ *STOP* processing the entire current skill:
48
+
49
+ <template>
50
+ ⧉ **ASE**: <arg2/>, ▶ ERROR: invalid `--worktree` value: **<arg1/>**
51
+ </template>
52
+
53
+ 3. Determine <context-dir/> by calling the `ase_worktree_path(id:
54
+ "<context-name/>", create: true)` tool of the `ase` MCP server and
55
+ set <context-label>.ase/worktree/<context-name/></context-label>.
56
+ You *MUST* *NEVER* assemble this path yourself, as only this tool
57
+ rejects a path leading through a symbolic link, through a
58
+ non-directory, or out of the repository. If this tool call fails,
59
+ only output the following <template/> and then immediately *STOP*
60
+ processing the entire current skill, leaving the working copy
61
+ *untouched*:
62
+
63
+ <template>
64
+ ⧉ **ASE**: <arg2/>, ▶ ERROR: no Git repository or unsafe worktree directory -- cannot create worktree
65
+ </template>
66
+
67
+ 4. Determine the *existing worktrees* and *existing branches* by
68
+ running the commands `git worktree list --porcelain` and
69
+ `git branch --list` (taken exactly as given).
70
+
71
+ - <if condition="<context-dir/> is a *registered* worktree">
72
+ The context worktree is *reused*, whatever is checked out in it.
73
+ If <context-branch/> is not empty and differs from the branch
74
+ checked out in <context-dir/>, switch it: if the command
75
+ `git -C "<context-dir/>" status --porcelain` reports any output,
76
+ or the command `git -C "<context-dir/>" switch "<context-branch/>"`
77
+ (for an existing branch) resp.
78
+ `git -C "<context-dir/>" switch -c "<context-branch/>"` (for a
79
+ missing branch, created from `HEAD`) fails, only output the
80
+ following <template/> and then immediately *STOP* processing the
81
+ entire current skill:
82
+
83
+ <template>
84
+ ⧉ **ASE**: <arg2/>, ◉ worktree: **<context-label/>**, ▶ ERROR: worktree has uncommitted changes or failed to switch to branch **<context-branch/>**
85
+ </template>
86
+
87
+ Otherwise, only output the following <template/> and *skip* all
88
+ remaining sub-steps of this definition:
89
+
90
+ <template>
91
+ ⧉ **ASE**: <arg2/>, ◉ worktree: **<context-label/>**, ▶ status: **worktree reused**
92
+ </template>
93
+ </if>
94
+
95
+ - <elseif condition="the directory <context-dir/> exists">
96
+ Only output the following <template/> and then immediately *STOP*
97
+ processing the entire current skill, leaving the directory
98
+ *untouched*:
99
+
100
+ <template>
101
+ ⧉ **ASE**: <arg2/>, ▶ ERROR: directory **<context-label/>** exists, but is no Git worktree
102
+ </template>
103
+ </elseif>
104
+
105
+ - <elseif condition="<arg4/> is not `true`">
106
+ A missing context worktree is *not* created here, as it would
107
+ start out empty (e.g. on a mistyped name). Only output the
108
+ following <template/> and then immediately *STOP* processing the
109
+ entire current skill:
110
+
111
+ <template>
112
+ ⧉ **ASE**: <arg2/>, ▶ ERROR: worktree **<context-label/>** does not exist
113
+ </template>
114
+ </elseif>
115
+
116
+ - <else>
117
+ The context worktree is *created*: if <context-branch/> is empty,
118
+ set <context-branch><context-name/></context-branch>. If the branch
119
+ <context-branch/> already exists, it is *checked out* into the
120
+ worktree, so set
121
+ <worktree-add-args>"<context-dir/>" "<context-branch/>"</worktree-add-args>,
122
+ otherwise it is *created* from the start point <arg5/> (or from
123
+ `HEAD` if <arg5/> is empty) together with the worktree, so set
124
+ <worktree-add-args>-b "<context-branch/>" "<context-dir/>"</worktree-add-args>,
125
+ followed by `"<arg5/>"` if <arg5/> is not empty. Create the
126
+ worktree by running the command
127
+ `git worktree add <worktree-add-args/>` (taken exactly as given).
128
+ As a fresh worktree starts at the start point (or the existing
129
+ branch), *uncommitted* changes of the current working copy are
130
+ *not* carried over. If this command fails, only output the following
131
+ <template/> and then immediately *STOP* processing the entire
132
+ current skill:
133
+
134
+ <template>
135
+ ⧉ **ASE**: <arg2/>, ▶ ERROR: worktree **<context-label/>** failed to create
136
+ </template>
137
+
138
+ Otherwise, only output the following <template/>:
139
+
140
+ <template>
141
+ ⧉ **ASE**: <arg2/>, ◉ worktree: **<context-label/>**, ⎇ branch: **<context-branch/>**, ▶ status: **worktree created**
142
+ </template>
143
+ </else>
144
+
145
+ </define>
146
+
147
+ <define name="changeset-ambiguity">
148
+
149
+ Guard against the *misparse* of the former *boolean* `--worktree`
150
+ option: since `--worktree` takes a value, a former call like
151
+ `-w fix the crash` silently takes the first query word `fix` as the
152
+ worktree name. This reads and possibly updates <getopt-option-worktree/>
153
+ and <query/>, where <arg1/> is the skill chrome of the status lines.
154
+ Do not output anything, except for the dialog and template below.
155
+
156
+ 1. If <getopt-option-worktree/> does *not* match the regexp `^[a-z]+$`
157
+ (a bare lower-case word, without any `:<branch/>` part) or <query/>
158
+ is empty, the value is *unambiguous*: *skip* all remaining
159
+ sub-steps of this definition.
160
+
161
+ 2. Determine the *worktree directory* by calling the
162
+ `ase_worktree_path(id: "<getopt-option-worktree/>", create: false)`
163
+ tool of the `ase` MCP server and the *existing worktrees* by running
164
+ the command `git worktree list --porcelain` (taken exactly as
165
+ given). If the tool call fails, or the worktree directory is a
166
+ *registered* worktree, the value is *unambiguous* (an error is
167
+ reported resp. the worktree is reused later): *skip* all remaining
168
+ sub-steps of this definition.
169
+
170
+ 3. In the following, you *MUST* *NOT* use your built-in
171
+ <user-dialog-tool/> tool! Instead, you *MUST* just show a custom
172
+ dialog according to the expanded `custom-dialog` definition. You
173
+ *MUST* closely follow this definition:
174
+
175
+ <expand name="custom-dialog" arg1="--no-other">
176
+ Worktree Ambiguity: Is `<getopt-option-worktree/>` the name of a *new* worktree or the first word of the query?
177
+ USE WORKTREE: create worktree `.ase/worktree/<getopt-option-worktree/>` for query "<query/>"
178
+ USE QUERY: use query "<getopt-option-worktree/> <query/>" without any worktree
179
+ STOP SKILL: stop the entire skill immediately
180
+ </expand>
181
+
182
+ 4. If <result/> is `USE QUERY`, set
183
+ <query><getopt-option-worktree/> <query/></query> and
184
+ <getopt-option-worktree></getopt-option-worktree> (empty). If
185
+ <result/> is `STOP SKILL` or `CANCEL`, only output the following
186
+ <template/> and then immediately *STOP* processing the entire
187
+ current skill:
188
+
189
+ <template>
190
+ ⧉ **ASE**: <arg1/>, ▶ status: **editing finished**
191
+ </template>
192
+
193
+ </define>
194
+
195
+ <define name="changeset-value">
196
+
197
+ Parse the value <arg2/> of the change set concept <arg1/> (`Source`,
198
+ `Changeset`, or `Target`), where <arg3/> is the comma-separated list of
199
+ its *permitted* forms and <arg4/> is the skill chrome of the status
200
+ line. It sets <value-type/> to the form (`worktree`, `branch`,
201
+ `attachment`, or `source`) and <value-name/> to the name of the
202
+ `branch:<name/>` and `attachment:<name/>` forms (or to empty otherwise).
203
+ Do not output anything, except for the error below.
204
+
205
+ 1. Set <value-text/> to <arg2/> with every placeholder `{id}`
206
+ replaced by <ase-task-id/>, where every character of the task id
207
+ other than `A-Z`, `a-z`, `0-9`, `_`, and `-` is replaced by `-`,
208
+ then every run of multiple `-` is reduced to a single `-`, and
209
+ finally all leading and trailing `-` and `_` are removed (e.g.,
210
+ `branch:cs-{id}` becomes `branch:cs-12` for the task id `#12`, and
211
+ `branch:cs-FOO-12` for `FOO#12`). Split <value-text/>
212
+ at its *first* `:` character into <value-type/> (the part before)
213
+ and <value-name/> (the part after, or empty if there is no `:`).
214
+
215
+ 2. The value is *valid* only if <value-type/> is one of <arg3/> and
216
+ one of the following holds:
217
+
218
+ - <value-type/> is `worktree` or `source` and <value-name/> is
219
+ empty.
220
+
221
+ - <value-type/> is `branch` and <value-name/> is a *valid branch
222
+ name*: it is non-empty, consists of the characters `A-Z`, `a-z`,
223
+ `0-9`, `_`, `-`, `.`, and `/` only, does *not* start with `-`,
224
+ `.`, or `/`, does *not* end with `/`, `.`, or `.lock`, and does
225
+ *not* contain `..` or `//`. This keeps it safe for being passed
226
+ quoted to the `git` commands.
227
+
228
+ - <value-type/> is `attachment` and <value-name/> is non-empty and
229
+ consists of the characters `A-Z`, `a-z`, `0-9`, `_`, and `-`
230
+ only, as it becomes part of a `Type` line and a worktree name.
231
+
232
+ If the value is *not* valid, only output the following <template/>
233
+ and then immediately *STOP* processing the entire current skill,
234
+ leaving everything *untouched*:
235
+
236
+ <template>
237
+ ⧉ **ASE**: <arg4/>, ▶ ERROR: invalid <arg1/> value: **<arg2/>**
238
+ </template>
239
+
240
+ </define>
241
+
242
+ <define name="changeset-land">
243
+
244
+ The change set *MUST* land *exclusively inside* the worktree <arg1/>:
245
+ read *every* artifact (also for discovering and grilling) and resolve
246
+ *every* file path relative to <arg1/> instead of the working copy the
247
+ agent tool was started in, and run *every* verification
248
+ command (build, tests, linter, type-checker, program execution) with
249
+ <arg1/> as its working directory. You *MUST* *NEVER* modify, stage,
250
+ stash, revert, or commit anything *outside* of this worktree. Do *not*
251
+ run `git add` or `git commit` inside it either, unless the skill
252
+ *explicitly* requires it, so the user keeps full control over the
253
+ final commit.
254
+
255
+ </define>
256
+
@@ -16,16 +16,19 @@ Determine the *kind of change* the task plan describes and internalize
16
16
  the corresponding tenet sets:
17
17
 
18
18
  - If the frontmatter of <task-content/> carries a `Kind: <text/>` key
19
- and <text/> is one of `CRAFTING`, `REFACTORING`, or `RESOLVING`:
20
- Set <task-kind><text/></task-kind> (set task kind to the stated kind).
19
+ and <text/> is one of `SPECIFYING`, `CRAFTING`, `REFACTORING`, or
20
+ `RESOLVING`: Set <task-kind><text/></task-kind> (set task kind to
21
+ the stated kind).
21
22
 
22
23
  - Else:
23
24
  The plan states no kind at all, or an unrecognized one, so *infer*
24
- the kind from the plan content itself: `RESOLVING` if the plan
25
- predominantly fixes a defect, `REFACTORING` if it predominantly
26
- re-structures existing artifacts without changing their observable
27
- behavior, and `CRAFTING` otherwise. Set <task-kind/> to the inferred
28
- kind, defaulting to `CRAFTING` if the inference stays inconclusive.
25
+ the kind from the plan content itself: `SPECIFYING` if the plan
26
+ predominantly creates or revises the statements of the `SPEC`
27
+ artifacts, `RESOLVING` if it predominantly fixes a defect,
28
+ `REFACTORING` if it predominantly re-structures existing artifacts
29
+ without changing their observable behavior, and `CRAFTING`
30
+ otherwise. Set <task-kind/> to the inferred kind, defaulting to
31
+ `CRAFTING` if the inference stays inconclusive.
29
32
 
30
33
  Then honor the tenet sets of <task-kind/>:
31
34
 
@@ -33,169 +36,3 @@ Then honor the tenet sets of <task-kind/>:
33
36
 
34
37
  </define>
35
38
 
36
- <define name="code-approaches">
37
-
38
- You *MUST* perform the following sub-steps *internally* and *without
39
- any output* until and including the recommendation decision. Only
40
- sub-steps 4-7 below are allowed to produce output; sub-steps 4-6 only if
41
- <getopt-option-auto/> is equal `false` *and* <ase-project-boxing/>
42
- is *not* equal `black`.
43
-
44
- If <getopt-option-auto/> is equal `true` or <ase-project-boxing/> is
45
- equal `black`, *skip* the reporting sub-steps 4-6 entirely (they
46
- perform no output at all) to speed up processing.
47
-
48
- 1. *Propose* a corresponding *<arg1/> approach*, optionally including
49
- some *alternative* <arg1/> approaches. Do *not* output anything
50
- in this sub-step.
51
-
52
- 2. *Reflect* on and *critique* the proposed approaches by deriving,
53
- per approach, a small set of concrete *pros* and *cons*. Do
54
- *not* output anything in this sub-step.
55
-
56
- 3. Based on the reflection, *decide* which approach to recommend
57
- and annotate it with an <annotation/> of
58
- ` ⚝ **RECOMMENDATION** ⚝`. All other approaches receive an
59
- empty <annotation/>. Do *not* output anything in this sub-step.
60
-
61
- 4. Indicate start of reporting by showing the following <template/>:
62
-
63
- <template>
64
- <ase-tpl-head title="APPROACHES"/>
65
- </template>
66
-
67
- 5. Now report each approach with the following <template/>,
68
- inlining its pros/cons derived in sub-step 2, and do not output
69
- anything else in this step:
70
-
71
- <template>
72
- ● **APPROACH A<n/>**<annotation/>: **<summary/>**
73
- ○ [...]
74
- ⊕ *PRO*: [...]
75
- ⊖ *CON*: [...]
76
- </template>
77
-
78
- Hints:
79
-
80
- - Give a short one-sentence <summary/> of the <arg1/> approach
81
- plus *precise* and *ultra brief and concise* <arg1/>
82
- information. Try to keep the number of bullet points
83
- (`○ [...]`) in the range of 1-4.
84
-
85
- 6. Indicate end of reporting by showing the following <template/>:
86
-
87
- <template>
88
- <ase-tpl-foot title="APPROACHES"/>
89
- </template>
90
-
91
- 7. <if condition="<getopt-option-auto/> is not equal `true` and <ase-project-boxing/> is not equal `black`">
92
-
93
- In the following, you *MUST* *NOT* use your built-in
94
- <user-dialog-tool/> tool! Instead, you *MUST* just show a
95
- custom dialog according to the expanded `custom-dialog`
96
- definition. You *MUST* closely follow this definition.
97
-
98
- Let the user choose the preferred approach A<n/> by raising
99
- a question with the following custom dialog, where per
100
- approach A<n/>, you determine an ultra brief summary
101
- <short-summary/> and then use the answer option `A<n/>:
102
- ⚝ **RECOMMENDATION** ⚝ - <short-summary/>` for your
103
- recommended approach plus zero or more answer options `A<n/>:
104
- <short-summary/>` for all other approaches:
105
-
106
- <expand name="custom-dialog" arg1="--no-other">
107
- Select Approach: Select your preferred <arg2/> approach to follow?
108
- A<n/>: <short-summary/>
109
- [...]
110
- </expand>
111
-
112
- </if>
113
- <else>
114
-
115
- Set <n/> to the number of the <arg1/> approach A<n/> you recommend.
116
- Output a hint with the following <template/>:
117
-
118
- <template>
119
- ⧉ **ASE**: ◉ task: **<ase-task-id/>**, ▶ status: **auto-chosen approach A<n/>**
120
- </template>
121
-
122
- </else>
123
-
124
- </define>
125
-
126
- <define name="code-next-dispatch">
127
-
128
- Treat <getopt-option-next/> as a comma-separated chronological
129
- list of pre-selected next-step tokens. *Peek* the *first* token
130
- as <head/> (or `none` if the list is `none`/empty).
131
- Set <args>--int-reuse-task</args>.
132
-
133
- 1. <if condition="<head/> is equal `DONE`">
134
- Consume the head: set <getopt-option-next/> to the remaining
135
- tokens (joined back with `,`, or `none` if empty). `DONE`
136
- means the freshly composed plan is finalized as-is, so do
137
- *not* hand off to `ase-task-edit`. Only output the following
138
- <template/> and then *STOP*. Do *not* implement the plan.
139
-
140
- <template>
141
- ⧉ **ASE**: ◉ task: **<ase-task-id/>**, ▶ status: **plan finalized -- done**
142
- </template>
143
- </if>
144
-
145
- 2. <elseif condition="<head/> is equal `IMPLEMENT`">
146
- Consume the head: set <getopt-option-next/> to the remaining
147
- tokens (joined back with `,`, or `none` if empty).
148
- <if condition="<getopt-option-next/> is not equal `none`">
149
- Set <args><args/> --next <getopt-option-next/></args>
150
- </if>
151
- Call the tool `Skill(skill: "ase:ase-task-implement", args: "<args/>")`
152
- to *implement* the freshly composed plan, bypassing `ase-task-edit`.
153
- </elseif>
154
-
155
- 3. <elseif condition="<head/> is equal `PREFLIGHT`">
156
- Consume the head: set <getopt-option-next/> to the remaining
157
- tokens (joined back with `,`, or `none` if empty).
158
- <if condition="<getopt-option-next/> is not equal `none`">
159
- Set <args><args/> --next <getopt-option-next/></args>
160
- </if>
161
- Call the tool `Skill(skill: "ase:ase-task-preflight", args: "<args/>")`
162
- to *preflight* the freshly composed plan, bypassing `ase-task-edit`.
163
- </elseif>
164
-
165
- 4. <elseif condition="<head/> is equal `GRILL`">
166
- Consume the head: set <getopt-option-next/> to the remaining
167
- tokens (joined back with `,`, or `none` if empty). `GRILL`
168
- is this skill's own dispatch token, *not* part of
169
- `ase-task-grill`'s `--next` vocabulary, so it must be
170
- stripped here rather than forwarded. All remaining tokens are
171
- `ase-task-grill`'s own vocabulary and are forwarded verbatim.
172
- <if condition="<getopt-option-next/> is not equal `none`">
173
- Set <args><args/> --next <getopt-option-next/></args>
174
- </if>
175
- Call the tool `Skill(skill: "ase:ase-task-grill", args: "<args/>")`
176
- to *grill* the freshly composed plan, bypassing `ase-task-edit`.
177
- </elseif>
178
-
179
- 5. <else>
180
- Hand off to `ase-task-edit`.
181
- <if condition="<head/> is equal `EDIT`">
182
- Consume the head: set <getopt-option-next/> to the remaining
183
- tokens (joined back with `,`, or `none` if empty). `EDIT`
184
- is this skill's own dispatch token, *not* part of
185
- `ase-task-edit`'s `--next` vocabulary, so it must be
186
- stripped here rather than forwarded.
187
- </if>
188
- All remaining tokens are `ase-task-edit`'s own vocabulary
189
- and are forwarded verbatim, so `ase-task-edit` consumes its
190
- own head itself.
191
- <if condition="<getopt-option-next/> is not equal `none`">
192
- Set <args><args/> --next <getopt-option-next/></args>
193
- </if>
194
- Then call the tool `Skill(skill: "ase:ase-task-edit", args: "<args/>")`.
195
- </else>
196
-
197
- 6. In every branch above which invoked the `Skill` tool, you *MUST*
198
- immediately stop processing the current skill once the `Skill`
199
- tool was used.
200
-
201
- </define>