vibecode-anything 0.0.0-stage → 0.4.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 (180) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +407 -2
  3. package/dist/cli.d.ts +2 -0
  4. package/dist/cli.js +2519 -0
  5. package/dist/core/adapters.d.ts +31 -0
  6. package/dist/core/adapters.js +478 -0
  7. package/dist/core/agent-adapter.d.ts +67 -0
  8. package/dist/core/agent-adapter.js +312 -0
  9. package/dist/core/anti-cheat.d.ts +6 -0
  10. package/dist/core/anti-cheat.js +372 -0
  11. package/dist/core/badge.d.ts +18 -0
  12. package/dist/core/badge.js +360 -0
  13. package/dist/core/cache.d.ts +47 -0
  14. package/dist/core/cache.js +403 -0
  15. package/dist/core/ci-export.d.ts +35 -0
  16. package/dist/core/ci-export.js +796 -0
  17. package/dist/core/ci-formats.d.ts +21 -0
  18. package/dist/core/ci-formats.js +388 -0
  19. package/dist/core/client-codegen.d.ts +36 -0
  20. package/dist/core/client-codegen.js +2538 -0
  21. package/dist/core/compose.d.ts +71 -0
  22. package/dist/core/compose.js +1088 -0
  23. package/dist/core/diff.d.ts +10 -0
  24. package/dist/core/diff.js +207 -0
  25. package/dist/core/docs-export.d.ts +37 -0
  26. package/dist/core/docs-export.js +2706 -0
  27. package/dist/core/doctor.d.ts +70 -0
  28. package/dist/core/doctor.js +525 -0
  29. package/dist/core/errors.d.ts +32 -0
  30. package/dist/core/errors.js +81 -0
  31. package/dist/core/exec.d.ts +38 -0
  32. package/dist/core/exec.js +336 -0
  33. package/dist/core/fixtures.d.ts +153 -0
  34. package/dist/core/fixtures.js +2245 -0
  35. package/dist/core/format.d.ts +77 -0
  36. package/dist/core/format.js +632 -0
  37. package/dist/core/fs-snapshot.d.ts +37 -0
  38. package/dist/core/fs-snapshot.js +216 -0
  39. package/dist/core/graphql-export.d.ts +34 -0
  40. package/dist/core/graphql-export.js +2482 -0
  41. package/dist/core/har-export.d.ts +29 -0
  42. package/dist/core/har-export.js +988 -0
  43. package/dist/core/html-report.d.ts +27 -0
  44. package/dist/core/html-report.js +1535 -0
  45. package/dist/core/http-export.d.ts +31 -0
  46. package/dist/core/http-export.js +726 -0
  47. package/dist/core/impact.d.ts +80 -0
  48. package/dist/core/impact.js +1412 -0
  49. package/dist/core/lint.d.ts +38 -0
  50. package/dist/core/lint.js +1111 -0
  51. package/dist/core/load-export.d.ts +37 -0
  52. package/dist/core/load-export.js +1813 -0
  53. package/dist/core/mcp-export.d.ts +35 -0
  54. package/dist/core/mcp-export.js +1736 -0
  55. package/dist/core/mock-server.d.ts +47 -0
  56. package/dist/core/mock-server.js +1722 -0
  57. package/dist/core/openapi-export.d.ts +44 -0
  58. package/dist/core/openapi-export.js +1074 -0
  59. package/dist/core/parity.d.ts +14 -0
  60. package/dist/core/parity.js +173 -0
  61. package/dist/core/playwright-exporter.d.ts +23 -0
  62. package/dist/core/playwright-exporter.js +1343 -0
  63. package/dist/core/png.d.ts +7 -0
  64. package/dist/core/png.js +339 -0
  65. package/dist/core/regression.d.ts +54 -0
  66. package/dist/core/regression.js +529 -0
  67. package/dist/core/responsive.d.ts +86 -0
  68. package/dist/core/responsive.js +606 -0
  69. package/dist/core/run.d.ts +74 -0
  70. package/dist/core/run.js +696 -0
  71. package/dist/core/scheduler.d.ts +24 -0
  72. package/dist/core/scheduler.js +162 -0
  73. package/dist/core/schema-export.d.ts +29 -0
  74. package/dist/core/schema-export.js +2215 -0
  75. package/dist/core/schema.d.ts +18 -0
  76. package/dist/core/schema.js +1057 -0
  77. package/dist/core/security.d.ts +233 -0
  78. package/dist/core/security.js +1839 -0
  79. package/dist/core/server-export.d.ts +38 -0
  80. package/dist/core/server-export.js +3198 -0
  81. package/dist/core/slices.d.ts +24 -0
  82. package/dist/core/slices.js +294 -0
  83. package/dist/core/spec-writer.d.ts +9 -0
  84. package/dist/core/spec-writer.js +1202 -0
  85. package/dist/core/store.d.ts +26 -0
  86. package/dist/core/store.js +217 -0
  87. package/dist/core/target-map.d.ts +34 -0
  88. package/dist/core/target-map.js +262 -0
  89. package/dist/core/test-exporter.d.ts +25 -0
  90. package/dist/core/test-exporter.js +1918 -0
  91. package/dist/core/types.d.ts +919 -0
  92. package/dist/core/types.js +4 -0
  93. package/dist/core/visual-semantic.d.ts +67 -0
  94. package/dist/core/visual-semantic.js +673 -0
  95. package/dist/core/visual.d.ts +34 -0
  96. package/dist/core/visual.js +508 -0
  97. package/dist/core/watch.d.ts +78 -0
  98. package/dist/core/watch.js +495 -0
  99. package/dist/core/yaml.d.ts +5 -0
  100. package/dist/core/yaml.js +1009 -0
  101. package/dist/diagnostics/diagnose.d.ts +53 -0
  102. package/dist/diagnostics/diagnose.js +1083 -0
  103. package/dist/diagnostics/flake.d.ts +71 -0
  104. package/dist/diagnostics/flake.js +608 -0
  105. package/dist/diagnostics/mutation-audit.d.ts +69 -0
  106. package/dist/diagnostics/mutation-audit.js +769 -0
  107. package/dist/diagnostics/spatial.d.ts +42 -0
  108. package/dist/diagnostics/spatial.js +346 -0
  109. package/dist/diagnostics/trends.d.ts +122 -0
  110. package/dist/diagnostics/trends.js +1190 -0
  111. package/dist/discovery/discover.d.ts +111 -0
  112. package/dist/discovery/discover.js +2017 -0
  113. package/dist/discovery/lock.d.ts +116 -0
  114. package/dist/discovery/lock.js +1505 -0
  115. package/dist/discovery/routes.d.ts +36 -0
  116. package/dist/discovery/routes.js +1494 -0
  117. package/dist/discovery/test-importer.d.ts +92 -0
  118. package/dist/discovery/test-importer.js +4952 -0
  119. package/dist/index.d.ts +123 -0
  120. package/dist/index.js +99 -0
  121. package/dist/ingestors/api-collections.d.ts +28 -0
  122. package/dist/ingestors/api-collections.js +2335 -0
  123. package/dist/ingestors/api-repo.d.ts +6 -0
  124. package/dist/ingestors/api-repo.js +1120 -0
  125. package/dist/ingestors/asyncapi.d.ts +26 -0
  126. package/dist/ingestors/asyncapi.js +2105 -0
  127. package/dist/ingestors/bridges.d.ts +5 -0
  128. package/dist/ingestors/bridges.js +1264 -0
  129. package/dist/ingestors/cli.d.ts +10 -0
  130. package/dist/ingestors/cli.js +454 -0
  131. package/dist/ingestors/curl.d.ts +14 -0
  132. package/dist/ingestors/curl.js +1024 -0
  133. package/dist/ingestors/graphql.d.ts +56 -0
  134. package/dist/ingestors/graphql.js +1852 -0
  135. package/dist/ingestors/http-file.d.ts +20 -0
  136. package/dist/ingestors/http-file.js +923 -0
  137. package/dist/ingestors/image.d.ts +2 -0
  138. package/dist/ingestors/image.js +147 -0
  139. package/dist/ingestors/index.d.ts +5 -0
  140. package/dist/ingestors/index.js +577 -0
  141. package/dist/ingestors/openrpc.d.ts +29 -0
  142. package/dist/ingestors/openrpc.js +1807 -0
  143. package/dist/ingestors/proto.d.ts +47 -0
  144. package/dist/ingestors/proto.js +2690 -0
  145. package/dist/ingestors/trace.d.ts +10 -0
  146. package/dist/ingestors/trace.js +599 -0
  147. package/dist/ingestors/video.d.ts +50 -0
  148. package/dist/ingestors/video.js +655 -0
  149. package/dist/ingestors/web.d.ts +40 -0
  150. package/dist/ingestors/web.js +839 -0
  151. package/dist/mcp/server.d.ts +2 -0
  152. package/dist/mcp/server.js +3969 -0
  153. package/dist/oracles/api-repo.d.ts +2 -0
  154. package/dist/oracles/api-repo.js +286 -0
  155. package/dist/oracles/cli.d.ts +2 -0
  156. package/dist/oracles/cli.js +205 -0
  157. package/dist/oracles/http-workflow.d.ts +68 -0
  158. package/dist/oracles/http-workflow.js +828 -0
  159. package/dist/oracles/image.d.ts +2 -0
  160. package/dist/oracles/image.js +429 -0
  161. package/dist/oracles/index.d.ts +6 -0
  162. package/dist/oracles/index.js +320 -0
  163. package/dist/oracles/perf-budget.d.ts +90 -0
  164. package/dist/oracles/perf-budget.js +1329 -0
  165. package/dist/oracles/stream.d.ts +94 -0
  166. package/dist/oracles/stream.js +1268 -0
  167. package/dist/oracles/ui-states.d.ts +49 -0
  168. package/dist/oracles/ui-states.js +894 -0
  169. package/dist/oracles/video.d.ts +21 -0
  170. package/dist/oracles/video.js +627 -0
  171. package/dist/oracles/web.d.ts +2 -0
  172. package/dist/oracles/web.js +871 -0
  173. package/dist/plugins/builtins.d.ts +12 -0
  174. package/dist/plugins/builtins.js +1052 -0
  175. package/dist/plugins/registry.d.ts +86 -0
  176. package/dist/plugins/registry.js +554 -0
  177. package/dist/setup/index.d.ts +7 -0
  178. package/dist/setup/index.js +298 -0
  179. package/package.json +54 -4
  180. package/skills/vibecode-anything/SKILL.md +75 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 nguyenthanhthe
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,408 @@
1
- # Temporary Holding Version
1
+ <div align="center">
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ <img src="assets/logo.png" width="92" alt="vibecode-anything logo" />
4
+
5
+ # vibecode-anything
6
+
7
+ ### Stop letting AI coding agents grade their own homework.
8
+
9
+ **Open-source, local-first CLI & MCP differential verification engine — turn any live CLI, API, Web UI, media flow, or Git repo into executable golden traces + isolated `~/.vibecode-vault/` holdouts, and verify every rebuild hits 100% parity.**
10
+
11
+ [![CI](https://img.shields.io/github/actions/workflow/status/nguyenthanhthe/vibecode-anything/ci.yml?branch=master&style=flat-square&logo=github)](https://github.com/nguyenthanhthe/vibecode-anything/actions/workflows/ci.yml)
12
+ [![Live Showcase](https://img.shields.io/badge/live%20showcase-GitHub%20Pages-0ea5e9?style=flat-square)](https://nguyenthanhthe.github.io/vibecode-anything/)
13
+ [![GitHub stars](https://img.shields.io/github/stars/nguyenthanhthe/vibecode-anything?style=flat-square&logo=github)](https://github.com/nguyenthanhthe/vibecode-anything/stargazers)
14
+ [![License: MIT](https://img.shields.io/badge/license-MIT-f4c430?style=flat-square)](LICENSE)
15
+ [![TypeScript](https://img.shields.io/badge/TypeScript-100%25-3178C6?style=flat-square&logo=typescript&logoColor=white)](tsconfig.json)
16
+ [![Node.js](https://img.shields.io/badge/node-%3E%3D20-339933?style=flat-square&logo=node.js&logoColor=white)](package.json)
17
+ [![Runtime Dependencies](https://img.shields.io/badge/dependencies-0%20runtime-111111?style=flat-square)](package.json)
18
+ [![Oracle Accuracy](https://img.shields.io/badge/oracle%20accuracy-100%25%20(128%2F128)-16a34a?style=flat-square)](#benchmarks)
19
+
20
+ [Caught the AI Cheating](#caught-the-ai-cheating-ab-proof) · [Interactive Showcase](https://nguyenthanhthe.github.io/vibecode-anything/) · [Live Proof Demo](https://nguyenthanhthe.github.io/vibecode-anything/demo/) · [Why It Exists](#why-vibecode-anything) · [Quick Start](#quick-start) · [Examples](#examples) · [Benchmarks](#benchmarks) · [CLI Reference](#cli-reference) · [FAQ](#faq)
21
+
22
+ <code>npx vibecode-anything setup</code>
23
+
24
+ <br/><br/>
25
+
26
+ <img src="assets/demo.gif" width="840" alt="vibecode-anything agent session differential verification demo" />
27
+
28
+ </div>
29
+
30
+ > [!NOTE]
31
+ > **Looking for the open-source developer CLI/MCP oracle?** You are in the right place. `vibecode-anything` is an MIT-licensed, 100% local-first differential verification engine for **Claude Code, Cursor, Antigravity, Codex, OpenCode, Windsurf, and Cline** — not the commercial mobile/hosted app builders at `vibecodeapp.com` or `anything.com`.
32
+
33
+ > [!IMPORTANT]
34
+ > **Two tracks, one zero-dependency engine:**
35
+ > - **AI Coding Agent Power Users:** Seal hidden holdout probes outside the repo in `~/.vibecode-vault/`, drive fresh-context Goldfish rebuilds (`run` / `vibecode-anything mcp` + [`SKILL.md`](skills/vibecode-anything/SKILL.md)), and reject constant stubs, visible-only overfitting, and contract tampering automatically.
36
+ > - **API & CI Engineers:** Auto-ingest OpenAPI, AsyncAPI, Protobuf `.proto`, OpenRPC, GraphQL, Postman, Bruno `.bru`, Insomnia v4, Copy-as-cURL, `.http`, and HAR 1.2 into strict PR parity gates (`nguyenthanhthe/vibecode-anything@v0.4.0`), contract mocks, and zero-dep test/client/schema/load/docs/CI/server exporters.
37
+
38
+ ---
39
+
40
+ ## Why `vibecode-anything`?
41
+
42
+ Coding agents already generate code fast. What they lack is **an automated differential oracle** that proves a rebuild actually matches the reference — especially when a broken build still returns HTTP `200`, exits `0` with valid JSON keys, or renders the exact right `360×240` pixel dimensions while dropping half the layout.
43
+
44
+ In 30 seconds, `vibecode-anything` turns any live reference into a machine-checkable `.vibecode/contract.json`, a deterministic `.vibecode/SPEC.md`, and isolated external holdouts — then drives your agent slice by slice until hard + soft parity hits **100%**.
45
+
46
+ | Capability | Raw Prompt | Single-Domain Tools | `vibecode-anything` v0.4.0 |
47
+ | :--- | :--- | :--- | :--- |
48
+ | **Multi-domain coverage** | Prose & screenshots only | 1 domain (Playwright *or* snapshot *or* OpenAPI) | **6 domains** (`cli`, `web`, `api`, `repo`, `image`, `video`) + **HAR & command trace** ingest |
49
+ | **Hidden holdouts & anti-cheat** | None (agent grades its own tests) | Tests live inside the repo where agents can edit them | **Isolated `~/.vibecode-vault/` holdouts** + anti-cheat gate (`STUB_CONSTANT_OUTPUT`, overfit & SHA-256 tamper detection) |
50
+ | **Zero-Assumption Spec** | Agent invents missing behavior | Manual markdown docs that drift | Auto-compiled deterministic **`.vibecode/SPEC.md`** (`vibecode://spec`) |
51
+ | **Autonomous build loop** | Single giant context window degrades | External wrapper scripts | **Goldfish fresh-context `run` loop** (`claude`, `codex`, `agy`, `opencode`, `mock:`) with plateau & quota guards |
52
+ | **Incremental speed** | Re-runs everything from scratch | Full suite re-execution | Dependency-ordered **`--slice`** tracking, **`watch`** mode, and **SHA-256 `--cache`** replay |
53
+ | **Visual & behavioral proof** | *"Looks good to me!"* | Raw terminal logs | **Self-contained `.vibecode/report.html`** (Before/After split, diff heatmap, convergence chart, unified diff) |
54
+ | **Install footprint** | Fragile ad-hoc scripts | Heavy dependency trees | **0 runtime dependencies** (pure Node.js `>=20` built-ins; optional adapters degrade cleanly) |
55
+
56
+ ## Caught the AI Cheating (A/B Proof)
57
+
58
+ When tests live inside the workspace, coding agents routinely hardcode visible fixtures, emit constant stubs, or edit test assertions to force a false green. [`examples/14-caught-ai-cheating/`](examples/14-caught-ai-cheating/README.md) runs four candidate builds of `rate-cli` (`11` visible invariants + `8` external `~/.vibecode-vault/` holdouts = `19` total) against both a naive smoke suite and `vibecode-anything`:
59
+
60
+ <p align="center">
61
+ <img src="assets/caught-cheating-ab.png" width="900" alt="Caught the AI Cheating — Naive 4/4 tests vs vibecode-anything differential oracle catching STUB_CONSTANT_OUTPUT, HOLDOUT_OVERFIT_SUSPECTED, and CONTRACT_TAMPERED while passing honest-cli 19/19" />
62
+ </p>
63
+
64
+ | Candidate Build | Naive Smoke Suite | `vibecode-anything` Oracle Verdict | Exit |
65
+ | :--- | :---: | :--- | :---: |
66
+ | `1. Constant Stub` (`cheat-stub.ts`) | `4/4 PASS` (fooled) | **CAUGHT:** `STUB_CONSTANT_OUTPUT` (`0/19`, `antiCheat=suspected`) | `1` |
67
+ | `2. Visible Overfit` (`cheat-overfit.ts`) | `4/4 PASS` (fooled) | **CAUGHT:** `HOLDOUT_OVERFIT_SUSPECTED` (`11/11` visible, `0/8` redacted vault) | `1` |
68
+ | `3. Contract Tamper` (`tamper-agent.mjs`) | `4/4 PASS` (fooled) | **STOPPED:** `CONTRACT_TAMPERED` (`.vibecode/contract.json` SHA-256 mismatch) | `1` |
69
+ | `4. Honest Rebuild` (`honest-cli.ts`) | `4/4 PASS` | **CLEAN PASS:** `19/19` (`11/11` visible + `8/8` live vault holdouts, `antiCheat=clean`) | `0` |
70
+
71
+ Reproduce the full A/B proof offline in seconds:
72
+
73
+ ```bash
74
+ node examples/14-caught-ai-cheating/run.ts --pretty
75
+ ```
76
+
77
+ ## 3-Step Showcase
78
+
79
+ ### 1. Ingest any reference into a contract, spec, and vault holdouts
80
+
81
+ ```bash
82
+ vibecode-anything ingest --domain cli --source "node ./ref-cli.ts" --force
83
+ ```
84
+
85
+ Generates `.vibecode/contract.json`, deterministic `.vibecode/SPEC.md`, and hidden holdout probes stored safely outside your workspace in `~/.vibecode-vault/`.
86
+
87
+ ### 2. Build autonomously with fresh context (or via MCP)
88
+
89
+ ```bash
90
+ # Autonomous Goldfish loop: spawns a fresh agent session per iteration until parity passes
91
+ vibecode-anything run --target "node ./new-cli.ts" --agent claude --max-iterations 5 --cache --strict
92
+
93
+ # Or connect your IDE/CLI agent over stdio MCP
94
+ vibecode-anything setup --clients auto --scope project
95
+ ```
96
+
97
+ ### 3. Inspect objective proof in `.vibecode/report.html`
98
+
99
+ ```bash
100
+ vibecode-anything verify --target "node ./new-cli.ts" --strict
101
+ vibecode-anything report --out .vibecode/report.html
102
+ ```
103
+
104
+ ## Visual Proof Report (`.vibecode/report.html`)
105
+
106
+ Every `verify` and `run` automatically writes a **100% offline, zero-external-asset `.vibecode/report.html`** (also readable via MCP resource `vibecode://report`) with interactive Before/After PNG split comparison, pixel-diff heatmap toggle, Goldfish iteration convergence sparkline, unified diffs, automatic secret/vault redaction, and strict XSS escaping. **[Open live interactive visual proof demo](https://nguyenthanhthe.github.io/vibecode-anything/demo/)** (reproducible via `node examples/06-visual-html-demo/generate.ts`):
107
+
108
+ <p align="center">
109
+ <img src="assets/report-preview.svg" width="900" alt="vibecode-anything self-contained visual proof report preview showing Gate PASS 100%, Before/After visual split with Pixel-Diff overlay, Iteration Convergence sparkline, Holdout Vault Shield, and Unified Diff snippet" />
110
+ </p>
111
+
112
+ ## Quick Start
113
+
114
+ Paste this into your coding agent:
115
+
116
+ ```text
117
+ Install vibecode-anything with npm i -g vibecode-anything, then run vibecode-anything setup.
118
+ Ingest the reference into .vibecode/contract.json and iterate slice by slice until vibecode-anything verify --strict passes.
119
+ ```
120
+
121
+ ### Connect your agent (MCP + Skill)
122
+
123
+ Install globally and register MCP + `SKILL.md` for Claude Code, Cursor, Antigravity, Codex, OpenCode, Windsurf, or Cline:
124
+
125
+ ```bash
126
+ npm install -g vibecode-anything
127
+ vibecode-anything setup --clients auto --scope project
128
+ vibecode-anything setup --dry-run
129
+ vibecode-anything doctor # verify Node, optional adapters, and MCP registration
130
+ vibecode-anything doctor --strict # promote optional adapter/MCP warnings to exit 1
131
+ ```
132
+
133
+ `vibecode-anything mcp` speaks **newline-delimited JSON-RPC 2.0 over stdio** (zero stdout log noise):
134
+
135
+ - **Tools:** `vibecode_discover`, `vibecode_lock`, `vibecode_ingest`, `vibecode_verify`, `vibecode_diagnose`, `vibecode_flake`, `vibecode_report`, `vibecode_status`, `vibecode_diff`, `vibecode_doctor`
136
+ - **Resources:** `vibecode://contract`, `vibecode://spec`, `vibecode://last-report`, `vibecode://report`
137
+ - **Prompts:** `vibecode_rebuild_slice`, `vibecode_fix_failures` (`prompts/list`, `prompts/get`)
138
+ - **Incremental slices, semantic modes, parallel verification, diff-driven impact, fixtures, strength auditing & trends:** `vibecode_ingest` and `vibecode_lock` support `asyncapi`, `proto`, and `openrpc` alongside `insomnia`, `bruno`, `openapi`, `graphql`, `postman`, `curl`, and `http-file`, and `vibecode_ingest` accepts workspace-confined `fromTests` (plus optional `target`) to statically import `node:test`, Jest, Vitest, Supertest, or `pytest` suites without executing user code; `vibecode_verify` accepts `affected` (git-diff impact selection with fail-closed full fallback), `mode` (`exact`, `structural`, `functional`, `reskin`), `concurrency` (`1-8`, deterministic ordering), `sliceIds`, `useCache`, `noReport`, `skipFixtures`, `targets` (per-domain map such as `{ "web": "http://localhost:3000", "cli": "node ./bin/app.mjs" }`, making `target` optional), and `vars` (runtime secrets for `{{vars.NAME}}` templates, never cached and redacted from all MCP text), and records `.vibecode/trends.ndjson` unless `noReport` is set (built-in `plugin_svg_a11y` and `plugin_state_file` run automatically; custom local `--plugin` execution and fixture `--allow-fixture-commands` hooks are CLI-only); `vibecode_flake` accepts `targets` (making `target` optional), `vars`, `skipFixtures`, `runs`, `invariantIds`, `sliceIds`, `strict`, `headers`, and `storageState` (while keeping `revealHoldouts` and `allowFixtureCommands` CLI-only); `vibecode_diagnose` accepts `includeStrength` to attach static oracle strength & stub-bypass mutation audit scores; `vibecode_status` includes a per-slice progress summary and accepts `includeTrends` / `trendWindow` to surface verification trends, sparklines, latency drift, and flaky hotspots; `vibecode://spec` serves `.vibecode/SPEC.md`; `vibecode://report` serves `.vibecode/report.html`; and isolated holdouts stay hidden from MCP reads.
139
+
140
+ ### Use from the terminal (CLI)
141
+
142
+ ```bash
143
+ # 0. Inspect a project or lock working behavior before a refactor
144
+ vibecode-anything discover --pretty
145
+ vibecode-anything lock --pretty
146
+ vibecode-anything lock --check --pretty
147
+
148
+ # 1. Ingest a reference into .vibecode/contract.json + .vibecode/SPEC.md (+ hidden holdouts)
149
+ vibecode-anything ingest --domain cli --source "node ./ref-cli.ts" --force
150
+ vibecode-anything ingest --domain web --source "http://localhost:3000" --route / --crawl-depth 2 --holdout-route /admin --force
151
+ vibecode-anything ingest --domain image --source ./mockup.png --force
152
+ vibecode-anything ingest --domain video --source ./frames/ --force
153
+
154
+ # 2. Run the differential oracle against your new build (auto-generates .vibecode/report.html)
155
+ vibecode-anything verify --target "node ./new-cli.ts"
156
+ vibecode-anything verify --target "node ./new-cli.ts" --strict --cache # soft fail + SHA-256 replay cache
157
+ vibecode-anything verify --target "node ./new-cli.ts" --slice cli-core # verify one incremental slice
158
+
159
+ # 3. Or run a closed-loop fresh-context agent build until 100% parity
160
+ vibecode-anything run --target "node ./new-cli.ts" --agent claude --max-iterations 5
161
+
162
+ # 4. Re-verify automatically on edit or regenerate the HTML visual proof report
163
+ vibecode-anything watch --target "node ./new-cli.ts" --watch-path ./src --debounce 250
164
+ vibecode-anything report --out .vibecode/report.html
165
+
166
+ # 5. Inspect contract status, root-cause diagnosis, flake stability, or one invariant diff
167
+ vibecode-anything status
168
+ vibecode-anything diff --invariant inv-cli-help
169
+ vibecode-anything diagnose --brief
170
+ vibecode-anything flake --target "node ./new-cli.ts" --runs 3 --pretty
171
+ ```
172
+
173
+ ### Drop-in GitHub Action (CI Gate)
174
+
175
+ Enforce behavioral + visual parity on every pull request with `action.yml`, automatically posting `.vibecode/pr-summary.md` to the job summary and emitting a flat-square SVG badge:
176
+
177
+ ```yaml
178
+ - uses: nguyenthanhthe/vibecode-anything@v0.4.0
179
+ with:
180
+ target: "node ./dist/server.js"
181
+ strict: "true"
182
+ cache: "true"
183
+ badge: ".vibecode/parity.svg"
184
+ baseline: ".vibecode/baseline-report.json" # optional PR regression gate
185
+ ```
186
+
187
+ ### Programmatic TypeScript SDK
188
+
189
+ Embed ingestion, differential verification, YAML parsing, interactive HTML reports, and badge generation directly in Node.js `>=20` / TypeScript via `vibecode-anything`:
190
+
191
+ ```ts
192
+ import { ingest, verifyContract, readContract, writeHtmlReport, renderParityBadgeSvg } from "vibecode-anything";
193
+
194
+ await ingest({ source: "./petstore.yaml", cwd: process.cwd(), force: true });
195
+ const report = await verifyContract(readContract(process.cwd()), { target: "http://127.0.0.1:3000", cwd: process.cwd() });
196
+ writeHtmlReport({ contract: readContract(process.cwd()), report, workspaceDir: process.cwd() });
197
+ const svg = renderParityBadgeSvg(report);
198
+ ```
199
+
200
+ ## How It Works
201
+
202
+ <p align="center">
203
+ <img src="assets/architecture-v04.svg" width="900" alt="vibecode-anything v0.4.0 closed-loop architecture" />
204
+ </p>
205
+
206
+ ```mermaid
207
+ flowchart LR
208
+ Ref["Reference<br/>CLI · Web · API · Repo · Image · Video · HAR"] -->|"ingest"| Contract[".vibecode/contract.json<br/>SPEC.md + Vault Holdouts"]
209
+ Contract --> Agent["Coding Agent<br/>Goldfish Fresh-Context Loop"]
210
+ Agent -->|"verify / watch / run"| Oracle["Differential Oracle<br/>Hard 100% · Soft / --strict · Anti-Cheat"]
211
+ Oracle -->|"fail -> exact diff"| Agent
212
+ Oracle -->|"pass"| Gate["Parity Gate Exit 0<br/>.vibecode/report.html"]
213
+ ```
214
+
215
+ - **Two-tier parity gate:** Hard invariants (exit codes, golden stdout/stderr, JSON schemas, DOM landmarks, image dimensions, monotonic video state order, filesystem side-effects) must pass **100%** (`exit 1` on failure). Soft perceptual invariants (SSIM, pixel diff ratio, color palette, XY-cut region IoU, motion IoU) emit warnings by default (`exit 0`) and become hard gate failures under `--strict` (`exit 1`). If every evaluated invariant is skipped (`ADAPTER_MISSING`), the gate returns `incomplete` (`exit 2`).
216
+ - **Zero-Assumption Spec & isolated holdout vault:** Unless `--no-spec` is passed, `ingest` compiles a deterministic `.vibecode/SPEC.md` capturing every visible invariant, schema, and layout rule while redacting secrets and hiding vault paths. Negative/boundary probes, `--holdout-route` paths, and 20% trace partitions live in `~/.vibecode-vault/<sha256-16>/holdouts.json`, excluded from `.vibecode/contract.json` and MCP reads, with failures redacted by default (inspectable locally only via CLI `--reveal-holdouts`).
217
+ - **Goldfish fresh-context `run` loop & anti-cheat:** Each iteration feeds a fresh agent context only `.vibecode/SPEC.md` and the compact failing diffs, verifies SHA-256 contract/vault hashes to reject tampering (`CONTRACT_TAMPERED`), flags constant stubs or holdout overfitting, and stops safely on convergence, plateau, or quota limits.
218
+ - **Zero runtime dependencies:** Core CLI, pure-Node PNG codec, SSIM/YIQ/dHash/XY-cut layout engine, monotone video DP aligner, SHA-256 replay cache, file watcher, doctor diagnostics, HTML report generator, and JSON-RPC 2.0 MCP server run on Node.js `>=20` built-ins alone. Optional adapters (`Playwright`, `sharp`, `ffmpeg`/`ffprobe`) plug in automatically and degrade cleanly with `ADAPTER_MISSING` hints when absent.
219
+
220
+ ## What You Can Verify
221
+
222
+ | Domain | Status | Ingestor | Differential Oracle | Optional Adapter / Fallback |
223
+ | :--- | :---: | :--- | :--- | :--- |
224
+ | `cli` / `script` | Verified | `--help` tree, subcommands, flags, negative probes, `--fs-diff`, `--from-commands` | Exit code, stdout/stderr, JSON schema, `jsonPaths`, fs side-effects, golden diff, live `perf_budget` latency & output byte budgets | None (Node built-in) |
225
+ | `web` / `url` | Verified | Routes (`--crawl-depth`), HTML & interactive landmarks, `--from-har`, `--header`, `--storage-state` | `web_route` (incl. multi-viewport `responsiveViewports` audits), `web_flow`, `web_network`, `web_ui_states` (hover/focus, keyboard Tab order & focus traps, disabled/empty/error states, local/session storage), `pageerror` / HTTP `>= 500` checks | `Playwright` optional (native `fetch` + HTML responsive fallback) |
226
+ | `api` | Verified | OpenAPI 3.x / Swagger 2.0 (`.json`, `.yaml`, `.yml`), AsyncAPI 2.x/3.x (`.yaml`/`.json`), Protobuf (`.proto`), OpenRPC 1.x JSON-RPC 2.0 (`.json`/`.yaml`), GraphQL SDL/Introspection (`.graphql`, `.gql`, `__schema`), REST Client (`.http`/`.rest`), Insomnia v4 (`.json`/`.yaml`), Bruno (`.bru` & `bruno.json`), Postman v2.x, Copy-as-cURL & `.har` traces (plus reverse `export-openapi` YAML/JSON) | Status, JSON subset, JSON schema (Draft 2020-12 / OpenAPI 3.0), headers, stateful `http_workflow` chains, `http_stream` (SSE/NDJSON), RFC 6455 `ws_protocol`, and live `perf_budget` p50/p95/p99 latency & payload byte budgets | None (native `fetch` + built-in YAML/GraphQL/Bruno/AsyncAPI/Protobuf/OpenRPC parsers) |
227
+ | `repo` | Verified | Exported symbol scan | `repo_exports` | None (Node built-in) |
228
+ | `image` | Verified | Dimensions, palette, XY-cut layout regions | Hard dimensions/non-blank; soft SSIM, pixel diff PNG, palette, region IoU; `--mode reskin` / `wcagLevel` WCAG 2.1 contrast & design-token audit | `sharp` optional (pure-Node PNG built-in) |
229
+ | `video` | Verified | Scene + periodic keyframes (`--crop`) or PNG frame dir + `.srt`/`.vtt` | Monotone state-order DP + soft keyframe SSIM/motion IoU + live URL scroll capture | `ffmpeg`/`ffprobe` optional (frame dir works) |
230
+ | `rea` / `cli-anything` / `postman` / `curl` / `graphql` / `http-file` / `insomnia` / `bruno` / `asyncapi` / `proto` / `openrpc` | Verified | Thin JSON contract, Postman v2.x, Copy-as-cURL, GraphQL, `.http`/`.rest`, Insomnia v4, Bruno `.bru`, AsyncAPI 2.x/3.x, `.proto` & OpenRPC 1.x JSON-RPC importers | Reuses the same multi-modal oracles | None (JSON / cURL / GraphQL / HTTP-file / Bruno / AsyncAPI / Protobuf / OpenRPC bridge) |
231
+
232
+ ## Examples
233
+
234
+ Self-contained, offline, zero-dependency walkthroughs live in [`examples/`](examples/README.md). Each runner executes inside an isolated `os.tmpdir()` workspace and cleans up on exit so `.vibecode/` is never left in the repository:
235
+
236
+ ```bash
237
+ node examples/01-cli-rebuild/run.ts # CLI ingest -> broken build fails (exit 1) -> diff -> fixed passes (exit 0)
238
+ node examples/02-web-image-rebuild/run.ts # Web HTTP fallback + pure-Node PNG soft-warn vs --strict + diff PNG
239
+ node examples/03-gron-cli-rebuild/run.ts # Real-world gron CLI rebuild -> external holdout redaction -> deterministic SPEC.md
240
+ node examples/04-autonomous-run-loop/run.ts # Closed-loop Goldfish run (mock agent): Iter 1 fail -> Iter 2 fix -> 100% + report.html
241
+ node examples/05-openapi-yaml-rebuild/run.ts # OpenAPI 3.0.3 YAML auto-ingest -> HTTP verify --pretty -> badge SVG + PR Markdown
242
+ node examples/07-curl-postman-rebuild/run.ts # Copy-as-cURL & Postman v2.1 auto-ingest -> pretty DX -> SARIF/JUnit/badge/MD
243
+ node examples/08-graphql-api-rebuild/run.ts # GraphQL SDL auto-ingest -> HTTP 200 errors/non-null drift -> doctor --pretty
244
+ node examples/09-http-file-regression/run.ts # .http file auto-ingest -> secret redaction -> diff --baseline REGRESSION/IMPROVED
245
+ node examples/10-export-tests-bruno-merge/run.ts # Bruno .bru & Insomnia YAML ingest -> merge -> lint -> standalone export-tests
246
+ node examples/11-openapi-playwright-export/run.ts # cURL ingest -> export-openapi YAML roundtrip -> export-tests --format playwright
247
+ node examples/12-mock-server-http-export/run.ts # OpenAPI + web_route -> live mock self-verify -> export-http roundtrip
248
+ node examples/13-client-codegen-har-replay/run.ts # export-client (TS/Py/Go + live TS client) -> export-har HAR 1.2 roundtrip
249
+ node examples/14-caught-ai-cheating/run.ts # A/B proof catching stub, overfit & tamper vs honest vault pass
250
+ node examples/15-graphql-mcp-export/run.ts # ingest + merge -> export-graphql lossless roundtrip -> live export-mcp JSON-RPC 2.0
251
+ node examples/16-schema-load-export/run.ts # ingest + merge -> export-schema (Zod/JSON Schema/TS guards) -> live export-load
252
+ node examples/17-docs-asyncapi-export/run.ts # ingest asyncapi.yaml + cli-tool.mjs & merge -> live webhook verify -> export-docs
253
+ node examples/18-proto-ci-export/run.ts # ingest orders.proto + cli-tool.mjs & merge -> gRPC-JSON verify -> export-ci
254
+ ```
255
+
256
+ | Walkthrough | Domains | What It Proves |
257
+ | :--- | :--- | :--- |
258
+ | [Example 01 — CLI Rebuild (`invoice-cli`)](examples/01-cli-rebuild/README.md) | `cli` | Catches a dropped `qty` multiplier that still exits `0` with valid JSON keys, inspects the exact diff, and verifies the fixed rebuild (`100%` hard parity). |
259
+ | [Example 02 — Web & Image Rebuild (`StatusPulse`)](examples/02-web-image-rebuild/README.md) | `web`, `image` | Catches missing `<nav>` / `<table>` / `<title>` on HTTP `200` routes via `fetch` fallback, then compares default soft-warn (`exit 0`) vs `--strict` (`exit 1`) + pixel-diff PNG. |
260
+ | [Example 03 — Real-World `gron` CLI Rebuild (`gron-cli`)](examples/03-gron-cli-rebuild/README.md) | `cli` | Rebuilds `gron` + `--ungron` against isolated external holdout probes, verifies byte-for-byte deterministic `.vibecode/SPEC.md`, redacts failing holdouts, and proves `100%` strict parity. |
261
+ | [Example 04 — Autonomous Goldfish `run` Loop](examples/04-autonomous-run-loop/README.md) | `cli` | Drives `vibecode-anything run` end-to-end with a deterministic fresh-context mock agent from failing build to `100%` parity and writes `.vibecode/report.html`. |
262
+ | [Example 05 — OpenAPI 3.0.3 YAML API Rebuild (`petstore`)](examples/05-openapi-yaml-rebuild/README.md) | `api` | Auto-ingests OpenAPI 3.0.3 YAML (`$ref` + `allOf`) without `--domain`, catches schema/filter/404 bugs on HTTP `200`, passes `--pretty`, and emits `.vibecode/report.html`, parity SVG badge, and PR Markdown summary. |
263
+ | [Example 07 — Copy-as-cURL & Postman v2.1 Rebuild](examples/07-curl-postman-rebuild/README.md) | `api` | Zero-flag Copy-as-cURL & Postman v2.1 auto-ingest with secret stripping, `--pretty` (`verify`, `status`, `diff`), and HTML/SVG/Markdown/SARIF 2.1.0/JUnit XML exports. |
264
+ | [Example 08 — GraphQL SDL API Rebuild](examples/08-graphql-api-rebuild/README.md) | `api` | Zero-flag GraphQL SDL auto-ingest with secret stripping & mutation skipping, HTTP 200 `errors`/non-null drift detection, `verify --pretty`, and `doctor --pretty`. |
265
+ | [Example 09 — `.http` File & `diff --baseline` Regression](examples/09-http-file-regression/README.md) | `api` | Zero-flag `.http` auto-ingest with secret `@var`/query stripping and CI-ready `diff --baseline --pretty` catching `[REGRESSION]` (`exit 1`) and `[IMPROVED]` (`exit 0`). |
266
+ | [Example 10 — Standalone `export-tests`, Bruno & Insomnia Merge](examples/10-export-tests-bruno-merge/README.md) | `api` | Zero-flag Bruno `.bru` & Insomnia v4 YAML auto-ingest with secret stripping, `merge --with`, `lint --pretty`, and zero-dep runnable `export-tests --format node-test`. |
267
+ | [Example 11 — OpenAPI 3.0.3 Export & Playwright Codegen](examples/11-openapi-playwright-export/README.md) | `api` | Zero-flag Copy-as-cURL ingest with secret stripping, `export-openapi --format yaml` lossless roundtrip verification, and `export-tests --format playwright` live HTTP verification. |
268
+ | [Example 12 — Contract Mock Server & HTTP Collection Export](examples/12-mock-server-http-export/README.md) | `api`, `web` | Offline multi-domain workflow proving `mock --port 0 --dry-run --pretty`, live self-parity `verify`, `404` unknown-route safety, and lossless `export-http` (`http-file`/`curl`/`postman`) roundtrips. |
269
+ | [Example 13 — Typed Client Codegen & W3C HAR 1.2 Replay](examples/13-client-codegen-har-replay/README.md) | `api`, `web` | Offline workflow compiling `export-client` (`ts-fetch`, `python`, `go`), executing live `ts-fetch` calls against the mock server, and verifying lossless `export-har` HAR 1.2 roundtrips. |
270
+ | [Example 14 — Caught the AI Cheating (A/B Proof)](examples/14-caught-ai-cheating/README.md) | `cli` | Side-by-side proof where naive `4/4` suites false-pass `STUB_CONSTANT_OUTPUT`, `HOLDOUT_OVERFIT_SUSPECTED`, and `CONTRACT_TAMPERED` while clean rebuilds pass external vault holdouts. |
271
+ | [Example 15 — GraphQL & Standalone MCP Server Export](examples/15-graphql-mcp-export/README.md) | `api`, `cli` | Offline workflow ingesting OpenAPI + CLI specs into a merged contract, compiling lossless `export-graphql` (`sdl`/`introspection`) roundtrips, and running live spawned `export-mcp` stdio JSON-RPC 2.0 tools. |
272
+ | [Example 16 — Schema Codegen & Live Load Benchmarks](examples/16-schema-load-export/README.md) | `api`, `cli` | Offline workflow ingesting OpenAPI + CLI specs into `export-schema` (`zod`/`json-schema`/live `is<Name>()` TypeScript guards) and `export-load` (`k6`/`artillery`/live `node-bench` mock pass vs drift failure). |
273
+ | [Example 17 — AsyncAPI Webhooks & Docs/`llms.txt` Portal](examples/17-docs-asyncapi-export/README.md) | `api`, `cli` | Offline walkthrough ingesting AsyncAPI 2.6 webhooks + CLI probes, verifying live ephemeral webhook servers, and exporting Markdown, zero-CDN HTML portals, and `llms-txt`. |
274
+ | [Example 18 — Protobuf `.proto` & CI/CD Pipeline Export](examples/18-proto-ci-export/README.md) | `api`, `cli` | Offline workflow ingesting `.proto` services (`google.api.http` + ConnectRPC) + CLI probes, verifying live gRPC-JSON endpoints, and exporting `github-actions`, `gitlab-ci`, and TAB-indented `makefile` pipelines. |
275
+
276
+ ## Benchmarks
277
+
278
+ Run the self-contained differential mutation, anti-cheat, holdout, and replay-cache benchmark suite (`node benchmarks/run.ts`) across all **6 domains** (`cli`, `web`, `image`, `video`, `api`, `repo`) plus **Anti-Cheat**, **Vault Holdouts**, and **Sandbox** isolation:
279
+
280
+ | Domain / Category | Tasks / Mutants | Naive Baseline Caught | `vibecode-anything` Oracle Caught |
281
+ | :--- | :---: | :---: | :---: |
282
+ | `cli` | 15 | 0 / 15 (0.0%) | **15 / 15 (100.0%)** |
283
+ | `web` | 12 | 0 / 12 (0.0%) | **12 / 12 (100.0%)** |
284
+ | `image` | 5 | 0 / 5 (0.0%) | **5 / 5 (100.0%)** |
285
+ | `video` | 5 | 0 / 5 (0.0%) | **5 / 5 (100.0%)** |
286
+ | `api` | 58 | 0 / 58 (0.0%) | **58 / 58 (100.0%)** |
287
+ | `repo` | 5 | 0 / 5 (0.0%) | **5 / 5 (100.0%)** |
288
+ | `anticheat` (`STUB_CONSTANT_OUTPUT`, overfit, contract tamper/lint, injection) | 19 | 0 / 19 (0.0%) | **19 / 19 (100.0%)** |
289
+ | `holdout` (External `~/.vibecode-vault` edge/boundary checks) | 6 | 0 / 6 (0.0%) | **6 / 6 (100.0%)** |
290
+ | `sandbox` (`--fs-diff` silent mutations & env drift) | 3 | 0 / 3 (0.0%) | **3 / 3 (100.0%)** |
291
+ | **Total** | **128** | **0 / 128 (0.0%)** | **128 / 128 (100.0%)** |
292
+
293
+ Warm `--cache` replay verification on `01-cli-csv-tool` caches `13 / 17` visible invariants (`4` external vault holdouts always re-run live) for a verified **2.20x** local speedup (`14,729 ms -> 6,706 ms`, saving `8,023 ms` / `-54.5%` wall-clock latency).
294
+
295
+ ```bash
296
+ node benchmarks/run.ts # print Markdown coverage & subtle-bug tables
297
+ node benchmarks/run.ts --json # emit machine-readable benchmark JSON
298
+ ```
299
+
300
+ The A/B agent evaluation protocol and golden/results aggregator live in [`benchmarks/PROTOCOL.md`](benchmarks/PROTOCOL.md):
301
+
302
+ ```bash
303
+ node benchmarks/runner.ts --list
304
+ node benchmarks/runner.ts --prepare # ingest each task's reference into benchmarks/golden/
305
+ node benchmarks/runner.ts --results <dir> # aggregate runs -> benchmarks/summary.json + Markdown table
306
+ ```
307
+
308
+ ## CLI Reference
309
+
310
+ | Command | Purpose | Flags & Options |
311
+ | :--- | :--- | :--- |
312
+ | `discover` | Inspect a workspace for frameworks, entrypoints, routes, API specs, ports, slices, and ready-to-run commands | `--dir <path>`, `--pretty` |
313
+ | `lock` | Snapshot working behavior into `.vibecode/contract.json`, `.vibecode/SPEC.md`, external holdouts, and `.vibecode/lock.json` (or check tamper/drift with `--check`) | `--check`, `--source`, `--domain`, `--target <cmd-or-url>`, `--name`, `--force`, `--strict`, `--no-spec`, `--no-verify`, `--pretty`, `--probe` (repeatable), `--probes <file.json>`, `--route` (repeatable), `--crawl-depth <1-3>`, `--holdout-route <path>` (repeatable), `--endpoints <file.json>`, `--base-url <url>`, `--header <Key: Value>` (repeatable), `--storage-state <file>`, `--env <KEY=VAL>` (repeatable), `--fs-diff` |
314
+ | `init` | Create a starter v0.1-compatible `.vibecode/contract.json` | `--domain`, `--source`, `--name`, `--force` |
315
+ | `ingest` | Probe a reference and write `.vibecode/contract.json`, `.vibecode/SPEC.md`, and isolated holdouts | `--source`, `--domain`, `--name`, `--force`, `--no-spec`, `--probe` (repeatable), `--probes <file.json>`, `--route` (repeatable), `--crawl-depth <1-3>`, `--holdout-route <path>` (repeatable), `--flow <file.json>`, `--endpoints <file.json>`, `--base-url <url>`, `--scene-threshold <n>`, `--max-frames <n>`, `--crop <w:h:x:y>`, `--env <KEY=VAL>` (repeatable), `--fs-diff`, `--header <Key: Value>` (repeatable), `--storage-state <file>`, `--from-commands <file>`, `--from-har <file>`, `--from-tests <path>` (static JS/TS/pytest import) |
316
+ | `verify` | Run the differential oracle and write `.vibecode/last-report.json`, `.vibecode/report.html` & `.vibecode/trends.ndjson` | `--target <cmd-or-url>` (optional when `--target-map` covers the domains), `--target-map <domain=target\|json>` (repeatable, e.g. `web=http://localhost:3000`), `--var <KEY=VAL>` (repeatable; also `VIBECODE_VAR_*`; fills `{{vars.NAME}}`, bypasses cache, redacted from all output and printed as `<REDACTED>` in `repro`), `--mode <exact\|structural\|functional\|reskin>`, `--concurrency <1-8>`, `--plugin <file.mjs>` (repeatable), `--affected` (verify only git-changed impacted invariants with fail-closed full fallback), `--strict`, `--invariant <id>` (repeatable), `--slice <id>` (repeatable), `--reveal-holdouts`, `--no-report`, `--no-fixtures` (skip `contract.fixtures` setup/teardown/rollback), `--allow-fixture-commands` (CLI-only opt-in for shell-free fixture command hooks), `--cache`, `--pretty`, `--header <Key: Value>` (repeatable), `--storage-state <file>` |
317
+ | `run` | Autonomous fresh-context slice loop until parity passes or safe stop | `--target <cmd-or-url>` (optional when `--target-map` covers the domains), `--target-map <domain=target\|json>` (repeatable), `--var <KEY=VAL>` (repeatable; also `VIBECODE_VAR_*`), `--mode <exact\|structural\|functional\|reskin>`, `--concurrency <1-8>`, `--plugin <file.mjs>` (repeatable), `--source <ref>`, `--domain <domain>`, `--agent <auto\|claude\|codex\|agy\|opencode\|mock:script>`, `--max-iterations <n>`, `--max-minutes <m>`, `--slice <id>` (repeatable), `--strict`, `--dry-run`, `--force`, `--no-report`, `--no-fixtures`, `--allow-fixture-commands`, `--cache`, `--pretty`, `--header <Key: Value>` (repeatable), `--storage-state <file>` |
318
+ | `report` | Generate self-contained HTML report, parity SVG badge, PR Markdown summary, SARIF 2.1.0, or JUnit XML | `--out <file>`, `--badge <file.svg>`, `--markdown <file.md>`, `--sarif <file.sarif>`, `--junit <file.xml>`, `--no-report` |
319
+ | `export-tests` | Export visible contract invariants into standalone zero-dep tests (`node-test`, `vitest`, `pytest`, `shell`, `playwright`) | `--format <node-test\|vitest\|pytest\|shell\|playwright>`, `--out <file>`, `--target <cmd-or-url>` |
320
+ | `export-openapi` | Compile visible HTTP invariants into an OpenAPI 3.0.3 YAML or JSON spec (secrets & holdouts stripped) | `--format <yaml\|json>`, `--out <file>`, `--name <title>`, `--base-url <url>` |
321
+ | `export-http` | Export visible HTTP invariants as `.http`, Copy-as-cURL, or Postman v2.1 collections (secrets & holdouts stripped) | `--format <http-file\|curl\|postman>`, `--out <file>`, `--name <title>`, `--base-url <url>` |
322
+ | `export-client` | Compile visible HTTP invariants into zero-dep typed TypeScript, Python, or Go API clients (secrets & holdouts excluded) | `--format <ts-fetch\|python\|go>`, `--out <file>`, `--name <title>`, `--base-url <url>`, `--pretty` |
323
+ | `export-har` | Export visible HTTP and web route invariants into a W3C HAR 1.2 archive (secrets & holdouts excluded) | `--out <file>`, `--name <title>`, `--base-url <url>`, `--pretty` |
324
+ | `export-graphql` | Compile visible GraphQL & REST HTTP invariants into GraphQL SDL or Introspection JSON (secrets & holdouts excluded) | `--format <sdl\|introspection>`, `--out <file>`, `--name <title>`, `--pretty` |
325
+ | `export-mcp` | Generate a standalone zero-dep runnable stdio JSON-RPC 2.0 MCP server from visible HTTP & CLI invariants | `--format <node-mjs\|ts>`, `--out <file>`, `--name <title>`, `--base-url <url>`, `--pretty` |
326
+ | `export-schema` | Compile visible HTTP & CLI schemas into Zod validators, Draft 2020-12 JSON Schema, or strict TypeScript guards | `--format <zod\|json-schema\|typescript>`, `--out <file>`, `--name <title>`, `--strict`, `--pretty` |
327
+ | `export-load` | Generate zero-secret load & soak benchmark suites for k6, Artillery YAML, or zero-dep Node runner | `--format <k6\|artillery\|node-bench>`, `--out <file>`, `--name <title>`, `--base-url <url>`, `--strict`, `--pretty` |
328
+ | `export-docs` | Generate Markdown reference, zero-CDN HTML interactive explorer, or `llms.txt` from visible invariants | `--format <markdown\|html\|llms-txt>`, `--out <file>`, `--name <title>`, `--base-url <url>`, `--strict`, `--pretty` |
329
+ | `export-ci` | Generate GitHub Actions, GitLab CI, or TAB-indented Makefile parity workflows (holdouts & secrets excluded) | `--format <github-actions\|gitlab-ci\|makefile>`, `--out <file>`, `--name <title>`, `--target <cmd-or-url>`, `--strict`, `--cache`, `--pretty` |
330
+ | `export-server` | Generate runnable zero-dep Node HTTP, Express TypeScript, or Python HTTP server scaffolds (holdouts & secrets excluded) | `--format <node-http\|express-ts\|python-http>`, `--out <file>`, `--name <title>`, `--port <n>`, `--strict`, `--pretty` |
331
+ | `mock` | Serve a deterministic contract mock server for visible `http` & `web_route` invariants (holdouts & secrets excluded) | `--port <n>`, `--dry-run`, `--pretty` |
332
+ | `merge` | Compose another contract into `.vibecode/contract.json` and inspect structural drift | `--with <contract.json>`, `--out <file>`, `--prefix <p>`, `--on-conflict <prefix\|overwrite\|skip>`, `--dry-run`, `--no-spec`, `--pretty` |
333
+ | `watch` | Re-run verification when watched paths change | `--target <cmd-or-url>`, `--target-map <domain=target>` (repeatable), `--var <KEY=VAL>` (repeatable), `--mode <exact\|structural\|functional\|reskin>`, `--concurrency <1-8>`, `--plugin <file.mjs>` (repeatable), `--smart` (selectively re-verify only impacted invariants per edit and skip docs-only edits), `--slice <id>` (repeatable), `--watch-path <dir>` (repeatable), `--debounce <ms>`, `--strict`, `--invariant <id>` (repeatable), `--no-fixtures`, `--allow-fixture-commands`, `--cache`, `--pretty`, `--header <Key: Value>` (repeatable), `--storage-state <file>` |
334
+ | `status` | Show contract metadata, adapter availability, slice summary, last report summary & verification trends | `--trends` (include `.vibecode/trends.ndjson` sparklines, latency drift & flaky hotspots), `--pretty` |
335
+ | `diff` | Compare `.vibecode/last-report.json` against a baseline report (`--baseline`) or inspect one invariant result | `--invariant <id>`, `--id <id>`, `--baseline <report.json>`, `--reveal-holdouts`, `--strict`, `--pretty` |
336
+ | `diagnose` | Root-cause failure triage on `.vibecode/last-report.json` with 3×3 spatial pixel-diff heatmaps, bbox shift vectors, and a minimal repair brief | `--brief`, `--strict`, `--pretty` |
337
+ | `flake` | Run sequential multi-pass verification (bypassing cache) to detect flaky/nondeterministic invariants and suggest `expected.normalize` rules | `--target <cmd-or-url>`, `--target-map <domain=target>` (repeatable), `--var <KEY=VAL>` (repeatable), `--runs <2-10>`, `--invariant <id>` (repeatable), `--slice <id>` (repeatable), `--strict`, `--reveal-holdouts`, `--no-fixtures`, `--allow-fixture-commands`, `--pretty`, `--header <Key: Value>` (repeatable), `--storage-state <file>` |
338
+ | `lint` | Audit `.vibecode/contract.json` for leaked secrets, weak assertions, duplicate IDs/probes, slice issues, and oracle strength | `--strength` (run static oracle strength & stub-bypass mutation audit), `--strict`, `--pretty` |
339
+ | `doctor` | Report environment health: Node, optional adapters, optional CLIs, coding agents, and MCP registration | `--scope <project\|global>`, `--strict`, `--antigravity-dir <dir>`, `--pretty` |
340
+ | `mcp` | Start the newline-delimited JSON-RPC 2.0 stdio MCP server | (no required flags) |
341
+ | `setup` | Idempotently merge MCP config and install `SKILL.md` for coding agents | `--clients <auto\|all\|claude-code,cursor,antigravity,codex,opencode,windsurf,cline>`, `--scope <project\|global>`, `--local`, `--dry-run`, `--antigravity-dir <dir>` |
342
+ | `help` | Print CLI usage summary (also `--help` / `-h` after any subcommand) | `--help`, `-h` |
343
+
344
+ **Exit codes:** `0` = command succeeded, `lock --check` valid, `diagnose` clean, `flake` stable, or parity gate `pass` / `pass_with_warnings`; `1` = parity gate `fail`, `diagnose` issues found, `flake` flaky/nondeterministic/failing invariants detected, `lock` baseline failure / overwrite conflict / tamper detected, existing contract without `--force` on `init`, `doctor` check failure (or warning with `--strict`), or setup config error; `2` = missing/invalid target, `--mode`, `--concurrency`, `--plugin`, `--runs`, directory, lock, report, or contract, missing required adapter (`incomplete` gate or all `flake` invariants skipped), missing `diff` invariant ID, or unknown command.
345
+
346
+ ---
347
+
348
+ ## FAQ
349
+
350
+ <details>
351
+ <summary><strong>Which coding agents work with vibecode-anything?</strong></summary>
352
+
353
+ Any agent that supports local stdio MCP servers, CLI execution, or agent skills. `vibecode-anything setup` automatically registers MCP configs and installs `SKILL.md` for **Claude Code, Cursor, Antigravity, Codex, OpenCode, Windsurf, and Cline** (`--clients all` installs all 7; `--clients auto` includes the core 3 plus any detected client config); `vibecode-anything run` natively drives `claude`, `codex`, `agy`, `opencode`, and custom `mock:<script>` adapters.
354
+
355
+ </details>
356
+
357
+ <details>
358
+ <summary><strong>Do I need Playwright, sharp, or ffmpeg installed?</strong></summary>
359
+
360
+ No. Core CLI, API, repo, HTTP fallback web verification, pure-Node PNG encoding/decoding + SSIM/layout comparison, and frame-directory video verification work with zero external dependencies. Installing `Playwright`, `sharp`, or `ffmpeg`/`ffprobe` unlocks full interactive browser flows (`web_flow` / `web_network`), non-PNG formats (JPEG/WebP), and raw `.mp4`/`.mov` scene extraction. Run `vibecode-anything doctor` to check what is available.
361
+
362
+ </details>
363
+
364
+ <details>
365
+ <summary><strong>How does --strict differ from default verify mode?</strong></summary>
366
+
367
+ By default, hard invariants must pass 100% (`exit 1` if any fail) while soft perceptual/layout invariants warn (`exit 0`, `pass_with_warnings`). Passing `--strict` promotes soft mismatches into hard gate failures (`exit 1`).
368
+
369
+ </details>
370
+
371
+ <details>
372
+ <summary><strong>How do --slice, --cache, and watch speed up agent build loops?</strong></summary>
373
+
374
+ Contracts group invariants into dependency-ordered slices (`--slice <id>`). Adding `--cache` reuses SHA-256 verified deterministic results while skipping holdouts and live URLs (auto-invalidating on file/strict/env edits), and `watch` debounces filesystem edits to surface `newlyFixed` and `newlyBroken` transitions live.
375
+
376
+ </details>
377
+
378
+ <details>
379
+ <summary><strong>Does vibecode-anything upload my code or targets anywhere?</strong></summary>
380
+
381
+ No. All ingestion, sandboxing, differential verification, image diffing, HTML proof generation, and MCP serving run 100% locally. See [SECURITY.md](SECURITY.md) for the full threat model and secret-redaction guarantees.
382
+
383
+ </details>
384
+
385
+ ## Roadmap
386
+
387
+ - [x] **v0.1.0-alpha:** Core `.vibecode/contract.json` schema, CLI skeleton, `cli` differential oracle, `SKILL.md`
388
+ - [x] **v0.2.0:** Multi-modal ingest/oracle support (`web`, `api`, `repo`, `image`, `video`), `rea` / `CLI-Anything` adapters, stdio MCP server, idempotent `setup`, and the A/B benchmark harness
389
+ - [x] **v0.3.0:** 100% strict TypeScript codebase (`src/`, `test/`, `benchmarks/`, `examples/`), incremental slice tracking, `watch` mode, and `doctor` diagnostics
390
+ - [x] **v0.4.0:** Deterministic `.vibecode/SPEC.md`, external holdout vault + anti-cheat gate, closed-loop Goldfish `run` orchestrator, SHA-256 `--cache`, and self-contained `.vibecode/report.html` visual proof
391
+
392
+ ## Documentation & Community
393
+
394
+ - [Contributing Guide](CONTRIBUTING.md)
395
+ - [Changelog](CHANGELOG.md)
396
+ - [Security Policy](SECURITY.md)
397
+ - [Examples Index](examples/README.md)
398
+ - [Live Interactive Showcase](https://nguyenthanhthe.github.io/vibecode-anything/) & [Live Visual Proof Demo](https://nguyenthanhthe.github.io/vibecode-anything/demo/)
399
+ - [GitHub Action Guide](docs/github-action.md)
400
+ - [TypeScript SDK Guide](docs/sdk.md)
401
+ - [System Architecture](docs/architecture.md)
402
+ - [Benchmark Protocol](benchmarks/PROTOCOL.md)
403
+ - [Agent Skill](skills/vibecode-anything/SKILL.md)
404
+ - [Roadmap Queue](docs/roadmap-queue.md) & [Evolution Log](docs/evolution-log.md)
405
+
406
+ ## License
407
+
408
+ [MIT](LICENSE)
package/dist/cli.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};