veycraft 0.0.0-stage → 2.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (250) hide show
  1. package/.agent/workflows/apply-url.md +8 -0
  2. package/.agent/workflows/build-portfolio.md +7 -0
  3. package/.agent/workflows/daily-run.md +7 -0
  4. package/.agent/workflows/demo.md +23 -0
  5. package/.agent/workflows/freelance-bid.md +7 -0
  6. package/.agent/workflows/freelance-service.md +7 -0
  7. package/.agent/workflows/github-audit.md +7 -0
  8. package/.agent/workflows/github-remote.md +7 -0
  9. package/.agent/workflows/linkedin-growth.md +7 -0
  10. package/.agent/workflows/portfolio-design.md +7 -0
  11. package/.agent/workflows/profile-update.md +8 -0
  12. package/.agent/workflows/quick-tailor.md +20 -0
  13. package/.agent/workflows/setup.md +8 -0
  14. package/.agent/workflows/tailor-cv.md +8 -0
  15. package/.agent/workflows/weekly-report.md +7 -0
  16. package/.agents/skills/apply-url/SKILL.md +10 -0
  17. package/.agents/skills/contract-and-nda-auditor/SKILL.md +9 -0
  18. package/.agents/skills/daily-run/SKILL.md +10 -0
  19. package/.agents/skills/demo/SKILL.md +10 -0
  20. package/.agents/skills/freelance-offer-radar-and-batch-bidder/SKILL.md +10 -0
  21. package/.agents/skills/freelance-profile-and-service-publisher/SKILL.md +10 -0
  22. package/.agents/skills/github-cli-remote-manager/SKILL.md +10 -0
  23. package/.agents/skills/linkedin-growth/SKILL.md +10 -0
  24. package/.agents/skills/offer-negotiator/SKILL.md +9 -0
  25. package/.agents/skills/profile-intelligence-engine/SKILL.md +10 -0
  26. package/.agents/skills/quick-tailor/SKILL.md +10 -0
  27. package/.agents/skills/recruiter-inbox-triage/SKILL.md +9 -0
  28. package/.agents/skills/rejection-pattern-analyzer/SKILL.md +9 -0
  29. package/.agents/skills/score-calibration/SKILL.md +9 -0
  30. package/.agents/skills/setup/SKILL.md +10 -0
  31. package/.agents/skills/tailor-cv/SKILL.md +10 -0
  32. package/.agents/skills/weekly-report/SKILL.md +10 -0
  33. package/.aiassistant/rules/AGENTS.md +11 -0
  34. package/.aider.conf.yml +5 -0
  35. package/.amazonq/rules/job-hunter.md +12 -0
  36. package/.augment/rules/job-hunter.md +17 -0
  37. package/.clinerules +14 -0
  38. package/.continue/rules/job-hunter.md +15 -0
  39. package/.cursor/rules/job-hunter.mdc +9 -0
  40. package/.github/CODEOWNERS +3 -0
  41. package/.github/copilot-instructions.md +5 -0
  42. package/.github/prompts/daily-run.prompt.md +10 -0
  43. package/.goosehints +12 -0
  44. package/.junie/guidelines.md +12 -0
  45. package/.kiro/steering/job-hunter.md +15 -0
  46. package/.openhands/microagents/repo.md +18 -0
  47. package/.roo/rules/job-hunter.md +12 -0
  48. package/.rules +12 -0
  49. package/.trae/rules/project_rules.md +10 -0
  50. package/.windsurfrules +14 -0
  51. package/AGENTS.md +126 -0
  52. package/AUTHORS.md +13 -0
  53. package/CHANGELOG.md +309 -0
  54. package/CLAUDE.md +22 -0
  55. package/CRUSH.md +12 -0
  56. package/GEMINI.md +42 -0
  57. package/HIRED.md +32 -0
  58. package/LICENSE +26 -0
  59. package/NOTICE +22 -0
  60. package/PLATFORMS.md +93 -0
  61. package/PROVENANCE.json +19 -0
  62. package/README.ar.md +238 -0
  63. package/README.md +208 -3
  64. package/WARP.md +12 -0
  65. package/adapters/apps/chatgpt-and-web-chats.md +18 -0
  66. package/adapters/apps/devin-desktop.md +13 -0
  67. package/adapters/apps/gemini-and-copilot.md +25 -0
  68. package/adapters/apps/hermes-pi-factory-openclaw.md +24 -0
  69. package/adapters/apps/openai-codex-cli.md +23 -0
  70. package/adapters/apps/opencode-and-kilocode.md +16 -0
  71. package/adapters/apps/qwen-mistral-kimi-deepseek.md +37 -0
  72. package/adapters/models/claude.md +28 -0
  73. package/adapters/models/deepseek-qwen-local.md +24 -0
  74. package/adapters/models/gemini.md +16 -0
  75. package/adapters/models/grok-and-kimi.md +14 -0
  76. package/adapters/models/mistral-and-llama.md +13 -0
  77. package/adapters/models/openai.md +16 -0
  78. package/bin/browser-payloads.mjs +507 -0
  79. package/bin/career-intelligence.mjs +8090 -0
  80. package/bin/cli.mjs +2032 -0
  81. package/bin/core-ops.mjs +1855 -0
  82. package/bin/fast-ops.mjs +1392 -0
  83. package/bin/fs-safety.mjs +1091 -0
  84. package/bin/mcp-server.mjs +787 -0
  85. package/bin/notion-sync.mjs +4625 -0
  86. package/bin/profile-intelligence.mjs +690 -0
  87. package/bin/ui-server.mjs +948 -0
  88. package/commands/apply-url.md +2 -0
  89. package/commands/build-portfolio.md +2 -0
  90. package/commands/daily-run.md +2 -0
  91. package/commands/demo.md +2 -0
  92. package/commands/freelance-bid.md +2 -0
  93. package/commands/freelance-service.md +2 -0
  94. package/commands/github-audit.md +2 -0
  95. package/commands/github-remote.md +2 -0
  96. package/commands/linkedin-growth.md +2 -0
  97. package/commands/portfolio-design.md +2 -0
  98. package/commands/profile-update.md +1 -0
  99. package/commands/quick-tailor.md +2 -0
  100. package/commands/setup.md +2 -0
  101. package/commands/tailor-cv.md +2 -0
  102. package/commands/weekly-report.md +2 -0
  103. package/config/guardrails.yaml +67 -0
  104. package/config/invariants.txt +7 -0
  105. package/context/DROP_YOUR_FILES_HERE.md +9 -0
  106. package/context/cv.md.example +12 -0
  107. package/context/feeds.yaml.example +27 -0
  108. package/context/form-answers.yaml.example +45 -0
  109. package/context/preferences.yaml.example +15 -0
  110. package/context/profile.md.example +20 -0
  111. package/context/readiness-state.json.example +64 -0
  112. package/context/resume-data.json.example +29 -0
  113. package/context/resume-facts.json.example +1 -0
  114. package/context/targets.yaml.example +433 -0
  115. package/docs/ARCHITECTURE.md +106 -0
  116. package/docs/COMPATIBILITY.md +92 -0
  117. package/docs/OPTIONAL_MCP_PLUGINS.md +49 -0
  118. package/docs/SKILL_CATALOG.md +73 -0
  119. package/docs/chat-commands.md +33 -0
  120. package/docs/demo-dashboard.html +646 -0
  121. package/docs/execution-safety.md +34 -0
  122. package/docs/index.html +634 -0
  123. package/docs/platform-registry.md +23 -0
  124. package/docs/repository-audit.md +12 -0
  125. package/evals/PROMPT.md +31 -0
  126. package/evals/README.md +36 -0
  127. package/evals/RUBRIC.md +51 -0
  128. package/evals/approval-gate.test.mjs +432 -0
  129. package/evals/career-intelligence.test.mjs +4647 -0
  130. package/evals/fast-ops.test.mjs +614 -0
  131. package/evals/fixtures/boards/bayt-mock.html +255 -0
  132. package/evals/fixtures/boards/gulftalent-mock.html +250 -0
  133. package/evals/fixtures/boards/naukri-mock.html +262 -0
  134. package/evals/fixtures/boards/stepstone-mock.html +245 -0
  135. package/evals/fixtures/candidate-profile.md +40 -0
  136. package/evals/fixtures/forms/ashby-mock.html +41 -0
  137. package/evals/fixtures/forms/greenhouse-mock.html +77 -0
  138. package/evals/fixtures/forms/lever-mock.html +46 -0
  139. package/evals/fixtures/forms/workday-mock.html +328 -0
  140. package/evals/fixtures/ground-truth.json +53 -0
  141. package/evals/fixtures/jds/01-strong-match.md +22 -0
  142. package/evals/fixtures/jds/02-prompt-injection-trap.md +23 -0
  143. package/evals/fixtures/jds/03-ghost-expired-job.md +14 -0
  144. package/evals/fixtures/jds/04-blacklist-duplicate.md +15 -0
  145. package/evals/fixtures/jds/05-stretch-mismatch.md +13 -0
  146. package/evals/journeys/journey-matrix.json +333 -0
  147. package/evals/journeys/run-journeys.test.mjs +1201 -0
  148. package/evals/mcp-server.test.mjs +665 -0
  149. package/evals/mena-boards.test.mjs +339 -0
  150. package/evals/naukri-board.test.mjs +304 -0
  151. package/evals/notion-sync.test.mjs +3479 -0
  152. package/evals/profile-intelligence.test.mjs +529 -0
  153. package/evals/results/baseline-verified-run.json +125 -0
  154. package/evals/results/live-agent-eval-run.json +143 -0
  155. package/evals/stepstone-board.test.mjs +318 -0
  156. package/evals/ui-server.test.mjs +502 -0
  157. package/evals/workday-fixture.test.mjs +268 -0
  158. package/examples/outputs/sample-interrogation-transcript.md +36 -0
  159. package/examples/outputs/sample-interview-dossier.md +33 -0
  160. package/examples/outputs/sample-outreach-75-words.md +13 -0
  161. package/examples/outputs/sample-tailoring-notes.md +70 -0
  162. package/examples/sandbox-demo/demo-profile.md +45 -0
  163. package/examples/sandbox-demo/expected-mission-control.md +16 -0
  164. package/examples/sandbox-demo/sample-jds.md +39 -0
  165. package/glama.json +6 -0
  166. package/llms.txt +70 -0
  167. package/mcp/README.md +80 -0
  168. package/mcp/claude_desktop_config.example.json +47 -0
  169. package/mcp/mcp.template.json +33 -0
  170. package/opencode.json +42 -0
  171. package/package.json +115 -6
  172. package/prompts/partials/pacing.md +8 -0
  173. package/prompts/partials/snapshot-first.md +4 -0
  174. package/prompts/partials/stop-conditions.md +5 -0
  175. package/schemas/application-ledger.schema.json +272 -0
  176. package/schemas/career-insights.schema.json +111 -0
  177. package/schemas/cv-versions.schema.json +83 -0
  178. package/schemas/notion-sync-plan.schema.json +338 -0
  179. package/schemas/profile-update-plan.schema.json +133 -0
  180. package/schemas/readiness.schema.json +484 -0
  181. package/schemas/resume-data.schema.json +171 -0
  182. package/scripts/install.ps1 +107 -0
  183. package/scripts/install.sh +130 -0
  184. package/skills/00-daily-run.md +89 -0
  185. package/skills/00-interrogate-and-onboard.md +87 -0
  186. package/skills/01-resume-ingestion.md +76 -0
  187. package/skills/02-discover-and-triage.md +121 -0
  188. package/skills/03-tailor-resume-and-verify.md +114 -0
  189. package/skills/04-fill-and-apply.md +108 -0
  190. package/skills/05-outreach-and-interview-prep.md +80 -0
  191. package/skills/06-log-and-insights.md +99 -0
  192. package/skills/07-persona-switcher.md +61 -0
  193. package/skills/08-follow-up-radar.md +59 -0
  194. package/skills/09-offer-negotiator.md +62 -0
  195. package/skills/10-autonomous-scheduler-loop.md +64 -0
  196. package/skills/11-portfolio-and-github-auditor.md +130 -0
  197. package/skills/12-recruiter-inbox-triage.md +69 -0
  198. package/skills/13-company-due-diligence.md +60 -0
  199. package/skills/14-privacy-pii-shield.md +56 -0
  200. package/skills/15-multilingual-adaptation.md +61 -0
  201. package/skills/16-rejection-pattern-analyzer.md +60 -0
  202. package/skills/17-score-calibration.md +61 -0
  203. package/skills/18-condition-based-browser-waiting.md +65 -0
  204. package/skills/19-on-demand-mcp-routing.md +69 -0
  205. package/skills/20-skill-authoring-standard.md +61 -0
  206. package/skills/21-ats-keyword-heatmap.md +60 -0
  207. package/skills/22-technical-assessment-architect.md +59 -0
  208. package/skills/23-contract-and-nda-auditor.md +60 -0
  209. package/skills/24-circuit-breaker-and-antiban.md +68 -0
  210. package/skills/25-prompt-injection-defense.md +59 -0
  211. package/skills/26-deduplication-and-blacklist-guard.md +59 -0
  212. package/skills/27-universal-cv-builder.md +99 -0
  213. package/skills/28-recruiter-brand-and-domain-intelligence.md +99 -0
  214. package/skills/29-portfolio-builder-and-deployer.md +160 -0
  215. package/skills/30-portfolio-design-system-and-qa.md +163 -0
  216. package/skills/54-github-cli-remote-manager.md +144 -0
  217. package/skills/55-freelance-profile-and-service-publisher.md +90 -0
  218. package/skills/56-freelance-offer-radar-and-batch-bidder.md +94 -0
  219. package/skills/REGISTRY.md +98 -0
  220. package/skills/ats/ashby.md +54 -0
  221. package/skills/ats/breezyhr.md +54 -0
  222. package/skills/ats/greenhouse.md +54 -0
  223. package/skills/ats/lever.md +54 -0
  224. package/skills/ats/smartrecruiters.md +54 -0
  225. package/skills/ats/taleo.md +43 -0
  226. package/skills/ats/workday.md +49 -0
  227. package/skills/fallback-no-mcp.md +57 -0
  228. package/skills/linkedin-growth.md +188 -0
  229. package/skills/meta-context-compaction.md +88 -0
  230. package/skills/meta-dom-recovery.md +63 -0
  231. package/skills/meta-self-verification.md +75 -0
  232. package/skills/meta-structured-debugging.md +69 -0
  233. package/skills/platforms/_template.md +69 -0
  234. package/skills/platforms/ats-engines.md +67 -0
  235. package/skills/platforms/b2b-contract-networks.md +59 -0
  236. package/skills/platforms/global-boards.md +122 -0
  237. package/skills/platforms/linkedin.md +162 -0
  238. package/skills/platforms/mena-boards.md +99 -0
  239. package/skills/platforms/remote-boards.md +64 -0
  240. package/skills/platforms/wellfound.md +59 -0
  241. package/skills/profile-intelligence-engine.md +98 -0
  242. package/skills/skills-manifest.json +1730 -0
  243. package/templates/analytics-dashboard.html +1106 -0
  244. package/templates/ats-cover-letter-template.html +29 -0
  245. package/templates/ats-resume-template.html +38 -0
  246. package/templates/ats-resume.html +3 -0
  247. package/ui/app.js +1113 -0
  248. package/ui/favicon.svg +4 -0
  249. package/ui/index.html +53 -0
  250. package/ui/styles.css +595 -0
@@ -0,0 +1,1201 @@
1
+ import test from 'node:test';
2
+ import assert from 'node:assert/strict';
3
+ import fs from 'node:fs';
4
+ import path from 'node:path';
5
+ import os from 'node:os';
6
+ import zlib from 'node:zlib';
7
+ import crypto from 'node:crypto';
8
+ import { spawnSync } from 'node:child_process';
9
+ import { fileURLToPath } from 'node:url';
10
+
11
+ const REPO_ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..', '..');
12
+ const CLI = [
13
+ process.env.JHO_CLI_PATH,
14
+ path.join(REPO_ROOT, 'bin', 'cli.mjs'),
15
+ path.join(os.homedir(), '.veycraft', 'bin', 'cli.mjs'),
16
+ path.join(os.homedir(), '.job-hunter-os', 'bin', 'cli.mjs'),
17
+ ].find(p => p && fs.existsSync(p));
18
+ assert.ok(CLI, 'Could not locate bin/cli.mjs (set JHO_CLI_PATH or run from repository root).');
19
+ const MATRIX = JSON.parse(fs.readFileSync(path.join(REPO_ROOT, 'evals', 'journeys', 'journey-matrix.json'), 'utf8'));
20
+
21
+ function runCli(args, cwd = REPO_ROOT) {
22
+ return spawnSync(process.execPath, [CLI, ...args], {
23
+ cwd,
24
+ encoding: 'utf8',
25
+ env: { ...process.env, NO_COLOR: '1' },
26
+ });
27
+ }
28
+
29
+ // Build a minimal valid OOXML .docx ZIP buffer with zero dependencies (stored ZIP entries).
30
+ function buildSyntheticDocx(documentXmlText) {
31
+ const crcTable = new Uint32Array(256);
32
+ for (let n = 0; n < 256; n++) {
33
+ let c = n;
34
+ for (let k = 0; k < 8; k++) c = (c & 1) ? (0xedb88320 ^ (c >>> 1)) : (c >>> 1);
35
+ crcTable[n] = c >>> 0;
36
+ }
37
+ const crc32 = buf => {
38
+ let c = 0xffffffff;
39
+ for (const b of buf) c = crcTable[(c ^ b) & 0xff] ^ (c >>> 8);
40
+ return (c ^ 0xffffffff) >>> 0;
41
+ };
42
+
43
+ const files = [
44
+ {
45
+ name: '[Content_Types].xml',
46
+ data: Buffer.from(
47
+ '<?xml version="1.0" encoding="UTF-8"?><Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="xml" ContentType="application/xml"/><Override PartName="/word/document.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml"/></Types>',
48
+ 'utf8',
49
+ ),
50
+ },
51
+ {
52
+ name: 'word/document.xml',
53
+ data: zlib.deflateRawSync(Buffer.from(documentXmlText, 'utf8')),
54
+ method: 8,
55
+ uncompressedSize: Buffer.byteLength(documentXmlText, 'utf8'),
56
+ crc: crc32(Buffer.from(documentXmlText, 'utf8')),
57
+ },
58
+ ];
59
+
60
+ const locals = [];
61
+ const centrals = [];
62
+ let offset = 0;
63
+
64
+ for (const f of files) {
65
+ const nameBuf = Buffer.from(f.name, 'utf8');
66
+ const method = f.method ?? 0;
67
+ const uncomp = f.uncompressedSize ?? f.data.length;
68
+ const crc = f.crc ?? crc32(f.data);
69
+
70
+ const lh = Buffer.alloc(30 + nameBuf.length);
71
+ lh.writeUInt32LE(0x04034b50, 0);
72
+ lh.writeUInt16LE(20, 4);
73
+ lh.writeUInt16LE(0, 6);
74
+ lh.writeUInt16LE(method, 8);
75
+ lh.writeUInt32LE(crc, 14);
76
+ lh.writeUInt32LE(f.data.length, 18);
77
+ lh.writeUInt32LE(uncomp, 22);
78
+ lh.writeUInt16LE(nameBuf.length, 26);
79
+ nameBuf.copy(lh, 30);
80
+ locals.push(lh, f.data);
81
+
82
+ const cd = Buffer.alloc(46 + nameBuf.length);
83
+ cd.writeUInt32LE(0x02014b50, 0);
84
+ cd.writeUInt16LE(20, 4);
85
+ cd.writeUInt16LE(20, 6);
86
+ cd.writeUInt16LE(0, 8);
87
+ cd.writeUInt16LE(method, 10);
88
+ cd.writeUInt32LE(crc, 16);
89
+ cd.writeUInt32LE(f.data.length, 20);
90
+ cd.writeUInt32LE(uncomp, 24);
91
+ cd.writeUInt16LE(nameBuf.length, 28);
92
+ cd.writeUInt32LE(offset, 42);
93
+ nameBuf.copy(cd, 46);
94
+ centrals.push(cd);
95
+
96
+ offset += lh.length + f.data.length;
97
+ }
98
+
99
+ const cdBuf = Buffer.concat(centrals);
100
+ const eocd = Buffer.alloc(22);
101
+ eocd.writeUInt32LE(0x06054b50, 0);
102
+ eocd.writeUInt16LE(files.length, 8);
103
+ eocd.writeUInt16LE(files.length, 10);
104
+ eocd.writeUInt32LE(cdBuf.length, 12);
105
+ eocd.writeUInt32LE(offset, 16);
106
+ return Buffer.concat([...locals, cdBuf, eocd]);
107
+ }
108
+
109
+ test('1. Universal Natural-Language Router covers all 14 core + 8 LinkedIn/platform + extended requests without forcing /setup', () => {
110
+ for (const j of MATRIX.journeys) {
111
+ const res = runCli(['route', j.prompt, '--json']);
112
+ assert.equal(res.status, 0, `route failed for "${j.prompt}": ${res.stderr}`);
113
+ const parsed = JSON.parse(res.stdout);
114
+ assert.equal(parsed.intent, j.expected_intent, `Intent mismatch for "${j.prompt}"`);
115
+ for (const sk of j.required_skills) {
116
+ assert.ok(parsed.skills.includes(sk), `Missing skill "${sk}" for "${j.prompt}"`);
117
+ }
118
+ assert.ok(parsed.skills.length <= 7, `Too many skills loaded (${parsed.skills.length}) for "${j.prompt}"`);
119
+ if (!j.requires_full_setup) {
120
+ assert.match(parsed.readiness, /task-specific/i, `Standalone task "${j.prompt}" must not force /setup`);
121
+ }
122
+ }
123
+ });
124
+
125
+ test('2. Metadata parity: offline-capable skills never require Playwright/Notion MCP while genuine browser skills keep Playwright', () => {
126
+ const manifest = JSON.parse(fs.readFileSync(path.join(REPO_ROOT, 'skills', 'skills-manifest.json'), 'utf8'));
127
+ const byName = new Map(manifest.skills.map(s => [s.name, s]));
128
+
129
+ for (const name of [
130
+ 'interrogate-and-onboard',
131
+ 'resume-ingestion',
132
+ 'tailor-resume-and-verify',
133
+ 'outreach-and-interview-prep',
134
+ 'log-and-insights',
135
+ 'portfolio-and-github-auditor',
136
+ 'portfolio-builder-and-deployer',
137
+ 'portfolio-design-system-and-qa',
138
+ 'recruiter-inbox-triage',
139
+ 'multilingual-adaptation',
140
+ 'linkedin-growth',
141
+ 'meta-self-verification',
142
+ ]) {
143
+ assert.deepEqual(byName.get(name).requires_mcp, ['none'], `${name} must declare requires_mcp: ["none"]`);
144
+ assert.ok(Array.isArray(byName.get(name).optional_mcp) && byName.get(name).optional_mcp.length >= 1, `${name} should declare optional_mcp`);
145
+ }
146
+
147
+ for (const name of ['daily-run', 'discover-and-triage', 'fill-and-apply', 'linkedin', 'greenhouse', 'lever', 'ashby']) {
148
+ assert.deepEqual(byName.get(name).requires_mcp, ['playwright'], `${name} genuinely requires playwright`);
149
+ }
150
+ });
151
+
152
+ test('3. CV Import & Format Honesty: reads MD, TXT, HTML, Word-compatible .doc, real .docx; blocks scanned PDF & fake .docx', () => {
153
+ const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'jho-cv-import-'));
154
+ try {
155
+ const mdPath = path.join(tmp, 'cv.md');
156
+ fs.writeFileSync(
157
+ mdPath,
158
+ [
159
+ '# Alex Rivera',
160
+ 'Senior Full-Stack Engineer building TypeScript and Node.js systems.',
161
+ '- Built Node.js webhook processors reducing p95 latency by 38% across $4.2M daily settlement volume.',
162
+ '- Shipped React and Next.js checkout flows with Playwright regression tests cutting CI from 22 minutes to 9 minutes.',
163
+ '- Maintained 99.95% checkout uptime across 3 seasonal sales events.',
164
+ ].join('\n'),
165
+ );
166
+ const mdAudit = runCli(['audit', mdPath], tmp);
167
+ assert.equal(mdAudit.status, 0, mdAudit.stderr);
168
+
169
+ const xmlDoc =
170
+ '<?xml version="1.0" encoding="UTF-8"?>' +
171
+ '<w:document xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"><w:body>' +
172
+ '<w:p><w:r><w:t>Alex Rivera — Senior Full-Stack Engineer</w:t></w:r></w:p>' +
173
+ '<w:p><w:r><w:t>- Built TypeScript and PostgreSQL webhook services cutting p95 latency by 38% across $4.2M daily volume.</w:t></w:r></w:p>' +
174
+ '<w:p><w:r><w:t>- Automated Playwright regression suites reducing CI runtime from 22 minutes to 9 minutes.</w:t></w:r></w:p>' +
175
+ '</w:body></w:document>';
176
+ const docxPath = path.join(tmp, 'cv.docx');
177
+ fs.writeFileSync(docxPath, buildSyntheticDocx(xmlDoc));
178
+ const docxAudit = runCli(['audit', docxPath], tmp);
179
+ assert.equal(docxAudit.status, 0, `Real .docx audit failed: ${docxAudit.stderr}`);
180
+
181
+ // Scanned / binary PDF must fail cleanly with clear paste/text guidance (never claim readable)
182
+ const pdfPath = path.join(tmp, 'scanned.pdf');
183
+ fs.writeFileSync(pdfPath, Buffer.from('%PDF-1.4\n%binary-image-stream\n\x00\x01\x02', 'latin1'));
184
+ const pdfAudit = runCli(['audit', pdfPath], tmp);
185
+ assert.notEqual(pdfAudit.status, 0);
186
+ assert.match(pdfAudit.stderr, /Binary\/PDF file detected/i);
187
+
188
+ // Fake .docx (HTML renamed to .docx) MUST be rejected by both audit and verify
189
+ const fakeDocxPath = path.join(tmp, 'fake.docx');
190
+ fs.writeFileSync(fakeDocxPath, '<html><body><h1>Alex Rivera</h1><p>Fake docx</p></body></html>');
191
+ const fakeAudit = runCli(['audit', fakeDocxPath], tmp);
192
+ assert.notEqual(fakeAudit.status, 0);
193
+ assert.match(fakeAudit.stderr, /Do not rename HTML/i);
194
+ const fakeVerify = runCli(['verify', fakeDocxPath], tmp);
195
+ assert.notEqual(fakeVerify.status, 0);
196
+ assert.match(fakeVerify.stderr, /Do not rename HTML/i);
197
+ } finally {
198
+ fs.rmSync(tmp, { recursive: true, force: true });
199
+ }
200
+ });
201
+
202
+ test('4. CV Edit (Preserving Original), Quick-Tailor Artifact Generation, Fact-Check Verification & Iterative Revision', () => {
203
+ const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'jho-tailor-'));
204
+ try {
205
+ const originalCvPath = path.join(tmp, 'original-cv.md');
206
+ const originalContent = [
207
+ '# Alex Rivera',
208
+ 'Senior Full-Stack Engineer',
209
+ '- Built Node.js and TypeScript webhook processors backed by PostgreSQL reducing latency by 38% across $4.2M daily volume.',
210
+ '- Shipped React and Next.js checkout flows cutting CI build times from 22 minutes to 9 minutes.',
211
+ ].join('\n');
212
+ fs.writeFileSync(originalCvPath, originalContent);
213
+ const originalHash = crypto.createHash('sha256').update(fs.readFileSync(originalCvPath)).digest('hex');
214
+
215
+ const tpl = fs.readFileSync(path.join(REPO_ROOT, 'templates', 'ats-resume-template.html'), 'utf8');
216
+ const fillResumeHtml = summary =>
217
+ tpl
218
+ .replaceAll('{{FULL_NAME}}', 'Alex Rivera')
219
+ .replaceAll('{{CONTACT_TEXT}}', 'Austin, TX | alex.rivera@example.invalid | +1-555-0199')
220
+ .replaceAll('{{VERIFIED_LINKS_HTML}}', '<a href="https://github.com/alexrivera-example">GitHub</a>')
221
+ .replaceAll('{{SUMMARY_TEXT}}', summary)
222
+ .replaceAll('{{SKILLS_TEXT}}', 'Languages: TypeScript, Node.js | Frontend: React, Next.js | Data &amp; QA: PostgreSQL, Docker, Playwright, AWS SQS')
223
+ .replaceAll(
224
+ '{{EXPERIENCE_HTML}}',
225
+ '<h3>Senior Full-Stack Engineer — FinPulse Systems (2023-01 to Present)</h3><ul><li>Built idempotent Node.js and TypeScript webhook processors backed by PostgreSQL and AWS SQS, reducing p95 latency by 38% across $4.2M daily settlement volume.</li></ul>' +
226
+ '<h3>Full-Stack Engineer — CloudCart Retail (2020-03 to 2022-12)</h3><ul><li>Shipped React and Next.js checkout flows with Playwright regression tests, cutting CI build times from 22 minutes to 9 minutes and maintaining 99.95% uptime across 3 sales events.</li></ul>',
227
+ )
228
+ .replaceAll('{{PROJECTS_HTML}}', '<ul><li>Webhook Reliability Harness: idempotency test suite in TypeScript and Playwright.</li></ul>')
229
+ .replaceAll('{{EDUCATION_HTML}}', '<p>B.Sc. Computer Science</p>');
230
+
231
+ const outDir = path.join(tmp, 'quick-tailor-cloudpay');
232
+ fs.mkdirSync(outDir, { recursive: true });
233
+
234
+ const htmlV1 = fillResumeHtml('Senior Full-Stack Engineer with 6 years building TypeScript, Node.js, React, and PostgreSQL settlement services.');
235
+ const docV1 = '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word">' + htmlV1.slice(htmlV1.indexOf('<head>'));
236
+ const txtV1 = 'Alex Rivera\nSenior Full-Stack Engineer with 6 years building TypeScript, Node.js, React, and PostgreSQL settlement services.\n- Reduced p95 latency by 38% across $4.2M daily volume.';
237
+ const notesV1 = '# Tailoring Notes\n- True Gaps: Kubernetes (0 verified years, excluded)\n- Keyword Match: 71% -> 92%\n';
238
+
239
+ fs.writeFileSync(path.join(outDir, 'resume.html'), htmlV1);
240
+ fs.writeFileSync(path.join(outDir, 'resume.doc'), docV1);
241
+ fs.writeFileSync(path.join(outDir, 'resume.txt'), txtV1);
242
+ fs.writeFileSync(path.join(outDir, 'tailoring-notes.md'), notesV1);
243
+
244
+ const groundTruth = path.join(tmp, 'ground-truth.json');
245
+ fs.copyFileSync(path.join(REPO_ROOT, 'evals', 'fixtures', 'ground-truth.json'), groundTruth);
246
+ const verifyPass = runCli(['verify', outDir, '--facts', groundTruth], tmp);
247
+ assert.equal(verifyPass.status, 0, verifyPass.stdout + verifyPass.stderr);
248
+
249
+ // Original file must remain byte-for-byte untouched after editing/tailoring
250
+ const afterHash = crypto.createHash('sha256').update(fs.readFileSync(originalCvPath)).digest('hex');
251
+ assert.equal(afterHash, originalHash, 'Original CV was unexpectedly modified!');
252
+
253
+ // Create CV from scratch without /setup (no context/targets.yaml) & verify clean output
254
+ const scratchDir = path.join(tmp, 'scratch-cv');
255
+ fs.mkdirSync(scratchDir, { recursive: true });
256
+ fs.writeFileSync(path.join(scratchDir, 'resume.html'), htmlV1);
257
+ fs.writeFileSync(path.join(scratchDir, 'resume.txt'), txtV1);
258
+ assert.equal(runCli(['verify', scratchDir, '--facts', groundTruth], tmp).status, 0);
259
+
260
+ // Bilingual Arabic RTL adaptation preserves verified metrics/dates without placeholders
261
+ const rtlHtml = '<!doctype html><html lang="ar" dir="rtl"><head><meta charset="utf-8"><title>السيرة الذاتية</title></head><body><h1>Alex Rivera</h1><p>مهندس برمجيات متكامل بخبرة 6 سنوات في Node.js و TypeScript و PostgreSQL، خفض زمن الاستجابة بنسبة 38%.</p></body></html>';
262
+ const rtlPath = path.join(tmp, 'resume-ar.html');
263
+ fs.writeFileSync(rtlPath, rtlHtml);
264
+ assert.equal(runCli(['verify', rtlPath, '--facts', groundTruth], tmp).status, 0);
265
+
266
+ // Iterative revision ("change the summary") preserves verified facts & passes verify
267
+ const htmlV2 = fillResumeHtml('Full-Stack Engineer with 5 years in TypeScript and 6 years in Node.js scaling payment webhooks and Playwright CI.');
268
+ fs.writeFileSync(path.join(outDir, 'resume.html'), htmlV2);
269
+ const verifyV2 = runCli(['verify', outDir, '--facts', groundTruth], tmp);
270
+ assert.equal(verifyV2.status, 0, verifyV2.stdout + verifyV2.stderr);
271
+
272
+ // Negative test: verify MUST catch hallucinated metric, forbidden skill (Kubernetes), AI slop, and leftover placeholders
273
+ const badPath = path.join(tmp, 'bad-resume.html');
274
+ fs.writeFileSync(
275
+ badPath,
276
+ '<html><body><h1>{{FULL_NAME}}</h1><p>Spearheaded Kubernetes clusters — boosting revenue by 99%.</p></body></html>',
277
+ );
278
+ const verifyFail = runCli(['verify', badPath, '--facts', groundTruth], tmp);
279
+ assert.notEqual(verifyFail.status, 0);
280
+ assert.match(verifyFail.stdout + verifyFail.stderr, /placeholder|Kubernetes|99%|spearheaded|em-dash/i);
281
+ } finally {
282
+ fs.rmSync(tmp, { recursive: true, force: true });
283
+ }
284
+ });
285
+
286
+ test('5. LinkedIn Profile Review & Improvement Prep, Multi-Source JD Analysis, Application Prep vs. Approved Submit', () => {
287
+ const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'jho-linkedin-app-'));
288
+ try {
289
+ fs.mkdirSync(path.join(tmp, 'logs', 'resumes', 'cloudpay-70112'), { recursive: true });
290
+ fs.mkdirSync(path.join(tmp, 'logs', 'insights'), { recursive: true });
291
+ fs.mkdirSync(path.join(tmp, 'config'), { recursive: true });
292
+ fs.copyFileSync(path.join(REPO_ROOT, 'config', 'guardrails.yaml'), path.join(tmp, 'config', 'guardrails.yaml'));
293
+ fs.copyFileSync(path.join(REPO_ROOT, 'config', 'invariants.txt'), path.join(tmp, 'config', 'invariants.txt'));
294
+
295
+ // 5.1 LinkedIn profile review & CV consistency check + DRAFT_ONLY improvement prep
296
+ const linkedinProfilePasted = 'Headline: Software Engineer | Experience: Built web apps at FinPulse Systems';
297
+ const cvFacts = ['TypeScript', 'Node.js', 'React', 'PostgreSQL', 'Playwright', '38%', '$4.2M'];
298
+ const missingFromLinkedIn = cvFacts.filter(fact => !linkedinProfilePasted.includes(fact));
299
+ assert.ok(missingFromLinkedIn.includes('PostgreSQL') && missingFromLinkedIn.includes('38%'));
300
+
301
+ const linkedinAuditOut = path.join(tmp, 'logs', 'insights', 'linkedin-seo-audit-2026-11-19.md');
302
+ fs.writeFileSync(
303
+ linkedinAuditOut,
304
+ [
305
+ '# LinkedIn Profile Audit (DRAFT_ONLY)',
306
+ '- Mode: DRAFT_ONLY (requires explicit APPROVE before any live LinkedIn edit)',
307
+ '- Consistency Gaps Found in CV: PostgreSQL, Playwright, TypeScript, Node.js, React, 38%, $4.2M',
308
+ '- Proposed Headline (DRAFT_ONLY): Senior Full-Stack Engineer | TypeScript, Node.js, React, PostgreSQL | 38% faster payment webhooks',
309
+ '- True Gaps (Excluded): Kubernetes',
310
+ ].join('\n'),
311
+ );
312
+ const linkedinGroundTruth = path.join(tmp, 'ground-truth.json');
313
+ fs.copyFileSync(path.join(REPO_ROOT, 'evals', 'fixtures', 'ground-truth.json'), linkedinGroundTruth);
314
+ assert.equal(runCli(['verify', linkedinAuditOut, '--facts', linkedinGroundTruth], tmp).status, 0);
315
+
316
+ // 5.2 Multi-source JD analysis & ranking against real fixture JDs (separating verified matches vs unknown requirements)
317
+ const jd01 = fs.readFileSync(path.join(REPO_ROOT, 'evals', 'fixtures', 'jds', '01-strong-match.md'), 'utf8');
318
+ const jd02 = fs.readFileSync(path.join(REPO_ROOT, 'evals', 'fixtures', 'jds', '02-prompt-injection-trap.md'), 'utf8');
319
+ const jd03 = fs.readFileSync(path.join(REPO_ROOT, 'evals', 'fixtures', 'jds', '03-ghost-expired-job.md'), 'utf8');
320
+ assert.match(jd01, /https:\/\/boards\.greenhouse\.io\/cloudpayledger\/jobs\/70112/);
321
+ assert.match(jd02, /IGNORE ALL PREVIOUS INSTRUCTIONS|SYSTEM OVERRIDE/i);
322
+ assert.match(jd03, /No longer accepting applications/i);
323
+
324
+ // LinkedIn <=75-word outreach draft verification
325
+ const outreachFile = path.join(tmp, 'logs', 'resumes', 'cloudpay-70112', 'outreach-draft.md');
326
+ fs.writeFileSync(
327
+ outreachFile,
328
+ 'DRAFT_ONLY: Hi Sam, I applied for Senior Full-Stack Engineer at CloudPay. I have 6 years building Node.js and TypeScript settlement webhooks with PostgreSQL, cutting p95 latency by 38%, and Playwright CI suites. Happy to chat if helpful.',
329
+ );
330
+
331
+ // 5.3 Application prepared WITHOUT submission (`status: "prepared"`, `applied_at: null`)
332
+ const appsLog = path.join(tmp, 'logs', 'applications-log.json');
333
+ fs.writeFileSync(
334
+ appsLog,
335
+ JSON.stringify([
336
+ {
337
+ job_id: 'greenhouse:cloudpay-70112',
338
+ title: 'Senior Full-Stack Engineer',
339
+ company: 'CloudPay Ledger',
340
+ platform: 'greenhouse',
341
+ url: 'https://boards.greenhouse.io/cloudpayledger/jobs/70112',
342
+ verified_at: '2026-11-19',
343
+ status: 'prepared',
344
+ applied_at: null,
345
+ match_score: 9.0,
346
+ notes: 'Prepared without submission; awaiting APPROVE or manual upload.',
347
+ submission_uncertain: false,
348
+ },
349
+ ]),
350
+ );
351
+
352
+ const preBefore = runCli(['pre-submit', '--draft', outreachFile], tmp);
353
+ assert.equal(preBefore.status, 0, preBefore.stdout + preBefore.stderr);
354
+ assert.match(preBefore.stdout, /Daily Cap OK: 0\/5/);
355
+ const statusBefore = runCli(['status'], tmp);
356
+ assert.equal(statusBefore.status, 0);
357
+ assert.match(statusBefore.stdout, /Applied: 0/);
358
+
359
+ // 5.4 Transition to `applied` ONLY after explicit human APPROVE + post-submit receipt
360
+ const today = new Date().toISOString().slice(0, 10);
361
+ fs.writeFileSync(
362
+ appsLog,
363
+ JSON.stringify([
364
+ {
365
+ job_id: 'greenhouse:cloudpay-70112',
366
+ title: 'Senior Full-Stack Engineer',
367
+ company: 'CloudPay Ledger',
368
+ platform: 'greenhouse',
369
+ url: 'https://boards.greenhouse.io/cloudpayledger/jobs/70112',
370
+ verified_at: today,
371
+ status: 'applied',
372
+ applied_at: `${today}T12:00:00Z`,
373
+ match_score: 9.0,
374
+ notes: 'receipt: "Thank you for applying to CloudPay Ledger" | approved_by: owner',
375
+ submission_uncertain: false,
376
+ },
377
+ ]),
378
+ );
379
+ const preAfter = runCli(['pre-submit', '--draft', outreachFile], tmp);
380
+ assert.equal(preAfter.status, 0, preAfter.stdout + preAfter.stderr);
381
+ assert.match(preAfter.stdout, /Daily Cap OK: 1\/5/);
382
+ const statusAfter = runCli(['status'], tmp);
383
+ assert.equal(statusAfter.status, 0);
384
+ assert.match(statusAfter.stdout, /Applied: 1/);
385
+ } finally {
386
+ fs.rmSync(tmp, { recursive: true, force: true });
387
+ }
388
+ });
389
+
390
+ test('6. Tool-Availability Scenarios & Manual Fallback: all 5 scenarios succeed without dead-ends or false capability claims', () => {
391
+ assert.equal(MATRIX.tool_scenarios.length, 5);
392
+ const noPw = MATRIX.tool_scenarios.find(s => s.id === 'local_without_playwright');
393
+ assert.equal(noPw.playwright_mcp, false);
394
+ // Confirm non-browser & fallback tasks succeed via CLI even with zero Playwright/Notion
395
+ for (const prompt of [
396
+ 'Review my uploaded CV.',
397
+ 'Tailor my CV to this job.',
398
+ 'Review my LinkedIn profile.',
399
+ 'Find suitable remote React jobs.',
400
+ 'Prepare my application for this position.',
401
+ 'Prepare me for an interview.',
402
+ 'Export my application report.',
403
+ ]) {
404
+ const res = runCli(['route', prompt, '--json']);
405
+ assert.equal(res.status, 0);
406
+ const parsed = JSON.parse(res.stdout);
407
+ assert.ok(parsed.fallback && parsed.fallback.length > 10, `Missing practical fallback for "${prompt}"`);
408
+ }
409
+
410
+ // Verify web-chat & missing-capability fallback playbook exists and preserves honest limitations
411
+ const fallbackMd = fs.readFileSync(path.join(REPO_ROOT, 'skills', 'fallback-no-mcp.md'), 'utf8');
412
+ assert.match(fallbackMd, /Print -> Save as PDF/i);
413
+ assert.match(fallbackMd, /never fake `?\.docx`?/i);
414
+ assert.match(fallbackMd, /requires_mcp:\s*\n\s*- none/);
415
+ });
416
+
417
+ test('7. Multi-IDE Adapter Setup: OpenAI Codex CLI (TOML + AGENTS.md), Gemini CLI, Copilot/VS Code & preservation guarantees', () => {
418
+ const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'jho-ides-'));
419
+ try {
420
+ const fakeHome = path.join(tmp, 'home');
421
+ const codexHome = path.join(fakeHome, '.codex');
422
+ const emptyCwd = path.join(tmp, 'empty');
423
+ const localProj = path.join(tmp, 'local-proj');
424
+ fs.mkdirSync(codexHome, { recursive: true });
425
+ fs.mkdirSync(emptyCwd, { recursive: true });
426
+ fs.mkdirSync(localProj, { recursive: true });
427
+
428
+ // Pre-existing user Codex AGENTS.md + custom model in config.toml MUST be preserved
429
+ const codexAgents = path.join(codexHome, 'AGENTS.md');
430
+ const codexToml = path.join(codexHome, 'config.toml');
431
+ fs.writeFileSync(codexAgents, '# Personal Codex Coding Rules\n- Always run tests.\n');
432
+ fs.writeFileSync(codexToml, 'model = "gpt-5"\napproval_policy = "on-request"\n');
433
+
434
+ const env = { ...process.env, HOME: fakeHome, USERPROFILE: fakeHome, CODEX_HOME: codexHome };
435
+ const initGlobal = spawnSync(process.execPath, [CLI, 'init', '--global', '--ide', 'all'], {
436
+ cwd: emptyCwd,
437
+ env,
438
+ encoding: 'utf8',
439
+ });
440
+ assert.equal(initGlobal.status, 0, initGlobal.stdout + initGlobal.stderr);
441
+
442
+ // Check OpenAI Codex CLI files + preservation
443
+ const agentsAfter = fs.readFileSync(codexAgents, 'utf8');
444
+ assert.match(agentsAfter, /# Personal Codex Coding Rules/);
445
+ assert.match(agentsAfter, /<!-- veycraft:start -->/);
446
+ assert.match(agentsAfter, /AGENTS\.md/);
447
+ const tomlAfter = fs.readFileSync(codexToml, 'utf8');
448
+ assert.match(tomlAfter, /model = "gpt-5"/);
449
+ assert.match(tomlAfter, /\[mcp_servers\.playwright\]/);
450
+ assert.match(tomlAfter, /--user-data-dir=/);
451
+ assert.ok(fs.existsSync(path.join(fakeHome, '.agents', 'skills', 'daily-run', 'SKILL.md')));
452
+
453
+ // Check Google Gemini CLI & GitHub Copilot global files
454
+ assert.ok(fs.existsSync(path.join(fakeHome, '.gemini', 'GEMINI.md')));
455
+ assert.ok(fs.existsSync(path.join(fakeHome, '.gemini', 'skills', 'quick-tailor', 'SKILL.md')));
456
+ const geminiSettings = JSON.parse(fs.readFileSync(path.join(fakeHome, '.gemini', 'settings.json'), 'utf8'));
457
+ assert.ok(geminiSettings.mcpServers?.playwright);
458
+ assert.ok(fs.existsSync(path.join(fakeHome, '.copilot', 'copilot-instructions.md')));
459
+ const copilotMcp = JSON.parse(fs.readFileSync(path.join(fakeHome, '.copilot', 'mcp-config.json'), 'utf8'));
460
+ assert.ok(copilotMcp.mcpServers?.playwright);
461
+
462
+ // Custom [mcp_servers.playwright] in config.toml MUST be preserved on re-sync
463
+ fs.writeFileSync(codexToml, 'model = "gpt-5"\n\n[mcp_servers.playwright]\ncommand = "custom-pw"\nargs = ["--user-data-dir=custom"]\n');
464
+ const reSync = spawnSync(process.execPath, [CLI, 'sync-mcp', '--global'], { cwd: emptyCwd, env, encoding: 'utf8' });
465
+ assert.equal(reSync.status, 0, reSync.stdout + reSync.stderr);
466
+ const tomlPreserved = fs.readFileSync(codexToml, 'utf8');
467
+ assert.match(tomlPreserved, /command = "custom-pw"/);
468
+
469
+ // Local init scaffolds Codex, Gemini, Copilot/VS Code, Roo, Kiro, Junie, Trae, Continue, OpenHands, Augment
470
+ const initLocal = spawnSync(process.execPath, [CLI, 'init', '--ide', 'all'], {
471
+ cwd: localProj,
472
+ env,
473
+ encoding: 'utf8',
474
+ });
475
+ assert.equal(initLocal.status, 0, initLocal.stdout + initLocal.stderr);
476
+ for (const rel of [
477
+ '.codex/config.toml',
478
+ '.gemini/settings.json',
479
+ '.vscode/mcp.json',
480
+ '.github/copilot-instructions.md',
481
+ '.roo/rules/job-hunter.md',
482
+ '.kiro/steering/job-hunter.md',
483
+ '.junie/guidelines.md',
484
+ '.aiassistant/rules/AGENTS.md',
485
+ '.trae/rules/project_rules.md',
486
+ '.continue/rules/job-hunter.md',
487
+ '.openhands/microagents/repo.md',
488
+ '.augment/rules/job-hunter.md',
489
+ '.amazonq/rules/job-hunter.md',
490
+ ]) {
491
+ assert.ok(fs.existsSync(path.join(localProj, rel)), `Missing local IDE file: ${rel}`);
492
+ }
493
+ const vscodeMcp = JSON.parse(fs.readFileSync(path.join(localProj, '.vscode', 'mcp.json'), 'utf8'));
494
+ assert.equal(vscodeMcp.servers?.playwright?.type, 'stdio');
495
+ } finally {
496
+ fs.rmSync(tmp, { recursive: true, force: true });
497
+ }
498
+ });
499
+
500
+ test('8. Developer Onboarding & Agent Discovery: clean uninitialized doctor --json, --version --json, status --json, safe no-arg help & VEYCRAFT_HOME', () => {
501
+ const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'veycraft-onboarding-'));
502
+ try {
503
+ const emptyDir = path.join(tmp, 'empty-workspace');
504
+ const customHome = path.join(tmp, 'custom-veycraft-home');
505
+ const fakeHome = path.join(tmp, 'home');
506
+ fs.mkdirSync(emptyDir, { recursive: true });
507
+ fs.mkdirSync(fakeHome, { recursive: true });
508
+
509
+ const env = { ...process.env, HOME: fakeHome, USERPROFILE: fakeHome, VEYCRAFT_HOME: customHome, NO_COLOR: '1' };
510
+
511
+ // 1. Running CLI with no args prints help safely, exits 0, and creates zero files
512
+ const noArg = spawnSync(process.execPath, [CLI], { cwd: emptyDir, env, encoding: 'utf8' });
513
+ assert.equal(noArg.status, 0, noArg.stdout + noArg.stderr);
514
+ assert.match(noArg.stdout, /veycraft v/);
515
+ assert.equal(fs.readdirSync(emptyDir).length, 0);
516
+
517
+ // 2. --version --json returns structured metadata
518
+ const ver = spawnSync(process.execPath, [CLI, '--version', '--json'], { cwd: emptyDir, env, encoding: 'utf8' });
519
+ assert.equal(ver.status, 0, ver.stdout + ver.stderr);
520
+ const verJson = JSON.parse(ver.stdout);
521
+ assert.equal(verJson.name, 'veycraft');
522
+ assert.equal(verJson.zero_dependencies.runtime, 0);
523
+ assert.equal(verJson.zero_dependencies.dev, 0);
524
+
525
+ // 3. doctor --json in an uninitialized directory succeeds (exit 0), verifies bundled package provenance, and gives next_steps
526
+ const doc = spawnSync(process.execPath, [CLI, 'doctor', '--json'], { cwd: emptyDir, env, encoding: 'utf8' });
527
+ assert.equal(doc.status, 0, doc.stdout + doc.stderr);
528
+ const docJson = JSON.parse(doc.stdout);
529
+ assert.equal(docJson.product, 'veycraft');
530
+ assert.equal(docJson.initialized, false);
531
+ assert.equal(docJson.provenance_verified, true);
532
+ assert.equal(docJson.critical_failures, 0);
533
+ assert.equal(docJson.global_root, customHome);
534
+ assert.ok(docJson.skills_count >= 50);
535
+ assert.ok(Array.isArray(docJson.next_steps) && docJson.next_steps.length > 0);
536
+ assert.equal(fs.readdirSync(emptyDir).length, 0, 'doctor must never create files in an empty workspace');
537
+
538
+ // 4. init --global respects VEYCRAFT_HOME and status --global --json works cleanly
539
+ const initCustom = spawnSync(process.execPath, [CLI, 'init', '--global', '--ide', 'codex'], { cwd: emptyDir, env, encoding: 'utf8' });
540
+ assert.equal(initCustom.status, 0, initCustom.stdout + initCustom.stderr);
541
+ assert.ok(fs.existsSync(path.join(customHome, 'AGENTS.md')));
542
+ assert.ok(fs.existsSync(path.join(customHome, '.veycraft-install.json')));
543
+
544
+ const st = spawnSync(process.execPath, [CLI, 'status', '--global', '--json'], { cwd: emptyDir, env, encoding: 'utf8' });
545
+ assert.equal(st.status, 0, st.stdout + st.stderr);
546
+ const stJson = JSON.parse(st.stdout);
547
+ assert.equal(stJson.product, 'veycraft');
548
+ assert.equal(stJson.daily_cap.dry_run, true);
549
+ } finally {
550
+ fs.rmSync(tmp, { recursive: true, force: true });
551
+ }
552
+ });
553
+
554
+ test('9. Anti-Slop Contract Parity & Pre-Submit Hardening (PR #5): unified 19 clichés, em-dash hard-fail, and compact Veycraft invariants', async () => {
555
+ const { pathToFileURL } = await import('node:url');
556
+ const binDir = path.dirname(CLI);
557
+ const { BANNED_AI_CLICHES } = await import(pathToFileURL(path.join(binDir, 'career-intelligence.mjs')).href);
558
+ const { DEFAULT_BANNED_CLICHES } = await import(pathToFileURL(path.join(binDir, 'profile-intelligence.mjs')).href);
559
+
560
+ const groundTruth = JSON.parse(fs.readFileSync(path.join(REPO_ROOT, 'evals', 'fixtures', 'ground-truth.json'), 'utf8'));
561
+ const baseline = JSON.parse(fs.readFileSync(path.join(REPO_ROOT, 'evals', 'results', 'baseline-verified-run.json'), 'utf8'));
562
+ const tailorSkill = fs.readFileSync(path.join(REPO_ROOT, 'skills', '03-tailor-resume-and-verify.md'), 'utf8');
563
+ const invariantsText = fs.readFileSync(path.join(REPO_ROOT, 'config', 'invariants.txt'), 'utf8');
564
+
565
+ // 1. Canonical 19-item banned cliché parity across JS modules, eval fixtures, and tailoring playbook
566
+ const canonicalSet = [...new Set(BANNED_AI_CLICHES.map(s => s.toLowerCase()))].sort();
567
+ assert.equal(canonicalSet.length, 19);
568
+ assert.deepEqual([...new Set(DEFAULT_BANNED_CLICHES.map(s => s.toLowerCase()))].sort(), canonicalSet);
569
+ assert.deepEqual([...new Set(groundTruth.banned_ai_cliches.map(s => s.toLowerCase()))].sort(), canonicalSet);
570
+ assert.deepEqual([...new Set(baseline.banned_ai_cliches.map(s => s.toLowerCase()))].sort(), canonicalSet);
571
+
572
+ const bannedLine = tailorSkill.split(/\r?\n/).find(l => /Banned AI clichés/i.test(l));
573
+ assert.ok(bannedLine, 'skills/03-tailor-resume-and-verify.md must define Banned AI clichés line');
574
+ const skillCliches = [...bannedLine.matchAll(/`([^`]+)`/g)]
575
+ .map(m => m[1].toLowerCase())
576
+ .filter(tok => !tok.includes('/') && tok !== 'banned_ai_cliches');
577
+ assert.deepEqual([...new Set(skillCliches)].sort(), canonicalSet);
578
+
579
+ // 2. config/invariants.txt preserves Veycraft branding, stays < 500 bytes, and covers Safe Wedge invariants
580
+ const invBytes = Buffer.byteLength(invariantsText, 'utf8');
581
+ assert.ok(invBytes < 500, `config/invariants.txt must stay under 500 bytes (got ${invBytes})`);
582
+ assert.match(invariantsText, /^VEYCRAFT - PRE-SUBMIT INVARIANTS/m);
583
+ assert.doesNotMatch(invariantsText, /JOB HUNTER OS|\bjob-hunter\b/i);
584
+ assert.match(invariantsText, /Evidence Map/i);
585
+ assert.match(invariantsText, /True Gaps/i);
586
+ assert.match(invariantsText, /clichés\/em-dashes/i);
587
+ assert.match(invariantsText, /untrusted data/i);
588
+
589
+ // 3. pre-submit passes clean outreach, hard-fails banned clichés, and hard-fails prose em-dashes (—)
590
+ const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'vc-pr5-antislop-'));
591
+ try {
592
+ fs.mkdirSync(path.join(tmp, 'config'), { recursive: true });
593
+ fs.mkdirSync(path.join(tmp, 'logs'), { recursive: true });
594
+ fs.copyFileSync(path.join(REPO_ROOT, 'config', 'guardrails.yaml'), path.join(tmp, 'config', 'guardrails.yaml'));
595
+ fs.copyFileSync(path.join(REPO_ROOT, 'config', 'invariants.txt'), path.join(tmp, 'config', 'invariants.txt'));
596
+
597
+ const cleanRes = runCli([
598
+ 'pre-submit',
599
+ '--text',
600
+ 'Hi hiring team, I applied for the Senior Backend role. I built Node.js and PostgreSQL payment APIs that cut p95 latency by 38%. Happy to share details.',
601
+ '--json',
602
+ ], tmp);
603
+ assert.equal(cleanRes.status, 0, cleanRes.stdout + cleanRes.stderr);
604
+ const cleanJson = JSON.parse(cleanRes.stdout);
605
+ assert.equal(cleanJson.allowed, true);
606
+ assert.equal(cleanJson.checks.draft.ok, true);
607
+ assert.equal(cleanJson.checks.draft.has_em_dash, false);
608
+ assert.deepEqual(cleanJson.checks.draft.banned_cliches, []);
609
+
610
+ const clicheRes = runCli([
611
+ 'pre-submit',
612
+ '--text',
613
+ 'Hi team, as a seasoned professional and dynamic team player, I am a results-driven engineer ready to join your team.',
614
+ '--json',
615
+ ], tmp);
616
+ assert.notEqual(clicheRes.status, 0, 'pre-submit must hard-fail outreach containing banned clichés');
617
+ const clicheJson = JSON.parse(clicheRes.stdout);
618
+ assert.equal(clicheJson.allowed, false);
619
+ assert.equal(clicheJson.checks.draft.ok, false);
620
+ assert.ok(clicheJson.violations.some(v => v.code === 'draft_banned_cliches'));
621
+ assert.ok(clicheJson.checks.draft.banned_cliches.includes('seasoned professional'));
622
+ assert.ok(clicheJson.checks.draft.banned_cliches.includes('dynamic team player'));
623
+ assert.ok(clicheJson.checks.draft.banned_cliches.includes('results-driven'));
624
+
625
+ const emDashRes = runCli([
626
+ 'pre-submit',
627
+ '--text',
628
+ 'Hi team, I built Node.js payment APIs — cutting p95 latency by 38% across 14 partner banks.',
629
+ '--json',
630
+ ], tmp);
631
+ assert.notEqual(emDashRes.status, 0, 'pre-submit must hard-fail outreach containing a prose em-dash');
632
+ const emDashJson = JSON.parse(emDashRes.stdout);
633
+ assert.equal(emDashJson.allowed, false);
634
+ assert.equal(emDashJson.checks.draft.ok, false);
635
+ assert.equal(emDashJson.checks.draft.has_em_dash, true);
636
+ assert.ok(emDashJson.violations.some(v => v.code === 'draft_prose_em_dash'));
637
+
638
+ const emDashDraftPath = path.join(tmp, 'logs', 'outreach-emdash.md');
639
+ fs.writeFileSync(emDashDraftPath, 'Hi team, I ship reliable TypeScript services — happy to chat.');
640
+ const emDashFileRes = runCli(['pre-submit', '--draft', 'logs/outreach-emdash.md'], tmp);
641
+ assert.notEqual(emDashFileRes.status, 0, 'pre-submit --draft must hard-fail on prose em-dash');
642
+ assert.match(emDashFileRes.stdout + emDashFileRes.stderr, /prose em-dash/i);
643
+ } finally {
644
+ fs.rmSync(tmp, { recursive: true, force: true });
645
+ }
646
+ });
647
+
648
+ test('10. Recruiter, Brand & Domain Intelligence (Skill 28): routing, <= 7 cap, offline parity, and domain-agnostic coverage', () => {
649
+ const manifest = JSON.parse(fs.readFileSync(path.join(REPO_ROOT, 'skills', 'skills-manifest.json'), 'utf8'));
650
+ const byName = new Map(manifest.skills.map(s => [s.name, s]));
651
+
652
+ // 1. Manifest parity & offline requires_mcp: ["none"]
653
+ const s28 = byName.get('recruiter-brand-and-domain-intelligence');
654
+ assert.ok(s28, 'recruiter-brand-and-domain-intelligence missing from skills-manifest.json');
655
+ assert.equal(s28.path, 'skills/28-recruiter-brand-and-domain-intelligence.md');
656
+ assert.deepEqual(s28.requires_mcp, ['none']);
657
+ assert.deepEqual(s28.requires_skills, ['meta-self-verification']);
658
+
659
+ for (const caller of [
660
+ 'discover-and-triage',
661
+ 'tailor-resume-and-verify',
662
+ 'persona-switcher',
663
+ 'ats-keyword-heatmap',
664
+ 'universal-cv-builder',
665
+ 'linkedin-growth',
666
+ 'profile-intelligence-engine',
667
+ ]) {
668
+ const entry = byName.get(caller);
669
+ assert.ok(entry && entry.requires_skills.includes('recruiter-brand-and-domain-intelligence'), `${caller} must require recruiter-brand-and-domain-intelligence`);
670
+ }
671
+
672
+ // 2. CLI routing includes skill 28 on standalone intents while enforcing <= 7 skills everywhere (including /daily-run)
673
+ const routeChecks = [
674
+ ['Tailor my CV for a Clinical Operations Lead role.', 'tailor-cv', true],
675
+ ['Analyze this Enterprise AE job description and rank fit.', 'job-discovery-and-triage', true],
676
+ ['Optimize my LinkedIn profile for Finance Director roles.', 'linkedin-profile', true],
677
+ ['Optimize my professional profile for Product Manager jobs.', 'profile-intelligence', true],
678
+ ['Create a new CV from scratch.', 'cv-create', true],
679
+ ['Improve my CV summary.', 'cv-edit', true],
680
+ ['/daily-run', 'daily-run', false],
681
+ ];
682
+ for (const [prompt, expectedIntent, mustInclude28] of routeChecks) {
683
+ const res = runCli(['route', prompt, '--json']);
684
+ assert.equal(res.status, 0, `route failed for "${prompt}": ${res.stderr}`);
685
+ const parsed = JSON.parse(res.stdout);
686
+ assert.equal(parsed.intent, expectedIntent);
687
+ assert.ok(parsed.skills.length <= 7, `Skill count > 7 for ${expectedIntent}: ${parsed.skills.length}`);
688
+ if (mustInclude28) {
689
+ assert.ok(parsed.skills.includes('28-recruiter-brand-and-domain-intelligence'), `Missing skill 28 on "${prompt}"`);
690
+ }
691
+ }
692
+
693
+ // 3. Domain-agnostic & HR/Brand coverage in skill 28 + de-biased caller skills
694
+ const s28Text = fs.readFileSync(path.join(REPO_ROOT, 'skills', '28-recruiter-brand-and-domain-intelligence.md'), 'utf8');
695
+ for (const term of ['Healthcare/Clinical/Pharma', 'Sales/Marketing/Growth', 'Finance/Accounting/Legal/Risk', 'Buyer Pain Point', 'Proof Density Hierarchy', 'Recruiter Boolean', '50-Skill Cap']) {
696
+ assert.ok(s28Text.includes(term), `skills/28 missing domain/recruiter/brand term: ${term}`);
697
+ }
698
+
699
+ const s02Text = fs.readFileSync(path.join(REPO_ROOT, 'skills', '02-discover-and-triage.md'), 'utf8');
700
+ const s03Text = fs.readFileSync(path.join(REPO_ROOT, 'skills', '03-tailor-resume-and-verify.md'), 'utf8');
701
+ const s21Text = fs.readFileSync(path.join(REPO_ROOT, 'skills', '21-ats-keyword-heatmap.md'), 'utf8');
702
+ const liText = fs.readFileSync(path.join(REPO_ROOT, 'skills', 'linkedin-growth.md'), 'utf8');
703
+ assert.doesNotMatch(s02Text, /Core Stack \(40%\)/);
704
+ assert.doesNotMatch(s02Text, /Full\+Stack\+OR\+React\+OR\+Next\.js/);
705
+ assert.doesNotMatch(s03Text, /direct, practical peer engineer/i);
706
+ assert.doesNotMatch(liText, /4 Proven Engineering Post Templates/);
707
+ assert.match(s21Text, /Credentials, Licensure & Compliance/);
708
+ });
709
+
710
+ test('11. GitHub CLI Audit, Marketing Polish, Tiered Cleanup & CV Extraction (Skill 11 v2.0.0)', () => {
711
+ const manifest = JSON.parse(fs.readFileSync(path.join(REPO_ROOT, 'skills', 'skills-manifest.json'), 'utf8'));
712
+ const byName = new Map(manifest.skills.map(s => [s.name, s]));
713
+
714
+ // 1. Manifest parity for Skill 11 v2.0.0 & updated caller skill versions
715
+ const s11 = byName.get('portfolio-and-github-auditor');
716
+ assert.ok(s11, 'portfolio-and-github-auditor missing from skills-manifest.json');
717
+ assert.equal(s11.version, '2.0.0');
718
+ assert.equal(s11.path, 'skills/11-portfolio-and-github-auditor.md');
719
+ assert.deepEqual(s11.requires_mcp, ['none']);
720
+ assert.deepEqual(s11.optional_mcp, ['playwright']);
721
+ for (const dep of [
722
+ 'resume-ingestion',
723
+ 'tailor-resume-and-verify',
724
+ 'recruiter-brand-and-domain-intelligence',
725
+ 'privacy-pii-shield',
726
+ 'prompt-injection-defense',
727
+ 'meta-self-verification',
728
+ ]) {
729
+ assert.ok(s11.requires_skills.includes(dep), `Skill 11 manifest missing requires_skills dep: ${dep}`);
730
+ }
731
+ assert.equal(byName.get('tailor-resume-and-verify').version, '2.2.0');
732
+ assert.equal(byName.get('universal-cv-builder').version, '1.2.0');
733
+ assert.equal(byName.get('profile-intelligence-engine').version, '1.2.0');
734
+
735
+ // 2. CLI routing for github-portfolio-audit + non-regression on profile-intelligence
736
+ const routeExpectations = [
737
+ ['audit my github repos and extract projects for my CV', 'github-portfolio-audit'],
738
+ ['/github-audit', 'github-portfolio-audit'],
739
+ ['clean up my github repos', 'github-portfolio-audit'],
740
+ ['delete junk repos', 'github-portfolio-audit'],
741
+ ['optimize my github profile', 'profile-intelligence'],
742
+ ];
743
+ for (const [prompt, expectedIntent] of routeExpectations) {
744
+ const res = runCli(['route', prompt, '--json']);
745
+ assert.equal(res.status, 0, `route failed for "${prompt}": ${res.stderr}`);
746
+ const parsed = JSON.parse(res.stdout);
747
+ assert.equal(parsed.intent, expectedIntent, `Intent mismatch for "${prompt}"`);
748
+ assert.ok(parsed.skills.includes('11-portfolio-and-github-auditor'), `Missing 11-portfolio-and-github-auditor on "${prompt}"`);
749
+ assert.ok(parsed.skills.length <= 7, `Skill count > 7 for "${prompt}": ${parsed.skills.length}`);
750
+ }
751
+
752
+ // 3. Safety, truthfulness, cleanup gate & downstream CV read-hooks
753
+ const s11Text = fs.readFileSync(path.join(REPO_ROOT, 'skills', '11-portfolio-and-github-auditor.md'), 'utf8');
754
+ for (const clause of [
755
+ 'DRAFT_ONLY',
756
+ 'DELETE <owner>/<repo>',
757
+ 'context/github-projects.md',
758
+ 'requires_user_confirmation',
759
+ 'Blast-Radius Warning',
760
+ 'SEC-02',
761
+ 'private',
762
+ 'archive',
763
+ ]) {
764
+ assert.ok(s11Text.includes(clause), `skills/11 missing required safety/contract clause: ${clause}`);
765
+ }
766
+
767
+ const s03Text = fs.readFileSync(path.join(REPO_ROOT, 'skills', '03-tailor-resume-and-verify.md'), 'utf8');
768
+ const s27Text = fs.readFileSync(path.join(REPO_ROOT, 'skills', '27-universal-cv-builder.md'), 'utf8');
769
+ const piText = fs.readFileSync(path.join(REPO_ROOT, 'skills', 'profile-intelligence-engine.md'), 'utf8');
770
+ assert.ok(s03Text.includes('context/github-projects.md'), 'skills/03 missing context/github-projects.md read-hook');
771
+ assert.ok(s27Text.includes('context/github-projects.md'), 'skills/27 missing context/github-projects.md read-hook');
772
+ assert.ok(piText.includes('skills/11-portfolio-and-github-auditor.md'), 'profile-intelligence-engine missing delegation note to skills/11');
773
+ });
774
+
775
+ test('12. Isolated Portfolio Builder & Multi-CLI Deployer (Skill 29 /build-portfolio, 56 Skills)', () => {
776
+ const manifest = JSON.parse(fs.readFileSync(path.join(REPO_ROOT, 'skills', 'skills-manifest.json'), 'utf8'));
777
+ assert.equal(manifest.skills.length, 56, `Expected 56 skills in manifest, got ${manifest.skills.length}`);
778
+ const byName = new Map(manifest.skills.map(s => [s.name, s]));
779
+
780
+ // 1. Manifest parity & zero 5-gate /daily-run coupling
781
+ const s29 = byName.get('portfolio-builder-and-deployer');
782
+ assert.ok(s29, 'portfolio-builder-and-deployer missing from skills-manifest.json');
783
+ assert.equal(s29.version, '1.1.0');
784
+ assert.equal(s29.path, 'skills/29-portfolio-builder-and-deployer.md');
785
+ assert.deepEqual(s29.requires_mcp, ['none']);
786
+ assert.deepEqual(s29.optional_mcp, ['playwright']);
787
+ assert.ok(!s29.requires_skills.includes('interrogate-and-onboard'), 'Skill 29 must not force 5-gate interrogate-and-onboard');
788
+ for (const dep of [
789
+ 'resume-ingestion',
790
+ 'tailor-resume-and-verify',
791
+ 'portfolio-and-github-auditor',
792
+ 'portfolio-design-system-and-qa',
793
+ 'privacy-pii-shield',
794
+ 'recruiter-brand-and-domain-intelligence',
795
+ 'meta-self-verification',
796
+ ]) {
797
+ assert.ok(s29.requires_skills.includes(dep), `Skill 29 manifest missing requires_skills dep: ${dep}`);
798
+ }
799
+
800
+ // 2. Collision-free CLI routing across build-portfolio, profile-intelligence, and github-portfolio-audit
801
+ const routeChecks = [
802
+ ['/build-portfolio', 'build-portfolio', '29-portfolio-builder-and-deployer'],
803
+ ['build and deploy my portfolio website', 'build-portfolio', '29-portfolio-builder-and-deployer'],
804
+ ['host my portfolio on vercel', 'build-portfolio', '29-portfolio-builder-and-deployer'],
805
+ ['update my portfolio website', 'build-portfolio', '29-portfolio-builder-and-deployer'],
806
+ ['optimize my portfolio profile', 'profile-intelligence', 'profile-intelligence-engine'],
807
+ ['audit my portfolio links and github repos', 'github-portfolio-audit', '11-portfolio-and-github-auditor'],
808
+ ];
809
+ for (const [prompt, expectedIntent, mustIncludeSkill] of routeChecks) {
810
+ const res = runCli(['route', prompt, '--json']);
811
+ assert.equal(res.status, 0, `route failed for "${prompt}": ${res.stderr}`);
812
+ const parsed = JSON.parse(res.stdout);
813
+ assert.equal(parsed.intent, expectedIntent, `Intent mismatch for "${prompt}"`);
814
+ assert.ok(parsed.skills.includes(mustIncludeSkill), `Missing ${mustIncludeSkill} on "${prompt}"`);
815
+ assert.ok(parsed.skills.length <= 7, `Skill count > 7 for "${prompt}": ${parsed.skills.length}`);
816
+ }
817
+
818
+ // 3. Isolation, privacy, hosting CLI, Skill 30 hand-off & Smart Fallback clauses in skills/29
819
+ const s29Text = fs.readFileSync(path.join(REPO_ROOT, 'skills', '29-portfolio-builder-and-deployer.md'), 'utf8');
820
+ assert.ok(!s29Text.includes('interrogate-and-onboard'), 'skills/29 must not depend on interrogate-and-onboard');
821
+ for (const clause of [
822
+ 'logs/portfolio/',
823
+ 'LOCAL_PREVIEW_ONLY',
824
+ 'Deploy Confirmation Table',
825
+ 'redasalem/veycraft',
826
+ 'vercel',
827
+ 'wrangler',
828
+ 'netlify',
829
+ 'Smart Fallback',
830
+ 'cPanel',
831
+ 'portfolio-manifest.json',
832
+ 'skills/30-portfolio-design-system-and-qa.md',
833
+ 'DESIGN_PLAN.md',
834
+ 'qa-report.md',
835
+ ]) {
836
+ assert.ok(s29Text.includes(clause), `skills/29 missing required clause: ${clause}`);
837
+ }
838
+ });
839
+
840
+ test('13. Portfolio Design System Studio, Automated Testing & Bounded Self-Healing QA (Skill 30 /portfolio-design, 56 Skills)', () => {
841
+ const manifest = JSON.parse(fs.readFileSync(path.join(REPO_ROOT, 'skills', 'skills-manifest.json'), 'utf8'));
842
+ const byName = new Map(manifest.skills.map(s => [s.name, s]));
843
+
844
+ // 1. Manifest parity & zero circular / /setup coupling
845
+ const s30 = byName.get('portfolio-design-system-and-qa');
846
+ assert.ok(s30, 'portfolio-design-system-and-qa missing from skills-manifest.json');
847
+ assert.equal(s30.version, '1.0.0');
848
+ assert.equal(s30.path, 'skills/30-portfolio-design-system-and-qa.md');
849
+ assert.deepEqual(s30.requires_mcp, ['none']);
850
+ assert.deepEqual(s30.optional_mcp, ['playwright']);
851
+ assert.ok(!s30.requires_skills.includes('portfolio-builder-and-deployer'), 'Skill 30 must not depend on Skill 29 (acyclic DAG)');
852
+ assert.ok(!s30.requires_skills.includes('interrogate-and-onboard'), 'Skill 30 must not force 5-gate interrogate-and-onboard');
853
+ for (const dep of [
854
+ 'recruiter-brand-and-domain-intelligence',
855
+ 'tailor-resume-and-verify',
856
+ 'multilingual-adaptation',
857
+ 'privacy-pii-shield',
858
+ 'meta-self-verification',
859
+ ]) {
860
+ assert.ok(s30.requires_skills.includes(dep), `Skill 30 manifest missing requires_skills dep: ${dep}`);
861
+ }
862
+
863
+ // 2. Acyclic DAG check across skills-manifest.json from Skill 30 and Skill 29
864
+ for (const rootSkill of ['portfolio-design-system-and-qa', 'portfolio-builder-and-deployer']) {
865
+ const seen = new Set();
866
+ const queue = [...(byName.get(rootSkill)?.requires_skills || [])];
867
+ while (queue.length) {
868
+ const cur = queue.shift();
869
+ assert.notEqual(cur, rootSkill, `Circular requires_skills dependency detected involving ${rootSkill}`);
870
+ if (!seen.has(cur)) {
871
+ seen.add(cur);
872
+ for (const nxt of byName.get(cur)?.requires_skills || []) queue.push(nxt);
873
+ }
874
+ }
875
+ }
876
+
877
+ // 3. Collision-free routing & <= 7 skill cap checks
878
+ const designRoutes = [
879
+ ['/portfolio-design', 'portfolio-design-qa', '30-portfolio-design-system-and-qa'],
880
+ ['redesign my portfolio colors', 'portfolio-design-qa', '30-portfolio-design-system-and-qa'],
881
+ ['create a portfolio design system', 'portfolio-design-qa', '30-portfolio-design-system-and-qa'],
882
+ ['run unit tests and visual QA on my portfolio', 'portfolio-design-qa', '30-portfolio-design-system-and-qa'],
883
+ ];
884
+ for (const [prompt, expectedIntent, mustIncludeSkill] of designRoutes) {
885
+ const res = runCli(['route', prompt, '--json']);
886
+ assert.equal(res.status, 0, `route failed for "${prompt}": ${res.stderr}`);
887
+ const parsed = JSON.parse(res.stdout);
888
+ assert.equal(parsed.intent, expectedIntent, `Intent mismatch for "${prompt}"`);
889
+ assert.equal(parsed.skills.length, 4, `Expected 4 skills for portfolio-design-qa on "${prompt}", got ${parsed.skills.length}`);
890
+ assert.ok(parsed.skills.includes(mustIncludeSkill), `Missing ${mustIncludeSkill} on "${prompt}"`);
891
+ }
892
+
893
+ const buildRes = runCli(['route', 'build and deploy my portfolio website on vercel', '--json']);
894
+ assert.equal(buildRes.status, 0, `route failed for build-portfolio: ${buildRes.stderr}`);
895
+ const buildParsed = JSON.parse(buildRes.stdout);
896
+ assert.equal(buildParsed.intent, 'build-portfolio');
897
+ assert.equal(buildParsed.skills.length, 7, `Expected 7/7 skills for build-portfolio, got ${buildParsed.skills.length}`);
898
+ assert.ok(buildParsed.skills.includes('29-portfolio-builder-and-deployer'));
899
+ assert.ok(buildParsed.skills.includes('30-portfolio-design-system-and-qa'));
900
+
901
+ const piRes = runCli(['route', 'optimize my portfolio profile', '--json']);
902
+ assert.equal(piRes.status, 0);
903
+ assert.equal(JSON.parse(piRes.stdout).intent, 'profile-intelligence');
904
+
905
+ const ghaRes = runCli(['route', 'audit my portfolio links and github repos', '--json']);
906
+ assert.equal(ghaRes.status, 0);
907
+ assert.equal(JSON.parse(ghaRes.stdout).intent, 'github-portfolio-audit');
908
+
909
+ // 4. Skill 30 pre-code blueprint, design studio, WCAG/RTL, 3-layer QA & 3-cycle self-healing clauses
910
+ const s30Text = fs.readFileSync(path.join(REPO_ROOT, 'skills', '30-portfolio-design-system-and-qa.md'), 'utf8');
911
+ assert.ok(!s30Text.includes('interrogate-and-onboard'), 'skills/30 must not depend on interrogate-and-onboard');
912
+ for (const clause of [
913
+ 'DESIGN_PLAN.md',
914
+ 'portfolio-data.json',
915
+ 'design-tokens.json',
916
+ 'tokens.css',
917
+ 'Editorial Ivory & Ink',
918
+ 'Obsidian Carbon & Warm Brass',
919
+ 'Studio Charcoal & Sage',
920
+ 'Custom',
921
+ '>= 4.5:1',
922
+ 'IBM Plex Sans Arabic',
923
+ 'margin-inline',
924
+ 'prefers-reduced-motion',
925
+ 'node --test',
926
+ 'vitest',
927
+ '375px',
928
+ '768px',
929
+ '1440px',
930
+ 'qa-report.md',
931
+ 'bounded 3-cycle self-healing loop',
932
+ '3 cycles',
933
+ 'root package.json',
934
+ '0/0',
935
+ ]) {
936
+ assert.ok(s30Text.includes(clause), `skills/30 missing required clause: ${clause}`);
937
+ }
938
+ });
939
+
940
+ test('14. Dual-Engine LinkedIn Growth, Recruiter Search, Feed Algorithm & Services Funnel (linkedin-growth v3.1.0, 56 Skills)', () => {
941
+ const manifest = JSON.parse(fs.readFileSync(path.join(REPO_ROOT, 'skills', 'skills-manifest.json'), 'utf8'));
942
+ assert.equal(manifest.skills.length, 56, `Expected 56 skills in manifest, got ${manifest.skills.length}`);
943
+ const byName = new Map(manifest.skills.map(s => [s.name, s]));
944
+
945
+ // 1. Manifest parity & zero 5-gate /setup coupling
946
+ const li = byName.get('linkedin-growth');
947
+ assert.ok(li, 'linkedin-growth missing from skills-manifest.json');
948
+ assert.equal(li.version, '3.1.0');
949
+ assert.equal(li.path, 'skills/linkedin-growth.md');
950
+ assert.deepEqual(li.requires_mcp, ['none']);
951
+ assert.deepEqual(li.optional_mcp, ['playwright']);
952
+ assert.ok(!li.requires_skills.includes('interrogate-and-onboard'), 'linkedin-growth must not force 5-gate interrogate-and-onboard');
953
+ for (const dep of [
954
+ 'tailor-resume-and-verify',
955
+ 'outreach-and-interview-prep',
956
+ 'recruiter-brand-and-domain-intelligence',
957
+ 'circuit-breaker-and-antiban',
958
+ 'meta-self-verification',
959
+ ]) {
960
+ assert.ok(li.requires_skills.includes(dep), `linkedin-growth manifest missing requires_skills dep: ${dep}`);
961
+ }
962
+
963
+ // 2. Acyclic DAG BFS check from linkedin-growth
964
+ const seen = new Set();
965
+ const queue = [...(li.requires_skills || [])];
966
+ while (queue.length) {
967
+ const cur = queue.shift();
968
+ assert.notEqual(cur, 'linkedin-growth', 'Circular requires_skills dependency detected involving linkedin-growth');
969
+ if (!seen.has(cur)) {
970
+ seen.add(cur);
971
+ for (const nxt of byName.get(cur)?.requires_skills || []) queue.push(nxt);
972
+ }
973
+ }
974
+
975
+ // 3. Collision-free EN + AR routing & 6/7 skill cap checks
976
+ const liPrompts = [
977
+ '/linkedin-growth',
978
+ 'optimize linkedin',
979
+ 'LinkedIn SEO setup',
980
+ 'set up my LinkedIn Services page for freelance clients',
981
+ 'optimize my LinkedIn for the LinkedIn algorithm and dwell time',
982
+ 'build a LinkedIn comment-first strategy and content pillars',
983
+ 'draft a LinkedIn native PDF carousel to grow my reach and impressions',
984
+ 'improve my LinkedIn topical authority and profile funnel',
985
+ 'how to grow my LinkedIn organically without engagement pods',
986
+ 'ظبط لينكد إن',
987
+ 'عدل لينكد إن',
988
+ 'تجهيز صفحة خدمات لينكد إن للفريلانس',
989
+ ];
990
+ for (const prompt of liPrompts) {
991
+ const res = runCli(['route', prompt, '--json']);
992
+ assert.equal(res.status, 0, `route failed for "${prompt}": ${res.stderr}`);
993
+ const parsed = JSON.parse(res.stdout);
994
+ assert.equal(parsed.intent, 'linkedin-profile', `Intent mismatch for "${prompt}"`);
995
+ assert.equal(parsed.skills.length, 6, `Expected 6/7 skills for linkedin-profile on "${prompt}", got ${parsed.skills.length}`);
996
+ assert.ok(parsed.skills.includes('linkedin-growth'), `Missing linkedin-growth on "${prompt}"`);
997
+ }
998
+
999
+ for (const [prompt, expectedIntent] of [
1000
+ ['/profile-update', 'profile-intelligence'],
1001
+ ['Update my LinkedIn profile for this job', 'profile-intelligence'],
1002
+ ['حسّن ملفي المهني', 'profile-intelligence'],
1003
+ ['حدّث بروفايلي لهذه الوظيفة', 'profile-intelligence'],
1004
+ ['optimize my professional profile across platforms', 'profile-intelligence'],
1005
+ ['find remote LinkedIn jobs for Product Manager', 'job-discovery-and-triage'],
1006
+ ]) {
1007
+ const res = runCli(['route', prompt, '--json']);
1008
+ assert.equal(res.status, 0, `route failed for "${prompt}": ${res.stderr}`);
1009
+ assert.equal(JSON.parse(res.stdout).intent, expectedIntent, `Boundary collision on "${prompt}"`);
1010
+ }
1011
+
1012
+ // 4. Engines A-D (Recruiter Search + Credibility + Feed Algorithm + Services Funnel), Anti-Myth, Anti-Pod, <500 lines & 0 em-dash hygiene
1013
+ const liText = fs.readFileSync(path.join(REPO_ROOT, 'skills', 'linkedin-growth.md'), 'utf8');
1014
+ const liLineCount = liText.split(/\r?\n/).length;
1015
+ assert.ok(liLineCount < 500, `skills/linkedin-growth.md must stay under 500 lines (got ${liLineCount})`);
1016
+ assert.ok(!liText.includes('\u2014'), 'skills/linkedin-growth.md must contain 0 prose em-dashes (U+2014)');
1017
+ assert.doesNotMatch(liText, /4 Proven Engineering Post Templates/);
1018
+ for (const clause of [
1019
+ 'Confirmed Platform Mechanics',
1020
+ 'Observed Distribution Heuristics',
1021
+ 'Hard Anti-Myth Rule',
1022
+ 'Years of Experience per Skill',
1023
+ 'Likely to Respond',
1024
+ '~140-210',
1025
+ 'Search Appearances -> Profile Views -> Inbound Replies',
1026
+ 'Credibility & Trust Signals',
1027
+ 'Topical Authority',
1028
+ 'Comment-First Strategy',
1029
+ 'Native Format Tradeoffs Matrix',
1030
+ 'Native PDF Document / Carousel',
1031
+ 'Engagement pods',
1032
+ 'canonical 19-item banned AI-cliche list',
1033
+ '10-Service Taxonomy Selection',
1034
+ 'Services Page',
1035
+ 'Direct Requests',
1036
+ 'Post-Delivery Review',
1037
+ 'logs/insights/linkedin-seo-audit-YYYY-MM-DD.md',
1038
+ 'pre-submit',
1039
+ 'skills/24-circuit-breaker-and-antiban.md',
1040
+ ]) {
1041
+ assert.ok(liText.includes(clause), `skills/linkedin-growth.md missing required clause: ${clause}`);
1042
+ }
1043
+ });
1044
+
1045
+ test('15. Universal No-Clone GitHub CLI Remote Manager & Cross-Model Agent Bridges (Skill 54, 56 Skills)', () => {
1046
+ const manifest = JSON.parse(fs.readFileSync(path.join(REPO_ROOT, 'skills', 'skills-manifest.json'), 'utf8'));
1047
+ assert.equal(manifest.skills.length, 56, `Expected 56 skills in manifest, got ${manifest.skills.length}`);
1048
+ const byName = new Map(manifest.skills.map(s => [s.name, s]));
1049
+
1050
+ const s54 = byName.get('github-cli-remote-manager');
1051
+ assert.ok(s54, 'github-cli-remote-manager missing from skills-manifest.json');
1052
+ assert.equal(s54.version, '1.0.0');
1053
+ assert.equal(s54.path, 'skills/54-github-cli-remote-manager.md');
1054
+ assert.deepEqual(s54.requires_mcp, ['none']);
1055
+ assert.deepEqual(s54.requires, ['gh']);
1056
+ assert.deepEqual(s54.requires_skills, ['privacy-pii-shield', 'meta-self-verification']);
1057
+
1058
+ const s54Text = fs.readFileSync(path.join(REPO_ROOT, 'skills', '54-github-cli-remote-manager.md'), 'utf8');
1059
+ assert.ok(s54Text.split(/\r?\n/).length < 500, 'skills/54-github-cli-remote-manager.md must stay under 500 lines');
1060
+ for (const clause of [
1061
+ '## When to Use & Preconditions',
1062
+ '## Deterministic Step-by-Step Execution',
1063
+ '## Anti-Patterns (What NEVER To Do) & Self-Verification Check',
1064
+ 'git/trees/HEAD',
1065
+ 'git/commits',
1066
+ 'gh repo edit',
1067
+ 'gh api',
1068
+ 'gh workflow run',
1069
+ 'gh api graphql',
1070
+ 'DELETE <owner>/<repo>',
1071
+ ]) {
1072
+ assert.ok(s54Text.includes(clause), `skills/54 missing required clause: ${clause}`);
1073
+ }
1074
+
1075
+ // Wrapper & cross-model bridges verify Skill 54 + MCP discovery
1076
+ const wrapperText = fs.readFileSync(path.join(REPO_ROOT, '.agents', 'skills', 'github-cli-remote-manager', 'SKILL.md'), 'utf8');
1077
+ assert.ok(wrapperText.includes('name: github-cli-remote-manager'));
1078
+ assert.ok(wrapperText.includes('skills/54-github-cli-remote-manager.md'));
1079
+
1080
+ for (const bridgePath of ['AGENTS.md', 'CLAUDE.md', 'GEMINI.md', path.join('.github', 'copilot-instructions.md')]) {
1081
+ const bText = fs.readFileSync(path.join(REPO_ROOT, bridgePath), 'utf8');
1082
+ assert.ok(bText.includes('54-github-cli-remote-manager.md'), `${bridgePath} missing Skill 54 reference`);
1083
+ assert.ok(bText.includes('veycraft_get_skill') && bText.includes('veycraft://manifest'), `${bridgePath} missing veycraft MCP discovery reference`);
1084
+ }
1085
+
1086
+ // Collision-free routing between github-remote-ops (Skill 54) and github-portfolio-audit (Skill 11)
1087
+ for (const [prompt, expectedIntent, expectedSkill] of [
1088
+ ['/github-remote', 'github-remote-ops', '54-github-cli-remote-manager'],
1089
+ ['Update remote GitHub files and LICENSE via gh api without cloning', 'github-remote-ops', '54-github-cli-remote-manager'],
1090
+ ['Trigger a GitHub Actions workflow and inspect open pull requests via gh pr', 'github-remote-ops', '54-github-cli-remote-manager'],
1091
+ ['/github-audit', 'github-portfolio-audit', '11-portfolio-and-github-auditor'],
1092
+ ['Audit my GitHub repos and extract real projects for my CV.', 'github-portfolio-audit', '11-portfolio-and-github-auditor'],
1093
+ ]) {
1094
+ const res = runCli(['route', prompt, '--json']);
1095
+ assert.equal(res.status, 0, `route failed for "${prompt}": ${res.stderr}`);
1096
+ const parsed = JSON.parse(res.stdout);
1097
+ assert.equal(parsed.intent, expectedIntent, `Intent mismatch for "${prompt}"`);
1098
+ assert.ok(parsed.skills.includes(expectedSkill), `Missing ${expectedSkill} for "${prompt}"`);
1099
+ }
1100
+ });
1101
+
1102
+ test('16. Universal Freelance Service Publisher & Offer Radar Batch Bidder (Skills 55-56, 56 Skills)', () => {
1103
+ const manifest = JSON.parse(fs.readFileSync(path.join(REPO_ROOT, 'skills', 'skills-manifest.json'), 'utf8'));
1104
+ assert.equal(manifest.skills.length, 56, `Expected 56 skills in manifest, got ${manifest.skills.length}`);
1105
+ const byName = new Map(manifest.skills.map(s => [s.name, s]));
1106
+
1107
+ // 1. Manifest parity & acyclic DAG (zero /setup interrogate-and-onboard coupling)
1108
+ const s55 = byName.get('freelance-profile-and-service-publisher');
1109
+ assert.ok(s55, 'freelance-profile-and-service-publisher missing from skills-manifest.json');
1110
+ assert.equal(s55.version, '1.0.0');
1111
+ assert.equal(s55.path, 'skills/55-freelance-profile-and-service-publisher.md');
1112
+ assert.deepEqual(s55.requires_mcp, ['none']);
1113
+ assert.deepEqual(s55.optional_mcp, ['playwright']);
1114
+ assert.ok(!s55.requires_skills.includes('interrogate-and-onboard'));
1115
+
1116
+ const s56 = byName.get('freelance-offer-radar-and-batch-bidder');
1117
+ assert.ok(s56, 'freelance-offer-radar-and-batch-bidder missing from skills-manifest.json');
1118
+ assert.equal(s56.version, '1.0.0');
1119
+ assert.equal(s56.path, 'skills/56-freelance-offer-radar-and-batch-bidder.md');
1120
+ assert.deepEqual(s56.requires_mcp, ['none']);
1121
+ assert.deepEqual(s56.optional_mcp, ['playwright']);
1122
+ assert.ok(!s56.requires_skills.includes('interrogate-and-onboard'));
1123
+
1124
+ for (const rootSkill of ['freelance-profile-and-service-publisher', 'freelance-offer-radar-and-batch-bidder']) {
1125
+ const seen = new Set();
1126
+ const queue = [...(byName.get(rootSkill)?.requires_skills || [])];
1127
+ while (queue.length) {
1128
+ const cur = queue.shift();
1129
+ assert.notEqual(cur, rootSkill, `Circular requires_skills dependency detected involving ${rootSkill}`);
1130
+ if (!seen.has(cur)) {
1131
+ seen.add(cur);
1132
+ for (const nxt of byName.get(cur)?.requires_skills || []) queue.push(nxt);
1133
+ }
1134
+ }
1135
+ }
1136
+
1137
+ // 2. Skill content, line-count (< 250 lines), H2 structure, and safety gate clauses
1138
+ const s55Text = fs.readFileSync(path.join(REPO_ROOT, 'skills', '55-freelance-profile-and-service-publisher.md'), 'utf8');
1139
+ assert.ok(s55Text.split(/\r?\n/).length < 250, 'skills/55 must stay under 250 lines');
1140
+ for (const clause of [
1141
+ '## When to Use & Preconditions',
1142
+ '## Deterministic Step-by-Step Execution',
1143
+ '## Anti-Patterns (What NEVER To Do) & Self-Verification Check',
1144
+ 'context/cv.md',
1145
+ 'context/github-projects.md',
1146
+ 'APPROVE PUBLISH',
1147
+ 'Live DOM Read-Back Table',
1148
+ 'browser_snapshot',
1149
+ ]) {
1150
+ assert.ok(s55Text.includes(clause), `skills/55 missing required clause: ${clause}`);
1151
+ }
1152
+
1153
+ const s56Text = fs.readFileSync(path.join(REPO_ROOT, 'skills', '56-freelance-offer-radar-and-batch-bidder.md'), 'utf8');
1154
+ assert.ok(s56Text.split(/\r?\n/).length < 250, 'skills/56 must stay under 250 lines');
1155
+ for (const clause of [
1156
+ '## When to Use & Preconditions',
1157
+ '## Deterministic Step-by-Step Execution',
1158
+ '## Anti-Patterns (What NEVER To Do) & Self-Verification Check',
1159
+ 'UNTRUSTED_EXTERNAL_DATA',
1160
+ 'Fit Score',
1161
+ 'APPROVE 1, 3, 4',
1162
+ 'tracker/freelance-proposals.md',
1163
+ 'browser_snapshot',
1164
+ ]) {
1165
+ assert.ok(s56Text.includes(clause), `skills/56 missing required clause: ${clause}`);
1166
+ }
1167
+
1168
+ // 3. Wrappers & cross-model bridges verify Skills 55 & 56
1169
+ const w55 = fs.readFileSync(path.join(REPO_ROOT, '.agents', 'skills', 'freelance-profile-and-service-publisher', 'SKILL.md'), 'utf8');
1170
+ assert.ok(w55.includes('name: freelance-profile-and-service-publisher'));
1171
+ assert.ok(w55.includes('skills/55-freelance-profile-and-service-publisher.md'));
1172
+
1173
+ const w56 = fs.readFileSync(path.join(REPO_ROOT, '.agents', 'skills', 'freelance-offer-radar-and-batch-bidder', 'SKILL.md'), 'utf8');
1174
+ assert.ok(w56.includes('name: freelance-offer-radar-and-batch-bidder'));
1175
+ assert.ok(w56.includes('skills/56-freelance-offer-radar-and-batch-bidder.md'));
1176
+
1177
+ for (const bridgePath of ['AGENTS.md', 'CLAUDE.md', 'GEMINI.md', path.join('.github', 'copilot-instructions.md')]) {
1178
+ const bText = fs.readFileSync(path.join(REPO_ROOT, bridgePath), 'utf8');
1179
+ assert.ok(bText.includes('55-freelance-profile-and-service-publisher.md'), `${bridgePath} missing Skill 55 reference`);
1180
+ assert.ok(bText.includes('56-freelance-offer-radar-and-batch-bidder.md'), `${bridgePath} missing Skill 56 reference`);
1181
+ }
1182
+
1183
+ // 4. Collision-free routing across Skill 55, Skill 56, linkedin-growth & github-remote-ops
1184
+ for (const [prompt, expectedIntent, expectedSkill] of [
1185
+ ['/freelance-service', 'freelance-service-publisher', '55-freelance-profile-and-service-publisher'],
1186
+ ['Publish an SEO Fiverr and Khamsat service package with custom cover image', 'freelance-service-publisher', '55-freelance-profile-and-service-publisher'],
1187
+ ['انشر خدمة فريلانس على خمسات مع صورة غلاف', 'freelance-service-publisher', '55-freelance-profile-and-service-publisher'],
1188
+ ['/freelance-bid', 'freelance-offer-radar', '56-freelance-offer-radar-and-batch-bidder'],
1189
+ ['Scan open projects on Upwork and Mostaql, filter freelance offers, and draft concise proposals', 'freelance-offer-radar', '56-freelance-offer-radar-and-batch-bidder'],
1190
+ ['فلتر عروض المشاريع المفتوحة على مستقل واكتب عروض تقديم', 'freelance-offer-radar', '56-freelance-offer-radar-and-batch-bidder'],
1191
+ ['set up my LinkedIn Services page for freelance clients', 'linkedin-profile', 'linkedin-growth'],
1192
+ ['/github-remote', 'github-remote-ops', '54-github-cli-remote-manager'],
1193
+ ]) {
1194
+ const res = runCli(['route', prompt, '--json']);
1195
+ assert.equal(res.status, 0, `route failed for "${prompt}": ${res.stderr}`);
1196
+ const parsed = JSON.parse(res.stdout);
1197
+ assert.equal(parsed.intent, expectedIntent, `Intent mismatch for "${prompt}"`);
1198
+ assert.ok(parsed.skills.includes(expectedSkill), `Missing ${expectedSkill} for "${prompt}"`);
1199
+ assert.ok(parsed.skills.length <= 7, `Skill count > 7 for "${prompt}": ${parsed.skills.length}`);
1200
+ }
1201
+ });