Repository Reference Audit
Systematically find and fix repository self-references that have drifted due to renames, copy-paste from upstream templates, or placeholder tokens left during setup.
When to Use
- After renaming a repository
- After forking/copying a repo and references still point to upstream
- When
[REDACTED] placeholders remain in public-facing files
- When README clone instructions or badge URLs don't match the actual repo
- Periodic hygiene check before release/publication
Audit Methodology
Phase 1: Discovery
Scan the entire repo for all external-looking URLs and repo-name patterns:
# Find all HTTP(S) URLs
find . -type f \( -name '*.md' -o -name '*.json' -o -name '*.py' -o -name '*.yml' -o -name '*.yaml' \) \
-not -path './node_modules/*' -not -path './.git/*' \
-exec grep -Hn 'https?://[^)>\s]+' {} +
# Find all owner/repo patterns (GitHub shorthand)
grep -rn 'github\.com/[A-Za-z0-9_-]\+/[A-Za-z0-9_.\-]\+' --include='*.md' --include='*.json' --include='*.py' --include='*.yml'
# Find common typos/variants of the repo name
grep -rn 'Harmes-House\|Hermes-House\|[REDACTED]' --include='*.md' --include='*.json' --include='*.py'
Also check:
git remote -v for the canonical upstream
package.json repository, bugs, homepage fields
mkdocs.yml or docs/ config for site URLs
- CI workflows (
.github/workflows/) for hardcoded repo references
Phase 2: Classification
Classify every hit into one of these buckets:
| Bucket |
Action |
Example |
| Correct |
No change |
https://github.com/clowlove/Hermes-House |
| Typo in repo name |
Fix spelling |
Harmes-House → Hermes-House |
| Wrong upstream |
Point to actual repo |
nousresearch/hermes-agent → clowlove/Hermes-House |
| Placeholder token |
Replace with real value |
[REDACTED] → clowlove (or remove if sensitive) |
| External ref |
Keep as-is |
Third-party URLs, upstream docs, CDN badges |
| Generated/lock file |
Skip unless intentional |
package-lock.json resolved URLs, node_modules/ |
Phase 3: Targeted Fixes
Do NOT blindly sed the whole repo. Fix by bucket with explicit old_string → new_string pairs.
Pitfalls:
- Lock/resolved files:
package-lock.json, yarn.lock, .gitmodules resolved URLs may be mirrors or upstream pins — inspect before changing.
- Badges:
img.shields.io/badge/... and github/stars|forks|issues URLs often encode the repo name. Fix these too, but verify the badge service accepts the new repo name.
- Historical logs: Files in
docs/memory-backup/ or CHANGELOG.md may reference old names as history. Fix for consistency unless the entry is a dated historical record that should stay verbatim.
- Upstream references: READMEs often have "Star the upstream" badges pointing to upstream repos (e.g.,
nousresearch/hermes-agent). Keep these if they're intentional upstream attribution, but fix any that are mistakenly pointing upstream when they should point to the fork.
- Sensitive placeholders:
[REDACTED] in public files may be intentional privacy redaction. Do NOT restore real secrets. If the placeholder is in a public README and the value is non-sensitive (username, non-secret URL), replace it. If it's a PAT, token, or private email, leave it redacted or ask the user.
Phase 4: Verification
# Re-scan for remaining issues
grep -rn 'Harmes-House\|nousresearch/hermes-agent' --include='*.md' --include='*.json' --include='*.py' | grep -v 'badge\|Sponsor\|Support'
# Verify clone instructions work
grep -rn 'git clone' --include='*.md' | grep -v 'nousresearch/hermes-agent'
# Check placeholder tokens remain only where intended
grep -rn '\[REDACTED\]' --include='*.md' --include='*.json'
Common Patterns
Repo rename typo (a → e)
The most common pattern when a repo is named after a brand/person and gets misspelled in templates:
Harmes-House → Hermes-House (missing 'e')
- Search for the typo variant across all file types, not just code files.
Clone URL drift
Forks often copy README clone instructions from upstream:
- git clone https://github.com/upstream-org/original-repo.git
+ git clone https://github.com/clowlove/Hermes-House.git
cd Hermes-House
Placeholder tokens
[REDACTED], YOUR_USERNAME, owner/repo left in configs or docs:
- Replace non-sensitive placeholders with real values
- Leave secrets redacted
- Update
mkdocs.yml, package.json, MEMORY.md, and any config files
Safety Constraints
- Never rewrite product structure — only touch docs, configs, metadata, and CSS/JS/meta for SEO/visual work.
- Never touch
node_modules/, .git/, dist/, build/ — these are generated or immutable.
- Lock files (
package-lock.json, yarn.lock) — only fix if the resolved URL is clearly wrong for this repo. Mirror URLs (Tencent, Aliyun, etc.) are intentional.
- Historical logs — dated entries in
CHANGELOG.md, docs/memory-backup/, hermes-journal.md should be fixed for consistency unless they are verbatim historical records.
- Secrets — never expose PATs, tokens, API keys, or private emails during cleanup.
Output
After fixing, report:
- Number of files modified
- Breakdown by bucket (typo, wrong upstream, placeholder, etc.)
- Any intentional upstream references you deliberately kept
- Any placeholders you left redacted and why
Reference
For the full error taxonomy and real-world examples from the clowlove/Hermes-House audit, see references/repo-reference-audit-examples.md.
1---2name: repo-reference-audit3description: Audit and bulk-correct repository self-references across multi-file, multi-language codebases. Covers repo name typos, clone URLs, placeholder tokens, and cross-reference consistency after renames or refactors.4license: MIT5---67# Repository Reference Audit89Systematically find and fix repository self-references that have drifted due to renames, copy-paste from upstream templates, or placeholder tokens left during setup.1011## When to Use1213- After renaming a repository14- After forking/copying a repo and references still point to upstream15- When `[REDACTED]` placeholders remain in public-facing files16- When README clone instructions or badge URLs don't match the actual repo17- Periodic hygiene check before release/publication1819## Audit Methodology2021### Phase 1: Discovery2223Scan the entire repo for all external-looking URLs and repo-name patterns:2425```bash26# Find all HTTP(S) URLs27find . -type f \( -name '*.md' -o -name '*.json' -o -name '*.py' -o -name '*.yml' -o -name '*.yaml' \) \28 -not -path './node_modules/*' -not -path './.git/*' \29 -exec grep -Hn 'https?://[^)>\s]+' {} +3031# Find all owner/repo patterns (GitHub shorthand)32grep -rn 'github\.com/[A-Za-z0-9_-]\+/[A-Za-z0-9_.\-]\+' --include='*.md' --include='*.json' --include='*.py' --include='*.yml'3334# Find common typos/variants of the repo name35grep -rn 'Harmes-House\|Hermes-House\|[REDACTED]' --include='*.md' --include='*.json' --include='*.py'36```3738Also check:39- `git remote -v` for the canonical upstream40- `package.json` `repository`, `bugs`, `homepage` fields41- `mkdocs.yml` or `docs/` config for site URLs42- CI workflows (`.github/workflows/`) for hardcoded repo references4344### Phase 2: Classification4546Classify every hit into one of these buckets:4748| Bucket | Action | Example |49|--------|--------|---------|50| **Correct** | No change | `https://github.com/clowlove/Hermes-House` |51| **Typo in repo name** | Fix spelling | `Harmes-House` → `Hermes-House` |52| **Wrong upstream** | Point to actual repo | `nousresearch/hermes-agent` → `clowlove/Hermes-House` |53| **Placeholder token** | Replace with real value | `[REDACTED]` → `clowlove` (or remove if sensitive) |54| **External ref** | Keep as-is | Third-party URLs, upstream docs, CDN badges |55| **Generated/lock file** | Skip unless intentional | `package-lock.json` resolved URLs, `node_modules/` |5657### Phase 3: Targeted Fixes5859**Do NOT blindly sed the whole repo.** Fix by bucket with explicit old_string → new_string pairs.6061Pitfalls:62- **Lock/resolved files**: `package-lock.json`, `yarn.lock`, `.gitmodules` resolved URLs may be mirrors or upstream pins — inspect before changing.63- **Badges**: `img.shields.io/badge/...` and `github/stars|forks|issues` URLs often encode the repo name. Fix these too, but verify the badge service accepts the new repo name.64- **Historical logs**: Files in `docs/memory-backup/` or `CHANGELOG.md` may reference old names as history. Fix for consistency unless the entry is a dated historical record that should stay verbatim.65- **Upstream references**: READMEs often have "Star the upstream" badges pointing to upstream repos (e.g., `nousresearch/hermes-agent`). Keep these if they're intentional upstream attribution, but fix any that are mistakenly pointing upstream when they should point to the fork.66- **Sensitive placeholders**: `[REDACTED]` in public files may be intentional privacy redaction. Do NOT restore real secrets. If the placeholder is in a public README and the value is non-sensitive (username, non-secret URL), replace it. If it's a PAT, token, or private email, leave it redacted or ask the user.6768### Phase 4: Verification6970```bash71# Re-scan for remaining issues72grep -rn 'Harmes-House\|nousresearch/hermes-agent' --include='*.md' --include='*.json' --include='*.py' | grep -v 'badge\|Sponsor\|Support'7374# Verify clone instructions work75grep -rn 'git clone' --include='*.md' | grep -v 'nousresearch/hermes-agent'7677# Check placeholder tokens remain only where intended78grep -rn '\[REDACTED\]' --include='*.md' --include='*.json'79```8081## Common Patterns8283### Repo rename typo (a → e)84The most common pattern when a repo is named after a brand/person and gets misspelled in templates:85- `Harmes-House` → `Hermes-House` (missing 'e')86- Search for the typo variant across all file types, not just code files.8788### Clone URL drift89Forks often copy README clone instructions from upstream:90```diff91- git clone https://github.com/upstream-org/original-repo.git92+ git clone https://github.com/clowlove/Hermes-House.git93 cd Hermes-House94```9596### Placeholder tokens97`[REDACTED]`, `YOUR_USERNAME`, `owner/repo` left in configs or docs:98- Replace non-sensitive placeholders with real values99- Leave secrets redacted100- Update `mkdocs.yml`, `package.json`, `MEMORY.md`, and any config files101102## Safety Constraints1031041. **Never rewrite product structure** — only touch docs, configs, metadata, and CSS/JS/meta for SEO/visual work.1052. **Never touch `node_modules/`, `.git/`, `dist/`, `build/`** — these are generated or immutable.1063. **Lock files** (`package-lock.json`, `yarn.lock`) — only fix if the resolved URL is clearly wrong for this repo. Mirror URLs (Tencent, Aliyun, etc.) are intentional.1074. **Historical logs** — dated entries in `CHANGELOG.md`, `docs/memory-backup/`, `hermes-journal.md` should be fixed for consistency unless they are verbatim historical records.1085. **Secrets** — never expose PATs, tokens, API keys, or private emails during cleanup.109110## Output111112After fixing, report:113- Number of files modified114- Breakdown by bucket (typo, wrong upstream, placeholder, etc.)115- Any intentional upstream references you deliberately kept116- Any placeholders you left redacted and why117118## Reference119120For the full error taxonomy and real-world examples from the `clowlove/Hermes-House` audit, see `references/repo-reference-audit-examples.md`.