claude-cook 1.10.6 → 1.10.7

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 (2) hide show
  1. package/package.json +1 -1
  2. package/scripts/pm-loop.sh +39 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-cook",
3
- "version": "1.10.6",
3
+ "version": "1.10.7",
4
4
  "description": "A meta-prompting, context engineering and spec-driven development system for Claude Code, OpenCode and Gemini by TÂCHES.",
5
5
  "bin": {
6
6
  "claude-cook": "bin/install.js"
@@ -199,6 +199,24 @@ print_progress() {
199
199
  fi
200
200
  }
201
201
 
202
+ # Check if all tickets are done (returns 0 if all done, 1 otherwise)
203
+ all_tickets_done() {
204
+ local ticket_map=""
205
+ ticket_map=$(find .planning/phases/ -name "TICKET-MAP.md" -print -quit 2>/dev/null || true)
206
+
207
+ if [ -n "$ticket_map" ] && [ -f "$ticket_map" ]; then
208
+ local done_count=$(grep -c "| done " "$ticket_map" 2>/dev/null || echo "0")
209
+ local inprogress_count=$(grep -c "| inprogress " "$ticket_map" 2>/dev/null || echo "0")
210
+ local todo_count=$(grep -c "| todo " "$ticket_map" 2>/dev/null || echo "0")
211
+ local total=$((done_count + inprogress_count + todo_count))
212
+
213
+ if [ "$total" -gt 0 ] && [ "$inprogress_count" -eq 0 ] && [ "$todo_count" -eq 0 ]; then
214
+ return 0
215
+ fi
216
+ fi
217
+ return 1
218
+ }
219
+
202
220
  # ─── Graceful Ctrl+C handling ────────────────────────────────────
203
221
 
204
222
  cleanup() {
@@ -479,6 +497,27 @@ while true; do
479
497
  REPLAN_ATTEMPTS=0
480
498
  update_status "running" "completed_cycle" "$(cat "$CALL_COUNT_FILE" 2>/dev/null || echo 0)"
481
499
  print_progress
500
+
501
+ # Exit if all tickets are done
502
+ if all_tickets_done; then
503
+ TIMESTAMP=$(date '+%Y-%m-%d %H:%M:%S')
504
+ echo ""
505
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
506
+ echo " PM ► ALL TICKETS DONE"
507
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
508
+ echo ""
509
+ echo " All tickets complete after $CYCLE cycles."
510
+ echo ""
511
+ echo "" >> "$LOG_FILE"
512
+ echo "## [$TIMESTAMP] LOOP_EXIT" >> "$LOG_FILE"
513
+ echo "" >> "$LOG_FILE"
514
+ echo "- All tickets done after $CYCLE cycles" >> "$LOG_FILE"
515
+ update_status "completed" "all_tickets_done" "$(cat "$CALL_COUNT_FILE" 2>/dev/null || echo 0)"
516
+ rm -f "$PID_FILE"
517
+ notify "COOK PM" "All tickets done! Phase complete after $CYCLE cycles."
518
+ exit 0
519
+ fi
520
+
482
521
  echo ""
483
522
  echo " Cycle #$CYCLE completed in ${CYCLE_DURATION}s. Next in ${INTERVAL}s..."
484
523
  echo ""