Skip to content

Commit ecd6ab8

Browse files
docs(prompts): improve change type detection in /pr prompt
- Add instruction to check ALL changes in the branch using git diff - Ensure Docs label is only applied when ALL changes are documentation - Clarify that mixed changes should be classified by code changes, not docs - Use git diff origin/main...HEAD to analyze complete branch changes
1 parent 395e9b6 commit ecd6ab8

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

.github/prompts/pr.prompt.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,17 @@ $ARGUMENTS
3333

3434
2. **Determine the change type**:
3535
1. Parse the user input to identify the change type (Major, Minor, Patch, Fix, or Docs)
36-
2. If nothing is provided, evaluate the code changes to infer the type:
37-
- **Major**: Changes that break backward compatibility (e.g., removing public APIs, changing method signatures)
38-
- **Minor**: New features or enhancements that do not break existing functionality
39-
- **Patch**: Bug fixes or small improvements that do not add new features
40-
- **Fix**: Specifically for bug fixes
41-
- **Docs**: Only documentation changes
36+
2. If nothing is provided, **analyze ALL changes in the branch** to infer the type:
37+
- Run `git diff origin/main...HEAD --name-only` to get all changed files in the branch
38+
- Read the diff content using `git diff origin/main...HEAD` to understand the nature of changes
39+
- Categorize based on ALL changes combined, not just recent commits:
40+
* **Docs**: ONLY if ALL changes are to documentation files (*.md, docs/, .github/prompts/, etc.) with no code/functionality changes
41+
* **Fix**: If changes specifically fix bugs without adding new features
42+
* **Patch**: Small fixes or improvements that do not add new features
43+
* **Minor**: New features or enhancements that do not break existing functionality
44+
* **Major**: Changes that break backward compatibility (e.g., removing public APIs, changing method signatures)
45+
- **Important**: If the branch contains BOTH code changes AND documentation changes, classify based on the code changes, not the documentation
46+
- **Important**: Check the entire branch diff, not just uncommitted changes or the last commit
4247

4348
3. **Get current branch information**:
4449
- Determine the current branch name

0 commit comments

Comments
 (0)