vibe-validate 0.17.6 → 0.18.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vibe-validate",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.0",
|
|
4
4
|
"description": "Git-aware validation orchestration for vibe coding (LLM-assisted development) - umbrella package",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -50,13 +50,13 @@
|
|
|
50
50
|
"access": "public"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@vibe-validate/cli": "0.
|
|
53
|
+
"@vibe-validate/cli": "0.18.0"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@types/node": "^20.19.26",
|
|
57
57
|
"typescript": "^5.9.3",
|
|
58
58
|
"vitest": "^2.1.9",
|
|
59
|
-
"@vibe-validate/utils": "0.
|
|
59
|
+
"@vibe-validate/utils": "0.18.0"
|
|
60
60
|
},
|
|
61
61
|
"scripts": {
|
|
62
62
|
"test": "vitest run",
|
package/skill/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: vibe-validate
|
|
3
|
-
version: 0.
|
|
3
|
+
version: 0.18.0 # Tracks vibe-validate package version
|
|
4
4
|
description: Expert guidance for vibe-validate, an LLM-optimized validation orchestration tool. Use when working with vibe-validate commands, configuration, pre-commit workflows, or validation orchestration in TypeScript projects.
|
|
5
5
|
model: claude-sonnet-4-5
|
|
6
6
|
tools:
|
|
@@ -238,7 +238,7 @@ vibe-validate sync-check --yaml # YAML output only
|
|
|
238
238
|
|
|
239
239
|
### `cleanup`
|
|
240
240
|
|
|
241
|
-
|
|
241
|
+
Comprehensive branch cleanup with GitHub integration
|
|
242
242
|
|
|
243
243
|
**What it does:**
|
|
244
244
|
|
|
@@ -255,12 +255,6 @@ Post-merge cleanup (switch to main, delete merged branches)
|
|
|
255
255
|
|
|
256
256
|
**When to use:** After PR merge to clean up local branches
|
|
257
257
|
|
|
258
|
-
**Options:**
|
|
259
|
-
|
|
260
|
-
- `--main-branch <branch>` - Main branch name
|
|
261
|
-
- `--dry-run` - Show what would be deleted without actually deleting
|
|
262
|
-
- `--yaml` - Output YAML only (no human-friendly display)
|
|
263
|
-
|
|
264
258
|
**Examples:**
|
|
265
259
|
|
|
266
260
|
```bash
|
|
@@ -386,7 +380,7 @@ vibe-validate doctor --yaml # YAML output only
|
|
|
386
380
|
|
|
387
381
|
### `watch-pr`
|
|
388
382
|
|
|
389
|
-
|
|
383
|
+
Monitor PR checks with auto-polling, error extraction, and flaky test detection (use after creating PR, run after each push)
|
|
390
384
|
|
|
391
385
|
**What it does:**
|
|
392
386
|
|
|
@@ -407,11 +401,13 @@ Watch CI checks for a pull/merge request in real-time
|
|
|
407
401
|
|
|
408
402
|
**Options:**
|
|
409
403
|
|
|
410
|
-
- `--
|
|
411
|
-
- `--
|
|
412
|
-
- `--
|
|
404
|
+
- `--yaml` - Force YAML output (auto-enabled on failure)
|
|
405
|
+
- `--repo <owner/repo>` - Repository (default: auto-detect from git remote)
|
|
406
|
+
- `--history` - Show historical runs for the PR with pass/fail summary
|
|
407
|
+
- `--run-id <id>` - Watch specific run ID instead of latest (useful for testing failed runs)
|
|
408
|
+
- `--timeout <seconds>` - Maximum polling time in seconds (default: 1800 = 30 min)
|
|
413
409
|
- `--poll-interval <seconds>` - Polling frequency in seconds (default: 10)
|
|
414
|
-
- `--fail-fast` - Exit immediately on first check failure
|
|
410
|
+
- `--fail-fast` - Exit immediately on first check failure (no polling)
|
|
415
411
|
|
|
416
412
|
**Error recovery:**
|
|
417
413
|
|
|
@@ -339,6 +339,249 @@ extract(output: string) {
|
|
|
339
339
|
- Output has unexpected whitespace or formatting
|
|
340
340
|
- Error lines are multi-line but code assumes single-line
|
|
341
341
|
|
|
342
|
+
## Testing Your Plugin
|
|
343
|
+
|
|
344
|
+
### Why Test?
|
|
345
|
+
|
|
346
|
+
Testing ensures your extractor:
|
|
347
|
+
- Correctly identifies tool output (detection)
|
|
348
|
+
- Accurately parses errors (extraction)
|
|
349
|
+
- Handles edge cases (empty output, malformed data)
|
|
350
|
+
- Maintains quality over time (regression prevention)
|
|
351
|
+
|
|
352
|
+
### Using the Test Helpers
|
|
353
|
+
|
|
354
|
+
vibe-validate provides universal test helpers to make testing consistent and simple.
|
|
355
|
+
|
|
356
|
+
**Import the helpers:**
|
|
357
|
+
```typescript
|
|
358
|
+
import { describe, it, expect } from 'vitest';
|
|
359
|
+
import {
|
|
360
|
+
expectPluginMetadata,
|
|
361
|
+
expectDetection,
|
|
362
|
+
expectExtractionResult,
|
|
363
|
+
expectEmptyExtraction,
|
|
364
|
+
expectErrorObject,
|
|
365
|
+
} from '@vibe-validate/extractors/testing';
|
|
366
|
+
|
|
367
|
+
import myPlugin from './index.js';
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
### Test Helper Reference
|
|
371
|
+
|
|
372
|
+
#### 1. `expectPluginMetadata(plugin, expected)`
|
|
373
|
+
|
|
374
|
+
Verifies plugin metadata (name, priority, hints, tags).
|
|
375
|
+
|
|
376
|
+
```typescript
|
|
377
|
+
describe('metadata', () => {
|
|
378
|
+
it('should have correct plugin metadata', () => {
|
|
379
|
+
expectPluginMetadata(myPlugin, {
|
|
380
|
+
name: 'my-tool',
|
|
381
|
+
priority: 85,
|
|
382
|
+
requiredHints: ['ERROR:', 'FAILED'],
|
|
383
|
+
tags: ['build', 'compiler'],
|
|
384
|
+
});
|
|
385
|
+
expect(myPlugin).toBeDefined();
|
|
386
|
+
});
|
|
387
|
+
});
|
|
388
|
+
```
|
|
389
|
+
|
|
390
|
+
**Parameters:**
|
|
391
|
+
- `name`: Plugin name (must match metadata.name)
|
|
392
|
+
- `priority`: Detection priority (10-100, higher = checked first)
|
|
393
|
+
- `requiredHints`: Patterns that must appear in output (optional)
|
|
394
|
+
- `tags`: Plugin tags for categorization (optional)
|
|
395
|
+
|
|
396
|
+
#### 2. `expectDetection(plugin, output, expected)`
|
|
397
|
+
|
|
398
|
+
Verifies detection logic returns correct confidence and reasoning.
|
|
399
|
+
|
|
400
|
+
```typescript
|
|
401
|
+
describe('detect', () => {
|
|
402
|
+
it('should detect tool output with high confidence', () => {
|
|
403
|
+
expectDetection(
|
|
404
|
+
myPlugin,
|
|
405
|
+
'ERROR: Build failed at line 42',
|
|
406
|
+
{
|
|
407
|
+
confidence: 90,
|
|
408
|
+
patterns: ['ERROR:', 'Build failed'],
|
|
409
|
+
reasonContains: 'Tool-specific error format detected',
|
|
410
|
+
}
|
|
411
|
+
);
|
|
412
|
+
expect(myPlugin).toBeDefined();
|
|
413
|
+
});
|
|
414
|
+
|
|
415
|
+
it('should not detect non-tool output', () => {
|
|
416
|
+
expectDetection(
|
|
417
|
+
myPlugin,
|
|
418
|
+
'Some random text',
|
|
419
|
+
{
|
|
420
|
+
confidence: 0,
|
|
421
|
+
}
|
|
422
|
+
);
|
|
423
|
+
expect(myPlugin).toBeDefined();
|
|
424
|
+
});
|
|
425
|
+
});
|
|
426
|
+
```
|
|
427
|
+
|
|
428
|
+
**Parameters:**
|
|
429
|
+
- `confidence`: Expected confidence (0-100) or `{ min: number }` for range
|
|
430
|
+
- `patterns`: Array of pattern descriptions (optional)
|
|
431
|
+
- `reasonContains`: Substring expected in detection reason (optional)
|
|
432
|
+
|
|
433
|
+
#### 3. `expectExtractionResult(result, expected)`
|
|
434
|
+
|
|
435
|
+
Verifies extraction result structure and content.
|
|
436
|
+
|
|
437
|
+
```typescript
|
|
438
|
+
describe('extract', () => {
|
|
439
|
+
it('should extract errors from tool output', () => {
|
|
440
|
+
const output = 'ERROR: Type mismatch at src/index.ts:42:5';
|
|
441
|
+
const result = myPlugin.extract(output);
|
|
442
|
+
|
|
443
|
+
expectExtractionResult(result, {
|
|
444
|
+
errorCount: 1,
|
|
445
|
+
summaryPattern: '1 error(s)',
|
|
446
|
+
});
|
|
447
|
+
|
|
448
|
+
expect(result.errors[0].file).toBe('src/index.ts');
|
|
449
|
+
});
|
|
450
|
+
});
|
|
451
|
+
```
|
|
452
|
+
|
|
453
|
+
**Parameters:**
|
|
454
|
+
- `errorCount`: Expected number of errors
|
|
455
|
+
- `summaryPattern`: Regex or string to match against result.summary
|
|
456
|
+
|
|
457
|
+
#### 4. `expectEmptyExtraction(extractFn, expectedSummary)`
|
|
458
|
+
|
|
459
|
+
Verifies behavior when no errors are found.
|
|
460
|
+
|
|
461
|
+
```typescript
|
|
462
|
+
describe('extract', () => {
|
|
463
|
+
it('should handle empty output', () => {
|
|
464
|
+
expectEmptyExtraction(myPlugin.extract, '0 error(s)');
|
|
465
|
+
});
|
|
466
|
+
});
|
|
467
|
+
```
|
|
468
|
+
|
|
469
|
+
**Parameters:**
|
|
470
|
+
- `extractFn`: Extract function reference
|
|
471
|
+
- `expectedSummary`: Expected summary for empty results
|
|
472
|
+
|
|
473
|
+
#### 5. `expectErrorObject(error, expected)`
|
|
474
|
+
|
|
475
|
+
Verifies individual error object fields.
|
|
476
|
+
|
|
477
|
+
```typescript
|
|
478
|
+
describe('extract', () => {
|
|
479
|
+
it('should parse error details correctly', () => {
|
|
480
|
+
const output = 'ERROR: Type mismatch at src/index.ts:42:5';
|
|
481
|
+
const result = myPlugin.extract(output);
|
|
482
|
+
|
|
483
|
+
expectErrorObject(result.errors[0], {
|
|
484
|
+
file: 'src/index.ts',
|
|
485
|
+
line: 42,
|
|
486
|
+
column: 5,
|
|
487
|
+
severity: 'error',
|
|
488
|
+
messageContains: 'Type mismatch',
|
|
489
|
+
});
|
|
490
|
+
});
|
|
491
|
+
});
|
|
492
|
+
```
|
|
493
|
+
|
|
494
|
+
**Parameters:**
|
|
495
|
+
- `file`: Expected file path
|
|
496
|
+
- `line`: Expected line number
|
|
497
|
+
- `column`: Expected column number (optional)
|
|
498
|
+
- `severity`: 'error' | 'warning'
|
|
499
|
+
- `code`: Error code (e.g., 'TS2322') (optional)
|
|
500
|
+
- `messageContains`: Substring expected in error message
|
|
501
|
+
|
|
502
|
+
### Complete Test Example
|
|
503
|
+
|
|
504
|
+
```typescript
|
|
505
|
+
/**
|
|
506
|
+
* My Tool Extractor Tests
|
|
507
|
+
*/
|
|
508
|
+
import { describe, it, expect } from 'vitest';
|
|
509
|
+
import {
|
|
510
|
+
expectPluginMetadata,
|
|
511
|
+
expectDetection,
|
|
512
|
+
expectExtractionResult,
|
|
513
|
+
expectEmptyExtraction,
|
|
514
|
+
expectErrorObject,
|
|
515
|
+
} from '@vibe-validate/extractors/testing';
|
|
516
|
+
|
|
517
|
+
import myToolPlugin from './index.js';
|
|
518
|
+
|
|
519
|
+
describe('My Tool Extractor Plugin', () => {
|
|
520
|
+
describe('detect', () => {
|
|
521
|
+
it('should detect tool output', () => {
|
|
522
|
+
expectDetection(
|
|
523
|
+
myToolPlugin,
|
|
524
|
+
'ERROR: Build failed',
|
|
525
|
+
{
|
|
526
|
+
confidence: 90,
|
|
527
|
+
patterns: ['ERROR:', 'Build failed'],
|
|
528
|
+
reasonContains: 'tool',
|
|
529
|
+
}
|
|
530
|
+
);
|
|
531
|
+
expect(myToolPlugin).toBeDefined();
|
|
532
|
+
});
|
|
533
|
+
});
|
|
534
|
+
|
|
535
|
+
describe('extract', () => {
|
|
536
|
+
it('should extract single error', () => {
|
|
537
|
+
const output = 'ERROR: Type error at src/index.ts:42:5';
|
|
538
|
+
const result = myToolPlugin.extract(output);
|
|
539
|
+
|
|
540
|
+
expectExtractionResult(result, {
|
|
541
|
+
errorCount: 1,
|
|
542
|
+
summaryPattern: '1 error(s)',
|
|
543
|
+
});
|
|
544
|
+
|
|
545
|
+
expectErrorObject(result.errors[0], {
|
|
546
|
+
file: 'src/index.ts',
|
|
547
|
+
line: 42,
|
|
548
|
+
column: 5,
|
|
549
|
+
severity: 'error',
|
|
550
|
+
messageContains: 'Type error',
|
|
551
|
+
});
|
|
552
|
+
});
|
|
553
|
+
|
|
554
|
+
it('should handle no errors', () => {
|
|
555
|
+
expectEmptyExtraction(myToolPlugin.extract, '0 error(s)');
|
|
556
|
+
});
|
|
557
|
+
});
|
|
558
|
+
|
|
559
|
+
describe('metadata', () => {
|
|
560
|
+
it('should have correct metadata', () => {
|
|
561
|
+
expectPluginMetadata(myToolPlugin, {
|
|
562
|
+
name: 'my-tool',
|
|
563
|
+
priority: 85,
|
|
564
|
+
requiredHints: ['ERROR:'],
|
|
565
|
+
});
|
|
566
|
+
expect(myToolPlugin).toBeDefined();
|
|
567
|
+
});
|
|
568
|
+
});
|
|
569
|
+
});
|
|
570
|
+
```
|
|
571
|
+
|
|
572
|
+
### Running Tests
|
|
573
|
+
|
|
574
|
+
```bash
|
|
575
|
+
# Run all tests
|
|
576
|
+
npm test
|
|
577
|
+
|
|
578
|
+
# Run tests in watch mode
|
|
579
|
+
npm test -- --watch
|
|
580
|
+
|
|
581
|
+
# Run specific test file
|
|
582
|
+
npm test -- index.test.ts
|
|
583
|
+
```
|
|
584
|
+
|
|
342
585
|
## Advanced: Contributing Back
|
|
343
586
|
|
|
344
587
|
Once your plugin is working well:
|