grounding-router

Routes medical education grounding requests through atomic primitive composition. Four primitives (Σ Source, Τ Textbook, Δ Dialectical, Ρ Response) combine via operators (∘ ⊗ * |) for SAQ/VIVA/Academic response generation. Integrates: limitless, research, pieces, pdf-search, pdf-brain CLIs.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "grounding-router" with this command: npx skills add zpankz/mcp-skillset/zpankz-mcp-skillset-grounding-router

Grounding Router

Version: 3.0.0 Architecture: atomic-permutation-router Trigger Keywords: grounding, saq, viva, textbook, pex, medical, citations, synthesis, sc:grounding

Progressive Loading:

  • Level 0: Frontmatter (~100 tokens) - trigger detection only
  • Level 1: Core SKILL.md (~2500 tokens) - primitives + routing
  • Level 2: references/*.md - on-demand deep specifications
  • Level 3: scripts/*.py - execute without loading context

Integrations:

  • Skills: dialectical, critique, mega, textbook-grounding, saq, qp
  • CLIs: limitless, research, pieces, pdf-search, pdf-brain, pex
  • Commands: sc:grounding
  • Routers: context-router

λΩ.τ: Query(ο) → Atomic-Composition(λ) → Grounded-Response(τ)

Routes grounding requests through minimal atomic primitives for maximal emergent function.

Trigger Conditions

Activate when:

  • Explicit: /grounding, /saq, /viva, sc:grounding
  • Implicit: SAQ, VIVA, medical exam, textbook citations, PEX sources
  • Hook signal: need_grounding=true from intent detection

Routing Decision Tree

Request Received
    │
    ├── Mode Detection
    │   ├── "SAQ" or ~200 words → SAQ Mode
    │   ├── "VIVA" or examiner → VIVA Mode
    │   ├── "academic" or paper → Academic Mode
    │   └── Default → SAQ Mode
    │
    ├── Composition Selection
    │   ├── SAQ: (Σ ⊗ Τ) ∘ Δ ∘ Ρₛ
    │   ├── VIVA: Σ* ∘ (Τ ⊗ Δ) ∘ Ρᵥ*
    │   └── Academic: Σ* ∘ Τ* ∘ Δ* ∘ Ρₐ
    │
    └── Pipeline Execution
        ├── G₀: Preflight (CLI health)
        ├── Σ: Source extraction
        ├── Τ: Textbook grounding
        ├── Δ: Dialectical synthesis
        ├── G₄: Hallucination check
        └── Ρ: Response generation

The Four Atomic Primitives

SymbolNameλο.τ FormCLI Sources
ΣSOURCEContext(ο) → Extraction(λ) → Evidence(τ)limitless, pieces, pdf-search, research
ΤTEXTBOOKEvidence(ο) → Grounding(λ) → Citation(τ)pdf-search, pdf-brain
ΔDIALECTICALClaims(ο) → Synthesis(λ) → Universal(τ)Thesis→Antithesis→Synthesis
ΡRESPONSESynthesis(ο) → Formatting(λ) → Output(τ)SAQ/VIVA/Academic modes

Composition Operators

OperatorNotationFunctionPattern
SequentialApply in orderΣ ∘ Τ (extract then ground)
ParallelConcurrentΣₚ ⊗ Σₜ (parallel sources)
Recursive*Until convergenceΔ* (resolve all antitheses)
Conditional|Activate on conditionΣ | has_cache

Source Sub-Primitives (Σ)

SymbolCLITriggersOutput
Σₚlimitlesspersonal, lifelog, recallpersonal_context[]
Σₗpiecesltm, snippet, historylocal_context[]
Σₜpdf-searchtextbook, book, pagetextbook_chunks[]
Σₐresearchpex, guidelines, evidenceauthoritative_sources[]
Σₚₑₓpexexam, lo, saq, curriculumexam_context[]

CLI Commands

# Σₚ — Personal Context
limitless lifelogs search "{topic}" --limit 10 --json

# Σₗ — Local Context
echo "" | pieces ask "{topic}" --ltm

# Σₜ — Textbook Context
pdf-search "{topic}" --limit 10 --tags {tags}
pdf-brain search "{topic}" --limit 10

# Σₐ — Authoritative Context
research pex-grounding -t "{topic}" --specialty {specialty} --format json

# Σₚₑₓ — PEX Exam Context
pex search "{topic}" --limit 10
pex prereq "LO:{id}" --model fast
pex path "{topic}" --max 10

Mode Compositions

SAQ Mode: (Σ ⊗ Τ) ∘ Δ ∘ Ρₛ

Parallel source + textbook → Sequential synthesis → SAQ output
Word count: 180-220 | Citations: 5-10 | Tables: max 1

VIVA Mode: Σ* ∘ (Τ ⊗ Δ) ∘ Ρᵥ*

Recursive sources → Parallel ground+synthesize → Recursive expand
Word count: 500-800 | Citations: 15-25 | Examiner probes: 3-5

Academic Mode: Σ* ∘ Τ* ∘ Δ* ∘ Ρₐ

All recursive → Maximum depth → Full scholarly
Word count: 1000-2000 | Citations: 30-50 | Full bibliography

Quality Gates

GateCheckPass Criteria
G₀Preflight≥3/5 CLIs available
G₁Sources≥2 sources, ≥2 types
G₂Textbook≥50% claims grounded
G₃SynthesisAll theses subsumed
G₄Hallucination<20% flagged claims
G₅OutputWord count compliant

Confidence Calculation

confidence = (
    0.30 * source_authority +
    0.25 * textbook_coverage +
    0.20 * synthesis_parsimony +
    0.15 * citation_density +
    0.10 * hallucination_pass_rate
)
ConfidenceAction
≥ 0.85Emit response
0.70-0.84Warn, emit
0.50-0.69Load references/, retry
< 0.50Execute scripts/, escalate

Progressive Loading Protocol

Level 0: Trigger (Always Active)

  • Frontmatter triggers in hook
  • ~100 tokens loaded

Level 1: Core (On Trigger Match)

  • This SKILL.md body
  • Routing + primitive specs

Level 2: References (On Demand)

Load when confidence < 0.7 or customization needed:

  • references/atomic-primitives.md — Full sub-primitive specs
  • references/composition-patterns.md — Advanced compositions
  • references/quality-gates.md — Detailed validation
  • references/cli-integration.md — CLI command patterns

Level 3: Scripts (Execute Only)

Invoke without loading context:

  • scripts/preflight.py --format json — CLI health
  • scripts/extract.py "{query}" — Parallel extraction
  • scripts/validate.py -r response.md — Hallucination check

Integration Points

Context Router Handoff

when: Σ primitives activated
action: Delegate to context-router for CLI orchestration
return: Aggregated sources to Τ primitive

Skill Integration

dialectical: Δ uses dialectical.atomic-composition
critique: G₄ uses critique.multi-lens
saq: Ρₛ uses saq.template
mega: Δ* escalates to mega when depth > 3

Command Integration

sc:grounding:
  invokes: grounding-router with mode detection
  flags: --mode, --sources, --specialty

Example Invocations

Basic SAQ

/grounding "Describe labetalol pharmacology" --mode=saq

Composition: (Σₗ ⊗ Σₜ ⊗ Σₐ) ∘ Δ ∘ Ρₛ
Output: 195-word SAQ with 7 citations
Confidence: 0.89

Extended VIVA

/grounding "Pre-eclampsia management" --mode=viva --sources=all

Composition: Σ* ∘ (Τ ⊗ Δ*) ∘ Ρᵥ*
Output: 650-word VIVA with 22 citations + 5 probes
Confidence: 0.92

Anti-Patterns

PatternWhy HarmfulFix
Σ without ΤUngrounded claimsAlways include Τ
Δ without ΣₜNo textbook basisRequire textbook source
Ρ without ΔNo synthesisDialectical before response
Skip G₄Hallucination riskAlways validate

Recursion: grounding-router(grounding-router) → meta-grounding for skill improvement.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

code-refactoring

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

code-refactor

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

dspy-code

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

codex

No summary provided by upstream source.

Repository SourceNeeds Review