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

# GitHubプロジェクトにコントリビュートする

> チャットからリポジトリをインポートし、小さな変更を依頼してプレビューで確認したら、Agentにプルリクエストを作成してもらいます。

export const Connectors = ({items}) => <div style={{
  margin: "8px 0 20px"
}}>
    <style>{`
      .connectors-list, .connectors-list * { margin-top: 0 !important; margin-bottom: 0 !important; }
      .connectors-row {
        display: flex !important;
        align-items: flex-start !important;
        gap: 10px !important;
        padding: 4px 0 !important;
        min-height: 0 !important;
        height: auto !important;
      }
      .connectors-row img {
        width: 20px !important;
        height: 20px !important;
        max-width: 20px !important;
        max-height: 20px !important;
        margin: 2px 0 0 !important;
        display: block !important;
      }
    `}</style>
    <div className="connectors-list">
      {items.map((item, i) => <div key={item.id} className="connectors-row" style={{
  borderTop: i === 0 ? "none" : "1px solid rgba(130,130,130,0.22)"
}}>
          <img src={`/images/connectors/${item.id}.svg`} alt="" width={20} height={20} />
          <div style={{
  minWidth: 0
}}>
            <div>
              <strong>{item.name}</strong>
              {item.why ? <span style={{
  opacity: 0.72
}}> · {item.why}</span> : null}
            </div>
            {item.auth === "api-key" ? <div style={{
  fontSize: "11.5px",
  lineHeight: 1.35,
  color: "#F26207",
  marginTop: "2px"
}}>
                Not a native connector. Agent will ask for your API key.
              </div> : null}
          </div>
        </div>)}
    </div>
  </div>;

export const AiPrompt = ({children}) => {
  return <CodeBlock className="relative block max-w-full overflow-x-hidden font-sans !whitespace-pre-wrap !break-words" style={{
    overflowWrap: "anywhere",
    wordBreak: "break-word"
  }}>
      <div className="pr-7" style={{
    whiteSpace: "pre-wrap",
    overflowWrap: "anywhere",
    wordBreak: "break-word"
  }}>
        {children}
      </div>
    </CodeBlock>;
};

書き込み権限のあるリポジトリに、チャットから直接小さな変更を加えます。プロンプトボックスからリポジトリをインポートし、普通の言葉で変更を依頼して、ライブプレビューで確認します。問題なければ、Agentがブランチにコミットしてプッシュし、説明文を記入したプルリクエストを作成します。

## 最適な用途

* ローカル環境を構築せずに変更をリリースしたい開発者。
* 誤字の修正や文言の修正など、開発者の作業を中断させずに小さな変更を行いたい非開発者。

## コネクタ

<Connectors
  items={[
{
  id: "github",
  name: "GitHub",
  why: "インポートするリポジトリ、プッシュ先のブランチ、プルリクエスト",
},
]}
/>

## 始める前に

小さく範囲の明確な変更を1つ選び、プロジェクトにコントリビューションガイドがあれば確認してください。Agentはブランチを直接プッシュし、そこからプルリクエストを作成するため、リポジトリへの書き込み権限が必要です。

プロンプトボックスで **plus** メニューを開き、**Import an existing project** を選択し、**GitHub** を選んでリポジトリのURLを貼り付けます。リポジトリのリンクをプロンプトボックスに直接貼り付けることもできます。

## エージェントへの指示

<AiPrompt>
  This is \[Repo link], imported from GitHub. Change the H1 on the home
  page from \[current text] to \[new text]. Keep the project's existing styling
  and copy conventions, don't touch anything else, and show me a preview of the
  page running.
</AiPrompt>

## 期待できること

<Steps>
  <Step title="Agentがプロジェクトをセットアップする">
    リポジトリを読み取り、依存関係をインストールし、環境変数が不足している場合など、推測できないことがあれば質問します。
  </Step>

  <Step title="適切なファイルを見つける">
    文字列が一致する箇所だけでなく適切なファイルを特定し、編集する前に変更の予定を伝えます。
  </Step>

  <Step title="変更を適用してプレビューを開く">
    差分ではなく、実際のページを確認できます。
  </Step>

  <Step title="プルリクエストを依頼する">
    プレビューで問題ないことを確認したら、同じチャットで依頼します。これにより変更が保存され、プルリクエストとしてチームに送られるため、公開前に誰かがレビューできます。先に、GitHubの接続が有効であることを確認してください。

    <AiPrompt>
      Commit this change and open a pull request for review. Give it a clear
      title and write the description based on what changed and how I
      checked it.
    </AiPrompt>
  </Step>
</Steps>

最終的に、変更内容、理由、確認方法が記入されたプルリクエストがリポジトリに作成されます。送信する前に、差分をご自身で確認してください。レビュアーは広範囲に及ぶ変更に難色を示すので、無関係な変更は別のプルリクエストにしましょう。

## 自分に合わせてカスタマイズする

<AiPrompt>
  Before you commit, run the project's linter and test suite and show me
  anything that fails. List every file the diff touches and flag anything
  unrelated to \[change].
</AiPrompt>

<AiPrompt>
  A reviewer left these review comments \[paste]. Apply the ones that are
  factual fixes, tell me which ones you disagree with and why, then push to the
  same branch.
</AiPrompt>

## トラブルシューティング

<AccordionGroup>
  <Accordion title="プレビューが起動しない">
    プロジェクトには、実行コマンドや環境変数が必要です。Agentにコントリビューションガイドとサンプルの環境ファイルを読んでもらい、何が不足しているかを具体的に教えてもらってください。
  </Accordion>

  <Accordion title="プッシュが拒否される">
    リポジトリへの書き込み権限があること、およびGitHubの接続が有効であることを確認してください。組織によっては、ブランチ名を制限したり、署名付きコミットを必須にしたりしています。Agentに正確なエラーを表示してもらってください。
  </Accordion>

  <Accordion title="レビュアーから変更を求められた">
    同じブランチにコミットして、もう一度プッシュしてください。プルリクエストは自動的に更新されるので、2つ目を作成しないでください。
  </Accordion>
</AccordionGroup>

## 関連情報

<CardGroup cols={2}>
  <Card title="リリースノートを生成する" href="/ja/use-cases/generate-release-notes">
    マージされたプルリクエストを、読みやすいノートに変換します。
  </Card>

  <Card title="アプリをプレビューする" href="/ja/features/editor/preview">
    プルリクエストを作成する前に、変更が動作する様子をライブで確認します。
  </Card>
</CardGroup>
