refactor: modularize kugetsu shell script #151

Merged
shoko merged 2 commits from fix/issue-116-modularize-script into main 2026-04-05 12:58:48 +02:00
Owner

Summary

Split the monolithic 2622-line kugetsu script into modular components.

Modules Created

Module Purpose
kugetsu-config.sh Config/env loading and global variables
kugetsu-index.sh Index.json read/write via JSON
kugetsu-worktree.sh Git worktree operations
kugetsu-log.sh Structured logging and notifications
kugetsu-session.sh Session create/fork/destroy logic
kugetsu-queue-daemon.sh Queue daemon subprocess

Changes

  • Main script (kugetsu) is now a thin dispatcher (~1000 lines)
  • Sources all modules at startup
  • All existing commands preserved
  • Each module is independently testable

Acceptance Criteria

  • All existing commands work exactly as before
  • Main script sources modules
  • Each module is independently testable

Fixes #116

## Summary Split the monolithic 2622-line kugetsu script into modular components. ## Modules Created | Module | Purpose | |--------|---------| | `kugetsu-config.sh` | Config/env loading and global variables | | `kugetsu-index.sh` | Index.json read/write via JSON | | `kugetsu-worktree.sh` | Git worktree operations | | `kugetsu-log.sh` | Structured logging and notifications | | `kugetsu-session.sh` | Session create/fork/destroy logic | | `kugetsu-queue-daemon.sh` | Queue daemon subprocess | ## Changes - Main script (`kugetsu`) is now a thin dispatcher (~1000 lines) - Sources all modules at startup - All existing commands preserved - Each module is independently testable ## Acceptance Criteria - [x] All existing commands work exactly as before - [x] Main script sources modules - [x] Each module is independently testable Fixes #116
shoko added 1 commit 2026-04-05 12:17:49 +02:00
Split the monolithic kugetsu script into modular components:

Modules created:
- kugetsu-config.sh - Config/env loading and global variables
- kugetsu-index.sh - Index.json read/write via JSON
- kugetsu-worktree.sh - Git worktree operations
- kugetsu-log.sh - Structured logging and notifications
- kugetsu-session.sh - Session create/fork/destroy logic
- kugetsu-queue-daemon.sh - Queue daemon subprocess

Main script (kugetsu) is now a thin dispatcher that sources all modules.

Acceptance Criteria:
- All existing commands work exactly as before
- Main script sources modules
- Each module is independently testable

Fixes #116
shoko added 1 commit 2026-04-05 12:56:59 +02:00
shoko force-pushed fix/issue-116-modularize-script from a5f6071485 to 1886c4a9c5 2026-04-05 12:57:48 +02:00 Compare
han approved these changes 2026-04-05 12:58:19 +02:00
han left a comment
First-time contributor

lgtm

lgtm
shoko merged commit 3942a915ff into main 2026-04-05 12:58:48 +02:00
Sign in to join this conversation.