Skip to content

Replace guardrail-target commands in claude/skills/#279

Merged
ikuwow merged 2 commits into
mainfrom
fix/retro-skill-sed-to-tr
Jul 9, 2026
Merged

Replace guardrail-target commands in claude/skills/#279
ikuwow merged 2 commits into
mainfrom
fix/retro-skill-sed-to-tr

Conversation

@ikuwow

@ikuwow ikuwow commented Jul 9, 2026

Copy link
Copy Markdown
Owner

Summary

Sweep claude/skills/ for occurrences of Bash commands that the planned claude-narrower-bash plugin (see #278) would soft-deny, and either replace them with the narrower dedicated tool or document why the swiss-army form is unavoidable.

Motivated by a self-collision this session: the retrospective skill's SKILL.md used pwd | sed 's|/|-|g' and tripped a session-local prototype of the guardrail while running the skill itself.

Changes

  • claude/skills/retrospective/SKILL.md: tr is the dedicated tool for single-character translation, needs no regex delimiters, and is the alternative the guardrail's own reason text points to.
  • claude/skills/git-workflow/pr-reaction.md: added an inline note explaining that the gh api /pulls/N/comments call cannot be replaced. Verified via gh pr view --json field list (no per-line review comments) and gh pr-review review view --help (no flag exposes user.type). This falls under the guardrail's documented escape hatch for cases where high-level gh cannot express the operation, but a future reader shouldn't have to re-derive that.

Verification

  • pre-commit hooks pass on both commits; CI (bootstrap ubuntu / macos, shellcheck, python-doctest, Socket Security) all green.
  • Retrospective SKILL Step 1 exercised this session — pwd | tr '/' '-' produced -Users-ikuwow-dotfiles, matching the transcript directory Claude Code actually writes to.
  • pr-reaction note verified against live gh today: gh pr-review review view --help exposes no flag for user.type / actor kind, and gh pr view --json field list has reviews / comments but nothing that returns per-line review comments with author metadata.

Notes

  • Explore sweep also found retrospective/analysis.md:156 mentions tail in prose. That is documentation text, not a Bash invocation, so no change.

Refs: #278 (plugin design), #277 (existing warn_gh_api hook).

ikuwow added 2 commits July 9, 2026 16:16
The Step 1 example used `pwd | sed 's|/|-|g'` for simple `/` → `-`
character translation. `tr` is the dedicated tool for that operation
and needs no regex delimiters. This also avoids a self-collision with
PreToolUse hooks that soft-deny bare `sed` invocations.
Add an inline note above the `gh api /pulls/N/comments` call in
pr-reaction.md explaining that neither the `gh pr-review` extension
nor high-level `gh pr` subcommands expose `user.type` on review
comments, so the REST API call is the intended path. Without this
context, a reader (or a PreToolUse guardrail) sees `gh api` and
looks for a replacement that doesn't exist.
@ikuwow ikuwow marked this pull request as ready for review July 9, 2026 07:51
@ikuwow ikuwow merged commit c1f2968 into main Jul 9, 2026
6 checks passed
@ikuwow ikuwow deleted the fix/retro-skill-sed-to-tr branch July 9, 2026 07:51
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.

1 participant