Skip to content
Back to skills

Cocorecipe

ASecurity

Generate a flow.json from a CocoRecipe template. Prompts for required parameters interactively, substitutes {{param}} slots, validates the result against CocoFlow schema, and writes to .cocoplus/flow.json.

  • 724 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 5, 2026
ai-agentsnode

Works with

  • cli

Security analysis

A100/100

Pro scans all 5 files and shows the line behind each finding

Scanned September 5, 2026

npx -y skills add Snowflake-Labs/cocoplus --skill cocorecipe --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Cocorecipe?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Cocorecipe
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/snowflake-labs-cocorecipe-9acb4036/badge)](https://www.skillsdirectory.com/skills/snowflake-labs-cocorecipe-9acb4036)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: "recipe-use"
description: "Generate a flow.json from a CocoRecipe template. Prompts for required parameters interactively, substitutes {{param}} slots, validates the result against CocoFlow schema, and writes to .cocoplus/flow.json."
version: "1.0.1"
author: "CocoPlus"
tags:
  - cocoplus
  - cocorecipe
---

Your objective is to generate a CocoFlow pipeline from a named recipe template.

## Pre-flight Check

Check that `.cocoplus/` exists. If not:
Output: "CocoPlus not initialized in this directory. Run `$pod init` to begin." Then stop.

## Locate Recipe Template

Look for `<name>.json.template` in:
1. `~/.coco/plugins/cocoplus/recipes/<name>.json.template`
2. `.cocoplus/recipes/<name>.json.template` (project-local)

If not found in either location, output:
"Recipe '<name>' not found. Run `$recipe list` to see available recipes." Then stop.

## Read Parameters

Read the `__recipe_meta` block from the template to identify required parameters, optional parameters, and their descriptions.

## Collect Parameter Values

For each required parameter not already supplied via `--params key=value`:
- Ask the developer interactively with a clear prompt showing the parameter name and description
- Wait for response before proceeding to the next missing parameter

Validate all collected values:
- Non-empty for required parameters
- Snowflake identifier format where specified (alphanumeric + underscores, no spaces)

If any validation fails, explain the format requirement and re-prompt (do not abort).

## Check for Existing flow.json

If `.cocoplus/flow.json` already exists:
Output: "A flow.json already exists for this project. Overwrite it with the <name> recipe pipeline? (y/n)"
Wait for confirmation. If declined, stop.

## Generate Pipeline

Replace all `{{parameter_name}}` slots in the template with supplied values.

Remove the `__recipe_meta` block from the output.

Validate the resulting JSON against the CocoFlow schema (check that `nodes` array exists and each node has `id`, `label`, `type`, `agent` fields). If validation fails, output the specific schema violations and do not write.

## Write to flow.json

Write the validated JSON to `.cocoplus/flow.json`.

## Output

```
Generated: <name> pipeline (<N> stages)
Parameters used:
  <param1>   = <value1>
  <param2>   = <value2>

Pipeline stages:
  1. <stage-id>   (<agent>, <model>)
  2. <stage-id>   (<agent>, <model>) [plan gate]
  ...

Written to .cocoplus/flow.json
Next: Run $plan to review and approve before executing.
```

## Error Cases

- **Recipe not found:** List available recipes
- **Generated JSON invalid:** Output specific schema error, do not write
- **flow.json exists, developer declined overwrite:** Stop gracefully, no changes made

## Anti-Rationalization

| Shortcut / Temptation | Why It Fails |
|-----------------------|--------------|
| Write flow.json without validation | An invalid flow.json crashes $flow run at start — catch schema errors now |
| Skip the overwrite prompt when flow.json exists | Silently overwriting a carefully built pipeline is data loss |
| Error on missing required parameter instead of prompting | Interactive collection is the spec behavior — always collect, never error |

## Exit Criteria

- [ ] `.cocoplus/flow.json` written with all `{{param}}` slots substituted
- [ ] JSON validates against CocoFlow schema before writing
- [ ] Output lists all parameters used, stage names, agents, and models
- [ ] Output ends with "Next: Run $plan to review and approve before executing."

Files in this skill

  • recipe-list.skill.md2.8 KB
  • recipe-metadata.skill.md1.5 KB
  • recipe-new.skill.md3 KB
  • recipe-use.skill.md3.4 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…