@massu/core 0.5.0 → 0.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 +40 -0
- package/agents/massu-architecture-reviewer.md +104 -0
- package/agents/massu-blast-radius-analyzer.md +84 -0
- package/agents/massu-competitive-scorer.md +126 -0
- package/agents/massu-help-sync.md +73 -0
- package/agents/massu-migration-writer.md +94 -0
- package/agents/massu-output-scorer.md +87 -0
- package/agents/massu-pattern-reviewer.md +84 -0
- package/agents/massu-plan-auditor.md +170 -0
- package/agents/massu-schema-sync-verifier.md +70 -0
- package/agents/massu-security-reviewer.md +98 -0
- package/agents/massu-ux-reviewer.md +106 -0
- package/commands/_shared-preamble.md +53 -23
- package/commands/_shared-references/auto-learning-protocol.md +71 -0
- package/commands/_shared-references/blast-radius-protocol.md +76 -0
- package/commands/_shared-references/security-pre-screen.md +64 -0
- package/commands/_shared-references/test-first-protocol.md +87 -0
- package/commands/_shared-references/verification-table.md +55 -0
- package/commands/massu-article-review.md +343 -0
- package/commands/massu-autoresearch/references/eval-runner.md +84 -0
- package/commands/massu-autoresearch/references/safety-rails.md +125 -0
- package/commands/massu-autoresearch/references/scoring-protocol.md +151 -0
- package/commands/massu-autoresearch.md +258 -0
- package/commands/massu-batch.md +44 -12
- package/commands/massu-bearings.md +42 -8
- package/commands/massu-checkpoint.md +588 -0
- package/commands/massu-ci-fix.md +2 -2
- package/commands/massu-command-health.md +132 -0
- package/commands/massu-command-improve.md +232 -0
- package/commands/massu-commit.md +205 -44
- package/commands/massu-create-plan.md +239 -57
- package/commands/massu-data/references/common-queries.md +79 -0
- package/commands/massu-data/references/table-guide.md +50 -0
- package/commands/massu-data.md +66 -0
- package/commands/massu-dead-code.md +29 -34
- package/commands/massu-debug/references/auto-learning.md +61 -0
- package/commands/massu-debug/references/codegraph-tracing.md +80 -0
- package/commands/massu-debug/references/common-shortcuts.md +98 -0
- package/commands/massu-debug/references/investigation-phases.md +294 -0
- package/commands/massu-debug/references/report-format.md +107 -0
- package/commands/massu-debug.md +105 -386
- package/commands/massu-docs.md +1 -1
- package/commands/massu-full-audit.md +61 -0
- package/commands/massu-gap-enhancement-analyzer.md +276 -16
- package/commands/massu-golden-path/references/approval-points.md +216 -0
- package/commands/massu-golden-path/references/competitive-mode.md +273 -0
- package/commands/massu-golden-path/references/error-handling.md +121 -0
- package/commands/massu-golden-path/references/phase-0-requirements.md +53 -0
- package/commands/massu-golden-path/references/phase-1-plan-creation.md +168 -0
- package/commands/massu-golden-path/references/phase-2-implementation.md +403 -0
- package/commands/massu-golden-path/references/phase-2.5-gap-analyzer.md +170 -0
- package/commands/massu-golden-path/references/phase-3-simplify.md +40 -0
- package/commands/massu-golden-path/references/phase-3.5-security-audit.md +108 -0
- package/commands/massu-golden-path/references/phase-4-commit.md +94 -0
- package/commands/massu-golden-path/references/phase-5-push.md +116 -0
- package/commands/massu-golden-path/references/phase-5.5-production-verify.md +170 -0
- package/commands/massu-golden-path/references/phase-6-completion.md +113 -0
- package/commands/massu-golden-path/references/qa-evaluator-spec.md +137 -0
- package/commands/massu-golden-path/references/sprint-contract-protocol.md +117 -0
- package/commands/massu-golden-path/references/vr-visual-calibration.md +73 -0
- package/commands/massu-golden-path.md +121 -844
- package/commands/massu-guide.md +72 -69
- package/commands/massu-hooks.md +27 -12
- package/commands/massu-hotfix.md +221 -144
- package/commands/massu-incident.md +49 -20
- package/commands/massu-infra-audit.md +187 -0
- package/commands/massu-learning-audit.md +211 -0
- package/commands/massu-loop/references/auto-learning.md +49 -0
- package/commands/massu-loop/references/checkpoint-audit.md +40 -0
- package/commands/massu-loop/references/guardrails.md +17 -0
- package/commands/massu-loop/references/iteration-structure.md +115 -0
- package/commands/massu-loop/references/loop-controller.md +188 -0
- package/commands/massu-loop/references/plan-extraction.md +78 -0
- package/commands/massu-loop/references/vr-plan-spec.md +140 -0
- package/commands/massu-loop-playwright.md +9 -9
- package/commands/massu-loop.md +115 -670
- package/commands/massu-new-pattern.md +423 -0
- package/commands/massu-perf.md +422 -0
- package/commands/massu-plan-audit.md +1 -1
- package/commands/massu-plan.md +389 -122
- package/commands/massu-production-verify.md +433 -0
- package/commands/massu-push.md +62 -378
- package/commands/massu-recap.md +29 -3
- package/commands/massu-rollback.md +613 -0
- package/commands/massu-scaffold-hook.md +2 -4
- package/commands/massu-scaffold-page.md +2 -3
- package/commands/massu-scaffold-router.md +1 -2
- package/commands/massu-security.md +619 -0
- package/commands/massu-simplify.md +115 -85
- package/commands/massu-squirrels.md +2 -2
- package/commands/massu-tdd.md +38 -22
- package/commands/massu-test.md +3 -3
- package/commands/massu-type-mismatch-audit.md +469 -0
- package/commands/massu-ui-audit.md +587 -0
- package/commands/massu-verify-playwright.md +287 -32
- package/commands/massu-verify.md +150 -46
- package/dist/cli.js +146 -95
- package/package.json +6 -2
- package/patterns/build-patterns.md +302 -0
- package/patterns/component-patterns.md +246 -0
- package/patterns/display-patterns.md +185 -0
- package/patterns/form-patterns.md +890 -0
- package/patterns/integration-testing-checklist.md +445 -0
- package/patterns/security-patterns.md +219 -0
- package/patterns/testing-patterns.md +569 -0
- package/patterns/tool-routing.md +81 -0
- package/patterns/ui-patterns.md +371 -0
- package/protocols/plan-implementation.md +267 -0
- package/protocols/recovery.md +225 -0
- package/protocols/verification.md +404 -0
- package/reference/command-taxonomy.md +178 -0
- package/reference/cr-rules-reference.md +76 -0
- package/reference/hook-execution-order.md +148 -0
- package/reference/lessons-learned.md +175 -0
- package/reference/patterns-quickref.md +208 -0
- package/reference/standards.md +135 -0
- package/reference/subagents-reference.md +17 -0
- package/reference/vr-verification-reference.md +867 -0
- package/src/commands/install-commands.ts +149 -53
package/commands/massu-batch.md
CHANGED
|
@@ -7,7 +7,7 @@ name: massu-batch
|
|
|
7
7
|
|
|
8
8
|
# Massu Batch: Parallel Code Migration via Worktree Agents
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
**Shared rules**: Read `.claude/commands/_shared-preamble.md` for POST-COMPACTION (CR-12), ENTERPRISE-GRADE (CR-14), AWS SECRETS (CR-5) rules.
|
|
11
11
|
|
|
12
12
|
---
|
|
13
13
|
|
|
@@ -17,7 +17,7 @@ name: massu-batch
|
|
|
17
17
|
/massu-batch [migration] → /massu-simplify → /massu-commit → /massu-push
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
-
**This command is for CODE-ONLY migrations. It REFUSES database work.**
|
|
20
|
+
**This command is for CODE-ONLY migrations. It REFUSES database work (CR-36 safety).**
|
|
21
21
|
|
|
22
22
|
---
|
|
23
23
|
|
|
@@ -37,16 +37,35 @@ Takes a migration description, identifies all affected files, splits them into b
|
|
|
37
37
|
|
|
38
38
|
Read `$ARGUMENTS` for the migration description.
|
|
39
39
|
|
|
40
|
-
If no arguments provided,
|
|
40
|
+
If no arguments provided, use AskUserQuestion:
|
|
41
|
+
```
|
|
42
|
+
question: "What code migration do you want to run?"
|
|
43
|
+
options:
|
|
44
|
+
- label: "Import path change"
|
|
45
|
+
description: "Rename/move imports across files (e.g., @/old/path → @/new/path)"
|
|
46
|
+
- label: "Component swap"
|
|
47
|
+
description: "Replace one component with another across files"
|
|
48
|
+
- label: "Pattern replacement"
|
|
49
|
+
description: "Replace a code pattern with a new one across files"
|
|
50
|
+
- label: "API update"
|
|
51
|
+
description: "Update API calls to a new format"
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Then ask for specifics:
|
|
41
55
|
- **Search pattern**: What to find (glob pattern or grep pattern)
|
|
42
56
|
- **Transformation**: What to change it to
|
|
43
57
|
- **Scope**: Directory to limit search (default: `src/`)
|
|
44
58
|
|
|
45
|
-
### Step 2: DB Guard (Safety Gate — MANDATORY)
|
|
59
|
+
### Step 2: DB Guard (CR-36 Safety Gate — MANDATORY)
|
|
46
60
|
|
|
47
61
|
**This step CANNOT be skipped. No exceptions.**
|
|
48
62
|
|
|
49
|
-
|
|
63
|
+
```bash
|
|
64
|
+
# Run the DB guard script
|
|
65
|
+
bash scripts/batch-db-guard.sh "$MIGRATION_DESCRIPTION" $TARGET_FILES
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Additionally, check the migration description for these keywords:
|
|
50
69
|
```
|
|
51
70
|
migration, schema, ALTER, CREATE TABLE, DROP, column, RLS, GRANT,
|
|
52
71
|
database, prisma, supabase, ctx.db, ctx.prisma, $queryRaw, execute_sql
|
|
@@ -65,8 +84,8 @@ supabase/migrations/
|
|
|
65
84
|
```
|
|
66
85
|
## DB GUARD: Migration Blocked
|
|
67
86
|
|
|
68
|
-
This migration touches database-related code. Database migrations
|
|
69
|
-
|
|
87
|
+
This migration touches database-related code. Database migrations MUST use
|
|
88
|
+
/massu-loop to ensure CR-36 compliance (all 3 environments in same session).
|
|
70
89
|
|
|
71
90
|
/massu-batch is designed for code-only migrations:
|
|
72
91
|
- Import path changes
|
|
@@ -122,6 +141,18 @@ Each agent will:
|
|
|
122
141
|
4. Report results
|
|
123
142
|
```
|
|
124
143
|
|
|
144
|
+
Use AskUserQuestion:
|
|
145
|
+
```
|
|
146
|
+
question: "Proceed with this batch migration plan?"
|
|
147
|
+
options:
|
|
148
|
+
- label: "Proceed"
|
|
149
|
+
description: "Execute the migration with M parallel agents"
|
|
150
|
+
- label: "Adjust batch size"
|
|
151
|
+
description: "Change the number of files per agent"
|
|
152
|
+
- label: "Cancel"
|
|
153
|
+
description: "Abort the migration"
|
|
154
|
+
```
|
|
155
|
+
|
|
125
156
|
**Wait for explicit user approval. Do NOT proceed without it.**
|
|
126
157
|
|
|
127
158
|
### Step 5: Execution Phase (Parallel Worktree Agents)
|
|
@@ -283,8 +314,8 @@ git worktree remove [path]
|
|
|
283
314
|
|
|
284
315
|
| Rule | Enforcement |
|
|
285
316
|
|------|-------------|
|
|
286
|
-
| **No database changes** | DB guard inline keyword check + path check |
|
|
287
|
-
| **User approval required** |
|
|
317
|
+
| **No database changes** | DB guard script + inline keyword check + path check |
|
|
318
|
+
| **User approval required** | AskUserQuestion before execution phase |
|
|
288
319
|
| **No file overlap between batches** | Planning phase ensures each file appears in exactly one batch |
|
|
289
320
|
| **Per-agent verification** | Each agent runs pattern-scanner + tsc before completing |
|
|
290
321
|
| **Consolidated verification** | Full checks run after merge |
|
|
@@ -314,7 +345,7 @@ git worktree remove [path]
|
|
|
314
345
|
|
|
315
346
|
| Scenario | Use Instead |
|
|
316
347
|
|----------|-------------|
|
|
317
|
-
| Database/schema changes | `/massu-loop` |
|
|
348
|
+
| Database/schema changes | `/massu-loop` (CR-36: all 3 envs) |
|
|
318
349
|
| < 5 files affected | Manual changes + `/massu-simplify` |
|
|
319
350
|
| New feature development | `/massu-create-plan` → `/massu-loop` |
|
|
320
351
|
| Cross-file dependencies | `/massu-loop` (sequential is safer) |
|
|
@@ -322,6 +353,7 @@ git worktree remove [path]
|
|
|
322
353
|
|
|
323
354
|
## Gotchas
|
|
324
355
|
|
|
325
|
-
- **NEVER for database work** — batch migrations are CODE-ONLY. Database migrations must be applied to all environments in sequence, which requires coordination that parallel agents cannot provide
|
|
356
|
+
- **NEVER for database work (CR-36)** — batch migrations are CODE-ONLY. Database migrations must be applied to all 3 environments in sequence, which requires coordination that parallel agents cannot provide
|
|
357
|
+
- **DB guard auto-refuses** — `scripts/batch-db-guard.sh` automatically blocks batch items that reference database tables, migrations, or SQL
|
|
326
358
|
- **Worktree isolation** — each agent runs in a git worktree. Changes must be mergeable. Agents editing the same file will cause merge conflicts
|
|
327
|
-
- **One task per agent** — each worktree agent gets exactly one plan item. Never combine unrelated items in a single agent
|
|
359
|
+
- **One task per agent (Principle #20)** — each worktree agent gets exactly one plan item. Never combine unrelated items in a single agent
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: massu-bearings
|
|
3
3
|
description: "When user starts a new session, says 'good morning', asks 'where was I', 'what should I work on', or needs session orientation after being away"
|
|
4
|
-
allowed-tools: Bash(*), Read(*), Grep(*), Glob(*)
|
|
4
|
+
allowed-tools: Bash(*), Read(*), Grep(*), Glob(*), mcp__massu-codegraph__massu_cost_session, mcp__massu-codegraph__massu_cost_trend, mcp__massu-codegraph__massu_cost_feature
|
|
5
5
|
---
|
|
6
6
|
name: massu-bearings
|
|
7
7
|
|
|
8
8
|
# Massu Bearings: Session Orientation
|
|
9
9
|
|
|
10
|
-
> **Shared rules apply.** Read `.claude/commands/_shared-preamble.md` before proceeding.
|
|
10
|
+
> **Shared rules apply.** Read `.claude/commands/_shared-preamble.md` before proceeding. CR-14, CR-5, CR-12 enforced.
|
|
11
11
|
|
|
12
12
|
---
|
|
13
13
|
|
|
@@ -41,6 +41,9 @@ Read these in parallel where possible:
|
|
|
41
41
|
| 10 | `.claude/metrics/command-invocations.jsonl` | Command usage frequency — top/least used in last 7 days |
|
|
42
42
|
| 11 | `.claude/metrics/bearings-history.jsonl` | Previous bearings runs — show trends |
|
|
43
43
|
| 12 | `.claude/commands/` (ls -d */`) | Detect folder-based skills (directories vs flat files) |
|
|
44
|
+
| 13 | `bash scripts/memory-contradiction-check.sh` | Contradiction count, consolidation candidates |
|
|
45
|
+
| 14 | `massu_cost_session` + `massu_cost_trend` MCP tools | Token spend this session, cost trend over time |
|
|
46
|
+
| 15 | `session-state/deferred-verifications.md` | Pending production verifications from previous deploys |
|
|
44
47
|
|
|
45
48
|
---
|
|
46
49
|
|
|
@@ -93,10 +96,28 @@ COMMAND USAGE (last 7 days)
|
|
|
93
96
|
Least: [command] (N invocations), [command] (N)
|
|
94
97
|
(or "No invocation data yet")
|
|
95
98
|
|
|
99
|
+
TOKEN SPEND
|
|
100
|
+
Session: $X.XX (N calls)
|
|
101
|
+
7-day trend: $XX.XX total, $X.XX/day avg
|
|
102
|
+
Top feature: [feature] ($X.XX)
|
|
103
|
+
(or "No cost data available — massu_cost_session returned empty")
|
|
104
|
+
|
|
96
105
|
FOLDER-BASED SKILLS
|
|
97
106
|
[list any commands that are directories: massu-golden-path, massu-debug, massu-loop, massu-data]
|
|
98
107
|
(or "No folder-based skills detected")
|
|
99
108
|
|
|
109
|
+
MEMORY HEALTH
|
|
110
|
+
Contradictions: [N] found
|
|
111
|
+
[1] file_a.md vs file_b.md — [brief description]
|
|
112
|
+
Consolidation candidates: [N]
|
|
113
|
+
(or "Memory is clean — 0 contradictions")
|
|
114
|
+
|
|
115
|
+
DEFERRED VERIFICATIONS
|
|
116
|
+
! [DV-001] [feature] — expected by [time], query: [sql snippet]
|
|
117
|
+
! [DV-002] [feature] — expected by [time], query: [sql snippet]
|
|
118
|
+
(or "No deferred verifications pending")
|
|
119
|
+
Action: Run `/massu-production-verify --deferred` to check
|
|
120
|
+
|
|
100
121
|
ACTIVE WARNINGS
|
|
101
122
|
- [any correction rules or memory enforcement reminders]
|
|
102
123
|
(or "No active warnings")
|
|
@@ -109,11 +130,12 @@ ACTIVE WARNINGS
|
|
|
109
130
|
## Suggested Focus Logic
|
|
110
131
|
|
|
111
132
|
Prioritize items in this order:
|
|
112
|
-
1. **
|
|
113
|
-
2. **
|
|
114
|
-
3. **
|
|
115
|
-
4. **
|
|
116
|
-
5. **
|
|
133
|
+
1. **Deferred verifications past due** — items in `session-state/deferred-verifications.md` past their expected verification time
|
|
134
|
+
2. **Blockers** — anything marked as blocked in CURRENT.md
|
|
135
|
+
3. **In-progress tasks** — partially completed work from last session
|
|
136
|
+
4. **Open plan items** — next items in an active plan
|
|
137
|
+
5. **Aging squirrels** — ideas parked > 7 days ago (mention but don't auto-promote)
|
|
138
|
+
6. **New work** — only if nothing else is open
|
|
117
139
|
|
|
118
140
|
Keep to 2-3 items. This is a focus list, not an inventory.
|
|
119
141
|
|
|
@@ -189,6 +211,18 @@ Read `.claude/metrics/command-invocations.jsonl`. Filter to last 7 days by `time
|
|
|
189
211
|
|
|
190
212
|
---
|
|
191
213
|
|
|
214
|
+
## Token Spend Logic
|
|
215
|
+
|
|
216
|
+
Call `massu_cost_session` MCP tool for current session cost. Call `massu_cost_trend` MCP tool for 7-day cost history. If either tool returns empty or errors, show "No cost data available — massu_cost_session returned empty". Otherwise:
|
|
217
|
+
|
|
218
|
+
1. **Session cost**: Display total cost and call count from `massu_cost_session`
|
|
219
|
+
2. **7-day trend**: Sum daily costs, calculate daily average from `massu_cost_trend`
|
|
220
|
+
3. **Top feature**: If `massu_cost_feature` data is available, show the most expensive feature
|
|
221
|
+
|
|
222
|
+
If the MCP tools are unavailable (server not running), skip this section silently — do NOT error or block the bearings output.
|
|
223
|
+
|
|
224
|
+
---
|
|
225
|
+
|
|
192
226
|
## Folder-Based Skill Detection
|
|
193
227
|
|
|
194
228
|
Run `ls -d .claude/commands/*/` to find commands that are directories. Display the list in FOLDER-BASED SKILLS section. Each folder-based skill has a `## Skill Contents` table in its main file listing sub-files.
|
|
@@ -197,7 +231,7 @@ Run `ls -d .claude/commands/*/` to find commands that are directories. Display t
|
|
|
197
231
|
|
|
198
232
|
## START NOW
|
|
199
233
|
|
|
200
|
-
1. Read all data sources in parallel (CURRENT.md, archives, squirrels, plans, git log, git diff, corrections, metrics, bearings-history)
|
|
234
|
+
1. Read all data sources in parallel (CURRENT.md, archives, squirrels, plans, git log, git diff, corrections, metrics, bearings-history, memory-contradiction-check, cost MCP tools)
|
|
201
235
|
2. Synthesize into the output format above
|
|
202
236
|
3. Present to terminal
|
|
203
237
|
4. Append bearings-history.jsonl entry
|