mattrguerra/meridian-skillsmainPrivate on GitHub, published here in full

artwork-template-rebuilder/

Artwork Template Rebuilder

Takes any off-standard vendor template and rebuilds it as a clean Meridian template. The standard was reverse-engineered from the confirmed-correct TD20 / BD08 (flat) and CP10 canopy (die-line) templates and is documented in references/house-standard.md; read it if anything below is unclear. Keep your own confirmed die-line reference files in references/examples/ (not included in this repo).

Step 1: ALWAYS query the user first (non-negotiable)

Before doing anything else, use the user-input tool to collect:

  1. Product name: the full display name (e.g. "Adjustable Backdrop Stand, 8 ft").
  2. SKU: the Meridian product code (e.g. "BD08"). This rarely lives in the vendor file, so it must come from the user. Do not infer it from the filename or guess it.

Pre-fill the product name from the filename/source only as a suggested default the user can correct. The SKU and name may contain intentional placeholders (e.g. SKU DM-[#], name [PLACEHOLDER]). Use them verbatim; do not "fix" them.

Step 2: Classify as a FLAT product or a DIE-LINE product (this decides everything)

FLAT / single-panel: backdrops, banners, tension fabric, feather flags, rigid signs. One artwork rectangle with one inset safe line. → Flat path (Steps 3F-5F).

DIE-LINE / multi-panel: tents, canopies, umbrellas, inflatables (domes), teardrop/pole-pocket flags, anything that is a nest of panels or an unfolded 3D shape. Each panel carries its own layout outline and safe line; there is NO single rectangle. → Die-line path (Steps 3D-5D).

How to tell quickly: run the measurer (Step 3F). If it returns a sane, near-centered visual size close to the page size, it's flat. If it returns a tiny fragment, warns "not centered," or you can see multiple panels in a thumbnail, it's a die-line, so switch to the die-line path. When in doubt, render a thumbnail (pdftoppm -png -r 8 in.pdf chk) and look.

Do not force a die-line through the flat path. build_template.py redraws ONE rectangle from two numbers; on a canopy or dome that throws away every panel and produces an official-looking but useless file. This was the original gap in this skill: it only ever handled flat products.


FLAT PATH

Step 3F: Measure the source (do not guess the safe margin)

python scripts/measure_template.py /mnt/user-data/uploads/<vendor>.pdf

The safe margin is measured from the vendor file, template by template: whatever inset the vendor drew. It reports bleed (page MediaBox), finds the dashed safe rectangle, and prints the exact --bleed-w/--bleed-h --visual-w/--visual-h flags. Insets may be non-uniform per axis; the measured visual size reproduces that exactly.

  • If it warns the safe line is not centered, the builder centers the visual area and can't reproduce that exactly. Flag it to the user rather than shipping a silent mismatch.
  • If it finds no dashed rect, fall back to a stated visual size or a documented default and tell the user you fell back and to what.
  • If it says the found safe line is tiny / a die-line fragment, you are on the wrong path; go to the die-line path.

Step 4F: Build

python scripts/build_template.py \
  --sku "<SKU>" --name "<Product Name>" \
  --bleed-w <W> --bleed-h <H> \
  [--visual-w <W> --visual-h <H>] \
  [--safe-margin <inches>] \
  --out /mnt/user-data/outputs/Artwork_Template_<SKU>_<slug>.pdf

Pass --visual-w/--visual-h straight from the measurer (normal path). Use --safe-margin only on the documented fallback when no safe line was found. The script handles the four OCG layers, Arial (Liberation Sans), CMYK black/red/teal, the title, spec block, legend, and all boilerplate.

Step 5F: Verify & present

Render a thumbnail (pdftoppm -png -r 18 out.pdf chk) and confirm against references/house-standard.md §7. Then present_files the output PDF and tell the user the SKU/name, dimensions, safe margin, and a one-line list of what was off-standard that you corrected.


DIE-LINE PATH (multi-panel / unfolded products)

You cannot redraw these from two dimensions, because the panel geometry only exists in the vendor file. The rebuild preserves the vendor's real panel paths and re-layers them onto the four standard layers. Keep confirmed examples of the target format in references/examples/ (not included here); these are the ones worth having:

  • example_CP10_canopy_top.pdf: the closest analog for angled/triangular panel nests (tents, canopies).
  • example_CP10_canopy_back_wall_and_sides.pdf: rectangular multi-panel.
  • example_UM06_umbrella_hexagon.pdf: hexagon-panel radial layout (umbrellas, domes).

Open the matching example alongside the vendor file and match it. The four layers, named exactly:

Layer Holds
Layout Area every panel's solid black outer layout/cut outline
Safe Lines every panel's red dashed safe line, inset inside its layout outline
Artwork Area empty; the designer drops art here
Help Info the title, spec block, legend, and Notes to Designers boilerplate

Step 3D: Re-layer in Illustrator (the geometry work)

This is a designer step; automation cannot reliably do it on a flattened vendor PDF (outlined text, one layer, non-readable stroke colors). Follow the example file:

  1. Place / open the vendor die-line. Create the four layers above, named exactly.
  2. Layout Area: move the vendor's outer panel outlines here. Recolor to CMYK black C0 M0 Y0 K100, solid.
  3. Safe Lines: move the vendor's safe outlines here (vendors often draw these green; recolor to CMYK red C0 M100 Y100 K0 and make them dashed). One safe line per panel, inset inside that panel's layout outline. Drop the vendor's separate "finished/cut" line unless the product genuinely needs all three, since the Meridian standard is two lines (black layout + red safe).
  4. Artwork Area: leave empty.
  5. Delete the vendor chrome: their title bar, their template key, their spec block, their stitch/ leather-circle callouts unless a callout is genuinely needed (keep needed ones in red, per the standard, e.g. "allow for stitching").
  6. Convert any remaining live text to Arial (ArialMT / Arial-BoldMT).

Step 4D: Stamp the Help Info block

On the Help Info layer, add the standard block (the same content the flat builder emits; see build_template.py for the verbatim text, or copy from the example file):

  • Title [SKU] - Product Name (Arial Bold, black, largest), then Artwork Template under it.
  • Visual Area: spec, one line per panel type with its finished size in inches + cm, e.g. Canopy Top: 123" x 76" (312cm x 193cm).
  • Legend: Visual area (solid black sample) and Safe Visual Line (red dashed sample).
  • Notes to Designers: (bold + underlined): the five standard bullets, teal key terms (150dpi, CMYK, PMS, flatten, outline), final bullet in red.
  • Preferred File Formats: and Acceptable File Formats: sections.

Step 5D: Verify & present

Confirm the four layers exist, are named exactly, and each toggles independently (flip a couple OFF and re-render). Confirm black layout + red dashed safe per panel, Arial + CMYK throughout, Help Info present. present_files the PDF and tell the user what you corrected.


Notes

  • Output is always CMYK and always Arial, because these are print files. RGB or a substitute display font is a defect, not a stylistic choice.
  • The inline key-term highlight in the boilerplate is a muted teal, not red (only the final warning line and stitching callouts are true red). Keep the teal unless the user confirms a change.
  • Layer names are exact and case-sensitive: Layout Area, Artwork Area, Safe Lines, Help Info. (An earlier version of this skill used Safe Line and Artwork Layer; both were wrong and are fixed.)