@rse/ase 0.9.61 → 0.9.63

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 (37) hide show
  1. package/dst/ase-artifact.js +19 -8
  2. package/dst/ase-config.js +12 -8
  3. package/dst/ase-hook.js +8 -0
  4. package/dst/ase-service.js +2 -0
  5. package/dst/ase-spec.js +241 -0
  6. package/dst/ase.js +2 -0
  7. package/package.json +10 -8
  8. package/plugin/.claude-plugin/plugin.json +1 -1
  9. package/plugin/.codex-plugin/plugin.json +1 -1
  10. package/plugin/.github/plugin/plugin.json +1 -1
  11. package/plugin/agents/ase-code-lint.md +47 -3
  12. package/plugin/etc/stx.conf +5 -3
  13. package/plugin/meta/ase-common-grill.md +89 -0
  14. package/plugin/meta/ase-dialog.md +6 -0
  15. package/plugin/meta/ase-format-meta.md +23 -105
  16. package/plugin/meta/ase-format-spec.md +22 -1326
  17. package/plugin/meta/ase-tenets.md +63 -4
  18. package/plugin/package.json +6 -2
  19. package/plugin/skills/ase-arch-analyze/SKILL.md +1 -1
  20. package/plugin/skills/ase-code-analyze/SKILL.md +1 -1
  21. package/plugin/skills/ase-code-analyze/help.md +2 -1
  22. package/plugin/skills/ase-code-edit/SKILL.md +142 -140
  23. package/plugin/skills/ase-code-lint/SKILL.md +5 -5
  24. package/plugin/skills/ase-code-lint/help.md +23 -8
  25. package/plugin/skills/ase-help-skill/catalog.md +3 -0
  26. package/plugin/skills/ase-meta-review/help.md +1 -1
  27. package/plugin/skills/ase-spec-edit/SKILL.md +520 -0
  28. package/plugin/skills/ase-spec-edit/help.md +130 -0
  29. package/plugin/skills/ase-sync-export/SKILL.md +57 -116
  30. package/plugin/skills/ase-sync-export/help.md +30 -42
  31. package/plugin/skills/ase-sync-import/SKILL.md +37 -15
  32. package/plugin/skills/ase-sync-import/help.md +14 -10
  33. package/plugin/skills/ase-sync-reconcile/SKILL.md +37 -16
  34. package/plugin/skills/ase-sync-reconcile/help.md +19 -16
  35. package/plugin/skills/ase-task-grill/SKILL.md +120 -59
  36. package/plugin/skills/ase-task-grill/help.md +42 -12
  37. package/plugin/meta/ase-format-arch.md +0 -1164
@@ -20,6 +20,9 @@
20
20
  ○ `ase-arch-analyze`: Review Software Architecture
21
21
  ○ `ase-arch-discover`: Discover Components
22
22
 
23
+ ⎈ **SPECIFICATION**
24
+ ○ `ase-spec-edit`: Edit Specification
25
+
23
26
  ⎈ **CODING**
24
27
  ○ `ase-code-analyze`: Analyze Source Code
25
28
  ○ `ase-code-lint`: Lint Source Code
@@ -27,7 +27,7 @@ naming, abstraction level), **clarity** (readability and
27
27
  self-documentation for a future reader), **robustness** (error handling,
28
28
  resource and concurrency safety), **security** and **performance** (risks
29
29
  introduced by the change), **convention** (conformance to the
30
- project's documented conventions - code style and the plan/spec/arch
30
+ project's documented conventions - code style and the plan/spec
31
31
  formats described in `AGENTS.md` and the `ase-format-*` meta documents),
32
32
  **testing** (inadequate coverage for the change - new or fixed behavior
33
33
  left untested, adjacent tests not updated, or existing tests silently
@@ -0,0 +1,520 @@
1
+ ---
2
+ name: ase-spec-edit
3
+ argument-hint: "[--help|-h] [--grill|-g] [--grill-rounds|-r <n>] [--verify|-v] [--worktree|-w] [--loop|-l] [<query>]"
4
+ description: >
5
+ Edit Specification: Use when the user wants to "edit" the
6
+ SpecBook-based specification (SPEC) in one shot from a query, with
7
+ optional grilling, SpecBook validation, looping, and Git worktree
8
+ isolation.
9
+ user-invocable: true
10
+ disable-model-invocation: false
11
+ effort: xhigh
12
+ ---
13
+
14
+ @${CLAUDE_SKILL_DIR}/../../meta/ase-control.md
15
+ @${CLAUDE_SKILL_DIR}/../../meta/ase-skill.md
16
+ @${CLAUDE_SKILL_DIR}/../../meta/ase-dialog.md
17
+ @${CLAUDE_SKILL_DIR}/../../meta/ase-getopt.md
18
+
19
+ <purpose name="ase-spec-edit">
20
+ Edit Specification
21
+ </purpose>
22
+
23
+ <expand name="getopt"
24
+ arg1="ase-spec-edit"
25
+ arg2="--grill|-g --grill-rounds|-r=1 --verify|-v --worktree|-w --loop|-l">
26
+ $ARGUMENTS
27
+ </expand>
28
+
29
+ <objective>
30
+ *Edit* the specification directly from a query -- creating, revising, or
31
+ pruning its statements in one shot -- through the states *querying*,
32
+ *discovering*, *grilling*, *implementing*, and *verifying*.
33
+ </objective>
34
+
35
+ @${CLAUDE_SKILL_DIR}/../../meta/ase-format-meta.md
36
+ @${CLAUDE_SKILL_DIR}/../../meta/ase-format-spec.md
37
+ @${CLAUDE_SKILL_DIR}/../../meta/ase-tenets.md
38
+ @${CLAUDE_SKILL_DIR}/../../meta/ase-common-grill.md
39
+
40
+ Procedure
41
+ ---------
42
+
43
+ This skill is *plan-less*: it *never* composes or persists a task plan
44
+ and *MUST* *NOT* call `ase_task_save(...)`. Instead, it applies the
45
+ requested edit *in place*, so the *implementing* state *requires* `Edit`
46
+ and `Write` to modify the affected artifacts. Every modification *MUST*
47
+ stay restricted to the `SPEC` artifacts the edit actually demands -- the
48
+ kinds `CODE`, `DOCS`, `TASK`, `INFR`, and `OTHR` are *never* touched.
49
+
50
+ <define name="todo-box">
51
+
52
+ On finishing the state `<arg1/>`, only output the following <template/>,
53
+ which shows the established <todo-what/> and <todo-how/>, where a still
54
+ empty <todo-what/> or <todo-how/> renders as `(none)`:
55
+
56
+ <template>
57
+ <ase-tpl-head title="EDIT TODO" subtitle="<arg1/>"/>
58
+
59
+ **WHAT**: <todo-what/>
60
+
61
+ **HOW**: <todo-how/>
62
+
63
+ <ase-tpl-foot title="EDIT TODO" subtitle="<arg1/>"/>
64
+ </template>
65
+
66
+ </define>
67
+
68
+ 1. **Initialize:**
69
+
70
+ 1. Set <query><getopt-arguments/></query> (with any leading and
71
+ trailing whitespace stripped), set <todo-what></todo-what> and
72
+ <todo-how></todo-how> (both empty), and set
73
+ <worktree-dir></worktree-dir> (empty). Do not output anything.
74
+
75
+ 2. If <getopt-option-grill-rounds/> is not a positive integer,
76
+ only output the following <template/> and then immediately
77
+ *STOP* processing the entire current skill:
78
+
79
+ <template>
80
+ ⧉ **ASE**: ✪ skill: **ase-spec-edit**, ▶ ERROR: invalid `--grill-rounds` value: **<getopt-option-grill-rounds/>**
81
+ </template>
82
+
83
+ 2. **Iterate:**
84
+
85
+ Perform the states (1) *querying*, (2) *discovering*, (3) *grilling*,
86
+ (4) *implementing*, and (5) *verifying* below as one *iteration*.
87
+ Without `--loop` perform exactly *one* iteration. Under `--loop`
88
+ *repeat* the iteration until the *querying* state receives a
89
+ `STOP SKILL` result. Do not output anything in this item.
90
+
91
+ 3. **State: querying:**
92
+
93
+ 1. <if condition="<query/> is empty">
94
+
95
+ 1. In the following, you *MUST* *NOT* use your built-in
96
+ <user-dialog-tool/> tool! Instead, you *MUST* just show a
97
+ custom dialog according to the expanded `custom-dialog`
98
+ definition. You *MUST* closely follow this definition. Its
99
+ only answer option is the fixed `STOP SKILL`, so the user
100
+ normally answers with the edit query in *one* free-text
101
+ reply:
102
+
103
+ <expand name="custom-dialog" arg1="--other">
104
+ Edit Query: What is your edit query?
105
+ STOP SKILL: stop the entire skill immediately
106
+ </expand>
107
+
108
+ 2. If <result/> is `STOP SKILL` or `CANCEL`, only output the
109
+ following <template/> and then immediately *STOP* processing
110
+ the entire current skill:
111
+
112
+ <template>
113
+ ⧉ **ASE**: ✪ skill: **ase-spec-edit**, ▶ status: **editing finished**
114
+ </template>
115
+
116
+ Otherwise, strip any leading `OTHER: ` prefix from
117
+ <result/> and set <query/> to the remainder.
118
+
119
+ </if>
120
+
121
+ 2. Convert the <query/> *fresh* into <todo-what/> -- the
122
+ domain-specific, non-implementation-detail information -- and
123
+ <todo-how/> -- the remaining information -- discarding all
124
+ <todo-what/>/<todo-how/> content of any previous iteration.
125
+ Without `--grill` you *MUST* *NOT* ask any clarifying questions
126
+ and during later implementation just interpret the query best-effort.
127
+ Do not output anything.
128
+
129
+ 3. Expand the following:
130
+
131
+ <expand name="todo-box" arg1="current state (after querying)"></expand>
132
+
133
+ 4. Set <query></query> (clear the query, so every further `--loop`
134
+ iteration asks for a fresh one). Do not output anything.
135
+
136
+ 4. **State: discovering:**
137
+
138
+ 1. Resolve the `SPEC` artifacts by calling the
139
+ `ase_artifact_list(kind: [ "spec" ])` tool of the `ase` MCP
140
+ server *once* and reading the returned `artifacts` array of
141
+ `{ kind, files }` objects to obtain the project-relative file
142
+ list. Do not output anything.
143
+
144
+ 2. Read the **SpecBook SCHEMA Model** of the project (resolved as
145
+ described in `ase-format-spec.md`) to learn the allowed object
146
+ kinds, properties, nestings, and value constraints. Do not
147
+ output anything.
148
+
149
+ 3. Read all resolved `SPEC` artifacts which are related to
150
+ <todo-what/> and <todo-how/>, and check the structure of the
151
+ existing specification -- its artifacts, object kinds, ids,
152
+ properties, descriptions, and `[[xxx]]` references -- to
153
+ understand the overall models and their relationships. Do not
154
+ output anything.
155
+
156
+ 5. **State: grilling:**
157
+
158
+ Enter this state only if <getopt-option-grill/> is equal `true`;
159
+ otherwise silently *skip* the entire state. Do not output anything
160
+ about the skipping.
161
+
162
+ 1. Understand what "grilling" is about:
163
+
164
+ <expand name="grill-understanding" arg1="the edit query in <todo-what/> and <todo-how/>"></expand>
165
+
166
+ 2. Perform <getopt-option-grill-rounds/> grilling *rounds*,
167
+ numbered <m/> (1-<getopt-option-grill-rounds/>).
168
+
169
+ For each round:
170
+
171
+ 1. INITIALIZE TODO:
172
+
173
+ Explicitly start *from scratch* from *only* the current
174
+ <todo-what/> and <todo-how/> and *forget* all information
175
+ gathered in previous rounds. Set <round-id/> to
176
+ `GRILLING ROUND <m/>/<getopt-option-grill-rounds/>` if
177
+ <getopt-option-grill-rounds/> is greater than 1, or to
178
+ `GRILLING` otherwise (a single round needs no round
179
+ numbering). Do not output anything.
180
+
181
+ 2. DETERMINE QUESTIONS:
182
+
183
+ Determine the questions, comprised of a round-local id
184
+ <question-N-id/> of `Q<N/>` -- where <N/> restarts at `1`
185
+ in *every* round, independent of the numbering of previous
186
+ rounds --, and a very brief but precise question text
187
+ <question-N-text/>. Each question is chosen to
188
+ resolve the open points related to the above understanding
189
+ of grilling, by focusing on the mentioned *Focus Areas*.
190
+
191
+ For <question-N-text/> use the format `Shall...?` for
192
+ questions of focus area `DOMAIN` and `INTERFACE`, the format
193
+ `Should...?` for questions of focus area `ARCHITECTURE`,
194
+ and the format `May...?` for questions of focus area
195
+ `IMPLEMENTATION`.
196
+
197
+ In every <question-N-text/>, encode all *literal aspects*
198
+ -- file paths, artifact ids, object kinds, object ids,
199
+ property keys, references, and literal values -- with
200
+ backticks.
201
+
202
+ Keep every <question-N-text/> at most *200 characters* long
203
+ -- compact the text until it fits --, as a longer question
204
+ overflows its table cell and silently degrades the entire
205
+ table into a plain text rendering.
206
+
207
+ 3. DETERMINE CONTEXT:
208
+
209
+ For each question, determine its focus area
210
+ <context-N-focus/> from the mentioned *Focus Areas*, a 1-3
211
+ word hint <context-N-topic/>, describing what the question
212
+ is about, and a <context-N-severity/>, describing how
213
+ important this question is.
214
+
215
+ Set <context-N-id/> to `DOM` for <context-N-focus/> of
216
+ `DOMAIN`, `IFC` for <context-N-focus/> of `INTERFACE`, `ARC`
217
+ for <context-N-focus/> of `ARCHITECTURE`, and `IMP` for
218
+ <context-N-focus/> of `IMPLEMENTATION`.
219
+
220
+ 4. SORT QUESTIONS:
221
+
222
+ Finally, *sort* the questions by descending focus area
223
+ order -- first all `DOMAIN`, then all `INTERFACE`, then all
224
+ `ARCHITECTURE`, and then all `IMPLEMENTATION` ones -- and
225
+ renumber <N/> according to this order, starting at `1`.
226
+ Truncate the list after a maximum of 10 questions and set
227
+ <n/> to the number of remaining questions. Do not output
228
+ anything.
229
+
230
+ Finally, assemble the <question-N/> out of
231
+ `**<question-N-id/>** ▶ **<context-N-id/>** ▷
232
+ **<context-N-topic/>**: <question-N-text/>`.
233
+
234
+ 5. DETERMINE ANSWERS:
235
+
236
+ For all remaining <question-N/>, check the specification and
237
+ your world knowledge to find *two to three* grounded answer
238
+ alternatives <answer-N-K/> with a question-local id
239
+ <answer-N-K-id/> of `A<K/>` -- where <K/> restarts at `1`
240
+ for *every* question, independent of the numbering of other
241
+ questions --, a 1-3 word label <answer-N-K-label/>, and
242
+ an ultra brief description <answer-N-K-description/> of
243
+ at most *10 words*. For the answer which reflects the
244
+ current <todo-what/>/<todo-how/> understanding, append
245
+ ` ⚑` to its <answer-N-K-label/>.
246
+
247
+ Assemble an <answer-N/> out of `**<answer-N-1-id/>**
248
+ ▶ **<answer-N-1-label/>**: <answer-N-1-description/>,
249
+ **<answer-N-2-id/>** ▶ **<answer-N-2-label/>**:
250
+ <answer-N-2-description/>[, ...]`.
251
+
252
+ Keep every assembled <answer-N/> at most *240 characters*
253
+ long -- drop the least relevant alternative and compact the
254
+ descriptions until it fits -- as a longer answer overflows
255
+ its table cell and silently degrades the entire table into a
256
+ plain text rendering.
257
+
258
+ 6. INTERACTIVE DIALOG:
259
+
260
+ In the following, you *MUST* *NOT* use your built-in
261
+ <user-dialog-tool/> tool! Instead, you *MUST* just show a
262
+ custom dialog according to the expanded `custom-dialog`
263
+ definition. You *MUST* closely follow this definition. The
264
+ dialog below carries the two fixed answer options
265
+ `SKIP GRILLING` and `STOP SKILL`, dispatched as follows:
266
+
267
+ - If a <result/> is `SKIP GRILLING` or `CANCEL`, ask no
268
+ further questions, continue with item 7 below (merging
269
+ the answers gathered so far), and after item 8 skip all
270
+ remaining rounds and continue with the *implementing*
271
+ state.
272
+
273
+ - If a <result/> is `STOP SKILL`, only output the
274
+ following <template/> and then immediately *STOP*
275
+ processing the entire current skill:
276
+
277
+ <template>
278
+ ⧉ **ASE**: ✪ skill: **ase-spec-edit**, ▶ status: **editing stopped**
279
+ </template>
280
+
281
+ 1. Output only the following <template/> -- it lists *all*
282
+ questions of the round up-front, one table row per
283
+ aspect, so the subsequent dialog only has to ask for the
284
+ combined answer. Align all column edges of the table.
285
+
286
+ In every table cell you *MUST* escape each literal pipe
287
+ character outside a code span as `\|` and you *MUST*
288
+ open *and* close every backtick code span within the
289
+ *same* cell -- an unescaped pipe or an unbalanced
290
+ backtick run splits the cell and silently degrades the
291
+ entire table into a plain text rendering:
292
+
293
+ <template>
294
+ ⧉ **ASE**: <round-id/>: *Relentless Interviewing Until Clarity*
295
+
296
+ | QUESTION | ANSWERS |
297
+ | ------------- | ----------- |
298
+ | <question-1/> | <answer-1/> |
299
+ | <question-2/> | <answer-2/> |
300
+ | [...] | [...] |
301
+
302
+ Legend: **DOM**: Domain (MUST), **IFC**: Interface (MUST), **ARC**: Architecture (SHOULD), **IMP**: Implementation (MAY)
303
+ **Qn**: round-local question id, **An**: question-local answer id, ⚑: current decision state
304
+ </template>
305
+
306
+ 2. Show a custom dialog. Its only answer options are the
307
+ two fixed ones, so the user normally answers all aspects in
308
+ *one* free-text reply:
309
+
310
+ <expand name="custom-dialog" arg1="--other">
311
+ <round-id/>: What is your (combined) answer to all (or a subset) of the above questions? (keywords or `Qn:An` references are sufficient)
312
+ SKIP GRILLING: skip all remaining grilling and continue with the implementation
313
+ STOP SKILL: stop the entire skill immediately
314
+ </expand>
315
+
316
+ Dispatch `SKIP GRILLING`, `STOP SKILL`, and `CANCEL` as
317
+ defined above. Otherwise, strip any leading `OTHER: `
318
+ prefix from <result/> and treat the remainder as the
319
+ combined free-text answers to all questions of the
320
+ round.
321
+
322
+ 7. MERGE ANSWERS INTO TODO:
323
+
324
+ Merge all gathered answers in <result/> of the round -- the
325
+ combined reply -- *exclusively* back into <todo-what/> and
326
+ <todo-how/>. Do not output anything.
327
+
328
+ 8. SHOW CURRENT TODO:
329
+
330
+ Set <round-suffix/> to
331
+ ` round <m/>/<getopt-option-grill-rounds/>` if
332
+ <getopt-option-grill-rounds/> is greater than 1, or to
333
+ empty otherwise, and expand the following -- this
334
+ intentionally closes *every* round, so the intermediate
335
+ <todo-what/>/<todo-how/> states stay visible:
336
+
337
+ <expand name="todo-box" arg1="current state (after grilling<round-suffix/>)"></expand>
338
+
339
+ 6. **State: implementing:**
340
+
341
+ 1. You *MUST* first forget all previous internalized tenets and
342
+ then freshly internalize and strictly honor the **GENERIC
343
+ TENETS** and the **SPECIFYING TENETS** of the **ASE Tenets** in
344
+ the following creation and updating of specification content. Do
345
+ not output anything.
346
+
347
+ 2. <if condition="<getopt-option-worktree/> is equal `true` and <worktree-dir/> is empty">
348
+
349
+ One *single* worktree serves the whole skill run: it is created
350
+ *once* before the first change set is applied, and all further
351
+ `--loop` iterations land in it, too.
352
+
353
+ 1. Set <worktree-name/> to a unique name, derived from
354
+ <todo-what/>, which consists of two lower-case words
355
+ concatenated with a `-` character. Do not output anything.
356
+
357
+ 2. Determine the *worktree directory* by calling the
358
+ `ase_worktree_path(id: "<worktree-name/>", create: true)`
359
+ tool of the `ase` MCP server and capturing its output into
360
+ <worktree-dir/>. You *MUST* *NEVER* assemble this path
361
+ yourself. If this tool call fails, only output the following
362
+ <template/> and then immediately *STOP* processing the
363
+ entire current skill, leaving the working copy *untouched*:
364
+
365
+ <template>
366
+ ⧉ **ASE**: ✪ skill: **ase-spec-edit**, ▶ ERROR: no Git repository or unsafe worktree directory -- cannot create worktree
367
+ </template>
368
+
369
+ 3. Determine the *existing worktrees* and *existing branches*
370
+ by running the commands `git worktree list --porcelain` and
371
+ `git branch --list` (taken exactly as given) and capturing
372
+ their outputs. If the worktree directory <worktree-dir/> or
373
+ the branch <worktree-name/> already exists, only output the
374
+ following <template/> and then immediately *STOP* processing
375
+ the entire current skill, leaving the existing worktree, its
376
+ branch, and the working copy *untouched*:
377
+
378
+ <template>
379
+ ⧉ **ASE**: ✪ skill: **ase-spec-edit**, ▶ ERROR: worktree or branch **<worktree-name/>** already exists
380
+ </template>
381
+
382
+ 4. Create the worktree by running the command
383
+ `git worktree add "<worktree-dir/>"` (taken exactly as
384
+ given), which creates the directory *and* -- named after its
385
+ last path component -- the branch <worktree-name/> from
386
+ `HEAD`. If this command fails, only output the following
387
+ <template/> and then immediately *STOP* processing the
388
+ entire current skill, leaving the working copy *untouched*:
389
+
390
+ <template>
391
+ ⧉ **ASE**: ✪ skill: **ase-spec-edit**, ▶ ERROR: worktree **<worktree-name/>** failed to create
392
+ </template>
393
+
394
+ 5. Only output the following <template/>:
395
+
396
+ <template>
397
+ ⧉ **ASE**: ✪ skill: **ase-spec-edit**, ◉ worktree: **.ase/worktree/<worktree-name/>**, ▶ status: **worktree created**
398
+ </template>
399
+
400
+ </if>
401
+
402
+ 3. Call the `ase_timestamp(format: "yyyy-LL-dd HH:mm")` tool of the
403
+ `ase` MCP server *once* to find out the current time and store
404
+ it in <timestamp-modified/>. Do not output anything.
405
+
406
+ 4. Apply the edit by modifying the affected `SPEC` *artifacts* with
407
+ a corresponding, complete *change set*, honoring *only*
408
+ <todo-what/> and <todo-how/> plus the information gathered in
409
+ the *discovering* state.
410
+
411
+ The change set *MUST* keep every touched artifact conformant to
412
+ the `SPEC` format contract (`ase-format-spec.md`): the
413
+ `Created:`/`Modified:` frontmatter block, the heading levels,
414
+ the Complex/Concise/Grouped format variants, the schema-allowed
415
+ object kinds, nestings, and property keys, the object ids and
416
+ `{{<id/>}}` anchors, the `, BECAUSE ` rationale split, and the
417
+ `[[xxx]]` references.
418
+
419
+ *Generate* a `SPEC` artifact which does not yet exist but is
420
+ warranted by the edit, using <timestamp-modified/> for both its
421
+ `Created:` and `Modified:` timestamps. Whenever an *existing*
422
+ artifact is changed and carries a `Modified:
423
+ <timestamp-modified-old/>` line, replace this with `Modified:
424
+ <timestamp-modified/>`.
425
+
426
+ Also, if a `CHANGELOG.md` file exists, make an appropriate entry
427
+ there, too.
428
+
429
+ <if condition="<worktree-dir/> is not empty">
430
+ The change set *MUST* land *exclusively inside* the worktree
431
+ <worktree-dir/>: resolve *every* file path relative to
432
+ <worktree-dir/> instead of the original working copy. You *MUST*
433
+ *NEVER* modify, stage, stash, revert, or commit anything
434
+ *outside* of this worktree. Leave the worktree *uncommitted*:
435
+ do *not* run `git add` and do *not* run `git commit`, so the
436
+ user keeps full control over the final commit.
437
+ </if>
438
+
439
+ 5. Output only the following <template/>. You *MUST* *NOT* output a
440
+ change summary, a list of modified artifacts, a rationale, or a
441
+ unified diff of the changes -- *independent* of
442
+ <ase-project-boxing/>, whose exposure rules are explicitly
443
+ *overridden* here:
444
+
445
+ <template>
446
+ ⧉ **ASE**: ✪ skill: **ase-spec-edit**, ▶ status: **changes applied**
447
+ </template>
448
+
449
+ 7. **State: verifying:**
450
+
451
+ Enter this state only if <getopt-option-verify/> is equal `true`.
452
+ Otherwise you *MUST* *strictly skip* the entire state and *any*
453
+ verification: do *NOT* validate the specification at all and do
454
+ *NOT* run any build, tests, linter, or type-checker.
455
+
456
+ 1. Validate the specification and capture its <diagnostics/> array
457
+ of `{ file, line, column, message }` objects:
458
+
459
+ <if condition="<worktree-dir/> is not empty">
460
+ Run the command `ase spec lint` with <worktree-dir/> as its
461
+ working directory and parse its
462
+ `<file/>:<line/>:<column/>: <message/>` output lines into
463
+ <diagnostics/> -- the `ase_specbook_lint` tool always validates
464
+ the *project* working copy and hence *MUST* *NOT* be used here.
465
+ </if>
466
+ <else>
467
+ Call the `ase_specbook_lint()` tool of the `ase` MCP server and
468
+ read its returned `diagnostics` array into <diagnostics/>.
469
+ </else>
470
+
471
+ 2. If <diagnostics/> is not empty, fix the reported problems in the
472
+ affected `SPEC` artifacts via the `Edit`/`Write` tools and
473
+ re-validate as in item 7.1 -- for at most *three* rounds in
474
+ total.
475
+
476
+ 3. <if condition="<diagnostics/> is not empty after the last round">
477
+
478
+ Only output the following <template/>, listing one bullet line
479
+ per remaining diagnostic:
480
+
481
+ <template>
482
+ ⧉ **ASE**: ✪ skill: **ase-spec-edit**, ▶ status: **verification failed**
483
+
484
+ <ase-tpl-bullet-signal/> **REMAINING DIAGNOSTICS**:
485
+
486
+ - `<file/>:<line/>:<column/>`: <message/>
487
+ [...]
488
+ </template>
489
+
490
+ </if>
491
+ <else>
492
+
493
+ Only output the following <template/>:
494
+
495
+ <template>
496
+ ⧉ **ASE**: ✪ skill: **ase-spec-edit**, ▶ status: **verification passed**
497
+ </template>
498
+
499
+ </else>
500
+
501
+ 8. **Loop or Finish:**
502
+
503
+ <if condition="<getopt-option-loop/> is equal `true`">
504
+ Continue with the *next* iteration at the *querying* state
505
+ (item 3 above). Do not output anything in this item.
506
+ </if>
507
+ <else>
508
+ Finish the skill processing, but first give the closing hints by
509
+ expanding the following (which, depending on the configured
510
+ <ase-guidance-level/>, may each expand into nothing and hence emit
511
+ no output at all):
512
+
513
+ <ase-tpl-hint level="normal">
514
+ Use `/ase-sync-reconcile -s SPEC` to propagate the specification changes into the remaining artifact kinds, and `/ase-sync-export` to re-materialize the derived export files.
515
+ </ase-tpl-hint>
516
+
517
+ <ase-tpl-hint level="verbose">
518
+ Use `/ase-spec-edit --grill` to stress-test the query first, `--verify` to validate the specification afterwards, and `--loop` to chain several edits.
519
+ </ase-tpl-hint>
520
+ </else>
@@ -0,0 +1,130 @@
1
+
2
+ ## NAME
3
+
4
+ `ase-spec-edit` - Edit Specification
5
+
6
+ ## SYNOPSIS
7
+
8
+ `ase-spec-edit`
9
+ [`--help`|`-h`]
10
+ [`--grill`|`-g`]
11
+ [`--grill-rounds`|`-r` *n*]
12
+ [`--verify`|`-v`]
13
+ [`--worktree`|`-w`]
14
+ [`--loop`|`-l`]
15
+ [*query*]
16
+
17
+ ## DESCRIPTION
18
+
19
+ The `ase-spec-edit` skill edits the *SpecBook*-based specification
20
+ (`SPEC`) *directly* from a *query*, in one shot and without any task
21
+ plan ceremony. It is the specification-level counterpart of
22
+ `ase-code-edit` and a *plan-less* alternative to `ase-sync-import` and
23
+ `ase-sync-reconcile` whenever the specification has to be changed from a
24
+ plain description instead of from a foreign source or another artifact
25
+ kind.
26
+
27
+ Each single-shot run (or each `--loop` iteration) walks through five
28
+ states: *querying* (take the *query* argument or ask for a query via an
29
+ interactive `Edit Query` dialog, and split it into its domain-specific
30
+ WHAT and its implementation-detail HOW parts), *discovering* (resolve
31
+ the `SPEC` artifacts, read the *SpecBook* schema configuration of the
32
+ project, and read the specification artifacts related to the query),
33
+ *grilling* (optionally stress-test the query with rounds of questions),
34
+ *implementing* (apply the change set in place, honoring the GENERIC and
35
+ SPECIFYING tenets and the `SPEC` format contract), and *verifying*
36
+ (optionally validate the specification until it passes). The *querying*
37
+ state and every *grilling* round close with an `EDIT TODO` box showing
38
+ the established `WHAT` and `HOW` information.
39
+
40
+ The change set stays strictly restricted to the `SPEC` artifacts -- the
41
+ artifact kinds `CODE`, `DOCS`, `TASK`, `INFR`, and `OTHR` are never
42
+ touched. Every generated artifact carries the current `Created:` and
43
+ `Modified:` timestamps, and every changed artifact gets its `Modified:`
44
+ timestamp refreshed.
45
+
46
+ ## OPTIONS
47
+
48
+ `--grill`|`-g`:
49
+ Grill the query before implementing, similar to `ase-task-grill`:
50
+ raise 1-10 questions per round which resolve the open points of the
51
+ query. Each question carries a `FOCUS-AREA` -- `DOMAIN`
52
+ (domain-specifics, must be clarified), `INTERFACE` (externally
53
+ observable behavior or UI/API interfaces, must be clarified),
54
+ `ARCHITECTURE` (structure, wiring, placement, or dependencies,
55
+ should be clarified), or `IMPLEMENTATION` (inner technical details,
56
+ can be clarified) -- and a 1-3 word `TOPIC` hint. The questions of a
57
+ round are sorted by descending focus area importance (`DOMAIN`,
58
+ `INTERFACE`, `ARCHITECTURE`, `IMPLEMENTATION`) and are announced
59
+ together below a `GRILLING ROUND K/L` line (the round numbering is
60
+ omitted when only a single round is performed) as a
61
+ `QUESTION`/`ANSWERS` table with one row per question, each row
62
+ carrying two to three grounded answer alternatives (with the
63
+ alternative reflecting the current understanding marked with `⚑`).
64
+ They are then asked in *one* batch via a single interactive dialog,
65
+ whose question asks for the combined answer to all (or a subset) of
66
+ the listed questions and whose only answer options are the fixed
67
+ `SKIP GRILLING` (skip the remaining grilling) and `STOP SKILL` (stop
68
+ the skill) ones, plus free-text input. The answers are merged back
69
+ into the WHAT and HOW parts of the query. Without `--grill`, no
70
+ questions are asked at all.
71
+
72
+ `--grill-rounds`|`-r` *n*:
73
+ The number of grill rounds to apply (default: `1`). Each round
74
+ starts from scratch from only the current WHAT and HOW parts,
75
+ forgetting all information of previous rounds, and closes with an
76
+ `EDIT TODO` box. Only effective together with `--grill`.
77
+
78
+ `--verify`|`-v`:
79
+ Verify the edited specification by validating it via *SpecBook*
80
+ linting and fixing the reported diagnostics in the affected `SPEC`
81
+ artifacts, for at most three rounds. Any diagnostics remaining after
82
+ the last round are listed as `REMAINING DIAGNOSTICS`. Without
83
+ `--verify`, strictly no validation is performed at all.
84
+
85
+ `--worktree`|`-w`:
86
+ Apply the change sets inside a dedicated Git worktree (as
87
+ `ase-task-implement --worktree`) instead of the current working
88
+ copy. One single worktree, named by a two-word id derived from the
89
+ first query, serves the whole skill run: all `--loop` iterations
90
+ land in it and it is left uncommitted for review. Under `--verify`,
91
+ the validation then runs as the `ase spec lint` command inside the
92
+ worktree.
93
+
94
+ `--loop`|`-l`:
95
+ Loop the whole state cycle: after each iteration, ask for the next
96
+ edit query via the interactive `Edit Query` dialog and repeat, until
97
+ the user answers with its fixed `STOP SKILL` option or cancels the
98
+ dialog.
99
+
100
+ ## ARGUMENTS
101
+
102
+ *query*:
103
+ Description of the specification edit to perform. When omitted, the
104
+ skill asks for the query via an interactive `Edit Query` dialog,
105
+ carrying the fixed `STOP SKILL` option plus free-text input.
106
+
107
+ ## EXAMPLES
108
+
109
+ Edit in one shot, without any questions or validation:
110
+
111
+ ```text
112
+ ❯ /ase-spec-edit add a Reviewer persona to the persona model
113
+ ```
114
+
115
+ Grill the query with two rounds first, then edit and validate:
116
+
117
+ ```text
118
+ ❯ /ase-spec-edit -g -r 2 -v split the Event entity into Event and EventSeries
119
+ ```
120
+
121
+ Loop over multiple specification edits inside a dedicated Git worktree:
122
+
123
+ ```text
124
+ ❯ /ase-spec-edit -l -w
125
+ ```
126
+
127
+ ## SEE ALSO
128
+
129
+ [`ase-code-edit`](../ase-code-edit/help.md), [`ase-sync-import`](../ase-sync-import/help.md), [`ase-sync-reconcile`](../ase-sync-reconcile/help.md),
130
+ [`ase-sync-export`](../ase-sync-export/help.md), [`ase-task-grill`](../ase-task-grill/help.md).