Validates structural mappings between abstract concepts and concrete domains: detects uncertainty, constructs correspondences, generates instantiations, and confirms via user input.
From analogianpx claudepluginhub jongwony/epistemic-protocols --plugin analogiaThis skill uses the workspace's default tool permissions.
references/best-practices.mdGuides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Migrates code, prompts, and API calls from Claude Sonnet 4.0/4.5 or Opus 4.1 to Opus 4.5, updating model strings on Anthropic, AWS, GCP, Azure platforms.
Analyzes BMad project state from catalog CSV, configs, artifacts, and query to recommend next skills or answer questions. Useful for help requests, 'what next', or starting BMad.
Validate structural mapping between abstract and concrete domains through AI-guided detection and user-validated instantiation. Type: (MappingUncertain, AI, GROUND, R) → ValidatedMapping.
Analogia (ἀναλογία): A dialogical act of validating structural correspondences between domains, where AI detects mapping uncertainty between abstract frameworks and concrete application contexts, constructs explicit structural mappings, and presents concrete instantiations for user verification of mapping adequacy.
── FLOW ──
Analogia(R) → Detect(R) → (Sₐ, Sₜ) → Map(Sₐ, Sₜ) → I(M, Sₜ) → V → R' → (loop until terminalized)
── MORPHISM ──
R
→ detect(R, context) -- infer mapping uncertainty
→ decompose(abstract, concrete) -- identify source and target domains
→ construct(mapping, Sₐ→Sₜ) -- build structural correspondences
→ instantiate(mapping, target) -- generate concrete examples
→ validate(instantiation, user) -- user verifies mapping adequacy
→ terminalize(mapping, user) -- make mapping status explicit in output
→ ValidatedMapping
requires: uncertain(mapping(Sₐ, Sₜ)) -- runtime gate (Phase 0)
deficit: MappingUncertain -- activation precondition (Layer 1/2)
preserves: content_identity(R) -- output content invariant; mapping status recorded in R'
invariant: Structural Correspondence over Abstract Assertion
── TYPES ──
R = Text containing abstract structures (source-agnostic: AI output, user analysis, or external reference)
-- Input type: morphism processes R uniformly; enumeration scopes the definition, not behavioral dispatch
Detect = Mapping uncertainty detection: R → Bool
Sₐ = Source domain (abstract structure in R)
Sₜ = Target domain (user's concrete application context)
Map = Structure-preserving mapping construction: (Sₐ, Sₜ) → Set(Correspondence)
M = Set(Correspondence) -- mapping result
Correspondence = { abstract: Component, concrete: Component, relation: String }
Component = { name: String, structure: String }
I = Concrete instantiation: M × Sₜ → Example
Example = { scenario: String, mapping_trace: List<Correspondence> }
V = User validation ∈ {Confirm, Adjust(feedback), Dismiss}
R' = Updated output with explicit mapping status
ValidatedMapping = R' where terminalized(R')
terminalized(R') = all_addressed(R') ∨ user_esc
all_addressed(R') = ∀ c ∈ M : confirmed(c) ∨ dismissed(c)
── R-BINDING ──
bind(R) = explicit_arg ∪ current_output ∪ most_recent_output
Priority: explicit_arg > current_output > most_recent_output
/ground "text" → R = "text"
/ground (alone) → R = most recent relevant output in current session (AI or user)
"ground this..." → R = text currently under discussion
If no relevant text exists: pause activation and request a grounding target before Phase 0.
── PHASE TRANSITIONS ──
Phase 0: R → Detect(R) → uncertain? -- mapping uncertainty gate (silent)
Phase 1: uncertain → (Sₐ, Sₜ) → Map(Sₐ, Sₜ) → M -- domain decomposition + mapping [Tool]
Phase 2: M → I(M, Sₜ) → Qs(I, progress) → Stop → V -- instantiation + validation [Tool]
Phase 3: V → integrate(V, R) → R' -- output update (sense)
── LOOP ──
After Phase 3: evaluate validation result.
If V = Confirm: mark correspondence confirmed; terminalize if all correspondences addressed.
If V = Adjust(feedback): refine mapping with feedback → return to Phase 1.
If V = Dismiss: accept this correspondence as unresolved for this session; terminalize if all correspondences addressed.
Max 3 mapping attempts per domain pair.
Continue until: terminalized(R') OR attempts exhausted.
Convergence evidence: At all_addressed(R'), present transformation trace — for each c ∈ Λ.mappings, show (MappingUncertain(c) → validation_result(c)). Convergence is demonstrated, not asserted.
── CONVERGENCE ──
terminalized(R') = all_addressed(R') ∨ user_esc
progress(Λ) = 1 - |remaining| / |mappings|
narrowing(V, M) = |remaining(after)| < |remaining(before)|
early_exit = user_declares_mapping_sufficient
── TOOL GROUNDING ──
-- Realization: gate → TextPresent+Stop; relay → TextPresent+Proceed
Phase 1 Map (observe) → Read, Grep (stored knowledge extraction: domain structure analysis); WebSearch (conditional: external domain knowledge)
Phase 2 Qs (gate) → present (mandatory; Esc key → loop termination at LOOP level, not a Validation)
Phase 3 (track) → Internal state update
Phase 0 Detect (sense) → Internal analysis (no external tool)
converge (relay) → TextPresent+Proceed (convergence evidence trace; proceed with validated mapping)
── ELIDABLE CHECKPOINTS ──
-- Axis: relay/gated = interaction kind; always_gated/elidable = regret profile
Phase 2 Qs (validate) → always_gated (gated: user validates structural mapping with examples)
── MODE STATE ──
Λ = { phase: Phase, R: Text, Sₐ: Domain, Sₜ: Domain,
mappings: Set(Correspondence), confirmed: Set(Correspondence),
dismissed: Set(Correspondence), remaining: Set(Correspondence),
instantiations: List<Example>,
validations: List<(Example, V)>, attempts: Nat, active: Bool,
cause_tag: String }
-- Invariant: mappings = confirmed ∪ dismissed ∪ remaining (pairwise disjoint)
Structural Correspondence over Abstract Assertion: When text contains abstract frameworks applied to a user's domain, validate that structure-preserving mappings exist between the abstract and concrete domains through explicit correspondences and concrete instantiations, rather than asserting that the abstraction applies. The purpose is to verify mapping adequacy, not to simplify the abstraction.
| Protocol | Initiator | Deficit → Resolution | Focus |
|---|---|---|---|
| Prothesis | AI-guided | FrameworkAbsent → FramedInquiry | Perspective selection |
| Syneidesis | AI-guided | GapUnnoticed → AuditedDecision | Decision-point gaps |
| Hermeneia | Hybrid | IntentMisarticulated → ClarifiedIntent | Expression clarification |
| Telos | AI-guided | GoalIndeterminate → DefinedEndState | Goal co-construction |
| Horismos | AI-guided | BoundaryUndefined → DefinedBoundary | Epistemic boundary definition |
| Aitesis | AI-guided | ContextInsufficient → InformedExecution | Context sufficiency sensing |
| Analogia | AI-guided | MappingUncertain → ValidatedMapping | Abstract-concrete mapping validation |
| Prosoche | User-initiated | ExecutionBlind → SituatedExecution | Risk-assessed execution |
| Epharmoge | AI-guided | ApplicationDecontextualized → ContextualizedExecution | Post-execution applicability |
| Katalepsis | User-initiated | ResultUngrasped → VerifiedUnderstanding | Comprehension verification |
Key differences:
Structural mapping distinction: Analogia operates on the functor between domains — not the content of either domain (Aitesis), nor the framework choice (Prothesis), nor the comprehension state (Katalepsis). The operational test: if the uncertainty is about whether abstract structure A corresponds to concrete structure B, it's Analogia; if it's about whether enough context exists to execute, it's Aitesis; if it's about which framework to apply, it's Prothesis.
See references/best-practices.md for user-language triggers and grounding scenarios.
AI detects mapping uncertainty in output OR user calls /ground. Detection is silent (Phase 0); validation always requires user interaction via gate interaction (Phase 2). On direct /ground, bind R from the current or most recent output under discussion; if no recoverable R exists, request the grounding target before Phase 0.
Activation layers:
/ground slash command or description-matching input. Always available.Mapping uncertain = text applies abstract structures to a domain where structural correspondence has not been established.
Gate predicate:
uncertain(mapping(Sₐ, Sₜ)) ≡ ∃ structure(s, Sₐ) : ¬established(correspondence(s, Sₜ))
Supersedes: Direct output patterns that assume mapping validity (Structural correspondence must be validated before proceeding)
Retained: Safety boundaries, tool restrictions, user explicit instructions
Action: At Phase 2, present concrete instantiation for user validation of mapping adequacy via gate interaction and yield turn. </system-reminder>
Protocol precedence: Activation order position 6/9 (graph.json is authoritative source for information flow). Concern cluster: Analysis.
Advisory relationships: Receives from Prothesis (advisory: perspective simulation provides mapping construction context), Aitesis (advisory: inferred context narrows mapping domain identification), Horismos (advisory: BoundaryMap narrows mapping domain identification). Provides to Syneidesis (advisory: validated mapping improves gap detection accuracy). Katalepsis is structurally last.
Heuristic signals for mapping uncertainty detection (not hard gates):
| Signal | Detection |
|---|---|
| Abstract framework applied | AI output uses a pattern, model, or analogy without domain-specific validation |
| Cross-domain transfer | Concept from one domain applied to a structurally different domain |
| Grounding probe | User requests "concrete example", "how does this apply to my case", "show me in my context" |
| Structural mismatch indicators | Abstract assumptions that may not hold in the concrete domain |
Cross-session enrichment: Accumulated mapping validation history from prior Reflexion cycles provides starting points for Phase 1 domain decomposition — previously validated correspondences may guide initial structural analysis. This is a heuristic input that may bias detection toward previously observed patterns; gate judgment remains with the user.
Skip:
| Trigger | Effect |
|---|---|
| All correspondences addressed (confirmed or dismissed) | Proceed with validated mapping |
| User Esc key | Accept current output without further grounding |
| Attempt cap reached | Surface remaining uncertainty, accept current output with explicit unresolved mapping note |
Analyze text for mapping uncertainty. This phase is silent — no user interaction.
R: use explicit argument or the current/most recent output under discussionR for abstract structures: patterns, models, analogies, frameworks applied to user's domain(Sₐ, Sₜ) — proceed to Phase 1Scan scope: Bound text R, conversation context, observable domain signals. Does NOT modify files or call external services.
Decompose abstract and concrete domains, then construct structural correspondences.
Sₐ: Extract abstract structures from R — components, relationships, constraints, assumptionsSₜ: Determine user's concrete application context — environment, constraints, existing structures
M: For each abstract component, identify the candidate concrete correspondent
Web context (conditional): When source or target domain knowledge exists primarily outside the codebase (external APIs, academic domains, industry standards), extend context collection to web search.
Web evidence is tagged with source: "web:{url}" for traceability.
Scope restriction: Read-only investigation only (Read, Grep, WebSearch). No test execution or file modifications.
Present concrete instantiations for user validation via gate interaction.
Selection criterion: Choose the correspondence whose validation would maximally narrow the remaining mapping uncertainty. When priority is equal, prefer the correspondence with richer structural evidence.
Surfacing format:
Present the mapping details as text output:
Then present:
Does [abstract concept] map correctly to your context?
Options:
1. **Confirm** — [what this validated mapping enables for downstream work]
2. **Adjust** — [what aspect of the mapping diverges and how refinement would change the correspondence]
3. **Dismiss** — [what assumption about contextual fit is accepted without grounding]
Other is always available — user can propose an alternative mapping or describe a structural correspondence not captured by the presented options.
Design principles:
After user response:
R' to include explicit mapping statusAfter integration:
(Example, V) to validations| Level | When | Format |
|---|---|---|
| Light | Single obvious correspondence | Brief example + gate interaction with Confirm default |
| Medium | Multiple correspondences, partial structural match | Mapping table + concrete examples |
| Heavy | Complex cross-domain mapping, structural mismatches detected | Full domain decomposition + multiple instantiations + gap analysis |
| Rule | Structure | Effect |
|---|---|---|
| Gate specificity | activate(Analogia) only if ∃ structure(s, Sₐ) : ¬established(correspondence(s, Sₜ)) | Prevents false activation on domain-specific output |
| Domain decomposition first | Phase 1 before Phase 2 | Ensures mapping is structurally grounded |
| One correspondence per cycle | Present highest-priority correspondence per Phase 2 | Prevents example overload |
| Session immunity | Validated domain pair → skip for session | Respects user's validation |
| Progress visibility | [N validated / M total] in Phase 2 | User sees mapping coverage |
| Attempt cap | Max 3 mapping attempts per domain pair | Prevents infinite refinement |
| Early exit | User can declare mapping sufficient at any Phase 2 | Full control over validation depth |
[N validated / M total]