mindsystem-cc 4.6.0 → 4.6.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/README.md CHANGED
@@ -420,9 +420,9 @@ Every artifact Mindsystem generates lives in `.planning/` — a markdown knowled
420
420
  │ └── 02-01-PLAN.md # planned, not yet executed
421
421
 
422
422
  ├── adhoc/ # /ms:adhoc → out-of-pipeline work
423
- │ └── 2026-01-15-fix-token/
424
- │ ├── adhoc-01-SUMMARY.md # Execution results and learnings
425
- │ └── adhoc-01-changes.patch # Code diff
423
+ │ └── fix-token/
424
+ │ ├── fix-token-SUMMARY.md # Execution results and learnings
425
+ │ └── fix-token-changes.patch # Code diff
426
426
 
427
427
  ├── debug/ # /ms:debug → structured investigations
428
428
  │ ├── websocket-reconnect.md # Active investigation — survives /clear
@@ -369,7 +369,7 @@ Execute discovered work with knowledge-aware planning and execution.
369
369
  - Browser verification for web projects (same flow as execute-phase)
370
370
  - Accepts Linear ticket IDs when task tracker is configured via `/ms:config` — auto-fetches context, tags commits, and finalizes the ticket on completion
371
371
  - Spawns Explore agents for codebase understanding, ms-adhoc-planner for plan creation, ms-executor for execution
372
- - Creates per-execution artifacts in `.planning/adhoc/{timestamp}-{slug}/`
372
+ - Creates per-execution artifacts in `.planning/adhoc/{slug}/`
373
373
  - Updates knowledge files via ms-consolidator after execution
374
374
 
375
375
  Usage: `/ms:adhoc Fix auth token not refreshing on 401`
@@ -440,9 +440,9 @@ Usage: `/ms:release-notes`
440
440
  │ ├── *.md # Pending todos (flat files)
441
441
  │ └── done/ # Completed todos
442
442
  ├── adhoc/ # Work executed via /ms:adhoc
443
- │ └── {date}-{slug}/ # Per-execution subdirectory
444
- │ ├── adhoc-01-PLAN.md # Execution plan (deleted after consolidation)
445
- │ └── adhoc-01-SUMMARY.md # Completion summary
443
+ │ └── {slug}/ # Per-execution subdirectory
444
+ │ ├── {slug}-PLAN.md # Execution plan (deleted after consolidation)
445
+ │ └── {slug}-SUMMARY.md # Completion summary
446
446
  ├── debug/ # Active debug sessions
447
447
  │ └── resolved/ # Archived resolved issues
448
448
  ├── codebase/ # Codebase map (brownfield projects)
@@ -102,16 +102,17 @@ Group journeys by starting area for efficient navigation. Format as a numbered l
102
102
 
103
103
  ## Spawn
104
104
 
105
- Spawn the browser verifier agent after auth is established and journeys are derived:
105
+ Spawn the browser verifier agent after auth is established and journeys are derived.
106
+
107
+ The orchestrator must pass `{screenshots_dir}` as a fully resolved path (e.g., `.planning/phases/04-comments/screenshots` or `.planning/adhoc/fix-auth/screenshots`). The browser verifier does not resolve paths — it uses whatever directory is provided.
106
108
 
107
109
  ```
108
110
  Task(
109
- prompt="Run browser verification for phase {phase_number}.
111
+ prompt="Run browser verification.
110
112
 
111
- Phase directory: {phase_dir}
112
113
  Dev URL: {dev_url}
113
114
  Auth state: .agent-browser-state.json
114
- Screenshots directory: {phase_dir}/screenshots
115
+ Screenshots directory: {screenshots_dir}
115
116
 
116
117
  ## User Journeys
117
118
 
@@ -122,7 +123,7 @@ Screenshots directory: {phase_dir}/screenshots
122
123
  {summary of which journeys need real backend data — from mock_hints external_data entries.
123
124
  Journeys needing backend data may show empty states or errors — mark as ENVIRONMENT_BLOCKED, not ISSUE.}
124
125
 
125
- Complete each user journey end-to-end. Save all screenshots to {phase_dir}/screenshots/.
126
+ Complete each user journey end-to-end. Save all screenshots to {screenshots_dir}/.
126
127
  Fix trivial issues inline. Return structured report.",
127
128
  subagent_type="ms-browser-verifier"
128
129
  )
@@ -143,7 +144,7 @@ Report: "Browser verification: {N} fixes applied, {M} issues found"
143
144
  Include the Fixes Applied section in the consolidator prompt (step `consolidate_knowledge`) so browser-discovered patterns are captured in knowledge files.
144
145
 
145
146
  **`has_issues`:**
146
- Report: "Browser verification: {N} issues found (see screenshots in {phase_dir}/screenshots/)"
147
+ Report: "Browser verification: {N} issues found (see screenshots in {screenshots_dir}/)"
147
148
  Note issues for verify-work — these are candidates for manual UAT.
148
149
 
149
150
  **`all_passed`:**
@@ -1,6 +1,6 @@
1
1
  # Adhoc Summary Template
2
2
 
3
- Template for `.planning/adhoc/{timestamp}-{slug}-SUMMARY.md` — documentation for work items executed via `/ms:adhoc`.
3
+ Template for `.planning/adhoc/{slug}/{slug}-SUMMARY.md` — documentation for work items executed via `/ms:adhoc`.
4
4
 
5
5
  ---
6
6
 
@@ -111,7 +111,7 @@ files_modified:
111
111
  - src/lib/api-client.ts
112
112
  - src/hooks/useAuth.ts
113
113
  commit: abc123f
114
- patch_file: .planning/adhoc/2026-01-20-fix-auth-token-not-refreshing-on-401.patch
114
+ patch_file: .planning/adhoc/fix-auth-token-not-refreshing-on-401/fix-auth-token-not-refreshing-on-401-changes.patch
115
115
  learnings:
116
116
  - "401 interceptors must queue concurrent requests during token refresh to avoid race conditions"
117
117
  ---
@@ -133,9 +133,13 @@ Present via AskUserQuestion with `multiSelect: true`:
133
133
  Create per-execution subdirectory:
134
134
 
135
135
  ```bash
136
- timestamp=$(date "+%Y-%m-%d")
137
136
  slug=$(echo "$description" | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9]/-/g' | sed 's/--*/-/g' | sed 's/^-//;s/-$//' | cut -c1-50)
138
- exec_dir=".planning/adhoc/${timestamp}-${slug}"
137
+ exec_dir=".planning/adhoc/${slug}"
138
+ if [ -d "$exec_dir" ]; then
139
+ echo "COLLISION: $exec_dir already exists from a previous adhoc execution"
140
+ echo "Choose a more specific description or remove the existing directory"
141
+ exit 1
142
+ fi
139
143
  mkdir -p "$exec_dir"
140
144
  ```
141
145
 
@@ -146,7 +150,7 @@ Assemble context payload for ms-adhoc-planner:
146
150
  - User decisions (from clarification step)
147
151
  - STATE.md context (current phase, accumulated decisions)
148
152
  - Subsystem list from config.json
149
- - Output path: `${exec_dir}/adhoc-01-PLAN.md`
153
+ - Output path: `${exec_dir}/${slug}-PLAN.md`
150
154
  - Ticket context when detected (per loaded ticket reference)
151
155
  - Todo context when detected (per loaded todo reference)
152
156
 
@@ -154,7 +158,7 @@ Spawn ms-adhoc-planner via Task tool. Receive completion report with plan path.
154
158
  </step>
155
159
 
156
160
  <step name="review_plan">
157
- Read the generated plan at `${exec_dir}/adhoc-01-PLAN.md`.
161
+ Read the generated plan at `${exec_dir}/${slug}-PLAN.md`.
158
162
 
159
163
  Present a summary to the user:
160
164
  - Number of Changes sections
@@ -170,12 +174,19 @@ If edits requested, apply them directly to the plan file, then re-present and as
170
174
  </step>
171
175
 
172
176
  <step name="spawn_executor">
177
+ Record pre-execution HEAD for accurate diff scoping:
178
+
179
+ ```bash
180
+ PRE_EXEC_HEAD=$(git rev-parse HEAD)
181
+ ```
182
+
173
183
  Spawn ms-executor via Task tool.
174
184
 
175
185
  Provide in the prompt:
176
- - Plan path: `${exec_dir}/adhoc-01-PLAN.md`
177
- - SUMMARY output path: `${exec_dir}/adhoc-01-SUMMARY.md`
186
+ - Plan path: `${exec_dir}/${slug}-PLAN.md`
187
+ - SUMMARY output path: `${exec_dir}/${slug}-SUMMARY.md`
178
188
  - Instruction to use phase-style SUMMARY format (with key-decisions, patterns-established, key-files, mock_hints frontmatter fields) for consolidator compatibility
189
+ - Commit scope: `"Use (${slug}) as commit scope for all task commits: {type}(${slug}): description"`
179
190
  - Ticket commit instructions when detected (per loaded ticket reference)
180
191
  - Todo commit instructions when detected (per loaded todo reference)
181
192
 
@@ -191,11 +202,11 @@ ms-tools browser-check
191
202
 
192
203
  **If exit 0 (READY):**
193
204
 
194
- Ensure `${exec_dir}/adhoc-01-SUMMARY.md` is available (needed for journey derivation — may already be in context from executor report).
205
+ Ensure `${exec_dir}/${slug}-SUMMARY.md` is available (needed for journey derivation — may already be in context from executor report).
195
206
 
196
207
  Read `~/.claude/mindsystem/references/browser-verification.md` and follow its sections in order:
197
208
  1. **Auth Flow** — establish browser authentication
198
- 2. **Derive User Journeys** — transform SUMMARY into user journeys (single file: `${exec_dir}/adhoc-01-SUMMARY.md`)
209
+ 2. **Derive User Journeys** — transform SUMMARY into user journeys (single file: `${exec_dir}/${slug}-SUMMARY.md`)
199
210
  3. **Spawn** — launch ms-browser-verifier with derived journeys, screenshots directory: `${exec_dir}/screenshots`
200
211
  4. **Post-Verifier Handling** — route by report status
201
212
 
@@ -232,8 +243,7 @@ CODE_REVIEW=$(ms-tools config-get code_review.adhoc)
232
243
 
233
244
  1. Get modified files from executor's commits:
234
245
  ```bash
235
- ADHOC_COMMITS=$(git log --oneline --grep="(adhoc-" --format="%H")
236
- CHANGED_FILES=$(git diff --name-only $(echo "$ADHOC_COMMITS" | tail -1)^..HEAD | grep -E '\.(dart|ts|tsx|js|jsx|swift|kt|py|go|rs)$')
246
+ CHANGED_FILES=$(git diff --name-only ${PRE_EXEC_HEAD}..HEAD | grep -E '\.(dart|ts|tsx|js|jsx|swift|kt|py|go|rs)$')
237
247
  ```
238
248
 
239
249
  2. Spawn code review agent with adhoc scope.
@@ -245,11 +255,13 @@ CODE_REVIEW=$(ms-tools config-get code_review.adhoc)
245
255
  Generate a patch file capturing all adhoc changes:
246
256
 
247
257
  ```bash
248
- ADHOC_COMMITS=$(git log --oneline --grep="(adhoc-" --format="%H")
249
- FIRST_COMMIT=$(echo "$ADHOC_COMMITS" | tail -1)
250
- LAST_COMMIT=$(echo "$ADHOC_COMMITS" | head -1)
251
- patch_file="${exec_dir}/adhoc-01-changes.patch"
252
- ms-tools generate-adhoc-patch "$FIRST_COMMIT" "$patch_file" --end "$LAST_COMMIT"
258
+ ADHOC_COMMITS=$(git log --reverse --grep="(${slug})" --format="%H" ${PRE_EXEC_HEAD}..HEAD)
259
+ FIRST_COMMIT=$(echo "$ADHOC_COMMITS" | head -1)
260
+ LAST_COMMIT=$(echo "$ADHOC_COMMITS" | tail -1)
261
+ patch_file="${exec_dir}/${slug}-changes.patch"
262
+ if [ -n "$FIRST_COMMIT" ]; then
263
+ ms-tools generate-adhoc-patch "$FIRST_COMMIT" "$patch_file" --end "$LAST_COMMIT"
264
+ fi
253
265
  ```
254
266
 
255
267
  If no adhoc commits found or patch generation reports no changes, skip silently.
@@ -262,7 +274,7 @@ Provide:
262
274
  - Phase directory: `${exec_dir}` (the per-execution subdirectory)
263
275
  - Phase identifier: "adhoc"
264
276
 
265
- The consolidator reads `adhoc-01-SUMMARY.md`, extracts knowledge (key-decisions, patterns-established, key-files), updates `.planning/knowledge/*.md` files, and deletes `adhoc-01-PLAN.md`.
277
+ The consolidator reads `${slug}-SUMMARY.md`, extracts knowledge (key-decisions, patterns-established, key-files), updates `.planning/knowledge/*.md` files, and deletes `${slug}-PLAN.md`.
266
278
  </step>
267
279
 
268
280
  <step name="cleanup_and_report">
@@ -272,15 +284,16 @@ The consolidator reads `adhoc-01-SUMMARY.md`, extracts knowledge (key-decisions,
272
284
 
273
285
  **Update STATE.md** "Recent Adhoc Work" section:
274
286
  - Find or create "### Recent Adhoc Work" under "## Accumulated Context"
275
- - Add entry at top: `- [YYYY-MM-DD]: [description] ({exec_dir}/adhoc-01-SUMMARY.md)`
287
+ - Add entry at top: `- [YYYY-MM-DD]: [description] ({exec_dir}/${slug}-SUMMARY.md)`
276
288
  - Keep last 5 entries (remove older ones from list)
277
289
 
278
290
  **Update state and commit:**
279
291
  ```bash
292
+ # Use the slug (sanitized directory name), not the raw description or ticket IDs
280
293
  ms-tools set-last-command "ms:adhoc ${slug}"
281
- git add .planning/knowledge/*.md "${exec_dir}/adhoc-01-SUMMARY.md" .planning/STATE.md
294
+ git add .planning/knowledge/*.md "${exec_dir}/${slug}-SUMMARY.md" .planning/STATE.md
282
295
  # Only include patch if it was generated
283
- [ -f "${exec_dir}/adhoc-01-changes.patch" ] && git add "${exec_dir}/adhoc-01-changes.patch"
296
+ [ -f "${exec_dir}/${slug}-changes.patch" ] && git add "${exec_dir}/${slug}-changes.patch"
284
297
  git commit -m "$(cat <<EOF
285
298
  docs(adhoc): consolidate knowledge from $description
286
299
 
@@ -298,8 +311,8 @@ Adhoc work complete: [description]
298
311
  **Knowledge updated:** [list of knowledge files]
299
312
 
300
313
  Artifacts:
301
- - Summary: {exec_dir}/adhoc-01-SUMMARY.md
302
- - Patch: {exec_dir}/adhoc-01-changes.patch
314
+ - Summary: {exec_dir}/${slug}-SUMMARY.md
315
+ - Patch: {exec_dir}/${slug}-changes.patch
303
316
  - Knowledge: .planning/knowledge/[subsystem].md
304
317
  ```
305
318
 
@@ -320,7 +320,7 @@ Ensure `$PHASE_DIR/*-SUMMARY.md` files are available (needed for journey derivat
320
320
  Read `~/.claude/mindsystem/references/browser-verification.md` and follow its sections in order:
321
321
  1. **Auth Flow** — establish browser authentication
322
322
  2. **Derive User Journeys** — transform SUMMARYs into user journeys
323
- 3. **Spawn** — launch verifier with derived journeys
323
+ 3. **Spawn** — launch verifier with derived journeys, screenshots directory: `$PHASE_DIR/screenshots`
324
324
  4. **Post-Verifier Handling** — route by report status
325
325
 
326
326
  **If exit 1 (MISSING_DEPS):**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mindsystem-cc",
3
- "version": "4.6.0",
3
+ "version": "4.6.1",
4
4
  "description": "The engineer's meta-prompting system for Claude Code.",
5
5
  "bin": {
6
6
  "mindsystem-cc": "bin/install.js"
@@ -2199,7 +2199,7 @@ def _scan_artifact_subsystem_values(planning: Path) -> list[str]:
2199
2199
  values: list[str] = []
2200
2200
  scan_globs = [
2201
2201
  ("phases", "*/*-SUMMARY.md"),
2202
- ("adhoc", "*-SUMMARY.md"),
2202
+ ("adhoc", "**/*-SUMMARY.md"),
2203
2203
  ("debug", "*.md"),
2204
2204
  ("debug/resolved", "*.md"),
2205
2205
  ("todos", "*.md"),
@@ -2321,7 +2321,7 @@ def cmd_scan_artifact_subsystems(args: argparse.Namespace) -> None:
2321
2321
 
2322
2322
  sections = [
2323
2323
  ("Phase SUMMARYs", "phases", "*/*-SUMMARY.md"),
2324
- ("Adhoc SUMMARYs", "adhoc", "*-SUMMARY.md"),
2324
+ ("Adhoc SUMMARYs", "adhoc", "**/*-SUMMARY.md"),
2325
2325
  ("Debug docs", "debug", "*.md"),
2326
2326
  ("Debug resolved", "debug/resolved", "*.md"),
2327
2327
  ("Pending Todos", "todos", "*.md"),