@boshu2/vibe-check 0.1.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.
Files changed (143) hide show
  1. package/.dockerignore +46 -0
  2. package/.gitattributes +3 -0
  3. package/.pre-commit-hooks.yaml +11 -0
  4. package/AGENTS.md +40 -0
  5. package/CHANGELOG.md +322 -0
  6. package/CLAUDE.md +342 -0
  7. package/CONTRIBUTING.md +227 -0
  8. package/Dockerfile +26 -0
  9. package/LICENSE +201 -0
  10. package/Makefile +213 -0
  11. package/README.md +165 -0
  12. package/SECURITY.md +182 -0
  13. package/action.yml +270 -0
  14. package/assets/logo-dark.svg +47 -0
  15. package/assets/logo.svg +47 -0
  16. package/bin/vc.js +2 -0
  17. package/bin/vibe-check.js +2 -0
  18. package/claude-progress.json +312 -0
  19. package/claude-progress.txt +572 -0
  20. package/dist/cli.d.ts +3 -0
  21. package/dist/cli.d.ts.map +1 -0
  22. package/dist/cli.js +70 -0
  23. package/dist/cli.js.map +1 -0
  24. package/dist/commands/analyze-helpers.d.ts +43 -0
  25. package/dist/commands/analyze-helpers.d.ts.map +1 -0
  26. package/dist/commands/analyze-helpers.js +124 -0
  27. package/dist/commands/analyze-helpers.js.map +1 -0
  28. package/dist/commands/analyze.d.ts +21 -0
  29. package/dist/commands/analyze.d.ts.map +1 -0
  30. package/dist/commands/analyze.js +114 -0
  31. package/dist/commands/analyze.js.map +1 -0
  32. package/dist/commands/index.d.ts +2 -0
  33. package/dist/commands/index.d.ts.map +1 -0
  34. package/dist/commands/index.js +2 -0
  35. package/dist/commands/index.js.map +1 -0
  36. package/dist/errors.d.ts +100 -0
  37. package/dist/errors.d.ts.map +1 -0
  38. package/dist/errors.js +208 -0
  39. package/dist/errors.js.map +1 -0
  40. package/dist/git.d.ts +39 -0
  41. package/dist/git.d.ts.map +1 -0
  42. package/dist/git.js +206 -0
  43. package/dist/git.js.map +1 -0
  44. package/dist/inner-loop/context-amnesia.d.ts +20 -0
  45. package/dist/inner-loop/context-amnesia.d.ts.map +1 -0
  46. package/dist/inner-loop/context-amnesia.js +246 -0
  47. package/dist/inner-loop/context-amnesia.js.map +1 -0
  48. package/dist/inner-loop/index.d.ts +39 -0
  49. package/dist/inner-loop/index.d.ts.map +1 -0
  50. package/dist/inner-loop/index.js +181 -0
  51. package/dist/inner-loop/index.js.map +1 -0
  52. package/dist/inner-loop/instruction-drift.d.ts +36 -0
  53. package/dist/inner-loop/instruction-drift.d.ts.map +1 -0
  54. package/dist/inner-loop/instruction-drift.js +270 -0
  55. package/dist/inner-loop/instruction-drift.js.map +1 -0
  56. package/dist/inner-loop/logging-only.d.ts +64 -0
  57. package/dist/inner-loop/logging-only.d.ts.map +1 -0
  58. package/dist/inner-loop/logging-only.js +292 -0
  59. package/dist/inner-loop/logging-only.js.map +1 -0
  60. package/dist/inner-loop/tests-passing-lie.d.ts +34 -0
  61. package/dist/inner-loop/tests-passing-lie.d.ts.map +1 -0
  62. package/dist/inner-loop/tests-passing-lie.js +213 -0
  63. package/dist/inner-loop/tests-passing-lie.js.map +1 -0
  64. package/dist/inner-loop/types.d.ts +125 -0
  65. package/dist/inner-loop/types.d.ts.map +1 -0
  66. package/dist/inner-loop/types.js +27 -0
  67. package/dist/inner-loop/types.js.map +1 -0
  68. package/dist/internal/context/index.d.ts +74 -0
  69. package/dist/internal/context/index.d.ts.map +1 -0
  70. package/dist/internal/context/index.js +151 -0
  71. package/dist/internal/context/index.js.map +1 -0
  72. package/dist/internal/context/types.d.ts +75 -0
  73. package/dist/internal/context/types.d.ts.map +1 -0
  74. package/dist/internal/context/types.js +8 -0
  75. package/dist/internal/context/types.js.map +1 -0
  76. package/dist/internal/output/contract.d.ts +81 -0
  77. package/dist/internal/output/contract.d.ts.map +1 -0
  78. package/dist/internal/output/contract.js +112 -0
  79. package/dist/internal/output/contract.js.map +1 -0
  80. package/dist/internal/output/index.d.ts +7 -0
  81. package/dist/internal/output/index.d.ts.map +1 -0
  82. package/dist/internal/output/index.js +7 -0
  83. package/dist/internal/output/index.js.map +1 -0
  84. package/dist/metrics/flow.d.ts +20 -0
  85. package/dist/metrics/flow.d.ts.map +1 -0
  86. package/dist/metrics/flow.js +85 -0
  87. package/dist/metrics/flow.js.map +1 -0
  88. package/dist/metrics/index.d.ts +4 -0
  89. package/dist/metrics/index.d.ts.map +1 -0
  90. package/dist/metrics/index.js +161 -0
  91. package/dist/metrics/index.js.map +1 -0
  92. package/dist/metrics/rework.d.ts +12 -0
  93. package/dist/metrics/rework.d.ts.map +1 -0
  94. package/dist/metrics/rework.js +51 -0
  95. package/dist/metrics/rework.js.map +1 -0
  96. package/dist/metrics/spirals.d.ts +17 -0
  97. package/dist/metrics/spirals.d.ts.map +1 -0
  98. package/dist/metrics/spirals.js +157 -0
  99. package/dist/metrics/spirals.js.map +1 -0
  100. package/dist/metrics/trust.d.ts +12 -0
  101. package/dist/metrics/trust.d.ts.map +1 -0
  102. package/dist/metrics/trust.js +175 -0
  103. package/dist/metrics/trust.js.map +1 -0
  104. package/dist/metrics/velocity.d.ts +25 -0
  105. package/dist/metrics/velocity.d.ts.map +1 -0
  106. package/dist/metrics/velocity.js +120 -0
  107. package/dist/metrics/velocity.js.map +1 -0
  108. package/dist/output/index.d.ts +10 -0
  109. package/dist/output/index.d.ts.map +1 -0
  110. package/dist/output/index.js +20 -0
  111. package/dist/output/index.js.map +1 -0
  112. package/dist/output/json.d.ts +3 -0
  113. package/dist/output/json.d.ts.map +1 -0
  114. package/dist/output/json.js +48 -0
  115. package/dist/output/json.js.map +1 -0
  116. package/dist/output/markdown.d.ts +3 -0
  117. package/dist/output/markdown.d.ts.map +1 -0
  118. package/dist/output/markdown.js +84 -0
  119. package/dist/output/markdown.js.map +1 -0
  120. package/dist/output/terminal.d.ts +10 -0
  121. package/dist/output/terminal.d.ts.map +1 -0
  122. package/dist/output/terminal.js +153 -0
  123. package/dist/output/terminal.js.map +1 -0
  124. package/dist/types.d.ts +75 -0
  125. package/dist/types.d.ts.map +1 -0
  126. package/dist/types.js +5 -0
  127. package/dist/types.js.map +1 -0
  128. package/docs/ARCHITECTURE.md +450 -0
  129. package/docs/DEPLOYMENT.md +394 -0
  130. package/docs/METRICS-EXPLAINED.md +394 -0
  131. package/docs/REFERENCE.md +230 -0
  132. package/docs/images/dashboard.png +0 -0
  133. package/drivers/README.md +327 -0
  134. package/drivers/go.sh +131 -0
  135. package/drivers/java.sh +137 -0
  136. package/drivers/javascript.sh +134 -0
  137. package/drivers/php.sh +132 -0
  138. package/drivers/python.sh +90 -0
  139. package/drivers/rust.sh +132 -0
  140. package/feature-list.json +273 -0
  141. package/hooks/pre-push +107 -0
  142. package/package.json +47 -0
  143. package/vitest.config.ts +25 -0
@@ -0,0 +1,394 @@
1
+ # Deployment Guide
2
+
3
+ This guide covers deploying vibe-check in CI/CD environments for automated code quality analysis.
4
+
5
+ ## Table of Contents
6
+
7
+ - [GitHub Actions](#github-actions)
8
+ - [GitLab CI](#gitlab-ci)
9
+ - [Jenkins Pipeline](#jenkins-pipeline)
10
+ - [Docker Usage](#docker-usage)
11
+ - [Environment Variables](#environment-variables)
12
+ - [Exit Codes](#exit-codes)
13
+
14
+ ---
15
+
16
+ ## GitHub Actions
17
+
18
+ ### Basic Usage
19
+
20
+ Add vibe-check to your workflow to analyze PR commits:
21
+
22
+ ```yaml
23
+ name: Vibe Check
24
+
25
+ on:
26
+ pull_request:
27
+ branches: [main]
28
+
29
+ jobs:
30
+ vibe-check:
31
+ runs-on: ubuntu-latest
32
+ steps:
33
+ - uses: actions/checkout@v4
34
+ with:
35
+ fetch-depth: 0 # Fetch all history for complete analysis
36
+
37
+ - uses: actions/setup-node@v4
38
+ with:
39
+ node-version: '20'
40
+
41
+ - name: Install vibe-check
42
+ run: npm install -g @boshu2/vibe-check
43
+
44
+ - name: Run vibe-check
45
+ run: vc --since "1 week ago" --format json --output results.json
46
+
47
+ - name: Upload results
48
+ uses: actions/upload-artifact@v4
49
+ if: always()
50
+ with:
51
+ name: vibe-check-results
52
+ path: results.json
53
+ ```
54
+
55
+ ### Advanced: Fail on Low Quality
56
+
57
+ ```yaml
58
+ - name: Run vibe-check with threshold
59
+ run: |
60
+ vc --since "1 week ago" --format json --output results.json
61
+ # Exit code 1 = LOW rating, fail the build
62
+ if [ $? -eq 1 ]; then
63
+ echo "::error::Code quality below threshold"
64
+ exit 1
65
+ fi
66
+ ```
67
+
68
+ ### Structured Logging
69
+
70
+ ```yaml
71
+ - name: Run with JSON logging
72
+ run: vc --log-json --since "1 week ago" 2> logs.jsonl
73
+ ```
74
+
75
+ ---
76
+
77
+ ## GitLab CI
78
+
79
+ ### Basic Pipeline
80
+
81
+ Add to `.gitlab-ci.yml`:
82
+
83
+ ```yaml
84
+ vibe-check:
85
+ stage: test
86
+ image: node:20-alpine
87
+ before_script:
88
+ - apk add --no-cache git
89
+ - npm install -g @boshu2/vibe-check
90
+ script:
91
+ - vc --since "1 week ago" --format json --output vibe-check.json
92
+ artifacts:
93
+ reports:
94
+ dotenv: vibe-check.json
95
+ when: always
96
+ paths:
97
+ - vibe-check.json
98
+ ```
99
+
100
+ ### Docker-based Pipeline
101
+
102
+ ```yaml
103
+ vibe-check:
104
+ stage: test
105
+ image: docker:latest
106
+ services:
107
+ - docker:dind
108
+ before_script:
109
+ - docker build -t vibe-check -f Dockerfile.ci .
110
+ script:
111
+ - docker run --rm -v $CI_PROJECT_DIR:/repo vibe-check --repo /repo --since "1 week ago"
112
+ ```
113
+
114
+ ### Timeout Configuration
115
+
116
+ ```yaml
117
+ vibe-check:
118
+ stage: test
119
+ timeout: 10m
120
+ script:
121
+ - vc --timeout 300 --max-commits 5000 --since "1 month ago"
122
+ ```
123
+
124
+ ---
125
+
126
+ ## Jenkins Pipeline
127
+
128
+ ### Declarative Pipeline
129
+
130
+ Add to `Jenkinsfile`:
131
+
132
+ ```groovy
133
+ pipeline {
134
+ agent {
135
+ docker {
136
+ image 'node:20-alpine'
137
+ args '-u root:root'
138
+ }
139
+ }
140
+
141
+ stages {
142
+ stage('Setup') {
143
+ steps {
144
+ sh 'apk add --no-cache git'
145
+ sh 'npm install -g @boshu2/vibe-check'
146
+ }
147
+ }
148
+
149
+ stage('Vibe Check') {
150
+ steps {
151
+ sh '''
152
+ vc --since "1 week ago" \\
153
+ --format json \\
154
+ --output vibe-check.json \\
155
+ --log-json 2> vibe-check.log
156
+ '''
157
+ }
158
+ post {
159
+ always {
160
+ archiveArtifacts artifacts: 'vibe-check.json,vibe-check.log', allowEmptyArchive: true
161
+ publishHTML([
162
+ reportDir: '.',
163
+ reportFiles: 'vibe-check.json',
164
+ reportName: 'Vibe Check Report'
165
+ ])
166
+ }
167
+ }
168
+ }
169
+ }
170
+ }
171
+ ```
172
+
173
+ ### Scripted Pipeline
174
+
175
+ ```groovy
176
+ node {
177
+ stage('Checkout') {
178
+ checkout scm
179
+ }
180
+
181
+ stage('Vibe Check') {
182
+ docker.image('node:20-alpine').inside {
183
+ sh 'apk add --no-cache git'
184
+ sh 'npm install -g @boshu2/vibe-check'
185
+
186
+ def exitCode = sh(
187
+ script: 'vc --since "1 week ago" --format json',
188
+ returnStatus: true
189
+ )
190
+
191
+ if (exitCode == 1) {
192
+ unstable(message: "Code quality below threshold")
193
+ } else if (exitCode != 0) {
194
+ error("Vibe check failed with exit code ${exitCode}")
195
+ }
196
+ }
197
+ }
198
+ }
199
+ ```
200
+
201
+ ---
202
+
203
+ ## Docker Usage
204
+
205
+ ### Building the Image
206
+
207
+ ```bash
208
+ # Build from Dockerfile
209
+ docker build -t vibe-check .
210
+
211
+ # Or use pre-built image (when available)
212
+ docker pull boshu2/vibe-check:latest
213
+ ```
214
+
215
+ ### Running Analysis
216
+
217
+ ```bash
218
+ # Analyze current directory
219
+ docker run --rm -v $(pwd):/repo vibe-check --repo /repo --since "1 week ago"
220
+
221
+ # With JSON output
222
+ docker run --rm -v $(pwd):/repo vibe-check \
223
+ --repo /repo \
224
+ --since "1 week ago" \
225
+ --format json > results.json
226
+
227
+ # With structured logging
228
+ docker run --rm -v $(pwd):/repo vibe-check \
229
+ --repo /repo \
230
+ --log-json \
231
+ --since "1 week ago" 2> logs.jsonl
232
+ ```
233
+
234
+ ### Performance Tuning
235
+
236
+ ```bash
237
+ # Large repositories: set timeout and max commits
238
+ docker run --rm -v $(pwd):/repo vibe-check \
239
+ --repo /repo \
240
+ --timeout 600 \
241
+ --max-commits 10000 \
242
+ --since "1 month ago"
243
+ ```
244
+
245
+ ---
246
+
247
+ ## Environment Variables
248
+
249
+ vibe-check respects the following environment variables:
250
+
251
+ | Variable | Description | Default |
252
+ |----------|-------------|---------|
253
+ | `DEBUG` | Enable debug logging (set to `1` or `true`) | `false` |
254
+ | `NO_COLOR` | Disable colored output | `false` |
255
+ | `CI` | Detected automatically in CI environments | auto-detected |
256
+
257
+ ### Example
258
+
259
+ ```bash
260
+ # Enable debug logging
261
+ export DEBUG=1
262
+ vc --since "1 week ago"
263
+
264
+ # Disable colors for log parsing
265
+ export NO_COLOR=1
266
+ vc --format json
267
+ ```
268
+
269
+ ---
270
+
271
+ ## Exit Codes
272
+
273
+ vibe-check uses semantic exit codes for integration with CI/CD:
274
+
275
+ | Exit Code | Meaning | CI Action |
276
+ |-----------|---------|-----------|
277
+ | `0` | Success (GOOD or ELITE rating) | Pass ✅ |
278
+ | `1` | General error (LOW rating) | Fail ❌ |
279
+ | `2` | Git error (not a repo, git failed) | Fail ❌ |
280
+ | `3` | Validation error (invalid options) | Fail ❌ |
281
+ | `4` | Storage error (file I/O failed) | Fail ❌ |
282
+ | `5` | Config error (invalid config) | Fail ❌ |
283
+ | `6` | Analysis error (calculation failed) | Fail ❌ |
284
+
285
+ ### Handling Exit Codes
286
+
287
+ **GitHub Actions:**
288
+ ```yaml
289
+ - name: Run vibe-check
290
+ run: vc --since "1 week ago"
291
+ continue-on-error: true # Don't fail build on LOW rating
292
+ ```
293
+
294
+ **GitLab CI:**
295
+ ```yaml
296
+ vibe-check:
297
+ script:
298
+ - vc --since "1 week ago"
299
+ allow_failure: true # Warning only
300
+ ```
301
+
302
+ **Jenkins:**
303
+ ```groovy
304
+ try {
305
+ sh 'vc --since "1 week ago"'
306
+ } catch (err) {
307
+ if (err.exitCode == 1) {
308
+ unstable(message: "Code quality below threshold")
309
+ } else {
310
+ error("Vibe check failed: ${err}")
311
+ }
312
+ }
313
+ ```
314
+
315
+ ---
316
+
317
+ ## Pre-commit Hook
318
+
319
+ Integrate vibe-check with [pre-commit](https://pre-commit.com/):
320
+
321
+ ### Add to `.pre-commit-config.yaml`:
322
+
323
+ ```yaml
324
+ repos:
325
+ - repo: https://github.com/boshu2/vibe-check
326
+ rev: v2.6.0
327
+ hooks:
328
+ - id: vibe-check
329
+ args: ['--since', '1 week ago']
330
+ ```
331
+
332
+ ### Manual Installation:
333
+
334
+ ```bash
335
+ # Install pre-commit
336
+ pip install pre-commit
337
+
338
+ # Install hook
339
+ pre-commit install
340
+
341
+ # Run manually
342
+ pre-commit run vibe-check --all-files
343
+ ```
344
+
345
+ ---
346
+
347
+ ## Troubleshooting
348
+
349
+ ### Timeout Errors
350
+
351
+ ```bash
352
+ # Increase timeout for large repos
353
+ vc --timeout 600 --max-commits 10000
354
+ ```
355
+
356
+ ### Memory Issues
357
+
358
+ ```bash
359
+ # Limit commits analyzed
360
+ vc --max-commits 5000 --since "2 weeks ago"
361
+ ```
362
+
363
+ ### Shallow Clone Issues
364
+
365
+ ```bash
366
+ # In CI, ensure full history is fetched
367
+ git fetch --unshallow
368
+ ```
369
+
370
+ ### Permission Errors
371
+
372
+ ```bash
373
+ # Docker: run as current user
374
+ docker run --rm -u $(id -u):$(id -g) -v $(pwd):/repo vibe-check
375
+ ```
376
+
377
+ ---
378
+
379
+ ## Best Practices
380
+
381
+ 1. **Set Timeouts**: Always use `--timeout` for large repositories
382
+ 2. **Limit Commits**: Use `--max-commits` for very active repos
383
+ 3. **Structured Logging**: Use `--log-json` for log aggregation
384
+ 4. **Artifact Storage**: Archive JSON results for trend analysis
385
+ 5. **Fail Gracefully**: Use `allow_failure` for warnings vs errors
386
+ 6. **Cache Results**: Store results between runs for comparison
387
+
388
+ ---
389
+
390
+ ## Support
391
+
392
+ - GitHub Issues: https://github.com/boshu2/vibe-check/issues
393
+ - Documentation: https://github.com/boshu2/vibe-check
394
+ - npm Package: https://www.npmjs.com/package/@boshu2/vibe-check