Ontology-enriched prompt decomposition engine — intent extraction, Four Directions classification, relational dependency mapping, ceremony-aware action stacking, and narrative beat generation.
Version: 0.1.0
Package: medicine-wheel-prompt-decomposition
Document ID: rispec-prompt-decomposition-v1
Last Updated: 2026-02-23
Users create ontologically grounded task decompositions where:
What this enables: Complex prompts become structured, relationally accountable work plans. An LLM receiving a decomposition knows not just what to do, but which direction each task serves, what relational obligations it carries, and whether ceremony is needed before proceeding.
Structural Tension: Between flat to-do lists (Western task management) and Four Directions awareness (each task serves a different ceremonial role). The decomposer bridges these by classifying intents into directions and detecting neglected perspectives.
Lineage: mcp-pde → ava-langchain-prompt-decomposition → medicine-wheel-prompt-decomposition
const decomposer = new MedicineWheelDecomposer({
extractImplicit: true, // Extract implicit intents from hedging
mapDependencies: true, // Infer task dependencies
ceremonyThreshold: 0.3, // Below this, ceremony is recommended
});
const result = decomposer.decompose(prompt);
// Returns: OntologicalDecomposition
| Direction | Keywords |
|---|---|
| East (Vision) | vision, goal, purpose, intention, want, need, desire, dream, imagine, envision, create, build, design |
| South (Analysis) | learn, research, investigate, understand, study, analyze, explore, discover, examine, dependency, context |
| West (Validation) | test, verify, validate, check, ensure, confirm, reflect, review, audit, ceremony, accountable, consent |
| North (Action) | implement, execute, deploy, run, build, code, script, install, configure, setup, write, ship, commit |
interface OntologicalDecomposition {
id: string;
timestamp: string;
prompt: string;
primary: PrimaryIntent;
secondary: RelationalIntent[];
context: ExtractionContext;
outputs: ExpectedOutputs;
directions: Record<DirectionName, OntologicalDirection>;
actionStack: ActionItem[];
ambiguities: AmbiguityFlag[];
balance: number; // 0–1, directional evenness
leadDirection: DirectionName;
neglectedDirections: DirectionName[];
ceremonyGuidance: CeremonyGuidance | null;
ceremonyRequired: boolean;
wilsonAlignment: number;
narrativeBeats: NarrativeBeat[];
}
interface RelationalIntent {
id: string;
action: string;
target: string;
implicit: boolean;
dependency: string | null;
confidence: number;
direction: DirectionName;
obligations: RelationalObligation[];
wilsonAlignment: number;
}
interface OntologicalDirection {
name: DirectionName;
ojibwe: string; // Ojibwe name
season: string; // Associated season
act: number; // Narrative act (1–4)
insights: DirectionalInsight[];
obligations: RelationalObligation[];
ceremonyRecommended: boolean;
}
Post-decomposition enrichment with graph data:
const enricher = new RelationalEnricher();
const result = enricher.enrich(decomposition, {
nodes: relationalNodes,
edges: relationalEdges,
relations: firstClassRelations,
});
// Returns: EnrichmentResult
{
decomposition: OntologicalDecomposition, // Updated Wilson scores
mappings: IntentNodeMapping[], // Intent → graph node matches
accountabilityGaps: AccountabilityGap[], // Where attention is needed
relationalHealth: number, // 0–1 composite score
}
saveDecomposition(workdir, result): StoredDecomposition
// Saves to .pde/{id}.json and .pde/{id}.md
loadDecomposition(workdir, id): StoredDecomposition | null
listDecompositions(workdir): StoredDecomposition[]
decompositionToMarkdown(result): string
// Git-diffable markdown with Four Directions table, balance, action stack
medicine-wheel-ontology-core ^0.1.0fs, path (for storage)DirectionName, RelationalObligation, CeremonyGuidance, NarrativeBeat, AccountabilityTrackingDIRECTIONS, DIRECTION_ACTS, OJIBWE_NAMES, DIRECTION_SEASONScomputeWilsonAlignment, findAccountabilityGaps