[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M754SKRS4JTA1NCDA4QS0P2C":3,"skill-same:01M754SKRS4JTA1NCDA4QS0P2C":49},{"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":29,"commitSha":30,"skillDirectory":5,"forksCount":14,"repositoryHtmlUrl":31,"repositoryHomepageUrl":6,"ownerHtmlUrl":32,"ownerBlogUrl":33,"ownerDescription":6,"updatedAt":34,"install":35,"resources":48},"01M754SKRS4JTA1NCDA4QS0P2C","openevidence-debug-bundle",null,"Generate comprehensive debug information for OpenEvidence integration issues.\nUse when troubleshooting complex problems, preparing support tickets,\nor conducting post-incident analysis.\nTrigger with phrases like \"openevidence debug\", \"openevidence troubleshoot\",\n\"openevidence support bundle\", \"diagnose openevidence\".","SamuelChien\u002Fmega-skills-collection","SamuelChien","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F4652114?v=4","01M74KK34WVHA0P5ZYSJRDDFMG","Samuel Chien","01M74KK35FQN1N9VZ9EPTH3P2S",0,"MIT","https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fopenevidence-debug-bundle\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: openevidence-debug-bundle\ndescription: |\n  Generate comprehensive debug information for OpenEvidence integration issues.\n  Use when troubleshooting complex problems, preparing support tickets,\n  or conducting post-incident analysis.\n  Trigger with phrases like \"openevidence debug\", \"openevidence troubleshoot\",\n  \"openevidence support bundle\", \"diagnose openevidence\".\nallowed-tools: Read, Grep, Bash(curl:*), Bash(npm:*), Bash(node:*)\nversion: 1.0.0\nlicense: MIT\nauthor: Jeremy Longshore \u003Cjeremy@intentsolutions.io>\ncompatible-with: claude-code, codex, openclaw\n---\n# OpenEvidence Debug Bundle\n\n## Overview\nGenerate comprehensive diagnostic information for troubleshooting OpenEvidence integration issues without exposing PHI.\n\n## Prerequisites\n- OpenEvidence SDK installed\n- Access to application logs\n- Command-line access\n- curl installed\n\n## Instructions\n\n### Step 1: Environment Check Script\n```bash\n#!\u002Fbin\u002Fbash\nset -euo pipefail\n# scripts\u002Fopenevidence-debug.sh\n\necho \"=== OpenEvidence Debug Bundle ===\"\necho \"Generated: $(date -u +%Y-%m-%dT%H:%M:%SZ)\"\necho \"\"\n\n# 1. Environment Variables (masked)\necho \"=== Environment Configuration ===\"\necho \"OPENEVIDENCE_API_KEY: ${OPENEVIDENCE_API_KEY:+[SET - ${#OPENEVIDENCE_API_KEY} chars]}\"\necho \"OPENEVIDENCE_ORG_ID: ${OPENEVIDENCE_ORG_ID:+[SET - ${#OPENEVIDENCE_ORG_ID} chars]}\"\necho \"OPENEVIDENCE_BASE_URL: ${OPENEVIDENCE_BASE_URL:-https:\u002F\u002Fapi.openevidence.com}\"\necho \"OPENEVIDENCE_TIMEOUT: ${OPENEVIDENCE_TIMEOUT:-30000}ms\"  # 30000: 30 seconds in ms\necho \"NODE_ENV: ${NODE_ENV:-not set}\"\necho \"\"\n\n# 2. SDK Version\necho \"=== SDK Version ===\"\nnpm list @openevidence\u002Fsdk 2>\u002Fdev\u002Fnull || pip show openevidence 2>\u002Fdev\u002Fnull || echo \"SDK not found\"\necho \"\"\n\n# 3. Node\u002FPython Version\necho \"=== Runtime Version ===\"\nnode --version 2>\u002Fdev\u002Fnull || echo \"Node.js not found\"\npython3 --version 2>\u002Fdev\u002Fnull || echo \"Python not found\"\necho \"\"\n\n# 4. Connectivity Test\necho \"=== Connectivity Test ===\"\nHEALTH_STATUS=$(curl -s -o \u002Fdev\u002Fnull -w \"%{http_code}\" \\\n  -H \"Authorization: Bearer ${OPENEVIDENCE_API_KEY}\" \\\n  \"${OPENEVIDENCE_BASE_URL:-https:\u002F\u002Fapi.openevidence.com}\u002Fhealth\" 2>\u002Fdev\u002Fnull)\necho \"Health endpoint: HTTP ${HEALTH_STATUS}\"\n\nDNS_CHECK=$(dig +short api.openevidence.com 2>\u002Fdev\u002Fnull || echo \"DNS lookup failed\")\necho \"DNS resolution: ${DNS_CHECK}\"\necho \"\"\n\n# 5. TLS Check\necho \"=== TLS Configuration ===\"\nopenssl s_client -connect api.openevidence.com:443 -brief 2>\u002Fdev\u002Fnull | head -5 || echo \"TLS check failed\"  # 443: HTTPS port\necho \"\"\n\n# 6. Rate Limit Status\necho \"=== Rate Limit Status ===\"\ncurl -s -D - \\\n  -H \"Authorization: Bearer ${OPENEVIDENCE_API_KEY}\" \\\n  \"${OPENEVIDENCE_BASE_URL:-https:\u002F\u002Fapi.openevidence.com}\u002Fv1\u002Frate-limit\" 2>\u002Fdev\u002Fnull \\\n  | grep -i \"x-ratelimit\" || echo \"Could not retrieve rate limit headers\"\necho \"\"\n\necho \"=== Debug Bundle Complete ===\"\n```\n\n### Step 2: Programmatic Debug Collection\n```typescript\n\u002F\u002F src\u002Fdebug\u002Fdebug-bundle.ts\nimport { OpenEvidenceClient } from '@openevidence\u002Fsdk';\nimport { execSync } from 'child_process';\n\ninterface DebugBundle {\n  timestamp: string;\n  environment: EnvironmentInfo;\n  connectivity: ConnectivityInfo;\n  sdkInfo: SDKInfo;\n  recentErrors: ErrorSummary[];\n  metrics: MetricsSummary;\n}\n\ninterface EnvironmentInfo {\n  nodeVersion: string;\n  sdkVersion: string;\n  apiKeySet: boolean;\n  apiKeyLength: number;\n  orgIdSet: boolean;\n  baseUrl: string;\n  timeout: number;\n}\n\ninterface ConnectivityInfo {\n  healthStatus: number | null;\n  latencyMs: number | null;\n  dnsResolution: boolean;\n  tlsVersion: string | null;\n}\n\ninterface SDKInfo {\n  version: string;\n  features: string[];\n}\n\ninterface ErrorSummary {\n  code: string;\n  count: number;\n  lastOccurred: string;\n}\n\ninterface MetricsSummary {\n  totalRequests: number;\n  successRate: number;\n  avgLatencyMs: number;\n  p99LatencyMs: number;\n}\n\nexport async function generateDebugBundle(): Promise\u003CDebugBundle> {\n  const timestamp = new Date().toISOString();\n\n  \u002F\u002F Gather environment info\n  const environment = gatherEnvironmentInfo();\n\n  \u002F\u002F Test connectivity\n  const connectivity = await testConnectivity();\n\n  \u002F\u002F Get SDK info\n  const sdkInfo = getSDKInfo();\n\n  \u002F\u002F Summarize recent errors (from in-memory store or logs)\n  const recentErrors = await summarizeRecentErrors();\n\n  \u002F\u002F Gather metrics\n  const metrics = await gatherMetrics();\n\n  return {\n    timestamp,\n    environment,\n    connectivity,\n    sdkInfo,\n    recentErrors,\n    metrics,\n  };\n}\n\nfunction gatherEnvironmentInfo(): EnvironmentInfo {\n  return {\n    nodeVersion: process.version,\n    sdkVersion: getPackageVersion('@openevidence\u002Fsdk'),\n    apiKeySet: !!process.env.OPENEVIDENCE_API_KEY,\n    apiKeyLength: process.env.OPENEVIDENCE_API_KEY?.length || 0,\n    orgIdSet: !!process.env.OPENEVIDENCE_ORG_ID,\n    baseUrl: process.env.OPENEVIDENCE_BASE_URL || 'https:\u002F\u002Fapi.openevidence.com',\n    timeout: parseInt(process.env.OPENEVIDENCE_TIMEOUT || '30000'),  # 30000: 30 seconds in ms\n  };\n}\n\nasync function testConnectivity(): Promise\u003CConnectivityInfo> {\n  const baseUrl = process.env.OPENEVIDENCE_BASE_URL || 'https:\u002F\u002Fapi.openevidence.com';\n  const startTime = Date.now();\n\n  try {\n    const response = await fetch(`${baseUrl}\u002Fhealth`, {\n      headers: { Authorization: `Bearer ${process.env.OPENEVIDENCE_API_KEY}` },\n    });\n\n    return {\n      healthStatus: response.status,\n      latencyMs: Date.now() - startTime,\n      dnsResolution: true,\n      tlsVersion: 'TLS 1.2+', \u002F\u002F Inferred from successful HTTPS\n    };\n  } catch (error: any) {\n    return {\n      healthStatus: null,\n      latencyMs: null,\n      dnsResolution: error.code !== 'ENOTFOUND',\n      tlsVersion: null,\n    };\n  }\n}\n\nfunction getSDKInfo(): SDKInfo {\n  return {\n    version: getPackageVersion('@openevidence\u002Fsdk'),\n    features: ['clinical-query', 'deep-consult', 'webhooks'],\n  };\n}\n\nfunction getPackageVersion(pkg: string): string {\n  try {\n    const result = execSync(`npm list ${pkg} --json 2>\u002Fdev\u002Fnull`, { encoding: 'utf8' });\n    const json = JSON.parse(result);\n    return json.dependencies?.[pkg]?.version || 'unknown';\n  } catch {\n    return 'unknown';\n  }\n}\n\nasync function summarizeRecentErrors(): Promise\u003CErrorSummary[]> {\n  \u002F\u002F This would typically pull from your error tracking system\n  \u002F\u002F Placeholder implementation\n  return [];\n}\n\nasync function gatherMetrics(): Promise\u003CMetricsSummary> {\n  \u002F\u002F This would typically pull from your metrics system\n  \u002F\u002F Placeholder implementation\n  return {\n    totalRequests: 0,\n    successRate: 0,\n    avgLatencyMs: 0,\n    p99LatencyMs: 0,\n  };\n}\n```\n\n### Step 3: Sanitized Log Extraction\n```typescript\n\u002F\u002F src\u002Fdebug\u002Flog-sanitizer.ts\n\u002F\u002F IMPORTANT: Removes PHI before including in debug bundle\n\nconst PHI_PATTERNS = [\n  \u002F\\b\\d{3}-\\d{2}-\\d{4}\\b\u002Fg,           \u002F\u002F SSN\n  \u002F\\b[A-Z]\\d{8}\\b\u002Fgi,                  \u002F\u002F MRN patterns\n  \u002F\\b\\d{10,}\\b\u002Fg,                      \u002F\u002F Long numbers (potential IDs)\n  \u002Fpatient[_\\s]*(name|id|dob)\u002Fgi,      \u002F\u002F Patient fields\n  \u002F\\b(male|female),?\\s*\\d{1,3}\u002Fgi,    \u002F\u002F Demographics\n  \u002F\"name\"\\s*:\\s*\"[^\"]+\"\u002Fgi,           \u002F\u002F Name fields in JSON\n  \u002F\"dob\"\\s*:\\s*\"[^\"]+\"\u002Fgi,            \u002F\u002F DOB fields\n  \u002F\"mrn\"\\s*:\\s*\"[^\"]+\"\u002Fgi,            \u002F\u002F MRN fields\n];\n\nexport function sanitizeLogs(logs: string): string {\n  let sanitized = logs;\n\n  for (const pattern of PHI_PATTERNS) {\n    sanitized = sanitized.replace(pattern, '[REDACTED]');\n  }\n\n  return sanitized;\n}\n\nexport function extractSanitizedLogs(\n  logSource: string,\n  timeRange: { start: Date; end: Date },\n  maxLines: number = 1000  # 1000: 1 second in ms\n): string[] {\n  \u002F\u002F Implementation depends on your logging infrastructure\n  \u002F\u002F Example with file-based logs:\n\n  const logs: string[] = [];\n  \u002F\u002F Read logs, filter by time range, sanitize each line\n  \u002F\u002F ...\n\n  return logs.map(sanitizeLogs).slice(0, maxLines);\n}\n```\n\n### Step 4: Support Ticket Generator\n```typescript\n\u002F\u002F src\u002Fdebug\u002Fsupport-ticket.ts\nimport { generateDebugBundle, DebugBundle } from '.\u002Fdebug-bundle';\nimport { sanitizeLogs, extractSanitizedLogs } from '.\u002Flog-sanitizer';\n\ninterface SupportTicket {\n  subject: string;\n  description: string;\n  debugBundle: DebugBundle;\n  sanitizedLogs: string[];\n  stepsToReproduce: string[];\n  expectedBehavior: string;\n  actualBehavior: string;\n}\n\nexport async function generateSupportTicket(\n  issue: {\n    summary: string;\n    stepsToReproduce: string[];\n    expectedBehavior: string;\n    actualBehavior: string;\n  }\n): Promise\u003CSupportTicket> {\n  const bundle = await generateDebugBundle();\n\n  const logs = extractSanitizedLogs(\n    '\u002Fvar\u002Flog\u002Fapp\u002Fopenevidence.log',\n    { start: new Date(Date.now() - 3600000), end: new Date() },  # 3600000 = configured value\n    500  # HTTP 500 Internal Server Error\n  );\n\n  return {\n    subject: `[OpenEvidence Integration] ${issue.summary}`,\n    description: `\n## Issue Summary\n${issue.summary}\n\n## Environment\n- Node Version: ${bundle.environment.nodeVersion}\n- SDK Version: ${bundle.environment.sdkVersion}\n- Base URL: ${bundle.environment.baseUrl}\n- Timeout: ${bundle.environment.timeout}ms\n\n## Connectivity\n- Health Status: ${bundle.connectivity.healthStatus || 'Failed'}\n- Latency: ${bundle.connectivity.latencyMs || 'N\u002FA'}ms\n- DNS Resolution: ${bundle.connectivity.dnsResolution ? 'OK' : 'Failed'}\n\n## Recent Errors\n${bundle.recentErrors.map(e => `- ${e.code}: ${e.count} occurrences (last: ${e.lastOccurred})`).join('\\n') || 'None recorded'}\n`,\n    debugBundle: bundle,\n    sanitizedLogs: logs,\n    stepsToReproduce: issue.stepsToReproduce,\n    expectedBehavior: issue.expectedBehavior,\n    actualBehavior: issue.actualBehavior,\n  };\n}\n```\n\n## Output\n- Environment configuration status\n- Connectivity test results\n- SDK version information\n- Sanitized logs (no PHI)\n- Formatted support ticket\n\n## Diagnostic Checklist\n- [ ] API key is set and correct length\n- [ ] Organization ID is configured\n- [ ] Health endpoint returns 200\n- [ ] DNS resolves api.openevidence.com\n- [ ] TLS handshake succeeds\n- [ ] Rate limits have headroom\n- [ ] No recent 5xx errors\n\n## Error Handling\n| Issue | Check | Resolution |\n|-------|-------|------------|\n| No connectivity | DNS, firewall | Check network config |\n| Auth failures | API key format | Regenerate key in dashboard |\n| Timeouts | Latency test | Increase timeout, check network |\n| PHI in logs | Log sanitizer | Audit logging configuration |\n\n## Examples\n\n### Quick Debug Command\n```bash\n# Run bash debug script\nchmod +x scripts\u002Fopenevidence-debug.sh\n.\u002Fscripts\u002Fopenevidence-debug.sh > debug-bundle.txt\n```\n\n### Generate Support Ticket\n```typescript\nconst ticket = await generateSupportTicket({\n  summary: 'Clinical queries timing out after SDK upgrade',\n  stepsToReproduce: [\n    '1. Upgrade @openevidence\u002Fsdk to v2.0.0',\n    '2. Make clinical query request',\n    '3. Request times out after 30s',\n  ],\n  expectedBehavior: 'Response within 10s',\n  actualBehavior: 'Timeout after configured limit',\n});\n\nconsole.log(JSON.stringify(ticket, null, 2));\n```\n\n## Resources\n- [OpenEvidence Support](mailto:support@openevidence.com)\n- [OpenEvidence Status](https:\u002F\u002Fstatus.openevidence.com\u002F)\n\n## Next Steps\nFor rate limit management, see `openevidence-rate-limits`.","# OpenEvidence Debug Bundle\n\n## Overview\nGenerate comprehensive diagnostic information for troubleshooting OpenEvidence integration issues without exposing PHI.\n\n## Prerequisites\n- OpenEvidence SDK installed\n- Access to application logs\n- Command-line access\n- curl installed\n\n## Instructions\n\n### Step 1: Environment Check Script\n```bash\n#!\u002Fbin\u002Fbash\nset -euo pipefail\n# scripts\u002Fopenevidence-debug.sh\n\necho \"=== OpenEvidence Debug Bundle ===\"\necho \"Generated: $(date -u +%Y-%m-%dT%H:%M:%SZ)\"\necho \"\"\n\n# 1. Environment Variables (masked)\necho \"=== Environment Configuration ===\"\necho \"OPENEVIDENCE_API_KEY: ${OPENEVIDENCE_API_KEY:+[SET - ${#OPENEVIDENCE_API_KEY} chars]}\"\necho \"OPENEVIDENCE_ORG_ID: ${OPENEVIDENCE_ORG_ID:+[SET - ${#OPENEVIDENCE_ORG_ID} chars]}\"\necho \"OPENEVIDENCE_BASE_URL: ${OPENEVIDENCE_BASE_URL:-https:\u002F\u002Fapi.openevidence.com}\"\necho \"OPENEVIDENCE_TIMEOUT: ${OPENEVIDENCE_TIMEOUT:-30000}ms\"  # 30000: 30 seconds in ms\necho \"NODE_ENV: ${NODE_ENV:-not set}\"\necho \"\"\n\n# 2. SDK Version\necho \"=== SDK Version ===\"\nnpm list @openevidence\u002Fsdk 2>\u002Fdev\u002Fnull || pip show openevidence 2>\u002Fdev\u002Fnull || echo \"SDK not found\"\necho \"\"\n\n# 3. Node\u002FPython Version\necho \"=== Runtime Version ===\"\nnode --version 2>\u002Fdev\u002Fnull || echo \"Node.js not found\"\npython3 --version 2>\u002Fdev\u002Fnull || echo \"Python not found\"\necho \"\"\n\n# 4. Connectivity Test\necho \"=== Connectivity Test ===\"\nHEALTH_STATUS=$(curl -s -o \u002Fdev\u002Fnull -w \"%{http_code}\" \\\n  -H \"Authorization: Bearer ${OPENEVIDENCE_API_KEY}\" \\\n  \"${OPENEVIDENCE_BASE_URL:-https:\u002F\u002Fapi.openevidence.com}\u002Fhealth\" 2>\u002Fdev\u002Fnull)\necho \"Health endpoint: HTTP ${HEALTH_STATUS}\"\n\nDNS_CHECK=$(dig +short api.openevidence.com 2>\u002Fdev\u002Fnull || echo \"DNS lookup failed\")\necho \"DNS resolution: ${DNS_CHECK}\"\necho \"\"\n\n# 5. TLS Check\necho \"=== TLS Configuration ===\"\nopenssl s_client -connect api.openevidence.com:443 -brief 2>\u002Fdev\u002Fnull | head -5 || echo \"TLS check failed\"  # 443: HTTPS port\necho \"\"\n\n# 6. Rate Limit Status\necho \"=== Rate Limit Status ===\"\ncurl -s -D - \\\n  -H \"Authorization: Bearer ${OPENEVIDENCE_API_KEY}\" \\\n  \"${OPENEVIDENCE_BASE_URL:-https:\u002F\u002Fapi.openevidence.com}\u002Fv1\u002Frate-limit\" 2>\u002Fdev\u002Fnull \\\n  | grep -i \"x-ratelimit\" || echo \"Could not retrieve rate limit headers\"\necho \"\"\n\necho \"=== Debug Bundle Complete ===\"\n```\n\n### Step 2: Programmatic Debug Collection\n```typescript\n\u002F\u002F src\u002Fdebug\u002Fdebug-bundle.ts\nimport { OpenEvidenceClient } from '@openevidence\u002Fsdk';\nimport { execSync } from 'child_process';\n\ninterface DebugBundle {\n  timestamp: string;\n  environment: EnvironmentInfo;\n  connectivity: ConnectivityInfo;\n  sdkInfo: SDKInfo;\n  recentErrors: ErrorSummary[];\n  metrics: MetricsSummary;\n}\n\ninterface EnvironmentInfo {\n  nodeVersion: string;\n  sdkVersion: string;\n  apiKeySet: boolean;\n  apiKeyLength: number;\n  orgIdSet: boolean;\n  baseUrl: string;\n  timeout: number;\n}\n\ninterface ConnectivityInfo {\n  healthStatus: number | null;\n  latencyMs: number | null;\n  dnsResolution: boolean;\n  tlsVersion: string | null;\n}\n\ninterface SDKInfo {\n  version: string;\n  features: string[];\n}\n\ninterface ErrorSummary {\n  code: string;\n  count: number;\n  lastOccurred: string;\n}\n\ninterface MetricsSummary {\n  totalRequests: number;\n  successRate: number;\n  avgLatencyMs: number;\n  p99LatencyMs: number;\n}\n\nexport async function generateDebugBundle(): Promise\u003CDebugBundle> {\n  const timestamp = new Date().toISOString();\n\n  \u002F\u002F Gather environment info\n  const environment = gatherEnvironmentInfo();\n\n  \u002F\u002F Test connectivity\n  const connectivity = await testConnectivity();\n\n  \u002F\u002F Get SDK info\n  const sdkInfo = getSDKInfo();\n\n  \u002F\u002F Summarize recent errors (from in-memory store or logs)\n  const recentErrors = await summarizeRecentErrors();\n\n  \u002F\u002F Gather metrics\n  const metrics = await gatherMetrics();\n\n  return {\n    timestamp,\n    environment,\n    connectivity,\n    sdkInfo,\n    recentErrors,\n    metrics,\n  };\n}\n\nfunction gatherEnvironmentInfo(): EnvironmentInfo {\n  return {\n    nodeVersion: process.version,\n    sdkVersion: getPackageVersion('@openevidence\u002Fsdk'),\n    apiKeySet: !!process.env.OPENEVIDENCE_API_KEY,\n    apiKeyLength: process.env.OPENEVIDENCE_API_KEY?.length || 0,\n    orgIdSet: !!process.env.OPENEVIDENCE_ORG_ID,\n    baseUrl: process.env.OPENEVIDENCE_BASE_URL || 'https:\u002F\u002Fapi.openevidence.com',\n    timeout: parseInt(process.env.OPENEVIDENCE_TIMEOUT || '30000'),  # 30000: 30 seconds in ms\n  };\n}\n\nasync function testConnectivity(): Promise\u003CConnectivityInfo> {\n  const baseUrl = process.env.OPENEVIDENCE_BASE_URL || 'https:\u002F\u002Fapi.openevidence.com';\n  const startTime = Date.now();\n\n  try {\n    const response = await fetch(`${baseUrl}\u002Fhealth`, {\n      headers: { Authorization: `Bearer ${process.env.OPENEVIDENCE_API_KEY}` },\n    });\n\n    return {\n      healthStatus: response.status,\n      latencyMs: Date.now() - startTime,\n      dnsResolution: true,\n      tlsVersion: 'TLS 1.2+', \u002F\u002F Inferred from successful HTTPS\n    };\n  } catch (error: any) {\n    return {\n      healthStatus: null,\n      latencyMs: null,\n      dnsResolution: error.code !== 'ENOTFOUND',\n      tlsVersion: null,\n    };\n  }\n}\n\nfunction getSDKInfo(): SDKInfo {\n  return {\n    version: getPackageVersion('@openevidence\u002Fsdk'),\n    features: ['clinical-query', 'deep-consult', 'webhooks'],\n  };\n}\n\nfunction getPackageVersion(pkg: string): string {\n  try {\n    const result = execSync(`npm list ${pkg} --json 2>\u002Fdev\u002Fnull`, { encoding: 'utf8' });\n    const json = JSON.parse(result);\n    return json.dependencies?.[pkg]?.version || 'unknown';\n  } catch {\n    return 'unknown';\n  }\n}\n\nasync function summarizeRecentErrors(): Promise\u003CErrorSummary[]> {\n  \u002F\u002F This would typically pull from your error tracking system\n  \u002F\u002F Placeholder implementation\n  return [];\n}\n\nasync function gatherMetrics(): Promise\u003CMetricsSummary> {\n  \u002F\u002F This would typically pull from your metrics system\n  \u002F\u002F Placeholder implementation\n  return {\n    totalRequests: 0,\n    successRate: 0,\n    avgLatencyMs: 0,\n    p99LatencyMs: 0,\n  };\n}\n```\n\n### Step 3: Sanitized Log Extraction\n```typescript\n\u002F\u002F src\u002Fdebug\u002Flog-sanitizer.ts\n\u002F\u002F IMPORTANT: Removes PHI before including in debug bundle\n\nconst PHI_PATTERNS = [\n  \u002F\\b\\d{3}-\\d{2}-\\d{4}\\b\u002Fg,           \u002F\u002F SSN\n  \u002F\\b[A-Z]\\d{8}\\b\u002Fgi,                  \u002F\u002F MRN patterns\n  \u002F\\b\\d{10,}\\b\u002Fg,                      \u002F\u002F Long numbers (potential IDs)\n  \u002Fpatient[_\\s]*(name|id|dob)\u002Fgi,      \u002F\u002F Patient fields\n  \u002F\\b(male|female),?\\s*\\d{1,3}\u002Fgi,    \u002F\u002F Demographics\n  \u002F\"name\"\\s*:\\s*\"[^\"]+\"\u002Fgi,           \u002F\u002F Name fields in JSON\n  \u002F\"dob\"\\s*:\\s*\"[^\"]+\"\u002Fgi,            \u002F\u002F DOB fields\n  \u002F\"mrn\"\\s*:\\s*\"[^\"]+\"\u002Fgi,            \u002F\u002F MRN fields\n];\n\nexport function sanitizeLogs(logs: string): string {\n  let sanitized = logs;\n\n  for (const pattern of PHI_PATTERNS) {\n    sanitized = sanitized.replace(pattern, '[REDACTED]');\n  }\n\n  return sanitized;\n}\n\nexport function extractSanitizedLogs(\n  logSource: string,\n  timeRange: { start: Date; end: Date },\n  maxLines: number = 1000  # 1000: 1 second in ms\n): string[] {\n  \u002F\u002F Implementation depends on your logging infrastructure\n  \u002F\u002F Example with file-based logs:\n\n  const logs: string[] = [];\n  \u002F\u002F Read logs, filter by time range, sanitize each line\n  \u002F\u002F ...\n\n  return logs.map(sanitizeLogs).slice(0, maxLines);\n}\n```\n\n### Step 4: Support Ticket Generator\n```typescript\n\u002F\u002F src\u002Fdebug\u002Fsupport-ticket.ts\nimport { generateDebugBundle, DebugBundle } from '.\u002Fdebug-bundle';\nimport { sanitizeLogs, extractSanitizedLogs } from '.\u002Flog-sanitizer';\n\ninterface SupportTicket {\n  subject: string;\n  description: string;\n  debugBundle: DebugBundle;\n  sanitizedLogs: string[];\n  stepsToReproduce: string[];\n  expectedBehavior: string;\n  actualBehavior: string;\n}\n\nexport async function generateSupportTicket(\n  issue: {\n    summary: string;\n    stepsToReproduce: string[];\n    expectedBehavior: string;\n    actualBehavior: string;\n  }\n): Promise\u003CSupportTicket> {\n  const bundle = await generateDebugBundle();\n\n  const logs = extractSanitizedLogs(\n    '\u002Fvar\u002Flog\u002Fapp\u002Fopenevidence.log',\n    { start: new Date(Date.now() - 3600000), end: new Date() },  # 3600000 = configured value\n    500  # HTTP 500 Internal Server Error\n  );\n\n  return {\n    subject: `[OpenEvidence Integration] ${issue.summary}`,\n    description: `\n## Issue Summary\n${issue.summary}\n\n## Environment\n- Node Version: ${bundle.environment.nodeVersion}\n- SDK Version: ${bundle.environment.sdkVersion}\n- Base URL: ${bundle.environment.baseUrl}\n- Timeout: ${bundle.environment.timeout}ms\n\n## Connectivity\n- Health Status: ${bundle.connectivity.healthStatus || 'Failed'}\n- Latency: ${bundle.connectivity.latencyMs || 'N\u002FA'}ms\n- DNS Resolution: ${bundle.connectivity.dnsResolution ? 'OK' : 'Failed'}\n\n## Recent Errors\n${bundle.recentErrors.map(e => `- ${e.code}: ${e.count} occurrences (last: ${e.lastOccurred})`).join('\\n') || 'None recorded'}\n`,\n    debugBundle: bundle,\n    sanitizedLogs: logs,\n    stepsToReproduce: issue.stepsToReproduce,\n    expectedBehavior: issue.expectedBehavior,\n    actualBehavior: issue.actualBehavior,\n  };\n}\n```\n\n## Output\n- Environment configuration status\n- Connectivity test results\n- SDK version information\n- Sanitized logs (no PHI)\n- Formatted support ticket\n\n## Diagnostic Checklist\n- [ ] API key is set and correct length\n- [ ] Organization ID is configured\n- [ ] Health endpoint returns 200\n- [ ] DNS resolves api.openevidence.com\n- [ ] TLS handshake succeeds\n- [ ] Rate limits have headroom\n- [ ] No recent 5xx errors\n\n## Error Handling\n| Issue | Check | Resolution |\n|-------|-------|------------|\n| No connectivity | DNS, firewall | Check network config |\n| Auth failures | API key format | Regenerate key in dashboard |\n| Timeouts | Latency test | Increase timeout, check network |\n| PHI in logs | Log sanitizer | Audit logging configuration |\n\n## Examples\n\n### Quick Debug Command\n```bash\n# Run bash debug script\nchmod +x scripts\u002Fopenevidence-debug.sh\n.\u002Fscripts\u002Fopenevidence-debug.sh > debug-bundle.txt\n```\n\n### Generate Support Ticket\n```typescript\nconst ticket = await generateSupportTicket({\n  summary: 'Clinical queries timing out after SDK upgrade',\n  stepsToReproduce: [\n    '1. Upgrade @openevidence\u002Fsdk to v2.0.0',\n    '2. Make clinical query request',\n    '3. Request times out after 30s',\n  ],\n  expectedBehavior: 'Response within 10s',\n  actualBehavior: 'Timeout after configured limit',\n});\n\nconsole.log(JSON.stringify(ticket, null, 2));\n```\n\n## Resources\n- [OpenEvidence Support](mailto:support@openevidence.com)\n- [OpenEvidence Status](https:\u002F\u002Fstatus.openevidence.com\u002F)\n\n## Next Steps\nFor rate limit management, see `openevidence-rate-limits`.",{"name":5,"author":24,"license":15,"version":25,"description":26,"allowed-tools":27,"compatible-with":28},"Jeremy Longshore \u003Cjeremy@intentsolutions.io>","1.0.0","Generate comprehensive debug information for OpenEvidence integration issues.\nUse when troubleshooting complex problems, preparing support tickets,\nor conducting post-incident analysis.\nTrigger with phrases like \"openevidence debug\", \"openevidence troubleshoot\",\n\"openevidence support bundle\", \"diagnose openevidence\".\n","Read, Grep, Bash(curl:*), Bash(npm:*), Bash(node:*)","claude-code, codex, openclaw","main","c2b1fdccc779e99ac814e55fb69ca8d71215dd0f","https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection","https:\u002F\u002Fgithub.com\u002FSamuelChien","http:\u002F\u002Fsamuelchien.com\u002F","2026-05-26 08:27:14",{"source":8,"skillName":5,"commands":36,"prompt":46,"zipAvailable":47},[37,40,43],{"tool":38,"command":39},"npx","npx skills add SamuelChien\u002Fmega-skills-collection --skill openevidence-debug-bundle",{"tool":41,"command":42},"bunx","bunx skills add SamuelChien\u002Fmega-skills-collection --skill openevidence-debug-bundle",{"tool":44,"command":45},"pnpm","pnpm dlx skills add SamuelChien\u002Fmega-skills-collection --skill openevidence-debug-bundle","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fopenevidence-debug-bundle\u002FSKILL.md",true,[],[50,57,64,71,78,86],{"skillNo":51,"name":52,"nameZh":6,"description":53,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":54,"categories":55,"keywords":56,"publishedAt":19},"01M76R4WZQZAXGGXMQCA0FZ716","zustand-store-ts","Create Zustand stores with TypeScript, subscribeWithSelector middleware, and proper state\u002Faction separation. Use when building React state management, creating global stores, or implementing reactive state patterns with Zustand.","https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fzustand-store-ts\u002FSKILL.md",[],[],{"skillNo":58,"name":59,"nameZh":6,"description":60,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":61,"categories":62,"keywords":63,"publishedAt":19},"01M76R4T9KENDH7FENGZQHBW4G","zustand-store-creator","Zustand Store Creator - Auto-activating skill for Frontend Development.\nTriggers on: zustand store creator, zustand store creator\nPart of the Frontend Development skill category.","https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fzustand-store-creator\u002FSKILL.md",[],[],{"skillNo":65,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":19},"01M76R3YWN84B7SANJ52X799ZE","zero-trust-config-helper","Zero Trust Config Helper - Auto-activating skill for Security Advanced.\nTriggers on: zero trust config helper, zero trust config helper\nPart of the Security Advanced skill category.","https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fzero-trust-config-helper\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":19},"01M76R3HNSV2AEYSKHM915GJ58","zapier-integration-helper","Zapier Integration Helper - Auto-activating skill for Business Automation.\nTriggers on: zapier integration helper, zapier integration helper\nPart of the Business Automation skill category.","https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fzapier-integration-helper\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":82,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":19},"01M76R3DJSKAT4FA7DV4BF3GCE","zai-cli","Execute z.AI CLI providing vision, search, reader, and GitHub exploration via CLI and MCP.\nUse when user needs image\u002Fvideo analysis, OCR, UI-to-code conversion, error diagnosis,\nreal-time web search, web page to markdown extraction, or GitHub code exploration.\nTrigger with phrases like \"analyze this image\", \"search the web for\", \"read this page\",\n\"explore this repo\", or \"use zai\". Requires Z_AI_API_KEY.","Apache-2.0","https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fzai-cli\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":19},"01M76R2KAM699XE9AJVAWE4H2E","yt-research","Research competitor YouTube channels, niches, and trending topics for your content strategy.\nUse this skill whenever the user says \"research channels\", \"analyze competitors\", \"find trending topics\",\n\"niche analysis\", \"competitive research\", \"what are other creators doing\", \"scrape YouTube channels\",\nor wants to understand the competitive landscape for a specific tool or topic area. Use when working with yt research. Trigger with 'yt', 'research'.","https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fyt-research\u002FSKILL.md",[],[]]