body method

  1. @override
String body(
  1. String path,
  2. String baseName,
  3. String className
)
override

Defines the actual body code. path is passed relative to lib, baseName is the filename, and className is the filename converted to Pascal case.

実際の本体コードを定義します。pathlibからの相対パス、baseNameにファイル名が渡され、classNameにファイル名をパスカルケースに変換した値が渡されます。

Implementation

@override
String body(String path, String baseName, String className) {
  return """
name: 🐛 バグ報告・修正
description: バグを発見した場合や修正を依頼する際に使用してください
title: "[バグ修正] "
labels: ["bug"]
body:
- type: markdown
  attributes:
    value: |
      ## バグ報告・修正依頼

      このテンプレートはバグを発見した場合や修正を依頼する際に使用してください。
      詳細な情報を提供することで、迅速な問題解決が可能になります。

- type: textarea
  id: bug-description
  attributes:
    label: バグの概要
    description: 発生しているバグについて簡潔に説明してください
    placeholder: "例: ユーザープロフィール画面で保存ボタンを押してもデータが保存されない"
  validations:
    required: true

- type: textarea
  id: steps-to-reproduce
  attributes:
    label: 再現手順
    description: バグを再現するための詳細な手順を記載してください
    placeholder: |
      1. アプリを起動する
      2. ユーザープロフィール画面に移動する
      3. 名前フィールドを編集する
      4. 保存ボタンをタップする
      5. エラーが発生する
  validations:
    required: true

- type: textarea
  id: expected-behavior
  attributes:
    label: 期待される動作
    description: 正常な場合にどのような動作をするべきかを記載してください
    placeholder: "保存ボタンをタップした際に、編集した内容が正常に保存され、成功メッセージが表示される"
  validations:
    required: true

- type: textarea
  id: actual-behavior
  attributes:
    label: 実際の動作
    description: 実際に発生している動作を詳しく記載してください
    placeholder: "保存ボタンをタップしても何も反応せず、データも保存されない。エラーメッセージも表示されない。"
  validations:
    required: true

- type: checkboxes
  id: affected-platforms
  attributes:
    label: 影響を受けるプラットフォーム
    description: バグが発生するプラットフォームを選択してください
    options:
      - label: iOS
      - label: Android
      - label: Web
      - label: macOS
      - label: Windows
      - label: Linux

- type: textarea
  id: environment
  attributes:
    label: 環境情報
    description: バグが発生している環境の詳細を記載してください
    placeholder: |
      ## デバイス情報
      - OS: iOS 17.0 / Android 14 / etc
      - デバイス: iPhone 15 Pro / Pixel 8 / etc
      - アプリバージョン: v1.0.0

      ## Flutter環境
      - Flutter バージョン: 3.x.x
      - Dart バージョン: 3.x.x

      ## その他
      - ネットワーク環境: WiFi / 4G / 5G
      - 特記事項: ___________

- type: textarea
  id: error-logs
  attributes:
    label: エラーログ・スタックトレース
    description: 関連するエラーログやスタックトレースがあれば貼り付けてください
    placeholder: |
      ```
      ここにエラーログやスタックトレースを貼り付けてください
      ```

- type: textarea
  id: screenshots
  attributes:
    label: スクリーンショット・画面録画
    description: バグの状況がわかるスクリーンショットや画面録画があれば添付してください
    placeholder: |
      スクリーンショットやGIFファイルをドラッグ&ドロップで添付できます。

      または以下のように記載してください:
      ![バグの状況](URL)

- type: textarea
  id: additional-context
  attributes:
    label: 補足情報
    description: その他のバグに関する重要な情報があれば記載してください
    placeholder: |
      - 関連するIssueのリンク
      - 外部サービスとの連携に関する問題
      - ユーザーからの報告頻度
      - ビジネスへの影響

- type: textarea
  id: instructions
  attributes:
    label: 作業実施の手順やルール
    description: ClaudeCodeに依頼する作業実施の手順やルールを記載してください
    value: |
      @claude
      下記の手順やルールに従って、上記の内容の実施を行ってください。

      ### 作業実施のルール
      - FlutterおよびMasamuneフレームワークのルールに従って実施。
      - `requirements.md`の代わりに上記の要件定義を参考にアプリケーションの開発を実施。
      - `設計書`の作成手順は`documents/rules/designs/**/*.md`を参考に実施。
      - `実装`の手順は`documents/rules/impls/**/*.md`を参考に実施。
      - `テスト`の手順は`documents/rules/tests/**/*.md`を参考に実施。
      - その他、FlutterおよびMasamuneフレームワークの実装のルールや手順については`documents/rules/docs/**/*.md`を参考にする。
      - コーディングについては`flutter analyze && dart run custom_lint`を実行しながらErrorやWarningが発生しないように開発を実施。
      - PageやWidgetはのアプリケーションUIについては`katana test update`を実行してスクリーンショット画像を作成し、それを確認しながら開発を実施。
      - 変更のコミットは`katana git commit`を利用して実施。
      - PRの作成は`katana git pull_request`、PRへのコメントは`katana git pull_request_comment`を利用して実施。

      ### 作業実施の手順

      1. 上記要件から改修を実施。
          - 実装中に`flutter analyze && dart run custom_lint`や`katana test update`を実行してエラーがないか確認しながら1つずつ実装。
      2. `flutter analyze && dart run custom_lint`を実行してErrorやWarningがないか確認。ErrorやWarningが発生していた場合は修正を実施して再度実行。ErrorやWarningがなくなるまで繰り返す。
      3. 画面の作成や変更を行った場合は`katana test update`を実行してゴールデンテスト用のスクリーンショット画像を更新。
      4. `katana test run`を実行してテストが全てパスするか確認。
      5. `katana git commit`を実行して変更をコミット。
      6. `katana git pull_request`を実行してPRを作成、既存のPRがある場合は`katana git pull_request_comment`でコメントを追加。
  validations:
    required: true
""";
}