From memex
Analyze the vault for missing related: frontmatter cross-links and present suggestions interactively. Conservative: only surfaces high-evidence (wikilink already in body) and medium-evidence (filepath/title in body, or shared title/H2 terms) candidates. Never edits without explicit per-item user confirmation. Use when the user asks to find missing related: links in the vault, when /memex:sweep flags an isolated spec, or as part of the After-completing-a-spec reflection.
How this skill is triggered — by the user, by Claude, or both
Slash command
/memex:linkThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Analyze the `.vault/` vault and surface candidate `related:` frontmatter additions where genuinely necessary.
Analyze the .vault/ vault and surface candidate related: frontmatter additions where genuinely necessary.
Announce at start: "Analyzing vault for missing cross-links..."
Four phases. Detection is deterministic (Bash). Presentation and editing are interactive (agent + user).
scripts/find-candidates.sh "$SCOPE" (where $SCOPE is the optional argument from the slash command).evidence_type to confidence (high/medium).y, edit source's related: frontmatter to add the wikilink.If no candidates surface, say No cross-link suggestions. Vault is well-connected. and stop.
Sanity-check command -v jq first — if absent, abort with memex-link requires jq. Install with: brew install jq (or platform-appropriate hint).
Then run the deterministic detector:
SCOPE="$1" # optional argument from slash command
SKILL_DIR="$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" && pwd)"
bash "$SKILL_DIR/scripts/find-candidates.sh" "$SCOPE" > /tmp/memex-link-candidates.json
If the script exits with code 2, surface its stderr and stop. If exit 0 and stdout is [], report "Vault is well-connected" and stop.
For each candidate, map evidence_type to confidence:
evidence_type | Confidence |
|---|---|
wikilink_in_body | high |
filepath_in_body | medium |
title_in_body | medium |
shared_heading_terms | medium |
No "low" bucket; the script does not emit anything that would qualify.
Render a markdown table grouped by confidence:
## Cross-Link Suggestions — N candidates (H high, M medium)
| # | conf | source → target | rationale |
|---|---|---|---|
| 1 | high | spec-rename… → memex | wikilink in body line 14 |
| 2 | medium | sweep → mechanical-enforcement-over-prose | shared H2 terms: feedforward, feedback |
For each candidate, in order, prompt the user:
[1/3] HIGH — .vault/specs/.../spec-X.md → .vault/learnings/Y.md
Reason: wikilink in body line 14
Add to source's `related:`? (y/n/skip-rest)
Receive user input (single character):
y — edit the source's frontmatter:
--- fences)related: fieldrealpath --relative-to=$(dirname source) target (or equivalent for macOS).
[[../../learnings/Y]].[[Y]].related: (uniformity with existing notes).Source modified externally — skipping. Continue loop.related: value is not a list (e.g., a string or mapping), abort that single edit with Cannot edit <path>: related field has unexpected shape. Skipping. Open the file and fix manually. Continue loop.n — skip; record locally as rejected (not persisted across runs); continue.
skip-rest or s — terminate the loop.
After the loop, print summary:
Done. N accepted, M rejected, K skipped.
Edits applied to: <list of files>
Do not auto-commit. The user decides when.
The skill ships a fixture-based test for the deterministic detector. To run:
bash .agents/skills/memex-link/tests/run.sh
Expected output: PASS. Run before committing any change to the script.
Guides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.
npx claudepluginhub ribeirogab/memex --plugin memex