Skip to content
This repository was archived by the owner on Mar 11, 2026. It is now read-only.

refactor(workflows): Extract Claude prompts to external Markdown files#10

Merged
UtakataKyosui merged 9 commits into
mainfrom
refactor/actions
Jan 12, 2026
Merged

refactor(workflows): Extract Claude prompts to external Markdown files#10
UtakataKyosui merged 9 commits into
mainfrom
refactor/actions

Conversation

@UtakataKyosui

Copy link
Copy Markdown
Owner

概要

GitHub Actions ワークフロー内に直書きされていた Claude へのプロンプトを、.github/prompts/ ディレクトリ配下の独立した Markdown ファイルに分離しました。

変更内容

  • プロンプト定義を .github/prompts/*.md に移動
  • 各ワークフロー (claude.yml, claude-docs.yml 等) で envsubst を使用してプロンプトファイル内の変数を動的に置換するように修正
  • 共通セットアップアクション setup-claude-env の導入により、環境構築手順を共通化

目的

  • プロンプトの可読性と保守性の向上
  • プロンプト内の変数 (${\{ ... \}}) と GitHub Actions のコンテキスト変数の分離管理
  • シェルスクリプトによる柔軟な変数置換 (envsubst) の導入

影響範囲

  • Claude 連携ワークフロー全般

Add repository name check to all workflows to prevent Actions from
running on the template repository (UtakataKyosui/SmartPhoneAutoDevelopSetup).

This ensures that workflows only run when the repository is used as a
template and renamed by users.

Modified workflows:
- claude.yml
- claude-code-review.yml
- claude-spec.yml
- claude-project.yml
- claude-docs.yml
- claude-project-management.yml
Create .github/actions/setup-claude-env to consolidate common setup steps:
- Checkout repository
- Setup Node.js
- Install uv CLI
- Setup Git configuration (configurable user/email)
- Get and export PR info

Updated workflows to use this composite action:
- claude.yml
- claude-spec.yml
- claude-project.yml
- claude-docs.yml
- claude-project-management.yml
@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello @UtakataKyosui, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

このプルリクエストは、Claude Code Actionsワークフローを大幅にリファクタリングし、プロンプトを専用のMarkdownファイルに外部化することで、モジュール性と保守性を向上させています。また、Claude環境の標準的なセットアップアクションを導入しました。これと並行して、「Spec Kit + TDD」ワークフローとその関連コンポーネントが削除され、プロジェクトの開発手法が合理化されました。

Highlights

  • プロンプトの外部化: ClaudeプロンプトをGitHub Actionsワークフローから.github/prompts/ディレクトリ配下の外部Markdownファイルに分離しました。
  • 動的な変数置換: 各ワークフローはenvsubstコマンドを使用し、プロンプトファイル内の変数をGitHub Actionsのコンテキスト変数で動的に置換するようになりました。
  • 共通セットアップアクションの導入: 共通の環境設定手順をカプセル化する新しいGitHub Actionsコンポジットアクションsetup-claude-envが導入されました。
  • Spec Kit + TDDワークフローの削除: Spec Kit + TDD関連のファイル、ドキュメント、およびIssue/PRテンプレートが削除または更新され、プロジェクトのワークフローからその概念が取り除かれました。

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Ignored Files
  • Ignored by pattern: .github/workflows/** (7)
    • .github/workflows/claude-code-review.yml
    • .github/workflows/claude-docs.yml
    • .github/workflows/claude-project-management.yml
    • .github/workflows/claude-project.yml
    • .github/workflows/claude-spec.yml
    • .github/workflows/claude.yml
    • .github/workflows/issue-spec-clarification.yml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

このプルリクエストは、Claudeへのプロンプトを外部ファイルに切り出すリファクタリングと、"Spec Kit"関連機能の削除という大きな変更を含んでいます。プロンプトの外部化は保守性を高める良い変更ですが、レビューの結果、IssueテンプレートのYAMLファイルに2点の重大な構文エラーが見つかりました。これらはIssue作成機能を壊す可能性があるため修正が必須です。また、新設されたプロンプトファイル間で変数名に不整合があり、これも修正を推奨します。全体として良い方向性のリファクタリングですが、マージ前にこれらの点の修正が必要です。

Comment on lines 12 to 13
url: https://github.com/UtakataKyosui/SmartPhoneAutoDevelopSetup/blob/main/docs/SPEC_KIT_TDD_WORKFLOW.md
about: 仕様駆動開発とTDD統合開発フローの詳細ガイド No newline at end of file

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

YAMLの構文が正しくありません。contact_linksのリストからSpec Kit + TDD ワークフローの項目を削除しようとしたのだと思いますが、urlaboutだけが残ってしまい、不正な形式になっています。これにより、この設定ファイルが正しく読み込まれず、Issue作成画面でエラーが発生する可能性があります。これらの行を削除してください。

Comment on lines 78 to 82
options:
- label: "🔍 仕様策定 (`/spec-kit:specify`) - 自然言語から正式仕様を作成"
required: false
- label: "📝 計画立案 (`/spec-kit:plan`) - 技術選定と実装計画"
required: false
- label: "📌 タスク生成 (`/spec-kit:tasks`) - TDD準拠のタスクリスト作成"
required: false
- label: "⚡ 実装 (`/spec-kit:implement`) - Red-Green-Refactorサイクル"
required: false

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

development_phaseドロップダウンのoptionsの形式が不正です。labelが削除され、required: falseだけが残っていますが、これはYAMLとして無効です。このままでは、この機能リクエストのテンプレートを使ったIssue作成が失敗します。Spec Kit関連のオプションを削除する意図であれば、optionsを空のリスト[]にするのが正しい修正です。

      options: []

Comment thread .github/prompts/claude-project.md Outdated
実行ユーザー: ${GITHUB_ACTOR}

### PR / Issue 情報
- PR番号: ${PR_NUMBER}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

このプロンプトファイルでは変数として${PR_NUMBER}が使われていますが、他の新しいプロンプトファイル(claude.md, claude-docs.mdなど)では${ISSUE_NUMBER}が使われています。変数名が異なると、ワークフロー側での変数設定が複雑になり、バグの原因となる可能性があります。一貫性を保つために、${ISSUE_NUMBER}に統一することをお勧めします。

Suggested change
- PR番号: ${PR_NUMBER}
- PR番号: ${ISSUE_NUMBER}

refactor: standardize variable names in claude-project prompt
@UtakataKyosui

Copy link
Copy Markdown
Owner Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

このプルリクエストは、ハードコードされていたClaudeへのプロンプトを外部のMarkdownファイルに分離する素晴らしいリファクタリングですね。これにより、プロンプトの可読性と保守性が大幅に向上します。また、共通のセットアップアクションを導入したことで、ワークフローの重複が削減され、クリーンになっています。
全体として非常に良い変更ですが、新しく追加された setup-claude-env アクションに1点だけ修正すべき箇所を見つけましたので、コメントをご確認ください。

Comment on lines +55 to +58
jq -r .title pr_info.json | tr -d '\r' | while IFS= read -r line; do
echo "PR_TITLE=$line" >> $GITHUB_ENV
done

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

PR_TITLE を環境変数にエクスポートする際の while ループの実装に問題があります。
現在の実装では、PRのタイトルが複数行だった場合(通常はありえませんが、堅牢性の観点から)、最後の行のみが PR_TITLE として設定されてしまいます。これは、ループの各イテレーションで PR_TITLE が上書きされるためです。

PR_BODY の処理と同様に、ヒアドキュメント構文(<<EOF)を使用して、複数行のタイトルにも対応できる、より堅牢で明確な実装に修正することをお勧めします。

          pr_title=$(jq -r .title pr_info.json | tr -d '\r')
          echo "PR_TITLE<<EOF" >> $GITHUB_ENV
          echo "$pr_title" >> $GITHUB_ENV
          echo "EOF" >> $GITHUB_ENV

@UtakataKyosui UtakataKyosui merged commit 5115e22 into main Jan 12, 2026
2 checks passed
@UtakataKyosui UtakataKyosui deleted the refactor/actions branch January 12, 2026 11:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant