T-Y7IN-document-grep-alias-bypass
Status: closed/done · Impact: low · Complexity: small
Auto-generated from a /sdlc:task-work post-mortem. Review and
promote to ready before picking up.
/sdlc:task-work and several other SDLC skills shell out to grep
with BSD-flag arguments (e.g. grep -l -E). On some user shells this
hits an alias that rewrites grep to rg --no-heading --with-filename, which then fails on the BSD flags. Documenting the
“use /usr/bin/grep (or command grep)” pattern in the skills that
invoke grep keeps a single-line workaround at the source of truth
instead of relitigating it during every run.
From the post-mortem:
“Bash invocations of
grepwere intercepted by a shell alias (looks likergwith--no-heading --with-filenamerewrites) that fails on BSD-flag arguments — used/usr/bin/grepto bypass. Cosmetic, but it broke a verification step until noticed.”
A grep of plugin/skills/**/SKILL.md shows several skills invoke
grep bare in their procedural prose; none currently caveat the alias
issue.
Proposed
Section titled “Proposed”In any SDLC skill that includes grep in a Bash example, switch the
example to command grep (POSIX-portable: bypasses aliases and
functions but uses the shell’s PATH) or /usr/bin/grep (absolute,
ignores PATH-overrides) and add a one-line note explaining why.
Optionally: add the same note to a shared “Bash conventions” snippet that skills can reference, so it stays consistent.
Approach
Section titled “Approach”grep -nE '\bgrep:space:' plugin/skills/**/SKILL.md(run with/usr/bin/grepto avoid the very issue) to enumerate hits.- For each hit, replace
grep→command grepand add a footnote / parenthetical on first use per file: “command greprather than baregrepbecause some shells aliasgreptorgrewrites that fail on BSD flags.” - Spot-check
/project-checkstill passes.
Files to touch
Section titled “Files to touch”plugin/skills/**/SKILL.md— wherevergrepis invoked. Likely candidates:task-work,project-cleanup,entities-audit,entities-migrate,import-planning.
Acceptance criteria
Section titled “Acceptance criteria”- AC-1: No SDLC SKILL.md procedural example invokes bare
grep; all usecommand grepor/usr/bin/grep. - AC-2: Each modified SKILL.md includes a one-line rationale on first use of the bypass.
- AC-3:
/project-checkstill passes.
Dependencies
Section titled “Dependencies”- none
Discovery context
Section titled “Discovery context”Spawned by /sdlc:task-work post-mortem of T-DHGL-build-import-planning-skill on 2026-05-19.
Post-mortem
Section titled “Post-mortem”What went sideways or what could automation have caught:
- Three of the six
grephits in SKILL.md files (git grepandgit log --grep) are git’s own flag/subcommand, not the shellgrepcommand — so they aren’t subject to the alias issue. Distinguishing “bashgrepinvocation” from “git’s--grepflag” required reading each hit in context. A simple\bgrep:space:“ regex doesn’t separate them; a more selective enumeration (e.g. excluding lines containinggitbefore thegreptoken, or requiring the token to start a pipeline) would have shortened the triage. - One hit (
task-work:213post-mortem prose: “a pre-implementation grep for similar helpers”) is a noun-form remediation suggestion, not a command to run. Left as-is — converting would read awkwardly and the prose doesn’t direct a specific shell invocation. - /project-check’s
check_entities.pyfailed in the worktree withModuleNotFoundError: No module named 'yaml'. Same failure on main — pre-existing environmental gap, not caused by this change. The newercheck_skill_prose.pyran cleanly and reported no violations. Worktree init should either pin a python with PyYAML available or vendor the YAML reader for the entity checker.
Out of scope
Section titled “Out of scope”- none