> ## Documentation Index
> Fetch the complete documentation index at: https://docs.devin.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Slack でのカスタマーヘルスサマリー

export const UseCaseHero = ({title, description, prompt, category, features, devinUrl, agent, intent, playbookId, type}) => {
  const encodedPrompt = encodeURIComponent(prompt || '');
  const tag = 'docs-use-case-gallery';
  const utm = 'utm_source=docs&utm_medium=use-case-gallery&utm_campaign=hero-cta';
  const agentParams = (agent ? '&agent=' + agent : '') + (intent ? '&intent=' + intent : '') + (playbookId ? '&playbookId=' + playbookId : '');
  const devinHref = type === 'schedule' ? 'https://app.devin.ai/settings/schedules/create?' + utm + agentParams + (prompt ? '&prompt=' + encodedPrompt : '') : type === 'review' ? 'https://app.devin.ai/review?' + utm : agent === 'ada' ? 'https://app.devin.ai/search?' + utm + '&noSubmit=true' + (prompt ? '&prompt=' + encodedPrompt : '') : devinUrl ? devinUrl.includes('?') ? devinUrl + '&' + utm + agentParams : devinUrl + '?' + utm + agentParams : prompt ? 'https://app.devin.ai/?tags=' + tag + '&' + utm + agentParams + '&prompt=' + encodedPrompt : 'https://app.devin.ai/?' + utm + agentParams;
  const buttonLabel = type === 'schedule' ? 'Schedule in Devin ↗' : type === 'review' ? 'Set Up Devin Review ↗' : agent === 'advanced' ? 'Try in Devin ↗' : agent === 'dana' ? 'Try in Dana ↗' : agent === 'ada' ? 'Try in Ask Devin ↗' : 'Try in Devin ↗';
  const featureList = features ? features.split(',').map(f => f.trim()) : [];
  return <div className="uc-hero">
      <div className="uc-hero-inner">
        <div className="uc-hero-left">
          <h1 className="uc-hero-title">{title}</h1>
          <p className="uc-hero-desc">{description}</p>
          <div>
            <a href={devinHref} target="_blank" rel="noopener noreferrer" className="try-in-devin-btn">
              {buttonLabel}
            </a>
          </div>
        </div>
        <div className="uc-hero-meta">
          <div className="uc-meta-item">
            <span className="uc-meta-label">Author</span>
            <span className="uc-meta-value">Cognition</span>
          </div>
          <div className="uc-meta-item">
            <span className="uc-meta-label">Category</span>
            <span className="uc-meta-value">{category}</span>
          </div>
          {featureList.length > 0 && <div className="uc-meta-item">
              <span className="uc-meta-label">Features</span>
              <span className="uc-meta-value">{featureList.join(', ')}</span>
            </div>}
        </div>
      </div>
    </div>;
};

export const PromptBlock = ({children, type, agent, intent, playbookId}) => {
  var utm = 'utm_source=docs&utm_medium=use-case-gallery&utm_campaign=prompt-block';
  var tag = 'docs-use-case-gallery';
  var agentParams = (agent ? '&agent=' + agent : '') + (intent ? '&intent=' + intent : '') + (playbookId ? '&playbookId=' + playbookId : '');
  var label = type === 'schedule' ? 'Schedule in Devin' : type === 'playbook' ? 'Create Playbook' : type === 'knowledge' ? 'Add to Knowledge' : agent === 'advanced' ? 'Try in Devin' : agent === 'dana' ? 'Try in Dana' : agent === 'ada' ? 'Try in Ask Devin' : 'Try in Devin';
  var buildUrl = function (text) {
    var encoded = encodeURIComponent(text);
    if (type === 'schedule') return 'https://app.devin.ai/settings/schedules/create?' + utm + agentParams + '&prompt=' + encoded;
    if (type === 'playbook') return 'https://app.devin.ai/settings/playbooks/create?' + utm + '&body=' + encoded;
    if (type === 'knowledge') return 'https://app.devin.ai/knowledge?' + utm + '&body=' + encoded;
    if (agent === 'ada') return 'https://app.devin.ai/search?' + utm + '&noSubmit=true&prompt=' + encoded;
    return 'https://app.devin.ai/?tags=' + tag + '&' + utm + agentParams + '&prompt=' + encoded;
  };
  const ref = React.useRef(null);
  const [href, setHref] = React.useState('#');
  React.useEffect(() => {
    if (!ref.current) return;
    var codeEl = ref.current.querySelector('pre code');
    if (codeEl) {
      var text = codeEl.textContent.trim();
      if (text) setHref(buildUrl(text));
    }
    var header = ref.current.querySelector('[data-component-part="code-block-header"]');
    if (header && !header.querySelector('.prompt-block-devin-link')) {
      var link = document.createElement('a');
      link.href = href;
      link.target = '_blank';
      link.rel = 'noopener noreferrer';
      link.className = 'prompt-block-devin-link';
      link.style.cssText = 'display:inline-flex;align-items:center;gap:6px;text-decoration:none;color:#fff;font-size:11px;font-weight:500;padding:4px 10px;border-radius:6px;white-space:nowrap;background:#317CFF;transition:background 0.2s;margin-left:8px;';
      link.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/><polyline points="15 3 21 3 21 9"/><line x1="10" y1="14" x2="21" y2="3"/></svg> ' + label;
      link.onmouseenter = function () {
        link.style.background = '#2968D9';
      };
      link.onmouseleave = function () {
        link.style.background = '#317CFF';
      };
      header.appendChild(link);
    }
    var existingLink = ref.current.querySelector('.prompt-block-devin-link');
    if (existingLink && href !== '#') existingLink.href = href;
  });
  return <div className="prompt-block" ref={ref}>{children}</div>;
};

<UseCaseHero title="Slack での顧客ヘルスサマリー" description="Dana とプレイブックを使って、データベースから顧客アカウントの指標を取得し、オンデマンドで Slack に表示します。" prompt="@Devin !dana !customer-health Acme Corp のアカウントサマリーを表示して" category="データと分析" features="Integrations, Playbooks, MCP" agent="dana" />

<div className="uc-detail-wrapper">
  <Tip>手動でセットアップしますか？このページのリンクをDevinのセッションに貼り付け、すべての設定を依頼してください。</Tip>

  <Steps>
    <Step title="MCP 経由で顧客データベースを接続する">
      Dana が、あなたのカスタマーデータが保存されているデータベースにアクセスできるようにする必要があります。**Settings > Connections > MCP servers** に移動し、利用しているデータベースプロバイダーを見つけて **Enable** をクリックします。

      カスタマーメトリクス向けの一般的な構成:

      * アプリケーションデータ (ユーザー、アカウント、フィーチャーフラグ) には **PostgreSQL**
      * 分析用データウェアハウス (利用状況イベント、売上) には **Redshift** または **BigQuery**
      * 業務データと分析データを統合して扱う場合には **Snowflake**

      プロバイダーが一覧にない場合は **Add Your Own** をクリックし、接続文字列を指定します。本番データベースでは、必ず **read-only** の接続文字列、または権限が制限されたデータベースユーザーを使用してください。

      接続後、Devin のウェブアプリからすばやく [Dana session](/ja/work-with-devin/data-analyst) を開始して、動作を確認します:

      <PromptBlock agent="dana">
        ```txt Verify database connection theme={null}
        !dana List all tables in the analytics schema that contain the word "user" or "account"
        ```
      </PromptBlock>

      Dana がテーブル名を返せば、MCP は正常に動作しています。返ってこない場合は、**Settings > Connections > MCP servers** で認証情報を再確認し、データベースが Devin の IP レンジからの接続を許可していることを確認してください。
    </Step>

    <Step title="カスタマー・ヘルス・プレイブックを作成する">
      [**Settings > Playbooks > Create playbook**](https://app.devin.ai/settings/playbooks/create?utm_source=docs\&utm_medium=use-case-gallery) に移動し、名前を `!customer-health` に設定します。`!` プレフィックスを付けると、Slack から呼び出せる [マクロ](/ja/product-guides/using-playbooks) になります。

      各アカウントについて Dana に取得させたい指標を定義します。Playbook は汎用的な内容にしておきます。スキーマをもとに、適切なテーブルとクエリを判断するのは Dana が行います。

      <PromptBlock type="playbook">
        ```txt Customer Account Health Summary theme={null}
        When given a customer name, find and report:

        1. **Monthly active users** — 6-month trend with month-over-month change
        2. **Feature adoption** — which features the account used in the past 30 days and how many distinct users per feature
        3. **Support tickets** — open vs resolved in the past 30 days, average resolution time
        4. **Revenue** — current MRR and 6-month trend

        Format the output as:
        - A summary line with health verdict (Healthy / At Risk / Needs Attention)
        - A table with MAU trend, feature adoption count, open tickets, and current MRR
        - A short list of risk factors or positive signals based on the data
        ```
      </PromptBlock>

      Devin に依頼して、スキーマや指標に合わせてカスタマイズされた顧客ヘルス用の Playbook を生成することもできます。
    </Step>

    <Step title="Slack から実行する">
      [Slack integration](/ja/integrations/slack) を **Settings > Connections** で接続し、チームが顧客アカウントについて議論しているチャンネルに Devin が追加されていることを確認してください。

      `!dana` キーワードとマクロ名を使ってプレイブックを呼び出します:

      <PromptBlock agent="dana">
        ```txt 顧客ヘルスサマリーを取得 theme={null}
        @Devin !dana !customer-health Give me an account summary for Acme Corp
        ```
      </PromptBlock>

      Dana は接続済みデータベースにクエリを実行し、プレイブック内の SQL を実行して、整形されたサマリーをスレッド内で返信します:

      > **Acme Corp — リスクあり**
      >
      > | 指標           | 値                    | 推移         |
      > | ------------ | -------------------- | ---------- |
      > | 月間アクティブユーザー  | 342                  | 前月比 -8%    |
      > | 利用機能数 (30 日) | 10 個中 6 個            | 安定         |
      > | 未処理サポートチケット  | 12 件 (平均解決時間 8.2 時間) | 前月比 +3 件   |
      > | MRR          | \$4,850              | 3 か月連続で横ばい |
      >
      > **リスク要因:** MAU が減少している、過去 3 か月間拡大がない、直近でログイン障害に関するチケットが 3 件ある。

      同じスレッド内でフォローアップして、さらに深掘りできます:

      <PromptBlock agent="dana">
        ```txt ユーザーアクティビティを深掘り theme={null}
        @Devin !dana For Acme Corp, show me the daily active users for the past
        30 days. Flag any days where DAU dropped below 50% of the 30-day average.
        ```
      </PromptBlock>

      <PromptBlock agent="dana">
        ```txt プラン平均との比較 theme={null}
        @Devin !dana Compare Acme Corp's feature adoption and MAU to the median
        for all Enterprise-plan accounts. Where are they lagging?
        ```
      </PromptBlock>
    </Step>

    <Step title="ルーティン化する">
      アドホックな参照に対してプレイブックがうまく機能するようになったら、自動化も検討しましょう。

      * **定期セッション**: [scheduled Devin sessions](/ja/product-guides/scheduled-sessions) を使用して、Dana に毎週月曜日の朝、上位 10 件のアカウントのヘルスサマリーを `#customer-health` チャンネルに投稿させます。
      * **ミーティング前の準備**: 四半期ビジネスレビューの前に、特定のティア内のすべてのアカウントのサマリーを取得するよう Dana に依頼します — `@Devin !dana !customer-health Run this for all accounts where plan = 'Enterprise'`.
    </Step>
  </Steps>
</div>
