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: ["enhancement", "improvement"]
body:
- type: markdown
  attributes:
    value: |
      ## 機能改修・改善依頼

      このテンプレートは既存の機能やページを改修・改善する際に使用してください。
      変更内容とその影響範囲を明確にして実装を行います。

- type: input
  id: target-feature
  attributes:
    label: 対象機能
    description: 改修対象の機能名やファイル名を入力してください
    placeholder: "例: ユーザープロフィール画面 (lib/pages/user/my.dart)"
  validations:
    required: true

- type: textarea
  id: current-behavior
  attributes:
    label: 現在の動作
    description: 現在の機能の動作や状態を詳しく説明してください
    placeholder: |
      現在の動作:
      - 現在どのように動作しているか
      - 現在の問題点
      - 改善したい箇所
  validations:
    required: true

- type: textarea
  id: desired-behavior
  attributes:
    label: 期待する動作
    description: 改修後にどのような動作になってほしいかを詳しく説明してください
    placeholder: |
      期待する動作:
      - 改修後の理想的な動作
      - 解決すべき課題
      - ユーザーへの影響
  validations:
    required: true

- type: textarea
  id: additional-info
  attributes:
    label: 補足情報
    description: その他の重要な情報があれば記載してください
    placeholder: |
      - 参考資料のURL
      - 関連する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
""";
}