@kafka0102/onespec 0.2.2 → 0.2.3
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/README.md
CHANGED
|
@@ -8,7 +8,7 @@ OneSpec is a CLI and agent skill bundle for running an OpenSpec + Superpowers wo
|
|
|
8
8
|
|
|
9
9
|
### `onespec`
|
|
10
10
|
|
|
11
|
-
`onespec` turns OpenSpec from a set of manual commands into an agent-operated workflow. It prepares the design, spec, and
|
|
11
|
+
`onespec` turns OpenSpec from a set of manual commands into an agent-operated workflow. It prepares the design, spec, and tasks, asks the human to confirm the design before implementation, recommends the implementation method and path based on complexity, then carries the change through execution, review, and archive.
|
|
12
12
|
|
|
13
13
|
Use it when a change needs normal design confirmation and acceptance review. You invoke the workflow in natural language instead of manually chaining multiple OpenSpec commands.
|
|
14
14
|
|
|
@@ -20,16 +20,42 @@ Use it when a change needs normal design confirmation and acceptance review. You
|
|
|
20
20
|
|
|
21
21
|
`onespec`
|
|
22
22
|
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
```
|
|
24
|
+
┌──────────┐ ┌──────────┐
|
|
25
|
+
│User │───▶│Complexity│
|
|
26
|
+
│request │ │ analysis │
|
|
27
|
+
└──────────┘ └────┬─────┘
|
|
28
|
+
│
|
|
29
|
+
┌──┴──┐
|
|
30
|
+
│ │
|
|
31
|
+
Low High
|
|
32
|
+
│ │
|
|
33
|
+
▼ ▼
|
|
34
|
+
┌──────────┐ ┌──────────┐
|
|
35
|
+
│Draft │◀───│Brainstorm│
|
|
36
|
+
│design, │ └──────────┘
|
|
37
|
+
│spec, & │
|
|
38
|
+
│ tasks │
|
|
39
|
+
└────┬─────┘
|
|
40
|
+
│
|
|
41
|
+
▼
|
|
42
|
+
┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐
|
|
43
|
+
│Human │───▶│Recommend │───▶│Execute │───▶│Human │───▶│ Archive │
|
|
44
|
+
│confirms │ │method & │ │approved │ │reviews │ │ │
|
|
45
|
+
│ design │ │path by │ │ change │ │acceptance│ │ │
|
|
46
|
+
└──────────┘ │complexity│ └──────────┘ └──────────┘ └──────────┘
|
|
47
|
+
└──────────┘
|
|
26
48
|
```
|
|
27
49
|
|
|
28
50
|
`onespec-fast`
|
|
29
51
|
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
|
|
52
|
+
```
|
|
53
|
+
┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐
|
|
54
|
+
│Fast-path │───▶│Create │───▶│Native │───▶│Test & │───▶│ Archive │
|
|
55
|
+
│request │ │compact │ │OpenSpec │ │validate │ │ │
|
|
56
|
+
└──────────┘ │OpenSpec │ │ apply │ └──────────┘ └──────────┘
|
|
57
|
+
│ context │ └──────────┘
|
|
58
|
+
└──────────┘
|
|
33
59
|
```
|
|
34
60
|
|
|
35
61
|
## Install
|
|
@@ -78,10 +78,19 @@ script_dir() {
|
|
|
78
78
|
|
|
79
79
|
canonicalize_path() {
|
|
80
80
|
local input="$1"
|
|
81
|
-
|
|
81
|
+
local label="${2:-path}"
|
|
82
|
+
if [ -z "$input" ] || [ "$input" = "unknown" ]; then
|
|
82
83
|
printf '%s\n' "$input"
|
|
83
84
|
return 0
|
|
84
85
|
fi
|
|
86
|
+
if [ ! -e "$input" ]; then
|
|
87
|
+
echo "ERROR: $label does not exist: $input" >&2
|
|
88
|
+
return 1
|
|
89
|
+
fi
|
|
90
|
+
if [ ! -d "$input" ]; then
|
|
91
|
+
echo "ERROR: $label is not a directory: $input" >&2
|
|
92
|
+
return 1
|
|
93
|
+
fi
|
|
85
94
|
(
|
|
86
95
|
cd "$input"
|
|
87
96
|
pwd -P
|
|
@@ -102,7 +111,7 @@ selected_actions_csv() {
|
|
|
102
111
|
}
|
|
103
112
|
|
|
104
113
|
origin_workspace_path_for_change() {
|
|
105
|
-
canonicalize_path "$(get_state_value "$1" origin_workspace_path)"
|
|
114
|
+
canonicalize_path "$(get_state_value "$1" origin_workspace_path)" "origin workspace path"
|
|
106
115
|
}
|
|
107
116
|
|
|
108
117
|
normalize_action() {
|
|
@@ -132,7 +141,7 @@ temporary_worktree_status() {
|
|
|
132
141
|
origin_branch="$(get_state_value "$change" origin_branch)"
|
|
133
142
|
origin_path="$(get_state_value "$change" origin_workspace_path)"
|
|
134
143
|
origin_mode="$(get_state_value "$change" origin_workspace_mode)"
|
|
135
|
-
origin_path="$(canonicalize_path "$origin_path")"
|
|
144
|
+
origin_path="$(canonicalize_path "$origin_path" "origin workspace path")"
|
|
136
145
|
current_path="$(state_workspace_path "$change")"
|
|
137
146
|
current_head="$(git -C "$current_path" branch --show-current 2>/dev/null || true)"
|
|
138
147
|
current_head="${current_head:-detached}"
|
|
@@ -221,7 +230,7 @@ cmd_validate_actions() {
|
|
|
221
230
|
ensure_git_repo
|
|
222
231
|
|
|
223
232
|
local -a selected=()
|
|
224
|
-
local action normalized
|
|
233
|
+
local action selected_action normalized
|
|
225
234
|
local already_selected
|
|
226
235
|
local has_archive_then_merge="false"
|
|
227
236
|
local has_archive_only="false"
|
|
@@ -232,8 +241,8 @@ cmd_validate_actions() {
|
|
|
232
241
|
normalized="$(normalize_action "$action")"
|
|
233
242
|
[ -n "$normalized" ] || continue
|
|
234
243
|
already_selected="false"
|
|
235
|
-
for
|
|
236
|
-
if [ "$
|
|
244
|
+
for selected_action in "${selected[@]:-}"; do
|
|
245
|
+
if [ "$selected_action" = "$normalized" ]; then
|
|
237
246
|
already_selected="true"
|
|
238
247
|
break
|
|
239
248
|
fi
|
|
@@ -243,8 +252,8 @@ cmd_validate_actions() {
|
|
|
243
252
|
fi
|
|
244
253
|
done
|
|
245
254
|
|
|
246
|
-
for
|
|
247
|
-
case "$
|
|
255
|
+
for selected_action in "${selected[@]}"; do
|
|
256
|
+
case "$selected_action" in
|
|
248
257
|
archive-then-merge-worktree) has_archive_then_merge="true" ;;
|
|
249
258
|
archive-only) has_archive_only="true" ;;
|
|
250
259
|
discard-worktree) has_discard_worktree="true" ;;
|