clud-bug 0.6.8 → 0.6.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/prompts.js
CHANGED
|
@@ -65,11 +65,50 @@ the stable system-prompt prefix (you're reading it now) at 10% of
|
|
|
65
65
|
standard input cost, but variable per-PR content is NOT cached, so
|
|
66
66
|
size discipline on those fetches pays back directly.
|
|
67
67
|
|
|
68
|
-
- PR diff
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
68
|
+
- PR diff (incremental on fix-push — v0.6.10+):
|
|
69
|
+
On a re-review (not first pass), fetch only the delta between
|
|
70
|
+
your prior pass and HEAD instead of the full PR. The handshake
|
|
71
|
+
state lives in your PRIOR SUMMARY COMMENT as an HTML marker:
|
|
72
|
+
\`<!-- last-reviewed-sha: <sha> -->\`.
|
|
73
|
+
|
|
74
|
+
CRITICAL — identifying the PRIOR SUMMARY (not the progress comment):
|
|
75
|
+
\`anthropics/claude-code-action\` posts an in-progress
|
|
76
|
+
\`[claude]: Claude Code is working…\` comment BEFORE this prompt
|
|
77
|
+
runs. That comment IS authored by claude[bot] but is NOT your
|
|
78
|
+
prior summary — it has no marker. Walking "the LAST claude[bot]
|
|
79
|
+
comment" would always land on the progress comment and the
|
|
80
|
+
handshake would never fire. Instead, identify the prior summary
|
|
81
|
+
by its HEADER LINE: it begins with \`## 🐛 Clud Bug review\`
|
|
82
|
+
(same anchor the strict-mode gate uses for classification).
|
|
83
|
+
|
|
84
|
+
Detection in three steps:
|
|
85
|
+
|
|
86
|
+
1. Fetch claude[bot] comments newest-first:
|
|
87
|
+
\`gh api "repos/$REPO_OWNER/$REPO_NAME/issues/$PR_NUMBER/comments?per_page=100&sort=created&direction=desc"\`
|
|
88
|
+
Walk them in order; find the FIRST whose body starts
|
|
89
|
+
(after any \`**Claude finished …**\` preamble the action
|
|
90
|
+
prepends) with \`## 🐛 Clud Bug review\`. THAT is your prior
|
|
91
|
+
summary. In its body, look for \`last-reviewed-sha: <sha>\`.
|
|
92
|
+
|
|
93
|
+
2. If a SHA was found, verify it's still in HEAD's ancestry:
|
|
94
|
+
\`git merge-base --is-ancestor <prior_sha> $HEAD_SHA\`
|
|
95
|
+
(exit 0 = yes, ancestry intact; non-zero = rebased/force-pushed).
|
|
96
|
+
|
|
97
|
+
3. Branch:
|
|
98
|
+
- Marker present AND ancestor intact (well-behaved fix-push):
|
|
99
|
+
\`git diff <prior_sha>..$HEAD_SHA | head -c "$MAX_DIFF_BYTES"\`
|
|
100
|
+
- Marker missing OR not an ancestor (first review or rebase):
|
|
101
|
+
\`gh pr diff "$PR_NUMBER" | head -c "$MAX_DIFF_BYTES"\`
|
|
102
|
+
|
|
103
|
+
Default cap is 80,000 bytes — covers ~95% of real PRs unbruised.
|
|
104
|
+
If output looks truncated mid-line, request the omitted hunks via
|
|
105
|
+
\`gh pr diff "$PR_NUMBER" --name-only\` + a targeted re-fetch.
|
|
106
|
+
|
|
107
|
+
Edge case — span check: if a delta-review surfaces a finding that
|
|
108
|
+
might affect unchanged code outside the delta (a fix-push edits a
|
|
109
|
+
function whose callers were fine in the prior pass), do a one-time
|
|
110
|
+
\`gh pr diff "$PR_NUMBER"\` to confirm before flagging. The
|
|
111
|
+
incremental view is for fast re-confirmation, not for blind trust.
|
|
73
112
|
|
|
74
113
|
- Skill files: \`head -c "$MAX_SKILL_BYTES" .claude/skills/<name>/SKILL.md\`
|
|
75
114
|
per file (default 4,000 bytes). Baseline skills fit easily;
|
|
@@ -112,6 +151,20 @@ At the end of every review, append a single-line footer:
|
|
|
112
151
|
If you genuinely cited none, list "[none]" and explain why no
|
|
113
152
|
installed skill applied to this diff.
|
|
114
153
|
|
|
154
|
+
Incremental-diff handshake (v0.6.10+) — emit the SHA marker:
|
|
155
|
+
At the very end of the summary comment (after the Skills-referenced
|
|
156
|
+
footer, on its own line), append the HTML marker that the next
|
|
157
|
+
review pass will read to decide between full-diff vs incremental:
|
|
158
|
+
|
|
159
|
+
<!-- last-reviewed-sha: $HEAD_SHA -->
|
|
160
|
+
|
|
161
|
+
(\`$HEAD_SHA\` is provided via the workflow env block; literal value
|
|
162
|
+
goes in the comment, not the variable name.) The marker is silent
|
|
163
|
+
to human readers (HTML comment) but load-bearing for cost: every
|
|
164
|
+
subsequent fix-push review re-fetches only the delta since this
|
|
165
|
+
SHA instead of the full PR. If you omit the marker, the next
|
|
166
|
+
review falls back to a full \`gh pr diff\` — correct but wasteful.
|
|
167
|
+
|
|
115
168
|
Strict-mode header (opt-in): if .claude/skills/.clud-bug.json
|
|
116
169
|
contains { "strictMode": true }, the comment header you post
|
|
117
170
|
MUST signal whether you flagged a critical issue:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clud-bug",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.10",
|
|
4
4
|
"description": "Skill-driven Claude PR review. Ship a brand-voice skill, get brand reviews. Each finding cites the skill that motivated it. CLI installs the workflow + a baseline kit; add more from skills.sh.",
|
|
5
5
|
"homepage": "https://cludbug.dev",
|
|
6
6
|
"bugs": "https://github.com/thrillmade/clud-bug/issues",
|
|
@@ -56,6 +56,8 @@ jobs:
|
|
|
56
56
|
PR_NUMBER: ${{ github.event.pull_request.number }}
|
|
57
57
|
REPO_OWNER: ${{ github.repository_owner }}
|
|
58
58
|
REPO_NAME: ${{ github.event.repository.name }}
|
|
59
|
+
# HEAD_SHA (v0.6.10+) — see workflow.yml.tmpl for design notes.
|
|
60
|
+
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
|
|
59
61
|
# Per-section byte budgets — see workflow.yml.tmpl for design notes.
|
|
60
62
|
MAX_DIFF_BYTES: '80000'
|
|
61
63
|
MAX_COMMENT_BYTES: '20000'
|
|
@@ -72,7 +74,7 @@ jobs:
|
|
|
72
74
|
show_full_output: true
|
|
73
75
|
claude_args: |
|
|
74
76
|
--max-turns 15
|
|
75
|
-
--allowedTools "mcp__github_inline_comment__create_inline_comment,Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh api graphql:*),Bash(gh api repos/:*),Bash(git show:*),Bash(cat .claude/skills/.clud-bug.json),Bash(cat .claude/skills/*/SKILL.md),Bash(head:*)"
|
|
77
|
+
--allowedTools "mcp__github_inline_comment__create_inline_comment,Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh api graphql:*),Bash(gh api repos/:*),Bash(git show:*),Bash(git diff:*),Bash(git merge-base:*),Bash(cat .claude/skills/.clud-bug.json),Bash(cat .claude/skills/*/SKILL.md),Bash(head:*)"
|
|
76
78
|
prompt: |
|
|
77
79
|
Review this pull request following the discipline in your
|
|
78
80
|
system prompt — every rule about skill routing, comment
|
|
@@ -82,6 +84,6 @@ jobs:
|
|
|
82
84
|
# Strict-mode gate — composite action; see workflow.yml.tmpl for design notes.
|
|
83
85
|
- name: Strict mode — fail check on critical findings
|
|
84
86
|
if: success()
|
|
85
|
-
uses: thrillmade/clud-bug/.github/actions/strict-mode-gate@v0.6.
|
|
87
|
+
uses: thrillmade/clud-bug/.github/actions/strict-mode-gate@v0.6.10
|
|
86
88
|
with:
|
|
87
89
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
@@ -56,6 +56,8 @@ jobs:
|
|
|
56
56
|
PR_NUMBER: ${{ github.event.pull_request.number }}
|
|
57
57
|
REPO_OWNER: ${{ github.repository_owner }}
|
|
58
58
|
REPO_NAME: ${{ github.event.repository.name }}
|
|
59
|
+
# HEAD_SHA (v0.6.10+) — see workflow.yml.tmpl for design notes.
|
|
60
|
+
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
|
|
59
61
|
# Per-section byte budgets — see workflow.yml.tmpl for design notes.
|
|
60
62
|
MAX_DIFF_BYTES: '80000'
|
|
61
63
|
MAX_COMMENT_BYTES: '20000'
|
|
@@ -72,7 +74,7 @@ jobs:
|
|
|
72
74
|
show_full_output: true
|
|
73
75
|
claude_args: |
|
|
74
76
|
--max-turns 15
|
|
75
|
-
--allowedTools "mcp__github_inline_comment__create_inline_comment,Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh api graphql:*),Bash(gh api repos/:*),Bash(git show:*),Bash(cat .claude/skills/.clud-bug.json),Bash(cat .claude/skills/*/SKILL.md),Bash(head:*)"
|
|
77
|
+
--allowedTools "mcp__github_inline_comment__create_inline_comment,Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh api graphql:*),Bash(gh api repos/:*),Bash(git show:*),Bash(git diff:*),Bash(git merge-base:*),Bash(cat .claude/skills/.clud-bug.json),Bash(cat .claude/skills/*/SKILL.md),Bash(head:*)"
|
|
76
78
|
prompt: |
|
|
77
79
|
Review this pull request following the discipline in your
|
|
78
80
|
system prompt — every rule about skill routing, comment
|
|
@@ -82,6 +84,6 @@ jobs:
|
|
|
82
84
|
# Strict-mode gate — composite action; see workflow.yml.tmpl for design notes.
|
|
83
85
|
- name: Strict mode — fail check on critical findings
|
|
84
86
|
if: success()
|
|
85
|
-
uses: thrillmade/clud-bug/.github/actions/strict-mode-gate@v0.6.
|
|
87
|
+
uses: thrillmade/clud-bug/.github/actions/strict-mode-gate@v0.6.10
|
|
86
88
|
with:
|
|
87
89
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
@@ -82,6 +82,12 @@ jobs:
|
|
|
82
82
|
PR_NUMBER: ${{ github.event.pull_request.number }}
|
|
83
83
|
REPO_OWNER: ${{ github.repository_owner }}
|
|
84
84
|
REPO_NAME: ${{ github.event.repository.name }}
|
|
85
|
+
# HEAD_SHA (v0.6.10+) — emitted as `<!-- last-reviewed-sha: ... -->`
|
|
86
|
+
# marker at the end of every summary comment. The next review pass
|
|
87
|
+
# reads the marker and switches `gh pr diff` (full) → `git diff
|
|
88
|
+
# <prior_sha>..HEAD` (delta) when the SHA is still in HEAD's
|
|
89
|
+
# ancestry. Fix-push reviews ingest only the new bytes.
|
|
90
|
+
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
|
|
85
91
|
# Per-section byte budgets (v0.6.4). The system-prompt instructs
|
|
86
92
|
# Claude to cap each per-PR input fetch with `head -c`. Caching
|
|
87
93
|
# covers the stable system prefix; capping covers the variable
|
|
@@ -116,7 +122,7 @@ jobs:
|
|
|
116
122
|
show_full_output: true
|
|
117
123
|
claude_args: |
|
|
118
124
|
--max-turns 15
|
|
119
|
-
--allowedTools "mcp__github_inline_comment__create_inline_comment,Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh api graphql:*),Bash(gh api repos/:*),Bash(git show:*),Bash(cat .claude/skills/.clud-bug.json),Bash(cat .claude/skills/*/SKILL.md),Bash(head:*)"
|
|
125
|
+
--allowedTools "mcp__github_inline_comment__create_inline_comment,Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh api graphql:*),Bash(gh api repos/:*),Bash(git show:*),Bash(git diff:*),Bash(git merge-base:*),Bash(cat .claude/skills/.clud-bug.json),Bash(cat .claude/skills/*/SKILL.md),Bash(head:*)"
|
|
120
126
|
prompt: |
|
|
121
127
|
Review this pull request following the discipline in your
|
|
122
128
|
system prompt — every rule about skill routing, comment
|
|
@@ -138,6 +144,6 @@ jobs:
|
|
|
138
144
|
# Letting the action's own failure fail the check is louder and right.
|
|
139
145
|
- name: Strict mode — fail check on critical findings
|
|
140
146
|
if: success()
|
|
141
|
-
uses: thrillmade/clud-bug/.github/actions/strict-mode-gate@v0.6.
|
|
147
|
+
uses: thrillmade/clud-bug/.github/actions/strict-mode-gate@v0.6.10
|
|
142
148
|
with:
|
|
143
149
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|