Runtime Configuration (Step 0 — before any processing)
Read these files to configure domain-specific behavior:
-
ops/derivation-manifest.md— vocabulary mapping, platform hints- Use
vocabulary.notesfor the notes folder name - Use
vocabulary.note/vocabulary.note_pluralfor note type references - Use
vocabulary.reflectfor the process verb in output - Use
vocabulary.topic_map/vocabulary.topic_map_pluralfor MOC references - Use
vocabulary.cmd_reweavefor the next-phase suggestion - Use
vocabulary.inboxfor the inbox folder name
- Use
-
ops/config.yaml— processing depth, pipeline chainingprocessing.depth: deep | standard | quickprocessing.chaining: manual | suggested | automatic
If these files don't exist, use universal defaults.
Processing depth adaptation:
| Depth | Connection Behavior |
|---|---|
| deep | Full dual discovery (MOC + semantic search). Evaluate every candidate. Multiple passes. Synthesis opportunity detection. Bidirectional link evaluation for all connections. |
| standard | Dual discovery with top 5-10 candidates. Standard evaluation. Bidirectional check for strong connections only. |
| quick | Single pass — either MOC or semantic search. Accept obvious connections only. Skip synthesis detection. |
EXECUTE NOW
Target: $ARGUMENTS
Parse immediately:
- If target contains
[[note name]]or note name: find connections for that {vocabulary.note} - If target contains
--handoff: output RALPH HANDOFF block at end - If target is empty: check for recently created {vocabulary.note_plural} or ask which {vocabulary.note}
- If target is "recent" or "new": find connections for all {vocabulary.note_plural} created today
Execute these steps:
- Read the target {vocabulary.note} fully — understand its claim and context
- Throughout discovery: Capture which {vocabulary.topic_map_plural} you read, which queries you ran (with scores), which candidates you evaluated. This becomes the Discovery Trace — proving methodology was followed, not reconstructed.
- Run Phase 0 (index freshness check)
- Use dual discovery in parallel:
- Browse relevant {vocabulary.topic_map}(s) for related {vocabulary.note_plural}
- Run semantic search for conceptually related {vocabulary.note_plural}
- Evaluate each candidate: does a genuine connection exist? Can you articulate WHY?
- Add inline wiki-links where connections pass the articulation test
- Update relevant {vocabulary.topic_map}(s) with this {vocabulary.note}
- If task file in context: update the {vocabulary.reflect} section
- Report what was connected and why
- If
--handoffin target: output RALPH HANDOFF block
START NOW. Reference below explains methodology — use to guide, not as output.
Reflect
Find connections, weave the knowledge graph, update {vocabulary.topic_map_plural}. This is the forward-connection phase of the processing pipeline.
Philosophy
The network IS the knowledge.
Individual {vocabulary.note_plural} are less valuable than their relationships. A {vocabulary.note} with fifteen incoming links is an intersection of fifteen lines of thought. Connections create compound value as the vault grows.
This is not keyword matching. This is semantic judgment — understanding what {vocabulary.note_plural} MEAN to determine how they relate. A {vocabulary.note} about "friction in systems" might deeply connect to "verification approaches" even though they share no words. You are building a traversable knowledge graph, not tagging documents.
Quality over speed. Explicit over vague.
Every connection must pass the articulation test: can you say WHY these {vocabulary.note_plural} connect? "Related" is not a relationship. "Extends X by adding Y" or "contradicts X because Z" is a relationship.
Bad connections pollute the graph. They create noise that makes real connections harder to find. When uncertain, do not connect.
Invocation Patterns
/reflect (no argument)
Check for recent additions:
- Look for {vocabulary.note_plural} modified in the last session
- If none obvious, ask user what {vocabulary.note_plural} to connect
/reflect [note]
Focus on connecting a specific {vocabulary.note}:
- Read the target {vocabulary.note}
- Discover related content
- Add connections and update {vocabulary.topic_map_plural}
/reflect [topic area]
Synthesize an area:
- Read the relevant {vocabulary.topic_map}
- Identify {vocabulary.note_plural} that should connect
- Weave connections, update synthesis
/reflect --handoff [note]
External loop mode for /ralph:
- Execute full workflow as normal
- At the end, output structured RALPH HANDOFF block
- Used when running isolated phases with fresh context per task
Workflow
Phase 0: Verify Index Freshness
Before using semantic search, verify the index is current. This is self-healing: if {vocabulary.note_plural} were created outside the pipeline (manual edits, other skills), reflect catches the drift before searching.
- Try
mcp__qmd__statusto get the indexed document count for the target collection - If MCP unavailable (tool fails or returns error): fall back to bash:
LOCKDIR="ops/queue/.locks/qmd.lock" while ! mkdir "$LOCKDIR" 2>/dev/null; do sleep 2; done qmd_count=$(qmd status 2>/dev/null | grep -A2 '{vocabulary.notes_collection}' | grep 'documents' | grep -oE '[0-9]+' | head -1) rm -rf "$LOCKDIR" - Count actual files:
file_count=$(ls -1 {vocabulary.notes}/*.md 2>/dev/null | wc -l | tr -d ' ') - If the counts differ, sync the index:
qmd update && qmd embed
Run this check before proceeding. If stale, sync and continue. If current, proceed immediately.
Phase 1: Understand What You Are Connecting
Before searching for connections, deeply understand the source material.
For each {vocabulary.note} you are connecting:
- Read the full {vocabulary.note}, not just title and description
- Identify the core claim and supporting reasoning
- Note key concepts, mechanisms, implications
- Ask: what questions does this answer? What questions does it raise?
What you are looking for:
- The central argument (what is being claimed?)
- The mechanism (why/how does this work?)
- The implications (what follows from this?)
- The scope (when does this apply? When not?)
- The tensions (what might contradict this?)
If a task file exists (pipeline execution): read the task file to see what the extraction phase discovered. The reduce notes, semantic neighbor field, and classification provide critical context about why this {vocabulary.note} was extracted and what it relates to.
Phase 2: Discovery (Find Candidates)
Use dual discovery: {vocabulary.topic_map} exploration AND semantic search in parallel. These are complementary, not sequential.
Capture discovery trace as you go. Note which {vocabulary.topic_map_plural} you read, which queries you ran (with scores), which searches you tried. This becomes the Discovery Trace section in output — proving methodology was followed, not reconstructed after the fact.
Primary discovery (run in parallel):
Path 1: {vocabulary.topic_map} Exploration — curated navigation
If you know the topic (check the {vocabulary.note}'s Topics footer), start with the {vocabulary.topic_map}:
- Read the relevant {vocabulary.topic_map}(s)
- Follow curated links in Core Ideas — these are human/agent-curated connections
- Note what is already connected to similar concepts
- Check Tensions and Gaps for context
- What do agent notes reveal about navigation?
{vocabulary.topic_map_plural} tell you what thinking exists and how it is organized. Someone already decided what matters for this topic.
Path 2: Semantic Search — find what {vocabulary.topic_map_plural} might miss
Three-tier fallback for semantic search:
Tier 1 — MCP tools (preferred): Use mcp__qmd__deep_search