prizmkit 1.0.142 → 1.0.144

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.
@@ -1,5 +1,5 @@
1
1
  {
2
- "frameworkVersion": "1.0.142",
3
- "bundledAt": "2026-03-28T23:25:23.889Z",
4
- "bundledFrom": "6c6eed3"
2
+ "frameworkVersion": "1.0.144",
3
+ "bundledAt": "2026-03-29T13:53:32.397Z",
4
+ "bundledFrom": "f48ed27"
5
5
  }
@@ -39,7 +39,7 @@ branch_create() {
39
39
 
40
40
  # Create and checkout new branch
41
41
  if ! git -C "$project_root" checkout -b "$branch_name" "$source_branch" 2>/dev/null; then
42
- log_error "Failed to create branch: $branch_name from $source_branch"
42
+ log_warn "Failed to create branch: $branch_name from $source_branch"
43
43
  return 1
44
44
  fi
45
45
 
@@ -138,29 +138,117 @@ prizm_check_common_dependencies() {
138
138
  fi
139
139
  }
140
140
 
141
- # Ensure git is installed and the current directory is a git repository.
142
- # If git is missing, print install instructions and exit.
141
+ # Ensure git is installed and a given directory is a git repository.
142
+ # If git is missing, attempt auto-install; on failure print instructions and exit.
143
143
  # If not inside a git repo, run git init + initial commit automatically.
144
+ #
145
+ # Usage: prizm_ensure_git_repo [directory]
146
+ # directory — path to check/initialize (defaults to current working directory)
144
147
  prizm_ensure_git_repo() {
148
+ local target_dir="${1:-.}"
149
+
150
+ # --- helper: run a command with a timeout (macOS-compatible) ---
151
+ # Uses GNU timeout / gtimeout if available, otherwise a background+kill fallback.
152
+ _run_with_timeout() {
153
+ local secs="$1"; shift
154
+ if command -v timeout &>/dev/null; then
155
+ timeout "$secs" "$@"
156
+ elif command -v gtimeout &>/dev/null; then
157
+ gtimeout "$secs" "$@"
158
+ else
159
+ # background + kill fallback
160
+ "$@" &
161
+ local pid=$!
162
+ ( sleep "$secs" && kill "$pid" 2>/dev/null ) &
163
+ local watchdog=$!
164
+ if wait "$pid" 2>/dev/null; then
165
+ kill "$watchdog" 2>/dev/null; wait "$watchdog" 2>/dev/null
166
+ return 0
167
+ else
168
+ kill "$watchdog" 2>/dev/null; wait "$watchdog" 2>/dev/null
169
+ return 1
170
+ fi
171
+ fi
172
+ }
173
+
145
174
  if ! command -v git &>/dev/null; then
146
- log_error "git is required but not installed."
147
- log_error "Install git:"
148
- log_error " macOS: brew install git or xcode-select --install"
149
- log_error " Ubuntu: sudo apt-get install git"
150
- log_error " Windows: https://git-scm.com/download/win"
175
+ log_warn "git is not installed. Attempting automatic installation..."
176
+ local _install_ok=false
177
+ case "$(uname -s)" in
178
+ Darwin)
179
+ if command -v brew &>/dev/null; then
180
+ log_info "Installing git via Homebrew..."
181
+ if _run_with_timeout 120 brew install git &>/dev/null; then
182
+ _install_ok=true
183
+ fi
184
+ else
185
+ # xcode-select --install opens a GUI dialog that cannot be automated;
186
+ # skip auto-install and fall through to manual instructions.
187
+ log_info "Homebrew not found; cannot auto-install git on macOS."
188
+ fi
189
+ ;;
190
+ Linux)
191
+ # Verify passwordless sudo is available (daemon/CI safety)
192
+ if ! sudo -n true 2>/dev/null; then
193
+ log_info "sudo requires a password; cannot auto-install git."
194
+ elif command -v apt-get &>/dev/null; then
195
+ log_info "Installing git via apt-get..."
196
+ _run_with_timeout 120 sudo apt-get update -y &>/dev/null
197
+ if _run_with_timeout 120 sudo apt-get install -y git &>/dev/null; then
198
+ _install_ok=true
199
+ fi
200
+ elif command -v yum &>/dev/null; then
201
+ log_info "Installing git via yum..."
202
+ if _run_with_timeout 120 sudo yum install -y git &>/dev/null; then
203
+ _install_ok=true
204
+ fi
205
+ elif command -v dnf &>/dev/null; then
206
+ log_info "Installing git via dnf..."
207
+ if _run_with_timeout 120 sudo dnf install -y git &>/dev/null; then
208
+ _install_ok=true
209
+ fi
210
+ elif command -v pacman &>/dev/null; then
211
+ log_info "Installing git via pacman..."
212
+ if _run_with_timeout 120 sudo pacman -S --noconfirm git &>/dev/null; then
213
+ _install_ok=true
214
+ fi
215
+ fi
216
+ ;;
217
+ esac
218
+
219
+ if $_install_ok && command -v git &>/dev/null; then
220
+ log_success "git installed successfully ($(git --version))."
221
+ else
222
+ log_error "Automatic git installation failed or timed out."
223
+ log_error "Please install git manually:"
224
+ log_error " macOS: brew install git or xcode-select --install"
225
+ log_error " Ubuntu: sudo apt-get install git"
226
+ log_error " CentOS: sudo yum install git"
227
+ log_error " Windows: https://git-scm.com/download/win"
228
+ exit 1
229
+ fi
230
+ fi
231
+
232
+ # Validate target directory exists
233
+ if [[ ! -d "$target_dir" ]]; then
234
+ log_error "Target directory does not exist: $target_dir"
151
235
  exit 1
152
236
  fi
153
237
 
154
- if ! git rev-parse --is-inside-work-tree &>/dev/null 2>&1; then
155
- log_warn "Current directory is not a git repository."
238
+ if ! git -C "$target_dir" rev-parse --is-inside-work-tree &>/dev/null 2>&1; then
239
+ log_warn "Directory is not a git repository: $target_dir"
156
240
  log_info "Initializing git repository..."
157
- git init -b main
241
+ git -C "$target_dir" init -b main
242
+ log_info "Git repository initialized at: $target_dir"
158
243
  # Create initial commit so branches and diffs work
159
- git add -A
160
- git commit --no-verify -m "chore: initial commit (auto-created by dev-pipeline)" || {
244
+ if ! git -C "$target_dir" add -A; then
245
+ log_error "Failed to stage files in: $target_dir"
246
+ exit 1
247
+ fi
248
+ git -C "$target_dir" commit --no-verify -m "chore: initial commit (auto-created by dev-pipeline)" || {
161
249
  # If nothing to commit (empty project), create an empty initial commit
162
- git commit --no-verify --allow-empty -m "chore: initial commit (auto-created by dev-pipeline)"
250
+ git -C "$target_dir" commit --no-verify --allow-empty -m "chore: initial commit (auto-created by dev-pipeline)"
163
251
  }
164
- log_success "Git repository initialized with initial commit."
252
+ log_success "Initial commit created workspace content committed."
165
253
  fi
166
254
  }
@@ -275,7 +275,9 @@ trap cleanup SIGINT SIGTERM
275
275
 
276
276
  check_dependencies() {
277
277
  prizm_check_common_dependencies "$CLI_CMD"
278
- prizm_ensure_git_repo
278
+ local _project_root
279
+ _project_root="$(cd "$SCRIPT_DIR/.." && pwd)"
280
+ prizm_ensure_git_repo "$_project_root"
279
281
  }
280
282
 
281
283
  run_log_cleanup() {
@@ -360,7 +360,9 @@ trap cleanup SIGINT SIGTERM
360
360
 
361
361
  check_dependencies() {
362
362
  prizm_check_common_dependencies "$CLI_CMD"
363
- prizm_ensure_git_repo
363
+ local _project_root
364
+ _project_root="$(cd "$SCRIPT_DIR/.." && pwd)"
365
+ prizm_ensure_git_repo "$_project_root"
364
366
  }
365
367
 
366
368
  run_log_cleanup() {
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.0.141",
2
+ "version": "1.0.144",
3
3
  "skills": {
4
4
  "prizm-kit": {
5
5
  "description": "Full-lifecycle dev toolkit. Covers spec-driven development, Prizm context docs, code quality, debugging, deployment, and knowledge management.",
@@ -113,38 +113,37 @@ Detect user intent from their message, then follow the corresponding workflow:
113
113
  - **(2) Background daemon** — pipeline runs fully detached via `launch-bugfix-daemon.sh`. Survives AI CLI session closure.
114
114
  - **(3) Manual** — display the final assembled commands only. Do not execute anything. User runs them on their own.
115
115
 
116
- 5. **Present configuration options**: After execution mode is chosen, show the remaining options with defaults. Ask the user to confirm or override.
116
+ 5. **Ask configuration options** ⚠️ MANDATORY INTERACTIVE STEP — applies to ALL execution modes (Foreground, Background, AND Manual). You MUST ask the user to configure options and WAIT for their response BEFORE proceeding to step 6. Do NOT skip this step or merge it with step 6.
117
117
 
118
- **Configuration Options:**
118
+ Use `AskUserQuestion` to present the following configuration choices. Each question is a separate selectable option:
119
119
 
120
- | Option | Default | Description |
121
- |--------|---------|-------------|
122
- | **Verbose logging** | On | Detailed AI session logs including tool calls and subagent activity |
123
- | **Max retries** | 3 | Max retry attempts per failed bug |
124
- | **Session timeout** | None | Per-bug timeout in seconds (e.g. `3600` = 1 hour) |
125
- | **Bug filter** | All | Run specific bugs: `B-001:B-005` (range), `B-001,B-003` (list), or mixed `B-001,B-005:B-010` |
120
+ **Question 1 Verbose logging** (multiSelect: false):
121
+ - On (default) — Detailed AI session logs including tool calls and subagent activity
122
+ - Off Minimal logging
126
123
 
127
- Default Verbose On.
124
+ **Question 2 — Max retries** (multiSelect: false):
125
+ - 3 (default)
126
+ - 1
127
+ - 5
128
128
 
129
- **Environment variable mapping** (for natural language → env var translation):
129
+ **Question 3 — Session timeout** (multiSelect: false):
130
+ - None (default) — No timeout
131
+ - 30 min — `SESSION_TIMEOUT=1800`
132
+ - 1 hour — `SESSION_TIMEOUT=3600`
133
+ - 2 hours — `SESSION_TIMEOUT=7200`
130
134
 
131
- | User says | Environment variable |
132
- |-----------|---------------------|
133
- | "timeout 2 hours" | `SESSION_TIMEOUT=7200` |
134
- | "max 5 retries" | `MAX_RETRIES=5` |
135
- | "no verbose" / "quiet" | `VERBOSE=0` |
136
- | "heartbeat every 60s" | `HEARTBEAT_INTERVAL=60` |
135
+ Note: Bug filter defaults to all bugs (by severity order). If the user selects "Other" on any option, handle their custom input.
137
136
 
138
- Example presentation to user:
139
- ```
140
- Bugfix pipeline will process N bugs in Foreground mode:
141
- - Verbose: On (subagent detection enabled)
142
- - Max retries: 3
143
- - Timeout: none
144
- - Bugs: all (by severity order)
137
+ **Environment variable mapping** (for translating user responses → env vars):
145
138
 
146
- Want to change any options, or proceed with these defaults?
147
- ```
139
+ | Config choice | Environment variable |
140
+ |-----------|---------------------|
141
+ | Verbose: Off | `VERBOSE=0` |
142
+ | Verbose: On | `VERBOSE=1` |
143
+ | Max retries: N | `MAX_RETRIES=N` |
144
+ | Timeout: value | `SESSION_TIMEOUT=<seconds>` |
145
+
146
+ ⚠️ STOP HERE and wait for user response before continuing to step 6.
148
147
 
149
148
  6. **Show final command**: Assemble the complete command from execution mode + confirmed configuration, and present it to the user.
150
149
 
@@ -133,46 +133,48 @@ Detect user intent from their message, then follow the corresponding workflow:
133
133
  - **(2) Background daemon** — pipeline runs fully detached via `launch-daemon.sh`. Survives AI CLI session closure.
134
134
  - **(3) Manual** — display the final assembled commands only. Do not execute anything. User runs them on their own.
135
135
 
136
- 6. **Present configuration options**: After execution mode is chosen, show the remaining options with defaults. Ask the user to confirm or override.
136
+ 6. **Ask configuration options** ⚠️ MANDATORY INTERACTIVE STEP — applies to ALL execution modes (Foreground, Background, AND Manual). You MUST ask the user to configure options and WAIT for their response BEFORE proceeding to step 7. Do NOT skip this step or merge it with step 7.
137
137
 
138
- **Configuration Options:**
138
+ Use `AskUserQuestion` to present the following configuration choices. Each question is a separate selectable option:
139
139
 
140
- | Option | Default | Description |
141
- |--------|---------|-------------|
142
- | **Critic review** | Off | Adversarial review after planning & implementation. Increases time ~5-10 min/feature |
143
- | **Verbose logging** | On | Detailed AI session logs including tool calls and subagent activity |
144
- | **Max retries** | 3 | Max retry attempts per failed feature |
145
- | **Session timeout** | None | Per-feature timeout in seconds (e.g. `3600` = 1 hour) |
146
- | **Feature filter** | All | Run specific features: `F-001:F-005` (range), `F-001,F-003` (list), or mixed `F-001,F-005:F-010` |
147
- | **Browser verify** | Auto | Run playwright-cli verification for features with `browser_interaction`. Auto = run if playwright-cli installed and features have the field |
140
+ **Question 1 Critic review** (multiSelect: false):
141
+ - Off (default) — Skip adversarial review
142
+ - On Enable critic review after planning & implementation (+5-10 min/feature)
148
143
 
149
- Default Verbose On. Default Critic to Off unless features have `estimated_complexity: "high"` or above.
144
+ **Question 2 Verbose logging** (multiSelect: false):
145
+ - On (default) — Detailed AI session logs including tool calls and subagent activity
146
+ - Off — Minimal logging
150
147
 
151
- **Environment variable mapping** (for natural language → env var translation):
148
+ **Question 3 — Max retries** (multiSelect: false):
149
+ - 3 (default)
150
+ - 1
151
+ - 5
152
152
 
153
- | User says | Environment variable |
153
+ **Question 4 Session timeout** (multiSelect: false):
154
+ - None (default) — No timeout
155
+ - 30 min — `SESSION_TIMEOUT=1800`
156
+ - 1 hour — `SESSION_TIMEOUT=3600`
157
+ - 2 hours — `SESSION_TIMEOUT=7200`
158
+
159
+ Note: Due to the 4-question limit per `AskUserQuestion` call, Feature filter and Browser verify use their defaults (all features, auto-detect playwright-cli). If the user selects "Other" on any option, handle their custom input.
160
+
161
+ Default Critic to Off unless features have `estimated_complexity: "high"` or above (in which case default to On).
162
+
163
+ **Environment variable mapping** (for translating user responses → env vars):
164
+
165
+ | Config choice | Environment variable |
154
166
  |-----------|---------------------|
155
- | "timeout 2 hours" | `SESSION_TIMEOUT=7200` |
156
- | "max 5 retries" | `MAX_RETRIES=5` |
157
- | "no verbose" / "quiet" | `VERBOSE=0` |
158
- | "heartbeat every 60s" | `HEARTBEAT_INTERVAL=60` |
159
- | "enable critic review" | `ENABLE_CRITIC=true` |
167
+ | Critic: On | `ENABLE_CRITIC=true` |
168
+ | Verbose: Off | `VERBOSE=0` |
169
+ | Verbose: On | `VERBOSE=1` |
170
+ | Max retries: N | `MAX_RETRIES=N` |
171
+ | Timeout: value | `SESSION_TIMEOUT=<seconds>` |
160
172
  | "skip browser verify" | `BROWSER_VERIFY=false` |
161
173
  | "enable browser verify" | `BROWSER_VERIFY=true` |
162
174
 
163
- Example presentation to user:
164
- ```
165
- Pipeline will process N features in Foreground mode:
166
- - Critic: Off
167
- - Verbose: On (subagent detection enabled)
168
- - Max retries: 3
169
- - Timeout: none
170
- - Features: all
171
-
172
- Want to change any options, or proceed with these defaults?
173
- ```
175
+ ⚠️ STOP HERE and wait for user response before continuing to step 7.
174
176
 
175
- 7. **Show final command**: Assemble the complete command from execution mode + confirmed configuration, and present it to the user.
177
+ 7. **Show final command**: After user confirms configuration in step 6, assemble the complete command from execution mode + user-confirmed configuration, and present it to the user.
176
178
 
177
179
  **Foreground command:**
178
180
  ```bash
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prizmkit",
3
- "version": "1.0.142",
3
+ "version": "1.0.144",
4
4
  "description": "Create a new PrizmKit-powered project with clean initialization — no framework dev files, just what you need.",
5
5
  "type": "module",
6
6
  "bin": {