@massu/core 0.4.2 → 0.6.0
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 +52 -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 +397 -0
- package/commands/massu-golden-path/references/phase-2.5-gap-analyzer.md +156 -0
- package/commands/massu-golden-path/references/phase-3-simplify.md +40 -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 +114 -848
- 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 +1451 -1047
- package/dist/hooks/post-tool-use.js +75 -6
- package/dist/hooks/user-prompt.js +16 -0
- 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/init.ts +27 -0
- package/src/commands/install-commands.ts +149 -53
- package/src/hooks/post-tool-use.ts +17 -0
- package/src/hooks/user-prompt.ts +21 -0
- package/src/memory-file-ingest.ts +127 -0
- package/src/memory-tools.ts +34 -1
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
# Display Patterns
|
|
2
|
+
|
|
3
|
+
**Purpose**: Centralized formatting functions and display conventions for data presentation.
|
|
4
|
+
|
|
5
|
+
**When to Read**: Before displaying formatted data (currency, phone numbers, dates, names, file sizes).
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Centralized Formatters
|
|
10
|
+
|
|
11
|
+
### Canonical Formatting Functions
|
|
12
|
+
|
|
13
|
+
All formatting MUST use centralized functions from `@/lib/formatting/fields`:
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import {
|
|
17
|
+
formatMoney,
|
|
18
|
+
formatPhone,
|
|
19
|
+
formatDate,
|
|
20
|
+
formatFullName,
|
|
21
|
+
formatFileSize,
|
|
22
|
+
} from '@/lib/formatting/fields';
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Function Reference
|
|
26
|
+
|
|
27
|
+
| Function | Input | Output | Notes |
|
|
28
|
+
|----------|-------|--------|-------|
|
|
29
|
+
| `formatMoney(amount)` | `number` | `$1,234.56` | US currency, 2 decimal places |
|
|
30
|
+
| `formatPhone(phone)` | `string` (E.164) | `(555) 123-4567` | US format from E.164 |
|
|
31
|
+
| `formatDate(date)` | `Date \| string` | `Jan 15, 2026` | Medium format |
|
|
32
|
+
| `formatFullName(first, last)` | `string, string` | `John Doe` | Null-safe, trims whitespace |
|
|
33
|
+
| `formatFileSize(bytes)` | `number` | `1.5 MB` | Auto-scales units |
|
|
34
|
+
|
|
35
|
+
### Usage Examples
|
|
36
|
+
|
|
37
|
+
```typescript
|
|
38
|
+
// Currency
|
|
39
|
+
<span>{formatMoney(order.total)}</span>
|
|
40
|
+
// Output: "$1,234.56"
|
|
41
|
+
|
|
42
|
+
// Phone
|
|
43
|
+
<span>{formatPhone(contact.phone)}</span>
|
|
44
|
+
// Output: "(555) 123-4567"
|
|
45
|
+
|
|
46
|
+
// Date
|
|
47
|
+
<span>{formatDate(order.created_at)}</span>
|
|
48
|
+
// Output: "Jan 15, 2026"
|
|
49
|
+
|
|
50
|
+
// Name
|
|
51
|
+
<span>{formatFullName(user.first_name, user.last_name)}</span>
|
|
52
|
+
// Output: "John Doe"
|
|
53
|
+
|
|
54
|
+
// File size
|
|
55
|
+
<span>{formatFileSize(file.size)}</span>
|
|
56
|
+
// Output: "1.5 MB"
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## formatFileSize Pattern
|
|
62
|
+
|
|
63
|
+
**WRONG (inline definition - causes duplication):**
|
|
64
|
+
```typescript
|
|
65
|
+
// WRONG - creates duplicate implementations
|
|
66
|
+
function formatFileSize(bytes: number): string {
|
|
67
|
+
if (bytes === 0) return '0 B';
|
|
68
|
+
const k = 1024;
|
|
69
|
+
const sizes = ['B', 'KB', 'MB', 'GB'];
|
|
70
|
+
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
71
|
+
return `${parseFloat((bytes / k ** i).toFixed(2))} ${sizes[i]}`;
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
**CORRECT (import from canonical location):**
|
|
76
|
+
```typescript
|
|
77
|
+
import { formatFileSize } from '@/lib/formatting/fields';
|
|
78
|
+
|
|
79
|
+
<span>{formatFileSize(file.size)}</span>
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## EditableField Component
|
|
85
|
+
|
|
86
|
+
For inline editing with type-appropriate display:
|
|
87
|
+
|
|
88
|
+
```typescript
|
|
89
|
+
import { EditableField } from '@/components/common/EditableField';
|
|
90
|
+
|
|
91
|
+
<EditableField
|
|
92
|
+
label="Phone"
|
|
93
|
+
value={contact.phone}
|
|
94
|
+
type="phone"
|
|
95
|
+
onSave={(value) => updateContact({ phone: value })}
|
|
96
|
+
/>
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Supported Types
|
|
100
|
+
|
|
101
|
+
| Type | Display | Edit Control |
|
|
102
|
+
|------|---------|-------------|
|
|
103
|
+
| `text` | Plain text | Input |
|
|
104
|
+
| `phone` | Formatted phone | PhoneInput |
|
|
105
|
+
| `email` | Email with link | Input type=email |
|
|
106
|
+
| `money` | Currency formatted | Input type=number |
|
|
107
|
+
| `date` | Formatted date | DatePicker |
|
|
108
|
+
| `select` | Selected label | Select dropdown |
|
|
109
|
+
| `textarea` | Multi-line text | Textarea |
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
## DataTable Column Type Handlers
|
|
114
|
+
|
|
115
|
+
When defining DataTable columns, use type-appropriate formatters:
|
|
116
|
+
|
|
117
|
+
```typescript
|
|
118
|
+
const columns = [
|
|
119
|
+
{
|
|
120
|
+
accessorKey: 'name',
|
|
121
|
+
header: 'Name',
|
|
122
|
+
cell: ({ row }) => formatFullName(row.original.first_name, row.original.last_name),
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
accessorKey: 'phone',
|
|
126
|
+
header: 'Phone',
|
|
127
|
+
cell: ({ row }) => row.original.phone ? formatPhone(row.original.phone) : '—',
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
accessorKey: 'total',
|
|
131
|
+
header: 'Total',
|
|
132
|
+
cell: ({ row }) => formatMoney(row.original.total),
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
accessorKey: 'created_at',
|
|
136
|
+
header: 'Created',
|
|
137
|
+
cell: ({ row }) => formatDate(row.original.created_at),
|
|
138
|
+
},
|
|
139
|
+
];
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
## International Formatting
|
|
145
|
+
|
|
146
|
+
For locale-aware formatting, use functions from `@/lib/i18n/formatting`:
|
|
147
|
+
|
|
148
|
+
```typescript
|
|
149
|
+
import {
|
|
150
|
+
formatCurrency,
|
|
151
|
+
formatNumber,
|
|
152
|
+
formatRelativeTime,
|
|
153
|
+
} from '@/lib/i18n/formatting';
|
|
154
|
+
|
|
155
|
+
// Currency with locale
|
|
156
|
+
formatCurrency(1234.56, 'USD', 'en-US') // "$1,234.56"
|
|
157
|
+
formatCurrency(1234.56, 'EUR', 'de-DE') // "1.234,56 €"
|
|
158
|
+
|
|
159
|
+
// Relative time
|
|
160
|
+
formatRelativeTime(new Date('2026-01-14')) // "2 days ago"
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## Display Rules
|
|
166
|
+
|
|
167
|
+
| Rule | Pattern | Error if Violated |
|
|
168
|
+
|------|---------|-------------------|
|
|
169
|
+
| Always use centralized formatters | Import from `@/lib/formatting/fields` | Inconsistent formatting |
|
|
170
|
+
| Never inline format functions | Use canonical imports | Duplicate code, drift |
|
|
171
|
+
| Null-safe display | `value ?? '—'` for missing data | Blank cells confuse users |
|
|
172
|
+
| Consistent empty state | Use em dash `—` not empty string | Visual clarity |
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
## Related Documentation
|
|
177
|
+
|
|
178
|
+
- **Component Patterns**: `patterns/component-patterns.md`
|
|
179
|
+
- **Form Patterns**: `patterns/form-patterns.md`
|
|
180
|
+
- **UI Patterns**: `patterns/ui-patterns.md`
|
|
181
|
+
|
|
182
|
+
---
|
|
183
|
+
|
|
184
|
+
**Document Status**: ACTIVE
|
|
185
|
+
**Compliance**: Mandatory — all formatting must use centralized functions
|