Converting Craft Patterns to Logic Blocks
Given a pattern (image description, PDF text dump, or verbal craft instructions), output this structure immediately:
- Base unit: [e.g., magic ring, 6sc]
- Hook/needle-to-yarn ratio: [e.g., 3.5mm hook, worsted weight]
- Gauge/tension: [e.g., 4x4 sts = 1in]
- Material thickness constant: [if relevant]
6 sc in magic ring [6]
R2: inc x6 [12] R3: (sc, inc) x6 [18]
R4-8: sc around [18] (x5 rows)
R9: (sc4, dec) x3 [15] R10: dec x6, sc3 [9]
- If st count off by ±1 at R4: recount R3, redistribute inc evenly
No preamble, no "here's your pattern" framing—output the blocks directly.
Progress:
- Step 1: Ingest & Isolate — strip all conversational/narrative text; extract only stitch counts, row markers, and repeat structures
- Step 2: Validate Environment Variables — lock down hook/needle size, yarn weight, gauge, tension, base unit count as immutable prerequisites
- Step 3: Decompose into Nodes — split into Foundation / Expansion / Stabilization / Contraction phases
- Step 4: Render as ASCII/linear ledger — no visual diagrams; use bracketed stitch counts
[N]after every row - Step 5: Inject Exception Routes — add localized recalculation loops at known drift points (typically post-expansion and pre-contraction rows)
- Step 6: Package — output as standalone, scrollable markdown fragments, each node readable without cross-referencing the full pattern
Foundation Primitives Node
Exact starting geometry: ring size, chain count, cast-on count. Always ends with a bracketed total [N].
Volumetric Expansion Node
Rate of increase per row, expressed as a repeat formula, not prose. Format: (action, action) xN [total].
Dimensional Stabilization Node
Flat/uniform rows. Collapse repeated identical rows into a single line with a row-range and multiplier: R6-12: sc around [24] (x7 rows).
Contraction Closure Node Reduction formula mirroring the expansion node structure, tapering to a defined final count (e.g., closure count for cinching).
Example 1: Input: "Round 1: Make a magic ring and single crochet 6 times into it. Round 2: Increase in every stitch around, you should have 12. Round 3: Alternate single crochet and increase around, ending at 18 stitches."
Output:
- Base unit: magic ring
- Gauge: not specified — FLAG
R1 [FOUNDATION]: 6 sc in MR [6] R2 [EXPANSION]: inc x6 [12] R3 [EXPANSION]: (sc, inc) x6 [18]
**Example 2:**
Input: A gridded cross-stitch chart described row-by-row as "10 dark, 3 light, 10 dark" repeated for 20 rows with no variation.
Output:
- Grid unit: 1 stitch = 1 cell
- Thread count: not specified — FLAG
R1-20 [STABILIZATION]: ##########...###..........########## (10D, 3L, 10D) — uniform x20 rows
- Always bracket running stitch totals
[N]— this is the non-negotiable state checkpoint. - Collapse identical consecutive rows into a single ranged line; never list 10 identical rows individually.
- Flag missing environmental variables (
FLAG) rather than assuming defaults. - Use repeat-formula notation
(x, y) xNover spelling out every repetition. - Keep each node under ~5 lines so it's readable in a single mobile screen scroll.
- Place exception routes immediately after the row where drift is statistically likely (post-expansion, pre-contraction).
- Do not preserve narrative/conversational language ("now you'll want to...")—convert to imperative logic only.
- Do not merge Expansion and Contraction logic into one node even if symmetric—they are distinct state machines.
- Do not omit the bracketed stitch count; an unverified count breaks the deterministic chain.
- Do not describe visual diagrams in prose—use ASCII grid or formula notation only.
- Do not skip the prerequisite gate even for "simple" patterns—undeclared gauge is the most common cause of downstream misalignment.