|
28 | 28 | """ |
29 | 29 |
|
30 | 30 | USER_PROMPT = """ |
| 31 | +## Input |
| 32 | +
|
31 | 33 | First, here is the git branch name: |
32 | 34 | <branch_name> |
33 | 35 | {branch_name} |
|
38 | 40 | {diff} |
39 | 41 | </code_diff> |
40 | 42 |
|
41 | | -Analyze the branch name: |
42 | | -1. Look for keywords or patterns that indicate the purpose of the changes (e.g., "work", "fix", "feature", "bugfix", "hotfix", "refactor"). |
| 43 | +## Analysis |
| 44 | +
|
| 45 | +### Analyze the branch name: |
| 46 | +1. Look for keywords or patterns that indicate the purpose of the changes (e.g., "work", "fix", |
| 47 | +"feature", "bugfix", "hotfix", "refactor"). |
43 | 48 | 2. Identify any ticket or issue numbers if present. |
44 | 49 | 3. Note any specific components or areas of the codebase mentioned. |
45 | 50 |
|
46 | | -Review the code diff: |
| 51 | +### Review the code diff: |
47 | 52 | 1. Identify the files that have been modified, added, or deleted. |
48 | 53 | 2. Understand the main changes and their purpose. |
49 | 54 | 3. Look for any significant additions or removals of functionality. |
50 | 55 | 4. Note any changes to dependencies or configuration files. |
51 | 56 |
|
52 | | -Writing the PR title: |
| 57 | +## Writing the PR title: |
53 | 58 | 1. Keep it concise (50-70 characters if possible). |
54 | 59 | 2. Start with a capital letter and use present tense. |
55 | 60 | 3. Summarize the main purpose of the changes. |
56 | 61 | 4. Include the ticket or issue number if present in the branch name. |
| 62 | +5. Use backticks (`) to enclose programming language keywords, identifiers, library class names, or |
| 63 | +constants that would benefit from being highlighted. |
57 | 64 |
|
58 | | -Composing the PR description: |
| 65 | +## Composing the PR description: |
59 | 66 | 1. Provide a brief overview of the changes (1-2 sentences). |
60 | 67 | 2. List the main components or areas affected. |
61 | 68 | 3. Explain the reason for the changes and their impact. |
62 | 69 | 4. Mention any important implementation details. |
63 | 70 | 5. Add any relevant links or references. |
| 71 | +6. Use backticks (`) to enclose programming language keywords, identifiers, library class names, or |
| 72 | +constants that would benefit from being highlighted. |
| 73 | +7. When appropriate, include code examples using Markdown code blocks (```). Provide an explanation |
| 74 | +of the intent and content of the code example. |
| 75 | +
|
| 76 | +## Output |
| 77 | +
|
| 78 | +Format your response in the following way: |
64 | 79 |
|
65 | | -Output your response into your <response> in the following format: |
66 | 80 | <pr_title> |
67 | 81 | Your PR title here |
68 | 82 | </pr_title> |
|
73 | 87 |
|
74 | 88 | Remember to base your PR title and description solely on the information provided in the branch name |
75 | 89 | and code diff. Do not include any external information or assumptions beyond what is given. |
| 90 | +
|
| 91 | +## Example Output |
| 92 | +
|
| 93 | +Here's an example of how your output might look: |
| 94 | +
|
| 95 | +<pr_title> |
| 96 | +Add `UserAuthentication` class to improve login process (#123) |
| 97 | +</pr_title> |
| 98 | +
|
| 99 | +<pr_description> |
| 100 | +This PR introduces a new `UserAuthentication` class to enhance the login process and improve overall |
| 101 | +security. |
| 102 | +
|
| 103 | +Key changes: |
| 104 | +- Create `UserAuthentication` class in `auth/user_authentication.rb` |
| 105 | +- Implement password hashing using `bcrypt` gem |
| 106 | +- Update `User` model to utilize the new authentication class |
| 107 | +
|
| 108 | +The `UserAuthentication` class encapsulates the login logic and password management, separating |
| 109 | +these concerns from the `User` model. This change improves code organization and makes it easier to |
| 110 | +maintain and extend authentication functionality in the future. |
| 111 | +
|
| 112 | +Example usage of the new class: |
| 113 | +
|
| 114 | +```ruby |
| 115 | +user_auth = UserAuthentication.new(user) |
| 116 | +if user_auth.authenticate(password) |
| 117 | + # Proceed with login |
| 118 | +else |
| 119 | + # Handle authentication failure |
| 120 | +end |
| 121 | +``` |
| 122 | +
|
| 123 | +This new implementation ensures that passwords are securely hashed and compared, reducing the risk of password-related vulnerabilities. |
| 124 | +
|
| 125 | +Please review the changes and provide feedback on the new authentication flow. |
| 126 | +</pr_description> |
76 | 127 | """ |
77 | 128 |
|
78 | 129 |
|
|
0 commit comments