Skip to content

fcakyon/claude-codex-settings / plugins/reusable-app-components/skills/opendesk-support

opendesk-support

Verified

This skill should be used when user asks to "add OpenDesk support chat", "migrate from Tawk", "theme a support widget", "configure an OpenDesk AI bot", "sync chatbot knowledge", or "inspect OpenDesk chats through API or MCP". Covers self-hosted deployment, signed identity, product workspaces, AI answers, knowledge automation and support operations.

assets/support-widget.ts

View on GitHub
type WidgetApi = ((command: string, ...args: unknown[]) => void) & { q?: unknown[][] }
declare global { interface Window { opendesk?: WidgetApi } }

let operations = Promise.resolve()

export function supportWidget({ key, url, identityUrl, context }: { key: string, url: string, identityUrl: () => string, context: () => { language: string, hidden: boolean } }) {
  let request: AbortController | undefined
  let script: HTMLScriptElement | undefined
  let identity: string | undefined
  let stopped = false

  const visibility = () => {
    const host = document.querySelector<HTMLElement>('[data-opendesk-widget]')
    if (context().hidden) window.opendesk?.('close')
    if (host) host.style.display = context().hidden ? 'none' : ''
    window.opendesk?.('locale', context().language)
  }
  const clear = () => {
    window.opendesk?.('shutdown')
    script?.remove()
    script = undefined
    identity = undefined
  }
  const sync = (reset = false) => {
    request?.abort()
    const controller = new AbortController()
    request = controller
    if (reset) {
      window.opendesk?.('close')
      const host = document.querySelector<HTMLElement>('[data-opendesk-widget]')
      if (host) host.style.display = 'none'
    }
    operations = operations.then(async () => {
      if (stopped || controller.signal.aborted) return
      if (reset) clear()
      const response = await fetch(identityUrl(), { cache: 'no-store', signal: controller.signal })
      if (!response.ok) throw Error('Support identity request failed')
      const account = response.status === 204 ? {} : await response.json()
      if (stopped || controller.signal.aborted) return
      const next = JSON.stringify(account)
      if (identity !== next) {
        clear()
        const queue: unknown[][] = []
        window.opendesk = Object.assign((...args: unknown[]) => { queue.push(args) }, { q: queue })
        window.opendesk('identify', account)
        window.opendesk('locale', context().language)
        const element = document.createElement('script')
        script = element
        element.src = `${url}/widget/v1.js`
        element.dataset.key = key
        element.dataset.lang = context().language
        element.async = true
        await new Promise<void>((resolve, reject) => {
          element.onload = () => resolve()
          element.onerror = () => reject(Error('Support widget could not load'))
          document.body.append(element)
        })
        identity = next
        window.opendesk?.('on', 'open', () => sync())
      }
      visibility()
    }).catch(() => {
      if (!stopped && !controller.signal.aborted) console.error('Support chat could not connect.')
    })
  }
  const focus = () => sync()
  window.addEventListener('focus', focus)
  sync()
  return {
    sync,
    visibility,
    destroy() {
      stopped = true
      request?.abort()
      window.removeEventListener('focus', focus)
      operations = operations.then(clear)
    }
  }
}
writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deploymentStars: 322kUpdated Claude CodeCodexVerifiedInstall
xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy.Stars: 119kUpdated Claude CodeCodexVerifiedInstall
childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release.Stars: 118kUpdated Claude CodeCodexVerifiedInstall