[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6F8E4454APSWW87YNPBS6ZR":3,"skill-same:01M6F8E4454APSWW87YNPBS6ZR":75},{"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":43,"linkOnly":44,"markdownContent":45,"markdownBody":46,"frontMatter":47,"refName":52,"commitSha":53,"skillDirectory":54,"forksCount":55,"repositoryHtmlUrl":56,"repositoryHomepageUrl":6,"ownerHtmlUrl":57,"ownerBlogUrl":58,"ownerDescription":59,"updatedAt":60,"install":61,"resources":74},"01M6F8E4454APSWW87YNPBS6ZR","openevidence-webhooks-events",null,"Configure OpenEvidence webhooks for async DeepConsult completion and events.\nUse when implementing webhook handlers, configuring async notifications,\nor setting up event-driven clinical AI workflows.\nTrigger with phrases like \"openevidence webhook\", \"openevidence events\",\n\"deepconsult callback\", \"openevidence notifications\".","Dicklesworthstone\u002Fpi_agent_rust","Dicklesworthstone","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F35050222?v=4","01M6CG26AR942CSVMN1M5E3DSE","Jeff Emanuel","01M6CG26EPP71PSHW1VDS71121",1981,"MIT","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Fplugins-community\u002Fplugins\u002Fsaas-packs\u002Fopenevidence-pack\u002Fskills\u002Fopenevidence-webhooks-events\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42],"openevidence webhooks events","webhooks","events","io","when","for","implementing","callback","with","event","event-driven","trigger","driven","workflows","webhook","clinical","async","up","use","edit","write","read","configure","notifications","2026-11-10 10:12:30",false,"---\nname: openevidence-webhooks-events\ndescription: |\n  Configure OpenEvidence webhooks for async DeepConsult completion and events.\n  Use when implementing webhook handlers, configuring async notifications,\n  or setting up event-driven clinical AI workflows.\n  Trigger with phrases like \"openevidence webhook\", \"openevidence events\",\n  \"deepconsult callback\", \"openevidence notifications\".\nallowed-tools: Read, Write, Edit\nversion: 1.0.0\nlicense: MIT\nauthor: Jeremy Longshore \u003Cjeremy@intentsolutions.io>\n---\n\n# OpenEvidence Webhooks & Events\n\n## Overview\nConfigure webhooks for asynchronous OpenEvidence operations like DeepConsult completion notifications.\n\n## Prerequisites\n- OpenEvidence Enterprise account with webhook access\n- HTTPS endpoint for receiving webhooks\n- Webhook secret for signature verification\n- Understanding of async processing patterns\n\n## Webhook Events\n\n| Event Type | Description | Payload |\n|------------|-------------|---------|\n| `deepconsult.started` | DeepConsult processing began | `consultId`, `estimatedTime` |\n| `deepconsult.progress` | Processing progress update | `consultId`, `progress` (0-100) |\n| `deepconsult.completed` | DeepConsult finished successfully | `consultId`, `report` |\n| `deepconsult.failed` | DeepConsult processing failed | `consultId`, `error` |\n| `rate_limit.warning` | Approaching rate limit | `remaining`, `limit`, `resetAt` |\n| `api_key.expiring` | API key expiration warning | `keyId`, `expiresAt` |\n\n## Instructions\n\n### Step 1: Configure Webhook Endpoint\n```typescript\n\u002F\u002F src\u002Fwebhooks\u002Fopenevidence-webhook.ts\nimport { Router, Request, Response } from 'express';\nimport crypto from 'crypto';\n\nconst router = Router();\n\n\u002F\u002F Webhook secret from OpenEvidence dashboard\nconst WEBHOOK_SECRET = process.env.OPENEVIDENCE_WEBHOOK_SECRET!;\n\ninterface WebhookPayload {\n  id: string;\n  event: string;\n  timestamp: string;\n  data: any;\n}\n\n\u002F\u002F Signature verification middleware\nfunction verifySignature(req: Request, res: Response, next: Function) {\n  const signature = req.headers['x-openevidence-signature'] as string;\n\n  if (!signature) {\n    return res.status(401).json({ error: 'Missing signature' });\n  }\n\n  \u002F\u002F Parse signature: t=timestamp,v1=signature\n  const parts = signature.split(',').reduce((acc, part) => {\n    const [key, value] = part.split('=');\n    acc[key] = value;\n    return acc;\n  }, {} as Record\u003Cstring, string>);\n\n  const timestamp = parseInt(parts['t']);\n  const providedSig = parts['v1'];\n\n  \u002F\u002F Reject if timestamp too old (5 minute tolerance)\n  const now = Math.floor(Date.now() \u002F 1000);\n  if (Math.abs(now - timestamp) > 300) {\n    return res.status(401).json({ error: 'Timestamp too old' });\n  }\n\n  \u002F\u002F Compute expected signature\n  const payload = typeof req.body === 'string' ? req.body : JSON.stringify(req.body);\n  const signedPayload = `${timestamp}.${payload}`;\n  const expectedSig = crypto\n    .createHmac('sha256', WEBHOOK_SECRET)\n    .update(signedPayload)\n    .digest('hex');\n\n  \u002F\u002F Timing-safe comparison\n  try {\n    const valid = crypto.timingSafeEqual(\n      Buffer.from(providedSig),\n      Buffer.from(expectedSig)\n    );\n    if (!valid) throw new Error('Invalid signature');\n  } catch {\n    return res.status(401).json({ error: 'Invalid signature' });\n  }\n\n  next();\n}\n\nrouter.post(\n  '\u002Fwebhooks\u002Fopenevidence',\n  verifySignature,\n  async (req: Request, res: Response) => {\n    const payload: WebhookPayload = req.body;\n\n    console.log(`[Webhook] Received event: ${payload.event}`);\n\n    try {\n      await handleWebhookEvent(payload);\n      res.status(200).json({ received: true });\n    } catch (error: any) {\n      console.error(`[Webhook] Processing failed:`, error);\n      \u002F\u002F Return 200 to prevent retries for processing errors\n      \u002F\u002F OpenEvidence will retry on 4xx\u002F5xx\n      res.status(200).json({ received: true, error: error.message });\n    }\n  }\n);\n\nexport default router;\n```\n\n### Step 2: Event Handlers\n```typescript\n\u002F\u002F src\u002Fwebhooks\u002Fevent-handlers.ts\nimport { WebhookPayload } from '.\u002Ftypes';\nimport { notificationService } from '..\u002Fservices\u002Fnotifications';\nimport { db } from '..\u002Fdb';\n\nexport async function handleWebhookEvent(payload: WebhookPayload): Promise\u003Cvoid> {\n  switch (payload.event) {\n    case 'deepconsult.started':\n      await handleDeepConsultStarted(payload);\n      break;\n    case 'deepconsult.progress':\n      await handleDeepConsultProgress(payload);\n      break;\n    case 'deepconsult.completed':\n      await handleDeepConsultCompleted(payload);\n      break;\n    case 'deepconsult.failed':\n      await handleDeepConsultFailed(payload);\n      break;\n    case 'rate_limit.warning':\n      await handleRateLimitWarning(payload);\n      break;\n    case 'api_key.expiring':\n      await handleApiKeyExpiring(payload);\n      break;\n    default:\n      console.log(`[Webhook] Unknown event type: ${payload.event}`);\n  }\n}\n\nasync function handleDeepConsultStarted(payload: WebhookPayload): Promise\u003Cvoid> {\n  const { consultId, estimatedTime } = payload.data;\n\n  await db.deepConsults.update({\n    where: { consultId },\n    data: {\n      status: 'processing',\n      estimatedCompletionAt: new Date(Date.now() + estimatedTime * 1000),\n    },\n  });\n}\n\nasync function handleDeepConsultProgress(payload: WebhookPayload): Promise\u003Cvoid> {\n  const { consultId, progress, currentPhase } = payload.data;\n\n  await db.deepConsults.update({\n    where: { consultId },\n    data: {\n      progress,\n      currentPhase,\n    },\n  });\n\n  \u002F\u002F Notify user if subscribed to progress updates\n  const consult = await db.deepConsults.findUnique({ where: { consultId } });\n  if (consult?.notifyOnProgress) {\n    await notificationService.sendProgress(consult.userId, consultId, progress);\n  }\n}\n\nasync function handleDeepConsultCompleted(payload: WebhookPayload): Promise\u003Cvoid> {\n  const { consultId, report } = payload.data;\n\n  \u002F\u002F Store the report\n  await db.deepConsults.update({\n    where: { consultId },\n    data: {\n      status: 'completed',\n      report,\n      completedAt: new Date(),\n    },\n  });\n\n  \u002F\u002F Get user info\n  const consult = await db.deepConsults.findUnique({\n    where: { consultId },\n    include: { user: true },\n  });\n\n  if (consult) {\n    \u002F\u002F Send notification\n    await notificationService.send({\n      userId: consult.userId,\n      type: 'deepconsult_ready',\n      title: 'DeepConsult Research Complete',\n      body: `Your research synthesis for \"${consult.question.substring(0, 50)}...\" is ready.`,\n      data: { consultId },\n    });\n\n    \u002F\u002F Send email if enabled\n    if (consult.user.emailNotifications) {\n      await notificationService.sendEmail({\n        to: consult.user.email,\n        subject: 'Your OpenEvidence DeepConsult is Ready',\n        template: 'deepconsult-complete',\n        data: {\n          userName: consult.user.name,\n          consultId,\n          summary: report.executiveSummary.substring(0, 200),\n        },\n      });\n    }\n  }\n}\n\nasync function handleDeepConsultFailed(payload: WebhookPayload): Promise\u003Cvoid> {\n  const { consultId, error, retryable } = payload.data;\n\n  await db.deepConsults.update({\n    where: { consultId },\n    data: {\n      status: 'failed',\n      error,\n      retryable,\n    },\n  });\n\n  \u002F\u002F Alert operations team\n  await notificationService.alertOps({\n    severity: 'warning',\n    service: 'openevidence',\n    message: `DeepConsult ${consultId} failed: ${error}`,\n    retryable,\n  });\n}\n\nasync function handleRateLimitWarning(payload: WebhookPayload): Promise\u003Cvoid> {\n  const { remaining, limit, resetAt } = payload.data;\n\n  console.warn(`[RateLimit] Warning: ${remaining}\u002F${limit} remaining, resets at ${resetAt}`);\n\n  \u002F\u002F Alert if critical\n  if (remaining \u003C limit * 0.1) {\n    await notificationService.alertOps({\n      severity: 'critical',\n      service: 'openevidence',\n      message: `Rate limit critical: ${remaining}\u002F${limit} remaining`,\n    });\n  }\n}\n\nasync function handleApiKeyExpiring(payload: WebhookPayload): Promise\u003Cvoid> {\n  const { keyId, expiresAt } = payload.data;\n\n  await notificationService.alertOps({\n    severity: 'warning',\n    service: 'openevidence',\n    message: `API key ${keyId} expires at ${expiresAt}`,\n    action: 'Rotate key before expiration',\n  });\n}\n```\n\n### Step 3: Webhook Registration\n```typescript\n\u002F\u002F src\u002Fservices\u002Fwebhook-registration.ts\nimport { OpenEvidenceClient } from '@openevidence\u002Fsdk';\n\nexport async function registerWebhooks(): Promise\u003Cvoid> {\n  const client = new OpenEvidenceClient({\n    apiKey: process.env.OPENEVIDENCE_API_KEY!,\n    orgId: process.env.OPENEVIDENCE_ORG_ID!,\n  });\n\n  const webhookUrl = process.env.WEBHOOK_BASE_URL + '\u002Fwebhooks\u002Fopenevidence';\n\n  await client.webhooks.register({\n    url: webhookUrl,\n    events: [\n      'deepconsult.started',\n      'deepconsult.progress',\n      'deepconsult.completed',\n      'deepconsult.failed',\n      'rate_limit.warning',\n      'api_key.expiring',\n    ],\n    secret: process.env.OPENEVIDENCE_WEBHOOK_SECRET!,\n  });\n\n  console.log(`[Webhooks] Registered: ${webhookUrl}`);\n}\n\n\u002F\u002F Call during app startup\nregisterWebhooks().catch(console.error);\n```\n\n### Step 4: Idempotency Handling\n```typescript\n\u002F\u002F src\u002Fwebhooks\u002Fidempotency.ts\nimport { db } from '..\u002Fdb';\n\nconst IDEMPOTENCY_TTL = 24 * 60 * 60 * 1000; \u002F\u002F 24 hours\n\nexport async function isProcessed(webhookId: string): Promise\u003Cboolean> {\n  const existing = await db.processedWebhooks.findUnique({\n    where: { id: webhookId },\n  });\n\n  return !!existing;\n}\n\nexport async function markProcessed(webhookId: string): Promise\u003Cvoid> {\n  await db.processedWebhooks.create({\n    data: {\n      id: webhookId,\n      processedAt: new Date(),\n      expiresAt: new Date(Date.now() + IDEMPOTENCY_TTL),\n    },\n  });\n}\n\n\u002F\u002F Cleanup job\nexport async function cleanupExpiredWebhooks(): Promise\u003Cvoid> {\n  await db.processedWebhooks.deleteMany({\n    where: {\n      expiresAt: { lt: new Date() },\n    },\n  });\n}\n\n\u002F\u002F Usage in webhook handler\nasync function handleWebhookWithIdempotency(payload: WebhookPayload): Promise\u003Cvoid> {\n  if (await isProcessed(payload.id)) {\n    console.log(`[Webhook] Already processed: ${payload.id}`);\n    return;\n  }\n\n  await handleWebhookEvent(payload);\n  await markProcessed(payload.id);\n}\n```\n\n### Step 5: Webhook Testing\n```typescript\n\u002F\u002F tests\u002Fwebhooks\u002Fopenevidence-webhook.test.ts\nimport { describe, it, expect, vi, beforeEach } from 'vitest';\nimport request from 'supertest';\nimport crypto from 'crypto';\nimport app from '..\u002F..\u002Fsrc\u002Fapp';\n\nconst WEBHOOK_SECRET = 'test-secret';\nprocess.env.OPENEVIDENCE_WEBHOOK_SECRET = WEBHOOK_SECRET;\n\nfunction generateSignature(payload: object, timestamp: number): string {\n  const payloadString = JSON.stringify(payload);\n  const signedPayload = `${timestamp}.${payloadString}`;\n  const signature = crypto\n    .createHmac('sha256', WEBHOOK_SECRET)\n    .update(signedPayload)\n    .digest('hex');\n  return `t=${timestamp},v1=${signature}`;\n}\n\ndescribe('OpenEvidence Webhooks', () => {\n  it('should accept valid webhook', async () => {\n    const timestamp = Math.floor(Date.now() \u002F 1000);\n    const payload = {\n      id: 'webhook-123',\n      event: 'deepconsult.completed',\n      timestamp: new Date().toISOString(),\n      data: {\n        consultId: 'consult-456',\n        report: { executiveSummary: 'Test report' },\n      },\n    };\n\n    const response = await request(app)\n      .post('\u002Fwebhooks\u002Fopenevidence')\n      .set('x-openevidence-signature', generateSignature(payload, timestamp))\n      .send(payload);\n\n    expect(response.status).toBe(200);\n    expect(response.body.received).toBe(true);\n  });\n\n  it('should reject webhook with invalid signature', async () => {\n    const payload = { event: 'test' };\n\n    const response = await request(app)\n      .post('\u002Fwebhooks\u002Fopenevidence')\n      .set('x-openevidence-signature', 't=123,v1=invalid')\n      .send(payload);\n\n    expect(response.status).toBe(401);\n  });\n\n  it('should reject webhook with old timestamp', async () => {\n    const oldTimestamp = Math.floor(Date.now() \u002F 1000) - 600; \u002F\u002F 10 minutes ago\n    const payload = { event: 'test' };\n\n    const response = await request(app)\n      .post('\u002Fwebhooks\u002Fopenevidence')\n      .set('x-openevidence-signature', generateSignature(payload, oldTimestamp))\n      .send(payload);\n\n    expect(response.status).toBe(401);\n  });\n});\n```\n\n## Output\n- Secure webhook endpoint with signature verification\n- Event handlers for all OpenEvidence events\n- Idempotency protection\n- Notification integration\n- Comprehensive test coverage\n\n## Webhook Security Checklist\n- [ ] HTTPS endpoint only\n- [ ] Signature verification enabled\n- [ ] Timestamp validation (replay protection)\n- [ ] Idempotency handling\n- [ ] Secret rotation procedure documented\n\n## Error Handling\n| Webhook Issue | Detection | Resolution |\n|---------------|-----------|------------|\n| Invalid signature | 401 response | Check secret configuration |\n| Missing events | No handler called | Verify webhook registration |\n| Duplicate processing | Multiple notifications | Enable idempotency |\n| Timeout | Webhook fails | Process async, return 200 quickly |\n\n## Resources\n- [OpenEvidence API Docs](https:\u002F\u002Fdocs.openevidence.com\u002F)\n- [Webhook Security Best Practices](https:\u002F\u002Fwebhooks.fyi\u002F)\n\n## Next Steps\nFor performance optimization, see `openevidence-performance-tuning`.\n","# OpenEvidence Webhooks & Events\n\n## Overview\nConfigure webhooks for asynchronous OpenEvidence operations like DeepConsult completion notifications.\n\n## Prerequisites\n- OpenEvidence Enterprise account with webhook access\n- HTTPS endpoint for receiving webhooks\n- Webhook secret for signature verification\n- Understanding of async processing patterns\n\n## Webhook Events\n\n| Event Type | Description | Payload |\n|------------|-------------|---------|\n| `deepconsult.started` | DeepConsult processing began | `consultId`, `estimatedTime` |\n| `deepconsult.progress` | Processing progress update | `consultId`, `progress` (0-100) |\n| `deepconsult.completed` | DeepConsult finished successfully | `consultId`, `report` |\n| `deepconsult.failed` | DeepConsult processing failed | `consultId`, `error` |\n| `rate_limit.warning` | Approaching rate limit | `remaining`, `limit`, `resetAt` |\n| `api_key.expiring` | API key expiration warning | `keyId`, `expiresAt` |\n\n## Instructions\n\n### Step 1: Configure Webhook Endpoint\n```typescript\n\u002F\u002F src\u002Fwebhooks\u002Fopenevidence-webhook.ts\nimport { Router, Request, Response } from 'express';\nimport crypto from 'crypto';\n\nconst router = Router();\n\n\u002F\u002F Webhook secret from OpenEvidence dashboard\nconst WEBHOOK_SECRET = process.env.OPENEVIDENCE_WEBHOOK_SECRET!;\n\ninterface WebhookPayload {\n  id: string;\n  event: string;\n  timestamp: string;\n  data: any;\n}\n\n\u002F\u002F Signature verification middleware\nfunction verifySignature(req: Request, res: Response, next: Function) {\n  const signature = req.headers['x-openevidence-signature'] as string;\n\n  if (!signature) {\n    return res.status(401).json({ error: 'Missing signature' });\n  }\n\n  \u002F\u002F Parse signature: t=timestamp,v1=signature\n  const parts = signature.split(',').reduce((acc, part) => {\n    const [key, value] = part.split('=');\n    acc[key] = value;\n    return acc;\n  }, {} as Record\u003Cstring, string>);\n\n  const timestamp = parseInt(parts['t']);\n  const providedSig = parts['v1'];\n\n  \u002F\u002F Reject if timestamp too old (5 minute tolerance)\n  const now = Math.floor(Date.now() \u002F 1000);\n  if (Math.abs(now - timestamp) > 300) {\n    return res.status(401).json({ error: 'Timestamp too old' });\n  }\n\n  \u002F\u002F Compute expected signature\n  const payload = typeof req.body === 'string' ? req.body : JSON.stringify(req.body);\n  const signedPayload = `${timestamp}.${payload}`;\n  const expectedSig = crypto\n    .createHmac('sha256', WEBHOOK_SECRET)\n    .update(signedPayload)\n    .digest('hex');\n\n  \u002F\u002F Timing-safe comparison\n  try {\n    const valid = crypto.timingSafeEqual(\n      Buffer.from(providedSig),\n      Buffer.from(expectedSig)\n    );\n    if (!valid) throw new Error('Invalid signature');\n  } catch {\n    return res.status(401).json({ error: 'Invalid signature' });\n  }\n\n  next();\n}\n\nrouter.post(\n  '\u002Fwebhooks\u002Fopenevidence',\n  verifySignature,\n  async (req: Request, res: Response) => {\n    const payload: WebhookPayload = req.body;\n\n    console.log(`[Webhook] Received event: ${payload.event}`);\n\n    try {\n      await handleWebhookEvent(payload);\n      res.status(200).json({ received: true });\n    } catch (error: any) {\n      console.error(`[Webhook] Processing failed:`, error);\n      \u002F\u002F Return 200 to prevent retries for processing errors\n      \u002F\u002F OpenEvidence will retry on 4xx\u002F5xx\n      res.status(200).json({ received: true, error: error.message });\n    }\n  }\n);\n\nexport default router;\n```\n\n### Step 2: Event Handlers\n```typescript\n\u002F\u002F src\u002Fwebhooks\u002Fevent-handlers.ts\nimport { WebhookPayload } from '.\u002Ftypes';\nimport { notificationService } from '..\u002Fservices\u002Fnotifications';\nimport { db } from '..\u002Fdb';\n\nexport async function handleWebhookEvent(payload: WebhookPayload): Promise\u003Cvoid> {\n  switch (payload.event) {\n    case 'deepconsult.started':\n      await handleDeepConsultStarted(payload);\n      break;\n    case 'deepconsult.progress':\n      await handleDeepConsultProgress(payload);\n      break;\n    case 'deepconsult.completed':\n      await handleDeepConsultCompleted(payload);\n      break;\n    case 'deepconsult.failed':\n      await handleDeepConsultFailed(payload);\n      break;\n    case 'rate_limit.warning':\n      await handleRateLimitWarning(payload);\n      break;\n    case 'api_key.expiring':\n      await handleApiKeyExpiring(payload);\n      break;\n    default:\n      console.log(`[Webhook] Unknown event type: ${payload.event}`);\n  }\n}\n\nasync function handleDeepConsultStarted(payload: WebhookPayload): Promise\u003Cvoid> {\n  const { consultId, estimatedTime } = payload.data;\n\n  await db.deepConsults.update({\n    where: { consultId },\n    data: {\n      status: 'processing',\n      estimatedCompletionAt: new Date(Date.now() + estimatedTime * 1000),\n    },\n  });\n}\n\nasync function handleDeepConsultProgress(payload: WebhookPayload): Promise\u003Cvoid> {\n  const { consultId, progress, currentPhase } = payload.data;\n\n  await db.deepConsults.update({\n    where: { consultId },\n    data: {\n      progress,\n      currentPhase,\n    },\n  });\n\n  \u002F\u002F Notify user if subscribed to progress updates\n  const consult = await db.deepConsults.findUnique({ where: { consultId } });\n  if (consult?.notifyOnProgress) {\n    await notificationService.sendProgress(consult.userId, consultId, progress);\n  }\n}\n\nasync function handleDeepConsultCompleted(payload: WebhookPayload): Promise\u003Cvoid> {\n  const { consultId, report } = payload.data;\n\n  \u002F\u002F Store the report\n  await db.deepConsults.update({\n    where: { consultId },\n    data: {\n      status: 'completed',\n      report,\n      completedAt: new Date(),\n    },\n  });\n\n  \u002F\u002F Get user info\n  const consult = await db.deepConsults.findUnique({\n    where: { consultId },\n    include: { user: true },\n  });\n\n  if (consult) {\n    \u002F\u002F Send notification\n    await notificationService.send({\n      userId: consult.userId,\n      type: 'deepconsult_ready',\n      title: 'DeepConsult Research Complete',\n      body: `Your research synthesis for \"${consult.question.substring(0, 50)}...\" is ready.`,\n      data: { consultId },\n    });\n\n    \u002F\u002F Send email if enabled\n    if (consult.user.emailNotifications) {\n      await notificationService.sendEmail({\n        to: consult.user.email,\n        subject: 'Your OpenEvidence DeepConsult is Ready',\n        template: 'deepconsult-complete',\n        data: {\n          userName: consult.user.name,\n          consultId,\n          summary: report.executiveSummary.substring(0, 200),\n        },\n      });\n    }\n  }\n}\n\nasync function handleDeepConsultFailed(payload: WebhookPayload): Promise\u003Cvoid> {\n  const { consultId, error, retryable } = payload.data;\n\n  await db.deepConsults.update({\n    where: { consultId },\n    data: {\n      status: 'failed',\n      error,\n      retryable,\n    },\n  });\n\n  \u002F\u002F Alert operations team\n  await notificationService.alertOps({\n    severity: 'warning',\n    service: 'openevidence',\n    message: `DeepConsult ${consultId} failed: ${error}`,\n    retryable,\n  });\n}\n\nasync function handleRateLimitWarning(payload: WebhookPayload): Promise\u003Cvoid> {\n  const { remaining, limit, resetAt } = payload.data;\n\n  console.warn(`[RateLimit] Warning: ${remaining}\u002F${limit} remaining, resets at ${resetAt}`);\n\n  \u002F\u002F Alert if critical\n  if (remaining \u003C limit * 0.1) {\n    await notificationService.alertOps({\n      severity: 'critical',\n      service: 'openevidence',\n      message: `Rate limit critical: ${remaining}\u002F${limit} remaining`,\n    });\n  }\n}\n\nasync function handleApiKeyExpiring(payload: WebhookPayload): Promise\u003Cvoid> {\n  const { keyId, expiresAt } = payload.data;\n\n  await notificationService.alertOps({\n    severity: 'warning',\n    service: 'openevidence',\n    message: `API key ${keyId} expires at ${expiresAt}`,\n    action: 'Rotate key before expiration',\n  });\n}\n```\n\n### Step 3: Webhook Registration\n```typescript\n\u002F\u002F src\u002Fservices\u002Fwebhook-registration.ts\nimport { OpenEvidenceClient } from '@openevidence\u002Fsdk';\n\nexport async function registerWebhooks(): Promise\u003Cvoid> {\n  const client = new OpenEvidenceClient({\n    apiKey: process.env.OPENEVIDENCE_API_KEY!,\n    orgId: process.env.OPENEVIDENCE_ORG_ID!,\n  });\n\n  const webhookUrl = process.env.WEBHOOK_BASE_URL + '\u002Fwebhooks\u002Fopenevidence';\n\n  await client.webhooks.register({\n    url: webhookUrl,\n    events: [\n      'deepconsult.started',\n      'deepconsult.progress',\n      'deepconsult.completed',\n      'deepconsult.failed',\n      'rate_limit.warning',\n      'api_key.expiring',\n    ],\n    secret: process.env.OPENEVIDENCE_WEBHOOK_SECRET!,\n  });\n\n  console.log(`[Webhooks] Registered: ${webhookUrl}`);\n}\n\n\u002F\u002F Call during app startup\nregisterWebhooks().catch(console.error);\n```\n\n### Step 4: Idempotency Handling\n```typescript\n\u002F\u002F src\u002Fwebhooks\u002Fidempotency.ts\nimport { db } from '..\u002Fdb';\n\nconst IDEMPOTENCY_TTL = 24 * 60 * 60 * 1000; \u002F\u002F 24 hours\n\nexport async function isProcessed(webhookId: string): Promise\u003Cboolean> {\n  const existing = await db.processedWebhooks.findUnique({\n    where: { id: webhookId },\n  });\n\n  return !!existing;\n}\n\nexport async function markProcessed(webhookId: string): Promise\u003Cvoid> {\n  await db.processedWebhooks.create({\n    data: {\n      id: webhookId,\n      processedAt: new Date(),\n      expiresAt: new Date(Date.now() + IDEMPOTENCY_TTL),\n    },\n  });\n}\n\n\u002F\u002F Cleanup job\nexport async function cleanupExpiredWebhooks(): Promise\u003Cvoid> {\n  await db.processedWebhooks.deleteMany({\n    where: {\n      expiresAt: { lt: new Date() },\n    },\n  });\n}\n\n\u002F\u002F Usage in webhook handler\nasync function handleWebhookWithIdempotency(payload: WebhookPayload): Promise\u003Cvoid> {\n  if (await isProcessed(payload.id)) {\n    console.log(`[Webhook] Already processed: ${payload.id}`);\n    return;\n  }\n\n  await handleWebhookEvent(payload);\n  await markProcessed(payload.id);\n}\n```\n\n### Step 5: Webhook Testing\n```typescript\n\u002F\u002F tests\u002Fwebhooks\u002Fopenevidence-webhook.test.ts\nimport { describe, it, expect, vi, beforeEach } from 'vitest';\nimport request from 'supertest';\nimport crypto from 'crypto';\nimport app from '..\u002F..\u002Fsrc\u002Fapp';\n\nconst WEBHOOK_SECRET = 'test-secret';\nprocess.env.OPENEVIDENCE_WEBHOOK_SECRET = WEBHOOK_SECRET;\n\nfunction generateSignature(payload: object, timestamp: number): string {\n  const payloadString = JSON.stringify(payload);\n  const signedPayload = `${timestamp}.${payloadString}`;\n  const signature = crypto\n    .createHmac('sha256', WEBHOOK_SECRET)\n    .update(signedPayload)\n    .digest('hex');\n  return `t=${timestamp},v1=${signature}`;\n}\n\ndescribe('OpenEvidence Webhooks', () => {\n  it('should accept valid webhook', async () => {\n    const timestamp = Math.floor(Date.now() \u002F 1000);\n    const payload = {\n      id: 'webhook-123',\n      event: 'deepconsult.completed',\n      timestamp: new Date().toISOString(),\n      data: {\n        consultId: 'consult-456',\n        report: { executiveSummary: 'Test report' },\n      },\n    };\n\n    const response = await request(app)\n      .post('\u002Fwebhooks\u002Fopenevidence')\n      .set('x-openevidence-signature', generateSignature(payload, timestamp))\n      .send(payload);\n\n    expect(response.status).toBe(200);\n    expect(response.body.received).toBe(true);\n  });\n\n  it('should reject webhook with invalid signature', async () => {\n    const payload = { event: 'test' };\n\n    const response = await request(app)\n      .post('\u002Fwebhooks\u002Fopenevidence')\n      .set('x-openevidence-signature', 't=123,v1=invalid')\n      .send(payload);\n\n    expect(response.status).toBe(401);\n  });\n\n  it('should reject webhook with old timestamp', async () => {\n    const oldTimestamp = Math.floor(Date.now() \u002F 1000) - 600; \u002F\u002F 10 minutes ago\n    const payload = { event: 'test' };\n\n    const response = await request(app)\n      .post('\u002Fwebhooks\u002Fopenevidence')\n      .set('x-openevidence-signature', generateSignature(payload, oldTimestamp))\n      .send(payload);\n\n    expect(response.status).toBe(401);\n  });\n});\n```\n\n## Output\n- Secure webhook endpoint with signature verification\n- Event handlers for all OpenEvidence events\n- Idempotency protection\n- Notification integration\n- Comprehensive test coverage\n\n## Webhook Security Checklist\n- [ ] HTTPS endpoint only\n- [ ] Signature verification enabled\n- [ ] Timestamp validation (replay protection)\n- [ ] Idempotency handling\n- [ ] Secret rotation procedure documented\n\n## Error Handling\n| Webhook Issue | Detection | Resolution |\n|---------------|-----------|------------|\n| Invalid signature | 401 response | Check secret configuration |\n| Missing events | No handler called | Verify webhook registration |\n| Duplicate processing | Multiple notifications | Enable idempotency |\n| Timeout | Webhook fails | Process async, return 200 quickly |\n\n## Resources\n- [OpenEvidence API Docs](https:\u002F\u002Fdocs.openevidence.com\u002F)\n- [Webhook Security Best Practices](https:\u002F\u002Fwebhooks.fyi\u002F)\n\n## Next Steps\nFor performance optimization, see `openevidence-performance-tuning`.\n",{"name":5,"author":48,"license":15,"version":49,"description":50,"allowed-tools":51},"Jeremy Longshore \u003Cjeremy@intentsolutions.io>","1.0.0","Configure OpenEvidence webhooks for async DeepConsult completion and events.\nUse when implementing webhook handlers, configuring async notifications,\nor setting up event-driven clinical AI workflows.\nTrigger with phrases like \"openevidence webhook\", \"openevidence events\",\n\"deepconsult callback\", \"openevidence notifications\".\n","Read, Write, Edit","main","90b50ed0778745a80fd5bfb13b1843d45b9e82f7","tests\u002Fext_conformance\u002Fartifacts\u002Fplugins-community\u002Fplugins\u002Fsaas-packs\u002Fopenevidence-pack\u002Fskills\u002Fopenevidence-webhooks-events",231,"https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust","https:\u002F\u002Fgithub.com\u002FDicklesworthstone","https:\u002F\u002Fwww.jeffreyemanuel.com\u002F","Building in NY","2026-11-12 03:15:57",{"source":8,"skillName":5,"commands":62,"prompt":72,"zipAvailable":73},[63,66,69],{"tool":64,"command":65},"npx","npx skills add Dicklesworthstone\u002Fpi_agent_rust --skill openevidence-webhooks-events",{"tool":67,"command":68},"bunx","bunx skills add Dicklesworthstone\u002Fpi_agent_rust --skill openevidence-webhooks-events",{"tool":70,"command":71},"pnpm","pnpm dlx skills add Dicklesworthstone\u002Fpi_agent_rust --skill openevidence-webhooks-events","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Fplugins-community\u002Fplugins\u002Fsaas-packs\u002Fopenevidence-pack\u002Fskills\u002Fopenevidence-webhooks-events\u002FSKILL.md",true,[],[76,115,139,165,191,213],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":80,"licenseFileUrl":81,"sourceHtmlUrl":82,"categories":83,"keywords":89,"publishedAt":43},"01M6FEGPPK0ZTKCCM0R3E3KS33","web-artifacts-builder","Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn\u002Fui). Use for complex artifacts requiring state management, routing, or shadcn\u002Fui components - not for simple single-file HTML\u002FJSX artifacts.","Apache-2.0","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Futilities\u002Fweb-artifacts-builder\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Futilities\u002Fweb-artifacts-builder\u002FSKILL.md",[84],{"categoryNo":85,"categoryName":86,"taxonomyType":87,"taxonomyTypeDesc":88},"01JBSEEDCAT000000000000009","前端开发","SCENARIO","使用场景",[90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,37,108,109,110,111,112,24,113,114],"web artifacts builder","web","artifacts","artifacts builder","builder","frontend","css","components","react","component","routing","state management","state","shadcn","file","ui","Tools","Tailwind","html","single-file","simple","ui components","multi","jsx","suite",{"skillNo":116,"name":117,"nameZh":6,"description":118,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":80,"licenseFileUrl":119,"sourceHtmlUrl":120,"categories":121,"keywords":126,"publishedAt":43},"01M6FEE9VTK1W4GY21AKREJXRG","webapp-testing","Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fsecurity\u002Fwebapp-testing\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fsecurity\u002Fwebapp-testing\u002FSKILL.md",[122,125],{"categoryNo":123,"categoryName":124,"taxonomyType":87,"taxonomyTypeDesc":88},"01JBSEEDCAT000000000000008","测试与质量",{"categoryNo":85,"categoryName":86,"taxonomyType":87,"taxonomyTypeDesc":88},[127,128,129,95,130,131,91,132,133,134,105,135,136,137,138,27,24],"testing","webapp testing","webapp","screenshots","playwright","debugging","toolkit","browser","logs","applications","behavior","local",{"skillNo":140,"name":141,"nameZh":6,"description":142,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":143,"sourceHtmlUrl":144,"categories":145,"keywords":146,"publishedAt":43},"01M6FE20F7ZTQBFWKF4MPJ2SBX","neuropixels-analysis","Neuropixels neural recording analysis. Load SpikeGLX\u002FOpenEphys data, preprocess, motion correction, Kilosort4 spike sorting, quality metrics, Allen\u002FIBL curation, AI-assisted visual analysis, for Neuropixels 1.0\u002F2.0 extracellular electrophysiology. Use when working with neural recordings, spike sorting, extracellular electrophysiology, or when the user mentions Neuropixels, SpikeGLX, Open Ephys, Kilosort, quality metrics, or unit curation.","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fscientific\u002Fneuropixels-analysis\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fscientific\u002Fneuropixels-analysis\u002FSKILL.md",[],[147,148,149,150,151,152,153,154,37,155,156,157,158,159,160,161,27,162,163,164,24,23],"analysis","neuropixels analysis","spike","metrics","data","open","quality","user","recordings","Neural","motion","visual","quality metrics","unit","sorting","curation","recording","load",{"skillNo":166,"name":167,"nameZh":6,"description":168,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":80,"licenseFileUrl":169,"sourceHtmlUrl":170,"categories":171,"keywords":175,"publishedAt":43},"01M6FDP0PDK6F1GGX395C7625Z","skill-creator","Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fproductivity\u002Fskill-creator\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fproductivity\u002Fskill-creator\u002FSKILL.md",[172],{"categoryNo":173,"categoryName":174,"taxonomyType":87,"taxonomyTypeDesc":88},"01JBSEEDCAT000000000000023","Skill与智能体开发",[176,177,32,178,179,180,181,182,183,184,185,186,187,188,27,24,189,23,190],"skill creator","creator","create","update","capabilities","knowledge","tool","integrations","specialized","guide","new skill","existing skill","users","Existing","new",{"skillNo":192,"name":193,"nameZh":6,"description":194,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":195,"sourceHtmlUrl":196,"categories":197,"keywords":199,"publishedAt":43},"01M6FDM8Y7VK7NYG9SM7QPA3PW","notebooklm","Use this skill to query your Google NotebookLM notebooks directly from Claude Code for source-grounded, citation-backed answers from Gemini. Browser automation, library management, persistent auth. Drastically reduced hallucinations through document-only responses.","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fproductivity\u002Fnotebooklm\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fproductivity\u002Fnotebooklm\u002FSKILL.md",[198],{"categoryNo":173,"categoryName":174,"taxonomyType":87,"taxonomyTypeDesc":88},[193,200,201,202,203,204,205,134,206,207,37,208,209,210,211,24,212],"google","browser automation","gemini","automation","auth","code","library","management","only","document","query","Citation","source",{"skillNo":214,"name":215,"nameZh":6,"description":216,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":80,"licenseFileUrl":217,"sourceHtmlUrl":218,"categories":219,"keywords":226,"publishedAt":43},"01M6FDHPXE10J3XGTCH5HBHS1M","slack-gif-creator","Knowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like \"make me a GIF of X doing Y for Slack.\"","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fenterprise-communication\u002Fslack-gif-creator\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fenterprise-communication\u002Fslack-gif-creator\u002FSKILL.md",[220,223],{"categoryNo":221,"categoryName":222,"taxonomyType":87,"taxonomyTypeDesc":88},"01JBSEEDCAT000000000000005","邮件与沟通",{"categoryNo":224,"categoryName":225,"taxonomyType":87,"taxonomyTypeDesc":88},"01JBSEEDCAT000000000000016","图像与多媒体",[227,228,229,177,230,106,231,232,181,37,233,188,234,235,236,24,237,23],"slack gif creator","slack","gif","validation","constraints","Animation","me","make","Utilities","concepts","request"]