@kraftapps-ai/kai 1.0.0 → 1.0.1
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/kai +9 -16
- package/package.json +1 -1
package/kai
CHANGED
|
@@ -47,10 +47,15 @@ EOF
|
|
|
47
47
|
|
|
48
48
|
# ── Commands ───────────────────────────────────────────
|
|
49
49
|
|
|
50
|
+
ensure_init() {
|
|
51
|
+
[ -f "$PRD_FILE" ] && return
|
|
52
|
+
cmd_init
|
|
53
|
+
}
|
|
54
|
+
|
|
50
55
|
cmd_init() {
|
|
51
56
|
if [ -f "$PRD_FILE" ]; then
|
|
52
|
-
echo "
|
|
53
|
-
|
|
57
|
+
echo "Already initialized."
|
|
58
|
+
return
|
|
54
59
|
fi
|
|
55
60
|
|
|
56
61
|
mkdir -p .kai
|
|
@@ -130,13 +135,9 @@ PROMPTEOF
|
|
|
130
135
|
}
|
|
131
136
|
|
|
132
137
|
cmd_plan() {
|
|
138
|
+
ensure_init
|
|
133
139
|
topic="${1:-}"
|
|
134
140
|
|
|
135
|
-
if [ ! -f "$PRD_FILE" ]; then
|
|
136
|
-
echo "kai.json not found. Run 'kai init' first."
|
|
137
|
-
exit 1
|
|
138
|
-
fi
|
|
139
|
-
|
|
140
141
|
# Build context about existing stories
|
|
141
142
|
existing=""
|
|
142
143
|
story_count=$(jq '.userStories | length' "$PRD_FILE")
|
|
@@ -337,15 +338,7 @@ cmd_reset() {
|
|
|
337
338
|
}
|
|
338
339
|
|
|
339
340
|
cmd_go() {
|
|
340
|
-
|
|
341
|
-
echo "kai.json not found. Run 'kai init' first."
|
|
342
|
-
exit 1
|
|
343
|
-
fi
|
|
344
|
-
|
|
345
|
-
if [ ! -f "$PROMPT_FILE" ]; then
|
|
346
|
-
echo ".kai/PROMPT.md not found. Run 'kai init' first."
|
|
347
|
-
exit 1
|
|
348
|
-
fi
|
|
341
|
+
ensure_init
|
|
349
342
|
|
|
350
343
|
# Collect context files
|
|
351
344
|
context_files="@${PROMPT_FILE} @${PRD_FILE} @${PROGRESS_FILE}"
|