[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7ASPE6300XZ5K39QAZB0CAD":3,"skill-same:01M7ASPE6300XZ5K39QAZB0CAD":48},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":29,"ownerHtmlUrl":30,"ownerBlogUrl":31,"ownerDescription":32,"updatedAt":33,"install":34,"resources":47},"01M7ASPE6300XZ5K39QAZB0CAD","vibey-bootstrap-typescript",null,"Use when consuming an vibey-bootstrap Python backend (v4.0.0) from TypeScript\u002FNext.js, or porting its framework-agnostic primitives to TypeScript. vibey-bootstrap is pure Python with no npm distribution. Covers the exact HTTP contract (x-api-key endpoints → 401\u002F429, Graph-style webhook handshake\u002F202\u002F401\u002F400, health probes, \u002Fapi\u002Fmetrics shape) with typed App Router client code, plus native TS reimplementations: structured JSON logging, correlation via AsyncLocalStorage, mask_* helpers, in-memory counters, TokenBucket, constant-time compare, and HMAC-SHA256 action tokens that interoperate byte-for-byte with Python's tokens module. Also includes the master env-var reference (v1–v3), testing notes (AZURE_BOOTSTRAP_ALLOW_RESET, USE_MOCK_BOOTSTRAP), and troubleshooting. Triggers on calling a Python vibey-bootstrap backend from Next.js, validationToken webhook, DATABASE_URL\u002Foutbox patterns, or interoperable HMAC tokens.","the-vibey-project\u002Fvibey","the-vibey-project","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F329298758?v=4","01M7AJHGZ9722CTJ4JNQZVRH0Q","the vibey project","01M7AJHGZVMG2K7TGXQ6XFHVG3",5,"MIT","https:\u002F\u002Fgithub.com\u002Fthe-vibey-project\u002Fvibey\u002Fblob\u002Fdevelop\u002Fsrc\u002Fvibey_tools\u002Fskills\u002Fplugins\u002Fvibey-bootstrap\u002Fskills\u002Fvibey-bootstrap-typescript\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: vibey-bootstrap-typescript\ndescription: \"Use when consuming an vibey-bootstrap Python backend (v4.0.0) from TypeScript\u002FNext.js, or porting its framework-agnostic primitives to TypeScript. vibey-bootstrap is pure Python with no npm distribution. Covers the exact HTTP contract (x-api-key endpoints → 401\u002F429, Graph-style webhook handshake\u002F202\u002F401\u002F400, health probes, \u002Fapi\u002Fmetrics shape) with typed App Router client code, plus native TS reimplementations: structured JSON logging, correlation via AsyncLocalStorage, mask_* helpers, in-memory counters, TokenBucket, constant-time compare, and HMAC-SHA256 action tokens that interoperate byte-for-byte with Python's tokens module. Also includes the master env-var reference (v1–v3), testing notes (AZURE_BOOTSTRAP_ALLOW_RESET, USE_MOCK_BOOTSTRAP), and troubleshooting. Triggers on calling a Python vibey-bootstrap backend from Next.js, validationToken webhook, DATABASE_URL\u002Foutbox patterns, or interoperable HMAC tokens.\"\n---\n\n> **vibey-bootstrap** is the library formerly published as `azure-bootstrap` (renamed in 4.0.0: package `vibey-bootstrap`, import `vibey_bootstrap`, CLI `vibey-bootstrap`; `azbootstrap` remains as a deprecated alias). Feature-tier labels below (v2 primitives, v3 modules) are historical and unchanged.\n\n# Azure Bootstrap — TypeScript\u002FNext.js Integration & Pattern Ports\n\n> **`vibey-bootstrap` is a pure Python package** with **no JavaScript\u002FTypeScript\n> distribution** — you cannot `npm install` or `import` it from a Next.js app. This\n> skill covers two distinct, legitimate things: (Part 7) calling a Python backend that\n> *uses* this library from Next.js over its HTTP surface, and (Part 8) reimplementing\n> the library's framework-agnostic primitives natively in TS.\n\n## 7. TypeScript\u002FNext.js — A: HTTP client integration\n\nThis documents the **exact HTTP contract** a Python backend exposes when it wires up\n`vibey_bootstrap.auth`, `health`, `metrics`, and `fastapi_middleware`, then gives typed\nNext.js (App Router) client code to consume it.\n\n> Conventions assumed below: backend base URL in `process.env.BACKEND_URL`; the API\n> key in **server-only** `process.env.BACKEND_API_KEY` (never `NEXT_PUBLIC_*`).\n\n### 7.1 API-key-protected endpoints\n\n**Contract:** header `x-api-key` (the backend reads it via FastAPI `Header` and passes\nit to `verify_api_key_header`, env `API_KEY`). On mismatch → **`401`** with\n`{\"detail\": \"Unauthorized\"}`. If the backend env var is unset, the check is **fail-open\nby default** (passes) unless the backend opted into strict mode.\n\nKeep the key server-side. Use a Route Handler (or Server Action) as a proxy so the\nbrowser never sees it:\n\n```ts\n\u002F\u002F app\u002Fapi\u002Fadmin\u002Freload\u002Froute.ts\nimport { NextResponse } from \"next\u002Fserver\";\n\nexport async function POST() {\n  const res = await fetch(`${process.env.BACKEND_URL}\u002Fapi\u002Fadmin\u002Freload`, {\n    method: \"POST\",\n    headers: { \"x-api-key\": process.env.BACKEND_API_KEY! },\n    cache: \"no-store\",\n  });\n  if (res.status === 401) return NextResponse.json({ error: \"unauthorized\" }, { status: 401 });\n  if (res.status === 429) return NextResponse.json({ error: \"rate_limited\" }, { status: 429 });\n  return NextResponse.json(await res.json(), { status: res.status });\n}\n```\n\n```ts\n\u002F\u002F lib\u002Fbackend.ts — a small typed wrapper, server-side only\nexport async function callBackend\u003CT>(path: string, init: RequestInit = {}): Promise\u003CT> {\n  const res = await fetch(`${process.env.BACKEND_URL}${path}`, {\n    ...init,\n    headers: { \"x-api-key\": process.env.BACKEND_API_KEY!, ...init.headers },\n    cache: \"no-store\",\n  });\n  if (!res.ok) throw new Error(`backend ${path} -> ${res.status}`);\n  return res.json() as Promise\u003CT>;\n}\n```\n\n### 7.2 Graph-style webhook\n\n`install_graph_webhook_route` exposes one `POST` path with two modes:\n\n| Request | Response |\n|---|---|\n| `POST {path}?validationToken=\u003Ct>` (subscription handshake) | `200` + **plaintext** body `\u003Ct>` (not JSON) |\n| `POST {path}` body `{\"value\":[{ \"clientState\", \"subscriptionId\", \"resourceData\": { \"id\" } }]}` | `202` (accepted) |\n| clientState missing\u002Fmismatch, or endpoint unconfigured | `401` (empty body) |\n| rate-limited | `429` (empty body) |\n| malformed JSON | `400` |\n\n`clientState` is checked **constant-time** against `GRAPH_WEBHOOK_CLIENT_STATE`;\ndedup is keyed on `(subscriptionId, resourceData.id)`. Payload types:\n\n```ts\n\u002F\u002F lib\u002Fwebhook-types.ts\nexport interface GraphNotification {\n  clientState?: string;\n  subscriptionId?: string;\n  resourceData?: { id?: string };\n}\nexport interface GraphNotificationBatch { value: GraphNotification[]; }\n```\n\nIf you instead want a Next.js Route Handler to *receive* such webhooks (a parallel TS\nimplementation of the same contract):\n\n```ts\n\u002F\u002F app\u002Fapi\u002Fwebhooks\u002Femail\u002Froute.ts\nimport { NextRequest, NextResponse } from \"next\u002Fserver\";\nimport { timingSafeEqual } from \"node:crypto\";\nimport type { GraphNotificationBatch } from \"@\u002Flib\u002Fwebhook-types\";\n\nfunction safeEqual(a?: string, b?: string): boolean {\n  if (!a || !b) return false;\n  const ab = Buffer.from(a), bb = Buffer.from(b);\n  return ab.length === bb.length && timingSafeEqual(ab, bb);\n}\n\nexport async function POST(req: NextRequest) {\n  \u002F\u002F 1. validation handshake — echo the token as plaintext\n  const token = req.nextUrl.searchParams.get(\"validationToken\");\n  if (token) return new NextResponse(token, { status: 200, headers: { \"content-type\": \"text\u002Fplain\" } });\n\n  \u002F\u002F 2. live notification\n  let batch: GraphNotificationBatch;\n  try { batch = await req.json(); } catch { return new NextResponse(null, { status: 400 }); }\n\n  const expected = process.env.GRAPH_WEBHOOK_CLIENT_STATE;\n  for (const n of batch.value ?? []) {\n    if (!safeEqual(n.clientState, expected)) return new NextResponse(null, { status: 401 });\n    const messageId = n.resourceData?.id;\n    if (messageId) queueBackgroundWork(messageId); \u002F\u002F your dedup + dispatch\n  }\n  return new NextResponse(null, { status: 202 });\n}\n```\n\n### 7.3 Health probes\n\n`check_*` helpers each return `{\"status\": \"ok\" | \"not_configured\" | \"error\", ...}`\n(no HTTP 5xx for an unconfigured optional dependency). A typical `\u002Fhealth\u002Fready` body:\n\n```ts\nexport interface Probe { status: \"ok\" | \"not_configured\" | \"error\"; message?: string; mock?: boolean; }\nexport interface ReadyResponse {\n  status: \"ok\"; app_config: Probe; app_insights: Probe; app_insights_logging?: Probe;\n}\n```\n\n```ts\n\u002F\u002F app\u002Fstatus\u002Fpage.tsx — server component\nexport default async function StatusPage() {\n  const res = await fetch(`${process.env.BACKEND_URL}\u002Fhealth\u002Fready`, { cache: \"no-store\" });\n  const ready = (await res.json()) as ReadyResponse;\n  const healthy = res.ok && Object.values(ready).every(\n    (v) => typeof v !== \"object\" || v.status !== \"error\");\n  return \u003Cmain>Backend: {healthy ? \"✅ healthy\" : \"⚠️ degraded\"}\u003C\u002Fmain>;\n}\n```\n\n### 7.4 `\u002Fapi\u002Fmetrics`\n\n`build_metrics_snapshot()` JSON shape (sections are present only if the backend has\nthat module wired):\n\n```ts\nexport interface MetricsSnapshot {\n  latency: Record\u003Cstring, { count: number; errors: number; slow: number;\n                            p50: number; p95: number; p99: number; max: number; last_seen?: number }>;\n  alert_counters: Record\u003Cstring, number>;\n  ai_usage?: { by_deployment: Record\u003Cstring, unknown>;\n               totals: { calls: number; total_tokens: number; cost_usd: number; rate_limit_events: number } };\n  bootstrap_initialized?: boolean;\n  last_sb_settle_age_seconds?: number | null;\n}\n```\n\n### 7.5 Correlation IDs & rate limiting\n\n- The Python middleware does **not** emit an `X-Correlation-ID` response header —\n  correlation lives in server-side context vars. If you want end-to-end correlation,\n  generate an id in Next.js, send it as a custom header, and have the backend read it\n  into `correlation_scope(...)`.\n- `429` responses carry **empty bodies** by design. Honor `Retry-After` if present and\n  back off; don't parse the body for budget state.\n\n## 8. TypeScript\u002FNext.js — B: porting the patterns to TypeScript\n\nThese are **equivalent reimplementations**, not bindings — drop them into a Next.js\napp that has no Python backend. They mirror the Python semantics closely; the token\nhelper in 8.6 is deliberately **wire-compatible** with the Python side.\n\n### 8.1 Structured JSON logging (mirrors `JsonLogFormatter`)\n\n```ts\n\u002F\u002F lib\u002Flogger.ts\nconst SECRET_KEYS = new Set([\"authorization\",\"api_key\",\"apikey\",\"password\",\"token\",\n  \"secret\",\"client_secret\",\"connection_string\"]);\n\nfunction maskSecrets(o: Record\u003Cstring, unknown>): Record\u003Cstring, unknown> {\n  const out: Record\u003Cstring, unknown> = {};\n  for (const [k, v] of Object.entries(o)) out[k] = SECRET_KEYS.has(k.toLowerCase()) && v ? \"***\" : v;\n  return out;\n}\n\nexport function log(level: \"INFO\"|\"WARNING\"|\"ERROR\"|\"DEBUG\",\n                    logger: string, message: string, extra: Record\u003Cstring, unknown> = {}) {\n  const line = { timestamp: new Date().toISOString(), level, logger, message, ...maskSecrets(extra) };\n  (level === \"ERROR\" ? console.error : console.log)(JSON.stringify(line));\n}\n```\n\n### 8.2 Correlation context (mirrors `correlation_scope` via `AsyncLocalStorage`)\n\n```ts\n\u002F\u002F lib\u002Fcorrelation.ts\nimport { AsyncLocalStorage } from \"node:async_hooks\";\nimport { randomUUID } from \"node:crypto\";\n\ntype Ctx = Record\u003Cstring, string>;\nconst als = new AsyncLocalStorage\u003CCtx>();\n\nexport function correlationScope\u003CT>(fn: () => T, fields: Ctx = {}): T {\n  const ctx: Ctx = { correlation_id: fields.correlation_id ?? randomUUID().replace(\u002F-\u002Fg, \"\").slice(0, 12), ...fields };\n  return als.run(ctx, fn);\n}\nexport const getCorrelationId = () => als.getStore()?.correlation_id;\nexport const getContext = () => als.getStore() ?? {};\n```\n\n### 8.3 Masking helpers (mirror `mask_*`)\n\n```ts\nexport const maskApiKey = (s?: string) => (!s || s.length \u003C 4 ? \"***\" : `***${s.slice(-4)}`);\nexport const maskBearer = (t?: string) => (t?.startsWith(\"Bearer\") ? \"Bearer ***\" : \"***\");\nexport const maskEmail = (e?: string) => {\n  if (!e || !e.includes(\"@\")) return \"***\";\n  const [local, domain] = e.split(\"@\");\n  return `***${local.slice(-2)}@${domain}`;\n};\n```\n\n### 8.4 In-memory counters (mirror `bump_counter` \u002F `counter_snapshot`)\n\n```ts\nconst counters = new Map\u003Cstring, number>();\nexport const bumpCounter = (name: string, n = 1) => counters.set(name, (counters.get(name) ?? 0) + n);\nexport const counterSnapshot = () => Object.fromEntries(counters);\n```\n\n### 8.5 Token bucket (mirrors `ratelimit.TokenBucket` + presets)\n\n```ts\n\u002F\u002F lib\u002Ftoken-bucket.ts\nexport class TokenBucket {\n  private tokens: number; private last = performance.now() \u002F 1000;\n  constructor(private budget: number, private refillPerSecond: number) { this.tokens = budget; }\n  consume(n = 1): boolean {\n    const now = performance.now() \u002F 1000;\n    this.tokens = Math.min(this.budget, this.tokens + (now - this.last) * this.refillPerSecond);\n    this.last = now;\n    if (this.tokens >= n) { this.tokens -= n; return true; }\n    return false;\n  }\n}\nexport const webhookBucket = () => new TokenBucket(240, 4);   \u002F\u002F 240 burst, 4\u002Fs\nexport const adminBucket   = () => new TokenBucket(30, 0.5);  \u002F\u002F 30 burst, 0.5\u002Fs\n```\n\n> In-process buckets only protect a single Node instance. On Vercel\u002Fserverless or\n> multi-replica deployments, back the limiter with Redis\u002FUpstash for a shared budget.\n\n### 8.6 HMAC-SHA256 action tokens — **interoperable with Python `tokens`**\n\nSame wire format as `vibey_bootstrap.tokens` \u002F the Service-Bus resubmit token:\n`base64url(json).base64url(hmac_sha256)`, payload sorted-keys with `exp` (unix\nseconds) and `act`. A token minted here verifies in Python and vice-versa — so a\nNext.js admin UI can issue a `dlq_resubmit` token the Python consumer accepts.\n\n```ts\n\u002F\u002F lib\u002Faction-token.ts\nimport { createHmac, timingSafeEqual } from \"node:crypto\";\n\nconst b64url = (b: Buffer) => b.toString(\"base64url\");\n\u002F\u002F Python uses json.dumps(sort_keys=True, separators=(\",\",\":\")) — match it exactly:\nfunction canonicalJson(obj: Record\u003Cstring, unknown>): string {\n  const keys = Object.keys(obj).sort();\n  return `{${keys.map((k) => `${JSON.stringify(k)}:${JSON.stringify(obj[k])}`).join(\",\")}}`;\n}\n\nexport function issueActionToken(secret: string, action: string,\n    ttlSeconds = 86400, payload: Record\u003Cstring, unknown> = {}): string {\n  const body = { ...payload, exp: Math.floor(Date.now() \u002F 1000) + ttlSeconds, act: action };\n  const payloadBytes = Buffer.from(canonicalJson(body), \"utf-8\");\n  const sig = createHmac(\"sha256\", secret).update(payloadBytes).digest();\n  return `${b64url(payloadBytes)}.${b64url(sig)}`;\n}\n\nexport function verifyActionToken(secret: string, token: string, expectedAction: string): Record\u003Cstring, unknown> {\n  const [p, s] = token.split(\".\");\n  if (!p || !s) throw new Error(\"malformed token\");\n  const payloadBytes = Buffer.from(p, \"base64url\");\n  const provided = Buffer.from(s, \"base64url\");\n  const expected = createHmac(\"sha256\", secret).update(payloadBytes).digest();\n  if (provided.length !== expected.length || !timingSafeEqual(provided, expected)) throw new Error(\"signature mismatch\");\n  const body = JSON.parse(payloadBytes.toString(\"utf-8\"));\n  if (body.act !== expectedAction) throw new Error(\"wrong action\");\n  if (typeof body.exp !== \"number\" || body.exp \u003C Math.floor(Date.now() \u002F 1000)) throw new Error(\"expired\");\n  return body;\n}\n```\n\n> **Interop caveats.** Byte-compatibility depends on the JSON serialization matching\n> Python's `json.dumps(sort_keys=True, separators=(\",\",\":\"))`. The helper above\n> reproduces sorted keys and compact separators, but keep payload values to JSON\n> primitives (strings, ints, bools) — non-ASCII strings and floats can serialize\n> differently across runtimes and will break the signature. Use the **same shared\n> secret** on both sides (a Key Vault secret).\n\n### 8.7 Constant-time compare (mirrors `compare_secrets`)\n\n```ts\nimport { timingSafeEqual } from \"node:crypto\";\nexport function compareSecrets(a?: string, b?: string): boolean {\n  if (!a || !b) return false;\n  const ab = Buffer.from(a, \"utf-8\"), bb = Buffer.from(b, \"utf-8\");\n  return ab.length === bb.length && timingSafeEqual(ab, bb);\n}\n```\n\n## 9. Appendices\n\n### 9.1 Master environment-variable reference\n\n| Variable | Default | Area |\n|---|---|---|\n| `APPLICATIONINSIGHTS_CONNECTION_STRING` | — | telemetry (v1) |\n| `AZURE_APP_CONFIGURATION_CONNECTION_STRING` | — | App Config (v1) |\n| `AZURE_APPCONFIG_ENDPOINT` | — | App Config via AAD (health) |\n| `AZURE_KEY_VAULT_URL` | — | Key Vault (v1) |\n| `AZURE_TENANT_ID` \u002F `AZURE_CLIENT_ID` \u002F `AZURE_CLIENT_SECRET` | — | `build_credential` |\n| `LOG_LEVEL` | `INFO` | logging |\n| `DEBUG_LOGGING_ENABLED` | off | DEBUG second gate |\n| `USE_MOCK_BOOTSTRAP` | off | mock bootstrap \u002F probes |\n| `FUNCTIONS_WORKER_RUNTIME` | — | Azure Functions detection |\n| `CONSOLE_LOGGING_ENABLED` | on | transport flag |\n| `APP_INSIGHTS_LOGGING_ENABLED` | off | transport flag |\n| `SUMO_LOGIC_LOGGING_ENABLED` | off | transport flag |\n| `SUMO_LOGIC_COLLECTOR_URL` (+ `_TOKEN`, `_SOURCE_CATEGORY`, `_SOURCE_HOST`, `_FIELDS`, `_BATCH_SIZE`, `_MAX_BATCH_BYTES`, `_GZIP_THRESHOLD`, `_FLUSH_INTERVAL`, `_MAX_BUFFER`, `_TIMEOUT`) | see primitives skill | Sumo transport |\n| `PANTHER_LOGGING_ENABLED`, `PANTHER_API_HOST`, `PANTHER_LOG_SOURCE_*` | off | Panther transport (v3) |\n| `FILE_LOGGING_ENABLED`, `FILE_LOG_PATH`, `FILE_LOG_ROOT`, `FILE_LOG_ROTATION`, … | off | local file transport (v3) |\n| `BLOB_LOGGING_ENABLED`, `BLOB_*` | off | Blob log transport (v3) |\n| `SQL_LOGGING_ENABLED`, `SQL_LOG_DSN`, `SQL_LOG_TABLE` | off | SQL log transport (v3) |\n| `NOSQL_LOGGING_ENABLED`, `NOSQL_LOG_URI`, `NOSQL_LOG_DATABASE` | off | NoSQL log transport (v3) |\n| `ADX_LOGGING_ENABLED`, `ADX_CLUSTER_URI`, `ADX_DATABASE` | off | ADX log transport (v3) |\n| `EVENTHUBS_LOGGING_ENABLED`, `EVENTHUB_FQNS`, `EVENTHUB_NAME` | off | Event Hubs log transport (v3) |\n| `DATABASE_URL` | — | SQLAlchemy \u002F outbox (v3 `[db]`) |\n| `ACS_CONNECTION_STRING`, `ACS_SENDER_ADDRESS` | — | ACS email (v3 `[email]`) |\n| `NOSQL_URI`, `NOSQL_DATABASE` | — | documentdb client (v3) |\n| `BUILD_VERSION` \u002F `APP_VERSION`, `GIT_SHA`, `POD_NAME`, `POD_NAMESPACE`, `NODE_NAME` | — | AKS build info (v3) |\n| `LEADER_ELECTION_CONFIGMAP` | — | AKS leader election (v3) |\n| `SERVICE_BUS_TRANSPORT_TYPE` | `amqp` | `amqp` or `websocket` (v3) |\n| `API_KEY` | — | `verify_api_key_header` |\n| `GRAPH_WEBHOOK_CLIENT_STATE` | — (required for webhooks) | webhook auth |\n| `DEV_ALERTS_ENABLED`, `DEV_ALERT_RECIPIENTS`, `ALERT_DEDUP_WINDOW_SECONDS`, `ALERT_MAX_PER_HOUR`, `ALERT_ESCALATE_AFTER`, `ALERT_ESCALATE_WINDOW_SECONDS`, `ALERT_CRITICAL_SUBJECT_PREFIX` | see Part 5 | `alerts` dispatcher |\n| `HEARTBEAT_INTERVAL_SECONDS` \u002F `WATCHDOG_*` | see Part 5 | heartbeat |\n| `AI_TPM_LIMIT[_\u003CDEPLOYMENT>]`, `AI_COST_ALERT_HOURLY_DOLLARS`, `AI_COST_ALERT_DAILY_DOLLARS`, `AI_HIGH_USAGE_TOKENS_HOURLY` | — | `openai` tracker |\n| `AZURE_BOOTSTRAP_ALLOW_RESET` | off | **test-only** (see 9.2) |\n\n### 9.2 Testing note\n\nSubpackages with global state (counters, latency histograms, alert dispatcher,\ntransports, webhook dedup, …) expose `reset_state()` \u002F `_reset_*` helpers **gated by\n`AZURE_BOOTSTRAP_ALLOW_RESET=1`**. The test suite sets it once in `test\u002Fconftest.py`;\n**production code must never set it.** For local\u002Fdev runs without Azure, set\n`USE_MOCK_BOOTSTRAP=true` to make `ensure_bootstrap()` a no-op and the health\u002Fidentity\nprobes return `{\"status\":\"ok\",\"mock\":true}`.\n\n### 9.3 Troubleshooting\n\n| Symptom | Cause \u002F fix |\n|---|---|\n| Sumo transport silently does nothing | `SUMO_LOGIC_COLLECTOR_URL` unset, or `[sumologic]` extra (`requests`) not installed → `make_sumo_logic_handler()` returns `None` by design. |\n| v3 transport silently does nothing | Required env vars unset or pip extra missing — factories return `None` (soft no-op); check `list_transports()`. |\n| `ImportError` from `get_db` \u002F `drain_outbox` | Install the `[db]` extra (`sqlalchemy`, `alembic`). |\n| `ImportError` from `request_with_retry` | Install the `[http]` extra (`requests`). |\n| App Insights never \"upgrades\" | The connection string wasn't present in env at phase 2 and isn't in App Config either; verify `APPLICATIONINSIGHTS_CONNECTION_STRING`. |\n| `ImportError` from `install_graph_webhook_route` \u002F `fastapi_rate_limit` | Install the `fastapi` extra. |\n| DEBUG logs missing despite `LOG_LEVEL=DEBUG` | Also set `DEBUG_LOGGING_ENABLED=true` (the second gate). |\n| `LoggingExtraConflictError` | An `extra={}` key collides with a reserved `LogRecord` attribute (e.g. `name`, `msg`, `args`) — rename it. |\n| `ConfigurationError` from webhook | `GRAPH_WEBHOOK_CLIENT_STATE` is unset; the endpoint refuses all entries (`401`). |\n\n### 9.4 Further reading\n\n- `README.md` — overview + extras matrix\n- `docs\u002FUSAGE.md` — complete usage guide (Python + TypeScript)\n- `examples\u002FREADME.md` — numbered reading order (01 → 46 + e2e_*)\n- `CHANGELOG.md` — release-by-release surface\n- `MIGRATING-FROM-V1.md` — v1 → v2 adoption\n- `MIGRATING-TO-V3.md` — v4.0.0 opt-in features (additive, no breaking changes)\n","> **vibey-bootstrap** is the library formerly published as `azure-bootstrap` (renamed in 4.0.0: package `vibey-bootstrap`, import `vibey_bootstrap`, CLI `vibey-bootstrap`; `azbootstrap` remains as a deprecated alias). Feature-tier labels below (v2 primitives, v3 modules) are historical and unchanged.\n\n# Azure Bootstrap — TypeScript\u002FNext.js Integration & Pattern Ports\n\n> **`vibey-bootstrap` is a pure Python package** with **no JavaScript\u002FTypeScript\n> distribution** — you cannot `npm install` or `import` it from a Next.js app. This\n> skill covers two distinct, legitimate things: (Part 7) calling a Python backend that\n> *uses* this library from Next.js over its HTTP surface, and (Part 8) reimplementing\n> the library's framework-agnostic primitives natively in TS.\n\n## 7. TypeScript\u002FNext.js — A: HTTP client integration\n\nThis documents the **exact HTTP contract** a Python backend exposes when it wires up\n`vibey_bootstrap.auth`, `health`, `metrics`, and `fastapi_middleware`, then gives typed\nNext.js (App Router) client code to consume it.\n\n> Conventions assumed below: backend base URL in `process.env.BACKEND_URL`; the API\n> key in **server-only** `process.env.BACKEND_API_KEY` (never `NEXT_PUBLIC_*`).\n\n### 7.1 API-key-protected endpoints\n\n**Contract:** header `x-api-key` (the backend reads it via FastAPI `Header` and passes\nit to `verify_api_key_header`, env `API_KEY`). On mismatch → **`401`** with\n`{\"detail\": \"Unauthorized\"}`. If the backend env var is unset, the check is **fail-open\nby default** (passes) unless the backend opted into strict mode.\n\nKeep the key server-side. Use a Route Handler (or Server Action) as a proxy so the\nbrowser never sees it:\n\n```ts\n\u002F\u002F app\u002Fapi\u002Fadmin\u002Freload\u002Froute.ts\nimport { NextResponse } from \"next\u002Fserver\";\n\nexport async function POST() {\n  const res = await fetch(`${process.env.BACKEND_URL}\u002Fapi\u002Fadmin\u002Freload`, {\n    method: \"POST\",\n    headers: { \"x-api-key\": process.env.BACKEND_API_KEY! },\n    cache: \"no-store\",\n  });\n  if (res.status === 401) return NextResponse.json({ error: \"unauthorized\" }, { status: 401 });\n  if (res.status === 429) return NextResponse.json({ error: \"rate_limited\" }, { status: 429 });\n  return NextResponse.json(await res.json(), { status: res.status });\n}\n```\n\n```ts\n\u002F\u002F lib\u002Fbackend.ts — a small typed wrapper, server-side only\nexport async function callBackend\u003CT>(path: string, init: RequestInit = {}): Promise\u003CT> {\n  const res = await fetch(`${process.env.BACKEND_URL}${path}`, {\n    ...init,\n    headers: { \"x-api-key\": process.env.BACKEND_API_KEY!, ...init.headers },\n    cache: \"no-store\",\n  });\n  if (!res.ok) throw new Error(`backend ${path} -> ${res.status}`);\n  return res.json() as Promise\u003CT>;\n}\n```\n\n### 7.2 Graph-style webhook\n\n`install_graph_webhook_route` exposes one `POST` path with two modes:\n\n| Request | Response |\n|---|---|\n| `POST {path}?validationToken=\u003Ct>` (subscription handshake) | `200` + **plaintext** body `\u003Ct>` (not JSON) |\n| `POST {path}` body `{\"value\":[{ \"clientState\", \"subscriptionId\", \"resourceData\": { \"id\" } }]}` | `202` (accepted) |\n| clientState missing\u002Fmismatch, or endpoint unconfigured | `401` (empty body) |\n| rate-limited | `429` (empty body) |\n| malformed JSON | `400` |\n\n`clientState` is checked **constant-time** against `GRAPH_WEBHOOK_CLIENT_STATE`;\ndedup is keyed on `(subscriptionId, resourceData.id)`. Payload types:\n\n```ts\n\u002F\u002F lib\u002Fwebhook-types.ts\nexport interface GraphNotification {\n  clientState?: string;\n  subscriptionId?: string;\n  resourceData?: { id?: string };\n}\nexport interface GraphNotificationBatch { value: GraphNotification[]; }\n```\n\nIf you instead want a Next.js Route Handler to *receive* such webhooks (a parallel TS\nimplementation of the same contract):\n\n```ts\n\u002F\u002F app\u002Fapi\u002Fwebhooks\u002Femail\u002Froute.ts\nimport { NextRequest, NextResponse } from \"next\u002Fserver\";\nimport { timingSafeEqual } from \"node:crypto\";\nimport type { GraphNotificationBatch } from \"@\u002Flib\u002Fwebhook-types\";\n\nfunction safeEqual(a?: string, b?: string): boolean {\n  if (!a || !b) return false;\n  const ab = Buffer.from(a), bb = Buffer.from(b);\n  return ab.length === bb.length && timingSafeEqual(ab, bb);\n}\n\nexport async function POST(req: NextRequest) {\n  \u002F\u002F 1. validation handshake — echo the token as plaintext\n  const token = req.nextUrl.searchParams.get(\"validationToken\");\n  if (token) return new NextResponse(token, { status: 200, headers: { \"content-type\": \"text\u002Fplain\" } });\n\n  \u002F\u002F 2. live notification\n  let batch: GraphNotificationBatch;\n  try { batch = await req.json(); } catch { return new NextResponse(null, { status: 400 }); }\n\n  const expected = process.env.GRAPH_WEBHOOK_CLIENT_STATE;\n  for (const n of batch.value ?? []) {\n    if (!safeEqual(n.clientState, expected)) return new NextResponse(null, { status: 401 });\n    const messageId = n.resourceData?.id;\n    if (messageId) queueBackgroundWork(messageId); \u002F\u002F your dedup + dispatch\n  }\n  return new NextResponse(null, { status: 202 });\n}\n```\n\n### 7.3 Health probes\n\n`check_*` helpers each return `{\"status\": \"ok\" | \"not_configured\" | \"error\", ...}`\n(no HTTP 5xx for an unconfigured optional dependency). A typical `\u002Fhealth\u002Fready` body:\n\n```ts\nexport interface Probe { status: \"ok\" | \"not_configured\" | \"error\"; message?: string; mock?: boolean; }\nexport interface ReadyResponse {\n  status: \"ok\"; app_config: Probe; app_insights: Probe; app_insights_logging?: Probe;\n}\n```\n\n```ts\n\u002F\u002F app\u002Fstatus\u002Fpage.tsx — server component\nexport default async function StatusPage() {\n  const res = await fetch(`${process.env.BACKEND_URL}\u002Fhealth\u002Fready`, { cache: \"no-store\" });\n  const ready = (await res.json()) as ReadyResponse;\n  const healthy = res.ok && Object.values(ready).every(\n    (v) => typeof v !== \"object\" || v.status !== \"error\");\n  return \u003Cmain>Backend: {healthy ? \"✅ healthy\" : \"⚠️ degraded\"}\u003C\u002Fmain>;\n}\n```\n\n### 7.4 `\u002Fapi\u002Fmetrics`\n\n`build_metrics_snapshot()` JSON shape (sections are present only if the backend has\nthat module wired):\n\n```ts\nexport interface MetricsSnapshot {\n  latency: Record\u003Cstring, { count: number; errors: number; slow: number;\n                            p50: number; p95: number; p99: number; max: number; last_seen?: number }>;\n  alert_counters: Record\u003Cstring, number>;\n  ai_usage?: { by_deployment: Record\u003Cstring, unknown>;\n               totals: { calls: number; total_tokens: number; cost_usd: number; rate_limit_events: number } };\n  bootstrap_initialized?: boolean;\n  last_sb_settle_age_seconds?: number | null;\n}\n```\n\n### 7.5 Correlation IDs & rate limiting\n\n- The Python middleware does **not** emit an `X-Correlation-ID` response header —\n  correlation lives in server-side context vars. If you want end-to-end correlation,\n  generate an id in Next.js, send it as a custom header, and have the backend read it\n  into `correlation_scope(...)`.\n- `429` responses carry **empty bodies** by design. Honor `Retry-After` if present and\n  back off; don't parse the body for budget state.\n\n## 8. TypeScript\u002FNext.js — B: porting the patterns to TypeScript\n\nThese are **equivalent reimplementations**, not bindings — drop them into a Next.js\napp that has no Python backend. They mirror the Python semantics closely; the token\nhelper in 8.6 is deliberately **wire-compatible** with the Python side.\n\n### 8.1 Structured JSON logging (mirrors `JsonLogFormatter`)\n\n```ts\n\u002F\u002F lib\u002Flogger.ts\nconst SECRET_KEYS = new Set([\"authorization\",\"api_key\",\"apikey\",\"password\",\"token\",\n  \"secret\",\"client_secret\",\"connection_string\"]);\n\nfunction maskSecrets(o: Record\u003Cstring, unknown>): Record\u003Cstring, unknown> {\n  const out: Record\u003Cstring, unknown> = {};\n  for (const [k, v] of Object.entries(o)) out[k] = SECRET_KEYS.has(k.toLowerCase()) && v ? \"***\" : v;\n  return out;\n}\n\nexport function log(level: \"INFO\"|\"WARNING\"|\"ERROR\"|\"DEBUG\",\n                    logger: string, message: string, extra: Record\u003Cstring, unknown> = {}) {\n  const line = { timestamp: new Date().toISOString(), level, logger, message, ...maskSecrets(extra) };\n  (level === \"ERROR\" ? console.error : console.log)(JSON.stringify(line));\n}\n```\n\n### 8.2 Correlation context (mirrors `correlation_scope` via `AsyncLocalStorage`)\n\n```ts\n\u002F\u002F lib\u002Fcorrelation.ts\nimport { AsyncLocalStorage } from \"node:async_hooks\";\nimport { randomUUID } from \"node:crypto\";\n\ntype Ctx = Record\u003Cstring, string>;\nconst als = new AsyncLocalStorage\u003CCtx>();\n\nexport function correlationScope\u003CT>(fn: () => T, fields: Ctx = {}): T {\n  const ctx: Ctx = { correlation_id: fields.correlation_id ?? randomUUID().replace(\u002F-\u002Fg, \"\").slice(0, 12), ...fields };\n  return als.run(ctx, fn);\n}\nexport const getCorrelationId = () => als.getStore()?.correlation_id;\nexport const getContext = () => als.getStore() ?? {};\n```\n\n### 8.3 Masking helpers (mirror `mask_*`)\n\n```ts\nexport const maskApiKey = (s?: string) => (!s || s.length \u003C 4 ? \"***\" : `***${s.slice(-4)}`);\nexport const maskBearer = (t?: string) => (t?.startsWith(\"Bearer\") ? \"Bearer ***\" : \"***\");\nexport const maskEmail = (e?: string) => {\n  if (!e || !e.includes(\"@\")) return \"***\";\n  const [local, domain] = e.split(\"@\");\n  return `***${local.slice(-2)}@${domain}`;\n};\n```\n\n### 8.4 In-memory counters (mirror `bump_counter` \u002F `counter_snapshot`)\n\n```ts\nconst counters = new Map\u003Cstring, number>();\nexport const bumpCounter = (name: string, n = 1) => counters.set(name, (counters.get(name) ?? 0) + n);\nexport const counterSnapshot = () => Object.fromEntries(counters);\n```\n\n### 8.5 Token bucket (mirrors `ratelimit.TokenBucket` + presets)\n\n```ts\n\u002F\u002F lib\u002Ftoken-bucket.ts\nexport class TokenBucket {\n  private tokens: number; private last = performance.now() \u002F 1000;\n  constructor(private budget: number, private refillPerSecond: number) { this.tokens = budget; }\n  consume(n = 1): boolean {\n    const now = performance.now() \u002F 1000;\n    this.tokens = Math.min(this.budget, this.tokens + (now - this.last) * this.refillPerSecond);\n    this.last = now;\n    if (this.tokens >= n) { this.tokens -= n; return true; }\n    return false;\n  }\n}\nexport const webhookBucket = () => new TokenBucket(240, 4);   \u002F\u002F 240 burst, 4\u002Fs\nexport const adminBucket   = () => new TokenBucket(30, 0.5);  \u002F\u002F 30 burst, 0.5\u002Fs\n```\n\n> In-process buckets only protect a single Node instance. On Vercel\u002Fserverless or\n> multi-replica deployments, back the limiter with Redis\u002FUpstash for a shared budget.\n\n### 8.6 HMAC-SHA256 action tokens — **interoperable with Python `tokens`**\n\nSame wire format as `vibey_bootstrap.tokens` \u002F the Service-Bus resubmit token:\n`base64url(json).base64url(hmac_sha256)`, payload sorted-keys with `exp` (unix\nseconds) and `act`. A token minted here verifies in Python and vice-versa — so a\nNext.js admin UI can issue a `dlq_resubmit` token the Python consumer accepts.\n\n```ts\n\u002F\u002F lib\u002Faction-token.ts\nimport { createHmac, timingSafeEqual } from \"node:crypto\";\n\nconst b64url = (b: Buffer) => b.toString(\"base64url\");\n\u002F\u002F Python uses json.dumps(sort_keys=True, separators=(\",\",\":\")) — match it exactly:\nfunction canonicalJson(obj: Record\u003Cstring, unknown>): string {\n  const keys = Object.keys(obj).sort();\n  return `{${keys.map((k) => `${JSON.stringify(k)}:${JSON.stringify(obj[k])}`).join(\",\")}}`;\n}\n\nexport function issueActionToken(secret: string, action: string,\n    ttlSeconds = 86400, payload: Record\u003Cstring, unknown> = {}): string {\n  const body = { ...payload, exp: Math.floor(Date.now() \u002F 1000) + ttlSeconds, act: action };\n  const payloadBytes = Buffer.from(canonicalJson(body), \"utf-8\");\n  const sig = createHmac(\"sha256\", secret).update(payloadBytes).digest();\n  return `${b64url(payloadBytes)}.${b64url(sig)}`;\n}\n\nexport function verifyActionToken(secret: string, token: string, expectedAction: string): Record\u003Cstring, unknown> {\n  const [p, s] = token.split(\".\");\n  if (!p || !s) throw new Error(\"malformed token\");\n  const payloadBytes = Buffer.from(p, \"base64url\");\n  const provided = Buffer.from(s, \"base64url\");\n  const expected = createHmac(\"sha256\", secret).update(payloadBytes).digest();\n  if (provided.length !== expected.length || !timingSafeEqual(provided, expected)) throw new Error(\"signature mismatch\");\n  const body = JSON.parse(payloadBytes.toString(\"utf-8\"));\n  if (body.act !== expectedAction) throw new Error(\"wrong action\");\n  if (typeof body.exp !== \"number\" || body.exp \u003C Math.floor(Date.now() \u002F 1000)) throw new Error(\"expired\");\n  return body;\n}\n```\n\n> **Interop caveats.** Byte-compatibility depends on the JSON serialization matching\n> Python's `json.dumps(sort_keys=True, separators=(\",\",\":\"))`. The helper above\n> reproduces sorted keys and compact separators, but keep payload values to JSON\n> primitives (strings, ints, bools) — non-ASCII strings and floats can serialize\n> differently across runtimes and will break the signature. Use the **same shared\n> secret** on both sides (a Key Vault secret).\n\n### 8.7 Constant-time compare (mirrors `compare_secrets`)\n\n```ts\nimport { timingSafeEqual } from \"node:crypto\";\nexport function compareSecrets(a?: string, b?: string): boolean {\n  if (!a || !b) return false;\n  const ab = Buffer.from(a, \"utf-8\"), bb = Buffer.from(b, \"utf-8\");\n  return ab.length === bb.length && timingSafeEqual(ab, bb);\n}\n```\n\n## 9. Appendices\n\n### 9.1 Master environment-variable reference\n\n| Variable | Default | Area |\n|---|---|---|\n| `APPLICATIONINSIGHTS_CONNECTION_STRING` | — | telemetry (v1) |\n| `AZURE_APP_CONFIGURATION_CONNECTION_STRING` | — | App Config (v1) |\n| `AZURE_APPCONFIG_ENDPOINT` | — | App Config via AAD (health) |\n| `AZURE_KEY_VAULT_URL` | — | Key Vault (v1) |\n| `AZURE_TENANT_ID` \u002F `AZURE_CLIENT_ID` \u002F `AZURE_CLIENT_SECRET` | — | `build_credential` |\n| `LOG_LEVEL` | `INFO` | logging |\n| `DEBUG_LOGGING_ENABLED` | off | DEBUG second gate |\n| `USE_MOCK_BOOTSTRAP` | off | mock bootstrap \u002F probes |\n| `FUNCTIONS_WORKER_RUNTIME` | — | Azure Functions detection |\n| `CONSOLE_LOGGING_ENABLED` | on | transport flag |\n| `APP_INSIGHTS_LOGGING_ENABLED` | off | transport flag |\n| `SUMO_LOGIC_LOGGING_ENABLED` | off | transport flag |\n| `SUMO_LOGIC_COLLECTOR_URL` (+ `_TOKEN`, `_SOURCE_CATEGORY`, `_SOURCE_HOST`, `_FIELDS`, `_BATCH_SIZE`, `_MAX_BATCH_BYTES`, `_GZIP_THRESHOLD`, `_FLUSH_INTERVAL`, `_MAX_BUFFER`, `_TIMEOUT`) | see primitives skill | Sumo transport |\n| `PANTHER_LOGGING_ENABLED`, `PANTHER_API_HOST`, `PANTHER_LOG_SOURCE_*` | off | Panther transport (v3) |\n| `FILE_LOGGING_ENABLED`, `FILE_LOG_PATH`, `FILE_LOG_ROOT`, `FILE_LOG_ROTATION`, … | off | local file transport (v3) |\n| `BLOB_LOGGING_ENABLED`, `BLOB_*` | off | Blob log transport (v3) |\n| `SQL_LOGGING_ENABLED`, `SQL_LOG_DSN`, `SQL_LOG_TABLE` | off | SQL log transport (v3) |\n| `NOSQL_LOGGING_ENABLED`, `NOSQL_LOG_URI`, `NOSQL_LOG_DATABASE` | off | NoSQL log transport (v3) |\n| `ADX_LOGGING_ENABLED`, `ADX_CLUSTER_URI`, `ADX_DATABASE` | off | ADX log transport (v3) |\n| `EVENTHUBS_LOGGING_ENABLED`, `EVENTHUB_FQNS`, `EVENTHUB_NAME` | off | Event Hubs log transport (v3) |\n| `DATABASE_URL` | — | SQLAlchemy \u002F outbox (v3 `[db]`) |\n| `ACS_CONNECTION_STRING`, `ACS_SENDER_ADDRESS` | — | ACS email (v3 `[email]`) |\n| `NOSQL_URI`, `NOSQL_DATABASE` | — | documentdb client (v3) |\n| `BUILD_VERSION` \u002F `APP_VERSION`, `GIT_SHA`, `POD_NAME`, `POD_NAMESPACE`, `NODE_NAME` | — | AKS build info (v3) |\n| `LEADER_ELECTION_CONFIGMAP` | — | AKS leader election (v3) |\n| `SERVICE_BUS_TRANSPORT_TYPE` | `amqp` | `amqp` or `websocket` (v3) |\n| `API_KEY` | — | `verify_api_key_header` |\n| `GRAPH_WEBHOOK_CLIENT_STATE` | — (required for webhooks) | webhook auth |\n| `DEV_ALERTS_ENABLED`, `DEV_ALERT_RECIPIENTS`, `ALERT_DEDUP_WINDOW_SECONDS`, `ALERT_MAX_PER_HOUR`, `ALERT_ESCALATE_AFTER`, `ALERT_ESCALATE_WINDOW_SECONDS`, `ALERT_CRITICAL_SUBJECT_PREFIX` | see Part 5 | `alerts` dispatcher |\n| `HEARTBEAT_INTERVAL_SECONDS` \u002F `WATCHDOG_*` | see Part 5 | heartbeat |\n| `AI_TPM_LIMIT[_\u003CDEPLOYMENT>]`, `AI_COST_ALERT_HOURLY_DOLLARS`, `AI_COST_ALERT_DAILY_DOLLARS`, `AI_HIGH_USAGE_TOKENS_HOURLY` | — | `openai` tracker |\n| `AZURE_BOOTSTRAP_ALLOW_RESET` | off | **test-only** (see 9.2) |\n\n### 9.2 Testing note\n\nSubpackages with global state (counters, latency histograms, alert dispatcher,\ntransports, webhook dedup, …) expose `reset_state()` \u002F `_reset_*` helpers **gated by\n`AZURE_BOOTSTRAP_ALLOW_RESET=1`**. The test suite sets it once in `test\u002Fconftest.py`;\n**production code must never set it.** For local\u002Fdev runs without Azure, set\n`USE_MOCK_BOOTSTRAP=true` to make `ensure_bootstrap()` a no-op and the health\u002Fidentity\nprobes return `{\"status\":\"ok\",\"mock\":true}`.\n\n### 9.3 Troubleshooting\n\n| Symptom | Cause \u002F fix |\n|---|---|\n| Sumo transport silently does nothing | `SUMO_LOGIC_COLLECTOR_URL` unset, or `[sumologic]` extra (`requests`) not installed → `make_sumo_logic_handler()` returns `None` by design. |\n| v3 transport silently does nothing | Required env vars unset or pip extra missing — factories return `None` (soft no-op); check `list_transports()`. |\n| `ImportError` from `get_db` \u002F `drain_outbox` | Install the `[db]` extra (`sqlalchemy`, `alembic`). |\n| `ImportError` from `request_with_retry` | Install the `[http]` extra (`requests`). |\n| App Insights never \"upgrades\" | The connection string wasn't present in env at phase 2 and isn't in App Config either; verify `APPLICATIONINSIGHTS_CONNECTION_STRING`. |\n| `ImportError` from `install_graph_webhook_route` \u002F `fastapi_rate_limit` | Install the `fastapi` extra. |\n| DEBUG logs missing despite `LOG_LEVEL=DEBUG` | Also set `DEBUG_LOGGING_ENABLED=true` (the second gate). |\n| `LoggingExtraConflictError` | An `extra={}` key collides with a reserved `LogRecord` attribute (e.g. `name`, `msg`, `args`) — rename it. |\n| `ConfigurationError` from webhook | `GRAPH_WEBHOOK_CLIENT_STATE` is unset; the endpoint refuses all entries (`401`). |\n\n### 9.4 Further reading\n\n- `README.md` — overview + extras matrix\n- `docs\u002FUSAGE.md` — complete usage guide (Python + TypeScript)\n- `examples\u002FREADME.md` — numbered reading order (01 → 46 + e2e_*)\n- `CHANGELOG.md` — release-by-release surface\n- `MIGRATING-FROM-V1.md` — v1 → v2 adoption\n- `MIGRATING-TO-V3.md` — v4.0.0 opt-in features (additive, no breaking changes)\n",{"name":5,"description":7},"develop","ae32736a1aabddabca5d2c96d665aa0ebc7d8700","src\u002Fvibey_tools\u002Fskills\u002Fplugins\u002Fvibey-bootstrap\u002Fskills\u002Fvibey-bootstrap-typescript",3,"https:\u002F\u002Fgithub.com\u002Fthe-vibey-project\u002Fvibey","https:\u002F\u002Fthe-vibey-project.github.io\u002Fvibey\u002F","https:\u002F\u002Fgithub.com\u002Fthe-vibey-project","https:\u002F\u002Fvibewithadam.matthewsteinberger.com","freedom for software engineers","2026-11-15 05:47:42",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add the-vibey-project\u002Fvibey --skill vibey-bootstrap-typescript",{"tool":40,"command":41},"bunx","bunx skills add the-vibey-project\u002Fvibey --skill vibey-bootstrap-typescript",{"tool":43,"command":44},"pnpm","pnpm dlx skills add the-vibey-project\u002Fvibey --skill vibey-bootstrap-typescript","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fthe-vibey-project\u002Fvibey\u002Fblob\u002Fdevelop\u002Fsrc\u002Fvibey_tools\u002Fskills\u002Fplugins\u002Fvibey-bootstrap\u002Fskills\u002Fvibey-bootstrap-typescript\u002FSKILL.md",true,[],[49,56,63,70,77,84],{"skillNo":50,"name":51,"nameZh":6,"description":52,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":53,"categories":54,"keywords":55,"publishedAt":19},"01M7AT1FQJAE1FQYAMDTF490Y4","white-paper-writing","Use when writing white papers, technical reports, policy documents, thought leadership pieces, or any long-form authoritative document. Triggers on requests to write, structure, outline, or review white papers, technical reports, position papers, policy briefs, or evidence-driven arguments. Also use for B2B content marketing strategy, technical documentation requiring authority, academic-style reports, or any document that must educate while persuading. Use when someone asks \"how should I structure this\" for a long-form document.","https:\u002F\u002Fgithub.com\u002Fthe-vibey-project\u002Fvibey\u002Fblob\u002Fdevelop\u002Fsrc\u002Fvibey_tools\u002Fskills\u002Fplugins\u002Fwriting-craft\u002Fskills\u002Fwhite-paper-writing\u002FSKILL.md",[],[],{"skillNo":57,"name":58,"nameZh":6,"description":59,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":60,"categories":61,"keywords":62,"publishedAt":19},"01M7AT16BJRJJKK2MASXRZS76G","prose-technical-mechanics","Use when editing or writing prose at a technical\u002Fmechanical level: choosing between Anglo-Saxon and Latinate diction, placing information in topic vs stress positions, writing periodic vs cumulative sentences, handling sentence rhythm, punctuation as logic, transitions, paragraph structure, or phonesthetics. Use when someone wants to understand WHY prose works or doesn't, not just surface-level style advice. Triggers on word choice, sentence structure, emphasis, rhythm, diction, or any deep writing mechanics question.","https:\u002F\u002Fgithub.com\u002Fthe-vibey-project\u002Fvibey\u002Fblob\u002Fdevelop\u002Fsrc\u002Fvibey_tools\u002Fskills\u002Fplugins\u002Fwriting-craft\u002Fskills\u002Fprose-technical-mechanics\u002FSKILL.md",[],[],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":19},"01M7AT0W9HT0ZZ9Y287NW99MR3","prose-mechanics","Use when writing, editing, or analyzing prose style; when trying to avoid generic AI-sounding writing; when applying specific prose styles such as journalistic, academic, narrative, KJV biblical, Hemingway plain, Latinate\u002FJamesian, Orwellian, Augustan, Victorian, Early Modern (Bacon, Browne, Milton), or free indirect discourse; or when coaching someone on writing voice and mechanics. Triggers on any request to improve, analyze, or write in a specific prose style, to fix \"AI-sounding\" writing, to make prose more vivid or concrete, to vary sentence rhythm, or to understand how a particular writer achieves their effects.","https:\u002F\u002Fgithub.com\u002Fthe-vibey-project\u002Fvibey\u002Fblob\u002Fdevelop\u002Fsrc\u002Fvibey_tools\u002Fskills\u002Fplugins\u002Fwriting-craft\u002Fskills\u002Fprose-mechanics\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":19},"01M7AT0KR635JX66X2X6F3E2CP","narrative-structure","Use when structuring stories, pitches, presentations, white papers, or any persuasive narrative; analyzing the hero's journey in fiction or non-fiction; applying StoryBrand for business communication; designing narrative arcs for thought leadership; or understanding Vogler, Snyder, Propp, or Campbell frameworks. Triggers on any narrative structure, storytelling, pitch structure, StoryBrand, hero's journey, three-act structure, Freytag, Save the Cat, narrative arc, or \"how should I structure this story\u002Fpitch\u002Fpresentation\" request.","https:\u002F\u002Fgithub.com\u002Fthe-vibey-project\u002Fvibey\u002Fblob\u002Fdevelop\u002Fsrc\u002Fvibey_tools\u002Fskills\u002Fplugins\u002Fwriting-craft\u002Fskills\u002Fnarrative-structure\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":19},"01M7AT0AKGW09NKKZDYBT8VRDE","legal-brief-writing","Use when writing legal briefs, motions, or any court filing; when analyzing judicial cognition and persuasion; when applying elite brief-writing techniques from Roberts, Clement, Kagan, Garner; or when structuring legal arguments for maximum persuasion. Also use for autistic\u002Fneurodivergent advocates who need to understand how their natural communication style maps to elite legal advocacy. Triggers on any legal writing, brief drafting, motion preparation, or legal argument structuring request.","https:\u002F\u002Fgithub.com\u002Fthe-vibey-project\u002Fvibey\u002Fblob\u002Fdevelop\u002Fsrc\u002Fvibey_tools\u002Fskills\u002Fplugins\u002Fwriting-craft\u002Fskills\u002Flegal-brief-writing\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":19},"01M7AT00VWPS4Q8B5VEMXX9NQT","journal-publishability-criteria","Use whenever a research paper, article or preprint is being written, revised, reviewed or published, and specifically before every publication of docs\u002Fpaper.md. Covers what legitimate journals actually gate on, in order of gating — the editor's desk screen (scope, novelty, package problems), what reviewers judge (methodological soundness, claims the evidence can carry, statistical and qualitative reporting), EQUATOR reporting guidelines, the ICMJE authorship criteria, COPE's view of text recycling, the near-universal generative-AI policy (no AI author, disclosure, author responsibility), TOP 2025 transparency standards, how to verify a journal is legitimate, submitting without an institution, and a pre-submission checklist. Triggers on requests to evaluate, review, prepare or submit a paper, to judge publishability, to write a declarations or data-availability section, to disclose AI use, or to check a journal.","https:\u002F\u002Fgithub.com\u002Fthe-vibey-project\u002Fvibey\u002Fblob\u002Fdevelop\u002Fsrc\u002Fvibey_tools\u002Fskills\u002Fplugins\u002Fwriting-craft\u002Fskills\u002Fjournal-publishability-criteria\u002FSKILL.md",[],[]]