@rse/ase 1.0.7 → 2.0.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 (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 +351 -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} +3 -0
  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 +251 -76
  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 +225 -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 +79 -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
@@ -5,7 +5,7 @@ Task Skill Common Steps
5
5
  <define name="task-react-id">
6
6
 
7
7
  1. <if condition="
8
- <instruction/> matches the regexp `^[a-zA-Z][a-zA-Z0-9_-]*$`
8
+ <instruction/> matches the regexp `^[a-zA-Z0-9#][a-zA-Z0-9#_-]*$`
9
9
  ">
10
10
  Set <ase-task-id><instruction/></ase-task-id> (set task
11
11
  id to instruction) and <instruction></instruction> (set
@@ -21,7 +21,7 @@ Task Skill Common Steps
21
21
 
22
22
  2. <elseif condition="
23
23
  <instruction/> has the format `<id/>: <text/>` where
24
- <id/> matches the regexp `^[a-zA-Z][a-zA-Z0-9_-]*$` and
24
+ <id/> matches the regexp `^[a-zA-Z0-9#][a-zA-Z0-9#_-]*$` and
25
25
  <text/> is *empty*
26
26
  ">
27
27
  Set <instruction></instruction> (set instruction to empty)
@@ -64,6 +64,10 @@ Task Skill Common Steps
64
64
  <getopt-option-int-reuse-task/> is equal `true`
65
65
  *and* an `ase_task_save(id: '<ase-task-id/>', ...)` tool call
66
66
  exists earlier in the current session
67
+ *and* the `text` *argument* of the most recent such call carries
68
+ no `Effort:` frontmatter key without <hash/> (a bare size like
69
+ `Effort: M`, which the task store stamped or dropped on that save,
70
+ see the plan format)
67
71
  ">
68
72
  Set <text/> to the `text` *argument* of the most recent
69
73
  `ase_task_save(id: '<ase-task-id/>', ...)` tool call -- this is
@@ -76,6 +80,8 @@ Task Skill Common Steps
76
80
  Call the `ase_task_load(id: "<ase-task-id/>")` tool of the
77
81
  `ase` MCP server to load the current task plan content in its
78
82
  *authoring form* -- the `variant` argument defaults to `source`
83
+ -- with the payloads of all attachments *elided* to `[elided: <n/>
84
+ lines]` markers -- the `attachments` argument defaults to `elided`
79
85
  -- and set <text/> to the `text` output field of this
80
86
  `ase_task_load` tool call. Do not output anything related to
81
87
  this MCP tool call. Set <status>plan loaded</status>.
@@ -95,6 +101,73 @@ Only output the following <template/>:
95
101
 
96
102
  </define>
97
103
 
104
+ <define name="task-ground-plan">
105
+
106
+ Before deriving any plan content from the <instruction/>, *ground* the
107
+ plan in the *current state* of the project, instead of deriving it from
108
+ the <instruction/> alone. Do not output anything during this grounding.
109
+
110
+ <if condition="<arg1/> is not empty">
111
+ The *code basis* of the task is the separate working copy <arg1/>
112
+ (e.g. a checkout of the branch of its `Source` key): resolve every
113
+ project-relative file path below relative to <arg1/> and read the
114
+ files *exclusively* from there, instead of from the current working
115
+ copy.
116
+ </if>
117
+
118
+ 1. Call the `ase_artifact_list(kind: [ "spec", "code", "infr" ])` tool
119
+ of the `ase` MCP server *once* and read the returned `artifacts`
120
+ array of `{ kind, files }` objects to obtain the project-relative
121
+ file lists of the **Artifact Set**s `SPEC` (specification), `CODE`
122
+ (source code), and `INFR` (infrastructure, like build, deployment,
123
+ and operations configuration).
124
+
125
+ 2. From these file lists, determine the files which the <instruction/>
126
+ *affects* or *depends on* -- the specification parts it touches or
127
+ which constrain it, the source code modules, interfaces, and symbols
128
+ it changes or uses, and the build, lint, test, packaging, and
129
+ deployment configuration it relies on -- and *read* them. Read only
130
+ the relevant files (or their relevant parts), not all files, but
131
+ always consider all three **Artifact Set**s.
132
+
133
+ 3. Build a precise understanding of the *current state* and the
134
+ *conventions* of the project (structure, naming, coding style, build,
135
+ lint, and test procedures) from them.
136
+
137
+ Then derive the plan from this grounding, where:
138
+
139
+ - the `## SPECIFICATION (WHAT)` bullet-points are *consistent* with the
140
+ existing specification, and explicitly state any intended deviation
141
+ from it,
142
+ - the `## DESIGN (HOW)` bullet-points name the *actual* files, modules,
143
+ interfaces, symbols, and configuration items to change, and place new
144
+ ones according to the existing structure and conventions, instead of
145
+ naming hypothetical ones,
146
+ - the `## VERIFICATION (WHEN)` bullet-points (if any) refer to the
147
+ *actual* build, lint, and test procedures of the project, and
148
+ - if a `CHANGELOG.md` file exists in the project (or in any affected
149
+ sub-package), the `## DESIGN (HOW)` section *MUST* include an
150
+ explicit `IMP` bullet-point describing the addition of a
151
+ corresponding new entry to that `CHANGELOG.md` file, aligned with
152
+ its existing style and conventions.
153
+
154
+ </define>
155
+
156
+ <define name="task-spec-format">
157
+
158
+ The `SPEC` artifacts are in scope, so -- unless already done earlier in
159
+ the current skill run -- use the `Read` tool to read the `SPEC` format
160
+ contract, i.e., the files `meta/ase-format-specbook.md` (the SpecBook
161
+ models and formats) and `meta/ase-format-spec.md` (the SpecBook project
162
+ instantiation), each with its file path formed by joining
163
+ <ase-plugin-root/> and the file name with exactly *one* `/` separator,
164
+ as <ase-plugin-root/> may or may not carry a trailing `/`. You *MUST*
165
+ then internalize and honor this `SPEC` format, plus the SpecBook schema
166
+ configuration of the project, in all following work on `SPEC`
167
+ artifacts. Do not output anything.
168
+
169
+ </define>
170
+
98
171
  <define name="task-save-content">
99
172
 
100
173
  Update <timestamp-modified/> with the current time in ISO-style
@@ -110,8 +183,11 @@ refreshed <timestamp-modified/> into the frontmatter keys `Id:`,
110
183
  `Created:`, and `Modified:` of <task-content/>.
111
184
 
112
185
  Call the `ase_task_save(id: "<ase-task-id/>", text:
113
- "<task-content/>")` tool of the `ase` MCP server to save the task
114
- plan content in its *authoring form*. This `ase_task_save` MCP
186
+ "<task-content/>", tag: true)` tool of the `ase` MCP server to save the task
187
+ plan content in its *authoring form* -- the `tag: true` makes
188
+ its output carry the `<task-plan-tag>` delimiter line, which
189
+ lets a subsequent `ase-task-edit --int-reuse-task` reuse the
190
+ just-saved plan instead of loading it again. This `ase_task_save` MCP
115
191
  tool call is the *only* permitted way to persist the task plan --
116
192
  you *MUST* *NEVER* write the plan file via `Write`/`Edit` or by
117
193
  executing a shell command. Do not output anything
@@ -163,6 +239,9 @@ Set <args>--int-reuse-task</args>.
163
239
  <if condition="<getopt-option-next/> is not equal `none`">
164
240
  Set <args><args/> --next <getopt-option-next/></args>
165
241
  </if>
242
+ <if condition="<arg3/> is given and not empty">
243
+ Set <args><args/> <arg3/></args>
244
+ </if>
166
245
  Only output the following <template/> and then call the tool
167
246
  `Skill(skill: "ase:<arg1/>", args: "<args/>")` to invoke the
168
247
  `ase:<arg1/>` skill to continue with the updated plan. Immediately
@@ -50,5 +50,3 @@ which boosts you to an expert-level Software Engineering AI agent.
50
50
  - When generating temporary helper programs or scratch test files, prefer the *target project's primary
51
51
  programming language* and *clean them up* once they are no longer needed.
52
52
 
53
- @./ase-persona.md
54
-
@@ -123,7 +123,7 @@ type SchemaDiagram = {
123
123
  config?: Partial<GradiaConfig>
124
124
  }
125
125
  type SchemaFormat = {
126
- type?: "auto" | "complex" | "concise"
126
+ type?: "auto" | "complex" | "compact" | "concise"
127
127
  maxTableColumns?: number
128
128
  maxCellHeight?: number
129
129
  withUnusedProps?: boolean
@@ -151,6 +151,9 @@ type SchemaGradiaConfig = Partial<{
151
151
  "color-node-ghost-name": string
152
152
  "color-node-ghost-box": string
153
153
  "color-node-ghost-border": string
154
+ "color-node-self-name": string
155
+ "color-node-self-box": string
156
+ "color-node-self-border": string
154
157
  "color-group-name": string
155
158
  "color-group-box": string
156
159
  "color-group-border": string
@@ -251,11 +254,13 @@ type SchemaGradiaConfig = Partial<{
251
254
  livelocks are ruled out
252
255
 
253
256
  - `SchemaObject.diagram?: SchemaDiagram`:
254
- diagram generated for every object of this kind,
257
+ diagram generated for every object of this kind (left out when the
258
+ configuration is emitted compressed by level 2 or higher),
255
259
  BECAUSE relations buried in references are graspable only when drawn
256
260
 
257
261
  - `SchemaObject.format?: SchemaFormat`:
258
- HTML/PDF rendering format of the objects of this kind,
262
+ HTML/PDF rendering format of the objects of this kind (left out when
263
+ the configuration is emitted compressed by level 2 or higher),
259
264
  BECAUSE rich objects need sections, uniform ones read as tables
260
265
 
261
266
  - `SchemaObject.props?: SchemaProperty[]`:
@@ -318,7 +323,8 @@ type SchemaGradiaConfig = Partial<{
318
323
  - `SchemaDiagram.center?: string | SchemaDiagramCenter`:
319
324
  object a `hub` diagram is projected onto (default: `self`), or a
320
325
  synthetic center node, labeled from a referenced `source` object (or
321
- one of its properties, via `property`) or a literal `label`, typed
326
+ one of its properties, via `property`, falling back onto the `label`
327
+ or the object name while absent) or a literal `label`, typed
322
328
  (under `qualified`) by `kind`, and linked to the `source` object,
323
329
  BECAUSE the focus of a hub is not always a specification object --
324
330
  the solution itself, e.g., sits in the middle of a context diagram
@@ -417,15 +423,16 @@ type SchemaGradiaConfig = Partial<{
417
423
  BECAUSE the node name alone rarely makes the nodes comparable
418
424
 
419
425
  - `SchemaDiagram.config?: SchemaGradiaConfig`:
420
- arbitrary Gradia rendering options (e.g. `grid-columns-max: 5`),
426
+ arbitrary Gradia rendering options (e.g. `grid-columns-max: 2`),
421
427
  BECAUSE layout tuning is cosmetics, not a schema concern
422
428
 
423
429
  - `SchemaFormat`:
424
430
  HTML/PDF rendering of the objects of an object kind among their siblings,
425
431
  BECAUSE one uniform rendering fits neither rich nor numerous objects
426
432
 
427
- - `SchemaFormat.type?: "auto" | "complex" | "concise"`:
428
- rendering: `complex` (sections), `concise` (tables), or `auto`,
433
+ - `SchemaFormat.type?: "auto" | "complex" | "compact" | "concise"`:
434
+ rendering: `complex` (sections), `concise` (tables), `compact`
435
+ (tables of section-like cells), or `auto`,
429
436
  BECAUSE sections bury small objects, tables truncate rich ones
430
437
 
431
438
  - `SchemaFormat.maxTableColumns?: number`:
@@ -498,7 +505,8 @@ type SchemaGradiaConfig = Partial<{
498
505
  BECAUSE an embedded font renders alike where it is not installed
499
506
 
500
507
  - `SchemaGradiaConfig."color-node-*": string`:
501
- colors of the node boxes in their regular, primary, and ghost role,
508
+ colors of the node boxes in their regular, primary, ghost, and self
509
+ role,
502
510
  BECAUSE the role of a node has to be readable at a glance
503
511
 
504
512
  - `SchemaGradiaConfig."color-group-*", "color-edge-*": string`:
@@ -557,13 +565,16 @@ that kind. Its `type` selects the diagram shape (`graph`, `hub`, or
557
565
  `grid`), `nodes` and `edges` select the participating objects through
558
566
  comma-separated `[[xxx]]` reference patterns (`nodes` defaults to the
559
567
  object itself plus all objects below it), and `center` names the object
560
- a `hub` is projected onto (default: `self`).
568
+ a `hub` is projected onto (default: `self`). An edge object of the
569
+ center targeting the center itself (a self-reference) places the center
570
+ a second time among its outputs, rendered as a dashed "self" node.
561
571
 
562
572
  Instead of naming an existing object, `center` can also declare a
563
573
  *synthetic* center node, which represents something no specification
564
574
  object models -- like the solution itself in the middle of a context
565
575
  diagram. Such a center is labeled from a referenced `source` object (or
566
- one of its properties, via `property`) or a literal `label`, and links
576
+ one of its properties, via `property`, falling back onto the `label` or
577
+ the object name while the property is absent) or a literal `label`, and links
567
578
  to the `source` object. As the nodes carry no `[[xxx]]` reference to a
568
579
  synthetic center, `centerEdges` synthesizes the edges from a direction
569
580
  `property` of the node objects: its `inbound` value maps onto a
@@ -577,7 +588,15 @@ node only, `qualified` labels every node with its object kind,
577
588
  `properties` lists the property names whose values are attached to the
578
589
  nodes as key/value annotations (with every `[[xxx]]` reference stripped
579
590
  to its target object name), and `config` passes arbitrary Gradia
580
- rendering options (e.g. `grid-columns-max: 5`) through to the diagram.
591
+ rendering options (e.g. `grid-columns-max: 2`) through to the diagram.
592
+ As the Gradia defaults are dimensioned for a stand-alone canvas,
593
+ SpecBook presets a compact geometry for every diagram, which `config`
594
+ overrides: `size-canvas-margin: 8`, `size-node-height-scale: 2`,
595
+ `hub-node-gap: 10`, `hub-node-count-max: 6` (a `hub` column of more
596
+ nodes wraps into two staggered sub-columns), `grid-gap-horizontal: 24`,
597
+ `grid-gap-vertical: 12`, and `grid-columns-min: 4` (the square
598
+ derivation of the column count otherwise leaves a third of the document
599
+ width unused).
581
600
 
582
601
  `ordered` replaces the layered layout of a `graph` by the document
583
602
  order of the objects: the top-level nodes stack top-down in that order
@@ -633,15 +652,20 @@ how the HTML/PDF export renders the objects of that kind among their
633
652
  siblings, so that the sibling kinds below one parent can render
634
653
  differently (e.g. one kind as a table, another as sections). Its `type`
635
654
  selects the rendering: `complex` (nested sections), `concise` (one
636
- compact table of all sibling objects of the kind), or the default
637
- `auto`, which collapses only the deepest level into tables.
655
+ compact table of all sibling objects of the kind), `compact` (one
656
+ table of the name and a single cell per object, which renders the
657
+ object like `complex`, but without its heading: diagram, properties as
658
+ key/value lines, and description, for a kind whose many properties a
659
+ table row cannot hold), or the default `auto`, which collapses only the
660
+ deepest level into tables.
638
661
 
639
662
  Inside a `concise` table, unconfigured child kinds implicitly stay
640
663
  `concise` and render as sub-tables inside the description cells, while
641
664
  an explicitly configured `type` is always honored, even a `complex`
642
665
  rendering pressed into a cell. `maxTableColumns` (default: `4`) bounds
643
666
  the columns of the compact table of the kind (a wider group chunks
644
- its properties into embedded per-object tables), `maxCellHeight`
667
+ its properties into embedded per-object tables, while a `compact`
668
+ one ignores it), `maxCellHeight`
645
669
  (default: `40`) is the percentage a table cell of the kind may exceed
646
670
  the height of every other non-empty cell of its row before the HTML
647
671
  export folds its remaining text away, and `withUnusedProps`
@@ -686,6 +710,7 @@ type SpecObject = {
686
710
  type SpecDescription = {
687
711
  description: string
688
712
  rationale?: string
713
+ elaboration?: string
689
714
  embedding?: string[]
690
715
  }
691
716
  type SpecProperty = {
@@ -760,7 +785,7 @@ type SpecProperty = {
760
785
  BECAUSE a specification is a tree, not a flat list of statements
761
786
 
762
787
  - `SpecDescription`:
763
- description of an object: statement, rationale, and images,
788
+ description of an object: statement, rationale, elaboration, and images,
764
789
  BECAUSE the WHAT and the WHY are stored apart to be rendered apart
765
790
 
766
791
  - `SpecDescription.description: string`:
@@ -769,11 +794,18 @@ type SpecProperty = {
769
794
 
770
795
  - `SpecDescription.rationale?: string`:
771
796
  rationale text behind the `, BECAUSE ` split (the WHY),
797
+ up to the end of its paragraph,
772
798
  BECAUSE a statement without its WHY cannot be judged or revised
773
799
 
800
+ - `SpecDescription.elaboration?: string`:
801
+ blocks following the paragraph of the rationale (e.g. images or diagrams),
802
+ BECAUSE further content must not end up inside the WHY
803
+
774
804
  - `SpecDescription.embedding?: string[]`:
775
- image files embedded via `![xxx](yyy)`, inlined at parse time,
776
- one entry per file in markup order (empty for an unreadable file),
805
+ image, diagram source, and source code files embedded via `![xxx](yyy)`,
806
+ inlined at parse time, one entry per file in markup order (those of
807
+ the statement first, those of the elaboration second, and empty for
808
+ an unreadable file),
777
809
  BECAUSE the exports have to stand alone, without the image files
778
810
 
779
811
  - `SpecProperty`:
@@ -789,7 +821,8 @@ type SpecProperty = {
789
821
  BECAUSE constraints and references are checked against this text
790
822
 
791
823
  - `SpecProperty.embedding?: string[]`:
792
- image files embedded in the value, inlined at parse time,
824
+ image, diagram source, and source code files embedded in the value,
825
+ inlined at parse time,
793
826
  one entry per file in markup order (empty for an unreadable file),
794
827
  BECAUSE the exports have to stand alone, without the image files
795
828
 
@@ -976,10 +1009,15 @@ paragraphs, blockquotes, ordered lists (e.g. scenario steps or test
976
1009
  case procedures), and fenced code blocks. A fenced code block of
977
1010
  language `gradia` is skipped, as it is the derived diagram which
978
1011
  **SpecBook** itself emits into exported Markdown and which must not
979
- become authored content on a re-parse. In the Concise Format, the
980
- description is formed by the non-property segments of the item, so a
981
- description carrying a `;` cannot be a segment either and forces its
982
- object into the Complex Format.
1012
+ become authored content on a re-parse. A fenced code block of language
1013
+ `mermaid` (alias `mmd`) or `d2` is a [Mermaid](https://mermaid.js.org/)
1014
+ or [D2](https://d2lang.com/) diagram, which the HTML/PDF export renders
1015
+ as a diagram instead of as code (see "Diagram Embeddings" below). A
1016
+ fenced code block of any other known language is a syntax-highlighted
1017
+ code listing (see "Code Listings" below). In
1018
+ the Concise Format, the description is formed by the non-property
1019
+ segments of the item, so a description carrying a `;` cannot be a
1020
+ segment either and forces its object into the Complex Format.
983
1021
 
984
1022
  A description is split into its *statement* and *rationale* at the first
985
1023
  `, BECAUSE ` (or `, **BECAUSE** `) occurrence:
@@ -989,10 +1027,25 @@ The event is created and configured but not visible to attendees,
989
1027
  BECAUSE an event needs a private setup phase.
990
1028
  ```
991
1029
 
1030
+ The rationale ends with its paragraph: all blocks following it (further
1031
+ paragraphs, embedded images, and diagrams) form the *elaboration*, which
1032
+ is rendered below the statement and its rationale, so the description
1033
+ of a Complex Format object can state its WHAT and WHY first and
1034
+ illustrate them afterwards:
1035
+
1036
+ ````
1037
+ The event is created and configured but not visible to attendees,
1038
+ BECAUSE an event needs a private setup phase.
1039
+
1040
+ ![Event Lifecycle](event-lifecycle.mmd)
1041
+ ````
1042
+
992
1043
  ### Wiki-Style References
993
1044
 
994
1045
  A `[[<reference/>]]` anywhere in a name, property value, description, or
995
- rationale is a Wiki-style reference to another object, which is checked
1046
+ rationale (except inside a fenced code block, whose code stays verbatim,
1047
+ so e.g. a shell test `[[ -f x ]]` is no reference) is a Wiki-style
1048
+ reference to another object, which is checked
996
1049
  for unique resolvability and rendered as a hyperlink in the HTML/PDF
997
1050
  exports. A reference is a `.`-separated path of segments, where each
998
1051
  segment matches a single object as:
@@ -1026,8 +1079,25 @@ constrain reference-valued properties (e.g. `[[PERSONA:*]]` or
1026
1079
 
1027
1080
  A Markdown image `![<alt/>](<file/>)` inside a description or property
1028
1081
  value embeds a local image file, resolved relative to the artifact file:
1029
- SVG files are inlined as-is; PNG/JPEG files are embedded as base64
1030
- `data:` URLs. URLs and other file types are left untouched.
1082
+ SVG files are inlined as-is; PNG/JPEG/WebP files are embedded as base64
1083
+ `data:` URLs. URLs and other file types are left untouched. The
1084
+ HTML/PDF export optimizes the embedded images on its own (downscaled
1085
+ and re-encoded PNG/JPEG/WebP, minified SVG), so the files can stay in their
1086
+ original resolution. Like a diagram, an embedded image (except the logo
1087
+ of the title page) folds, maximizes, and is omitted (`-O diagram:image`,
1088
+ or by nesting level) in the HTML/PDF export, while the AST exports keep
1089
+ it.
1090
+
1091
+ A page of a PDF document is embedded like an image --
1092
+ `![<alt/>](<file/>.pdf)` for the first page, or
1093
+ `![<alt/>](<file/>.pdf#page=<n/>)` for the 1-based page number `<n/>` --
1094
+ where the document is inlined at parse time. The exports convert the
1095
+ page through `pdfjs-dist` into a vector SVG with its texts as glyph
1096
+ outlines and then treat it exactly like an embedded SVG image, while a
1097
+ page failing to render (e.g. an absent page number) is omitted with a
1098
+ notice. A presentation (e.g. PowerPoint), a spreadsheet (e.g. Excel), or
1099
+ any other office document is embedded through its PDF export, which
1100
+ carries its exact rendering and fonts.
1031
1101
 
1032
1102
  A reference carrying the `{theme}` placeholder -- e.g.
1033
1103
  `![Logo](logo-{theme}.svg)` -- is a *theme-aware* embedding: it expands
@@ -1036,3 +1106,116 @@ both of which are embedded, as two consecutive entries in this order. The
1036
1106
  HTML export shows just the variant matching the color theme currently
1037
1107
  active in the document, while the PDF export (like print in general)
1038
1108
  always uses the `light` variant.
1109
+
1110
+ An image without a dark variant is treated on the dark theme of the HTML
1111
+ export as its `dark` fragment parameter says (see "Fragment Parameters"
1112
+ below), while print always keeps it as it is. An image defaults to
1113
+ `dark=auto`, which inverts it (with its hues rotated back) if it most
1114
+ likely draws dark lines onto a transparent or light canvas: an SVG if it
1115
+ neither adapts itself (via `light-dark()` colors, `prefers-color-scheme`
1116
+ rules, or a `color-scheme` declaration, which follows the color theme of
1117
+ the document anyway), nor embeds a raster image, nor paints a background
1118
+ which is not light, and a raster image (PNG/JPEG/WebP) if at least 60%
1119
+ of its pixels are transparent or near-white and the others are dark on
1120
+ average and of a few colors only (unlike a photo or a colorful
1121
+ screenshot). As the detection cannot tell a logo or illustration with
1122
+ brand colors from a line drawing, `#dark=none` keeps such an image as it
1123
+ is, while `#dark=invert` forces the inversion (e.g.
1124
+ `![Overview](overview.svg#dark=invert)`). A
1125
+ [draw.io](https://www.drawio.com/) diagram is best embedded as its
1126
+ editable SVG (`.drawio.svg`, which draw.io keeps current on every save)
1127
+ with its "Adaptive Colors" page setting on "Automatic", as it then
1128
+ adapts all its colors itself. A theme-aware embedding ignores the
1129
+ fragment, as its `dark` variant already serves the dark theme.
1130
+
1131
+ The reference-style image `![<alt/>][<label/>]` embeds the image of its
1132
+ definition `[<label/>]: data:image/<type/>;base64,<data/>` (SVG, PNG,
1133
+ JPEG, or WebP, where a `;dark=invert` or `;dark=none` parameter behind
1134
+ the type carries the treatment on the dark theme, which the export
1135
+ always resolves for an SVG) in the same file, the only supported link
1136
+ definition.
1137
+ This is the form the normalized Markdown export emits for every embedded
1138
+ image (a theme-aware one by its `light` variant), with the definitions
1139
+ at the end of the document, so it stands alone without the image files.
1140
+ Author the inline form; the reference-style one is for re-parsing only.
1141
+
1142
+ ### Diagram Embeddings
1143
+
1144
+ A [Mermaid](https://mermaid.js.org/) or [D2](https://d2lang.com/)
1145
+ diagram is either written inline into a description as a fenced code
1146
+ block of language `mermaid` (alias `mmd`) or `d2`, or kept in a file of
1147
+ its own and embedded like an image -- `![<alt/>](<file/>.mmd)`,
1148
+ `![<alt/>](<file/>.mermaid)`, or `![<alt/>](<file/>.d2)` -- inside a
1149
+ description or property value, where its source is inlined at parse time.
1150
+ The HTML/PDF export renders every such diagram (Mermaid through
1151
+ `beautiful-mermaid`, D2 through `@d2lang/d2`, laid out by its TALA
1152
+ engine unless the diagram configures another `layout-engine`) in the
1153
+ theme colors of the document, once per color theme, like a theme-aware
1154
+ image. It folds,
1155
+ maximizes, and is omitted (`-O diagram:code`, for diagrams as code, or
1156
+ by nesting level) like a derived Gradia diagram. A diagram failing to render
1157
+ is omitted with a notice. The normalized Markdown and the AST exports
1158
+ carry the source of a fenced diagram as part of the description, and an
1159
+ embedded diagram file as its rendered SVG (the `light` variant).
1160
+
1161
+ ### Code Listings
1162
+
1163
+ A code snippet is either written inline into a description as a fenced
1164
+ code block of a known language (any language id or alias of
1165
+ [Shiki](https://shiki.style/), like `ts`, `java`, `css`, or `html`), or
1166
+ kept in a source code file of its own and embedded like an image --
1167
+ `![<alt/>](<file/>.<ext/>)`, where `<ext/>` is such a language id or
1168
+ alias (e.g. `.ts`, `.java`, `.css`, `.html`) -- inside a description or
1169
+ property value, where its source is inlined at parse time. A fenced code
1170
+ block of no or an unknown language stays plain preformatted text.
1171
+
1172
+ The HTML/PDF export renders every such snippet as a *code listing* in
1173
+ DejaVu Sans Mono, with line numbers and with its keywords, operators,
1174
+ and punctuation in the accent color and bold, its literals in the signal
1175
+ color, and its comments in the dim color and italic. A code listing
1176
+ folds, maximizes, and is omitted (`-O diagram:listing`, or by nesting
1177
+ level) like a diagram.
1178
+
1179
+ A fenced code listing takes whitespace-separated parameters behind its
1180
+ language, and an embedded one takes them as its fragment (see "Fragment
1181
+ Parameters" below):
1182
+
1183
+ - `start=<n/>` (fenced only): the number of the first line (default `1`).
1184
+ - `lines=<a/>-<b/>` or `lines=<a/>` (embedded only): the excerpt of the
1185
+ 1-based lines `<a/>` to `<b/>` (or line `<a/>` alone), numbered from
1186
+ `<a/>`, where an empty range is reported as an error.
1187
+ - `mark=<a/>[-<b/>][,...]`: the lines or line ranges to mark (in the
1188
+ shown line numbers) on a very light signal background.
1189
+
1190
+ ````
1191
+ ```ts start=10 mark=12-13
1192
+ const greeter = new Greeter("World")
1193
+ ```
1194
+
1195
+ ![Greeter Class](greeter.ts#lines=5-20&mark=8,12-14)
1196
+ ````
1197
+
1198
+ The AST exports carry an embedded source code file as its
1199
+ `data:text/x-code;lang=<lang/>;start=<n/>[;mark=<hunks/>];base64,<data/>`
1200
+ URL, while the normalized Markdown export turns one of a description into
1201
+ a fenced code block (with its `start` and `mark` parameters) at the end
1202
+ of the elaboration, and keeps one of a property value as a
1203
+ reference-style image definition of that URL.
1204
+
1205
+ #### Fragment Parameters
1206
+
1207
+ The fragment of an embedding reference is a list of `<key/>=<value/>`
1208
+ parameters joined by `&`, in any order and each at most once, with the
1209
+ values optionally URI-encoded (e.g. `%20` for a space): `page`
1210
+ (documents), `dark` (documents and images), and `lines` and `mark`
1211
+ (source code files, see "Code Listings" above). A fragment carrying any
1212
+ other key or an invalid value is reported as an error. The `dark`
1213
+ parameter selects the treatment on the dark theme of the HTML export,
1214
+ while print always shows the original: `dark=invert` inverts the
1215
+ embedding with its hues rotated back, `dark=none` shows it as it is, and
1216
+ `dark=auto` (the default) decides by the content of the image or the
1217
+ rendered document page (inverting a light canvas with dark ink, but
1218
+ neither a dark one nor one carrying a photo), as an image and a document
1219
+ page can be anything (line drawings, photos, logos); e.g.
1220
+ `![<alt/>](<file/>.pdf#page=3&dark=none)` keeps a page which the
1221
+ detection would invert, but whose colors have to stay.