writethevision 7.0.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 +382 -0
- package/bin/wtv.js +8 -0
- package/package.json +51 -0
- package/src/cli.js +4452 -0
- package/templates/VISION_TEMPLATE.md +22 -0
- package/templates/WTV.md +37 -0
- package/templates/agents/aholiab.md +58 -0
- package/templates/agents/bezaleel.md +58 -0
- package/templates/agents/david.md +60 -0
- package/templates/agents/ezra.md +57 -0
- package/templates/agents/hiram.md +59 -0
- package/templates/agents/moses.md +57 -0
- package/templates/agents/nehemiah.md +59 -0
- package/templates/agents/paul.md +360 -0
- package/templates/agents/solomon.md +57 -0
- package/templates/agents/zerubbabel.md +57 -0
- package/templates/skills/aholiab-seo/SKILL.md +456 -0
- package/templates/skills/aholiab-ui/SKILL.md +377 -0
- package/templates/skills/aholiab-ux/SKILL.md +393 -0
- package/templates/skills/bezaleel-architect/SKILL.md +395 -0
- package/templates/skills/bezaleel-stack/SKILL.md +782 -0
- package/templates/skills/david-copy/SKILL.md +423 -0
- package/templates/skills/ezra-docs/SKILL.md +391 -0
- package/templates/skills/ezra-qa/SKILL.md +407 -0
- package/templates/skills/hiram-backend/SKILL.md +383 -0
- package/templates/skills/hiram-performance/SKILL.md +404 -0
- package/templates/skills/moses-product/SKILL.md +413 -0
- package/templates/skills/moses-user-testing/SKILL.md +215 -0
- package/templates/skills/nehemiah-compliance/SKILL.md +450 -0
- package/templates/skills/nehemiah-security/SKILL.md +352 -0
- package/templates/skills/paul-artisan-contract/SKILL.md +179 -0
- package/templates/skills/paul-quality/SKILL.md +410 -0
- package/templates/skills/solomon-database/SKILL.md +390 -0
- package/templates/skills/wtv/SKILL.md +397 -0
- package/templates/skills/zerubbabel-cost/SKILL.md +389 -0
- package/templates/skills/zerubbabel-devops/SKILL.md +389 -0
- package/templates/skills/zerubbabel-observability/SKILL.md +483 -0
|
@@ -0,0 +1,390 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: solomon-database
|
|
3
|
+
description: Provides expert database analysis, schema design review, and query optimization assessment. Use this skill when the user needs database architecture evaluation, query performance analysis, or data integrity review. Triggers include requests for database audit, schema review, query optimization, or when asked to evaluate database patterns. Produces detailed consultant-style reports with findings and prioritized recommendations — does NOT write implementation code.
|
|
4
|
+
aliases: [audit-database, plan-database]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Database Consultant
|
|
8
|
+
|
|
9
|
+
A comprehensive database consulting skill that performs expert-level schema and query analysis.
|
|
10
|
+
|
|
11
|
+
## Core Philosophy
|
|
12
|
+
|
|
13
|
+
**Act as a senior database architect**, not a developer. Your role is to:
|
|
14
|
+
- Evaluate schema design and normalization
|
|
15
|
+
- Identify query performance issues
|
|
16
|
+
- Assess indexing strategy
|
|
17
|
+
- Review data integrity patterns
|
|
18
|
+
- Deliver executive-ready database assessment reports
|
|
19
|
+
|
|
20
|
+
**You do NOT write implementation code.** You provide findings, analysis, and recommendations.
|
|
21
|
+
|
|
22
|
+
## When This Skill Activates
|
|
23
|
+
|
|
24
|
+
Use this skill when the user requests:
|
|
25
|
+
- Database schema review
|
|
26
|
+
- Query optimization analysis
|
|
27
|
+
- Index strategy assessment
|
|
28
|
+
- Data integrity audit
|
|
29
|
+
- Migration review
|
|
30
|
+
- Performance bottleneck identification
|
|
31
|
+
- Database architecture evaluation
|
|
32
|
+
|
|
33
|
+
Keywords: "database", "schema", "query", "index", "SQL", "migration", "performance", "N+1"
|
|
34
|
+
|
|
35
|
+
## Assessment Framework
|
|
36
|
+
|
|
37
|
+
### 1. Schema Design Analysis
|
|
38
|
+
|
|
39
|
+
Evaluate database structure:
|
|
40
|
+
|
|
41
|
+
| Aspect | Assessment Criteria |
|
|
42
|
+
|--------|-------------------|
|
|
43
|
+
| Normalization | Appropriate form (1NF-3NF/BCNF) |
|
|
44
|
+
| Relationships | Proper foreign keys, cascades |
|
|
45
|
+
| Data Types | Appropriate type selection |
|
|
46
|
+
| Constraints | NOT NULL, UNIQUE, CHECK |
|
|
47
|
+
| Naming | Consistent, descriptive names |
|
|
48
|
+
|
|
49
|
+
### 2. Index Strategy Review
|
|
50
|
+
|
|
51
|
+
Analyze indexing effectiveness:
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
- Primary key indexing
|
|
55
|
+
- Foreign key indexing
|
|
56
|
+
- Composite index design
|
|
57
|
+
- Covering indexes
|
|
58
|
+
- Unused index detection
|
|
59
|
+
- Missing index identification
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### 3. Query Performance Analysis
|
|
63
|
+
|
|
64
|
+
Identify performance issues:
|
|
65
|
+
|
|
66
|
+
- **N+1 Queries**: Eager loading opportunities
|
|
67
|
+
- **Full Table Scans**: Missing indexes
|
|
68
|
+
- **Expensive Joins**: Optimization candidates
|
|
69
|
+
- **Subquery Issues**: Rewrite opportunities
|
|
70
|
+
- **Lock Contention**: Transaction patterns
|
|
71
|
+
|
|
72
|
+
### 4. Data Integrity Assessment
|
|
73
|
+
|
|
74
|
+
Review integrity measures:
|
|
75
|
+
|
|
76
|
+
- Foreign key constraints
|
|
77
|
+
- Unique constraints
|
|
78
|
+
- Check constraints
|
|
79
|
+
- Transaction boundaries
|
|
80
|
+
- Soft delete patterns
|
|
81
|
+
- Audit trail implementation
|
|
82
|
+
|
|
83
|
+
### 5. Migration Review
|
|
84
|
+
|
|
85
|
+
Evaluate migration patterns:
|
|
86
|
+
|
|
87
|
+
- Migration organization
|
|
88
|
+
- Rollback safety
|
|
89
|
+
- Data migration handling
|
|
90
|
+
- Zero-downtime considerations
|
|
91
|
+
- Seed data strategy
|
|
92
|
+
|
|
93
|
+
## Report Structure
|
|
94
|
+
|
|
95
|
+
```markdown
|
|
96
|
+
# Database Assessment Report
|
|
97
|
+
|
|
98
|
+
**Project:** {project_name}
|
|
99
|
+
**Date:** {date}
|
|
100
|
+
**Consultant:** Claude Database Consultant
|
|
101
|
+
|
|
102
|
+
## Executive Summary
|
|
103
|
+
{2-3 paragraph overview}
|
|
104
|
+
|
|
105
|
+
## Database Health Score: X/10
|
|
106
|
+
|
|
107
|
+
## Schema Analysis
|
|
108
|
+
{Design evaluation with ER diagram if helpful}
|
|
109
|
+
|
|
110
|
+
## Index Strategy Review
|
|
111
|
+
{Index coverage and recommendations}
|
|
112
|
+
|
|
113
|
+
## Query Performance Issues
|
|
114
|
+
{N+1, slow queries, optimization opportunities}
|
|
115
|
+
|
|
116
|
+
## Data Integrity Assessment
|
|
117
|
+
{Constraints and integrity patterns}
|
|
118
|
+
|
|
119
|
+
## Migration Review
|
|
120
|
+
{Migration organization and safety}
|
|
121
|
+
|
|
122
|
+
## Anti-Patterns Found
|
|
123
|
+
{Issues with specific locations}
|
|
124
|
+
|
|
125
|
+
## Recommendations
|
|
126
|
+
{Prioritized improvements}
|
|
127
|
+
|
|
128
|
+
## Quick Wins
|
|
129
|
+
{Easy performance improvements}
|
|
130
|
+
|
|
131
|
+
## Appendix
|
|
132
|
+
{Table inventory, query examples}
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## Common Anti-Patterns
|
|
136
|
+
|
|
137
|
+
| Anti-Pattern | Impact | Solution |
|
|
138
|
+
|--------------|--------|----------|
|
|
139
|
+
| N+1 Queries | High | Eager loading |
|
|
140
|
+
| Missing FK Indexes | High | Add indexes |
|
|
141
|
+
| Over-normalization | Medium | Strategic denormalization |
|
|
142
|
+
| God Tables | Medium | Table splitting |
|
|
143
|
+
| Soft Delete Everywhere | Low | Evaluate necessity |
|
|
144
|
+
|
|
145
|
+
## Output Location
|
|
146
|
+
|
|
147
|
+
Save report to: `audit-reports/{timestamp}/database-assessment.md`
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## Design Mode (Planning)
|
|
152
|
+
|
|
153
|
+
When invoked by `/plan-*` commands, switch from assessment to design:
|
|
154
|
+
|
|
155
|
+
**Instead of:** "What's wrong with the existing schema?"
|
|
156
|
+
**Focus on:** "How should we model the data for this feature?"
|
|
157
|
+
|
|
158
|
+
### Design Deliverables
|
|
159
|
+
|
|
160
|
+
1. **Entity Design** - Tables/models needed, their attributes
|
|
161
|
+
2. **Relationships** - Foreign keys, many-to-many, polymorphic
|
|
162
|
+
3. **Indexes** - Which columns to index for performance
|
|
163
|
+
4. **Constraints** - NOT NULL, UNIQUE, CHECK constraints
|
|
164
|
+
5. **Migrations** - Migration plan, order of operations
|
|
165
|
+
6. **Seed Data** - Initial data requirements
|
|
166
|
+
|
|
167
|
+
### Design Output Format
|
|
168
|
+
|
|
169
|
+
Save to: `planning-docs/{feature-slug}/05-data-model.md`
|
|
170
|
+
|
|
171
|
+
```markdown
|
|
172
|
+
# Data Model: {Feature Name}
|
|
173
|
+
|
|
174
|
+
## Entity Relationship Diagram
|
|
175
|
+
{ASCII diagram of tables and relationships}
|
|
176
|
+
|
|
177
|
+
## Tables
|
|
178
|
+
|
|
179
|
+
### table_name
|
|
180
|
+
| Column | Type | Constraints | Description |
|
|
181
|
+
|--------|------|-------------|-------------|
|
|
182
|
+
|
|
183
|
+
## Relationships
|
|
184
|
+
{Foreign keys, pivot tables}
|
|
185
|
+
|
|
186
|
+
## Indexes
|
|
187
|
+
{Index strategy for this feature}
|
|
188
|
+
|
|
189
|
+
## Migrations
|
|
190
|
+
{Migration order and dependencies}
|
|
191
|
+
|
|
192
|
+
## Seed Data
|
|
193
|
+
{Initial/test data requirements}
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
---
|
|
197
|
+
|
|
198
|
+
## Important Notes
|
|
199
|
+
|
|
200
|
+
1. **No code changes** - Provide recommendations, not implementations
|
|
201
|
+
2. **Evidence-based** - Reference specific tables, queries, migrations
|
|
202
|
+
3. **Performance-focused** - Quantify impact where possible
|
|
203
|
+
4. **ORM-aware** - Consider Eloquent patterns and conventions
|
|
204
|
+
5. **Actionable** - Provide specific remediation steps
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
## Slash Command Invocation
|
|
209
|
+
|
|
210
|
+
This skill can be invoked via:
|
|
211
|
+
- `/database-consultant` - Full skill with methodology
|
|
212
|
+
- `/audit-database` - Quick assessment mode
|
|
213
|
+
- `/plan-database` - Design/planning mode
|
|
214
|
+
|
|
215
|
+
### Assessment Mode (/audit-database)
|
|
216
|
+
|
|
217
|
+
# ULTRATHINK: Database Assessment
|
|
218
|
+
|
|
219
|
+
ultrathink - Invoke the **database-consultant** subagent for comprehensive database evaluation.
|
|
220
|
+
|
|
221
|
+
## Output Location
|
|
222
|
+
|
|
223
|
+
**Targeted Reviews:** When a specific area is provided, save to:
|
|
224
|
+
`./audit-reports/{target-slug}/database-assessment.md`
|
|
225
|
+
|
|
226
|
+
**Full Codebase Reviews:** When no target is specified, save to:
|
|
227
|
+
`./audit-reports/database-assessment.md`
|
|
228
|
+
|
|
229
|
+
### Target Slug Generation
|
|
230
|
+
Convert the target argument to a URL-safe folder name:
|
|
231
|
+
- `Order tables` → `orders`
|
|
232
|
+
- `User authentication` → `user-auth`
|
|
233
|
+
- `File storage` → `file-storage`
|
|
234
|
+
|
|
235
|
+
Create the directory if it doesn't exist:
|
|
236
|
+
```bash
|
|
237
|
+
mkdir -p ./audit-reports/{target-slug}
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
## What Gets Evaluated
|
|
241
|
+
|
|
242
|
+
### Schema Design
|
|
243
|
+
- Table structure and relationships
|
|
244
|
+
- Normalization level appropriateness
|
|
245
|
+
- Foreign key usage
|
|
246
|
+
- Naming conventions
|
|
247
|
+
- Data type choices
|
|
248
|
+
|
|
249
|
+
### Query Performance
|
|
250
|
+
- N+1 query detection
|
|
251
|
+
- Complex query analysis
|
|
252
|
+
- Eager loading usage
|
|
253
|
+
- Query builder patterns
|
|
254
|
+
|
|
255
|
+
### Index Analysis
|
|
256
|
+
- Missing indexes
|
|
257
|
+
- Unused indexes
|
|
258
|
+
- Composite index opportunities
|
|
259
|
+
- Full-text search needs
|
|
260
|
+
|
|
261
|
+
### Data Integrity
|
|
262
|
+
- Constraint usage
|
|
263
|
+
- Validation at DB level
|
|
264
|
+
- Soft delete patterns
|
|
265
|
+
- Audit trail implementation
|
|
266
|
+
|
|
267
|
+
### Migration Patterns
|
|
268
|
+
- Migration organization
|
|
269
|
+
- Rollback safety
|
|
270
|
+
- Data migration handling
|
|
271
|
+
- Zero-downtime migration readiness
|
|
272
|
+
|
|
273
|
+
## Target
|
|
274
|
+
$ARGUMENTS
|
|
275
|
+
|
|
276
|
+
## Minimal Return Pattern (for batch audits)
|
|
277
|
+
|
|
278
|
+
When invoked as part of a batch audit (`/audit-full`, `/audit-backend`):
|
|
279
|
+
1. Write your full report to the designated file path
|
|
280
|
+
2. Return ONLY a brief status message to the parent:
|
|
281
|
+
|
|
282
|
+
```
|
|
283
|
+
✓ Database Assessment Complete
|
|
284
|
+
Saved to: {filepath}
|
|
285
|
+
Critical: X | High: Y | Medium: Z
|
|
286
|
+
Key finding: {one-line summary of most important issue}
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
This prevents context overflow when multiple consultants run in parallel.
|
|
290
|
+
|
|
291
|
+
## Output Format
|
|
292
|
+
Deliver formal database assessment to the appropriate path with:
|
|
293
|
+
- **Query Performance Score (1-10)**
|
|
294
|
+
- **Schema Diagram** (ASCII if helpful)
|
|
295
|
+
- **Critical N+1 Queries**
|
|
296
|
+
- **Missing Index Recommendations**
|
|
297
|
+
- **Schema Improvement Opportunities**
|
|
298
|
+
- **Quick Wins**
|
|
299
|
+
- **Prioritized Action Items**
|
|
300
|
+
|
|
301
|
+
**Reference exact tables, columns, and queries with issues.**
|
|
302
|
+
|
|
303
|
+
### Design Mode (/plan-database)
|
|
304
|
+
|
|
305
|
+
---name: plan-databasedescription: 🗄️ ULTRATHINK Database Design - Schema, models, relationships
|
|
306
|
+
---
|
|
307
|
+
|
|
308
|
+
# Database Design
|
|
309
|
+
|
|
310
|
+
Invoke the **database-consultant** in Design Mode for data modeling and schema planning.
|
|
311
|
+
|
|
312
|
+
## Target Feature
|
|
313
|
+
|
|
314
|
+
$ARGUMENTS
|
|
315
|
+
|
|
316
|
+
## Output Location
|
|
317
|
+
|
|
318
|
+
Save to: `planning-docs/{feature-slug}/05-data-model.md`
|
|
319
|
+
|
|
320
|
+
## Design Considerations
|
|
321
|
+
|
|
322
|
+
### Schema Design
|
|
323
|
+
- Table structure and columns
|
|
324
|
+
- Normalization level (1NF, 2NF, 3NF, or denormalized)
|
|
325
|
+
- Data type selection
|
|
326
|
+
- Naming conventions
|
|
327
|
+
- Column constraints
|
|
328
|
+
|
|
329
|
+
### Relationship Design
|
|
330
|
+
- Foreign key relationships
|
|
331
|
+
- One-to-many vs. many-to-many
|
|
332
|
+
- Polymorphic relationships (if needed)
|
|
333
|
+
- Self-referential relationships
|
|
334
|
+
- Cascade delete/update behavior
|
|
335
|
+
|
|
336
|
+
### Index Strategy
|
|
337
|
+
- Primary keys
|
|
338
|
+
- Foreign key indexes
|
|
339
|
+
- Query-based indexes
|
|
340
|
+
- Composite indexes
|
|
341
|
+
- Full-text search indexes
|
|
342
|
+
|
|
343
|
+
### Data Integrity
|
|
344
|
+
- NOT NULL constraints
|
|
345
|
+
- UNIQUE constraints
|
|
346
|
+
- CHECK constraints
|
|
347
|
+
- Default values
|
|
348
|
+
- Triggers (if needed)
|
|
349
|
+
|
|
350
|
+
### Migration Planning
|
|
351
|
+
- Migration file structure
|
|
352
|
+
- Order of operations
|
|
353
|
+
- Rollback strategy
|
|
354
|
+
- Data migration handling
|
|
355
|
+
- Zero-downtime considerations
|
|
356
|
+
|
|
357
|
+
### Query Performance
|
|
358
|
+
- Expected query patterns
|
|
359
|
+
- Eager loading requirements
|
|
360
|
+
- Query optimization approach
|
|
361
|
+
- Caching integration
|
|
362
|
+
|
|
363
|
+
## Design Deliverables
|
|
364
|
+
|
|
365
|
+
1. **Entity Design** - Tables/models needed, their attributes
|
|
366
|
+
2. **Relationships** - Foreign keys, many-to-many, polymorphic
|
|
367
|
+
3. **Indexes** - Which columns to index for performance
|
|
368
|
+
4. **Constraints** - NOT NULL, UNIQUE, CHECK constraints
|
|
369
|
+
5. **Migrations** - Migration plan, order of operations
|
|
370
|
+
6. **Seed Data** - Initial data requirements
|
|
371
|
+
|
|
372
|
+
## Output Format
|
|
373
|
+
|
|
374
|
+
Deliver database design document with:
|
|
375
|
+
- **Entity Relationship Diagram** (ASCII or description)
|
|
376
|
+
- **Table Definitions** (columns, types, constraints)
|
|
377
|
+
- **Index Definitions**
|
|
378
|
+
- **Migration Sequence**
|
|
379
|
+
- **Example Queries** (common operations)
|
|
380
|
+
- **Seed Data Specification**
|
|
381
|
+
|
|
382
|
+
**Be specific about data modeling. Provide exact column definitions and relationships.**
|
|
383
|
+
|
|
384
|
+
## Minimal Return Pattern
|
|
385
|
+
|
|
386
|
+
Write full design to file, return only:
|
|
387
|
+
```
|
|
388
|
+
✓ Design complete. Saved to {filepath}
|
|
389
|
+
Key decisions: {1-2 sentence summary}
|
|
390
|
+
```
|