Find why your productivity system keeps failing, then apply the smallest fix — capacity math, bottleneck routing, durable local notes.
Coding
knitting-pattern-solver
Try itParse, decode, and expand written knitting patterns. Translates abbreviations, calculates yarn requirements from gauge, tracks stitch counts across rows, and generates row-by-row instructions from condensed pattern notation. Use when a knitter needs help understanding, planning, or tracking a knitting project.
What it does
Knitting patterns are written in dense shorthand — — that's impenetrable to beginners and error-prone even for experts. Row counts get miscounted, yarn runs out mid-project, and pattern repeats are easy to botch. This skill decodes that notation into plain-English instructions, calculates exactly…
The skill document
Knitting Pattern Solver
Overview
Knitting patterns are written in dense shorthand — k2, p2, *k2tog, yo, rep from * to last 4 sts — that's impenetrable to beginners and error-prone even for experts. Row counts get miscounted, yarn runs out mid-project, and pattern repeats are easy to botch. This skill decodes that notation into plain-English instructions, calculates exactly how much yarn a project needs based on a gauge swatch, tracks your progress row by row, and flags stitch-count errors before they compound.
When to Use
- A user is following a written knitting pattern and needs it expanded into row-by-row instructions
- A user needs to calculate yarn requirements before starting (or buying) for a project
- A user wants to verify their stitch count per row matches the pattern's expected count
- A user is substituting yarn and needs to recalculate yardage for a different weight
- A user is designing their own pattern and wants to verify the repeat math
- Don't use for: crochet patterns (different notation), machine-knitting, or purely chart-based patterns (no text to parse)
How to Use
1. Decode a Pattern Row
python scripts/pattern_parser.py "k2, p1, *yo, k2tog, rep from * 3 times, k2"
Output: plain-English step-by-step for each segment, with the expanded repeat count.
2. Calculate Yarn Requirements
python scripts/yarn_calculator.py --gauge-swraps 20 --gauge-rows 28 --swatch-yards 18 --project-stitches 200 --project-rows 300
Output: total yards needed, recommended buy-yardage (with 15% buffer), estimated skeins.
3. Verify Stitch Counts
python scripts/pattern_parser.py --verify "CO 100, Row 1: k2, *p2, k2, rep from * to end"
Output: per-row expected stitch count and flag if any row's net change doesn't balance.
Core Abbreviations Decoded
| Abbrev | Full Term | Effect on Stitch Count |
|---|---|---|
| k | knit | 0 |
| p | purl | 0 |
| yo | yarn over | +1 |
| k2tog | knit 2 together | -1 |
| ssk | slip slip knit | -1 |
| m1 | make 1 | +1 |
| kfb | knit front & back | +1 |
| bo | bind off | -1 per st bound off |
| co | cast on | sets initial count |
Numbered Workflow
- Cast-on analysis: Parse the CO instruction to get the starting stitch count.
- Row-by-row expansion: For each row, expand
*...rep from * N timesinto concrete stitch sequences. - Stitch tracking: Track net increases/decreases per row and flag if the count goes negative or doesn't match a stated target.
- Yarn calculation: Use the gauge swatch (wraps per 4", rows per 4", yards consumed in swatch) to project total yardage.
- Progress tracking: Track which rows have been completed and provide a "you are here" marker.
Common Pitfalls
-
Confusing "rep from * to end" with "rep from * N times." The former repeats until stitches run out; the latter does an exact count. The parser handles both but flags when "to end" doesn't divide evenly.
-
Forgetting that yo and k2tog in the same repeat may be decorative holes with zero net change. Always compute the net per-repeat delta, not individual stitches.
-
Yarn calculator assumes consistent gauge. If the user's tension varies (common for beginners), actual usage may differ ±20%. Always add a 15% safety buffer.
-
Gauge swatch must be washed and blocked before measuring. Pre-block measurements underestimate yardage for stretchy yarns.
-
Pattern substitution without re-gauging. Switching from DK to worsted changes everything. The user must knit a new swatch with the substitute yarn.
Verification Checklist
- Pattern row decodes without parse errors
- Each row's net stitch change matches expected target (if stated)
- Yarn calculation includes a 15%+ safety buffer
- Repeat counts multiply correctly (no off-by-one)
- Cast-on count is divisible by pattern repeat width (or remainder is accounted for)
Example Session
User: "I'm knitting a scarf. Pattern says: CO 40 sts. Row 1: *k3, p2, rep from * to end. Row 2: *p2, k3, rep from * to end. How much yarn do I need for 200 rows? My swatch is 20sts/4", 24 rows/4", and used 15 yards."
Agent workflow:
- Parse CO 40 → starting count = 40
- Row 1:
k3, p2= 5-stitch repeat × 8 = 40 ✓ (divides evenly) - Yarn calc: area_ratio = (40/20) × (200/24) = 2.0 × 8.33 = 16.67; total = 15 × 16.67 ≈ 250 yards → recommend buying 290 yards (with buffer)
- Report: "40 stitches divides evenly into 8 repeats of k3,p2. You'll need ~250 yards, buy 290 to be safe."
Related skills
Generate and edit Draw.io, Mermaid, and Excalidraw diagrams from natural language using a structured JSON spec.
Join a video meeting as an AI bot with voice, avatar, and screenshare across four operating modes.
Stores durable facts in a categorized, plain-markdown vault on disk, alongside your agent's built-in memory.
Query and manage Linear issues, projects, teams, cycles, labels, and comments through a managed OAuth GraphQL endpoint.
Post videos, photos, text, and documents to 10 social platforms through a single REST API call.
More from voronindenis5
Browse all skillsPryamoy Russkiy (Straight Russian) — AI assistant that tells it like it is. Direct answers, no fluff, occasional profanity. Specializes in honest analysis, t...
Agent self-awareness of cognitive states — context fatigue, attention drift, memory debt, confidence erosion, and skill staleness. Detect, report, and mitigate degrading conditions before they cause failures.
Plan what happens to your digital life if you die or become incapacitated. Inventory accounts, subscriptions, crypto wallets, important files, social media legacy contacts, and generate a sealed instruction document for trusted family. Includes encrypted digital will template and printable emergency access guide.
Use when an agent task fails or produces unexpected results. Performs structured post-mortem root cause analysis: categorizes the failure, traces the exact failure point through tool-call logs, reconstructs the decision chain, generates a post-mortem report, and saves lessons to prevent recurrence.
Excavate forgotten solutions, code snippets, and decisions from past conversation sessions. Use when the user is re-solving a problem you've likely solved before, hunting for a lost snippet, or wants to mine session history for buried knowledge instead of starting from scratch.
Decide whether to fix, replace, or recycle a broken item. Takes item type, age, symptoms, and repair estimate, then produces a scored recommendation across cost, lifespan, sentimental value, and environmental impact.