DEV Community

owly
owly

Posted on

LivinGrimoire: Unleashing the Power of Skill Catalogs

Image description
The LivinGrimoire has a built-in skill catalog feature that takes your coding experience to the next level. Here's how you can make the most of it:

Adding Skill Notes

To add skill notes, simply override the skillNotes function of the Skill class:

def skillNotes(self, param: str) -> str:
    return "notes unknown"
Enter fullscreen mode Exit fullscreen mode

Example: DiTime Skill

Here's an example from the DiTime skill (a subclass of Skill):

def skillNotes(self, param: str) -> str:
    if param == "notes":
        return "gets time date or misc"
    elif param == "triggers":
        return random.choice(["what is the time", "which day is it", "what is the date", "evil laugh", "good part of day", "when is the fifth"])
    return "time util skill"
Enter fullscreen mode Exit fullscreen mode

Using a Skill Reader Skill: DiAware

Finally, use a skill reader skill, in this case, DiAware. DiAware is unique because its constructor takes in the very Chobit object housing it, giving it access to all the skills in the Chobit object.

case "what can you do":
    if self.skillDex is None:
        self.skillDex = UniqueRandomGenerator(len(self.chobit.get_skill_list()))
    self.skill_for_info = self.skillDex.get_unique_random()
    self.setSimpleAlg(f'{self.chobit._dClasses[self.skill_for_info].__class__.__name__} {self.chobit._dClasses[self.skill_for_info].skillNotes("notes")}')
case "skill triggers":
    self.setSimpleAlg(self.chobit._dClasses[self.skill_for_info].skillNotes("triggers"))
Enter fullscreen mode Exit fullscreen mode

With this setup, you can ask "what can you do" to get suggestions for skills to engage, and complement it with "skill triggers" to see how to work the skill or know about automatic skills and such. This essentially acts as a built-in skill catalog or skill legend, making your coding experience more interactive and efficient.

Dive into the LivinGrimoire and unlock the full potential of your coding skills!

Top comments (0)