@glrs-dev/harness-plugin-opencode 2.1.0 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +133 -0
- package/README.md +42 -106
- package/SECURITY.md +1 -1
- package/dist/agents/prompts/build.md +34 -4
- package/dist/agents/prompts/build.open.md +18 -4
- package/dist/agents/prompts/code-reviewer-thorough.md +77 -0
- package/dist/agents/prompts/code-reviewer.md +80 -0
- package/dist/agents/prompts/code-reviewer.open.md +68 -0
- package/dist/agents/prompts/debriefer.md +55 -0
- package/dist/agents/prompts/gap-analyzer.md +2 -0
- package/dist/agents/prompts/plan-reviewer.md +5 -1
- package/dist/agents/prompts/plan.md +119 -10
- package/dist/agents/prompts/prime.md +149 -88
- package/dist/agents/prompts/research-auto.md +1 -1
- package/dist/agents/prompts/research-local.md +1 -1
- package/dist/agents/prompts/research-web.md +1 -1
- package/dist/agents/prompts/research.md +2 -0
- package/dist/agents/prompts/scoper.md +129 -0
- package/dist/agents/prompts/spec-reviewer.md +53 -0
- package/dist/agents/prompts/spec-reviewer.open.md +56 -0
- package/dist/agents/shared/index.ts +1 -0
- package/dist/agents/shared/ui-evaluation-ladder.md +50 -0
- package/dist/agents/shared/workflow-mechanics.md +5 -5
- package/dist/autopilot/prompt-template.md +104 -0
- package/dist/chunk-GCWHRUOK.js +259 -0
- package/dist/chunk-MJSMBY2Y.js +87 -0
- package/dist/chunk-NIFAVPNN.js +544 -0
- package/dist/{chunk-VJUETC6A.js → chunk-PDMXYZM4.js} +53 -1
- package/dist/cli.js +1596 -1964
- package/dist/commands/prompts/fresh.md +27 -24
- package/dist/commands/prompts/review.md +3 -3
- package/dist/commands/prompts/ship.md +2 -0
- package/dist/index.js +188 -633
- package/dist/loop-session-J35NILUZ.js +30 -0
- package/dist/opencode-server-KPCDFYAX.js +22 -0
- package/dist/plan-parser-TMHEKT22.js +6 -0
- package/dist/plan-session-7VS32P52.js +117 -0
- package/dist/scoper-S77SOK7X.js +326 -0
- package/dist/skills/adversarial-review-rubric/SKILL.md +47 -0
- package/dist/skills/code-quality/SKILL.md +1 -1
- package/dist/skills/root-cause-diagnosis/SKILL.md +24 -0
- package/dist/skills/spear-protocol/SKILL.md +167 -0
- package/package.json +3 -1
- package/dist/agents/prompts/pilot-assessor.md +0 -77
- package/dist/agents/prompts/pilot-builder.md +0 -40
- package/dist/agents/prompts/pilot-planner.md +0 -56
- package/dist/agents/prompts/pilot-scoper.md +0 -58
- package/dist/agents/prompts/qa-reviewer.md +0 -68
- package/dist/agents/prompts/qa-reviewer.open.md +0 -58
- package/dist/agents/prompts/qa-thorough.md +0 -63
- package/dist/bin/plan-check.sh +0 -255
- package/dist/chunk-6CZPRUMJ.js +0 -869
- package/dist/chunk-DZG4D3OH.js +0 -54
- package/dist/chunk-OYRKOEXK.js +0 -88
- package/dist/commands/prompts/autopilot.md +0 -96
- package/dist/install-6775ZBDG.js +0 -13
- package/dist/paths-WZ23ZQOV.js +0 -18
package/dist/bin/plan-check.sh
DELETED
|
@@ -1,255 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# plan-check.sh — parse a plan file's plan-state fence and report on it.
|
|
3
|
-
#
|
|
4
|
-
# Modes:
|
|
5
|
-
# plan-check.sh <path> Prints a summary line then one line per item:
|
|
6
|
-
# `total=N done=M pending=K invalid=I`
|
|
7
|
-
# `STATUS ID VERIFY` (one per item)
|
|
8
|
-
#
|
|
9
|
-
# plan-check.sh --run <path> Prints the verify command of each PENDING
|
|
10
|
-
# item on stdout, one per line, raw. The
|
|
11
|
-
# caller is responsible for executing them.
|
|
12
|
-
# This script NEVER executes verify commands
|
|
13
|
-
# itself — that would bypass the caller's
|
|
14
|
-
# bash-permission scope.
|
|
15
|
-
#
|
|
16
|
-
# plan-check.sh --check <path>
|
|
17
|
-
# Structural validation only. Exits 1 if any
|
|
18
|
-
# fence item is missing a required field.
|
|
19
|
-
#
|
|
20
|
-
# Fence format, inside `## Acceptance criteria`:
|
|
21
|
-
#
|
|
22
|
-
# ```plan-state
|
|
23
|
-
# - [ ] id: a1
|
|
24
|
-
# intent: Prose description of business intent (one line).
|
|
25
|
-
# tests:
|
|
26
|
-
# - path/to/test.sh::"some test name"
|
|
27
|
-
# - path/to/other.ts::"another test"
|
|
28
|
-
# verify: bash path/to/test.sh
|
|
29
|
-
#
|
|
30
|
-
# - [x] id: a2
|
|
31
|
-
# ...
|
|
32
|
-
# ```
|
|
33
|
-
#
|
|
34
|
-
# Backward compat: a plan without a ```plan-state fence emits the line
|
|
35
|
-
# `legacy` and exits 0 — callers treat it as "old format, fall back".
|
|
36
|
-
#
|
|
37
|
-
# Portability: POSIX bash + awk + grep only. No sed -i.
|
|
38
|
-
|
|
39
|
-
set -eu
|
|
40
|
-
|
|
41
|
-
MODE=""
|
|
42
|
-
PLAN_PATH=""
|
|
43
|
-
|
|
44
|
-
case "${1:-}" in
|
|
45
|
-
--run) MODE=run; PLAN_PATH="${2:-}" ;;
|
|
46
|
-
--check) MODE=check; PLAN_PATH="${2:-}" ;;
|
|
47
|
-
-h|--help|"")
|
|
48
|
-
sed -n '2,34p' "$0"
|
|
49
|
-
exit 0
|
|
50
|
-
;;
|
|
51
|
-
*) MODE=summary; PLAN_PATH="${1:-}" ;;
|
|
52
|
-
esac
|
|
53
|
-
|
|
54
|
-
if [[ -z "${PLAN_PATH:-}" ]]; then
|
|
55
|
-
echo "plan-check.sh: missing plan path" >&2
|
|
56
|
-
exit 2
|
|
57
|
-
fi
|
|
58
|
-
|
|
59
|
-
if [[ ! -f "$PLAN_PATH" ]]; then
|
|
60
|
-
echo "plan-check.sh: file not found: $PLAN_PATH" >&2
|
|
61
|
-
exit 2
|
|
62
|
-
fi
|
|
63
|
-
|
|
64
|
-
# Extract the plan-state fence body into a temp file. awk state machine:
|
|
65
|
-
# enter `## Acceptance criteria`, enter ``` plan-state, exit on next ```.
|
|
66
|
-
FENCE_BODY="$(awk '
|
|
67
|
-
/^## Acceptance criteria/ { in_ac = 1; next }
|
|
68
|
-
/^## / && in_ac && !in_fence { in_ac = 0 }
|
|
69
|
-
in_ac && /^```plan-state[[:space:]]*$/ { in_fence = 1; next }
|
|
70
|
-
in_fence && /^```[[:space:]]*$/ { in_fence = 0; next }
|
|
71
|
-
in_fence { print }
|
|
72
|
-
' "$PLAN_PATH")"
|
|
73
|
-
|
|
74
|
-
if [[ -z "$FENCE_BODY" ]]; then
|
|
75
|
-
# No fence found — legacy plan. Report and exit cleanly.
|
|
76
|
-
if [[ "$MODE" == "summary" ]]; then
|
|
77
|
-
echo "legacy (no plan-state fence)"
|
|
78
|
-
fi
|
|
79
|
-
# --run on a legacy plan emits nothing (no commands to run).
|
|
80
|
-
# --check on a legacy plan succeeds (we're accepting legacy plans).
|
|
81
|
-
exit 0
|
|
82
|
-
fi
|
|
83
|
-
|
|
84
|
-
# Parse items. awk state machine:
|
|
85
|
-
# - A line `- [ ] id: ID` or `- [x] id: ID` starts a new item.
|
|
86
|
-
# - While inside an item, indented keys `intent:`, `tests:`, `verify:` set
|
|
87
|
-
# fields. Under `tests:`, subsequent ` - ...` lines extend the list
|
|
88
|
-
# until the next key or the next item.
|
|
89
|
-
# - Items are separated by one or more blank lines OR by the next `- [`.
|
|
90
|
-
#
|
|
91
|
-
# We emit a tab-delimited record per item:
|
|
92
|
-
# STATUS<TAB>ID<TAB>INTENT<TAB>TESTS<TAB>VERIFY
|
|
93
|
-
# TESTS is a `|`-delimited list. Missing fields are the empty string.
|
|
94
|
-
PARSED="$(echo "$FENCE_BODY" | awk '
|
|
95
|
-
function flush() {
|
|
96
|
-
if (cur_id != "") {
|
|
97
|
-
# Trim trailing/leading whitespace on each field
|
|
98
|
-
gsub(/^[[:space:]]+|[[:space:]]+$/, "", cur_intent)
|
|
99
|
-
gsub(/^[[:space:]]+|[[:space:]]+$/, "", cur_verify)
|
|
100
|
-
gsub(/^\||\|$/, "", cur_tests)
|
|
101
|
-
printf "%s\t%s\t%s\t%s\t%s\n", cur_status, cur_id, cur_intent, cur_tests, cur_verify
|
|
102
|
-
}
|
|
103
|
-
cur_status = ""; cur_id = ""; cur_intent = ""; cur_tests = ""; cur_verify = ""
|
|
104
|
-
in_tests = 0
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
/^-[[:space:]]+\[[[:space:]xX[:space:]]\][[:space:]]+id:/ {
|
|
108
|
-
flush()
|
|
109
|
-
status = $0
|
|
110
|
-
sub(/^-[[:space:]]+\[[[:space:]]*/, "", status)
|
|
111
|
-
sub(/\].*$/, "", status)
|
|
112
|
-
# status is either empty/space (" ") -> pending, or "x"/"X" -> done
|
|
113
|
-
if (status ~ /[xX]/) cur_status = "done"; else cur_status = "pending"
|
|
114
|
-
# Capture id
|
|
115
|
-
id_part = $0
|
|
116
|
-
sub(/^.*id:[[:space:]]*/, "", id_part)
|
|
117
|
-
cur_id = id_part
|
|
118
|
-
next
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
/^[[:space:]]*intent:/ {
|
|
122
|
-
field = $0
|
|
123
|
-
sub(/^[[:space:]]*intent:[[:space:]]*/, "", field)
|
|
124
|
-
cur_intent = field
|
|
125
|
-
in_tests = 0
|
|
126
|
-
next
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
/^[[:space:]]*intent\b/ {
|
|
130
|
-
# already handled
|
|
131
|
-
next
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
/^[[:space:]]*tests:/ {
|
|
135
|
-
in_tests = 1
|
|
136
|
-
next
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
/^[[:space:]]*verify:/ {
|
|
140
|
-
field = $0
|
|
141
|
-
sub(/^[[:space:]]*verify:[[:space:]]*/, "", field)
|
|
142
|
-
cur_verify = field
|
|
143
|
-
in_tests = 0
|
|
144
|
-
next
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
# Continuation lines inside tests: list
|
|
148
|
-
in_tests && /^[[:space:]]+-[[:space:]]/ {
|
|
149
|
-
line = $0
|
|
150
|
-
sub(/^[[:space:]]+-[[:space:]]+/, "", line)
|
|
151
|
-
if (cur_tests == "") cur_tests = line
|
|
152
|
-
else cur_tests = cur_tests "|" line
|
|
153
|
-
next
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
# Continuation line for intent (indented without `-`, after intent is set
|
|
157
|
-
# and before another key). Append with a space separator.
|
|
158
|
-
!in_tests && /^[[:space:]]{4,}[^-[:space:]]/ && cur_id != "" && cur_intent != "" && cur_verify == "" {
|
|
159
|
-
line = $0
|
|
160
|
-
sub(/^[[:space:]]+/, "", line)
|
|
161
|
-
cur_intent = cur_intent " " line
|
|
162
|
-
next
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
END { flush() }
|
|
166
|
-
' 2>&1)"
|
|
167
|
-
|
|
168
|
-
# If PARSED contains awk errors, surface them as invalid.
|
|
169
|
-
if echo "$PARSED" | grep -q '^awk:'; then
|
|
170
|
-
echo "plan-check.sh: parser error" >&2
|
|
171
|
-
echo "$PARSED" >&2
|
|
172
|
-
exit 3
|
|
173
|
-
fi
|
|
174
|
-
|
|
175
|
-
# Count totals.
|
|
176
|
-
total=0
|
|
177
|
-
done_count=0
|
|
178
|
-
pending_count=0
|
|
179
|
-
invalid_count=0
|
|
180
|
-
invalid_reasons=()
|
|
181
|
-
|
|
182
|
-
while IFS=$'\t' read -r status id intent tests verify; do
|
|
183
|
-
[[ -z "$status" ]] && continue
|
|
184
|
-
total=$((total + 1))
|
|
185
|
-
if [[ -z "$id" ]]; then
|
|
186
|
-
invalid_count=$((invalid_count + 1))
|
|
187
|
-
invalid_reasons+=("missing id")
|
|
188
|
-
continue
|
|
189
|
-
fi
|
|
190
|
-
if [[ -z "$intent" ]]; then
|
|
191
|
-
invalid_count=$((invalid_count + 1))
|
|
192
|
-
invalid_reasons+=("$id: missing intent")
|
|
193
|
-
continue
|
|
194
|
-
fi
|
|
195
|
-
if [[ -z "$tests" ]]; then
|
|
196
|
-
invalid_count=$((invalid_count + 1))
|
|
197
|
-
invalid_reasons+=("$id: missing tests")
|
|
198
|
-
continue
|
|
199
|
-
fi
|
|
200
|
-
if [[ -z "$verify" ]]; then
|
|
201
|
-
invalid_count=$((invalid_count + 1))
|
|
202
|
-
invalid_reasons+=("$id: missing verify")
|
|
203
|
-
continue
|
|
204
|
-
fi
|
|
205
|
-
if [[ "$status" == "done" ]]; then
|
|
206
|
-
done_count=$((done_count + 1))
|
|
207
|
-
else
|
|
208
|
-
pending_count=$((pending_count + 1))
|
|
209
|
-
fi
|
|
210
|
-
done <<< "$PARSED"
|
|
211
|
-
|
|
212
|
-
case "$MODE" in
|
|
213
|
-
summary)
|
|
214
|
-
printf 'total=%d done=%d pending=%d invalid=%d\n' \
|
|
215
|
-
"$total" "$done_count" "$pending_count" "$invalid_count"
|
|
216
|
-
while IFS=$'\t' read -r status id intent tests verify; do
|
|
217
|
-
[[ -z "$status" ]] && continue
|
|
218
|
-
# For the summary-per-item line, prefer displaying the verify
|
|
219
|
-
# command (truncated) so the reader sees what gates each item.
|
|
220
|
-
v="${verify:0:60}"
|
|
221
|
-
if [[ -n "$verify" && ${#verify} -gt 60 ]]; then v="${v}…"; fi
|
|
222
|
-
printf '%s %s %s\n' "$status" "$id" "$v"
|
|
223
|
-
done <<< "$PARSED"
|
|
224
|
-
if [[ "$invalid_count" -gt 0 ]]; then
|
|
225
|
-
echo "invalid:"
|
|
226
|
-
for r in "${invalid_reasons[@]}"; do
|
|
227
|
-
echo " $r"
|
|
228
|
-
done
|
|
229
|
-
fi
|
|
230
|
-
;;
|
|
231
|
-
|
|
232
|
-
run)
|
|
233
|
-
# Emit verify command per PENDING item, one per line. Skip done items,
|
|
234
|
-
# skip invalid items. Caller executes via their own bash permission.
|
|
235
|
-
while IFS=$'\t' read -r status id intent tests verify; do
|
|
236
|
-
[[ -z "$status" ]] && continue
|
|
237
|
-
[[ "$status" == "done" ]] && continue
|
|
238
|
-
[[ -z "$verify" ]] && continue
|
|
239
|
-
[[ -z "$intent" || -z "$tests" ]] && continue
|
|
240
|
-
echo "$verify"
|
|
241
|
-
done <<< "$PARSED"
|
|
242
|
-
;;
|
|
243
|
-
|
|
244
|
-
check)
|
|
245
|
-
# Structural validation. Exit 1 if anything invalid.
|
|
246
|
-
if [[ "$invalid_count" -gt 0 ]]; then
|
|
247
|
-
echo "plan-check: $invalid_count invalid item(s):" >&2
|
|
248
|
-
for r in "${invalid_reasons[@]}"; do
|
|
249
|
-
echo " $r" >&2
|
|
250
|
-
done
|
|
251
|
-
exit 1
|
|
252
|
-
fi
|
|
253
|
-
printf 'ok: %d item(s) pass structural validation\n' "$total"
|
|
254
|
-
;;
|
|
255
|
-
esac
|