Skip to content

Add Patchwork Recipe schema (patchwork-recipe.json)#5608

Open
kungfuk3nnyyy wants to merge 3 commits intoSchemaStore:masterfrom
kungfuk3nnyyy:add-patchwork-recipe-schema
Open

Add Patchwork Recipe schema (patchwork-recipe.json)#5608
kungfuk3nnyyy wants to merge 3 commits intoSchemaStore:masterfrom
kungfuk3nnyyy:add-patchwork-recipe-schema

Conversation

@kungfuk3nnyyy
Copy link
Copy Markdown

What is Patchwork?

Patchwork is a recipe-based automation platform for developer workflows. Recipes are YAML files that chain tool calls across SaaS connectors (Jira, GitHub, Slack, Gmail, Linear, etc.) with support for parallel execution, conditional steps, template variables, and approval-gated writes.

What this PR adds

A JSON Schema for Patchwork recipe files (.patchwork.yaml / .patchwork.yml). The schema covers:

  • Top-level recipe fields: name, description, trigger, steps, maxConcurrency, maxDepth, apiVersion
  • Per-step fields: id, tool, params, awaits, when, optional, risk, output
  • Agent-step variant: agent field with model, prompt, tools
  • Nested-recipe-step variant: recipe field for chaining
  • Trigger types: manual, cron, webhook, chained
  • Template expression syntax: {{steps.X.data.field}}, {{env.VAR}}

Schema location

https://raw.githubusercontent.com/patchworkos/recipes/main/schema/recipe.v1.json

File match patterns

["*.patchwork.yaml", "*.patchwork.yml"]

(Intentionally narrow — does not claim *.yaml globally. Authors using plain .yaml filenames should add the # yaml-language-server: $schema=... header.)

Editor experience

Any editor with yaml-language-server (VS Code YAML extension, IntelliJ, Neovim with yaml-ls) will provide autocomplete, hover docs, and validation for all recipe fields.

Recipes generated by patchwork recipe new already emit the $schema header automatically.

Checklist

  • src/schemas/json/patchwork-recipe.json added
  • src/api/json/catalog.json entry added
  • Positive test fixture added
  • Negative test fixture added
  • Schema URL is publicly accessible

Adds JSON Schema for Patchwork recipe YAML files (.patchwork.yaml).
Schema covers recipe fields, step definitions, trigger types, template
expressions, and chained-step metadata.

Schema URL: https://raw.githubusercontent.com/patchworkos/recipes/main/schema/recipe.v1.json
fileMatch: ['*.patchwork.yaml', '*.patchwork.yml']
@github-actions
Copy link
Copy Markdown
Contributor

Thanks for the PR!

This section of the codebase is owned by @madskristensen and @hyperupcall - if they write a comment saying "LGTM" then it will be merged.

Comment thread src/schemas/json/patchwork-recipe.json Outdated
@@ -0,0 +1,355 @@
{
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you're adding an external URL to the catalog.json file, you don't need to upload the schema to this repo

Per maintainer feedback (madskristensen, PR SchemaStore#5608): when the catalog
entry references an external URL, the schema does not need to be
mirrored into this repo. Removing the file also resolves the
`validate` CI failure caused by `positive/`+`negative/` test
subdirectories not matching SchemaStore's flat-file convention.
@kungfuk3nnyyy
Copy link
Copy Markdown
Author

Thanks @madskristensen — good point. Just dropped src/schemas/json/patchwork-recipe.json + the src/test/patchwork-recipe/ fixtures in a85eab5. Now only the catalog entry remains (pointing at the external URL). That should also clear the validate failure (the positive/ / negative/ subdir layout was tripping the flat-file check).

Let me know if you'd like any other changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants