{
  "format": "musicprompt-agent-contract",
  "version": 1,
  "tasks": [
    "draft",
    "style",
    "lyrics",
    "revise"
  ],
  "contextSchema": {
    "type": "object",
    "properties": {
      "mode": {
        "type": "string",
        "enum": [
          "vocal",
          "instrumental"
        ]
      },
      "brief": {
        "type": "object",
        "properties": {
          "purpose": {
            "type": "string",
            "maxLength": 100
          },
          "story": {
            "type": "string",
            "maxLength": 2000
          },
          "arc": {
            "type": "string",
            "maxLength": 100
          }
        },
        "required": [
          "purpose",
          "story",
          "arc"
        ],
        "additionalProperties": false
      },
      "draft": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "maxLength": 120
          },
          "lyricsLanguage": {
            "type": "string",
            "enum": [
              "en",
              "zh",
              "es",
              "ja",
              "ko",
              "fr",
              "pt",
              "de"
            ]
          },
          "style": {
            "type": "object",
            "properties": {
              "primaryGenre": {
                "type": "string",
                "enum": [
                  "",
                  "pop",
                  "indie-pop",
                  "rock",
                  "indie-rock",
                  "post-punk",
                  "metal",
                  "hip-hop",
                  "trap",
                  "rnb",
                  "neo-soul",
                  "electronic",
                  "house",
                  "techno",
                  "drum-bass",
                  "synthwave",
                  "lofi",
                  "folk",
                  "country",
                  "jazz",
                  "classical",
                  "orchestral",
                  "cinematic",
                  "ambient",
                  "afrobeats",
                  "latin",
                  "reggaeton",
                  "kpop",
                  "city-pop",
                  "funk",
                  "disco",
                  "blues",
                  "bossa-nova",
                  "reggae",
                  "gospel",
                  "chinese-folk"
                ]
              },
              "secondaryGenre": {
                "type": "string",
                "enum": [
                  "",
                  "pop",
                  "indie-pop",
                  "rock",
                  "indie-rock",
                  "post-punk",
                  "metal",
                  "hip-hop",
                  "trap",
                  "rnb",
                  "neo-soul",
                  "electronic",
                  "house",
                  "techno",
                  "drum-bass",
                  "synthwave",
                  "lofi",
                  "folk",
                  "country",
                  "jazz",
                  "classical",
                  "orchestral",
                  "cinematic",
                  "ambient",
                  "afrobeats",
                  "latin",
                  "reggaeton",
                  "kpop",
                  "city-pop",
                  "funk",
                  "disco",
                  "blues",
                  "bossa-nova",
                  "reggae",
                  "gospel",
                  "chinese-folk"
                ]
              },
              "tempo": {
                "type": "string",
                "enum": [
                  "",
                  "slow",
                  "midtempo",
                  "upbeat",
                  "fast"
                ]
              },
              "bpm": {
                "type": [
                  "number",
                  "null"
                ],
                "minimum": 40,
                "maximum": 240
              },
              "key": {
                "type": "string",
                "enum": [
                  "",
                  "C major",
                  "C minor",
                  "C# major",
                  "C# minor",
                  "D major",
                  "D minor",
                  "Eb major",
                  "Eb minor",
                  "E major",
                  "E minor",
                  "F major",
                  "F minor",
                  "F# major",
                  "F# minor",
                  "G major",
                  "G minor",
                  "Ab major",
                  "Ab minor",
                  "A major",
                  "A minor",
                  "Bb major",
                  "Bb minor",
                  "B major",
                  "B minor"
                ]
              },
              "meter": {
                "type": "string",
                "enum": [
                  "",
                  "4/4",
                  "3/4",
                  "6/8",
                  "5/4",
                  "7/8"
                ]
              },
              "groove": {
                "type": "string",
                "enum": [
                  "",
                  "straight",
                  "swing",
                  "shuffle",
                  "halftime",
                  "syncopated",
                  "four-on-floor",
                  "free"
                ]
              },
              "instruments": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "acoustic-guitar",
                    "electric-guitar",
                    "distorted-guitar",
                    "bass",
                    "piano",
                    "rhodes",
                    "synth",
                    "synth-pad",
                    "strings",
                    "brass",
                    "drums",
                    "electronic-drums",
                    "808",
                    "percussion",
                    "saxophone",
                    "flute",
                    "violin",
                    "cello",
                    "organ",
                    "accordion",
                    "guzheng",
                    "erhu",
                    "pipa",
                    "dizi",
                    "sitar",
                    "koto"
                  ]
                },
                "maxItems": 3,
                "uniqueItems": true
              },
              "vocalType": {
                "type": "string",
                "enum": [
                  "",
                  "female",
                  "male",
                  "androgynous",
                  "duet",
                  "choir"
                ]
              },
              "vocalDelivery": {
                "type": "string",
                "enum": [
                  "",
                  "warm",
                  "breathy",
                  "raspy",
                  "powerful",
                  "intimate",
                  "whispered",
                  "spoken",
                  "rap"
                ]
              },
              "production": {
                "type": "string",
                "enum": [
                  "",
                  "polished",
                  "raw",
                  "lofi",
                  "analog",
                  "acoustic",
                  "minimal",
                  "spacious",
                  "overdriven"
                ]
              },
              "moods": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "joyful",
                    "melancholic",
                    "nostalgic",
                    "dreamy",
                    "dark",
                    "hopeful",
                    "romantic",
                    "aggressive",
                    "euphoric",
                    "mysterious",
                    "calm",
                    "triumphant"
                  ]
                },
                "maxItems": 2,
                "uniqueItems": true
              },
              "notes": {
                "type": "string",
                "maxLength": 600
              }
            },
            "required": [
              "primaryGenre",
              "secondaryGenre",
              "tempo",
              "bpm",
              "key",
              "meter",
              "groove",
              "instruments",
              "vocalType",
              "vocalDelivery",
              "production",
              "moods",
              "notes"
            ],
            "additionalProperties": false
          },
          "sections": {
            "type": "array",
            "maxItems": 24,
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "enum": [
                    "intro",
                    "verse",
                    "pre-chorus",
                    "chorus",
                    "bridge",
                    "instrumental-break",
                    "outro",
                    "end",
                    "build",
                    "drop",
                    "breakdown",
                    "solo"
                  ]
                },
                "lyrics": {
                  "type": "string",
                  "maxLength": 2000
                },
                "modifiers": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "enum": [
                      "stripped",
                      "full-band",
                      "energy-build",
                      "high-energy",
                      "whispered",
                      "powerful-vocal",
                      "harmonies",
                      "guitar-only",
                      "piano-only",
                      "fade-out",
                      "silence"
                    ]
                  },
                  "maxItems": 2,
                  "uniqueItems": true
                }
              },
              "required": [
                "type",
                "lyrics",
                "modifiers"
              ],
              "additionalProperties": false
            }
          },
          "exclusions": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "vocals",
                "drums",
                "guitar",
                "piano",
                "synth",
                "autotune",
                "choir",
                "reverb",
                "distortion",
                "spoken"
              ]
            },
            "maxItems": 10,
            "uniqueItems": true
          }
        },
        "required": [
          "title",
          "lyricsLanguage",
          "style",
          "sections",
          "exclusions"
        ],
        "additionalProperties": false
      }
    },
    "required": [
      "mode",
      "brief",
      "draft"
    ],
    "additionalProperties": false
  },
  "suggestionSchema": {
    "type": "object",
    "properties": {
      "summary": {
        "type": "string",
        "maxLength": 1200
      },
      "draft": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "maxLength": 120
          },
          "lyricsLanguage": {
            "type": "string",
            "enum": [
              "en",
              "zh",
              "es",
              "ja",
              "ko",
              "fr",
              "pt",
              "de"
            ]
          },
          "style": {
            "type": "object",
            "properties": {
              "primaryGenre": {
                "type": "string",
                "enum": [
                  "",
                  "pop",
                  "indie-pop",
                  "rock",
                  "indie-rock",
                  "post-punk",
                  "metal",
                  "hip-hop",
                  "trap",
                  "rnb",
                  "neo-soul",
                  "electronic",
                  "house",
                  "techno",
                  "drum-bass",
                  "synthwave",
                  "lofi",
                  "folk",
                  "country",
                  "jazz",
                  "classical",
                  "orchestral",
                  "cinematic",
                  "ambient",
                  "afrobeats",
                  "latin",
                  "reggaeton",
                  "kpop",
                  "city-pop",
                  "funk",
                  "disco",
                  "blues",
                  "bossa-nova",
                  "reggae",
                  "gospel",
                  "chinese-folk"
                ]
              },
              "secondaryGenre": {
                "type": "string",
                "enum": [
                  "",
                  "pop",
                  "indie-pop",
                  "rock",
                  "indie-rock",
                  "post-punk",
                  "metal",
                  "hip-hop",
                  "trap",
                  "rnb",
                  "neo-soul",
                  "electronic",
                  "house",
                  "techno",
                  "drum-bass",
                  "synthwave",
                  "lofi",
                  "folk",
                  "country",
                  "jazz",
                  "classical",
                  "orchestral",
                  "cinematic",
                  "ambient",
                  "afrobeats",
                  "latin",
                  "reggaeton",
                  "kpop",
                  "city-pop",
                  "funk",
                  "disco",
                  "blues",
                  "bossa-nova",
                  "reggae",
                  "gospel",
                  "chinese-folk"
                ]
              },
              "tempo": {
                "type": "string",
                "enum": [
                  "",
                  "slow",
                  "midtempo",
                  "upbeat",
                  "fast"
                ]
              },
              "bpm": {
                "type": [
                  "number",
                  "null"
                ],
                "minimum": 40,
                "maximum": 240
              },
              "key": {
                "type": "string",
                "enum": [
                  "",
                  "C major",
                  "C minor",
                  "C# major",
                  "C# minor",
                  "D major",
                  "D minor",
                  "Eb major",
                  "Eb minor",
                  "E major",
                  "E minor",
                  "F major",
                  "F minor",
                  "F# major",
                  "F# minor",
                  "G major",
                  "G minor",
                  "Ab major",
                  "Ab minor",
                  "A major",
                  "A minor",
                  "Bb major",
                  "Bb minor",
                  "B major",
                  "B minor"
                ]
              },
              "meter": {
                "type": "string",
                "enum": [
                  "",
                  "4/4",
                  "3/4",
                  "6/8",
                  "5/4",
                  "7/8"
                ]
              },
              "groove": {
                "type": "string",
                "enum": [
                  "",
                  "straight",
                  "swing",
                  "shuffle",
                  "halftime",
                  "syncopated",
                  "four-on-floor",
                  "free"
                ]
              },
              "instruments": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "acoustic-guitar",
                    "electric-guitar",
                    "distorted-guitar",
                    "bass",
                    "piano",
                    "rhodes",
                    "synth",
                    "synth-pad",
                    "strings",
                    "brass",
                    "drums",
                    "electronic-drums",
                    "808",
                    "percussion",
                    "saxophone",
                    "flute",
                    "violin",
                    "cello",
                    "organ",
                    "accordion",
                    "guzheng",
                    "erhu",
                    "pipa",
                    "dizi",
                    "sitar",
                    "koto"
                  ]
                },
                "maxItems": 3,
                "uniqueItems": true
              },
              "vocalType": {
                "type": "string",
                "enum": [
                  "",
                  "female",
                  "male",
                  "androgynous",
                  "duet",
                  "choir"
                ]
              },
              "vocalDelivery": {
                "type": "string",
                "enum": [
                  "",
                  "warm",
                  "breathy",
                  "raspy",
                  "powerful",
                  "intimate",
                  "whispered",
                  "spoken",
                  "rap"
                ]
              },
              "production": {
                "type": "string",
                "enum": [
                  "",
                  "polished",
                  "raw",
                  "lofi",
                  "analog",
                  "acoustic",
                  "minimal",
                  "spacious",
                  "overdriven"
                ]
              },
              "moods": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "joyful",
                    "melancholic",
                    "nostalgic",
                    "dreamy",
                    "dark",
                    "hopeful",
                    "romantic",
                    "aggressive",
                    "euphoric",
                    "mysterious",
                    "calm",
                    "triumphant"
                  ]
                },
                "maxItems": 2,
                "uniqueItems": true
              },
              "notes": {
                "type": "string",
                "maxLength": 600
              }
            },
            "required": [
              "primaryGenre",
              "secondaryGenre",
              "tempo",
              "bpm",
              "key",
              "meter",
              "groove",
              "instruments",
              "vocalType",
              "vocalDelivery",
              "production",
              "moods",
              "notes"
            ],
            "additionalProperties": false
          },
          "sections": {
            "type": "array",
            "maxItems": 24,
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "enum": [
                    "intro",
                    "verse",
                    "pre-chorus",
                    "chorus",
                    "bridge",
                    "instrumental-break",
                    "outro",
                    "end",
                    "build",
                    "drop",
                    "breakdown",
                    "solo"
                  ]
                },
                "lyrics": {
                  "type": "string",
                  "maxLength": 2000
                },
                "modifiers": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "enum": [
                      "stripped",
                      "full-band",
                      "energy-build",
                      "high-energy",
                      "whispered",
                      "powerful-vocal",
                      "harmonies",
                      "guitar-only",
                      "piano-only",
                      "fade-out",
                      "silence"
                    ]
                  },
                  "maxItems": 2,
                  "uniqueItems": true
                }
              },
              "required": [
                "type",
                "lyrics",
                "modifiers"
              ],
              "additionalProperties": false
            }
          },
          "exclusions": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "vocals",
                "drums",
                "guitar",
                "piano",
                "synth",
                "autotune",
                "choir",
                "reverb",
                "distortion",
                "spoken"
              ]
            },
            "maxItems": 10,
            "uniqueItems": true
          }
        },
        "required": [
          "title",
          "lyricsLanguage",
          "style",
          "sections",
          "exclusions"
        ],
        "additionalProperties": false
      }
    },
    "required": [
      "summary",
      "draft"
    ],
    "additionalProperties": false
  },
  "documentation": {
    "en": "https://www.musicprompt.ai/blog/ai-music-agent-workflow",
    "zh-cn": "https://www.musicprompt.ai/zh-cn/blog/ai-music-agent-workflow"
  }
}
