Dropstone Docs

GitHub

GitHub の issue と pull request で Dropstone を使用します。

Dropstone は GitHub ワークフローと統合されます。任意のコメントで /dropstone と記述すると、Dropstone は GitHub Actions ランナー内でタスクを実行します。


機能

  • Issue のトリアージ: Dropstone に issue を調査させ、説明してもらいます。
  • 修正と実装: Dropstone に issue を修正させたり、機能を実装させたりします。新しいブランチで作業し、すべての変更を含む PR を送信します。
  • セキュア: Dropstone は GitHub のランナー内で実行されます。

インストール

GitHub リポジトリ内にあるプロジェクトで、以下のコマンドを実行します。

dropstone github install

このコマンドは GitHub アプリのインストール、ワークフローの作成、シークレットの設定をガイドします。


手動セットアップ

または、手動でセットアップすることもできます。

  1. GitHub アプリをインストール

    github.com/apps/dropstone-agent にアクセスします。対象のリポジトリにインストールされていることを確認してください。

  2. ワークフローを追加

    以下のワークフローファイルをリポジトリの .github/workflows/dropstone.yml に追加します。env で適切な model と必要な API キーを設定してください。

    name: dropstone
    
    on:
      issue_comment:
        types: [created]
      pull_request_review_comment:
        types: [created]
    
    jobs:
      dropstone:
        if: contains(github.event.comment.body, '/dropstone')
        runs-on: ubuntu-latest
        permissions:
          id-token: write
        steps:
          - name: Checkout repository
            uses: actions/checkout@v6
            with:
              fetch-depth: 1
              persist-credentials: false
    
          - name: Run Dropstone
            uses: blankline-org/dropstone-cli/github@latest
            env:
              DROPSTONE_API_KEY: ${{ secrets.DROPSTONE_API_KEY }}
            with:
              model: dropstone/dropstone-pro
              # share: true
              # github_token: xxxx
    
  3. リポジトリシークレットに API キーを保存

    組織またはリポジトリの Settings で、左側の Secrets and variables を展開し、Actions を選択します。DROPSTONE_API_KEY を新しいリポジトリシークレットとして追加します。


設定

  • model: 使用する Dropstone ティア。dropstone/dropstone-fastdropstone/dropstone-pro、または dropstone/dropstone-heavy のいずれか。これは 必須 です。

  • agent: 使用するエージェント。プライマリエージェントである必要があります。見つからない場合は、config の default_agent または "build" にフォールバックします。

  • share: Dropstone セッションを共有するかどうか。パブリックリポジトリではデフォルトで true です。

  • prompt: デフォルトの動作をオーバーライドするオプションのカスタムプロンプト。Dropstone がリクエストを処理する方法をカスタマイズするために使用します。

  • token: コメントの作成、変更のコミット、pull request のオープンなどの操作を実行するためのオプションの GitHub アクセストークン。デフォルトでは、Dropstone は Dropstone GitHub App からのインストールアクセストークンを使用するため、コミット、コメント、pull request はアプリから送信されたように表示されます。

    または、Dropstone GitHub App をインストールせずに、GitHub Action ランナーの 組み込み GITHUB_TOKEN を使用できます。ワークフローで必要な権限を付与してください。

    permissions:
      id-token: write
      contents: write
      pull-requests: write
      issues: write
    

    必要に応じて personal access tokens(PAT) を使用することもできます。


サポートされているイベント

Dropstone は以下の GitHub イベントでトリガーできます。

イベントタイプトリガー元詳細
issue_commentissue または PR のコメントコメント内で /dropstone と記述します。Dropstone はコンテキストを読み取り、ブランチの作成、PR のオープン、返信ができます。
pull_request_review_commentPR の特定のコード行へのコメントPR の「Files」タブでコードをレビュー中に /dropstone と記述します。Dropstone はファイルパス、行番号、diff コンテキストを受け取ります。
issuesIssue のオープンまたは編集issue が作成または変更されたときに自動的に Dropstone をトリガーします。prompt 入力が必要です。
pull_requestPR のオープンまたは更新PR がオープン、同期、または再度オープンされたときに自動的に Dropstone をトリガーします。自動レビューに便利です。
scheduleCron ベースのスケジュールスケジュールに従って Dropstone を実行します。prompt 入力が必要です。出力はログと PR に送信されます(コメント対象の issue はありません)。
workflow_dispatchGitHub UI からの手動トリガーActions タブから Dropstone をオンデマンドでトリガーします。prompt 入力が必要です。出力はログと PR に送信されます。

スケジュール例

スケジュールに従って Dropstone を実行し、自動化されたタスクを実行します。

name: Scheduled Dropstone Task

on:
  schedule:
    - cron: "0 9 * * 1" # Every Monday at 9am UTC

jobs:
  dropstone:
    runs-on: ubuntu-latest
    permissions:
      id-token: write
      contents: write
      pull-requests: write
      issues: write
    steps:
      - name: Checkout repository
        uses: actions/checkout@v6
        with:
          persist-credentials: false

      - name: Run Dropstone
        uses: blankline-org/dropstone-cli/github@latest
        env:
          DROPSTONE_API_KEY: ${{ secrets.DROPSTONE_API_KEY }}
        with:
          model: dropstone/dropstone-pro
          prompt: |
            Review the codebase for any TODO comments and create a summary.
            If you find issues worth addressing, open an issue to track them.

スケジュール済みイベントの場合、コメントから指示を抽出する対象がないため、prompt 入力は 必須 です。スケジュール済みワークフローはユーザーコンテキストなしで実行されるため、Dropstone がブランチまたは PR を作成することが予想される場合、ワークフローは contents: writepull-requests: write を付与する必要があります。


Pull Request 例

PR がオープンまたは更新されたときに自動的に PR をレビューします。

name: dropstone-review

on:
  pull_request:
    types: [opened, synchronize, reopened, ready_for_review]

jobs:
  review:
    runs-on: ubuntu-latest
    permissions:
      id-token: write
      contents: read
      pull-requests: read
      issues: read
    steps:
      - uses: actions/checkout@v6
        with:
          persist-credentials: false
      - uses: blankline-org/dropstone-cli/github@latest
        env:
          DROPSTONE_API_KEY: ${{ secrets.DROPSTONE_API_KEY }}
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          model: dropstone/dropstone-pro
          use_github_token: true
          prompt: |
            Review this pull request:
            - Check for code quality issues
            - Look for potential bugs
            - Suggest improvements

pull_request イベントの場合、prompt が提供されていなければ、Dropstone はデフォルトで pull request をレビューします。


Issue トリアージ例

新しい issue を自動的にトリアージします。この例では、スパムを減らすために 30 日以上前のアカウントにフィルタリングします。

name: Issue Triage

on:
  issues:
    types: [opened]

jobs:
  triage:
    runs-on: ubuntu-latest
    permissions:
      id-token: write
      contents: write
      pull-requests: write
      issues: write
    steps:
      - name: Check account age
        id: check
        uses: actions/github-script@v7
        with:
          script: |
            const user = await github.rest.users.getByUsername({
              username: context.payload.issue.user.login
            });
            const created = new Date(user.data.created_at);
            const days = (Date.now() - created) / (1000 * 60 * 60 * 24);
            return days >= 30;
          result-encoding: string

      - uses: actions/checkout@v6
        if: steps.check.outputs.result == 'true'
        with:
          persist-credentials: false

      - uses: blankline-org/dropstone-cli/github@latest
        if: steps.check.outputs.result == 'true'
        env:
          DROPSTONE_API_KEY: ${{ secrets.DROPSTONE_API_KEY }}
        with:
          model: dropstone/dropstone-pro
          prompt: |
            Review this issue. If there's a clear fix or relevant docs:
            - Provide documentation links
            - Add error handling guidance for code examples
            Otherwise, do not comment.

issues イベントの場合、コメントから指示を抽出する対象がないため、prompt 入力は 必須 です。


カスタムプロンプト

デフォルトプロンプトをオーバーライドして、ワークフローに合わせて Dropstone の動作をカスタマイズします。

- uses: blankline-org/dropstone-cli/github@latest
  with:
    model: dropstone/dropstone-pro
    prompt: |
      Review this pull request:
      - Check for code quality issues
      - Look for potential bugs
      - Suggest improvements

これは、プロジェクトに関連する特定のレビュー基準、コーディング標準、または焦点領域を強制するのに便利です。


GitHub で Dropstone を使用する方法の例を以下に示します。

  • Issue を説明する

    GitHub issue にこのコメントを追加します。

    /dropstone explain this issue
    

    Dropstone はスレッド全体(すべてのコメントを含む)を読み取り、明確な説明で返信します。

  • Issue を修正する

    GitHub issue で以下のように記述します。

    /dropstone fix this
    

    Dropstone は新しいブランチを作成し、変更を実装し、変更を含む PR をオープンします。

  • PR をレビューして変更を加える

    GitHub PR に以下のコメントを残します。

    /dropstone delete the attachment from S3 when the note is removed
    

    Dropstone は要求された変更を実装し、同じ PR にコミットします。

  • 特定のコード行をレビューする

    PR の「Files」タブのコード行に直接コメントを残します。Dropstone は自動的にファイル、行番号、diff コンテキストを検出して、正確な応答を提供します。

    [Files タブの特定の行にコメント]
    /dropstone add error handling here
    

    特定の行にコメントする場合、Dropstone は以下を受け取ります。

    • レビュー対象の正確なファイル
    • コードの特定の行
    • 周囲の diff コンテキスト
    • 行番号情報

    これにより、ファイルパスや行番号を手動で指定する必要なく、より的を絞ったリクエストが可能になります。

Ctrl+I