@rse/ase 2.0.2 → 2.0.4

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 (236) hide show
  1. package/dst/ase-agent-definition-core.js +111 -87
  2. package/dst/ase-agent-fleet.js +1 -1
  3. package/dst/ase-agent-runtime-claim.js +5 -3
  4. package/dst/ase-agent-runtime-engine.js +1 -1
  5. package/dst/ase-agent-runtime-phase.js +1 -1
  6. package/dst/ase-agent-runtime-request.js +1 -1
  7. package/dst/ase-agent-runtime.js +3 -5
  8. package/dst/ase-artifact.js +3 -3
  9. package/dst/ase-config-core.js +2 -16
  10. package/dst/ase-config-schema.js +1 -3
  11. package/dst/ase-config.js +2 -0
  12. package/dst/ase-hook.js +13 -13
  13. package/dst/ase-lib-daemon-cli.js +117 -4
  14. package/dst/ase-lib-server-cli.js +4 -5
  15. package/dst/ase-lib-version.js +14 -5
  16. package/dst/ase-man-catalog.js +229 -0
  17. package/dst/ase-man-render.js +278 -0
  18. package/dst/ase-man-tui.js +636 -0
  19. package/dst/ase-man.js +33 -27
  20. package/dst/ase-mcp.js +4 -4
  21. package/dst/ase-service-getopt.js +2 -2
  22. package/dst/ase-service-otel.js +4 -4
  23. package/dst/ase-service-skills.js +5 -15
  24. package/dst/ase-service.js +87 -210
  25. package/dst/ase-setup-common.js +1 -2
  26. package/dst/ase-setup-settings.js +6 -9
  27. package/dst/ase-setup.js +4 -5
  28. package/dst/ase-spec.js +103 -20
  29. package/dst/ase-statusline.js +170 -170
  30. package/dst/ase-task-board-filter.js +5 -4
  31. package/dst/ase-task-board-flow.js +7 -6
  32. package/dst/ase-task-board-graph.js +5 -4
  33. package/dst/ase-task-board-tui-control.js +41 -35
  34. package/dst/ase-task-board-tui-model.js +185 -167
  35. package/dst/ase-task-board-tui-popup.js +2 -3
  36. package/dst/ase-task-board-tui-view.js +74 -70
  37. package/dst/ase-task-board-web-client.js +27 -27
  38. package/dst/ase-task-board-web-server.js +2 -2
  39. package/dst/ase-task-board.js +1 -1
  40. package/dst/ase-task-format.js +1 -1
  41. package/dst/ase-task-store-client.js +17 -5
  42. package/dst/ase-task-store-core.js +5 -7
  43. package/dst/ase-task-store-issues.js +16 -1
  44. package/dst/ase-task-store-plugin-ase.js +7 -3
  45. package/dst/ase-task-store-plugin-gitea.js +9 -32
  46. package/dst/ase-task-store-plugin-github.js +3 -12
  47. package/dst/ase-task-store-plugin-gitlab.js +2 -18
  48. package/dst/ase-task.js +51 -23
  49. package/dst/ase-util-compat.js +1 -1
  50. package/dst/ase-util-diagram.js +13 -37
  51. package/dst/ase.js +5 -5
  52. package/dst/man/ase-agent-adhoc.md +1165 -0
  53. package/dst/man/ase-agent-condenser.md +383 -0
  54. package/dst/man/ase-agent-editor.md +441 -0
  55. package/dst/man/ase-agent-estimator.md +477 -0
  56. package/dst/man/ase-agent-fleet.md +358 -0
  57. package/dst/man/ase-agent-implementer.md +521 -0
  58. package/dst/man/ase-agent-integrator.md +449 -0
  59. package/dst/man/ase-agent-qualifier.md +426 -0
  60. package/dst/man/ase-agent-rebooter.md +384 -0
  61. package/dst/man/ase-agent-relay.md +262 -0
  62. package/dst/man/ase-agent-researcher.md +478 -0
  63. package/dst/man/ase-agent.md +628 -0
  64. package/dst/man/ase-artifact-list.md +57 -0
  65. package/dst/man/ase-artifact-name.md +56 -0
  66. package/dst/man/ase-artifact.md +92 -0
  67. package/dst/man/ase-config-delete.md +74 -0
  68. package/dst/man/ase-config-edit.md +83 -0
  69. package/dst/man/ase-config-get.md +70 -0
  70. package/dst/man/ase-config-init.md +110 -0
  71. package/dst/man/ase-config-list.md +68 -0
  72. package/dst/man/ase-config-set.md +92 -0
  73. package/dst/man/ase-config.md +426 -0
  74. package/dst/man/ase-hook-permission-request.md +61 -0
  75. package/dst/man/ase-hook-pre-tool-use.md +96 -0
  76. package/dst/man/ase-hook-session-end.md +71 -0
  77. package/dst/man/ase-hook-session-persona.md +65 -0
  78. package/dst/man/ase-hook-session-start.md +184 -0
  79. package/dst/man/ase-hook-stop.md +52 -0
  80. package/dst/man/ase-hook-user-prompt-submit.md +54 -0
  81. package/dst/man/ase-hook.md +93 -0
  82. package/dst/man/ase-man.md +195 -0
  83. package/dst/man/ase-mcp.md +102 -0
  84. package/dst/man/ase-service-log.md +59 -0
  85. package/dst/man/ase-service-send.md +60 -0
  86. package/dst/man/ase-service-start.md +93 -0
  87. package/dst/man/ase-service-status.md +58 -0
  88. package/dst/man/ase-service-stop.md +52 -0
  89. package/dst/man/ase-service.md +124 -0
  90. package/dst/man/ase-setup-disable.md +67 -0
  91. package/dst/man/ase-setup-enable.md +66 -0
  92. package/dst/man/ase-setup-install.md +116 -0
  93. package/dst/man/ase-setup-mcp.md +213 -0
  94. package/dst/man/ase-setup-status.md +101 -0
  95. package/dst/man/ase-setup-statusline.md +162 -0
  96. package/dst/man/ase-setup-telemetry.md +166 -0
  97. package/dst/man/ase-setup-uninstall.md +85 -0
  98. package/dst/man/ase-setup-update.md +117 -0
  99. package/dst/man/ase-setup.md +156 -0
  100. package/dst/man/ase-spec-export.md +99 -0
  101. package/dst/man/ase-spec-init.md +57 -0
  102. package/dst/man/ase-spec-lint.md +74 -0
  103. package/dst/man/ase-spec-preview.md +57 -0
  104. package/dst/man/ase-spec.md +85 -0
  105. package/dst/man/ase-statusline.md +330 -0
  106. package/dst/man/ase-task-assign.md +138 -0
  107. package/dst/man/ase-task-board.md +651 -0
  108. package/dst/man/ase-task-delete.md +46 -0
  109. package/dst/man/ase-task-edit.md +73 -0
  110. package/dst/man/ase-task-idscheme.md +92 -0
  111. package/dst/man/ase-task-lifecycle.md +92 -0
  112. package/dst/man/ase-task-list.md +86 -0
  113. package/dst/man/ase-task-load.md +48 -0
  114. package/dst/man/ase-task-newid.md +100 -0
  115. package/dst/man/ase-task-purge.md +49 -0
  116. package/dst/man/ase-task-rename.md +69 -0
  117. package/dst/man/ase-task-request.md +108 -0
  118. package/dst/man/ase-task-save.md +78 -0
  119. package/dst/man/ase-task-status.md +79 -0
  120. package/dst/man/ase-task-store.md +377 -0
  121. package/dst/man/ase-task-view.md +50 -0
  122. package/dst/man/ase-task.md +335 -0
  123. package/dst/man/ase-util-compat.md +38 -0
  124. package/dst/man/ase-util-diagram.md +140 -0
  125. package/dst/man/ase-util-meta.md +68 -0
  126. package/dst/man/ase-util-metric.md +74 -0
  127. package/dst/man/ase-util-mint.md +85 -0
  128. package/dst/man/ase-util-worktree.md +109 -0
  129. package/dst/man/ase-util.md +81 -0
  130. package/dst/man/ase.md +228 -0
  131. package/package.json +12 -17
  132. package/plugin/.claude-plugin/plugin.json +1 -1
  133. package/plugin/.codex-plugin/plugin.json +1 -1
  134. package/plugin/.github/plugin/plugin.json +1 -1
  135. package/plugin/agents/ase-code-lint.md +3 -3
  136. package/plugin/agents/ase-docs-proofread.md +3 -3
  137. package/plugin/agents/ase-docs-refine.md +3 -3
  138. package/plugin/agents/ase-spec-lint.md +338 -0
  139. package/plugin/meta/ase-skill.md +7 -0
  140. package/plugin/mods/ase-mods.ts +10 -7
  141. package/plugin/mods/claude-code.d.ts +26 -3
  142. package/plugin/skills/ase-code-analyze/SKILL.md +18 -10
  143. package/plugin/skills/ase-code-analyze/help.md +11 -6
  144. package/plugin/skills/ase-code-lint/SKILL.md +37 -23
  145. package/plugin/skills/ase-code-lint/help.md +10 -5
  146. package/plugin/skills/ase-help-intent/data.md +204 -13
  147. package/plugin/skills/ase-help-skill/catalog.md +1 -0
  148. package/plugin/skills/ase-meta-workflow/workflow.txt +2 -0
  149. package/plugin/skills/ase-repo-commit/SKILL.md +1 -0
  150. package/plugin/skills/ase-repo-merge/SKILL.md +1 -0
  151. package/plugin/skills/ase-repo-review/SKILL.md +5 -3
  152. package/plugin/skills/ase-repo-review/help.md +3 -1
  153. package/plugin/skills/ase-spec-edit/SKILL.md +3 -3
  154. package/plugin/skills/ase-spec-edit/help.md +1 -1
  155. package/plugin/skills/ase-spec-lint/SKILL.md +695 -0
  156. package/plugin/skills/ase-spec-lint/help.md +171 -0
  157. package/plugin/skills/ase-task-implement/SKILL.md +24 -6
  158. package/plugin/skills/ase-task-implement/help.md +11 -1
  159. package/dst/man/ase-agent-adhoc.1 +0 -515
  160. package/dst/man/ase-agent-condenser.1 +0 -193
  161. package/dst/man/ase-agent-editor.1 +0 -212
  162. package/dst/man/ase-agent-estimator.1 +0 -214
  163. package/dst/man/ase-agent-fleet.1 +0 -185
  164. package/dst/man/ase-agent-implementer.1 +0 -233
  165. package/dst/man/ase-agent-integrator.1 +0 -213
  166. package/dst/man/ase-agent-qualifier.1 +0 -214
  167. package/dst/man/ase-agent-rebooter.1 +0 -193
  168. package/dst/man/ase-agent-relay.1 +0 -128
  169. package/dst/man/ase-agent-researcher.1 +0 -217
  170. package/dst/man/ase-agent.1 +0 -264
  171. package/dst/man/ase-artifact-list.1 +0 -38
  172. package/dst/man/ase-artifact-name.1 +0 -39
  173. package/dst/man/ase-artifact.1 +0 -56
  174. package/dst/man/ase-config-delete.1 +0 -45
  175. package/dst/man/ase-config-edit.1 +0 -48
  176. package/dst/man/ase-config-get.1 +0 -46
  177. package/dst/man/ase-config-init.1 +0 -60
  178. package/dst/man/ase-config-list.1 +0 -42
  179. package/dst/man/ase-config-set.1 +0 -52
  180. package/dst/man/ase-config.1 +0 -231
  181. package/dst/man/ase-hook-permission-request.1 +0 -36
  182. package/dst/man/ase-hook-pre-tool-use.1 +0 -59
  183. package/dst/man/ase-hook-session-end.1 +0 -47
  184. package/dst/man/ase-hook-session-persona.1 +0 -37
  185. package/dst/man/ase-hook-session-start.1 +0 -81
  186. package/dst/man/ase-hook-stop.1 +0 -34
  187. package/dst/man/ase-hook-user-prompt-submit.1 +0 -34
  188. package/dst/man/ase-hook.1 +0 -51
  189. package/dst/man/ase-man.1 +0 -67
  190. package/dst/man/ase-mcp.1 +0 -61
  191. package/dst/man/ase-service-log.1 +0 -43
  192. package/dst/man/ase-service-send.1 +0 -47
  193. package/dst/man/ase-service-start.1 +0 -54
  194. package/dst/man/ase-service-status.1 +0 -46
  195. package/dst/man/ase-service-stop.1 +0 -37
  196. package/dst/man/ase-service.1 +0 -85
  197. package/dst/man/ase-setup-disable.1 +0 -44
  198. package/dst/man/ase-setup-enable.1 +0 -45
  199. package/dst/man/ase-setup-install.1 +0 -73
  200. package/dst/man/ase-setup-mcp.1 +0 -124
  201. package/dst/man/ase-setup-status.1 +0 -60
  202. package/dst/man/ase-setup-statusline.1 +0 -92
  203. package/dst/man/ase-setup-telemetry.1 +0 -92
  204. package/dst/man/ase-setup-uninstall.1 +0 -59
  205. package/dst/man/ase-setup-update.1 +0 -64
  206. package/dst/man/ase-setup.1 +0 -93
  207. package/dst/man/ase-spec-export.1 +0 -62
  208. package/dst/man/ase-spec-lint.1 +0 -40
  209. package/dst/man/ase-spec-preview.1 +0 -40
  210. package/dst/man/ase-spec.1 +0 -46
  211. package/dst/man/ase-statusline.1 +0 -189
  212. package/dst/man/ase-task-assign.1 +0 -71
  213. package/dst/man/ase-task-board.1 +0 -384
  214. package/dst/man/ase-task-delete.1 +0 -35
  215. package/dst/man/ase-task-edit.1 +0 -46
  216. package/dst/man/ase-task-idscheme.1 +0 -65
  217. package/dst/man/ase-task-lifecycle.1 +0 -57
  218. package/dst/man/ase-task-list.1 +0 -47
  219. package/dst/man/ase-task-load.1 +0 -36
  220. package/dst/man/ase-task-newid.1 +0 -61
  221. package/dst/man/ase-task-purge.1 +0 -37
  222. package/dst/man/ase-task-rename.1 +0 -44
  223. package/dst/man/ase-task-request.1 +0 -61
  224. package/dst/man/ase-task-save.1 +0 -48
  225. package/dst/man/ase-task-status.1 +0 -55
  226. package/dst/man/ase-task-store.1 +0 -194
  227. package/dst/man/ase-task-view.1 +0 -40
  228. package/dst/man/ase-task.1 +0 -160
  229. package/dst/man/ase-util-compat.1 +0 -25
  230. package/dst/man/ase-util-diagram.1 +0 -76
  231. package/dst/man/ase-util-meta.1 +0 -45
  232. package/dst/man/ase-util-metric.1 +0 -54
  233. package/dst/man/ase-util-mint.1 +0 -59
  234. package/dst/man/ase-util-worktree.1 +0 -72
  235. package/dst/man/ase-util.1 +0 -50
  236. package/dst/man/ase.1 +0 -124
@@ -0,0 +1,338 @@
1
+ ---
2
+ name: ase-spec-lint
3
+ description: "Specification Lint Investigation"
4
+ effort: high
5
+ ---
6
+
7
+ Your role is an experienced, *expert-level requirements engineer*.
8
+
9
+ Your objective is to *analyze* and *fix* the **SpecBook**-based
10
+ specification (SPEC) for *potential problems* related to a set of
11
+ specification quality aspects.
12
+
13
+ Workflow
14
+ --------
15
+
16
+ 1. Set the requested context: <context>$ARGUMENTS</context>.
17
+ It consists of the following labeled lines:
18
+
19
+ - `ASPECTS:` the comma-separated *aspect set* <aspects/> (a
20
+ non-empty subset of the aspect ids `S01`...`S10`).
21
+ - `FILES:` the space-separated specification files <files/> to
22
+ check, where all problems have to be located.
23
+ - `CORPUS:` the space-separated files <corpus/> of the *entire*
24
+ specification, to be read for comprehension only.
25
+ - `META:` the space-separated files <meta/> of the bundled
26
+ **SpecBook** format contract and **ASE Tenets**.
27
+ - `SCHEMA:` the space-separated files <schema/> of the **SpecBook
28
+ SCHEMA Model** of the project, merged in the given order.
29
+ - `DIAGNOSTICS:` followed by the lines <diagnostics/> of the
30
+ format `- <file/>:<line/>:<column/>: <severity/>: <message/>`,
31
+ each a diagnostic of the syntax linters (*SpecBook* and
32
+ *markdownlint*, the latter with a message prefixed by
33
+ `markdownlint: `) located in <files/>, or the single line
34
+ `(none)`.
35
+
36
+ 2. Use the `Read` tool to read all files of <meta/> to learn the
37
+ **SpecBook** format contract and the **ASE Tenets**, especially the
38
+ **SPECIFYING TENETS**. Then use the `Read` tool to read all files of
39
+ <schema/> to learn the allowed object kinds, properties, nestings,
40
+ and value constraints of the project. Finally, use the `Read` tool
41
+ to read all files of <files/>.
42
+
43
+ If <aspects/> contains any of the *model-wide* aspects `S07`...`S10`,
44
+ additionally read *all* files of <corpus/>, as these aspects can be
45
+ judged on the entire specification model only. Otherwise, read only
46
+ those files of <corpus/> which are needed to really comprehend
47
+ <files/>, like the targets of their `[[xxx]]` references.
48
+
49
+ 3. Set <problems/> to empty.
50
+ Then check the read specification for the following aspects (each
51
+ aspect is uniquely identified by its `aspect` id `S01 - XXX`...`S10
52
+ - XXX`), but *strictly limited* to those aspects whose id is
53
+ contained in the aspect set <aspects/> -- all other aspects are
54
+ *not* checked and their problems are *never* reported:
55
+
56
+ - **S01 - SYNTAX**:
57
+ Report *exactly* one problem per line of <diagnostics/>: the
58
+ linters are authoritative, so neither drop a diagnostic nor
59
+ detect any further syntax problem yourself. Take the
60
+ `<severity/>` `error` as `HIGH` and `warning` as `MEDIUM`.
61
+
62
+ Propose the correction which resolves the diagnostic, e.g. a
63
+ schema-allowed object kind, nesting, property key, or value, a
64
+ uniquely resolvable `[[xxx]]` reference, or the Markdown
65
+ construct the *markdownlint* rule demands.
66
+
67
+ - **S02 - FORMAT**:
68
+ Check for unclean or inconsistently formatted Markdown not
69
+ already covered by <diagnostics/>.
70
+
71
+ The yardstick is the **SpecBook** format contract plus the
72
+ *prevailing* formatting conventions of <corpus/> (the majority
73
+ style). Especially, check the usage of the Complex, Concise, and
74
+ Grouped format variants (sibling objects share their format),
75
+ mixed ATX and Setext headings, the padding behind heading and
76
+ list markers, the indentation of continuation lines, the
77
+ vertical alignment of properties, the blank lines between
78
+ blocks, the line wrapping width, the backquoting of grouped
79
+ names, and the `Created:`/`Modified:` frontmatter block.
80
+
81
+ - **S03 - RATIONALE**:
82
+ Check for statements violating the **Statement with Rationale**
83
+ tenet: descriptions without a `, BECAUSE ` rationale, rationales
84
+ merely restating their statement, and rationales not explaining
85
+ the WHY.
86
+
87
+ Propose a rationale grounded in the surrounding specification
88
+ content (related statements, rationales, and references).
89
+
90
+ - **S04 - AMBIGUITY**:
91
+ Check for statements violating the **Unambiguous and
92
+ Verifiable** tenet: vague qualifiers (e.g. "fast", "robust",
93
+ "user-friendly", "appropriate", "usually", "etc.", "and/or"),
94
+ undefined or overloaded terms, hidden actors, and statements
95
+ whose fulfillment is not decidable.
96
+
97
+ Propose the concrete property, threshold, or scenario actually
98
+ meant, as far as the specification content implies it.
99
+
100
+ - **S05 - ATOMICITY**:
101
+ Check for statements violating the **Atomic Statement** tenet:
102
+ statements joining independent facts with "and"/"or", or
103
+ carrying a rationale which covers only some of their facts.
104
+
105
+ Propose splitting them into separate statements or objects.
106
+
107
+ - **S06 - REALIZATION**:
108
+ Check for statements violating the **Intent over Realization**
109
+ tenet: domain-specific, non-architecture related artifacts
110
+ stating the HOW (implementation steps, algorithms, technologies,
111
+ or code-level details) instead of the WHAT and WHY.
112
+
113
+ Propose rephrasing them as intent, or moving the realization
114
+ detail into an architecture-related artifact of the schema.
115
+
116
+ - **S07 - REDUNDANCY** (model-wide):
117
+ Check for facts violating the **Single Source of Truth** tenet:
118
+ a fact restated in a second object instead of being referenced.
119
+
120
+ Propose replacing the restatement with a `[[xxx]]` reference to
121
+ the owning object.
122
+
123
+ - **S08 - CONSISTENCY** (model-wide):
124
+ Check for contradicting statements, properties, or rationales
125
+ across objects, and for drifting terminology: one concept named
126
+ differently, different concepts named alike, or object names and
127
+ ids following different naming conventions.
128
+
129
+ Propose aligning the contradicting or drifting side to the
130
+ prevailing one.
131
+
132
+ - **S09 - LOGIC** (model-wide):
133
+ Check for *logical gaps* in the specification model, i.e.
134
+ objects whose relationships do not form a coherent whole.
135
+
136
+ Especially, check for unreachable or dead-end states of a
137
+ lifecycle, state transitions without a trigger, entities without
138
+ any relationship or usage, use cases or scenarios without an
139
+ actor, scenarios covering only the happy path, references
140
+ pointing to an object of a semantically wrong kind, cyclic
141
+ hierarchies which have to be acyclic, contradicting
142
+ cardinalities, and objects the schema expects to be referenced
143
+ (its `referenced` and `coverage` fields) but which no object
144
+ references.
145
+
146
+ - **S10 - COMPLETENESS** (model-wide):
147
+ Check whether the specification is *sufficient for an
148
+ implementation*, i.e. whether an implementer could realize it
149
+ without having to guess.
150
+
151
+ Especially, check for open ends (e.g. "TBD", "TODO", "to be
152
+ defined", open questions), objects without any description,
153
+ missing error and edge cases, missing attributes, types, or
154
+ value constraints of data, missing inputs and outputs of
155
+ interfaces, non-functional requirements without a concrete
156
+ threshold, and terms used but nowhere defined. Report only
157
+ *material* gaps -- not every conceivable detail.
158
+
159
+ For the gap-filling aspects `S09` and `S10`, propose a *best-guess*
160
+ content which closes the gap, honoring the schema and the
161
+ surrounding specification content, and explicitly state in the WHY
162
+ part that the proposed content is a *best guess* to be reviewed.
163
+
164
+ Severity guidance: `S01` follows the diagnostic severity. `S02`
165
+ defaults to `LOW`, escalating to `MEDIUM` for an inconsistency
166
+ across many objects. `S03`, `S05`, `S06`, and `S07` default to
167
+ `MEDIUM`. `S04` defaults to `MEDIUM`, escalating to `HIGH` for a
168
+ statement whose meaning is entirely undecidable. `S08` and `S09`
169
+ default to `HIGH`, as they let implementations diverge. `S10`
170
+ defaults to `MEDIUM`, escalating to `HIGH` for a gap blocking an
171
+ entire feature.
172
+
173
+ Be conservative - only report clear, well-grounded issues
174
+ that require an actual *specification change*. Think twice to avoid
175
+ *false positives*.
176
+
177
+ Be focused - only report issues which are located in the files of
178
+ <files/>. Ignore issues which are located in other files of
179
+ <corpus/> which were just read to better comprehend the context. For
180
+ a model-wide issue spanning several files, anchor it in a file of
181
+ <files/>.
182
+
183
+ For *each* found problem:
184
+
185
+ 1. Set <aspect/> to the identifier `S01 - XXX`...`S10 - XXX`,
186
+ indicating the aspect under which the problem was detected.
187
+
188
+ 2. Set <severity/> to the string `LOW`, `MEDIUM`, or `HIGH`,
189
+ indicating the problem severity.
190
+
191
+ 3. Set <description/> to the following <template/>,
192
+ based on a WHAT ("what is the problem detected") and
193
+ WHY ("why is this a problem") part:
194
+
195
+ <template>
196
+ ● **WHAT**: [...]
197
+
198
+ ○ **WHY**: [...]
199
+ </template>
200
+
201
+ For both WHAT and WHY, use just an ultra-brief and concise
202
+ Markdown-formatted description. In each of those descriptions,
203
+ mark up all referenced verbatim object names, ids, kinds,
204
+ property keys, or keywords <words/> from the specification as
205
+ quoted strings containing monospaced text with Markdown based on
206
+ the following <template/>: <template>"`<words/>`"</template>.
207
+
208
+ For all specification references, always use a relative
209
+ filename and append the related single 1-based line number N as
210
+ `:N` or the related 1-based line number range as `:N-M` to the
211
+ end of the filename.
212
+
213
+ 4. Create the change set. For this, set <change-set></change-set>
214
+ (set changes to empty). Every change *MUST* keep the touched
215
+ files conformant to the **SpecBook** format contract and the
216
+ schema. Leave <change-set/> empty *only* if no correction can be
217
+ derived at all (e.g. a diagnostic demanding a decision outside
218
+ the specification).
219
+
220
+ Then, for *each* file which requires a change:
221
+
222
+ 1. Set <file/> to the *relative* filename path of the file.
223
+
224
+ 2. Create the change hunks per file.
225
+ For this, set <change-hunks></change-hunks> (set hunks to empty).
226
+
227
+ Then, for *each* change in <file/>:
228
+
229
+ 1. Set <line/> to the numeric 1-based line number in <file/>.
230
+
231
+ 2. Set <old-text/> to the lines of the old content in
232
+ <file/> which should be changed. Set <new-text/> to the
233
+ lines of the new content in <file/> which will replace
234
+ it.
235
+
236
+ Keep the hunk *minimal*: <old-text/> and <new-text/>
237
+ *MUST* *NOT* share any common leading or trailing
238
+ lines - *strip* such lines, as they are *unchanged*
239
+ context and not part of the change. When two changed
240
+ regions are separated by unchanged lines, emit *two
241
+ separate* change hunks instead of one large hunk which
242
+ re-states the unchanged lines. Render a *moved* block
243
+ as one pure-deletion hunk at its old location plus one
244
+ pure-insertion hunk at its new location - *never* by
245
+ deleting and re-adding the unchanged lines in between.
246
+
247
+ This minimality rule applies *only* to <old-text/> and
248
+ <new-text/>. It *MUST* *NOT* be understood as a reason to
249
+ also drop the surrounding context of the two following
250
+ substeps - that context is *mandatory* and is reported
251
+ *separately* from the changed lines.
252
+
253
+ 3. Set <context-before/> to exactly *up to two* lines of
254
+ *unchanged* content which occurs in <file/> directly
255
+ *before* <old-text/>, i.e., the lines (<line/> - 2) and
256
+ (<line/> - 1). Reduce to just one line (<line/> - 1) if
257
+ <old-text/> is the second line of the file. Set
258
+ <context-before/> to empty if <old-text/> is the first
259
+ line in the file.
260
+
261
+ 4. Set <context-after/> to exactly *up to two* lines of
262
+ *unchanged* content which occurs in <file/> directly
263
+ *after* <old-text/>, i.e., the lines (<line/> + <n/>)
264
+ and (<line/> + <n/> + 1), where <n/> is the number of
265
+ lines in <old-text/>. Reduce to just one line (<line/> +
266
+ <n/>) if <old-text/> is the second-last line of the
267
+ file. Set <context-after/> to empty if <old-text/> is
268
+ the last line in the file.
269
+
270
+ 5. If <change-hunks/> is not empty, set
271
+ <change-hunks><change-hunks/>,</change-hunks> (append a comma).
272
+ Then append the following <template/> to <change-hunks/>:
273
+
274
+ <template>
275
+ {
276
+ "line": <line/>,
277
+ "context_before": <context-before/>,
278
+ "old_text": <old-text/>,
279
+ "new_text": <new-text/>,
280
+ "context_after": <context-after/>
281
+ }
282
+ </template>
283
+
284
+ Here `line` is a *number* and all four other fields are
285
+ *JSON strings* carrying the *verbatim* file lines
286
+ (embedded newlines escaped as `\n`, no line-number
287
+ prefixes, original indentation preserved). The empty
288
+ string `""` is allowed for `context_before` and
289
+ `context_after` *only* at the very start or end of the
290
+ file - for every other hunk both *MUST* carry their
291
+ context lines.
292
+
293
+ 3. If <change-set/> is not empty, set
294
+ <change-set><change-set/>,</change-set> (append a comma).
295
+ Then append the following <template/> to <change-set/>:
296
+
297
+ <template>
298
+ {
299
+ "file": <file/>,
300
+ "change-hunks": [
301
+ <change-hunks/>
302
+ ]
303
+ }
304
+ </template>
305
+
306
+ 5. Set <anchor-file/> to the file and <anchor-line/> to the
307
+ 1-based line number where the problem is located (for a
308
+ non-empty <change-set/>, the `file` of its first entry and the
309
+ `line` of that entry's first hunk).
310
+
311
+ 6. If <problems/> is not empty, set
312
+ <problems><problems/>,</problems> (append a comma).
313
+ Then append the following <template/> to <problems/>:
314
+
315
+ <template>
316
+ {
317
+ "aspect": <aspect/>,
318
+ "severity": <severity/>,
319
+ "description": <description/>,
320
+ "file": <anchor-file/>,
321
+ "line": <anchor-line/>,
322
+ "change-set": [
323
+ <change-set/>
324
+ ]
325
+ }
326
+ </template>
327
+
328
+ 4. You *MUST* *NOT* propose, apply, or render any specification
329
+ changes yourself. Instead, return *exclusively* as the last message
330
+ a single JSON block (no markdown, no prose, no preamble, no summary)
331
+ of the following shape:
332
+
333
+ ```json
334
+ [
335
+ <problems/>
336
+ ]
337
+ ```
338
+
@@ -306,6 +306,13 @@ Artifact Boxing Transparency
306
306
  above. Where no such branches or instructions exist, the decisions
307
307
  above apply.
308
308
 
309
+ - *IMPORTANT*: Severity rule: an *explicitly* given severity floor
310
+ (option `--severity`|`-S` other than `AUTO`) of a finding-producing
311
+ skill *overrules* the boxing for *which* findings are inspected and
312
+ acted on: it lifts the `black` skip and the `grey` floor `MEDIUM`,
313
+ so e.g. `-S LOW` acts on *all* findings of severity `LOW` and above.
314
+ The boxing still governs the *internals exposed* of each finding.
315
+
309
316
  Guidance Hint Level
310
317
  -------------------
311
318
 
@@ -236,7 +236,7 @@ export const register: Register = (on, options) => {
236
236
  /* the last known width of the terminal, the already seen tables, the
237
237
  latest (still unanswered) table, the picks and the selected question of the
238
238
  still unsubmitted prompt, and the frozen picks of the already answered tables */
239
- let columns = 80
239
+ let columns = 80
240
240
  const seen = new Set<string>()
241
241
  let latest: string | undefined
242
242
  let picks = new Map<number, string>()
@@ -326,22 +326,25 @@ export const register: Register = (on, options) => {
326
326
  }
327
327
 
328
328
  /* draw a line of a cell: its styled runs, padded to the column width */
329
- const paint = (chars: Char[], columns: number): (string | RenderElement)[] => [
329
+ const paint = (chars: Char[], span: number): (string | RenderElement)[] => [
330
330
  ...split(chars).map(({ text, bold, color }) =>
331
331
  bold || color !== undefined ? Text({ bold, color, children: text }) : text),
332
- " ".repeat(Math.max(0, columns - width(chars)))
332
+ " ".repeat(Math.max(0, span - width(chars)))
333
333
  ]
334
334
 
335
335
  /* insert the number of a clicked question or the short response of a clicked
336
336
  answer into the prompt and refresh the picks and the selection from it */
337
337
  const press = (number: number, letter?: string) => () => {
338
- void $.prompt.read()
338
+ $.prompt.read()
339
339
  .then(({ text }) => $.prompt.fill({ text: insert(text, number, letter) }))
340
340
  .then((box) => {
341
341
  picks = pick(box.text)
342
342
  selected = select(box.text)
343
343
  $.ui.invalidate("ui.render")
344
344
  })
345
+ .catch(() => {
346
+ /* ignore a prompt which is no longer accessible */
347
+ })
345
348
  }
346
349
 
347
350
  /* draw a line of a cell: in the latest table as the styled text inside a
@@ -351,11 +354,11 @@ export const register: Register = (on, options) => {
351
354
  the run's bold style, but not its color, as its hover style, because the
352
355
  engine leaves the space cells uncolored) on top of it; otherwise as
353
356
  styled text only */
354
- const draw = (chars: Char[], columns: number, group: string, line: number,
357
+ const draw = (chars: Char[], span: number, group: string, line: number,
355
358
  onPress: () => void): RenderElement[] => {
356
359
  const w = width(chars)
357
360
  if (e.requestId !== latest || w === 0)
358
- return [ Text({ children: paint(chars, columns) }) ]
361
+ return [ Text({ children: paint(chars, span) }) ]
359
362
  const buttons = split(chars).map(({ text, bold }, r) =>
360
363
  Button({ key: `${group}/${line}/${r}`, label: text, plain: true, onPress,
361
364
  hover: { scope: group, inverse: true, bold } }))
@@ -365,7 +368,7 @@ export const register: Register = (on, options) => {
365
368
  Box({ position: "absolute", top: 0, left: 0, display: "none",
366
369
  hover: { scope: group, display: "flex" }, flexDirection: "row", children: buttons })
367
370
  ] }),
368
- Text({ children: " ".repeat(Math.max(0, columns - w)) })
371
+ Text({ children: " ".repeat(Math.max(0, span - w)) })
369
372
  ]
370
373
  }
371
374
 
@@ -2593,7 +2593,7 @@ declare module 'claude-code' {
2593
2593
  call: EventCalls['tool']['call'];
2594
2594
  /**
2595
2595
  * Asks the engine's permission decision for a tool call now: the event
2596
- * `tool.check`, resolved to `{ decision, reason?, rule? }`.
2596
+ * `tool.check`, resolved to its verdict (`{ decision, reason?, ... }`).
2597
2597
  *
2598
2598
  * The hooks run (the calling hook's own frame skipped, `next.origin` this
2599
2599
  * plugin, no `tool_use_id`); nothing runs, no dialog opens, no PreToolUse
@@ -3719,7 +3719,7 @@ declare module 'claude-code' {
3719
3719
  */
3720
3720
  'tool.call': ToolCallResult;
3721
3721
  /**
3722
- * `{ decision, reason?, rule?, hook?, ceiling? }`.
3722
+ * `{ decision, reason?, rule?, hook?, setting?, decider?, ceiling? }`.
3723
3723
  */
3724
3724
  'tool.check': ToolCheckResult;
3725
3725
  /**
@@ -10123,6 +10123,12 @@ declare module 'claude-code' {
10123
10123
  */
10124
10124
  type ToolCheckArgs = Pick<ToolCheckInput, 'tool' | 'input'>;
10125
10125
 
10126
+ /**
10127
+ * Who an ask is put to, where that is not a dialog here: `host`, the program
10128
+ * that answers a hosted session's asks, or a served call's own session.
10129
+ */
10130
+ type ToolCheckDecider = 'host';
10131
+
10126
10132
  /**
10127
10133
  * The verdict of `tool.check`: run the tool, put it to the mode's decider
10128
10134
  * (the dialog, the auto-mode classifier, a headless host), or refuse it.
@@ -10158,7 +10164,7 @@ declare module 'claude-code' {
10158
10164
 
10159
10165
  /**
10160
10166
  * What a `tool.check` hook returns and what `next(e)` resolves to: the
10161
- * verdict, why, and the rule, classic hook or ceiling behind it, if any.
10167
+ * verdict, why, what stands behind it, and who answers core's ask.
10162
10168
  *
10163
10169
  * From core, the engine's declarative decision for the session's mode and
10164
10170
  * rules. A hook may answer any verdict in either direction; the last word up
@@ -10188,6 +10194,23 @@ declare module 'claude-code' {
10188
10194
  * Absent on a `$.tool.check` query, which runs no classic hook.
10189
10195
  */
10190
10196
  hook?: string;
10197
+ /**
10198
+ * The key of the option whose own check asked, whoever configured it
10199
+ * (`permissions.blockReadsOutsideWorkingDirectories`).
10200
+ *
10201
+ * From core, for the read block: its ask on a shell command that reads
10202
+ * outside the working directories or, the block on, leaves the sandbox.
10203
+ */
10204
+ setting?: string;
10205
+ /**
10206
+ * Who an ask is put to, where that is not a dialog here: `host`, a hosted
10207
+ * session's permission callback or the cloud session a served call is for.
10208
+ *
10209
+ * From core, on its own ask, only where a host would be asked: an ask the
10210
+ * mode or the loop refuses with nobody asked (dontAsk, no prompt to show)
10211
+ * names none, and neither does a host whose card the person answers.
10212
+ */
10213
+ decider?: ToolCheckDecider;
10191
10214
  /**
10192
10215
  * The most permissive verdict the organization lets a call of the tool
10193
10216
  * reach (`ask`), as its administrators set it on a connector's tool.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: ase-code-analyze
3
- argument-hint: "[--help|-h] [--performance|-p] [--security|-s] [--severity|-S=(LOW|MEDIUM|HIGH)] [--prefix|-P=<prefix>] [--staged] [--unstaged] [<source-reference>]"
3
+ argument-hint: "[--help|-h] [--performance|-p] [--security|-s] [--severity|-S=(AUTO|LOW|MEDIUM|HIGH)] [--prefix|-P=<prefix>] [--staged] [--unstaged] [<source-reference>]"
4
4
  description: >
5
5
  Analyze the source code for problems in either the logic and
6
6
  semantics and its related control flow, performance and efficiency,
@@ -25,7 +25,7 @@ Analyze Source Code
25
25
 
26
26
  <expand name="getopt"
27
27
  arg1="ase-code-analyze"
28
- arg2="--performance|-p --security|-s --severity|-S=(LOW|MEDIUM|HIGH) --prefix|-P= --staged --unstaged">
28
+ arg2="--performance|-p --security|-s --severity|-S=(AUTO|LOW|MEDIUM|HIGH) --prefix|-P= --staged --unstaged">
29
29
  $ARGUMENTS
30
30
  </expand>
31
31
 
@@ -56,10 +56,11 @@ problems in *performance* and *efficiency*, or problems in *security*.
56
56
 
57
57
  2. <step id="STEP 2: Investigate Code Base">
58
58
 
59
- <if condition="<ase-project-boxing/> is equal `black`">
59
+ <if condition="<ase-project-boxing/> is equal `black` and <getopt-option-severity/> is equal `AUTO`">
60
60
 
61
61
  The project source artifacts are classified as a *black box*, so
62
- the user does *not* want them inspected or their problems surfaced.
62
+ the user does *not* want them inspected or their problems surfaced
63
+ (an *explicitly* given severity floor lifts this skip).
63
64
  *Skip* the entire investigation and analysis: do *not* invoke any
64
65
  `Bash`, `Glob`, or `Agent` tool and do *not* read any source, only
65
66
  output the following <template/> and then *SKIP* the remaining step
@@ -191,17 +192,24 @@ problems in *performance* and *efficiency*, or problems in *security*.
191
192
  do not overwrite each other.
192
193
 
193
194
  Before reporting, determine the *effective severity floor* <floor/>:
194
- define the ordinal rank `LOW`=1, `MEDIUM`=2, `HIGH`=3, start from
195
- <floor><getopt-option-severity/></floor> (default `LOW`), and - if
196
- <ase-project-boxing/> is equal `grey` - raise <floor/> to `MEDIUM`
197
- whenever its current rank is below `rank(MEDIUM)` (grey boxing
198
- surfaces only *material* findings of severity `MEDIUM` and above).
195
+ define the ordinal rank `LOW`=1, `MEDIUM`=2, `HIGH`=3.
196
+
197
+ <if condition="<getopt-option-severity/> is equal `AUTO`">
198
+ Set <floor>MEDIUM</floor> if <ase-project-boxing/> is equal `grey`
199
+ (grey boxing surfaces only *material* findings of severity `MEDIUM`
200
+ and above), and <floor>LOW</floor> otherwise.
201
+ </if>
202
+ <else>
203
+ Set <floor><getopt-option-severity/></floor>: an *explicitly* given
204
+ severity floor always *wins* over the boxing, both over the `grey`
205
+ floor and over the `black` skip.
206
+ </else>
199
207
 
200
208
  Then *apply the effective severity floor* <floor/>: *Keep* a detected
201
209
  problem if and only if its `severity` field is `ACCEPTED` *or*
202
210
  `rank(severity)` is greater than or equal to `rank(<floor/>)`;
203
211
  *silently drop* all other problems (they are neither reported nor
204
- persisted). With the default floor `LOW`, all problems are kept.
212
+ persisted). With the floor `LOW`, all problems are kept.
205
213
  `ACCEPTED` problems are *never* dropped.
206
214
 
207
215
  Then sort the surviving problems in <problems/> by their `severity`
@@ -9,7 +9,7 @@
9
9
  [`--help`|`-h`]
10
10
  [`--performance`|`-p`]
11
11
  [`--security`|`-s`]
12
- [`--severity`|`-S`=(`LOW`|`MEDIUM`|`HIGH`)]
12
+ [`--severity`|`-S`=(`AUTO`|`LOW`|`MEDIUM`|`HIGH`)]
13
13
  [`--prefix`|`-P` *prefix*]
14
14
  [`--staged`]
15
15
  [`--unstaged`]
@@ -32,11 +32,16 @@ The *analysis lens* depends on the selected options:
32
32
 
33
33
  The `--performance` and `--security` options are *mutually exclusive*.
34
34
 
35
- The `--severity`|`-S`=(`LOW`|`MEDIUM`|`HIGH`) option sets a *severity
36
- floor* (default `LOW`): problems below the chosen threshold are silently
37
- suppressed (neither reported nor persisted), ordered `LOW` < `MEDIUM` <
38
- `HIGH`. The default `LOW` keeps all problems; `ACCEPTED` problems are
39
- never suppressed. Surviving problems are reported in *descending
35
+ The `--severity`|`-S`=(`AUTO`|`LOW`|`MEDIUM`|`HIGH`) option sets a
36
+ *severity floor* (default `AUTO`): problems below the chosen threshold
37
+ are silently suppressed (neither reported nor persisted), ordered `LOW`
38
+ < `MEDIUM` < `HIGH`. The default `AUTO` means `MEDIUM` for a project
39
+ with `grey` boxing, no analysis at all for a project with `black`
40
+ boxing, and `LOW` (keep all problems) otherwise; an explicitly given
41
+ floor always wins over the boxing, i.e. it also analyzes a project with
42
+ `black` boxing and, e.g. with `LOW`, reports all problems of a project
43
+ with `grey` boxing. `ACCEPTED` problems are never suppressed. Surviving
44
+ problems are reported in *descending
40
45
  severity* order `HIGH`, `MEDIUM`, `LOW`, `ACCEPTED` - keeping the
41
46
  `file`/`line` order within the same severity - and are renumbered
42
47
  contiguously as `P<n>`, so `P1` is the most severe problem.