Skip to content

Commit 553a1ec

Browse files
kaovilaiclaude
andcommitted
refactor: move AI review prompt to configurable external file
- Move AI_REVIEW_PROMPT definition from Makefile to ai/Makefile/Prompt/prompt.example - Add conditional include logic to use custom prompt if ai/Makefile/Prompt/prompt exists - Falls back to prompt.example if custom prompt not defined - Allows users to customize AI review prompts without modifying Makefile 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 0778c33 commit 553a1ec

File tree

3 files changed

+20
-11
lines changed

3 files changed

+20
-11
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,6 @@ tests/e2e/must-gather/
4848

4949
# Ollama cache directory
5050
.ollama/
51+
52+
# Custom AI review prompt (use prompt.example as template)
53+
./ai/Makefile/Prompt/prompt

Makefile

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -657,17 +657,12 @@ endif
657657
build-must-gather: ## Build OADP Must-gather binary must-gather/oadp-must-gather
658658
cd must-gather && go build -mod=mod -a -o oadp-must-gather cmd/main.go
659659

660-
# Common AI review prompt
661-
define AI_REVIEW_PROMPT
662-
Review this git diff for a project called OADP (OpenShift API for Data Protection) operator. Focus on: \
663-
1. Code quality and best practices \
664-
2. Potential bugs or issues \
665-
3. Go idioms and conventions \
666-
4. Kubernetes/OpenShift operator patterns \
667-
5. Security concerns \
668-
Please provide actionable feedback. Be concise but thorough. \
669-
If able, browse linked URLs for context.
670-
endef
660+
# Include AI review prompt - use custom prompt if exists, otherwise use example
661+
ifneq (,$(wildcard ./ai/Makefile/Prompt/prompt))
662+
include ./ai/Makefile/Prompt/prompt
663+
else
664+
include ./ai/Makefile/Prompt/prompt.example
665+
endif
671666

672667
# AI code review using Ollama on Podman
673668
#

ai/Makefile/Prompt/prompt.example

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Common AI review prompt
2+
define AI_REVIEW_PROMPT
3+
Review this git diff for a project called OADP (OpenShift API for Data Protection) operator. Focus on: \
4+
1. Code quality and best practices \
5+
2. Potential bugs or issues \
6+
3. Go idioms and conventions \
7+
4. Kubernetes/OpenShift operator patterns \
8+
5. Security concerns \
9+
Please provide actionable feedback. Be concise but thorough. \
10+
If able, browse linked URLs for context.
11+
endef

0 commit comments

Comments
 (0)