vibe-validate 0.17.0 → 0.17.1-rc.3

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.
@@ -0,0 +1,980 @@
1
+ # Configuration Reference
2
+
3
+ Complete reference for vibe-validate configuration options.
4
+
5
+ ## Configuration File
6
+
7
+ vibe-validate uses **YAML** as the configuration format.
8
+
9
+ The configuration file must be named `vibe-validate.config.yaml` in your project root.
10
+
11
+ ## Basic Configuration
12
+
13
+ ### YAML Configuration
14
+
15
+ ```yaml
16
+ # vibe-validate.config.yaml
17
+
18
+ # JSON Schema for IDE autocomplete and validation
19
+ $schema: https://unpkg.com/@vibe-validate/config/config.schema.json
20
+
21
+ # Git integration settings
22
+ git:
23
+ mainBranch: main
24
+ remoteOrigin: origin
25
+ autoSync: false # Never auto-merge - safety first
26
+
27
+ # Validation configuration
28
+ validation:
29
+ failFast: true # Stop at first failure
30
+ ```
31
+
32
+ ### Configuration with Custom Phases
33
+
34
+ Example with custom validation phases:
35
+
36
+ ```yaml
37
+ # vibe-validate.config.yaml
38
+ $schema: https://raw.githubusercontent.com/jdutton/vibe-validate/main/packages/config/config.schema.json
39
+
40
+ git:
41
+ mainBranch: main
42
+ remoteOrigin: origin
43
+ autoSync: false
44
+
45
+ validation:
46
+ # Define custom validation phases
47
+ phases:
48
+ - name: Pre-Qualification
49
+ parallel: true # Run steps simultaneously
50
+ steps:
51
+ - name: TypeScript
52
+ command: tsc --noEmit
53
+ description: Type-check TypeScript files
54
+ - name: ESLint
55
+ command: eslint src/
56
+ description: Lint source code
57
+
58
+ - name: Testing
59
+ parallel: false # Run steps sequentially
60
+ steps:
61
+ - name: Unit Tests
62
+ command: npm test
63
+ description: Run unit tests with coverage
64
+
65
+ failFast: false # Continue even if a step fails
66
+ ```
67
+
68
+ ## Configuration Schema
69
+
70
+ ### Top-Level Options
71
+
72
+ ```yaml
73
+ validation: # Required - validation configuration
74
+ phases: []
75
+
76
+ git: # Optional - git integration settings
77
+ mainBranch: main
78
+ ```
79
+
80
+ ## Validation Configuration
81
+
82
+ ### `validation.phases`
83
+
84
+ Array of validation phases. Each phase groups related validation steps.
85
+
86
+ **Type**: `Phase[]`
87
+
88
+ **Required**: Yes
89
+
90
+ ```yaml
91
+ phases:
92
+ - name: Phase Name # Required: string
93
+ parallel: false # Optional: boolean (default: false)
94
+ steps: # Required: array of steps
95
+ - name: Step Name
96
+ command: command here
97
+ ```
98
+
99
+ ### Phase Options
100
+
101
+ #### `name` (required)
102
+
103
+ Display name for the phase.
104
+
105
+ **Type**: `string`
106
+
107
+ **Example**: `"Pre-Qualification"`, `"Testing"`, `"Build"`
108
+
109
+ #### `parallel` (optional)
110
+
111
+ Controls execution strategy for validation steps both locally and in CI workflows.
112
+
113
+ **Type**: `boolean`
114
+
115
+ **Default**: `false` (recommended for most projects)
116
+
117
+ **Impact**:
118
+ - **Local validation**: Steps run in parallel (true) or sequentially (false)
119
+ - **CI workflows**: Determines GitHub Actions job grouping strategy (see below)
120
+
121
+ **CI Job Grouping Strategies**:
122
+
123
+ When you run `vibe-validate generate-workflow`, the `parallel` flag controls how GitHub Actions jobs are created:
124
+
125
+ 1. **Phase-Based Grouping (`parallel: false`)** - Recommended Default
126
+ - Creates **ONE GitHub Actions job per phase**
127
+ - All steps run sequentially as workflow steps within that job
128
+ - **Benefits**:
129
+ - Reduces CI runner usage by 40-70% (fewer jobs = fewer runners)
130
+ - Eliminates runner startup overhead (10-20s per job)
131
+ - Lower cost and faster overall for quick steps
132
+ - **Best for**: Fast validation steps (< 30s each) where parallelism overhead exceeds actual work time
133
+
134
+ 2. **Step-Based Parallelism (`parallel: true`)** - For Slow Steps
135
+ - Creates **separate GitHub Actions job per step**
136
+ - Steps run in parallel across multiple runners
137
+ - **Benefits**:
138
+ - Maximum parallelism for independent, slow steps
139
+ - Faster overall execution when steps take 1+ minute each
140
+ - **Trade-offs**:
141
+ - Higher CI runner usage (more jobs = more runners)
142
+ - Runner startup overhead multiplied by number of steps
143
+ - Higher cost but faster for slow steps
144
+
145
+ **Decision Guide**: When to Use Each Strategy
146
+
147
+ | Scenario | Recommendation | Reason |
148
+ |----------|---------------|---------|
149
+ | Fast validation steps (< 30s each) | `parallel: false` | Startup overhead dominates actual work time |
150
+ | Slow, independent steps (1+ min each) | `parallel: true` | Parallelism benefits outweigh overhead |
151
+ | Bootstrap projects (need build artifacts) | `parallel: false` in Phase 1 | Avoid redundant rebuilds across runners |
152
+ | Cost-sensitive CI usage | `parallel: false` | Minimize runner usage and GitHub Actions minutes |
153
+ | Maximum speed with resources | `parallel: true` | Accept higher cost for faster feedback |
154
+
155
+ **Examples**:
156
+
157
+ ```yaml
158
+ # Phase-based grouping (recommended default)
159
+ # All 4 steps run in ONE GitHub Actions job
160
+ - name: Pre-Qualification
161
+ parallel: false
162
+ steps:
163
+ - name: TypeScript Type Check
164
+ command: pnpm typecheck
165
+ - name: ESLint
166
+ command: pnpm lint
167
+ - name: Code Duplication Check
168
+ command: node tools/jscpd-check.js
169
+ - name: Build Packages
170
+ command: pnpm -r build
171
+
172
+ # Step-based parallelism (for slow steps)
173
+ # Each step runs in separate GitHub Actions job
174
+ - name: Testing
175
+ parallel: true
176
+ steps:
177
+ - name: Unit Tests (slow)
178
+ command: pnpm test:coverage
179
+ - name: Integration Tests (slow)
180
+ command: pnpm test:integration
181
+ - name: E2E Tests (slow)
182
+ command: pnpm test:e2e
183
+ ```
184
+
185
+ **Build Phase Placement**:
186
+
187
+ Where you place your build step matters:
188
+
189
+ ```yaml
190
+ # Bootstrap projects (CLI tools, validation depends on build)
191
+ validation:
192
+ phases:
193
+ - name: Pre-Qualification
194
+ parallel: false # Build first to avoid redundant rebuilds
195
+ steps:
196
+ - name: Build Packages
197
+ command: pnpm -r build
198
+ - name: TypeScript
199
+ command: pnpm typecheck
200
+ - name: ESLint
201
+ command: pnpm lint
202
+
203
+ - name: Testing
204
+ steps:
205
+ - name: Unit Tests
206
+ command: pnpm test
207
+
208
+ # Non-bootstrap projects (tests don't need build artifacts)
209
+ validation:
210
+ phases:
211
+ - name: Pre-Qualification
212
+ parallel: false
213
+ steps:
214
+ - name: TypeScript
215
+ command: pnpm typecheck
216
+ - name: ESLint
217
+ command: pnpm lint
218
+
219
+ - name: Testing
220
+ steps:
221
+ - name: Unit Tests
222
+ command: pnpm test
223
+
224
+ - name: Build
225
+ steps:
226
+ - name: Build
227
+ command: pnpm build # Verify "can I ship?" last
228
+ ```
229
+
230
+ **Cost vs Speed Tradeoffs**:
231
+
232
+ | Configuration | CI Runners | Typical Duration | Best For |
233
+ |--------------|------------|------------------|----------|
234
+ | 1 phase, `parallel: false`, 4 fast steps | 1 runner | 45s (4×10s + 5s overhead) | Small projects, fast checks |
235
+ | 1 phase, `parallel: true`, 4 fast steps | 4 runners | 30s (10s + 20s overhead) | Not recommended (overhead > work) |
236
+ | 1 phase, `parallel: false`, 3 slow steps | 1 runner | 180s (3×60s) | Cost-effective, acceptable speed |
237
+ | 1 phase, `parallel: true`, 3 slow steps | 3 runners | 80s (60s + 20s overhead) | Faster but 3x cost |
238
+
239
+ **Migration Note**: Existing configs with `parallel: false` will now create phase-based jobs in CI (previously this flag was ignored). Regenerate workflows with `vibe-validate generate-workflow` to use the new optimization.
240
+
241
+ #### `timeout` (optional)
242
+
243
+ Default timeout for all steps in this phase (in milliseconds).
244
+
245
+ **Type**: `number`
246
+
247
+ **Default**: `300000` (5 minutes)
248
+
249
+ **Example**:
250
+ ```yaml
251
+ - name: End-to-End Tests
252
+ parallel: false
253
+ timeout: 900000 # 15 minutes for all steps in this phase
254
+ steps:
255
+ - name: E2E Tests
256
+ command: npm run test:e2e
257
+ ```
258
+
259
+ **Note**: Individual steps can override this with their own `timeout` property.
260
+
261
+ #### `failFast` (optional)
262
+
263
+ Stop executing steps in this phase after first failure.
264
+
265
+ **Type**: `boolean`
266
+
267
+ **Default**: `true`
268
+
269
+ **Examples**:
270
+ ```yaml
271
+ # Stop phase on first step failure (default)
272
+ - name: Pre-Qualification
273
+ parallel: true
274
+ failFast: true # Stop if TypeScript OR ESLint fails
275
+ steps:
276
+ - name: TypeScript
277
+ command: tsc --noEmit
278
+ - name: ESLint
279
+ command: eslint src/
280
+
281
+ # Run all steps even if some fail (collect all errors)
282
+ - name: Code Quality Checks
283
+ parallel: true
284
+ failFast: false # Run all checks to see all issues
285
+ steps:
286
+ - name: TypeScript
287
+ command: tsc --noEmit
288
+ - name: ESLint
289
+ command: eslint src/
290
+ - name: Prettier
291
+ command: prettier --check src/
292
+ ```
293
+
294
+ **Note**: This is different from `validation.failFast` which controls whether to stop ALL validation (all phases) on first phase failure.
295
+
296
+ ### Step Configuration
297
+
298
+ #### `name` (required)
299
+
300
+ Display name for the validation step.
301
+
302
+ **Type**: `string`
303
+
304
+ **Example**: `"TypeScript"`, `"Unit Tests"`, `"Build"`
305
+
306
+ #### `command` (required)
307
+
308
+ Shell command to execute for this validation step.
309
+
310
+ **Type**: `string`
311
+
312
+ **Examples**:
313
+ ```yaml
314
+ - name: TypeScript
315
+ command: tsc --noEmit
316
+
317
+ - name: ESLint
318
+ command: eslint src/ --max-warnings=0
319
+
320
+ - name: Tests
321
+ command: vitest run --coverage
322
+
323
+ - name: Build
324
+ command: npm run build
325
+ ```
326
+
327
+ **Note**: Commands run in the project root directory by default (see `cwd` option to override).
328
+
329
+ #### `description` (optional)
330
+
331
+ Human-readable description of what this step does.
332
+
333
+ **Type**: `string`
334
+
335
+ **Example**:
336
+ ```yaml
337
+ - name: TypeScript
338
+ command: tsc --noEmit
339
+ description: Type-check all TypeScript files
340
+ ```
341
+
342
+ **Note**: Used for documentation and informational purposes only.
343
+
344
+ #### `timeout` (optional)
345
+
346
+ Override the phase timeout for this specific step (in milliseconds).
347
+
348
+ **Type**: `number`
349
+
350
+ **Default**: Inherits from `phase.timeout` (300000ms = 5 minutes)
351
+
352
+ **Example**:
353
+ ```yaml
354
+ - name: Integration Tests
355
+ command: npm run test:integration
356
+ timeout: 600000 # 10 minutes (longer than phase default)
357
+ ```
358
+
359
+ #### `continueOnError` (optional)
360
+
361
+ Continue to next step even if this step fails.
362
+
363
+ **Type**: `boolean`
364
+
365
+ **Default**: `false`
366
+
367
+ **Example**:
368
+ ```yaml
369
+ - name: Optional Linter
370
+ command: npm run lint:experimental
371
+ continueOnError: true # Don't fail phase if this fails
372
+ ```
373
+
374
+ **Use case**: Non-critical checks that shouldn't block validation.
375
+
376
+ #### `env` (optional)
377
+
378
+ Environment variables to set for this step only.
379
+
380
+ **Type**: `object` (key-value pairs)
381
+
382
+ **Example**:
383
+ ```yaml
384
+ - name: Tests
385
+ command: npm test
386
+ env:
387
+ NODE_ENV: test
388
+ CI: "true"
389
+ COVERAGE: "true"
390
+
391
+ - name: Build
392
+ command: npm run build
393
+ env:
394
+ NODE_ENV: production
395
+ BUILD_TARGET: es2020
396
+ ```
397
+
398
+ **Note**: These variables are merged with system environment variables (step-level vars take precedence).
399
+
400
+ #### `cwd` (optional)
401
+
402
+ Working directory for this step's command, **relative to git repository root** (v0.17.0+).
403
+
404
+ **Type**: `string` (relative path)
405
+
406
+ **Default**: Git repository root
407
+
408
+ **Breaking change in v0.17.0**: The `cwd` field is now interpreted relative to git root (not current directory). This provides consistent behavior regardless of where you invoke validation.
409
+
410
+ **Path resolution**:
411
+ - All paths are relative to git repository root
412
+ - Absolute paths are **not allowed** (security)
413
+ - Path traversal (`../`) outside git root is **rejected**
414
+ - Examples:
415
+ - `cwd: packages/core` → resolves to `<git-root>/packages/core`
416
+ - `cwd: services/backend` → resolves to `<git-root>/services/backend`
417
+ - `cwd: ../other-repo` → **ERROR** (escapes git root)
418
+
419
+ **Example**:
420
+ ```yaml
421
+ # Multi-language monorepo
422
+ validation:
423
+ phases:
424
+ - name: test
425
+ parallel: true
426
+ steps:
427
+ # Java backend
428
+ - name: test-backend
429
+ command: mvn test
430
+ cwd: services/backend
431
+
432
+ # TypeScript frontend
433
+ - name: test-frontend
434
+ command: npm test
435
+ cwd: apps/web
436
+
437
+ # Python ML service
438
+ - name: test-ml
439
+ command: pytest
440
+ cwd: services/ml-engine
441
+ ```
442
+
443
+ **Use case**: Perfect for monorepos and heterogeneous projects with multiple languages or build systems. See the [Heterogeneous Projects Guide](heterogeneous-projects.md) for comprehensive examples.
444
+
445
+ **Security**: All `cwd` paths are validated to prevent directory traversal attacks. Paths must resolve within the git repository.
446
+
447
+ **CI/CD integration**: When you run `vibe-validate generate-workflow`, steps with `cwd` automatically get `working-directory` in GitHub Actions:
448
+ ```yaml
449
+ # Generated workflow
450
+ - name: Test Backend
451
+ working-directory: services/backend
452
+ run: mvn test
453
+ ```
454
+
455
+ **Cache optimization**: Using `cwd` field instead of `cd` commands improves cache hit rates by 30-50% in monorepo scenarios.
456
+
457
+ ### `validation.failFast`
458
+
459
+ Whether to stop validation at first phase failure.
460
+
461
+ **Type**: `boolean`
462
+
463
+ **Default**: `true`
464
+
465
+ **Options**:
466
+
467
+ - **`true`** (default): Stops at first phase failure
468
+ - Faster feedback on breakage
469
+ - Useful for quick iteration
470
+ - May hide subsequent issues
471
+
472
+ - **`false`**: Runs all validation phases even if some fail
473
+ - Provides complete error visibility
474
+ - Shows all issues in one run
475
+ - Better for fixing multiple issues at once
476
+
477
+ **Example**:
478
+ ```yaml
479
+ validation:
480
+ failFast: false # Run all phases even if one fails
481
+ phases:
482
+ # ... (your phases here)
483
+ ```
484
+
485
+ ## Git Configuration
486
+
487
+ Configuration for git workflow integration.
488
+
489
+ ### `git.mainBranch`
490
+
491
+ Name of the main branch to sync with.
492
+
493
+ **Type**: `string`
494
+
495
+ **Default**: `'main'`
496
+
497
+ **Examples**:
498
+ ```yaml
499
+ # Most projects
500
+ git:
501
+ mainBranch: main
502
+
503
+ # Legacy projects
504
+ git:
505
+ mainBranch: master
506
+
507
+ # Git-flow projects
508
+ git:
509
+ mainBranch: develop
510
+ ```
511
+
512
+ ### `git.remoteOrigin`
513
+
514
+ Name of the git remote to sync with.
515
+
516
+ **Type**: `string`
517
+
518
+ **Default**: `'origin'`
519
+
520
+ **When to customize**:
521
+ - **Forked repositories**: Use `upstream` to sync with the original repository
522
+ - **Multiple remotes**: Specify which remote to track for validation
523
+ - **Enterprise workflows**: Custom remote names for internal git servers
524
+
525
+ **Examples**:
526
+ ```yaml
527
+ # Standard workflow (most projects)
528
+ git:
529
+ mainBranch: main
530
+ remoteOrigin: origin
531
+
532
+ # Forked repository workflow
533
+ git:
534
+ mainBranch: main
535
+ remoteOrigin: upstream # Sync with upstream, not your fork
536
+
537
+ # Git-flow with custom remote
538
+ git:
539
+ mainBranch: develop
540
+ remoteOrigin: upstream # Track upstream/develop
541
+ ```
542
+
543
+ **How it's used**:
544
+ - `pre-commit` command: Checks if branch is behind `<remoteOrigin>/<mainBranch>`
545
+ - `sync-check` command: Verifies sync with `<remoteOrigin>/<mainBranch>`
546
+ - Branch validation: Ensures you're up-to-date before committing
547
+
548
+ ### `git.autoSync`
549
+
550
+ Whether to automatically merge/rebase when behind main branch.
551
+
552
+ **Type**: `boolean`
553
+
554
+ **Default**: `false`
555
+
556
+ **Safety**: This option is **always false** for safety. vibe-validate never auto-merges.
557
+
558
+ **Example**:
559
+ ```yaml
560
+ git:
561
+ autoSync: false # Never auto-merge (always false)
562
+ ```
563
+
564
+ ## CI Configuration
565
+
566
+ Configuration for GitHub Actions workflow generation (via `generate-workflow` command).
567
+
568
+ ### `ci.nodeVersions` (optional)
569
+
570
+ Node.js versions to test in CI matrix.
571
+
572
+ **Type**: `string[]`
573
+
574
+ **Default**: `['20', '22']`
575
+
576
+ **Example**:
577
+ ```yaml
578
+ ci:
579
+ nodeVersions: ['20', '22', '24'] # Test on Node.js 20, 22, and 24
580
+ ```
581
+
582
+ ### `ci.os` (optional)
583
+
584
+ Operating systems to test in CI matrix.
585
+
586
+ **Type**: `string[]`
587
+
588
+ **Default**: `['ubuntu-latest']`
589
+
590
+ **Example**:
591
+ ```yaml
592
+ ci:
593
+ os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
594
+ ```
595
+
596
+ ### `ci.failFast` (optional)
597
+
598
+ Stop CI matrix on first failure.
599
+
600
+ **Type**: `boolean`
601
+
602
+ **Default**: `false`
603
+
604
+ **Example**:
605
+ ```yaml
606
+ ci:
607
+ failFast: true # Stop testing other OS/Node combos on first failure
608
+ ```
609
+
610
+ ### `ci.coverage` (optional)
611
+
612
+ Enable coverage reporting in CI.
613
+
614
+ **Type**: `boolean`
615
+
616
+ **Default**: `false`
617
+
618
+ **Example**:
619
+ ```yaml
620
+ ci:
621
+ coverage: true # Upload coverage reports to Codecov
622
+ ```
623
+
624
+ **Complete CI Example**:
625
+ ```yaml
626
+ ci:
627
+ nodeVersions: ['20', '22', '24']
628
+ os: ['ubuntu-latest', 'macos-latest']
629
+ failFast: false
630
+ coverage: true
631
+ ```
632
+
633
+ ## Hooks Configuration
634
+
635
+ Configuration for git hooks (pre-commit, etc.).
636
+
637
+ ### `hooks.preCommit.enabled` (optional)
638
+
639
+ Enable pre-commit hook checking during `doctor` command.
640
+
641
+ **Type**: `boolean`
642
+
643
+ **Default**: `true`
644
+
645
+ **Example**:
646
+ ```yaml
647
+ hooks:
648
+ preCommit:
649
+ enabled: false # Skip pre-commit hook checks
650
+ ```
651
+
652
+ ### `hooks.preCommit.command` (optional)
653
+
654
+ Custom command to run in pre-commit hook.
655
+
656
+ **Type**: `string`
657
+
658
+ **Default**: `'npx vibe-validate pre-commit'`
659
+
660
+ **Example**:
661
+ ```yaml
662
+ hooks:
663
+ preCommit:
664
+ enabled: true
665
+ command: 'pnpm vibe-validate pre-commit' # Use pnpm instead of npx
666
+ ```
667
+
668
+ **Complete Hooks Example**:
669
+ ```yaml
670
+ hooks:
671
+ preCommit:
672
+ enabled: true
673
+ command: 'npx vibe-validate pre-commit'
674
+ ```
675
+
676
+ ## Using Config Templates
677
+
678
+ Start with a template and customize as needed.
679
+
680
+ ### Available Templates
681
+
682
+ - **`minimal`**: Bare-bones starting point
683
+ - **`typescript-library`**: For npm packages and libraries
684
+ - **`typescript-nodejs`**: For Node.js applications and servers
685
+ - **`typescript-react`**: For React/Next.js applications
686
+
687
+ All templates are available at: https://github.com/jdutton/vibe-validate/tree/main/packages/cli/config-templates
688
+
689
+ ### Using a Template
690
+
691
+ ```bash
692
+ # Initialize with a specific template
693
+ npx vibe-validate init --template typescript-nodejs
694
+
695
+ # Or copy directly from GitHub
696
+ curl -o vibe-validate.config.yaml \
697
+ https://raw.githubusercontent.com/jdutton/vibe-validate/main/config-templates/typescript-nodejs.yaml
698
+ ```
699
+
700
+ ### Customizing Templates
701
+
702
+ After copying a template, customize it for your project:
703
+
704
+ ```yaml
705
+ # Start with typescript-nodejs template, then customize
706
+ validation:
707
+ phases:
708
+ - name: Pre-Qualification
709
+ parallel: true
710
+ steps:
711
+ - name: TypeScript
712
+ command: pnpm typecheck
713
+ - name: ESLint
714
+ command: pnpm lint
715
+
716
+ - name: Testing
717
+ parallel: false
718
+ steps:
719
+ - name: Unit Tests
720
+ command: pnpm test
721
+
722
+ # Add custom security phase
723
+ - name: Security
724
+ parallel: true
725
+ steps:
726
+ - name: npm audit
727
+ command: npm audit --audit-level=high
728
+ - name: Snyk scan
729
+ command: snyk test
730
+
731
+ - name: Build
732
+ parallel: false
733
+ steps:
734
+ - name: Build
735
+ command: pnpm build
736
+
737
+ failFast: true
738
+
739
+ git:
740
+ mainBranch: develop # Customize for your workflow
741
+ remoteOrigin: origin
742
+ autoSync: false
743
+ ```
744
+
745
+ ## Environment Variables
746
+
747
+ vibe-validate respects these environment variables for agent context detection:
748
+
749
+ - `CLAUDE_CODE=true` - Detects Claude Code context
750
+ - `CURSOR=true` - Detects Cursor context
751
+ - `AIDER=true` - Detects Aider context
752
+ - `CONTINUE=true` - Detects Continue context
753
+ - `CI=true` - Detects CI environment
754
+
755
+ **Purpose**: Agent detection optimizes output verbosity for AI assistants vs. interactive terminals.
756
+
757
+ **Behavior**:
758
+ - **Agent contexts** (Claude Code, Cursor, etc.): Minimal terminal output, errors in validation state
759
+ - **CI environments**: Minimal terminal output, errors in validation state
760
+ - **Interactive terminals**: Verbose terminal output with colors and progress indicators
761
+
762
+ **Note**: All contexts use YAML format (access via `vibe-validate state` command)
763
+
764
+ **Note**: Use CLI flags for behavior control (e.g., `--force` to bypass cache, `--verbose` for detailed output)
765
+
766
+ ## Complete Example
767
+
768
+ Comprehensive configuration with all options:
769
+
770
+ ```yaml
771
+ # vibe-validate.config.yaml
772
+ $schema: https://unpkg.com/@vibe-validate/config/config.schema.json
773
+
774
+ # Git configuration
775
+ git:
776
+ mainBranch: main
777
+ remoteOrigin: origin
778
+ autoSync: false
779
+ warnIfBehind: true
780
+
781
+ # CI/CD configuration (for generate-workflow command)
782
+ ci:
783
+ nodeVersions: ['20', '22', '24']
784
+ os: ['ubuntu-latest', 'macos-latest']
785
+ failFast: false
786
+ coverage: true
787
+
788
+ # Hooks configuration
789
+ hooks:
790
+ preCommit:
791
+ enabled: true
792
+ command: 'npx vibe-validate pre-commit'
793
+
794
+ # Validation configuration
795
+ validation:
796
+ phases:
797
+ - name: Pre-Qualification
798
+ parallel: true
799
+ timeout: 300000 # 5 minutes for all steps in this phase
800
+ failFast: true # Stop phase on first step failure
801
+ steps:
802
+ - name: TypeScript
803
+ command: tsc --noEmit
804
+ description: Type-check all TypeScript files
805
+
806
+ - name: ESLint
807
+ command: eslint src/ --max-warnings=0
808
+ description: Lint source code
809
+
810
+ - name: Prettier
811
+ command: prettier --check src/
812
+ description: Check code formatting
813
+
814
+ - name: Testing
815
+ parallel: false
816
+ timeout: 600000 # 10 minutes for this phase
817
+ steps:
818
+ - name: Unit Tests
819
+ command: vitest run --coverage
820
+ description: Run unit tests with coverage
821
+ env:
822
+ NODE_ENV: test
823
+ COVERAGE: "true"
824
+
825
+ - name: Integration Tests
826
+ command: npm run test:integration
827
+ description: Run integration tests
828
+ timeout: 900000 # 15 minutes (override phase timeout)
829
+ env:
830
+ NODE_ENV: test
831
+
832
+ - name: Build
833
+ parallel: false
834
+ steps:
835
+ - name: Build
836
+ command: npm run build
837
+ description: Build application
838
+ env:
839
+ NODE_ENV: production
840
+
841
+ - name: Bundle Size
842
+ command: npm run check:bundle-size
843
+ description: Verify bundle size limits
844
+ continueOnError: true # Don't fail if bundle is slightly large
845
+
846
+ - name: Security
847
+ parallel: true
848
+ failFast: false # Run all security checks even if one fails
849
+ steps:
850
+ - name: npm audit
851
+ command: npm audit --audit-level=high
852
+ description: Check for security vulnerabilities
853
+ continueOnError: true # Don't block on audit findings
854
+
855
+ - name: License Check
856
+ command: npm run check:licenses
857
+ description: Verify dependency licenses
858
+
859
+ failFast: false # Continue all phases even if one fails
860
+ ```
861
+
862
+ ## Common Git Configuration Scenarios
863
+
864
+ ### Standard Single-Remote Workflow
865
+
866
+ Most projects use the default `origin` remote:
867
+
868
+ ```yaml
869
+ git:
870
+ mainBranch: main
871
+ remoteOrigin: origin # Default - can be omitted
872
+ ```
873
+
874
+ ### Forked Repository Workflow
875
+
876
+ When working on a fork, sync with the upstream repository:
877
+
878
+ ```yaml
879
+ git:
880
+ mainBranch: main
881
+ remoteOrigin: upstream # Sync with original repo, not your fork
882
+ ```
883
+
884
+ **Setup**:
885
+ ```bash
886
+ # Add upstream remote (one-time setup)
887
+ git remote add upstream https://github.com/original/repo.git
888
+
889
+ # Configure vibe-validate to track upstream
890
+ # (add remoteOrigin: 'upstream' to config)
891
+ ```
892
+
893
+ ### Legacy Main Branch Name
894
+
895
+ Projects using `master` instead of `main`:
896
+
897
+ ```yaml
898
+ git:
899
+ mainBranch: master
900
+ remoteOrigin: origin
901
+ ```
902
+
903
+ ### Git-Flow Workflow
904
+
905
+ Track `develop` branch instead of `main`:
906
+
907
+ ```yaml
908
+ git:
909
+ mainBranch: develop
910
+ remoteOrigin: origin
911
+ ```
912
+
913
+ ### Enterprise Custom Remote
914
+
915
+ Internal git servers with custom remote names:
916
+
917
+ ```yaml
918
+ git:
919
+ mainBranch: main
920
+ remoteOrigin: corporate # Custom remote name
921
+ ```
922
+
923
+ ## Troubleshooting Git Configuration
924
+
925
+ ### "Branch is behind origin/main" but should check upstream
926
+
927
+ **Problem**: You're working on a fork but vibe-validate checks `origin` instead of `upstream`.
928
+
929
+ **Solution**: Set `remoteOrigin: 'upstream'` in your config:
930
+
931
+ ```yaml
932
+ git:
933
+ mainBranch: main
934
+ remoteOrigin: upstream
935
+ ```
936
+
937
+ ### "Remote not found" error
938
+
939
+ **Problem**: Configured remote doesn't exist in your repository.
940
+
941
+ **Solution**: Verify remote exists:
942
+
943
+ ```bash
944
+ git remote -v
945
+
946
+ # Add missing remote if needed
947
+ git remote add upstream https://github.com/owner/repo.git
948
+ ```
949
+
950
+ ### Using different branch names
951
+
952
+ **Problem**: Your team uses `master` or `develop` instead of `main`.
953
+
954
+ **Solution**: Configure the correct branch name:
955
+
956
+ ```yaml
957
+ git:
958
+ mainBranch: master # or 'develop', 'trunk', etc.
959
+ remoteOrigin: origin
960
+ ```
961
+
962
+ ## Validation State Storage
963
+
964
+ Validation state is stored in git notes (not files):
965
+
966
+ - **Storage**: Git notes under `refs/notes/vibe-validate/runs`
967
+ - **Access**: Use `vibe-validate state` command to view current state
968
+ - **History**: Use `vibe-validate history list` to view all validations
969
+ - **Contents**: Validation results, git tree hash, timestamp, errors
970
+
971
+ **No `.gitignore` needed** - state is stored in git notes, not tracked files.
972
+
973
+ **Migration from v0.11.x**: If upgrading, run `vibe-validate doctor` to detect deprecated `.vibe-validate-state.yaml` files.
974
+
975
+ ## See Also
976
+
977
+ - [Getting Started](getting-started.md) - Initial setup
978
+ - [CLI Reference](cli-reference.md) - Command-line options
979
+ - [Config Templates Guide](../config-templates/README.md) - Using and customizing templates
980
+ - [Error Extractors Guide](error-extractors-guide.md) - Error formatting details