agentleFS
Alan-ChaAlan-Cha/silhouette-card-maker/AGENTS.md

silhouette-card-maker

AGENTS.md223 starsChanged 34 days agoMITView on GitHub

This file provides context for AI coding assistants working on this project. Silhouette Card Maker is a collection of tools and cutting templates for utilizing Silhouette cutting machines to cut cards. Users can create DIY card games or proxies for various trading card games (TCGs). The project consists of: - Python scripts for PDF generation and offset calibration - Silhouette Studio cutting templates - Plugins for fetching card images from various TCG databases - A Hugo documentation site IMPORTANT: The…

  • Installs packages
  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.

    Of the AGENTS.md files we read, the 31,439 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

The file

We split this AGENTS.md into the rules it gives an agent

6 rules. About 0 are common, 3 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When documentation changes are made, similar changes need to be made in both locations:

    line 52
  2. Distinctive:

    Run by end users as part of the normal card-making workflow.

    line 67
  3. Distinctive:

    Run by maintainers to regenerate project artifacts.

    line 77
  4. Very specific:

    Place test card images in game/front/

    line 181
  5. Very specific:

    Run python create_pdf.py with desired options

    line 182
  6. Very specific:

    Check output at game/output/game.pdf

    line 183

≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

AGENTS.md

This file provides context for AI coding assistants working on this project.

Project Overview

Silhouette Card Maker is a collection of tools and cutting templates for utilizing Silhouette cutting machines to cut cards. Users can create DIY card games or proxies for various trading card games (TCGs).

The project consists of:

  • Python scripts for PDF generation and offset calibration
  • Silhouette Studio cutting templates
  • Plugins for fetching card images from various TCG databases
  • A Hugo documentation site

Directory Structure

silhouette-card-maker/
├── create_pdf.py          # Main script for laying out cards in a PDF
├── offset_pdf.py          # Script for adding offset to PDFs (printer calibration)
├── requirements.txt       # Python dependencies
├── cutting_templates/     # Silhouette Studio cutting templates (.studio3 files)
├── calibration/           # Offset calibration sheets for printer alignment
├── examples/              # Sample card games
├── game/                  # Working directory for card images
│   ├── front/             # Card front images
│   ├── back/              # Card back images
│   ├── double_sided/      # Back images for double-sided cards
│   ├── decklist/          # Decklist files for plugins
│   └── output/            # Generated PDFs
├── plugins/               # Card image acquisition scripts
│   ├── mtg/               # Magic: The Gathering
│   ├── yugioh/            # Yu-Gi-Oh!
│   ├── pokemon/           # Pokemon TCG
│   ├── lorcana/           # Disney Lorcana
│   ├── digimon/           # Digimon
│   ├── one_piece/         # One Piece TCG
│   ├── flesh_and_blood/   # Flesh and Blood
│   ├── star_wars_unlimited/ # Star Wars: Unlimited
│   └── ...                # Other TCG plugins
├── hugo/                  # Hugo documentation site
│   ├── content/           # Markdown content
│   ├── static/            # Static assets (images)
│   └── themes/hextra/     # Hugo theme (submodule)
└── README.md              # Main documentation

Documentation Sync Requirement

IMPORTANT: The README.md and Hugo site documentation are closely aligned and must be kept in sync.

When documentation changes are made, similar changes need to be made in both locations:

README.md SectionHugo Content Location
Root README.mdhugo/content/_index.md
create_pdf.py docshugo/content/docs/create.md
offset_pdf.py docshugo/content/docs/offset.md
plugins/<game>/README.mdhugo/content/plugins/<game>.md

The Hugo site is deployed to: https://alan-cha.github.io/silhouette-card-maker

Script Reference

User-facing scripts

Run by end users as part of the normal card-making workflow.

ScriptPurpose
create_pdf.pyLay out card images into a print-ready PDF with registration marks
offset_pdf.pyAdd x/y/angle offset to a PDF to compensate for printer front/back misalignment
clean_up.pyDelete all images from game/front/ and game/double_sided/ to start fresh

Developer/maintainer tools

Run by maintainers to regenerate project artifacts. Not needed for normal card-making use.

ScriptPurpose
generate_calibration.pyGenerate calibration PDFs for all paper sizes
generate_dxf.pyGenerate DXF cutting templates from assets/layouts.json
dxf_to_studio3.pyConvert DXF files to Silhouette Studio .studio3 format; subcommands: convert (single file), batch (all DXFs), calibrate (record UI coordinates)
generate_readme_tables.pyRegenerate the card/paper size tables in README.md and Hugo docs

Internal modules

Imported by other scripts. Not intended to be run directly.

ModulePurpose
utilities.pyShared data loading: LayoutConfig, load_layout_config, template_name, etc.
enums.pyShared enums: Orientation
size_convert.pyUnit conversion utilities (pixels, mm, inches)
page_manager.pyCard layout and page geometry calculations
dxf_manager.pyDXF file generation utilities

Key Script Details

create_pdf.py

Creates PDFs with card layouts and registration marks for cutting. Supports multiple card sizes (standard, japanese, poker, bridge, tarot, etc.) and paper sizes (letter, legal, tabloid, a4, a3, arch_b).

Key options:

  • --card_size / --paper_size: Card and paper dimensions
  • --extend_corners: Fix artifacts from rounded corner images
  • --crop: Crop existing print bleed from images
  • --load_offset: Apply saved printer offset
  • --skip: Skip cards near registration marks

offset_pdf.py

Adds offset to every other page in a PDF to compensate for printer front/back misalignment. Supports x/y offset and angle rotation.

Key options:

  • --x_offset / --y_offset: Pixel offset values
  • --angle: Rotational offset in degrees
  • --save: Persist offset values for future use

Plugin Structure

Each plugin follows a similar pattern:

plugins/<game>/
├── README.md           # Plugin documentation
├── fetch.py            # Main entry point CLI
├── deck_formats.py     # Decklist format parsers
└── <api>.py            # API client for card database

Plugins read decklists and download card images to game/front/ (and game/double_sided/ for double-faced cards).

Supported games include: Altered, Ashes Reborn, Bushiroad, Digimon, Echoes of Astra, Elestrals, Final Fantasy, Flesh and Blood, Grand Archive, Gundam, KeyForge, Lorcana, MTG, Netrunner, One Piece, Pokemon, Riftbound, Sorcery: Contested Realm, Star Wars: Unlimited, and Yu-Gi-Oh!

Development Setup

# Create virtual environment
python -m venv venv

# Activate (macOS/Linux)
. venv/bin/activate

# Activate (Windows PowerShell)
.\venv\Scripts\Activate.ps1

# Install dependencies
pip install -r requirements.txt

Hugo Site Development

The documentation site uses Hugo with the Hextra theme.

cd hugo
hugo server

The theme is included as a git submodule in hugo/themes/hextra/.

Supported Card Sizes

SizeDimensionsCommon Games
standard63x88mmMTG, Pokemon, Lorcana, One Piece, Digimon, Star Wars: Unlimited
standard_double126x88mmMTG oversized (Planechase, Archenemy, Commander)
japanese59x86mmYu-Gi-Oh!
poker2.5x3.5inStandard playing cards
bridge2.25x3.5inBridge cards
tarot2.75x4.75inTarot cards

Code Style Notes

  • Python scripts use Click for CLI argument parsing
  • Card images are processed with Pillow (PIL)
  • PDFs are generated using reportlab
  • Hugo content uses Hextra shortcodes (e.g., {{< youtube >}}, {{% ref %}})

Testing Workflow

  1. Place test card images in game/front/
  2. Run python create_pdf.py with desired options
  3. Check output at game/output/game.pdf
  4. For double-sided, also run python offset_pdf.py if calibration is needed

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.