{
  "author": {
    "address": "0xc820da3Ce55C600A6282D2B21083Fe5Aa7E51F3D",
    "name": "tpae",
    "signature": "db66c79429c6d20fbe6c753664de5515a53d0be5c53288607be5c8827e9a710a58f0bac5bc842b6df197a2138d12a0f955a5ecec2ea35326f8a8e45744cd28841b"
  },
  "available_to_orchestrator": true,
  "changelog": "Created a two-sided business-card workflow with local design selection, exact US/EU sizing and bleed, self-contained PDF rendering, and automated page-size verification; 3 examples pass.",
  "content_hash": "sha256:9d9b7c7de6399a1f6bcae34bb8db7cbd81263a2599e9f4c4d656aeb1fbafc16f",
  "created_at": "2026-10-08T16:31:38Z",
  "format": "osaurus.template",
  "format_version": 1,
  "id": "2C561B74-1091-4A27-AACD-F7D60008CA23",
  "kind": "workflow",
  "name": "Print-Ready Business Card Maker",
  "requirements": {
    "dependencies": [
      {
        "manager": "pip",
        "packages": [
          "reportlab"
        ]
      }
    ],
    "knowledge": [],
    "mcp_servers": [],
    "models": [
      {
        "locality": "local_only",
        "needs_tool_use": false,
        "preferred": "OsaurusAI/Raptor-0.6-4B-JANG_6M",
        "slot": "designer",
        "strictness": "always"
      }
    ],
    "network": [],
    "notes": {},
    "permissions": [],
    "plugins": [],
    "secrets": [],
    "tools": [
      "shell_run",
      "file_read",
      "file_write"
    ]
  },
  "summary": "Designs a two-sided business card and exports a print-ready PDF with bleed.",
  "version": 1,
  "workflow": {
    "dependencies": [
      {
        "manager": "pip",
        "packages": [
          "reportlab"
        ]
      }
    ],
    "edges": [
      {
        "from": "compose_script",
        "to": "write_script"
      },
      {
        "from": "write_script",
        "to": "render_pdf"
      },
      {
        "from": "render_pdf",
        "to": "verify_pdf"
      },
      {
        "from": "verify_pdf",
        "to": "check_pdf"
      },
      {
        "from": "design",
        "to": "palette"
      },
      {
        "from": "palette",
        "to": "compose_script"
      }
    ],
    "examples": [
      {
        "input": {
          "back_content": "Residential landscapes • Public gardens • Climate-resilient planting",
          "card_format": "US — 3.5 × 2 in",
          "company": "Verdant Studio",
          "contact_details": "maya@verdantstudio.com\n(415) 555-0142\nverdantstudio.com\nSan Francisco, CA",
          "full_name": "Maya Chen",
          "orientation": "Horizontal",
          "print_notes": "Uncoated stock; avoid very fine reversed-out type.",
          "role": "Landscape Architect",
          "style": "Refined, organic, and modern. Deep forest green, warm ivory, and a subtle botanical line motif. Plenty of breathing room; no gradients.",
          "tagline": "Places that grow with people."
        },
        "name": "Typical US landscape architect card"
      },
      {
        "input": {
          "back_content": "Advisory • Incident readiness • Executive briefings",
          "card_format": "EU/UK — 85 × 55 mm",
          "company": "Northstar Risk",
          "contact_details": "amara@northstarrisk.eu\n+31 20 555 0184\nnorthstarrisk.eu",
          "full_name": "Dr. Amara Okafor",
          "orientation": "Vertical",
          "print_notes": "Matte laminated stock.",
          "role": "Cybersecurity Advisor",
          "style": "Technical and trustworthy, navy and pale blue, structured, understated, no decorative flourish.",
          "tagline": "Clarity under pressure."
        },
        "name": "Vertical EU consultant card"
      },
      {
        "input": {
          "back_content": "",
          "card_format": "US — 3.5 × 2 in",
          "company": "JO LI",
          "contact_details": "hello@joli.studio",
          "full_name": "Jo Li",
          "orientation": "Horizontal",
          "print_notes": "",
          "role": "Ceramicist",
          "style": "Extremely minimal black and white, editorial, quiet, lots of empty space.",
          "tagline": ""
        },
        "name": "Minimal solo maker card"
      }
    ],
    "input_schema": {
      "additionalProperties": false,
      "properties": {
        "back_content": {
          "description": "Describe what should appear on the back, such as a tagline, services, or call to action.",
          "title": "Back-side content",
          "type": "string"
        },
        "card_format": {
          "description": "Choose the finished card size used by your printer.",
          "enum": [
            "US — 3.5 × 2 in",
            "EU/UK — 85 × 55 mm"
          ],
          "title": "Card format",
          "type": "string"
        },
        "company": {
          "description": "Enter the company, organization, or brand name.",
          "title": "Company or brand",
          "type": "string"
        },
        "contact_details": {
          "description": "Enter the phone, email, website, address, and social handles to include, one per line.",
          "title": "Contact details",
          "type": "string"
        },
        "full_name": {
          "description": "Enter the name exactly as it should appear on the card.",
          "title": "Full name",
          "type": "string"
        },
        "orientation": {
          "description": "Choose a horizontal or vertical card.",
          "enum": [
            "Horizontal",
            "Vertical"
          ],
          "title": "Orientation",
          "type": "string"
        },
        "print_notes": {
          "description": "Enter any special print requirements; leave blank for standard full-color printing with bleed.",
          "title": "Printer notes",
          "type": "string"
        },
        "role": {
          "description": "Enter the person’s title or role.",
          "title": "Job title or role",
          "type": "string"
        },
        "style": {
          "description": "Describe the desired look, mood, industry, colors, and any design preferences.",
          "title": "Visual style",
          "type": "string"
        },
        "tagline": {
          "description": "Enter an optional slogan or short positioning statement.",
          "title": "Tagline",
          "type": "string"
        }
      },
      "required": [
        "full_name",
        "role",
        "company",
        "contact_details",
        "style",
        "card_format",
        "orientation"
      ],
      "type": "object",
      "x-order": [
        "full_name",
        "role",
        "company",
        "contact_details",
        "tagline",
        "back_content",
        "style",
        "card_format",
        "orientation",
        "print_notes"
      ]
    },
    "model_slots": [
      {
        "locality": "local_only",
        "needs_tool_use": false,
        "preferred": "OsaurusAI/Raptor-0.6-4B-JANG_6M",
        "slot": "designer",
        "strictness": "always"
      }
    ],
    "nodes": [
      {
        "id": "design",
        "inference": {
          "instructions": "Act as a senior identity designer. Choose a restrained, print-appropriate visual direction for the supplied business card. Do not invent any claims, services, contact details, URLs, or credentials. Choose the closest palette: `forest_ivory` for organic, grounded, or premium work; `navy_sky` for corporate, technical, or trustworthy work; `charcoal_coral` for modern, creative, or energetic work; or `black_white` for strictly minimal work. Select one layout from `rule`, `frame`, or `split`; one motif from `lines` or `none`; and one typography treatment from `sans`, `serif`, or `mixed`. Keep the summary concise and explain how the choices fit the requested style. Production notes must mention the chosen finished size, bleed (0.125 in for US or 3 mm for EU/UK), front-then-back page order, printer trimming, and the need for printer preflight/CMYK-profile review.",
          "mode": "generate",
          "model_slot": "designer",
          "temperature": 0.45
        },
        "input": {
          "back_content": "{{input.back_content}}",
          "card_format": "{{input.card_format}}",
          "company": "{{input.company}}",
          "contact_details": "{{input.contact_details}}",
          "full_name": "{{input.full_name}}",
          "orientation": "{{input.orientation}}",
          "print_notes": "{{input.print_notes}}",
          "role": "{{input.role}}",
          "style": "{{input.style}}",
          "tagline": "{{input.tagline}}"
        },
        "intent": "Create self-contained print artwork for both sides from the supplied business details and style.",
        "kind": "inference",
        "name": "Choose the visual direction",
        "output_schema": {
          "additionalProperties": false,
          "properties": {
            "design_summary": {
              "type": "string"
            },
            "layout": {
              "enum": [
                "rule",
                "frame",
                "split"
              ],
              "type": "string"
            },
            "motif": {
              "enum": [
                "lines",
                "none"
              ],
              "type": "string"
            },
            "palette": {
              "enum": [
                "forest_ivory",
                "navy_sky",
                "charcoal_coral",
                "black_white"
              ],
              "type": "string"
            },
            "production_notes": {
              "type": "string"
            },
            "typography": {
              "enum": [
                "sans",
                "serif",
                "mixed"
              ],
              "type": "string"
            }
          },
          "required": [
            "palette",
            "layout",
            "motif",
            "typography",
            "design_summary",
            "production_notes"
          ],
          "type": "object"
        },
        "retry": {
          "backoff_seconds": 1,
          "max_attempts": 1
        },
        "timeout": 180
      },
      {
        "id": "render_pdf",
        "input": {
          "command": "python generate_card.py"
        },
        "intent": "Convert the finished two-page artwork into a PDF file.",
        "kind": "tool",
        "name": "Render print-ready PDF",
        "output_schema": {},
        "retry": {
          "backoff_seconds": 1,
          "max_attempts": 1
        },
        "timeout": 180,
        "tool": {
          "name": "shell_run"
        }
      },
      {
        "id": "verify_pdf",
        "input": {
          "mode": "structure",
          "path": "business-card.pdf"
        },
        "intent": "Confirm that the PDF exists and contains the expected two pages.",
        "kind": "tool",
        "name": "Inspect the finished PDF",
        "output_schema": {},
        "retry": {
          "backoff_seconds": 1,
          "max_attempts": 1
        },
        "timeout": 30,
        "tool": {
          "name": "file_read"
        }
      },
      {
        "code": {
          "network": [],
          "secrets": [],
          "source": "async function run(input, ctx) {\n  const packed={details:{full_name:input.full_name,role:input.role,company:input.company,contact_details:input.contact_details,tagline:input.tagline,back_content:input.back_content,card_format:input.card_format,orientation:input.orientation,print_notes:input.print_notes},design:input.design};\n  const literal=JSON.stringify(JSON.stringify(packed));\n  const script=`import json,re\\nD=json.loads(${literal}); d=D['details']; s=D['design']\\ndef rgb(v,f):\\n v=str(v or f)\\n if not re.match(r'^#[0-9A-Fa-f]{6}$',v): v=f\\n return tuple(int(v[i:i+2],16)/255 for i in (1,3,5))\\nP=rgb(s.get('primary_color'),'#173B32'); A=rgb(s.get('accent_color'),'#B88A44'); B=rgb(s.get('background_color'),'#F7F2E8')\\nif 'US' in d['card_format']: tw,th,b=3.5*72,2*72,.125*72\\nelse: tw,th,b=85*72/25.4,55*72/25.4,3*72/25.4\\nif d['orientation']=='Vertical': tw,th=th,tw\\nW,H=tw+2*b,th+2*b; safe=b+(.125*72 if 'US' in d['card_format'] else 3*72/25.4)\\ndef col(c): return '%.3f %.3f %.3f'%c\\ndef esc(v):\\n v=str(v).replace('\\\\\\\\','\\\\\\\\\\\\\\\\').replace('(','\\\\\\\\(').replace(')','\\\\\\\\)').replace('\\\\n',' ')\\n return v.encode('cp1252','replace').decode('latin1')\\ndef face(kind,bold=False):\\n t=s.get('typography','sans')\\n if t=='serif' or (t=='mixed' and kind=='display'): return 'F4' if bold else 'F3'\\n return 'F2' if bold else 'F1'\\ndef estimate(v,size): return len(str(v))*size*.52\\ndef fit(v,maxw,start):\\n z=float(start)\\n while z>6 and estimate(v,z)>maxw: z-=.5\\n return z\\ndef text(cmd,x,y,v,font,size,c,align='left'):\\n if not v:return\\n if align=='center':x-=estimate(v,size)/2\\n elif align=='right':x-=estimate(v,size)\\n cmd.append('BT /%s %.2f Tf %s rg %.2f %.2f Td (%s) Tj ET'%(font,size,col(c),x,y,esc(v)))\\ndef base(cmd):\\n cmd.append('%s rg 0 0 %.2f %.2f re f'%(col(B),W,H))\\n layout=s.get('layout','rule')\\n if layout=='frame':cmd.append('%s RG 1.5 w %.2f %.2f %.2f %.2f re S'%(col(A),b+4,b+4,tw-8,th-8))\\n elif layout=='split':cmd.append('%s rg 0 0 %.2f %.2f re f'%(col(P),W*.24,H))\\n else:cmd.append('%s rg %.2f %.2f %.2f 3 re f'%(col(A),safe,H-safe-3,W-2*safe))\\n if s.get('motif')=='lines':cmd.append('%s RG 1.2 w %.2f %.2f m %.2f %.2f l S %.2f %.2f m %.2f %.2f l S'%(col(A),W-safe-26,H-safe,W-safe,H-safe,W-safe,H-safe,W-safe,H-safe-26))\\n elif s.get('motif')=='circles':cmd.append('%s RG 1 w %.2f %.2f 8 0 360 arc S'%(col(A),W-safe-8,H-safe-8))\\ndef front():\\n q=[];base(q);left=safe+(W*.18 if s.get('layout')=='split' else 0);right=W-safe;width=right-left\\n company=str(d.get('company',''));name=str(d.get('full_name',''));role=str(d.get('role',''))\\n text(q,left,H-safe-14,company.upper(),face('body',True),fit(company.upper(),width,9),P)\\n ns=fit(name,width,22 if W>H else 18);text(q,left,H*.53,name,face('display',True),ns,P);text(q,left,H*.53-ns*.9,role,face('body'),fit(role,width,9),A)\\n lines=[x.strip() for x in str(d.get('contact_details','')).splitlines() if x.strip()];y=safe+max(0,(len(lines)-1)*10)\\n for line in reversed(lines):text(q,right,y,line,face('body'),fit(line,width,7.5),P,'right');y-=10\\n return '\\\\n'.join(q)\\ndef back():\\n q=[];base(q);cx=W/2;maxw=W-2*safe;company=str(d.get('company',''));tag=str(d.get('tagline','')).strip();content=str(d.get('back_content','')).strip();y=H*.61\\n z=fit(company,maxw,20 if W>H else 17);text(q,cx,y,company,face('display',True),z,P,'center')\\n if tag:y-=z*1.35;text(q,cx,y,tag,face('body'),fit(tag,maxw,10),A,'center')\\n if content:\\n  y-=22\\n  for item in [x.strip() for x in re.split(r'[•|\\\\n]',content) if x.strip()][:5]:text(q,cx,y,item,face('body'),fit(item,maxw,7.5),P,'center');y-=11\\n return '\\\\n'.join(q)\\ndef stream(data):\\n raw=data.encode('latin1','replace');return ('<< /Length %d >>\\\\nstream\\\\n'%len(raw)).encode()+raw+b'\\\\nendstream'\\nfront_data=front();back_data=back()\\nobjs=[b'<< /Type /Catalog /Pages 2 0 R >>',b'<< /Type /Pages /Kids [3 0 R 4 0 R] /Count 2 >>',('<< /Type /Page /Parent 2 0 R /MediaBox [0 0 %.3f %.3f] /Resources << /Font << /F1 5 0 R /F2 6 0 R /F3 7 0 R /F4 8 0 R >> >> /Contents 9 0 R >>'%(W,H)).encode(),('<< /Type /Page /Parent 2 0 R /MediaBox [0 0 %.3f %.3f] /Resources << /Font << /F1 5 0 R /F2 6 0 R /F3 7 0 R /F4 8 0 R >> >> /Contents 10 0 R >>'%(W,H)).encode(),b'<< /Type /Font /Subtype /Type1 /BaseFont /Helvetica /Encoding /WinAnsiEncoding >>',b'<< /Type /Font /Subtype /Type1 /BaseFont /Helvetica-Bold /Encoding /WinAnsiEncoding >>',b'<< /Type /Font /Subtype /Type1 /BaseFont /Times-Roman /Encoding /WinAnsiEncoding >>',b'<< /Type /Font /Subtype /Type1 /BaseFont /Times-Bold /Encoding /WinAnsiEncoding >>',stream(front_data),stream(back_data)]\\nout=bytearray(b'%PDF-1.4\\\\n%\\\\xe2\\\\xe3\\\\xcf\\\\xd3\\\\n');offs=[0]\\nfor i,o in enumerate(objs,1):offs.append(len(out));out.extend(('%d 0 obj\\\\n'%i).encode());out.extend(o);out.extend(b'\\\\nendobj\\\\n')\\nx=len(out);out.extend(('xref\\\\n0 %d\\\\n0000000000 65535 f \\\\n'%(len(objs)+1)).encode())\\nfor p in offs[1:]:out.extend(('%010d 00000 n \\\\n'%p).encode())\\nout.extend(('trailer << /Size %d /Root 1 0 R >>\\\\nstartxref\\\\n%d\\\\n%%%%EOF\\\\n'%(len(objs)+1,x)).encode())\\nopen('business-card.pdf','wb').write(out)\\nprint(json.dumps({'path':'business-card.pdf','pages':2,'width_pt':W,'height_pt':H}))\\n`;\n  return {script};\n}",
          "timeout": 30
        },
        "id": "compose_script",
        "input": {
          "back_content": "{{input.back_content}}",
          "card_format": "{{input.card_format}}",
          "company": "{{input.company}}",
          "contact_details": "{{input.contact_details}}",
          "design": "{{nodes.palette.output}}",
          "full_name": "{{input.full_name}}",
          "orientation": "{{input.orientation}}",
          "print_notes": "{{input.print_notes}}",
          "role": "{{input.role}}",
          "tagline": "{{input.tagline}}"
        },
        "kind": "code",
        "name": "Prepare exact-size artwork",
        "output_schema": {
          "additionalProperties": false,
          "properties": {
            "script": {
              "type": "string"
            }
          },
          "required": [
            "script"
          ],
          "type": "object"
        },
        "retry": {
          "backoff_seconds": 1,
          "max_attempts": 1
        },
        "timeout": 120
      },
      {
        "id": "write_script",
        "input": {
          "content": "{{nodes.compose_script.output.script}}",
          "path": "generate_card.py"
        },
        "kind": "tool",
        "name": "Write PDF renderer",
        "output_schema": {},
        "retry": {
          "backoff_seconds": 1,
          "max_attempts": 1
        },
        "timeout": 30,
        "tool": {
          "name": "file_write"
        }
      },
      {
        "code": {
          "network": [],
          "secrets": [],
          "source": "async function run(input, ctx) {\n  const r=input.inspection||{};\n  if (r.page_count !== 2) throw new Error(`Expected 2 pages, found ${r.page_count}`);\n  let trim = input.card_format.startsWith('US') ? [3.5*72,2*72,0.125*72] : [85*72/25.4,55*72/25.4,3*72/25.4];\n  let [tw,th,b]=trim; if(input.orientation==='Vertical'){const x=tw;tw=th;th=x;}\n  const ew=tw+2*b, eh=th+2*b;\n  for(const p of r.pages||[]){const m=String(p.size_pt||'').match(/([0-9.]+)x([0-9.]+)/); if(!m) throw new Error('Could not read PDF page size'); const w=+m[1],h=+m[2]; if(Math.abs(w-ew)>1.5||Math.abs(h-eh)>1.5) throw new Error(`Wrong PDF page size: ${w}x${h} pt`);}\n  return {valid:true,page_count:2,size_pt:`${ew.toFixed(1)}x${eh.toFixed(1)}`};\n}",
          "timeout": 30
        },
        "id": "check_pdf",
        "input": {
          "card_format": "{{input.card_format}}",
          "inspection": "{{nodes.verify_pdf.output}}",
          "orientation": "{{input.orientation}}"
        },
        "kind": "code",
        "name": "Confirm two print-size pages",
        "output_schema": {
          "additionalProperties": false,
          "properties": {
            "page_count": {
              "type": "integer"
            },
            "size_pt": {
              "type": "string"
            },
            "valid": {
              "type": "boolean"
            }
          },
          "required": [
            "valid",
            "page_count",
            "size_pt"
          ],
          "type": "object"
        },
        "retry": {
          "backoff_seconds": 1,
          "max_attempts": 1
        },
        "timeout": 120
      },
      {
        "code": {
          "network": [],
          "secrets": [],
          "source": "async function run(input, ctx) {\n const palettes={forest_ivory:['#173B32','#B88A44','#F7F2E8'],navy_sky:['#102A43','#2E86AB','#F4F8FB'],charcoal_coral:['#222222','#E76F51','#FFF9F5'],black_white:['#111111','#666666','#FFFFFF']};\n const d=input.design||{}; const p=palettes[d.palette]||palettes.forest_ivory;\n return {...d,primary_color:p[0],accent_color:p[1],background_color:p[2]};\n}",
          "timeout": 30
        },
        "id": "palette",
        "input": {
          "design": "{{nodes.design.output}}"
        },
        "kind": "code",
        "name": "Apply a reliable color palette",
        "output_schema": {
          "additionalProperties": false,
          "properties": {
            "accent_color": {
              "type": "string"
            },
            "background_color": {
              "type": "string"
            },
            "design_summary": {
              "type": "string"
            },
            "layout": {
              "type": "string"
            },
            "motif": {
              "type": "string"
            },
            "palette": {
              "type": "string"
            },
            "primary_color": {
              "type": "string"
            },
            "production_notes": {
              "type": "string"
            },
            "typography": {
              "type": "string"
            }
          },
          "required": [
            "palette",
            "layout",
            "motif",
            "typography",
            "design_summary",
            "production_notes",
            "primary_color",
            "accent_color",
            "background_color"
          ],
          "type": "object"
        },
        "retry": {
          "backoff_seconds": 1,
          "max_attempts": 1
        },
        "timeout": 120
      }
    ],
    "output": {
      "design_summary": "{{nodes.design.output.design_summary}}",
      "pdf": "business-card.pdf",
      "production_notes": "{{nodes.design.output.production_notes}}"
    },
    "output_schema": {
      "additionalProperties": false,
      "properties": {
        "design_summary": {
          "title": "Design summary",
          "type": "string"
        },
        "pdf": {
          "format": "file",
          "title": "Print-ready PDF",
          "type": "string"
        },
        "production_notes": {
          "title": "Production notes",
          "type": "string"
        }
      },
      "required": [
        "pdf",
        "design_summary",
        "production_notes"
      ],
      "type": "object"
    },
    "requirement_notes": {},
    "secrets": []
  }
}