refactor(workflows): Extract Claude prompts to external Markdown files#10
Conversation
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
Summary of ChangesHello @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
🧠 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
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
Code Review
このプルリクエストは、Claudeへのプロンプトを外部ファイルに切り出すリファクタリングと、"Spec Kit"関連機能の削除という大きな変更を含んでいます。プロンプトの外部化は保守性を高める良い変更ですが、レビューの結果、IssueテンプレートのYAMLファイルに2点の重大な構文エラーが見つかりました。これらはIssue作成機能を壊す可能性があるため修正が必須です。また、新設されたプロンプトファイル間で変数名に不整合があり、これも修正を推奨します。全体として良い方向性のリファクタリングですが、マージ前にこれらの点の修正が必要です。
| url: https://github.com/UtakataKyosui/SmartPhoneAutoDevelopSetup/blob/main/docs/SPEC_KIT_TDD_WORKFLOW.md | ||
| about: 仕様駆動開発とTDD統合開発フローの詳細ガイド No newline at end of file |
| 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 |
| 実行ユーザー: ${GITHUB_ACTOR} | ||
|
|
||
| ### PR / Issue 情報 | ||
| - PR番号: ${PR_NUMBER} |
refactor: standardize variable names in claude-project prompt
|
/gemini review |
| jq -r .title pr_info.json | tr -d '\r' | while IFS= read -r line; do | ||
| echo "PR_TITLE=$line" >> $GITHUB_ENV | ||
| done | ||
|
|
There was a problem hiding this comment.
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
概要
GitHub Actions ワークフロー内に直書きされていた Claude へのプロンプトを、
.github/prompts/ディレクトリ配下の独立した Markdown ファイルに分離しました。変更内容
.github/prompts/*.mdに移動claude.yml,claude-docs.yml等) でenvsubstを使用してプロンプトファイル内の変数を動的に置換するように修正setup-claude-envの導入により、環境構築手順を共通化目的
${\{ ... \}}) と GitHub Actions のコンテキスト変数の分離管理envsubst) の導入影響範囲