> ## 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.

# Notion 每周状态汇总

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="Notion 每周状态摘要" description="已排程的 Devin 会汇总最近的 PR 和提交，然后每周向你的 Notion 页面发布一条格式化的状态更新。" prompt="查看过去 7 天内在我们各个代码仓库中已合并的 PR 和提交。总结已经上线的内容、正在进行中的工作，以及任何阻塞因素。在 Notion 中的 Engineering Status 页面添加一个带日期的新章节并完成更新。" category="Automations" features="Schedules, MCP" type="schedule" />

<div className="uc-detail-wrapper">
  <Tip>不想手动设置？将此页面的链接粘贴到 Devin 会话中，然后让它为你完成全部设置。</Tip>

  <Steps>
    <Step title="连接 Notion MCP">
      Devin 需要对你的 Notion 工作区的写入权限来更新状态页面。前往 **Settings > Connections > MCP servers**，找到 **Notion**，并点击 **Enable**。系统会提示你完成 OAuth 授权流程 —— 请使用服务账户，而不是你个人的 Notion 账户，因为该访问权限会在整个组织中共享。

      连接完成后，通过启动一次快速 Devin 会话来验证是否生效：

      <PromptBlock>
        ```txt 测试 Notion 连接 theme={null}
        找到标题为 "Engineering Status" 的 Notion 页面，并列出其内容。
        ```
      </PromptBlock>

      如果 Devin 找到你的状态页面，说明已经就绪。如果没有，请检查 Notion 集成是否有权访问正确的页面 —— 在 Notion 中打开该页面，点击 **...** > **Connections**，并添加该集成。
    </Step>

    <Step title="编写状态更新提示词">
      你的提示词会告诉 Devin 要检查哪些仓库、要总结什么内容，以及把结果写到哪里。请对 Notion 页面以及你希望的输出格式进行具体说明。

      <PromptBlock type="schedule">
        ```txt Weekly status update theme={null}
        Review the last 7 days of merged PRs and commits across our repositories
        (acme/web-app, acme/api-server, acme/infra).

        Summarize the high-level project areas that saw activity and list the
        contributors for each. Update the Notion page "Engineering Status" by
        adding a new dated section at the top.
        ```
      </PromptBlock>
    </Step>

    <Step title="安排每周运行">
      前往 [**Settings > Schedules**](/zh/product-guides/scheduled-sessions) 并点击 **Create schedule**。

      * **Name**：`Weekly Engineering Status Update`
      * **Schedule type**：Recurring
      * **Frequency**：Weekly — 每周一上午 8:00 (站会前)
      * **Prompt**：粘贴上一步编写的提示词
      * **Email notifications**：设置为 **On failure only**，这样一旦出问题你就会收到提醒
      * **Slack channel** (可选) ：选择一个频道来接收会话通知 —— 当状态页面更新时，用于提醒你的团队

      点击 **Save**。Devin 现在会在每周一早上自动运行此会话。每次运行都会显示在该排程详情页的 **Past Sessions** 中，你可以查看 Devin 发布的内容。

      在真正依赖这个排程之前，先以常规会话的方式手动运行一次，以确认 Notion 输出效果是否符合预期。根据结果调整提示词 —— 例如，如果 Devin 对每个 PR 的描述太详细，可以在提示词中加上“keep descriptions under 15 words.”。
    </Step>
  </Steps>
</div>
