budtags/skills/labelary-help/SKILL.md
Use this skill when working with the Labelary ZPL rendering API for converting ZPL to images/PDFs, implementing ZPL preview functionality, or converting images/fonts to ZPL format.
npx skillsauth add jwilly246/budtags-claude-plugin labelary-helpInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You are now equipped with comprehensive knowledge of the Labelary ZPL Rendering API via modular category files and pattern guides. This skill uses progressive disclosure to load only the information relevant to your task.
When the user asks about Labelary or ZPL rendering, you can:
This skill has access to 4 category files, 4 pattern files, and 3 workflow guides:
Core Operations:
categories/getting-started.md - Quickstart, CDN setup, basic usage, DPI/DPMM introcategories/api-endpoints.md - 4 core endpoints (ZPL→PNG/PDF, Image→ZPL, Font→ZPL)categories/parameters.md - Complete parameter reference (URL params, headers, options)categories/advanced-features.md - PDF layouts, rotation, linting, data extraction, qualitypatterns/dpi-conversion.md - DPI to DPMM conversion (CRITICAL!)patterns/get-vs-post.md - When to use GET vs POST requestspatterns/error-handling.md - Rate limits, errors, troubleshootingpatterns/integration.md - React/TypeScript integration patternsWORKFLOWS/ZPL_PREVIEW_WORKFLOW.md - Implementing live ZPL preview modalsWORKFLOWS/IMAGE_CONVERSION_WORKFLOW.md - Converting images to ZPL graphicsWORKFLOWS/FONT_CONVERSION_WORKFLOW.md - Converting TrueType fonts to ZPLAPI_REFERENCE.md - Complete API endpoint reference with all parameters and optionsCODE_EXAMPLES.md - Real implementation examples from BudTags project (React/TypeScript)INTEGRATION_GUIDE.md - Step-by-step guide to integrating Labelary in your applicationdocs/ directory - 8 complete Labelary documentation filesBase URL: http://api.labelary.com/v1/
Authentication: None required (free tier)
Rate Limits (Free Tier):
Key Features:
IMPORTANT: Only load files relevant to the user's question. DO NOT load all categories.
Ask the user or determine from context:
"What Labelary API task are you working on? Please provide:
Determine scope:
User asks: "How do I convert ZPL to PNG?"
Load:
categories/getting-started.md (quickstart, basic usage)Context: ~100 lines (97% reduction from full docs)
User asks: "What's the format for the image-to-ZPL endpoint?"
Load:
categories/api-endpoints.md (all 4 endpoints with examples)Context: ~150 lines (95% reduction)
User asks: "What Accept headers are available?"
Load:
categories/parameters.md (complete parameter reference)Context: ~150 lines (95% reduction)
User asks: "I'm getting HTTP 400 errors with dpmm"
Load:
patterns/dpi-conversion.md (CRITICAL conversion pattern)patterns/error-handling.mdContext: ~120-200 lines (94% reduction)
User asks: "Should I use GET or POST?"
Load:
patterns/get-vs-post.md (complete decision tree + examples)Context: ~120 lines (96% reduction)
User asks: "I'm getting rate limited / HTTP 429 errors"
Load:
patterns/error-handling.md (all errors, fixes, retry strategies)Context: ~120 lines (96% reduction)
User asks: "How do I implement ZPL preview in React?"
Load:
patterns/integration.md (React hooks, modal components, caching)WORKFLOWS/ZPL_PREVIEW_WORKFLOW.mdContext: ~200-300 lines (90% reduction)
User asks: "How do I create multi-label PDF sheets?"
Load:
categories/advanced-features.md (PDF layouts, rotation, linting, data extraction)Context: ~150 lines (95% reduction)
When answering:
User: "How do I convert ZPL to PNG?"
Your Response:
To convert ZPL to PNG, use a POST request to the Labelary API.
Let me load the getting started guide for you...
[Load categories/getting-started.md]
**Basic Example:**
\```bash
curl --request POST http://api.labelary.com/v1/printers/8dpmm/labels/4x6/0/ \
--header "Content-Type: application/x-www-form-urlencoded" \
--data "^xa^cfa,50^fo100,100^fdHello World^fs^xz" > label.png
\```
**TypeScript/React:**
\```typescript
const dpmm = Math.round(203 / 25.4); // 8
const apiUrl = `http://api.labelary.com/v1/printers/${dpmm}dpmm/labels/4x6/0/`;
const response = await fetch(apiUrl, {
method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
body: zplCode,
});
const blob = await response.blob();
const imageUrl = URL.createObjectURL(blob);
\```
**Category Reference**: categories/getting-started.md
Would you like to see more advanced features or integration patterns?
User: "I'm getting HTTP 400 error: Invalid printer density"
Your Response:
This error occurs when you use DPI instead of DPMM in the URL.
[Load patterns/dpi-conversion.md]
**The Problem:**
Labelary uses DPMM (dots per millimeter), NOT DPI!
**Conversion Formula:**
\```javascript
const dpmm = Math.round(dpi / 25.4);
// Common conversions:
// 203 DPI → 8 dpmm
// 300 DPI → 12 dpmm
// 600 DPI → 24 dpmm
\```
**Valid DPMM values:** `6dpmm`, `8dpmm`, `12dpmm`, `24dpmm`
**❌ WRONG:**
\```typescript
const apiUrl = `http://api.labelary.com/v1/printers/203dpmm/...`;
\```
**✅ CORRECT:**
\```typescript
const dpmm = Math.round(203 / 25.4); // 8
const apiUrl = `http://api.labelary.com/v1/printers/${dpmm}dpmm/...`;
\```
**Pattern Reference**: patterns/dpi-conversion.md
This should fix your HTTP 400 error!
User: "How do I implement ZPL preview modal in React?"
Your Response:
Use a custom hook with useEffect to fetch the preview.
[Load patterns/integration.md]
**React Hook Pattern:**
\```typescript
const useLabelaryPreview = ({ zplCode, widthInches, heightInches, dpi }) => {
const [imageUrl, setImageUrl] = useState(null);
const [loading, setLoading] = useState(false);
useEffect(() => {
if (!zplCode) return;
const fetchPreview = async () => {
setLoading(true);
const dpmm = Math.round(dpi / 25.4);
const apiUrl = `http://api.labelary.com/v1/printers/${dpmm}dpmm/labels/${widthInches}x${heightInches}/0/`;
const response = await fetch(apiUrl, {
method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
body: zplCode,
});
const blob = await response.blob();
setImageUrl(URL.createObjectURL(blob));
setLoading(false);
};
fetchPreview();
return () => {
if (imageUrl) URL.revokeObjectURL(imageUrl);
};
}, [zplCode, widthInches, heightInches, dpi]);
return { imageUrl, loading };
};
\```
**Pattern Reference**: patterns/integration.md
Would you like to see the complete modal component or workflow guide?
User: "Getting HTTP 429 Too Many Requests errors"
Your Response:
You're exceeding the free tier rate limit (3 requests/second).
[Load patterns/error-handling.md]
**Free Tier Limits:**
- 3 requests per second
- 5,000 requests per day
**Solution - Implement Throttling:**
\```typescript
class LabelaryClient {
private readonly DELAY_MS = 350; // 3 req/sec
async fetchWithThrottle(zpl: string) {
await new Promise(resolve => setTimeout(resolve, this.DELAY_MS));
return fetch(apiUrl, { method: 'POST', body: zpl });
}
}
\```
**Solution - Exponential Backoff:**
\```typescript
async function fetchWithRetry(url, options, maxRetries = 3) {
for (let i = 0; i < maxRetries; i++) {
const response = await fetch(url, options);
if (response.status === 429) {
const delay = Math.pow(2, i) * 1000;
await new Promise(resolve => setTimeout(resolve, delay));
continue;
}
return response;
}
}
\```
**Pattern Reference**: patterns/error-handling.md
This will prevent rate limit errors!
Labelary uses DPMM, NOT DPI!
// Always convert
const dpmm = Math.round(dpi / 25.4);
// Valid values: 6, 8, 12, 24
// Most common: 8 (203 DPI), 12 (300 DPI)
See: patterns/dpi-conversion.md
Use POST for production (ALWAYS):
// ✅ RECOMMENDED
const response = await fetch(apiUrl, {
method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
body: zplCode,
});
See: patterns/get-vs-post.md
Always revoke to prevent memory leaks:
useEffect(() => {
// ... fetch logic
return () => {
if (imageUrl) {
URL.revokeObjectURL(imageUrl);
}
};
}, [zplCode]);
See: patterns/integration.md
Free tier: 3 req/sec, 5,000 req/day
// Add delay between requests
await new Promise(resolve => setTimeout(resolve, 350));
See: patterns/error-handling.md
Control with Accept header:
headers: {
'Accept': 'image/png', // PNG (default)
'Accept': 'application/pdf', // PDF
'Accept': 'application/json', // Data extraction
}
See: categories/parameters.md
categories/getting-started.md - Use when you need to:
categories/api-endpoints.md - Use when you need to:
categories/parameters.md - Use when you need to:
categories/advanced-features.md - Use when you need to:
patterns/dpi-conversion.md - Use when you need to:
patterns/get-vs-post.md - Use when you need to:
patterns/error-handling.md - Use when you need to:
patterns/integration.md - Use when you need to:
Help users successfully integrate Labelary ZPL rendering API by:
You have complete knowledge of the Labelary API via modular, focused files. Use progressive disclosure to provide fast, relevant answers!
| Query Type | Before | After | Reduction | |------------|--------|-------|-----------| | Getting started | 488 lines | ~100 lines | 79% | | Endpoint details | 488 lines | ~150 lines | 69% | | DPI conversion | 488 lines | ~120 lines | 75% | | Integration patterns | 488 lines | ~120 lines | 75% | | Error handling | 488 lines | ~120 lines | 75% | | Average | 488 lines | ~120 lines | ~75% |
Pro Tip: When users have HTTP 400 errors, ALWAYS check DPI to DPMM conversion first (patterns/dpi-conversion.md) - this is the #1 most common error!
development
Use this skill when generating ZPL code, working with ZPL commands, creating Zebra printer labels, or troubleshooting ZPL syntax and formatting issues.
development
Use this skill to verify that code aligns with BudTags coding standards, architectural patterns, and conventions before or after implementation.
development
Use this skill when working with Unleashed Software inventory/order management API integration, syncing inventory, importing orders, managing stock adjustments, or handling customer/product data from Unleashed.
data-ai
TanStack Virtual patterns for virtualized lists, tables, and grids with high-performance rendering of large datasets