Repository navigation
fix(review-utils): inline skill partials into the review prompt #368
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -212,12 +212,23 @@ runs: | |||||||||||||||||||||
| # the prompt text. The skill defines `name` + `description` for skill | ||||||||||||||||||||||
| # tooling — the action only needs the methodology that follows the second | ||||||||||||||||||||||
| # `---` delimiter. | ||||||||||||||||||||||
| # | ||||||||||||||||||||||
| # The skill's partials (formatting + thread management) are appended | ||||||||||||||||||||||
| # INLINE. Relying on the model to Read them by relative path was not | ||||||||||||||||||||||
| # reliable even with Read granted: reviews kept improvising their own | ||||||||||||||||||||||
| # format (observed on nsheaps/greasemonkey-scripts#54, nsheaps/ai-mktpl#746 | ||||||||||||||||||||||
| # and nsheaps/agent-jordan#2). Inlining makes the format part of the prompt. | ||||||||||||||||||||||
| - name: Extract prompt body from skill | ||||||||||||||||||||||
| shell: bash | ||||||||||||||||||||||
| run: | | ||||||||||||||||||||||
| awk 'BEGIN{p=0} /^---$/{p++; next} p>=2' \ | ||||||||||||||||||||||
| "./agent-repo/plugins/claude-code/review-utils/skills/review-code/SKILL.md" \ | ||||||||||||||||||||||
| > "$RUNNER_TEMP/review-prompt-template.md" | ||||||||||||||||||||||
| SKILL_DIR="./agent-repo/plugins/claude-code/review-utils/skills/review-code" | ||||||||||||||||||||||
| { | ||||||||||||||||||||||
| awk 'BEGIN{p=0} /^---$/{p++; next} p>=2' "$SKILL_DIR/SKILL.md" | ||||||||||||||||||||||
| for partial in "$SKILL_DIR"/partials/*.md; do | ||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
With the default bash shell flags that GitHub Actions uses (
Suggested change
Alternatively leave as-is: the loud failure is arguably the right behavior if someone accidentally deletes the partials dir and ships a prompt with no formatting rules at all. |
||||||||||||||||||||||
| printf '\n\n---\n\n<!-- Inlined from partials/%s (the file referenced above; do not try to Read it) -->\n\n' "$(basename "$partial")" | ||||||||||||||||||||||
| cat "$partial" | ||||||||||||||||||||||
| done | ||||||||||||||||||||||
| } > "$RUNNER_TEMP/review-prompt-template.md" | ||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ❔ P2 — assembled template now flows through The partial contents are concatenated into
Not blocking — just worth noting since the whole point of this PR is removing a silent-failure mode. Leaving a different one in place would be unfortunate. |
||||||||||||||||||||||
| echo "PROMPT_TEMPLATE=$RUNNER_TEMP/review-prompt-template.md" >> $GITHUB_ENV | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| # TODO: investigate a Claude Code plugin hook for internal prompt interpolation | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ Comment block clearly captures the root cause (model skipping Read even when granted), lists the concrete observations (
greasemonkey-scripts#54,ai-mktpl#746,agent-jordan#2), and names the fix (inline). This is exactly the context a future maintainer needs to understand why the step grew. Nice.Minor follow-up:
SKILL.mdlines 28 and 98 still say "Seepartials/review-formatting.md..." / "Seepartials/review-thread-management.md...". Those references now point at content the model will see inlined below. The inline header you add (do not try to Read it) handles the "don't duplicate the read" case well, but a brief edit toSKILL.mdto change "Seepartials/..." → "See the inlined partials appended below" would make the SKILL body self-consistent and avoid future contributors re-introducing the Read dependency. Not required.