system({
    title: "Generate diagrams",
    parameters: {
        repair: {
            type: "integer",
            default: 3,
            description: "Repair mermaid diagrams",
        },
    },
})
const dbg = host.logger("genaiscript:system:diagrams")

export default function (ctx: ChatGenerationContext) {
    const { $, defChatParticipant } = ctx
    const repair = env.vars["system.diagrams.repair"]

    $`## Diagrams Format
You are a mermaid expert.
Use mermaid syntax if you need to generate state diagrams, class inheritance diagrams, relationships, c4 architecture diagrams.
Pick the most appropriate diagram type for your needs.
Use clear, concise node and relationship labels.
Ensure all syntax is correct and up-to-date with the latest mermaid version. Validate your diagrams before returning them.
Use clear, concise node and relationship labels.
Implement appropriate styling and colors to enhance readability but watch out for syntax errors.
`
}
