| name | cross-agent-skill-audit |
| version | 1.0.0 |
| category | coordination |
| description | Audit and fix skill accessibility across all 4 agents (Hermes, Codex, Codex CLI, Gemini CLI). Identifies gaps in symlink wiring, external_dirs, and per-repo routing. |
| tags | ["skills","audit","multi-agent","codex","gemini","hermes","Codex","harness"] |
Cross-Agent Skill Audit
When to Use
- User reports a skill isn't visible to one or more agents
- After migrating skills between locations (~/.hermes/ vs .Codex/)
- When adding a new repo to the workspace
- After hermes update or harness-update to verify nothing broke
Architecture Overview
All 4 agents access skills through different mechanisms:
Hermes: external_dirs in ~/.hermes/config.yaml (reads 6 repos' .Codex/skills/)
Codex: .Codex/skills/ (native, on-demand via slash commands)
Codex CLI: .codex/skills/ → symlink → ../.Codex/skills/
Gemini CLI: .gemini/skills/ → symlink → ../.Codex/skills/
Per-repo: each repo that has agents must have .codex/skills and .gemini/skills symlinks pointing to ../../.Codex/skills.
Audit Procedure
Step 1: Count skills per agent
WS=/mnt/local-analysis/workspace-hub
echo "CC: $(find -L $WS/.Codex/skills -name 'SKILL.md' -not -path '*/_archive/*' | wc -l)"
echo "Codex: $(find -L $WS/.codex/skills -name 'SKILL.md' -not -path '*/_archive/*' | wc -l)"
echo "Gemini: $(find -L $WS/.gemini/skills -name 'SKILL.md' -not -path '*/_archive/*' | wc -l)"
grep -A7 'external_dirs' ~/.hermes/config.yaml | grep '.Codex/skills' | wc -l
echo "(count of external_dirs paths)"
Expected: All three symlink agents should show the same count. A mismatch means broken symlink or real directory takeover.
Step 2: Verify symlink integrity
test -L $WS/.codex/skills && echo "OK: symlink" || echo "BROKEN: real dir or missing"
test -L $WS/.gemini/skills && echo "OK: symlink" || echo "BROKEN: real dir or missing"
for repo in CAD-DEVELOPMENTS digitalmodel worldenergydata achantas-data assetutilities; do
if [ -d "$WS/$repo/.codex" ]; then
target=$(readlink "$WS/$repo/.codex/skills" 2>/dev/null || echo "MISSING")
echo " $repo/.codex/skills → $target"
fi
done
Step 3: Check external_dirs coverage
for d in $(grep 'external_dirs' ~/.hermes/config.yaml -A10 | grep '.Codex/skills' | sed 's/.*- //'); do
count=$(find -L "$d" -name 'SKILL.md' -not -path '*/_archive/*' | wc -l 2>/dev/null)
label=$(basename $(dirname $(dirname "$d")))
echo " $label: $count skills"
done
Step 4: Check for local-only skills
find ~/.hermes/skills -name 'SKILL.md' 2>/dev/null | while read f; do
echo " LOCAL ONLY: $f"
done
Expected: 0 results. Any local skills should be migrated to repo .Codex/skills/.
Common Fixes
Fix 1: .codex/skills is a real directory instead of symlink
cd $WS
mv .codex/skills .codex/skills.bak
ln -s ../.Codex/skills .codex/skills
rm -rf .codex/skills.bak
git add .codex/skills
git commit -m "fix(codex): replace .codex/skills real dir with symlink"
Fix 2: Missing per-repo symlinks
cd $WS/GEMINI-REPO
rm -rf .codex/skills 2>/dev/null
rm -rf .gemini/skills 2>/dev/null
ln -s ../../.Codex/skills .codex/skills
ln -s ../../.Codex/skills .gemini/skills
git add .codex/skills .gemini/skills
git commit -m "feat(harness): add .codex/.gemini symlinks for GEMINI-REPO"
Fix 3: Hermes external_dirs missing a repo
Edit ~/.hermes/config.yaml:
skills:
external_dirs:
- /path/to/repo/.Codex/skills
Then run: scripts/_core/sync-agent-configs.sh
Fix 4: Skills in ~/.hermes/skills/ not migrated to repo
bash scripts/hermes/backfill-skills-to-repo.sh --commit
Pitfalls
-
find without -L doesn't follow symlinks: Always use find -L when counting skills through .codex/skills or .gemini/skills. Plain find returns 0 for symlinked directories.
-
Codex symlink takeover: A common bug where .codex/skills somehow becomes a real directory (e.g., from a git checkout that dereferences symlinks). Always check with test -L.
-
Per-repo vs workspace-hub access: When Codex/Gemini work inside a sub-repo (e.g., CAD-DEVELOPMENTS/), their symlinks point to ../../.Codex/skills which is the sub-repo's local skills only. They do NOT automatically see workspace-hub canonical skills. This is by design to limit context budget.
-
external_dirs path changes: If workspace-hub moves to a different path, update __WS_HUB_PATH__ in config/agents/hermes/config.yaml.template and re-run sync-agent-configs.sh.
-
_archive directory: The 2166 archived skills in workspace-hub .Codex/skills/ should NOT be counted. Always exclude with -not -path '*/_archive/*'.
-
Empty category dirs in ~/.hermes/skills/: After migration, empty dirs remain. Clean with: find ~/.hermes/skills -mindepth 1 -maxdepth 1 -type d -empty -delete
Validation Checklist
After any change to the skill ecosystem: