agentleFS
MicrosoftKnown publishermicrosoft/new-copilot-studio-tech-guide/sample/archive/store-solution/skills/membership-card-pdf/SKILL.md

membership-card-pdf

Skill21 starsChanged 5 months agoMITView on GitHub

Generate a printable BlastPass membership card as a PDF. Use when an associate or member asks to print, reprint, or replace a BlastPass membership card. The skill takes the member details returned by the Membership MCP (get_membership) and generates and runs a short Python (reportlab) snippet that renders a CR80-sized membership card to a real PDF file. It only renders the card from already-retrieved values — it never looks anything up or invents data.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    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. Very specific:

    Never invent a member, tier, or serial number — every value on the card comes from the get_membership result.

    line 13
  2. Very specific:

    Use this skill when the associate asks to print / reprint / replace a BlastPass membership card for a known member.

    line 19
  3. Very specific:

    Call get_membership with the mega-blast-customer-id (e.g.

    line 49
  4. Distinctive:

    All data is mock; the card is for demo purposes only.

    line 190

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill 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
SKILL.md

BlastPass Membership Card PDF Generator

This skill produces a printable BlastPass membership card — the simplest file-generation flow in the demo. You take the member record you already pulled from the Membership MCP (get_membership), then generate and run a short Python snippet that renders a styled card to a PDF using reportlab.

Never invent a member, tier, or serial number — every value on the card comes from the get_membership result. This skill only draws the card; it does not decide anything.

When to use

Use this skill when the associate asks to print / reprint / replace a BlastPass membership card for a known member. The only prerequisite is a single get_membership(customer_id) call on the Membership MCP. There is no policy lookup, no calculation, and no other agent involved — that is what makes this the entry-level scenario.

Inputs (all from the Membership MCP get_membership result)

Card fieldSource field
member_namemember_name
member_idcustomer_id
tiertier
tier_codetier_code (plus | extra | mega) — drives the accent color & perks
console_serialconsole_serial
member_sinceactivation_date
valid_throughterm_end_date
statusstatus

The tier_code selects the card's accent color, header badge, and the perks line printed beneath the card:

  • plus → blue, "PLUS", 5% off + 10 BlastPoints/$1
  • extra → purple, "PLUS EXTRA", 10% off + 20% BlastPoints bonus
  • mega → orange, "MEGA!!!", 15% off + 50% BlastPoints + day-one exclusives

Workflow

1. Pull the member record

Call get_membership with the mega-blast-customer-id (e.g. MEGA-BLAST-2048). Map its fields into the card dict below. Do not add fields the MCP didn't return.

2. Generate and run this Python to render the PDF

Fill the card dict with the confirmed values and run the snippet. It writes blastpass_card.pdf to the working directory; report that path back to the associate.

from reportlab.lib.pagesizes import LETTER
from reportlab.lib.units import inch
from reportlab.lib import colors
from reportlab.pdfgen import canvas

# --- confirmed values (filled from the Membership MCP get_membership call) ---
card = {
    "member_name": "Sam Sparkle",
    "member_id": "MEGA-BLAST-2048",
    "tier": "BlastPass Plus Extra MEGA!!!",
    "tier_code": "mega",            # plus | extra | mega
    "console_serial": "OMEGA-9B1C-2048",
    "member_since": "2026-05-30",   # activation_date
    "valid_through": "2027-05-30",  # term_end_date
    "status": "active",
}

# Tier styling: accent color, a short badge for the header, and the perks blurb.
TIERS = {
    "plus":  ("#3aa0ff", "PLUS",
              "Free 2-day shipping  |  5% off accessories  |  10 BlastPoints / $1"),
    "extra": ("#9b51e0", "PLUS EXTRA",
              "Free next-day shipping  |  10% off accessories  |  +20% BlastPoints bonus"),
    "mega":  ("#ff7a18", "MEGA!!!",
              "Same-day delivery  |  15% off everything  |  +50% BlastPoints  |  Day-one exclusives"),
}
accent_hex, tier_badge, perks = TIERS.get(card["tier_code"], TIERS["plus"])
accent = colors.HexColor(accent_hex)
ink = colors.HexColor("#1b1030")

# Card geometry: a standard CR80 card (3.375 x 2.125 in) centered on the page.
PAGE_W, PAGE_H = LETTER
CARD_W, CARD_H = 3.375 * inch, 2.125 * inch
x0 = (PAGE_W - CARD_W) / 2
y0 = (PAGE_H - CARD_H) / 2

c = canvas.Canvas("blastpass_card.pdf", pagesize=LETTER)

# Cut guide
c.setStrokeColor(colors.HexColor("#cccccc"))
c.setDash(2, 2)
c.rect(x0 - 6, y0 - 6, CARD_W + 12, CARD_H + 12)
c.setDash()

# Card body
c.setFillColor(ink)
c.roundRect(x0, y0, CARD_W, CARD_H, 10, stroke=0, fill=1)
# Accent header band
c.setFillColor(accent)
c.roundRect(x0, y0 + CARD_H - 0.55 * inch, CARD_W, 0.55 * inch, 10, stroke=0, fill=1)
c.rect(x0, y0 + CARD_H - 0.55 * inch, CARD_W, 0.18 * inch, stroke=0, fill=1)  # square the bottom of the band

# Brand + tier badge
c.setFillColor(colors.white)
c.setFont("Helvetica-Bold", 14)
c.drawString(x0 + 0.22 * inch, y0 + CARD_H - 0.37 * inch, "BlastBox Omega")
# Tier badge pill on the right of the header band
c.setFont("Helvetica-Bold", 8)
badge_w = c.stringWidth(tier_badge, "Helvetica-Bold", 8) + 0.18 * inch
bx_badge = x0 + CARD_W - 0.22 * inch - badge_w
c.setFillColor(colors.Color(1, 1, 1, alpha=0.22))
c.roundRect(bx_badge, y0 + CARD_H - 0.42 * inch, badge_w, 0.20 * inch, 4, stroke=0, fill=1)
c.setFillColor(colors.white)
c.drawCentredString(bx_badge + badge_w / 2, y0 + CARD_H - 0.36 * inch, tier_badge)

# Member name
c.setFillColor(colors.white)
c.setFont("Helvetica-Bold", 13)
c.drawString(x0 + 0.22 * inch, y0 + CARD_H - 0.85 * inch, card["member_name"])

# Member id (mono, spaced)
c.setFillColor(accent)
c.setFont("Courier-Bold", 12)
c.drawString(x0 + 0.22 * inch, y0 + CARD_H - 1.08 * inch, card["member_id"])

# Detail rows
details = [
    ("MEMBER SINCE", card["member_since"]),
    ("VALID THROUGH", card["valid_through"]),
    ("CONSOLE S/N", card["console_serial"]),
]
dy = y0 + CARD_H - 1.30 * inch
for label, val in details:
    c.setFillColor(colors.HexColor("#9d90bd"))
    c.setFont("Helvetica", 6)
    c.drawString(x0 + 0.22 * inch, dy, label)
    c.setFillColor(colors.white)
    c.setFont("Helvetica-Bold", 8)
    c.drawString(x0 + 1.05 * inch, dy, str(val))
    dy -= 0.17 * inch

# Faux barcode strip (deterministic from the member id)
bx = x0 + 0.22 * inch
by = y0 + 0.13 * inch
c.setFillColor(colors.white)
import hashlib
seed = int(hashlib.md5(card["member_id"].encode()).hexdigest(), 16)
w = 0.0
i = 0
while w < CARD_W - 0.44 * inch:
    bar = 0.012 * inch + ((seed >> (i % 32)) & 0x3) * 0.006 * inch
    if i % 2 == 0:
        c.rect(bx + w, by, bar, 0.13 * inch, stroke=0, fill=1)
    w += bar
    i += 1

# Perks footer (printed under the card, not on it)
c.setFillColor(colors.HexColor("#555555"))
c.setFont("Helvetica-Oblique", 8)
c.drawCentredString(PAGE_W / 2, y0 - 0.45 * inch, perks)
c.setFont("Helvetica", 7)
c.drawCentredString(PAGE_W / 2, y0 - 0.62 * inch,
                    "Present this card in-store or scan at checkout. Lost cards can be reprinted at any BlastBox desk.")

c.showPage()
c.save()
print("WROTE blastpass_card.pdf")

3. Hand back the file

Tell the associate the card was generated (blastpass_card.pdf) and read back the member name, tier, and member ID so they can confirm it before handing it over.

Notes

  • The reference renderer lives next to this file as card_pdf.py and is validated against the four mock members in the Membership MCP.
  • The barcode is decorative (deterministic from the member ID) — it is not a real scannable symbology.
  • All data is mock; the card is for demo purposes only.

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.