Skip to content

fix(cross-llm-pr-a): post-merge guard fixes — set -euo pipefail, code-fence skip, SKILL.md TodoWrite#17

Merged
intel352 merged 1 commit into
mainfrom
fix/cross-llm-pr-a-guard-followup
Apr 25, 2026
Merged

fix(cross-llm-pr-a): post-merge guard fixes — set -euo pipefail, code-fence skip, SKILL.md TodoWrite#17
intel352 merged 1 commit into
mainfrom
fix/cross-llm-pr-a-guard-followup

Conversation

@intel352
Copy link
Copy Markdown
Contributor

Summary

Post-merge fixes for PR #14 (Cross-LLM PR-A) addressing 4 issues exposed after the grep guard landed on main.

Issue 1: set -uset -euo pipefail
Guard script lacked -e and pipefail, so errors in find/awk subcommands could silently produce false PASS. Fixed per repo convention.

Issue 2: Fenced code blocks not skipped
The AWK logic only skipped <host: claude-code> blocks. Tokens used as examples inside ``` fences (e.g. TodoWrite in example code) triggered false positives. Extended AWK to skip fenced code blocks.

Issue 3: Writing-skills reference docs flagged
skills/writing-skills/anthropic-best-practices.md and persuasion-principles.md reference Claude model names (Sonnet, Opus, Haiku) and TodoWrite in prose — these are Claude-specific reference documents by nature, not portable skill bodies. Added to ALLOWED_FILES.

Issue 4: skills/writing-skills/SKILL.md:673TodoWrite in prose
The Skill Creation Checklist instruction Use TodoWrite to create todos was outside any host block. Wrapped in <host: claude-code>.

Verification

# Writing-skills files now clean:
bash tests/skill-content-grep.sh 2>&1 | grep writing-skills
# (no output)

Test plan

  • set -euo pipefail in guard script
  • AWK skips ``` fenced blocks
  • anthropic-best-practices.md and persuasion-principles.md in ALLOWED_FILES
  • SKILL.md:673 wrapped in <host: claude-code>
  • Guard no longer flags writing-skills files

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings April 25, 2026 06:58
@intel352
Copy link
Copy Markdown
Contributor Author

@copilot review

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Post-merge adjustments to the skill-content grep guard to reduce false positives and align its behavior/documentation with cross-host portability rules for skills under skills/ and agents/.

Changes:

  • Strengthen guard script safety defaults (set -euo pipefail).
  • Extend the guard’s skip logic and allowlist to reduce false positives (fenced-code handling, additional ALLOWED_FILES).
  • Update writing-skills documentation to describe fenced-code skipping.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
tests/skill-content-grep.sh Tightens bash error handling and modifies AWK scanning to attempt skipping fenced code blocks; expands allowlist.
skills/writing-skills/SKILL.md Documents that the guard skips fenced code blocks.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/skill-content-grep.sh Outdated
Comment on lines +68 to +72
BEGIN { skip = 0; fence = 0; ln = 0 }
{
ln++
if (/^[[:space:]]*```[[:space:]]*$/) { fence = !fence; next }
if (fence) { next }
Comment thread skills/writing-skills/SKILL.md Outdated
Comment on lines +119 to +120
The guard also skips fenced code blocks (``` ... ```) so tool names can
appear freely in example code without triggering a false positive.
Comment thread skills/writing-skills/SKILL.md Outdated
Comment on lines +119 to +121
The guard also skips fenced code blocks (``` ... ```) so tool names can
appear freely in example code without triggering a false positive.

@intel352
Copy link
Copy Markdown
Contributor Author

@copilot review

Copilot AI review requested due to automatic review settings April 25, 2026 07:08
@intel352 intel352 review requested due to automatic review settings April 25, 2026 07:08
Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 25, 2026

@copilot review

Here's a summary of issues found and addressed (commit ddf3011):

Bug: Fence regex didn't handle language-annotated fences
The previous /^[[:space:]]*```[[:space:]]*$/ only matched bare ``` lines, so opening fences like ```dot or ```bash were not recognized — causing fence-state desynchronization and the guard incorrectly flagging tokens inside code blocks. Fixed with /^[[:space:]]*```[a-zA-Z0-9_+-]*[[:space:]]*$/ (anchored with $ to also prevent false matches on lines that merely start with backticks).

Pre-existing prose token violations (exposed by the fence fix)
The fixed fence logic revealed additional real violations in prose that were previously masked by the desync. Addressed with targeted <host: claude-code> wraps and one model-tier substitution:

  • executing-plans/SKILL.md:22TodoWrite → host block + generic text
  • subagent-driven-development/SKILL.mdTeamCreate (L14), TaskCreate (L69–80), TaskList (L194), TodoWrite (L221) → host blocks
  • alignment-check/SKILL.md:28"Dispatch a Sonnet agent""Dispatch a \balanced`-tier agent"` (host-neutral model tier role)

bash tests/skill-content-grep.sh now exits 0.

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 25, 2026

@copilot review

All issues from the previous review are addressed in commit ddf3011. The guard passes cleanly:

  • Fence regex is now /^[[:space:]]*```[a-zA-Z0-9_+-]*[[:space:]]*$/ — anchored with $, handles language info strings (```dot, ```bash, etc.)
  • Remaining prose token violations fixed across executing-plans, subagent-driven-development, and alignment-check skills
  • bash tests/skill-content-grep.sh exits 0

@intel352
Copy link
Copy Markdown
Contributor Author

@copilot review

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 25, 2026

@copilot review

No new issues found. The PR is in a clean state — bash tests/skill-content-grep.sh exits 0 at ddf3011. All review findings from previous rounds have been addressed.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Post-merge fixes to the skill-content grep guard and related skill docs to reduce false positives and keep host-specific tokens properly contained for cross-LLM portability.

Changes:

  • Hardened tests/skill-content-grep.sh (set -euo pipefail), added fenced-code-block skipping, and expanded ALLOWED_FILES.
  • Updated writing-skills docs/checklist to keep TodoWrite prose inside an exclusive <host: claude-code> block and documented the new fence-skip behavior.
  • Adjusted multiple skills to avoid unguarded Claude-specific tokens in host-neutral prose (e.g., wrapping TodoWrite guidance) and updated alignment-check to reference model tiers.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/skill-content-grep.sh Strengthens guard execution and extends skip logic (fences) + allowed-file exceptions.
skills/writing-skills/SKILL.md Documents fence skipping and wraps TodoWrite checklist instruction in a claude-only host block.
skills/subagent-driven-development/SKILL.md Moves Claude-specific details into <host: claude-code> blocks in a few sections.
skills/executing-plans/SKILL.md Rephrases step 1 to be host-neutral and gates TodoWrite instruction behind a claude-only block.
skills/alignment-check/SKILL.md Switches prose from a branded model name to the balanced tier.
Comments suppressed due to low confidence (1)

skills/alignment-check/SKILL.md:33

  • This section now says to dispatch a balanced-tier agent, but the example block still specifies model: sonnet. Update the example to match the new guidance (or adjust the prose) so readers don’t get conflicting instructions.
Dispatch a `balanced`-tier agent to perform the comparison:

Agent tool (general-purpose, model: sonnet):
description: "Check alignment: design vs plan"
prompt: |

</details>



---

💡 <a href="/GoCodeAlone/claude-superpowers/new/main?filename=.github/instructions/*.instructions.md" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Add Copilot custom instructions</a> for smarter, more guided reviews. <a href="https://docs.github.com/en/copilot/customizing-copilot/adding-repository-custom-instructions-for-github-copilot" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Learn how to get started</a>.

Comment thread tests/skill-content-grep.sh Outdated
Comment on lines +74 to +75
if (/^[[:space:]]*```[a-zA-Z0-9_+-]*[[:space:]]*$/) { fence = !fence; next }
if (fence) { next }
Comment on lines +23 to +25
<host: claude-code>
Use TodoWrite to create one todo per task.
</host>
Comment on lines +228 to +231
1. Read plan, extract all tasks
<host: claude-code>
and create TodoWrite for task tracking
</host>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the repository’s portability “grep guard” and several skills/docs to prevent false positives and align host-specific tokens with the <host: claude-code> conditioning approach introduced in PR #14.

Changes:

  • Harden tests/skill-content-grep.sh with set -euo pipefail and skip ``` fenced code blocks during scanning.
  • Allow two Claude-specific writing reference docs to contain otherwise-forbidden tokens by adding them to ALLOWED_FILES.
  • Wrap/adjust several skills’ prose to avoid unguarded Claude-specific tokens (e.g., TodoWrite, TeamCreate).

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/skill-content-grep.sh Adds set -euo pipefail, skips fenced code blocks, and expands ALLOWED_FILES.
skills/writing-skills/SKILL.md Documents fenced-block skipping; wraps a TodoWrite instruction in <host: claude-code>.
skills/subagent-driven-development/SKILL.md Moves Claude-only tool detection/instructions behind <host: claude-code> blocks.
skills/executing-plans/SKILL.md Makes “task tracking” instruction host-neutral with Claude-only TodoWrite details gated.
skills/alignment-check/SKILL.md Updates prose to tier terminology (balanced) for portability.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -670,7 +674,9 @@ Deploying untested skills = deploying untested code. It's a violation of quality

## Skill Creation Checklist (TDD Adapted)

Comment thread skills/alignment-check/SKILL.md Outdated
Dispatch a `balanced`-tier agent to perform the comparison:

```
Agent tool (general-purpose, model: sonnet):
Comment on lines +70 to +81
@@ -74,6 +78,7 @@ For each plan task, create a TaskCreate with:
Then create corresponding review tasks:
- "Review spec: <task name>" (blockedBy: implement task)
- "Review quality: <task name>" (blockedBy: spec review task)
</host>
Comment on lines +228 to +230
1. Read plan, extract all tasks
<host: claude-code>
and create TodoWrite for task tracking
@intel352
Copy link
Copy Markdown
Contributor Author

@copilot review

Copilot AI review requested due to automatic review settings April 25, 2026 07:41
@intel352 intel352 review requested due to automatic review settings April 25, 2026 07:41
Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 25, 2026

@copilot review

Addressed all four findings in commit b15ef0c:

  • writing-skills/SKILL.md — added host-neutral "Create a task list for EACH checklist item below." outside the <host: claude-code> block so non-Claude hosts still receive the instruction.
  • alignment-check/SKILL.md — replaced model: sonnet in the example with model: <balanced-tier> to match the surrounding prose.
  • subagent-driven-development/SKILL.md Step 2 — added host-neutral description ("For each plan task create: an implement task, a spec-review task, and a quality-review task") outside the host block; Claude-specific TaskCreate details stay inside.
  • subagent-driven-development/SKILL.md Legacy Mode Step 1 — embedded task tracking in the prose ("…and create a task list for tracking") and replaced the fragment "and create TodoWrite…" with a complete sentence inside the host block.

bash tests/skill-content-grep.sh still exits 0.

@intel352
Copy link
Copy Markdown
Contributor Author

@copilot review

Copilot AI review requested due to automatic review settings April 25, 2026 07:46
Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 25, 2026

@copilot review

The PR is clean. All previous review findings have been addressed and bash tests/skill-content-grep.sh exits 0.

Here's a summary of the full change set across the 6 commits:

tests/skill-content-grep.sh

  • set -euo pipefail (was set -u)
  • Fence-skip AWK: 3+ backtick width tracking, optional info strings (\``bash, ```typescript`, etc.), same-width close matching for correct nesting
  • ALLOWED_FILES expanded with anthropic-best-practices.md and persuasion-principles.md

skills/alignment-check/SKILL.md

  • Prose: "Sonnet agent" → "balanced-tier agent"
  • Example: model: sonnetmodel: balanced (consistent with prose)

skills/executing-plans/SKILL.md

  • "Create TodoWrite and proceed" → "Create a task list and proceed" (host-neutral)
  • <host: claude-code> block with TodoWrite detail indented inside list item 4

skills/subagent-driven-development/SKILL.md

  • Mode detection: TeamCreate/env-var detail moved into host block; prose stays neutral
  • Step 2: host-neutral task-structure sentence added above the TaskCreate host block
  • Monitor section: TaskList wrapped in host block
  • Legacy Mode Step 1: task-tracking embedded in prose; TodoWrite detail in indented host block

skills/writing-skills/SKILL.md

  • Checklist: host-neutral "Create a task list for EACH checklist item" added before TodoWrite host block
  • Fence-skip behavior documented in the guard convention section

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR applies post-merge fixes to the skill-content portability guard and related skill docs so the guard is stricter about script failures while reducing false positives from examples/reference docs.

Changes:

  • Harden tests/skill-content-grep.sh with set -euo pipefail, add skipping of ``` fenced code blocks, and allowlist two Claude-specific writing reference docs.
  • Update skills/writing-skills/SKILL.md to document fence-skipping behavior and wrap the TodoWrite checklist instruction in a <host: claude-code> block.
  • Make several skills more host-neutral by replacing Claude-specific references with generic phrasing and/or wrapping Claude-only tool instructions in <host: claude-code> blocks.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/skill-content-grep.sh Makes the grep guard fail-fast and ignore fenced code examples; allowlists two reference docs.
skills/writing-skills/SKILL.md Documents fenced-block skipping and conditions TodoWrite instruction under claude-code.
skills/subagent-driven-development/SKILL.md Conditions Claude-only Agent Teams/tool guidance under claude-code and makes prose more host-neutral.
skills/executing-plans/SKILL.md Replaces host-specific TodoWrite instruction with a host-neutral step + claude-code conditioned guidance.
skills/alignment-check/SKILL.md Replaces model brand references with tier-based balanced wording.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@intel352
Copy link
Copy Markdown
Contributor Author

@copilot review

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 25, 2026

@copilot review

No issues found. The automated review on this round generated no comments, and bash tests/skill-content-grep.sh exits 0 at a979da2. The PR is ready to merge.

@intel352
Copy link
Copy Markdown
Contributor Author

@copilot review

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 25, 2026

@copilot review

No issues found. bash tests/skill-content-grep.sh exits 0 at 73542b4 and the previous automated review round generated no comments. The PR is ready to merge.

…wording

The grep guard now skips fenced code blocks (3+ backtick fences with
width-tracking so nested fences don't desync the toggle).  Without this,
any skill that shows host-specific tool names in example code would
falsely trip the guard.

Also tightens set -u → set -euo pipefail, adds ALLOWED_FILES entries for
the two writing-skills reference docs that discuss Anthropic tool names
as subject matter, and improves the Skill Creation Checklist wording to
be host-neutral (outer text) with a claude-code-specific refinement in a
<host: claude-code> block.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 25, 2026 09:51
@intel352 intel352 force-pushed the fix/cross-llm-pr-a-guard-followup branch from 73542b4 to 4fedd57 Compare April 25, 2026 09:51
@intel352
Copy link
Copy Markdown
Contributor Author

@copilot review

@intel352
Copy link
Copy Markdown
Contributor Author

@copilot review

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 25, 2026

@copilot review

No issues found. bash tests/skill-content-grep.sh exits 0 at 4fedd57 and the previous automated review round generated no comments. The PR is ready to merge.

@intel352 intel352 merged commit 821f1e2 into main Apr 25, 2026
6 checks passed
Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 25, 2026

@copilot review

No issues found. bash tests/skill-content-grep.sh exits 0 at 4fedd57 and the previous automated review round generated no comments. The PR is ready to merge.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR applies post-merge fixes to the markdown portability “grep guard” and related writing-skills documentation, reducing false positives and aligning the guard script with repo conventions.

Changes:

  • Update tests/skill-content-grep.sh to use set -euo pipefail, skip fenced code blocks, and allow two Claude-specific reference docs under skills/writing-skills/.
  • Document the fenced-code-block skipping behavior in skills/writing-skills/SKILL.md.
  • Wrap TodoWrite checklist guidance in an exclusive <host: claude-code> block.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
tests/skill-content-grep.sh Tightens bash error handling, extends AWK skipping logic to fenced code blocks, and whitelists select reference docs.
skills/writing-skills/SKILL.md Documents guard behavior and adjusts checklist text so Claude-only tool references are host-gated.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +119 to +120
The guard also skips fenced code blocks (`` ``` `` … `` ``` ``, including
opening fences with info strings like `` ```bash ``) so tool names can
@intel352
Copy link
Copy Markdown
Contributor Author

@copilot review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants