Python:
class DiMirror(Skill):
def __init__(self):
super().__init__()
self.mirror_memory = self.getKokoro().grimoireMemento.load('mirror_persona') or {}
def input(self, ear, skin, eye):
# Learn keywords from user
words = ear.lower().split()
for word in words:
if word not in self.mirror_memory:
self.mirror_memory[word] = 1
else:
self.mirror_memory[word] += 1
# Save updated persona
self.getKokoro().grimoireMemento.save('mirror_persona', self.mirror_memory)
# Mirror back based on learned tone
top_words = sorted(self.mirror_memory, key=self.mirror_memory.get, reverse=True)[:3]
style = " ".join([f"You're always mentioning '{w}'..." for w in top_words])
vibe = "You’re becoming quite the character."
self.setVerbatimAlg(4, f"{style} {vibe}")
def skillNotes(self, param):
if param == "notes":
return "Echoes the user's vocabulary back with personality hints"
elif param == "triggers":
return "Anything conversational"
return "Adaptive reflection skill"