Module: GemHadar::PromptTemplate

Included in:
GemHadar
Defined in:
lib/gem_hadar/prompt_template.rb

Overview

A module that provides default prompt templates for interacting with AI models when generating GitHub release changelogs and semantic version bump suggestions.

This module contains methods that return system prompts and template strings used by the GemHadar framework to instruct AI models on how to format responses for release notes and versioning decisions. These prompts are designed to produce structured, relevant output that aligns with development workflow requirements.

Instance Method Summary collapse

Instance Method Details

#default_git_release_promptString

The default_git_release_prompt method returns the prompt used for generating GitHub release changelogs.

This prompt instructs the AI model to create a markdown-formatted changelog entry for a new release. It specifies guidelines for what constitutes significant changes, emphasizing the exclusion of trivial updates and the inclusion of only verified and impactful modifications.



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/gem_hadar/prompt_template.rb', line 35

def default_git_release_prompt
  "    Output the content of a changelog for the new release of %{name} %{version}\n\n    **Strictly** follow these guidelines:\n\n      - Use bullet points in markdown format (`-`) to list significant changes.\n      - Exclude trivial updates such as:\n        * Version number increments\n        * Dependency version bumps (unless they resolve critical issues)\n        * Minor code style adjustments\n        * Internal documentation tweaks\n      - Include only verified and substantial changes that impact\n        functionality, performance, or user experience.\n      - If unsure about a change's significance, omit it from the output.\n      - Avoid adding any comments or notes; keep the output purely factual.\n\n    These are the log messages including patches for the new release:\n\n    %{log_diff}\n  EOT\nend\n"

#default_git_release_system_promptString

The default_git_release_system_prompt method returns the system prompt used for generating GitHub release changelogs.

This prompt instructs the AI model to act as a Ruby programmer who creates markdown-formatted changelog entries for new releases. The generated content helps users understand what has changed in the software.



18
19
20
21
22
23
24
# File 'lib/gem_hadar/prompt_template.rb', line 18

def default_git_release_system_prompt
  "    You are a Ruby programmer generating changelog messages in markdown\n    format for new releases, so users can see what has changed. Remember you\n    are not a chatbot of any kind.\n  EOT\nend\n"

#default_version_bump_promptString

The default_version_bump_prompt method returns the prompt template used for generating semantic version bump suggestions.

This prompt instructs the AI model to analyze provided changes and determine whether a major, minor, or build version bump is appropriate according to Semantic Versioning principles. It requires the model to first provide a brief explanation of its reasoning, followed by a single line containing only one word: ‘major’, ‘minor’, or ‘build’.



88
89
90
91
92
93
94
95
96
97
98
# File 'lib/gem_hadar/prompt_template.rb', line 88

def default_version_bump_prompt
  "    Given the current version %{version} and the following changes:\n\n    %{log_diff}\n\n    Please explain your reasoning for suggesting a version bump and then end\n    with a single line containing only one word: 'major', 'minor', or\n    'build'.\n  EOT\nend\n"

#default_version_bump_system_promptString

The default_version_bump_system_prompt method returns the system prompt used for generating semantic version bump suggestions.

This prompt instructs the AI model to act as an expert in semantic versioning, analyzing provided changes and determining whether a major, minor, or build version bump is appropriate. It requires the model to provide a brief explanation of its reasoning followed by a single line containing only one word: ‘major’, ‘minor’, or ‘build’.



68
69
70
71
72
73
74
75
76
# File 'lib/gem_hadar/prompt_template.rb', line 68

def default_version_bump_system_prompt
  "    You are an expert at semantic versioning. Analyze the provided changes\n    and suggest whether to bump major, minor, or build version according to\n    Semantic Versioning. Provide a brief explanation of your reasoning,\n    followed by a single line containing only one word: 'major', 'minor', or\n    'build'.\n  EOT\nend\n"