规范
Recipaie 使用 JSON Schema 进行校验。下面的 schema 定义了部署配方与执行结果的完整结构。
Recipaie Schema
recipaie schema 定义了部署配方的结构——描述如何安装和配置软件的模板。
Schema 地址:
必填字段
| 字段 | 类型 | 说明 |
|---|---|---|
| string | 服务或应用的名称 |
| string | recipaie 的语义化版本号(例如 "1.0.0") |
| array | 按顺序排列的部署步骤列表 |
| integer | 步骤总数(必须与 steps 数组长度一致) |
可选字段
| 字段 | 类型 | 说明 |
|---|---|---|
| string | 简要说明这份配方部署的是什么 |
| array | 开始前所需的工具或条件 |
步骤结构
steps 数组中的每一步都必须包含:
| 字段 | 是否必填 | 说明 |
|---|---|---|
| 是 | 步骤编号(从 1 开始) |
| 是 | 要执行什么操作 |
| 是 | 为什么需要这一步(用于建立上下文) |
| 是 | 何时或在什么条件下执行此步骤 |
| 否 | 跳过此步骤的条件 |
| 是 | 如何执行该操作(命令或说明) |
| 是 | 如何验证该步骤已成功 |
| 否 | 补充上下文或备注 |
完整的 Schema JSON
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://recipaie.publifye.pro/recipaie.schema.json",
"title": "Recipaie",
"description": "Recipe for AI - a simple deployment guide schema for AI assistants",
"type": "object",
"required": ["name", "version", "steps", "step_count"],
"properties": {
"$schema": {
"type": "string",
"description": "Reference to the recipaie schema"
},
"name": {
"type": "string",
"description": "Name of the service or application"
},
"flavor": {
"type": "string",
"description": "Variant identifier (e.g., 'dev', 'deploy'). Empty or omitted for the main recipaie. Must match filename suffix: recipaie-{flavor}.json"
},
"version": {
"type": "string",
"description": "Semantic version of the recipaie (e.g., '1.0.0')"
},
"description": {
"type": "string",
"description": "Brief description of what this recipe deploys"
},
"prerequisites": {
"type": "array",
"items": { "type": "string" },
"description": "Tools or conditions that must exist before starting (e.g., docker, pubmcp)"
},
"steps": {
"type": "array",
"description": "Ordered list of deployment steps",
"items": {
"type": "object",
"required": ["order", "what", "why", "when", "how", "verify"],
"properties": {
"order": {
"type": "integer",
"minimum": 1,
"description": "Step number (1-based)"
},
"what": {
"type": "string",
"description": "What action to perform"
},
"why": {
"type": "string",
"description": "Why this step is needed (builds context)"
},
"when": {
"type": "string",
"description": "When or under what condition to perform this step"
},
"skip_if": {
"type": "string",
"description": "Condition to skip this step (optional)"
},
"how": {
"type": "string",
"description": "How to perform the action (command or instruction)"
},
"verify": {
"type": "string",
"description": "How to verify the step succeeded"
},
"comments": {
"type": "array",
"items": { "type": "string" },
"description": "Additional context or notes (optional)"
}
},
"additionalProperties": false
}
},
"step_count": {
"type": "integer",
"minimum": 1,
"description": "Total number of steps (must match steps array length)"
}
},
"additionalProperties": false
}
Prodaie Schema
prodaie schema 在 recipaie 的基础上扩展,用于按安装位置记录执行结果。它是运行 recipaie 所得的“产物”。
Schema 地址:
结构
一份 prodaie 包含:
- 必须与原始 recipaie 一致name
locations- 安装位置数组,每个位置都有各自的执行结果
Location 结构
每个 location 包含:
| 字段 | 说明 |
|---|---|
| 此实例所安装的文件路径或目录 |
| 这次具体安装的目的 |
| 执行状态:complete、partial 或 failed |
| 本次安装各步骤及其结果 |
| 步骤总数 |
步骤结果
除 recipaie 的步骤字段外,prodaie 的步骤还包含以下必填字段:
| 字段 | 类型 | 说明 |
|---|---|---|
| boolean | 若该步骤成功或被有意跳过,则为 |
| string | 对执行过程中所发生情况的说明 |
布尔字段 success 便于用程序检查每一步的结果,而 details 则给出可读的说明。
完整的 Schema JSON
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://recipaie.publifye.pro/prodaie.schema.json",
"title": "Prodaie",
"description": "Product of AI - a recipaie with execution results per installation location",
"type": "object",
"required": ["name", "locations"],
"properties": {
"$schema": {
"type": "string",
"description": "Reference to the prodaie schema"
},
"name": {
"type": "string",
"description": "Name of the service or application"
},
"flavor": {
"type": "string",
"description": "Variant identifier matching the recipaie that was executed. Must match filename suffix: prodaie-{flavor}.json"
},
"description": {
"type": "string",
"description": "Brief description of what this recipe deploys"
},
"prerequisites": {
"type": "array",
"items": { "type": "string" },
"description": "Tools or conditions that must exist before starting"
},
"locations": {
"type": "array",
"description": "Installation locations with their individual execution results",
"minItems": 1,
"items": {
"type": "object",
"required": ["path", "status", "steps", "step_count"],
"properties": {
"path": {
"type": "string",
"description": "File path or directory where this instance is installed"
},
"description": {
"type": "string",
"description": "Purpose of this specific installation"
},
"status": {
"type": "string",
"enum": ["complete", "partial", "failed"],
"description": "Execution status for this installation"
},
"steps": {
"type": "array",
"description": "Ordered list of deployment steps with results for this installation",
"items": {
"type": "object",
"required": ["order", "what", "why", "when", "how", "verify", "success", "details"],
"properties": {
"order": {
"type": "integer",
"minimum": 1,
"description": "Step number (1-based)"
},
"what": {
"type": "string",
"description": "What action to perform"
},
"why": {
"type": "string",
"description": "Why this step is needed (builds context)"
},
"when": {
"type": "string",
"description": "When or under what condition to perform this step"
},
"skip_if": {
"type": "string",
"description": "Condition to skip this step (optional)"
},
"how": {
"type": "string",
"description": "How to perform the action (command or instruction)"
},
"verify": {
"type": "string",
"description": "How to verify the step succeeded"
},
"success": {
"type": "boolean",
"description": "Whether the step succeeded (true) or failed (false). Steps that were intentionally skipped are also true."
},
"details": {
"type": "string",
"description": "Explanation of what happened during execution"
},
"comments": {
"type": "array",
"items": { "type": "string" },
"description": "Additional context or notes (optional)"
}
},
"additionalProperties": false
}
},
"step_count": {
"type": "integer",
"minimum": 1,
"description": "Total number of steps (must match steps array length)"
}
},
"additionalProperties": false
}
}
},
"additionalProperties": false
}
校验
使用我们的在线校验器做快速检查,或以程序方式校验:
API
curl -X POST https://recipaie.com/api/validate \
-H "Content-Type: application/json" \
-d '{"schema_type":"recipaie","content":{...your JSON...}}'
命令行工具(不限次数)
# Using ajv-cli (Node.js)
npx ajv validate -s https://recipaie.com/schemas/recipaie.schema.json -d my-recipe.json
# Using jsonschema (Python)
pip install jsonschema
jsonschema -i my-recipe.json https://recipaie.com/schemas/recipaie.schema.json