> ## 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="毎週 Devin セッションをスケジュールし、古くなったパッケージを検出してテストを実行し、更新 PR を作成します。" prompt="古くなった npm パッケージを確認してください。すべてのパッチおよびマイナーバージョンは 1 つの PR でまとめて更新し、テストスイートを実行して、変更内容を表形式で含めてください。メジャーバージョンを上げる必要があるものは、changelog の破壊的変更点をまとめたノートを添えて、別の PR を作成してください。" category="自動化" features="スケジュール" type="schedule" />

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

  <Steps>
    <Step title="週次スケジュールを作成する">
      [app.devin.ai](https://app.devin.ai/?utm_source=docs\&utm_medium=use-case-gallery) を開き、**Settings > Schedules** に移動します。**Create schedule** をクリックして、次のように設定します:

      * **Frequency:** Weekly — 例: 毎週月曜 午前7:00 UTC (`0 7 * * 1`)
      * **Prompt:** 下記の依存関係アップデート用プロンプトを貼り付ける

      <PromptBlock type="schedule">
        ```txt Weekly dependency update prompt theme={null}
        acme/frontend リポジトリで古くなっている npm パッケージを確認してください。それぞれについて:
        1. すべてのパッチおよびマイナー更新を 1 つの PR にまとめて更新する。
           フルテストスイートを実行し、変更のサマリー表を含める。
        2. 各メジャーバージョンアップについては、別々の PR を作成し、以下を含める:
           - パッケージの changelog に基づく破壊的変更の要約
           - 互換性を保つために必要なコード修正
           - 更新された lockfile
        3. `npm audit` を実行し、既知の脆弱性があるパッケージにフラグを付ける。
        ```
      </PromptBlock>

      チームが依存関係アップグレードをどのように扱うかについて [Playbook](/ja/product-guides/creating-playbooks) を使っている場合 (例: 更新後は常に `npm run build` を実行する、`devDependencies` はスキップする、など) 、それをスケジュールに紐づけておくと、毎回同じプロセスで実行されます。
    </Step>

    <Step title="Knowledge を追加してアップデート方針を制御する">
      すべてのパッケージを自動更新すべきとは限りません。**Settings > Knowledge** に移動し、Devin に何をスキップすべきか、あるいは慎重に扱うべきかを伝えるエントリーを追加します:

      * `react を v18 より先には更新しないこと — 別ブランチで v19 への移行作業中です。`
      * `@types/node は常に使用している Node.js のバージョン (20.x) に合わせて固定すること。`
      * `eslint-plugin-import はスキップすること — カスタムの lint 設定と衝突します。`
      * `テストコマンドは npm test ではなく npm run test:ci です。`

      これらの [Knowledge](/ja/product-guides/knowledge) エントリーはすべてのスケジュール実行にわたって保持されるため、毎回プロンプトで繰り返さなくても Devin が制約を尊重します。
    </Step>

    <Step title="Devin の成果をレビューする">
      毎週月曜、Devin はリポジトリで古くなっているパッケージを確認し、代わりに PR を作成します。典型的な週では次のような成果が得られます:

      **PR #1 — 安全な更新 (パッチ + マイナー) :**

      ```
      ## Dependency Updates — Week of Feb 10

      | Package         | From    | To      | Type  |
      |-----------------|---------|---------|-------|
      | axios           | 1.6.2   | 1.6.8   | patch |
      | react-query     | 5.17.0  | 5.22.1  | minor |
      | tailwindcss     | 3.4.1   | 3.4.6   | patch |
      | typescript      | 5.3.3   | 5.3.5   | patch |

      847 件のテストがすべてパスしました。npm audit による脆弱性は検出されませんでした。
      ```

      **PR #2 — メジャーアップデート (分離し、メモ付き) :**

      ```
      ## Major Update: zod 3.x → 4.0.0

      Breaking changes (CHANGELOG より):
      - `z.object().strict()` がデフォルト動作になりました
      - `z.enum` には少なくとも 1 つの値が必要になりました
      - 非推奨だった `.check()` メソッドが削除されました

      この PR でのコード変更:
      - 明示的な `.strict()` 呼び出しを削除するために 3 つのスキーマファイルを更新
      - src/schemas/status.ts の空の enum にフォールバック値を追加
      ```

      Devin は各 PR ごとに個別にテストスイートを実行するため、安全なバッチはすぐにマージしつつ、メジャーアップデートは時間をかけてレビューできます。
    </Step>

    <Step title="改善と拡張を重ねる">
      週次スケジュールが動き始めたら、時間をかけて洗練させていくことができます。任意のスケジュール済みセッションに返信して、Devin に追加の指示を伝えます:

      <PromptBlock>
        ```txt Handle a major update theme={null}
        zod v3 から v4 への移行を進めてください。https://zod.dev/v4 のマイグレーションガイドを確認し、すべてのスキーマファイルをそれに合わせて更新してください。
        ```
      </PromptBlock>

      <PromptBlock>
        ```txt Expand to backend deps theme={null}
        acme/backend リポジトリ内の Python パッケージについても、pip を使って古くなっているものを確認してください。
        互換性のあるバージョンはすべて更新し、別の PR を作成してください。PR を作成する前に pytest を実行してください。
        ```
      </PromptBlock>

      **スムーズに運用するためのヒント:**

      * **フロントエンドとバックエンドを分ける** — リポジトリに両方含まれている場合は、2 つのスケジュールを作成し、各 PR の対象を絞ってレビューしやすくします。
      * **マージ前に CI を最後まで実行させる** — 見た目には安全そうなマイナーアップデートでも、微妙なバグを引き起こす可能性があります。Devin はテストを実行しますが、フル CI パイプラインを流すことで、さらに高い信頼性を得られます。
      * 実行履歴の監視、コードフリーズ中のスケジュール一時停止、cron 式の調整には、**[Schedules](/ja/product-guides/scheduled-sessions) ページ** を確認してください。
    </Step>
  </Steps>
</div>
