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

# 来自 PR 的每周变更日志

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="来自 PR 的每周变更日志" description="将已发布的 pull request（PR）汇总为分类变更日志，将其发布到 Slack，并打开一个 PR 来更新文档。" prompt="收集本周合并到发布分支的所有 pull request（PR），涵盖我们的前端、后端和移动端代码仓库。按“新功能”“缺陷修复”“改进”分组生成变更日志。将其发布到 Slack 中的 #releases 频道，并在文档仓库中打开一个 PR 来更新 CHANGELOG.md。" category="自动化" features="计划任务, 集成" type="schedule" />

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

  <Steps>
    <Step title="连接 Slack">
      Devin 会将变更日志发布到 Slack，并针对你的文档仓库打开一个 PR，因此你需要先完成 Slack 集成。

      前往 **Settings > Connections > Slack** 并连接你的工作区 (workspace) 。Devin 将能够向任何被邀请的频道发送消息。将 Devin 添加到你希望发布变更日志的频道 (例如 `#releases`) 。详情参见 [Slack integration guide](/zh/integrations/slack)。
    </Step>

    <Step title="创建每周计划">
      在 [app.devin.ai](https://app.devin.ai/?utm_source=docs\&utm_medium=use-case-gallery) 左侧边栏中进入 **Schedules**，或在首页输入框的上下文菜单中使用 **Schedule Devin** 选项。点击 **Create schedule** 并进行如下配置：

      * **Frequency：** Weekly —— 例如，每周五 UTC 时间下午 4:00
      * **Repositories：** 选择 Devin 需要扫描已合并 PR 的仓库
      * **Slack channel：** 选择一个频道 (例如 `#releases`) ，这样当变更日志准备好时你的团队就能看到
      * **Prompt：** 明确说明涉及的代码仓库、分组逻辑、语气和输出格式——并告知 Devin 要匹配你现有变更日志条目的风格，这样每周的输出都保持一致

      <PromptBlock type="schedule">
        ```txt Weekly changelog prompt theme={null}
        Gather all PRs merged to the release branch this week across these
        repos:
        - acme/frontend
        - acme/backend
        - acme/mobile

        Only include PRs that made it to the release branch — ignore PRs
        merged to main that haven't been released yet.

        Generate a changelog grouped into these sections, in this order:
        1. **New Features** — PRs with a `feat:` prefix or `feature` label
        2. **Bug Fixes** — PRs with a `fix:` prefix or `bug` label
        3. **Improvements** — performance, refactors, DX improvements
           (anything that isn't a feature, fix, or chore)

        Skip PRs labeled `internal` or `chore`.

        For each entry:
        - Lead with a short, user-facing title (not the raw PR title)
        - Follow with a one-sentence summary of what changed and why
        - Include the PR number and author handle
        - Keep the tone concise and factual — no marketing language

        Read the existing entries in CHANGELOG.md in the acme/docs repo
        and match their heading style, bullet format, and level of detail
        exactly.

        Post the result to #releases in Slack and open a PR against the
        acme/docs repo to prepend the new section to CHANGELOG.md.
        ```
      </PromptBlock>

      Devin 会扫描每个仓库中过去 7 天内合并的 PR，读取它们的标题、描述和标签以进行分类，然后生成如下输出：

      ```markdown theme={null}
      # Changelog — Week of Feb 14, 2026

      ## New Features
      - **User profile avatars** — Upload custom avatars from the settings page (#412, @alice)
      - **CSV export for analytics** — Export any dashboard chart as CSV (#398, @bob)

      ## Bug Fixes
      - **Date picker timezone** — Fixed UTC offset in booking flow (#419, @carol)
      - **iOS nav overlap** — Resolved navbar covering content on Safari (#421, @dave)

      ## Improvements
      - **API rate limiting** — Per-key rate limits on webhook endpoints (#210, @bob)
      - **Search performance** — Full-text search 3x faster on large datasets (#405, @alice)
      ```
    </Step>

    <Step title="根据受众进行定制">
      同一个计划可以根据阅读变更日志的人不同而生成不同的输出。添加 [Knowledge](/zh/product-guides/knowledge) 条目来让 Devin 学习你团队的约定做法，或者针对不同受众调整提示词。

      **面向内部工程团队** —— 包含 PR 编号、作者账号 (handle) 以及 PR 链接。提及基础架构变更和内部工具更新。

      **面向用户的发行说明** —— 去除技术细节，用通俗语言重写，并完全跳过内部变更：

      <PromptBlock>
        ```txt User-facing release notes theme={null}
        Rewrite this week's changelog for customers. Only include PRs that
        made it to the release branch. Remove anything internal. Use
        non-technical language — focus on what users can now do, not how
        it was built. Post to #product-updates in Slack instead of #releases.
        ```
      </PromptBlock>
    </Step>
  </Steps>
</div>
