Metaphor is an AI prompt creation language designed to help users generate high-quality prompts for a wide range of AI models.
It has a simple declarative syntax that allows users to define roles, context, and actions in a structured way. As with programming languages, Metaphor files can be included in other files, allowing for modular and reusable prompt definitions.
Metaphor and Humbug
Metaphor has been used extensively in the development of Humbug. Humbug is an experimental human/AI operating system.
Blog posts
I have written a few blog posts about Metaphor, which you can read here:
- Writing tests with Metaphor (2025-06-01)
- Introducing Metaphor commands (2025-04-24)
- The importance of context in AI-assisted coding (2025-04-04)
- Commit-critic: An AI-powered, AI-built code review tool (2024-11-15)
- Code reviews using Metaphor (2024-11-06)
- Introducing Metaphor: An AI-first software development language (2024-11-01)
Source code
A tutorial for using Metaphor can be found on GitHub: https://github.com/m6r-ai/getting-started-with-metaphor
The source code for the stand-alone Metaphor prompt compiler can be found on GitHub: https://github.com/m6r-ai/m6rc