Skip to content

Commit 4f889c1

Browse files
committed
feat(prompts): add detailed scripts for generating PR content and commit messages
1 parent 038288b commit 4f889c1

File tree

3 files changed

+39
-24
lines changed

3 files changed

+39
-24
lines changed

.github/prompts/util.gh-pr-content-create.prompt.md renamed to .github/prompts/util.gh-pr-content.prompt.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,29 @@ Craft a diff-driven pull request title and body, ready to copy/paste, that compa
1919

2020
### A. Establish the diff against `main`
2121

22-
Run the labelled batch below **once** from the repository root so each command prints `>>> <command>` before its output:
22+
Run the labelled batch below **once** from the repository root. Output is written to `docs/prompts/git-pr-content-diff.txt` so that large diffs do not overflow the terminal context.
2323

2424
```bash
25+
_diff_file="docs/prompts/git-pr-content-diff.txt"
26+
: > "$_diff_file"
2527
if ! git show-ref --verify --quiet refs/heads/main; then
26-
printf '\n>>> %s\n' "git fetch origin main:main"
27-
git fetch origin main:main
28+
printf '\n>>> %s\n' "git fetch origin main:main" | tee -a "$_diff_file"
29+
git fetch origin main:main 2>&1 | tee -a "$_diff_file"
2830
fi
2931
for cmd in \
3032
"git diff --stat main...HEAD" \
3133
"git diff main...HEAD" \
3234
"git status -sb" \
3335
"git rev-parse --abbrev-ref HEAD"; do
34-
printf '\n>>> %s\n' "$cmd"
35-
eval "$cmd"
36+
printf '\n>>> %s\n' "$cmd" >> "$_diff_file"
37+
eval "$cmd" >> "$_diff_file" 2>&1
3638
done
39+
printf '\nDiff captured → %s (%s bytes)\n' "$_diff_file" "$(wc -c < "$_diff_file")"
3740
```
3841

39-
- Use `git diff --stat` for the overview and `git diff main...HEAD` for detailed evidence.
42+
After the script completes, **read the file `docs/prompts/git-pr-content-diff.txt`** in full and use its contents as the authoritative diff evidence for the rest of this review.
43+
44+
- Use `git diff --stat main...HEAD` for the overview and `git diff main...HEAD` for detailed evidence.
4045
- Capture branch/working-tree information from `git status -sb` and `git rev-parse --abbrev-ref HEAD`.
4146
- If there is no diff, stop and report **"No diff vs main – nothing to raise."**
4247

@@ -152,5 +157,5 @@ Add additional sections (for example "Testing", "Follow-ups") **only** if the te
152157

153158
---
154159

155-
> **Version**: 1.1.0
156-
> **Last Amended**: 2026-01-24
160+
> **Version**: 1.1.1
161+
> **Last Amended**: 2026-02-20

.github/prompts/util.gh-pr-review.prompt.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,24 +39,29 @@ Where evidence cannot be found, record **Unknown from code – {suggested action
3939

4040
### B. Establish an accurate diff against `main`
4141

42-
Run the labelled batch below **once** from the repository root so each command prints a `>>> <command>` header followed by its output. This keeps every datum tied to the command that produced it and avoids duplicate executions.
42+
Run the labelled batch below **once** from the repository root. Output is written to `docs/prompts/git-pr-review-diff.txt` so that large diffs do not overflow the terminal context.
4343

4444
```bash
45+
_diff_file="docs/prompts/git-pr-review-diff.txt"
46+
: > "$_diff_file"
4547
if ! git show-ref --verify --quiet refs/heads/main; then
46-
printf '\n>>> %s\n' "git fetch origin main:main"
47-
git fetch origin main:main
48+
printf '\n>>> %s\n' "git fetch origin main:main" | tee -a "$_diff_file"
49+
git fetch origin main:main 2>&1 | tee -a "$_diff_file"
4850
fi
4951
for cmd in \
5052
"git diff --stat main...HEAD" \
5153
"git diff main...HEAD" \
5254
"git status -sb" \
5355
"git rev-parse --abbrev-ref HEAD"; do
54-
printf '\n>>> %s\n' "$cmd"
55-
eval "$cmd"
56+
printf '\n>>> %s\n' "$cmd" >> "$_diff_file"
57+
eval "$cmd" >> "$_diff_file" 2>&1
5658
done
59+
printf '\nDiff captured → %s (%s bytes)\n' "$_diff_file" "$(wc -c < "$_diff_file")"
5760
```
5861

59-
1. Use `git diff --stat` for the overview and `git diff main...HEAD` for detailed evidence.
62+
After the script completes, **read the file `docs/prompts/git-pr-review-diff.txt`** in full and use its contents as the authoritative diff evidence for the rest of this review.
63+
64+
1. Use `git diff --stat main...HEAD` for the overview and `git diff main...HEAD` for detailed evidence.
6065
2. Capture branch/working-tree information from `git status -sb` and `git rev-parse --abbrev-ref HEAD`.
6166
3. Identify the change category (one or more):
6267
- Bug fix
@@ -255,5 +260,5 @@ Use this snippet for each significant finding:
255260

256261
---
257262

258-
> **Version**: 1.3.10
259-
> **Last Amended**: 2026-01-24
263+
> **Version**: 1.3.11
264+
> **Last Amended**: 2026-02-20

.github/prompts/util.git-commit-message.prompt.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,14 @@ All artefacts must be fully backed by the diff between `main` and the current `H
2323

2424
### A. Establish the diff against `main`
2525

26-
Run the labelled batch below **once** from the repository root so each command prints a `>>> <command>` header followed by its output. This keeps every datum tied to the command that produced it and avoids duplicate executions.
26+
Run the labelled batch below **once** from the repository root. Output is written to `docs/prompts/git-commit-message-diff.txt` so that large diffs do not overflow the terminal context.
2727

2828
```bash
29+
_diff_file="docs/prompts/git-commit-message-diff.txt"
30+
: > "$_diff_file"
2931
if ! git show-ref --verify --quiet refs/heads/main; then
30-
printf '\n>>> %s\n' "git fetch origin main:main"
31-
git fetch origin main:main
32+
printf '\n>>> %s\n' "git fetch origin main:main" | tee -a "$_diff_file"
33+
git fetch origin main:main 2>&1 | tee -a "$_diff_file"
3234
fi
3335
for cmd in \
3436
"git diff --stat main...HEAD" \
@@ -38,13 +40,16 @@ for cmd in \
3840
"git diff --stat" \
3941
"git diff --cached --stat" \
4042
"git log -3 --oneline"; do
41-
printf '\n>>> %s\n' "$cmd"
42-
eval "$cmd"
43+
printf '\n>>> %s\n' "$cmd" >> "$_diff_file"
44+
eval "$cmd" >> "$_diff_file" 2>&1
4345
done
46+
printf '\nDiff captured → %s (%s bytes)\n' "$_diff_file" "$(wc -c < "$_diff_file")"
4447
```
4548

49+
After the script completes, **read the file `docs/prompts/git-commit-message-diff.txt`** in full and use its contents as the authoritative diff evidence for the rest of this review.
50+
4651
1. Use the labelled outputs above to confirm `main` is up to date.
47-
2. Use `git diff --stat` for the overview and `git diff main...HEAD` for full context.
52+
2. Use `git diff --stat main...HEAD` for the overview and `git diff main...HEAD` for full context.
4853
3. Capture branch/working-tree details from `git status -sb` and `git rev-parse --abbrev-ref HEAD`.
4954
4. If the diffs show no changes, output **"No diff vs main – nothing to commit."** and stop.
5055
5. Mirror recent commit tone using `git log -3 --oneline`.
@@ -129,5 +134,5 @@ Return content exactly in this shape for easy copy/paste:
129134

130135
---
131136

132-
> **Version**: 1.2.3
133-
> **Last Amended**: 2026-01-17
137+
> **Version**: 1.2.4
138+
> **Last Amended**: 2026-02-20

0 commit comments

Comments
 (0)