docs(skills): document review path-resolution gotcha in agy + grok

review/review-files resolve relative paths only against CWD or
$CLAUDETOOLS_ROOT, never a submodule/subdir — so submodule-relative
paths fail with "file not found". Add a [!WARNING] callout to both
SKILL.md files, fix the misleading "absolute or repo-relative" table
wording, and add inline GOTCHA comments at each resolution site in
both scripts. Bitten us repeatedly (latest: GuruConnect review).
This commit is contained in:
2026-06-05 16:55:56 -07:00
parent 8b82e28ed6
commit 2795fab3c7
4 changed files with 44 additions and 8 deletions

View File

@@ -207,8 +207,11 @@ case "$MODE" in
target="$1"
instr="${2:-Give an independent, critical review of this file: accuracy, gaps/omissions, and concrete improvements. Be specific.}"
# Grok reads the file itself (no embedding). Resolve to an absolute path (as given, or
# repo-relative), then hand grok the native-Windows ABSOLUTE path so read_file works
# regardless of cwd, and tolerates absolute paths and spaces.
# relative to $REPO_ROOT), then hand grok the native-Windows ABSOLUTE path so read_file
# works regardless of cwd, and tolerates absolute paths and spaces.
# GOTCHA: a relative path resolves against ONLY CWD or $REPO_ROOT ($CLAUDETOOLS_ROOT) --
# NOT a submodule/subdir. "server/src/x.rs" relative to a submodule fails unless CWD is
# that submodule. Pass ABSOLUTE paths for submodule/subtree files.
if [ -f "$target" ]; then resolved="$target"
elif [ -f "$REPO_ROOT/$target" ]; then resolved="$REPO_ROOT/$target"
else echo "[$SELF] file not found: $target" >&2; exit 2; fi
@@ -234,8 +237,11 @@ case "$MODE" in
;;
review-files)
# review-files [-i "instructions"] <file> [file ...]
# Reviews a SET of files together (grok read_file's each). Paths may be absolute or
# repo-relative; spaces are fine. No code is passed as a shell arg -> no quote hell.
# Reviews a SET of files together (grok read_file's each). Paths may be absolute,
# CWD-relative, or relative to $REPO_ROOT ($CLAUDETOOLS_ROOT); spaces are fine.
# GOTCHA: a relative path is NOT resolved against a submodule/subdir -- "server/src/x.rs"
# relative to a submodule fails ("file not found") unless CWD is that submodule. Pass
# ABSOLUTE paths for submodule/subtree files. No code passed as a shell arg -> no quote hell.
instr='Independently review these files together as a unit: correctness/bugs, gaps, cross-file consistency, and concrete improvements. Be specific and cite file:line.'
files=()
while [ $# -gt 0 ]; do