Metaphor - a prompt generation language designed to help with coding and maintenance problems

I’ve been designing a simple structured language, Metaphor, to make it easy to build and maintain software using LLMs. I’ve built quite a few applications where the coding is entirely done by the LLM (usually ChatGPT 4o).

The format is very simple, and designed to allow people to focus on what they want in natural language form.

To support this I build a prompt compiler library that can process strings or files. It supports including other files to allow for modularizing the prompt elements and to also support different actions and personas being applied to the same application problem. It also supports embedding files that can be used as additional context (e.g. it could be some earlier version of code that you want to retain as a template).

The idea is to capture a full description of what the software is supposed to do, leaving the LLM with the ability to make any changes it needs to. This also means an LLM can build an entirely new version (although it will typically look very different).

I’ve built various different apps and libraries using this approach - usually in TypeScript or Python, but occasionally C++ too. One of the more fun ones in the last few days is an app called commit-critic that will do code reviews based on a series of Metaphor coding guidelines. That app was also coded and enhanced by an LLM based on a Metaphor description.

The code is under and Apache 2.0 license if you’re interested in taking a look:

1 Like

Hello,

Sounds very interesting, I tried to visit examples page, but got it broken at m6r.ai/Metaphor

Can you provide walk-though video on YouTube ?

Thanks for letting me know that link was broken - now fixed :slight_smile:

It should have been https://m6r.ai/metaphor.

I’ve created any videos yet, but it’s on my to-do list. Will see if I can get something done this week.

Regards,
Dave

Thank you, please share the YouTube channel once you upload anything.

Greetings,
Samir