Skip to content

Commit 1febeb8

Browse files
committed
docs(gitfix): add grep-based discovery + stale-ref sweep + "Grep before you trust" rule
Lesson from a 2026-04-20 polish pass: prior audits missed 9 stale `2ndbrain-maxxing` references hiding in `README-SECTIONS/` and `tests/` because the sweeps only checked top-level `README.md` + `install.sh`. Three insertions so the next `/gitfix` run enumerates the surface before it starts reading: 1. Phase 1 gains a step 5 — grep the whole tree for renamed repo names, version mismatches, self-references, TODO/FIXME markers, and deprecated commands. Memory counts are an anchor, not a ceiling. 2. Phase 4 cross-reference gains a stale-reference sweep sub-rule using the Phase-1 greps as the authoritative fix list, with a post-flip verification requirement (`grep -rE <old-pattern> .` must return 0). 3. Rules section gains a "Grep before you trust" bullet — the refs that slip through every prior audit are the ones hiding in `README-SECTIONS/`, `tests/fixtures/`, `docs/`, config snippets, and vendored scripts. Skipping the grep step is how bugs survive sweeps.
1 parent 625473c commit 1febeb8

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

gitfix-skill/SKILL.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ Before reading any file, build a complete map of the repo:
2222
2. For each `step-*/`, `bonus-*/`, `gitfix-skill/`, and other feature folders, list their contents
2323
3. Note every install script (`*.sh`), skill file (`SKILL.md`), and documentation file (`*.md`)
2424
4. Identify the primary documentation files: `README.md`, `CHEATSHEET.md`, `SECURITY.md`, and any files in `README-SECTIONS/` or `docs/`
25+
5. **Grep-based discovery.** Before reading files individually, enumerate the surface area exhaustively:
26+
- `grep -rn '<old-repo-name>' .` — every reference to any predecessor or sibling repo name (e.g. renames, forks, merged projects)
27+
- `grep -rn '<current-version>\|<prev-version>' .` — version strings mentioned anywhere (package.json truth vs docs claims)
28+
- `grep -rnE '\.(sh|md|json|yml|yaml|toml)$' --include='*' -l '<current-repo-name>' .` — self-references (for finding where self-name appears so renames are clean)
29+
- `grep -rn 'TODO\|FIXME\|XXX\|HACK' .` — unresolved markers
30+
- `grep -rn '<deprecated-command-or-alias>' .` — commands that changed names
31+
Capture every hit with line numbers — you read what grep tells you to read, not what judgment suggests. Prior audits' count of "N references" is an anchor, not a ceiling: refs hide in `README-SECTIONS/`, `tests/`, `docs/`, sub-scripts that top-level greps miss.
2532

2633
Do not skip any folder. The map must be complete before Phase 2 begins.
2734

@@ -98,6 +105,11 @@ Compare what the code actually does (Phase 2) against what the docs say (Phase 3
98105

99106
**Cross-references between docs** — Does the README point to the right section anchors? Do links resolve?
100107

108+
**Stale-reference sweep (grep-driven).** Use the greps from Phase 1 step 5 as the authoritative fix list. For each pattern:
109+
- Confirm every hit. Do not trust prior passes' counts. If memory says "N refs in README.md and install.sh", re-grep the whole tree — the misses live in `README-SECTIONS/`, `tests/fixtures/`, `docs/`, sub-scripts, config snippets.
110+
- Flip each hit to the current canonical form, preserving case-sensitivity rules (e.g. lowercase `old-name` → new repo's canonical case).
111+
- Post-flip verify: `grep -rE '<old-pattern>' .` must return 0 hits on tracked files. Untracked `owner: human` vault notes are out of scope but should be flagged in the Watch list.
112+
101113
### Phase 5 — Fix Everything
102114

103115
Fix every gap found in Phase 4. Apply edits in this order:
@@ -199,3 +211,4 @@ Never push without asking first. Never skip listing the commits. The user must s
199211
- **No invented content.** If you don't know the current state of something, read the file. Don't guess.
200212
- **Flag what you can't verify.** If something requires running a command or checking an external URL, flag it in the Watch list rather than silently skipping it.
201213
- **Touch every section.** The value of `/gitfix` is that nothing gets missed. If a section is fine, say so in the report. If it's wrong, fix it.
214+
- **Grep before you trust.** When looking for every instance of X across the repo, run `grep -rn <pattern> .` first — not just against top-level `README.md` + `install.sh`. The refs that slip through every prior audit are the ones hiding in `README-SECTIONS/`, `tests/fixtures/`, `docs/`, config snippets, and vendored scripts. Do not rely on memory or prior-pass counts. Skipping the grep step is how bugs survive sweeps.

0 commit comments

Comments
 (0)