@rse/ase 2.0.6 → 2.0.8
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.
- package/dst/ase-agent-definition-api.d.ts +2 -0
- package/dst/ase-agent-definition-core.js +24 -3
- package/dst/ase-agent-fleet.js +2 -1
- package/dst/ase-agent-relay-client.js +3 -4
- package/dst/ase-agent-runtime-engine.js +22 -4
- package/dst/ase-agent-runtime-tool.js +10 -8
- package/dst/ase-agent-runtime.js +8 -4
- package/dst/ase-config-schema.js +4 -1
- package/dst/ase-lib-fetch.js +12 -0
- package/dst/ase-lib-server-cli.js +8 -5
- package/dst/ase-man-catalog.js +1 -1
- package/dst/ase-task-board-diff.js +120 -0
- package/dst/ase-task-board-tui-control.js +8 -5
- package/dst/ase-task-board-tui-model.js +54 -14
- package/dst/ase-task-board-tui-popup.js +41 -8
- package/dst/ase-task-board-tui.js +42 -27
- package/dst/ase-task-board-web-client.css +1 -1
- package/dst/ase-task-board-web-client.html +16 -0
- package/dst/ase-task-board-web-client.js +33 -33
- package/dst/ase-task-board-web-server.js +44 -9
- package/dst/ase-task-board.js +12 -4
- package/dst/ase-task-store-client.js +4 -5
- package/dst/ase-task-store-plugin-gitea.js +3 -3
- package/dst/man/ase-agent-adhoc.md +25 -6
- package/dst/man/ase-agent-condenser.md +7 -0
- package/dst/man/ase-agent-editor.md +7 -0
- package/dst/man/ase-agent-estimator.md +7 -0
- package/dst/man/ase-agent-fleet.md +7 -4
- package/dst/man/ase-agent-implementer.md +7 -0
- package/dst/man/ase-agent-integrator.md +7 -0
- package/dst/man/ase-agent-qualifier.md +7 -0
- package/dst/man/ase-agent-rebooter.md +7 -0
- package/dst/man/ase-agent-researcher.md +7 -0
- package/dst/man/ase-config-init.md +2 -1
- package/dst/man/ase-config.md +5 -0
- package/dst/man/ase-task-board.md +44 -2
- package/package.json +11 -10
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/.codex-plugin/plugin.json +1 -1
- package/plugin/.github/plugin/plugin.json +1 -1
- package/plugin/meta/ase-common-task.md +33 -1
- package/plugin/meta/ase-control.md +14 -0
- package/plugin/meta/ase-format-specbook.yaml +9 -9
- package/plugin/meta/ase-skill.md +7 -0
- package/plugin/mods/ase-mods-common.ts +73 -42
- package/plugin/mods/ase-mods-help-hint.ts +1 -1
- package/plugin/mods/ase-mods-task-edit.ts +427 -0
- package/plugin/mods/ase-mods.ts +45 -14
- package/plugin/skills/ase-code-edit/SKILL.md +53 -16
- package/plugin/skills/ase-code-edit/help.md +26 -13
- package/plugin/skills/ase-code-lint/SKILL.md +7 -3
- package/plugin/skills/ase-help-intent/data.md +248 -36
- package/plugin/skills/ase-help-skill/catalog.md +1 -0
- package/plugin/skills/ase-meta-workflow/workflow.txt +2 -0
- package/plugin/skills/ase-repo-changelog/SKILL.md +29 -10
- package/plugin/skills/ase-repo-changelog/help.md +5 -1
- package/plugin/skills/ase-repo-commit/SKILL.md +4 -1
- package/plugin/skills/ase-repo-dissect/help.md +2 -1
- package/plugin/skills/ase-repo-stage/SKILL.md +459 -0
- package/plugin/skills/ase-repo-stage/help.md +120 -0
- package/plugin/skills/ase-spec-edit/SKILL.md +20 -12
- package/plugin/skills/ase-spec-edit/help.md +22 -14
- package/plugin/skills/ase-task-edit/SKILL.md +114 -9
- package/plugin/skills/ase-task-edit/help.md +60 -0
- package/plugin/skills/ase-task-grill/SKILL.md +35 -20
- package/plugin/skills/ase-task-grill/help.md +18 -8
- /package/plugin/mods/{ase-mods-evaluate.ts → ase-mods-meta-evaluate.ts} +0 -0
- /package/plugin/mods/{ase-mods-grill.ts → ase-mods-task-grill.ts} +0 -0
|
@@ -15,7 +15,7 @@ The `ase-repo-changelog` skill helps to *complete*, *consolidate*, and
|
|
|
15
15
|
file, based on the underlying *Git* commits and the currently staged
|
|
16
16
|
changes in the Git *index*.
|
|
17
17
|
|
|
18
|
-
Each entry
|
|
18
|
+
Each entry starts with `<change-type> [<artifact-kind>]: <summary>`
|
|
19
19
|
where *change-type* is one of `FEATURE`, `IMPROVEMENT`, `BUGFIX`,
|
|
20
20
|
`UPDATE`, `CLEANUP`, or `REFACTOR`, and *artifact-kind* is one or more
|
|
21
21
|
comma-separated *artifact class* tags out of `spec`, `code`, `docs`,
|
|
@@ -23,6 +23,10 @@ comma-separated *artifact class* tags out of `spec`, `code`, `docs`,
|
|
|
23
23
|
prefix. The date in the section header is also updated to the current
|
|
24
24
|
date.
|
|
25
25
|
|
|
26
|
+
The layout of the entries follows the style of the existing entries
|
|
27
|
+
of the file (e.g. a single line, a title line plus an explaining body,
|
|
28
|
+
or a wrapped sentence), and each entry is kept within about 5 lines.
|
|
29
|
+
|
|
26
30
|
## SCENARIOS
|
|
27
31
|
|
|
28
32
|
- You want the `CHANGELOG.md` brought up to date with recent commits
|
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
name: ase-repo-commit
|
|
3
3
|
argument-hint: "[--help|-h]"
|
|
4
4
|
description: >
|
|
5
|
-
Determine commit message for staged Git changes.
|
|
5
|
+
Determine commit message for staged Git changes. Use when the user
|
|
6
|
+
asks to "give", "write", "craft", "suggest", or "propose" a "commit
|
|
7
|
+
message", or wants to know how to "describe" or "phrase" the staged
|
|
8
|
+
changes for a commit.
|
|
6
9
|
user-invocable: true
|
|
7
10
|
disable-model-invocation: false
|
|
8
11
|
effort: medium
|
|
@@ -123,4 +123,5 @@ Dissect the changes along an explicitly given axis:
|
|
|
123
123
|
## SEE ALSO
|
|
124
124
|
|
|
125
125
|
[`ase-task-dissect`](../ase-task-dissect/help.md), [`ase-repo-diff`](../ase-repo-diff/help.md), [`ase-repo-review`](../ase-repo-review/help.md),
|
|
126
|
-
[`ase-repo-changelog`](../ase-repo-changelog/help.md), [`ase-repo-commit`](../ase-repo-commit/help.md)
|
|
126
|
+
[`ase-repo-changelog`](../ase-repo-changelog/help.md), [`ase-repo-commit`](../ase-repo-commit/help.md),
|
|
127
|
+
[`ase-repo-stage`](../ase-repo-stage/help.md).
|
|
@@ -0,0 +1,459 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ase-repo-stage
|
|
3
|
+
argument-hint: "[--help|-h] [--entry|-e] [--turn|-t] [--session|-s] [--merge|-m] [--no-verify|-V] [--worktree|-w] [--changelog|-c] [--commit|-C] [<topic>]"
|
|
4
|
+
description: >
|
|
5
|
+
Stage only the part of the current Git working copy changes which
|
|
6
|
+
belongs to a topic, to the last `CHANGELOG.md` entry, to the last
|
|
7
|
+
turn, or to the entire session, by picking and, if necessary,
|
|
8
|
+
splitting hunks, check that the staged state builds on its own,
|
|
9
|
+
and optionally chain into ChangeLog updating and commit message
|
|
10
|
+
crafting. Use when the user calls to "stage" only a part of the
|
|
11
|
+
changes, like "the hunks related to" a topic or "the last turn".
|
|
12
|
+
user-invocable: true
|
|
13
|
+
disable-model-invocation: false
|
|
14
|
+
effort: high
|
|
15
|
+
allowed-tools:
|
|
16
|
+
- "Bash(git *)"
|
|
17
|
+
- "Bash(find *)"
|
|
18
|
+
- "Bash(ln -s *)"
|
|
19
|
+
- "Bash(rm -f *)"
|
|
20
|
+
- "Write"
|
|
21
|
+
- "Read"
|
|
22
|
+
- "Skill"
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
@${CLAUDE_SKILL_DIR}/../../meta/ase-control.md
|
|
26
|
+
@${CLAUDE_SKILL_DIR}/../../meta/ase-skill.md
|
|
27
|
+
@${CLAUDE_SKILL_DIR}/../../meta/ase-getopt.md
|
|
28
|
+
|
|
29
|
+
<purpose name="ase-repo-stage">
|
|
30
|
+
Stage a Part of the Changes
|
|
31
|
+
</purpose>
|
|
32
|
+
|
|
33
|
+
<expand name="getopt"
|
|
34
|
+
arg1="ase-repo-stage"
|
|
35
|
+
arg2="--entry|-e --turn|-t --session|-s --merge|-m --no-verify|-V --worktree|-w --changelog|-c --commit|-C">
|
|
36
|
+
$ARGUMENTS
|
|
37
|
+
</expand>
|
|
38
|
+
|
|
39
|
+
<objective>
|
|
40
|
+
*Stage* only the part of the current Git working copy changes which
|
|
41
|
+
belongs to a *selection* -- a topic, the last `CHANGELOG.md` entry, the
|
|
42
|
+
last turn, or the entire session -- by picking and, if necessary,
|
|
43
|
+
*splitting* hunks, and *check* that the staged state builds on its own.
|
|
44
|
+
</objective>
|
|
45
|
+
|
|
46
|
+
Procedure
|
|
47
|
+
---------
|
|
48
|
+
|
|
49
|
+
Throughout the entire skill, you *MUST* *NEVER* modify the *content* of
|
|
50
|
+
any working copy file yourself: only the Git *index* is changed, the
|
|
51
|
+
working copy is only *temporarily* stashed and restored by STEP 4, and
|
|
52
|
+
only the chained `ase-repo-changelog` skill of STEP 5 may edit a file.
|
|
53
|
+
|
|
54
|
+
Whenever this skill *stops early* after STEP 1.5, first *undo* the
|
|
55
|
+
intent-to-add marks of all files of <intent-files/> which carry no
|
|
56
|
+
staged content by running the corresponding command (taken exactly as
|
|
57
|
+
given) per file: `git reset -q -- "<file/>"`.
|
|
58
|
+
|
|
59
|
+
<flow>
|
|
60
|
+
|
|
61
|
+
1. <step id="STEP 1: Determine Selection and Change Set">
|
|
62
|
+
|
|
63
|
+
1. Set <topic><getopt-arguments/></topic>, with any leading and
|
|
64
|
+
trailing whitespace stripped. If *more than one* of
|
|
65
|
+
<getopt-option-entry/>, <getopt-option-turn/>, and
|
|
66
|
+
<getopt-option-session/> is equal `true`, only output the
|
|
67
|
+
following <template/> and then immediately *STOP*:
|
|
68
|
+
|
|
69
|
+
<template>
|
|
70
|
+
⧉ **ASE**: ✪ skill: **ase-repo-stage**, ▶ ERROR: options `--entry`, `--turn`, and `--session` are mutually exclusive
|
|
71
|
+
</template>
|
|
72
|
+
|
|
73
|
+
2. Determine the *selection mode* <mode/>: set it to `entry`,
|
|
74
|
+
`turn`, or `session` if the corresponding option is equal
|
|
75
|
+
`true`. Otherwise, *infer* it from <topic/>: set it to `turn`
|
|
76
|
+
if <topic/> refers to the changes of the last (or previous)
|
|
77
|
+
turn, to `session` if it refers to all changes of the current
|
|
78
|
+
session, to `entry` if it refers to the last ChangeLog entry,
|
|
79
|
+
and in all these cases strip the referring words from <topic/>.
|
|
80
|
+
Otherwise, set it to `topic`. An explicitly given option always
|
|
81
|
+
*overrides* the inference, and a remaining non-empty <topic/>
|
|
82
|
+
always *narrows* the modes `entry`, `turn`, and `session`.
|
|
83
|
+
|
|
84
|
+
If <mode/> is `topic` and <topic/> is empty, only output the
|
|
85
|
+
following <template/> and then immediately *STOP*:
|
|
86
|
+
|
|
87
|
+
<template>
|
|
88
|
+
⧉ **ASE**: ✪ skill: **ase-repo-stage**, ▶ ERROR: no selection given -- neither a topic nor `--entry`, `--turn`, or `--session`
|
|
89
|
+
</template>
|
|
90
|
+
|
|
91
|
+
Otherwise, set <selection/> to a brief rendering of <mode/> and
|
|
92
|
+
<topic/> (like `topic "<topic/>"`, `last ChangeLog entry`, `last
|
|
93
|
+
turn`, or `session, narrowed to "<topic/>"`) and only output the
|
|
94
|
+
following <template/>:
|
|
95
|
+
|
|
96
|
+
<template>
|
|
97
|
+
⧉ **ASE**: ✪ skill: **ase-repo-stage**, ⇌ selection: **<selection/>**
|
|
98
|
+
</template>
|
|
99
|
+
|
|
100
|
+
3. Determine the *repository root* by running the corresponding
|
|
101
|
+
command (taken exactly as given) and capturing its output into
|
|
102
|
+
<repo-root/>. If this command fails, only output the following
|
|
103
|
+
<template/> and then immediately *STOP*:
|
|
104
|
+
|
|
105
|
+
`git rev-parse --show-toplevel`
|
|
106
|
+
|
|
107
|
+
<template>
|
|
108
|
+
⧉ **ASE**: ✪ skill: **ase-repo-stage**, ▶ ERROR: no Git repository
|
|
109
|
+
</template>
|
|
110
|
+
|
|
111
|
+
4. <if condition="<getopt-option-merge/> is not equal `true`">
|
|
112
|
+
The selection *replaces* the current index content. Determine
|
|
113
|
+
the staged and the unstaged files by running the corresponding
|
|
114
|
+
commands (taken exactly as given):
|
|
115
|
+
|
|
116
|
+
`git -C "<repo-root/>" -c core.quotepath=off diff --cached --name-only`
|
|
117
|
+
|
|
118
|
+
`git -C "<repo-root/>" -c core.quotepath=off diff --name-only`
|
|
119
|
+
|
|
120
|
+
If a file occurs in *both* lists, its staged version exists
|
|
121
|
+
*nowhere else* and would be lost by resetting the index, so only
|
|
122
|
+
output the following <template/> and then immediately *STOP*,
|
|
123
|
+
leaving everything untouched:
|
|
124
|
+
|
|
125
|
+
<template>
|
|
126
|
+
⧉ **ASE**: ✪ skill: **ase-repo-stage**, ▶ ERROR: files with both staged and unstaged changes -- use `--merge` or commit the staged changes first
|
|
127
|
+
</template>
|
|
128
|
+
|
|
129
|
+
Otherwise, if the first list is not empty, *unstage* everything
|
|
130
|
+
by running the corresponding command (taken exactly as given),
|
|
131
|
+
which leaves the working copy untouched:
|
|
132
|
+
|
|
133
|
+
`git -C "<repo-root/>" reset -q`
|
|
134
|
+
</if>
|
|
135
|
+
<else>
|
|
136
|
+
The selection is staged *on top* of the current index content,
|
|
137
|
+
which hence stays untouched. Do not output anything.
|
|
138
|
+
</else>
|
|
139
|
+
|
|
140
|
+
5. Determine the *untracked files* by running the corresponding
|
|
141
|
+
command (taken exactly as given), skipping every entry below the
|
|
142
|
+
`.ase/` directory, as it carries *ASE*'s own state:
|
|
143
|
+
|
|
144
|
+
`git -C "<repo-root/>" -c core.quotepath=off ls-files --others --exclude-standard`
|
|
145
|
+
|
|
146
|
+
Set <intent-files/> to the remaining files and mark each of them
|
|
147
|
+
as *intent-to-add* by running the corresponding command (taken
|
|
148
|
+
exactly as given), so its content shows up as an ordinary,
|
|
149
|
+
splittable creation diff:
|
|
150
|
+
|
|
151
|
+
`git -C "<repo-root/>" add -N -- "<file/>"`
|
|
152
|
+
|
|
153
|
+
6. Determine the *diff details* and the *diff statistics* of the
|
|
154
|
+
working copy against the index by running the corresponding
|
|
155
|
+
commands (taken exactly as given) and capturing their full
|
|
156
|
+
outputs into <diff/> and <stat/>:
|
|
157
|
+
|
|
158
|
+
`git -C "<repo-root/>" diff --binary`
|
|
159
|
+
|
|
160
|
+
`git -C "<repo-root/>" diff --numstat`
|
|
161
|
+
|
|
162
|
+
<if condition="<diff/> is empty">
|
|
163
|
+
Only output the following <template/> and then *STOP*:
|
|
164
|
+
|
|
165
|
+
<template>
|
|
166
|
+
⧉ **ASE**: ✪ skill: **ase-repo-stage**, ▶ status: **no changes to stage**
|
|
167
|
+
</template>
|
|
168
|
+
</if>
|
|
169
|
+
|
|
170
|
+
</step>
|
|
171
|
+
|
|
172
|
+
2. <step id="STEP 2: Select Changes">
|
|
173
|
+
|
|
174
|
+
1. Determine the *selected changes* -- the changed *lines* of
|
|
175
|
+
<diff/> which belong to the selection -- according to <mode/>:
|
|
176
|
+
|
|
177
|
+
- `topic`: the changes which semantically belong to <topic/>.
|
|
178
|
+
|
|
179
|
+
- `entry`: the changes which realize the *last* ChangeLog
|
|
180
|
+
entry, i.e. the entry added or modified by the *uncommitted*
|
|
181
|
+
change of the `CHANGELOG.md` file in <diff/> (if several,
|
|
182
|
+
the one <topic/> names, else the last one in file order),
|
|
183
|
+
*plus* the lines of this entry itself. If <diff/> adds or
|
|
184
|
+
modifies no such entry, only output the following
|
|
185
|
+
<template/> and then *STOP*:
|
|
186
|
+
|
|
187
|
+
<template>
|
|
188
|
+
⧉ **ASE**: ✪ skill: **ase-repo-stage**, ▶ ERROR: no uncommitted `CHANGELOG.md` entry found
|
|
189
|
+
</template>
|
|
190
|
+
|
|
191
|
+
- `turn` resp. `session`: the changes made by your *own*
|
|
192
|
+
file-modifying tool calls (like `Edit` and `Write`) of the
|
|
193
|
+
*last* turn before this skill invocation resp. of the
|
|
194
|
+
*entire* current session, as carried by the conversation
|
|
195
|
+
context. If the context carries no such modifications which
|
|
196
|
+
are still part of <diff/>, only output the following
|
|
197
|
+
<template/> and then *STOP*:
|
|
198
|
+
|
|
199
|
+
<template>
|
|
200
|
+
⧉ **ASE**: ✪ skill: **ase-repo-stage**, ▶ ERROR: no changes of the <mode/> found in the conversation context
|
|
201
|
+
</template>
|
|
202
|
+
|
|
203
|
+
For the modes `entry`, `turn`, and `session`, a non-empty
|
|
204
|
+
<topic/> additionally *narrows* the selected changes to those
|
|
205
|
+
which semantically belong to <topic/>.
|
|
206
|
+
|
|
207
|
+
2. Keep *mutually dependent* changes together: if a selected
|
|
208
|
+
change only builds together with an unselected one (like a use
|
|
209
|
+
and its import or declaration), select the latter, too, and
|
|
210
|
+
mention it in its file summary of STEP 3.
|
|
211
|
+
|
|
212
|
+
3. Set <n-files/>, <n-hunks/>, and <n-split/> to the number of
|
|
213
|
+
files, hunks, and *partially* selected hunks with selected
|
|
214
|
+
changes. A binary file diff is never split, so it is either
|
|
215
|
+
selected entirely or not at all.
|
|
216
|
+
|
|
217
|
+
<if condition="no changes were selected">
|
|
218
|
+
Only output the following <template/> and then *STOP*:
|
|
219
|
+
|
|
220
|
+
<template>
|
|
221
|
+
⧉ **ASE**: ✪ skill: **ase-repo-stage**, ▶ status: **nothing selected for staging**
|
|
222
|
+
</template>
|
|
223
|
+
</if>
|
|
224
|
+
|
|
225
|
+
</step>
|
|
226
|
+
|
|
227
|
+
3. <step id="STEP 3: Stage Changes">
|
|
228
|
+
|
|
229
|
+
1. Set <tmp-dir/> to the value of the `TMPDIR` environment variable
|
|
230
|
+
if it is known in the current session context, and to `/tmp`
|
|
231
|
+
otherwise. Do not output anything.
|
|
232
|
+
|
|
233
|
+
2. Assemble <patch/> from <diff/>: keep the complete `diff --git`
|
|
234
|
+
file headers and the `@@` hunk headers of all files and hunks
|
|
235
|
+
with selected changes, and drop all others. Keep an *entirely*
|
|
236
|
+
selected hunk *verbatim*. Turn a *partially* selected hunk into
|
|
237
|
+
a sub-hunk, exactly like an edited hunk of `git add -p`: keep
|
|
238
|
+
its context lines and its selected `+` and `-` lines, turn every
|
|
239
|
+
*unselected* `-` line into a context line by replacing its
|
|
240
|
+
leading `-` by a space, and drop every *unselected* `+` line.
|
|
241
|
+
Its `@@` header stays unchanged, as `--recount` fixes its counts.
|
|
242
|
+
|
|
243
|
+
Besides these marker changes, <patch/> stays *byte-exact*: you
|
|
244
|
+
*MUST* *NEVER* re-wrap, re-indent, or re-encode a line, normalize
|
|
245
|
+
or strip trailing whitespace, omit the trailing newline, or
|
|
246
|
+
re-render any part of it as Markdown.
|
|
247
|
+
|
|
248
|
+
3. Use the `Write` tool to write <patch/> to the patch file
|
|
249
|
+
`<tmp-dir/>/ase-stage.patch`, and apply it to the *index only*
|
|
250
|
+
by running the corresponding command (taken exactly as given):
|
|
251
|
+
|
|
252
|
+
`git -C "<repo-root/>" apply --cached --recount --whitespace=nowarn "<tmp-dir/>/ase-stage.patch"`
|
|
253
|
+
|
|
254
|
+
<if condition="this command fails">
|
|
255
|
+
Keep the patch file for inspection, only output the following
|
|
256
|
+
<template/>, and then *STOP*:
|
|
257
|
+
|
|
258
|
+
<template>
|
|
259
|
+
⧉ **ASE**: ✪ skill: **ase-repo-stage**, ▶ ERROR: patch failed to apply -- kept as `<tmp-dir/>/ase-stage.patch`
|
|
260
|
+
</template>
|
|
261
|
+
</if>
|
|
262
|
+
|
|
263
|
+
4. Undo the intent-to-add mark of every file of <intent-files/>
|
|
264
|
+
without selected changes by running the corresponding command
|
|
265
|
+
(taken exactly as given) per file, and then remove the patch
|
|
266
|
+
file by running the corresponding command (taken exactly as
|
|
267
|
+
given):
|
|
268
|
+
|
|
269
|
+
`git -C "<repo-root/>" reset -q -- "<file/>"`
|
|
270
|
+
|
|
271
|
+
`rm -f "<tmp-dir/>/ase-stage.patch"`
|
|
272
|
+
|
|
273
|
+
5. Only output the following <template/>, with one `○` line per
|
|
274
|
+
staged file and an ultra brief <summary/> of its staged changes:
|
|
275
|
+
|
|
276
|
+
<template>
|
|
277
|
+
○ `<file/>`: <summary/>
|
|
278
|
+
[...]
|
|
279
|
+
⧉ **ASE**: ✪ skill: **ase-repo-stage**, ✚ staged: **<n-files/>** files, **<n-hunks/>** hunks (**<n-split/>** split), ▶ status: **selection staged**
|
|
280
|
+
</template>
|
|
281
|
+
|
|
282
|
+
</step>
|
|
283
|
+
|
|
284
|
+
4. <step id="STEP 4: Verify Staged State"
|
|
285
|
+
condition="<getopt-option-no-verify/> is not equal `true`">
|
|
286
|
+
|
|
287
|
+
1. Determine the *build command* <build/> of the project: prefer
|
|
288
|
+
the command the project-level AI guidance files (`AGENTS.md`,
|
|
289
|
+
`CLAUDE.md`, or similar) name for building, else derive it from
|
|
290
|
+
the build configuration (like the `build` script of
|
|
291
|
+
`package.json`, the default target of a `Makefile`, or the
|
|
292
|
+
native build command of the language). Prefer a *single*
|
|
293
|
+
top-level command which builds and type-checks the *entire*
|
|
294
|
+
project.
|
|
295
|
+
|
|
296
|
+
<if condition="no build command can be determined">
|
|
297
|
+
Only output the following <template/> and then *skip* the
|
|
298
|
+
remaining sub-steps of this step:
|
|
299
|
+
|
|
300
|
+
<template>
|
|
301
|
+
⧉ **ASE**: ✪ skill: **ase-repo-stage**, ▶ status: **no build command found -- check skipped**
|
|
302
|
+
</template>
|
|
303
|
+
</if>
|
|
304
|
+
|
|
305
|
+
2. Set <build-ok/> to the outcome of running <build/> on the
|
|
306
|
+
*staged state alone*, determined by the *first* applicable
|
|
307
|
+
case:
|
|
308
|
+
|
|
309
|
+
- <if condition="the working copy carries neither unstaged changes nor untracked files besides those below `.ase/`">
|
|
310
|
+
The working copy already equals the staged state (check it
|
|
311
|
+
via `git -C "<repo-root/>" diff --quiet` and a re-run of the
|
|
312
|
+
untracked files command of STEP 1.5), so run <build/> with
|
|
313
|
+
<repo-root/> as its working directory.
|
|
314
|
+
</if>
|
|
315
|
+
|
|
316
|
+
- <elseif condition="<getopt-option-worktree/> is equal `true`">
|
|
317
|
+
Build in a *temporary worktree*: determine <check-dir/> by
|
|
318
|
+
calling the `ase_worktree_path(id: "ase-repo-stage", temp:
|
|
319
|
+
true, create: true)` tool of the `ase` MCP server -- you
|
|
320
|
+
*MUST* *NEVER* assemble this path yourself. If <check-dir/>
|
|
321
|
+
is still a registered worktree of an earlier run, remove it
|
|
322
|
+
first. Then run the corresponding commands (taken exactly as
|
|
323
|
+
given), where the redirection captures the binary-safe
|
|
324
|
+
staged diff:
|
|
325
|
+
|
|
326
|
+
`git -C "<repo-root/>" worktree add --detach "<check-dir/>" HEAD`
|
|
327
|
+
|
|
328
|
+
`git -C "<repo-root/>" diff --cached --binary > "<tmp-dir/>/ase-stage-check.patch"`
|
|
329
|
+
|
|
330
|
+
`git -C "<check-dir/>" apply --whitespace=nowarn "<tmp-dir/>/ase-stage-check.patch"`
|
|
331
|
+
|
|
332
|
+
Link every git-ignored *dependency* directory of the working
|
|
333
|
+
copy (like each `node_modules` directory, found via `find
|
|
334
|
+
"<repo-root/>" -name node_modules -type d -prune -not -path
|
|
335
|
+
"*/.ase/*"`) into the same relative location of <check-dir/>
|
|
336
|
+
via `ln -s "<dependency-dir/>" "<check-dir/>/<relative-dir/>"`,
|
|
337
|
+
so <build/> runs without a fresh installation. Then run
|
|
338
|
+
<build/> with <check-dir/> as its working directory, and
|
|
339
|
+
finally clean up by running the corresponding commands
|
|
340
|
+
(taken exactly as given):
|
|
341
|
+
|
|
342
|
+
`git -C "<repo-root/>" worktree remove --force "<check-dir/>"`
|
|
343
|
+
|
|
344
|
+
`rm -f "<tmp-dir/>/ase-stage-check.patch"`
|
|
345
|
+
</elseif>
|
|
346
|
+
|
|
347
|
+
- <else>
|
|
348
|
+
Build *in place*: run the corresponding commands (taken
|
|
349
|
+
exactly as given) and compare the outputs of the first and
|
|
350
|
+
the third command -- only if they *differ* was the stash
|
|
351
|
+
really created:
|
|
352
|
+
|
|
353
|
+
`git -C "<repo-root/>" rev-parse -q --verify refs/stash`
|
|
354
|
+
|
|
355
|
+
`git -C "<repo-root/>" stash push -q --keep-index --include-untracked -m "ase-repo-stage"`
|
|
356
|
+
|
|
357
|
+
`git -C "<repo-root/>" rev-parse -q --verify refs/stash`
|
|
358
|
+
|
|
359
|
+
If the stash was not created, only output the following
|
|
360
|
+
<template/> and then immediately *STOP*, as the working copy
|
|
361
|
+
stays untouched:
|
|
362
|
+
|
|
363
|
+
<template>
|
|
364
|
+
⧉ **ASE**: ✪ skill: **ase-repo-stage**, ▶ ERROR: stashing the unstaged changes failed -- staged state not checked
|
|
365
|
+
</template>
|
|
366
|
+
|
|
367
|
+
Otherwise, run <build/> with <repo-root/> as its working
|
|
368
|
+
directory, and then *always* -- also on a failed build --
|
|
369
|
+
restore the working copy by running the corresponding
|
|
370
|
+
commands (taken exactly as given), where the reset is safe
|
|
371
|
+
because the stash carries both the index and the working
|
|
372
|
+
copy:
|
|
373
|
+
|
|
374
|
+
`git -C "<repo-root/>" reset -q --hard`
|
|
375
|
+
|
|
376
|
+
`git -C "<repo-root/>" stash pop -q --index`
|
|
377
|
+
|
|
378
|
+
If the `git stash pop` command fails, only output the
|
|
379
|
+
following <template/> and then immediately *STOP*:
|
|
380
|
+
|
|
381
|
+
<template>
|
|
382
|
+
⧉ **ASE**: ✪ skill: **ase-repo-stage**, ▶ ERROR: restoring the working copy failed -- the changes are kept in `git stash list` as `ase-repo-stage`
|
|
383
|
+
</template>
|
|
384
|
+
|
|
385
|
+
<ase-tpl-hint level="minimal">
|
|
386
|
+
Remove the conflicting files the build created and restore the changes via `git stash pop --index`.
|
|
387
|
+
</ase-tpl-hint>
|
|
388
|
+
</else>
|
|
389
|
+
|
|
390
|
+
3. <if condition="<build-ok/> indicates success">
|
|
391
|
+
Only output the following <template/>:
|
|
392
|
+
|
|
393
|
+
<template>
|
|
394
|
+
⧉ **ASE**: ✪ skill: **ase-repo-stage**, ⚙ build: `<build/>`, ▶ status: **staged state builds**
|
|
395
|
+
</template>
|
|
396
|
+
</if>
|
|
397
|
+
<else>
|
|
398
|
+
The staged selection stays as it is, and the chaining of STEP 5
|
|
399
|
+
is *skipped*. Only output the following <template/>, where
|
|
400
|
+
<errors/> are the *essential* error lines of the build output
|
|
401
|
+
as a fenced code block:
|
|
402
|
+
|
|
403
|
+
<template>
|
|
404
|
+
<errors/>
|
|
405
|
+
⧉ **ASE**: ✪ skill: **ase-repo-stage**, ⚙ build: `<build/>`, ▶ ERROR: staged state does not build
|
|
406
|
+
</template>
|
|
407
|
+
|
|
408
|
+
<ase-tpl-hint level="minimal">
|
|
409
|
+
The selection most likely lacks a dependent change -- re-run `/ase-repo-stage` with a refined topic.
|
|
410
|
+
</ase-tpl-hint>
|
|
411
|
+
</else>
|
|
412
|
+
|
|
413
|
+
</step>
|
|
414
|
+
|
|
415
|
+
5. <step id="STEP 5: Chain into ChangeLog and Commit"
|
|
416
|
+
condition="(<getopt-option-changelog/> is equal `true` or <getopt-option-commit/> is equal `true`) and STEP 4 reported no build failure">
|
|
417
|
+
|
|
418
|
+
1. <if condition="<getopt-option-changelog/> is equal `true`">
|
|
419
|
+
Capture the unstaged diff of the `CHANGELOG.md` file located by
|
|
420
|
+
`ase-repo-changelog` (in the current directory or one of its
|
|
421
|
+
parents) into <before/> via `git -C "<repo-root/>" diff --
|
|
422
|
+
"<changelog/>"`. Then invoke the ChangeLog updating:
|
|
423
|
+
|
|
424
|
+
<skill name="ase:ase-repo-changelog"/>
|
|
425
|
+
|
|
426
|
+
Capture the same diff again into <after/>, and *stage* exactly
|
|
427
|
+
the changes which <after/> carries beyond <before/> -- the
|
|
428
|
+
entries just added or updated for the staged selection -- by
|
|
429
|
+
assembling, writing, and applying them as in STEP 3.2 and 3.3.
|
|
430
|
+
</if>
|
|
431
|
+
|
|
432
|
+
2. <if condition="<getopt-option-commit/> is equal `true`">
|
|
433
|
+
Invoke the commit message crafting for the staged selection:
|
|
434
|
+
|
|
435
|
+
<skill name="ase:ase-repo-commit"/>
|
|
436
|
+
</if>
|
|
437
|
+
|
|
438
|
+
</step>
|
|
439
|
+
|
|
440
|
+
6. <step id="STEP 6: Report Result">
|
|
441
|
+
|
|
442
|
+
Give the closing hints by expanding the following (which, depending
|
|
443
|
+
on the configured <ase-guidance-level/>, may each expand into
|
|
444
|
+
nothing and hence emit no output at all):
|
|
445
|
+
|
|
446
|
+
<if condition="<getopt-option-commit/> is not equal `true`">
|
|
447
|
+
<ase-tpl-hint level="normal">
|
|
448
|
+
Use `/ase-repo-review` to review and `/ase-repo-commit` to craft the commit message of the staged selection.
|
|
449
|
+
</ase-tpl-hint>
|
|
450
|
+
</if>
|
|
451
|
+
|
|
452
|
+
<ase-tpl-hint level="verbose">
|
|
453
|
+
Use `--merge` to keep already staged changes, `--worktree` to check the build in a temporary worktree, `--no-verify` to skip the check, and `--changelog`/`--commit` to chain into the ChangeLog and commit message skills.
|
|
454
|
+
</ase-tpl-hint>
|
|
455
|
+
|
|
456
|
+
</step>
|
|
457
|
+
|
|
458
|
+
</flow>
|
|
459
|
+
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
|
|
2
|
+
## NAME
|
|
3
|
+
|
|
4
|
+
`ase-repo-stage` - Stage a Part of the Changes
|
|
5
|
+
|
|
6
|
+
## SYNOPSIS
|
|
7
|
+
|
|
8
|
+
`ase-repo-stage`
|
|
9
|
+
[`--help`|`-h`]
|
|
10
|
+
[`--entry`|`-e`]
|
|
11
|
+
[`--turn`|`-t`]
|
|
12
|
+
[`--session`|`-s`]
|
|
13
|
+
[`--merge`|`-m`]
|
|
14
|
+
[`--no-verify`|`-V`]
|
|
15
|
+
[`--worktree`|`-w`]
|
|
16
|
+
[`--changelog`|`-c`]
|
|
17
|
+
[`--commit`|`-C`]
|
|
18
|
+
[*topic*]
|
|
19
|
+
|
|
20
|
+
## DESCRIPTION
|
|
21
|
+
|
|
22
|
+
The `ase-repo-stage` skill stages only the *part* of the current Git working copy changes which
|
|
23
|
+
belongs to a *selection*, so a mixed change set can be committed in cohesive portions without
|
|
24
|
+
hand-crafted partial patches.
|
|
25
|
+
|
|
26
|
+
The selection is either a free-text *topic*, the *last* `CHANGELOG.md` entry (`--entry`), the
|
|
27
|
+
changes of the *last turn* (`--turn`), or all changes of the current *session* (`--session`).
|
|
28
|
+
Without an option, the selection is inferred from the *topic* text, so `stage the last turn`
|
|
29
|
+
works, too. An explicitly given option overrides the inference, and a remaining *topic* narrows
|
|
30
|
+
the entry, turn, and session selections.
|
|
31
|
+
|
|
32
|
+
The changes are picked at the granularity of individual *lines*: hunks which belong to the
|
|
33
|
+
selection only partially are *split*, and untracked files are selectable, even partially.
|
|
34
|
+
Mutually dependent changes, like a use and its import, are kept together. Unless `--merge` is
|
|
35
|
+
given, the selection *replaces* the current index content. Only the Git index is changed, never
|
|
36
|
+
the content of a working copy file.
|
|
37
|
+
|
|
38
|
+
After staging, the skill checks that the *staged state alone builds*, with the build command
|
|
39
|
+
auto-detected from the project. By default, the remaining unstaged changes are temporarily
|
|
40
|
+
stashed for this, or -- under `--worktree` -- the staged state is built in a temporary worktree.
|
|
41
|
+
A failed build keeps the staged selection and is reported with its essential error lines.
|
|
42
|
+
|
|
43
|
+
Finally, the skill optionally chains into the ChangeLog updating and the commit message
|
|
44
|
+
crafting, both for the staged selection.
|
|
45
|
+
|
|
46
|
+
## OPTIONS
|
|
47
|
+
|
|
48
|
+
- `--entry`|`-e`:
|
|
49
|
+
Select the changes which realize the *last* `CHANGELOG.md` entry, i.e. the entry added or
|
|
50
|
+
modified by the uncommitted change of `CHANGELOG.md`, plus the entry itself.
|
|
51
|
+
|
|
52
|
+
- `--turn`|`-t`:
|
|
53
|
+
Select the changes made by the agent in the *last turn* before the skill invocation.
|
|
54
|
+
|
|
55
|
+
- `--session`|`-s`:
|
|
56
|
+
Select all changes made by the agent in the current *session*.
|
|
57
|
+
|
|
58
|
+
- `--merge`|`-m`:
|
|
59
|
+
Stage the selection *on top* of the already staged changes, instead of replacing them.
|
|
60
|
+
|
|
61
|
+
- `--no-verify`|`-V`:
|
|
62
|
+
Skip the check that the staged state builds on its own.
|
|
63
|
+
|
|
64
|
+
- `--worktree`|`-w`:
|
|
65
|
+
Check the build in a *temporary Git worktree* holding only the staged state, instead of
|
|
66
|
+
temporarily stashing the unstaged changes of the working copy.
|
|
67
|
+
|
|
68
|
+
- `--changelog`|`-c`:
|
|
69
|
+
Afterwards, update the `CHANGELOG.md` entries via `ase-repo-changelog` and stage exactly the
|
|
70
|
+
entries it added or updated.
|
|
71
|
+
|
|
72
|
+
- `--commit`|`-C`:
|
|
73
|
+
Afterwards, craft the commit message of the staged selection via `ase-repo-commit`.
|
|
74
|
+
|
|
75
|
+
The options `--entry`, `--turn`, and `--session` are mutually exclusive.
|
|
76
|
+
|
|
77
|
+
## ARGUMENTS
|
|
78
|
+
|
|
79
|
+
- *topic*:
|
|
80
|
+
A free-text description of the changes to stage, or -- without an option -- a reference
|
|
81
|
+
like `last turn` or `last changelog entry` the selection is inferred from.
|
|
82
|
+
|
|
83
|
+
## SCENARIOS
|
|
84
|
+
|
|
85
|
+
- You want only the hunks related to a certain topic staged
|
|
86
|
+
- You want only the changes of the last turn or of the session staged
|
|
87
|
+
- You want the changes behind a `CHANGELOG.md` entry staged and committed
|
|
88
|
+
- You want to be sure the staged part builds without the rest of the changes
|
|
89
|
+
|
|
90
|
+
## EXAMPLES
|
|
91
|
+
|
|
92
|
+
Stage only the hunks related to a topic:
|
|
93
|
+
|
|
94
|
+
```text
|
|
95
|
+
❯ /ase-repo-stage the getopt negation handling
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Stage the changes of the last turn, checking the build in a temporary worktree:
|
|
99
|
+
|
|
100
|
+
```text
|
|
101
|
+
❯ /ase-repo-stage --turn --worktree
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Stage the changes of the last ChangeLog entry and craft its commit message:
|
|
105
|
+
|
|
106
|
+
```text
|
|
107
|
+
❯ /ase-repo-stage --entry --commit
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Add the session changes related to a topic to the already staged ones:
|
|
111
|
+
|
|
112
|
+
```text
|
|
113
|
+
❯ /ase-repo-stage --session --merge task board
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## SEE ALSO
|
|
117
|
+
|
|
118
|
+
[`ase-repo-dissect`](../ase-repo-dissect/help.md), [`ase-repo-diff`](../ase-repo-diff/help.md),
|
|
119
|
+
[`ase-repo-review`](../ase-repo-review/help.md), [`ase-repo-commit`](../ase-repo-commit/help.md),
|
|
120
|
+
[`ase-repo-changelog`](../ase-repo-changelog/help.md).
|