IntermediateClaude Code

Barcode Generator Skill for SKU & EAN Labels

Use this barcode generator Skill to turn an existing SKU, EAN or UPC into a PNG label with a bundled Python script. Your assistant can choose the format, save the image and check the encoded value, making it useful for preparing product and warehouse labels before connecting them to your scanner, inventory system or printing workflow.

Views
0
Copies
0
Favorites
0
01

Barcode generator: from product number to PNG

The Skill accepts a product identifier, barcode format and output path, then generates an image using its Python script. Supported formats include Code128, Code39, EAN and UPC. For an internal alphanumeric SKU, Code128 is a practical starting point to test with your warehouse equipment.

The image represents the identifier you supply; it does not allocate a GS1 number or connect the SKU to inventory automatically. The bundled script handles one image at a time. CSV loops, ZIP packaging and printer-specific layouts can be added as separate work when the label volume grows.

02

Is this Skill right for your store?

Barcode Generator suits stores that already have product codes and need barcode images for picking, stock checks or packing. It turns a chosen code into a PNG; use it when the missing step is making the label image, rather than assigning product identifiers or managing warehouse inventory.

01

Make warehouse labels from existing SKUs

For internal SKUs containing letters, digits or hyphens, generate a Code128 sample and decode it before printing a batch. The worked example returned the exact input SKU. Then confirm that the scanner and warehouse software map that value to the intended item.

02

Use approved EAN or UPC numbers for retail labels

Use an already assigned EAN or UPC when the selling channel requires that identifier. Check the generated value against the product record, especially where a library recalculates a check digit; creating an image does not register a number or establish marketplace acceptance.

03

Choose a batch or printing workflow when volume grows

Batch generation requires a loop or helper around the single-image script. The worked example uses such helper code for several SKUs and a ZIP; fixed label dimensions, page layout and print queues should be handled in the appropriate printing workflow.

03

Before you use it

Prepare the following business inputs and software before starting the workflow.

Python environment

Prepare python 3, a virtual environment and python-barcode with its image dependencies.

Approved product identifiers

Prepare a valid identifier you are entitled to use; generation does not register a product code.

Output and scan checks

Prepare a new output directory and a scanner or decoder for checking the result.

04

Install

Install the complete Skill package, then start with the merchant inputs listed above.

Copy this request into Codex or Claude Code on your computer. The assistant will download the Skill, set up its Python environment and generate a sample barcode. The terminal commands remain available in the other tab.

  1. Open Codex or Claude Code with local file and terminal access.
  2. Copy the request below into the app you are using. The assistant will select that app’s installation directory.
  3. Check the returned path and file checks. Start a new session if needed, then ask the assistant to use the installed Skill.
Install barcode-generator on this computer and complete a sample run. Please execute the setup commands, rather than only explaining them. 1. Download the original author's repository https://github.com/AIDotNet/MoYuCode.git into a new temporary directory and check out commit 9fa0412ff1d57ca3216835637773ac975cae1009. The Skill is at skills/tools/barcode-generator. Read its SKILL.md and scripts before running them. 2. Copy the complete barcode-generator folder, preserving its structure, and include the repository LICENSE. For Codex, use ~/.agents/skills/barcode-generator; for Claude Code, use ~/.claude/skills/barcode-generator. Install only for the app I am using. If that destination already exists, inspect it and report any differences before replacing it. 3. Check Python 3 is available. Create a .venv inside the installed Skill folder and install python-barcode[images]==0.16.1 and Pillow==11.3.0 there. Use the virtual environment's Python for all following commands, adapting its executable path to my operating system. 4. Read the installed SKILL.md and use scripts/barcode_generator.py to encode CCT-MUG-BLUE-001 as Code128. Create a new output directory and pass --output with a PNG path. Check the actual saved filename and confirm the file is a readable PNG. If an independent barcode decoder is available, decode it and compare the result with CCT-MUG-BLUE-001; otherwise report image generation and decoding as separate checks. 5. Return the Skill's absolute installation path, source commit, Python executable, sample image path and actual check results. Explain how to invoke it in this app, and give me a follow-up request for generating a label from my own SKU.
05

Get started: three store tasks

Starter prompts for the main use cases—copy and use them directly.

01

Make an internal SKU label

Make an internal SKU label to produce a Code128 PNG whose decoded value matches the SKU. SKU text and a new output path.

Show prompt and variablesHide prompt and variables
Use the reviewed barcode-generator script to encode [INPUT] as Code128 in a new output directory. Pass --output, report the saved path, and decode the image to check its value. Do not assign a retail GTIN.

Replace these variables

[INPUT]
SKU text and a new output path.
02

Render an existing EAN identifier

Render an existing EAN identifier to produce a PNG and comparison of the supplied and encoded values. An assigned EAN and expected check digit.

Show prompt and variablesHide prompt and variables
Render [INPUT] using --format ean13 and --output in a new directory. Compare the decoded digits with the approved product identifier, including its check digit. Flag any correction rather than silently accepting it.

Replace these variables

[INPUT]
An assigned EAN and expected check digit.
03

Check an identifier before export

Check an identifier before export to produce encoded text or a validation error; no image without --output. A candidate value and barcode format.

Show prompt and variablesHide prompt and variables
Check [INPUT] with the reviewed script without --output. Record its encoded value or error. Explain unsupported options, including --width and --height, and do not claim that an image was saved.

Replace these variables

[INPUT]
A candidate value and barcode format.
06

Worked example: Create a readable label for a ceramic mug

Cedar & Cart Demo needed a Code128 image for SKU CCT-MUG-BLUE-001. The input was a fictional product code, with no customer data.

Steps and prompt

  1. Prepare the attached business materials, preserving amounts, units, dates and metric definitions.
  2. We need warehouse labels for the three SKUs in the supplied catalog. Create one Code128 PNG per SKU with a readable label and adequate quiet zones. Decode every generated image and check that its value exactly matches the catalog. Deliver the three label images and a short matching report so the warehouse team can print a sample sheet.
  3. Submit the exact prompt below. Read the primary deliverable on the right and download all deliverables for the team handoff.

Case input files: business-inputs.zip

Use the barcode-generator Skill.

We need warehouse labels for the three SKUs in the supplied catalog. Create one Code128 PNG per SKU with a readable label and adequate quiet zones. Decode every generated image and check that its value exactly matches the catalog. Deliver the three label images and a short matching report so the warehouse team can print a sample sheet.

The attached business materials are:
- inputs/catalog.csv

Deliver a complete result.md report that the operations team can read, plus any finished files needed for this task. Keep supporting calculations and evidence with the deliverables. Write the report in English; use the requested target language for customer-facing copy. The business datasets are fictional examples unless the brief explicitly names a live public website.

What the run produced

The primary file produced by this prompt is shown below in its original language.

Create a readable label for a ceramic mug

Merchant business data is synthetic. Website observations, when present, come from the public URLs listed in the report.

07

What the output does—and what needs review

Review these limits before using generated files or estimates in your store.

Batching and dimensions

The script produces individual PNGs; batch export and resizing require helper code.

GS1 registration

Generating a barcode does not allocate or register a GS1 identifier.

Physical print checks

Check the decoded value and a physical print before using labels in fulfillment.

Frequently asked questions

Choose a barcode format, prepare spreadsheet batches and diagnose printing or identifier problems before using labels in your store.

Which barcode should I use for SKUs: Code128, EAN-13 or UPC-A?

For an internal SKU such as CCT-MUG-BLUE-001, start with Code128: the tested script preserves that combination of letters, digits and hyphens. If a retail partner requires a GTIN, use the assigned product number and the barcode format they accept; EAN-13 and UPC-A serve a different identification workflow from an internal SKU.

Keep a mapping between the encoded value and the product variant in your inventory system. A readable image alone does not make the scanner retrieve the correct item. Generate one sample, decode it and scan it into the software that staff actually use before preparing the full catalog.

Can I generate barcodes in bulk from Excel or a CSV file?

Yes, with a separate helper around the supplied single-image script. The original command does not provide an Excel importer, batch queue or ZIP export. In our merchant case, the assistant added a helper, generated three SKU images, packaged them and independently decoded every archived image.

Prepare a sheet with one SKU per row and store identifier columns as text so leading zeros survive export. Ask the assistant to report blank rows, duplicates and invalid identifiers, generate separate filenames, and include a CSV mapping each input to its output. Test a small sample first; this case does not establish a maximum batch size or production throughput.

Does generating a UPC or EAN image register a retail product number?

No. Barcode Generator renders an identifier; it does not allocate a GS1 number or register your business or product with a retailer. If the product already has an assigned identifier, use that exact value. If it needs a new identifier, resolve that requirement with the relevant GS1 organization or selling channel before making the image.

For a store's own pick-and-pack labels, an internal SKU may be enough. For retail distribution, first confirm the partner's identifier, label and variant requirements. Do not replace an existing product identifier merely because a newly generated barcode looks correct.

Why does a barcode PNG decode on screen but fail after printing?

Separate an encoding problem from a printing problem. First decode the saved PNG and compare it with the SKU. If that matches, check whether printing changed the image proportions, clipped the blank margins or made the bars too narrow for the printer. Also inspect contrast, smudging, folds and the scanner's enabled formats.

The reviewed script does not expose a label-paper layout or a 400×100 sizing control. Use label software or an explicitly added helper for that work, and print a small sample at the intended physical size. Our test confirms digital decoding; it does not certify a printer, stock material or scanner combination.

Why can the generated EAN or Code39 value differ from my input?

The underlying library applies format-specific rules. In our tests, EAN could recalculate the final check digit, while Code39 could append a checksum. A successful command therefore does not prove that the encoded identifier is the exact identifier you intended to use.

Compare three values: the approved product number, the submitted text and the independently decoded image. If they differ, stop that item's export and identify whether the source number, selected format or checksum setting is responsible. Keep the expected value in the output report. Do not silently overwrite the product master with the library's corrected value.

Can this Skill export SVG, PDF sheets or printer-ready label files?

The reviewed script saves PNG images through its ImageWriter path. It does not include a native SVG switch, PDF sheet builder or printer-language exporter. If you need any of those formats, ask for a separate conversion or label-layout step and keep that added work distinguishable from the original Skill.

Choose the output from the printing workflow backwards: specify the label stock, physical dimensions, printer resolution, text placement and number of copies. Check that the resulting layout preserves readable bars and margins. For routine warehouse printing, putting the generated identifier into your existing label software is often simpler than building a print system around this script.

No reviews yet.

Leave a review

Rate every dimension, then share your real experience.

Task effectiveness
Setup and ease of use
Reliability and guardrails
Documentation clarity
Time to first useful result

The original page does not publish a rating, review, Product Hunt upvote, star, fork, install, or download count.