agentleFS
genvjacobcgenvjacobc/lightspeed-x-mcp/skills/writes/SKILL.md

writes

Skill0 starsChanged 3 months agoMITView on GitHub

How to change data in Lightspeed X safely through this plugin. Use whenever the user asks to create, update, delete, tag, retag, archive, price, transfer, receive, adjust, issue, redeem, void or otherwise change anything in their Lightspeed account, e.g. "tag these pouches", "archive the 6-pack promo", "create a transfer from the DC to West Omaha", "receive PO 1234", "fix the price on this SKU", "add this customer to the wholesale group", "undo that change", or "why can't you write to Lightspeed".

  • Reads credentials

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Every write here is two steps, and only the second one changes anything.

    line 8
  2. Very specific:

    Preview: Call the purpose-built write tool.

    line 10
  3. Very specific:

    Apply: After the user has seen the preview and said yes, call lightspeed_apply_write with that plan_id and the confirm phrase copied …

    line 13
  4. Distinctive:

    One plan, one yes: If the user changes anything about the request, run the preview again.

    line 23
  5. Distinctive:

    Relay warnings and UNVERIFIED labels: If the preview says an endpoint is unverified, or that a step cannot be undone, say so plainly before …

    line 28
  6. Distinctive:

    If the user declines, stop: Do not retry with a different tool, the raw write tool, or a smaller batch to get around a no.

    line 31

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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

Changing data in Lightspeed X

Every write here is two steps, and only the second one changes anything.

  1. Preview. Call the purpose-built write tool. It reads current state, validates, and returns a diff, the exact requests, a plan_id and a confirm phrase. Nothing is sent.
  2. Apply. After the user has seen the preview and said yes, call lightspeed_apply_write with that plan_id and the confirm phrase copied exactly. The user is asked to approve that call every time.

Rules

  • Never apply a plan the user has not seen. Show the preview's summary, warnings and request list in your reply, then stop and wait for an explicit yes. "Go ahead and fix it" before a preview exists is permission to preview, not to apply.
  • One plan, one yes. If the user changes anything about the request, run the preview again; do not apply an older plan.
  • Copy the confirm phrase exactly. It is written by the server and shown in the approval prompt so the user can see what they are approving. Never paraphrase it or build one yourself.
  • Relay warnings and UNVERIFIED labels. If the preview says an endpoint is unverified, or that a step cannot be undone, say so plainly before asking for a yes. After an unverified write, tell the user to check the back office.
  • If the user declines, stop. Do not retry with a different tool, the raw write tool, or a smaller batch to get around a no.
  • Prefer the specific tool over lightspeed_api_write. The raw tool validates nothing, records no undo, and should be a last resort the user understands.

Pick the tool

They want to...Tool
Add/remove tags on productslightspeed_update_product_tags (merges by name, creates missing tags)
Change a product's name, price, brand, category, active flaglightspeed_update_product
Create a product or variant familylightspeed_create_product
Stop selling somethinglightspeed_update_product with is_active: false (prefer over delete)
Create or edit a promotionlightspeed_upsert_promotion
Retire a promotionlightspeed_archive_promotion (there is no promotion delete)
Brands, suppliers, tags, categories, price books, webhookslightspeed_manage_*
Move stock between storeslightspeed_create_consignment type OUTLET, then lightspeed_advance_consignment SENT, then RECEIVED at the destination
Raise a purchase orderlightspeed_create_consignment type SUPPLIER
Receive a deliverylightspeed_advance_consignment RECEIVED with received counts, or receive_all
Write off damage/theft, add found stocklightspeed_adjust_stock (quantity is a delta, sign must match the reason)
Recount a storelightspeed_create_consignment type STOCKTAKE
Reorder ruleslightspeed_set_reorder_points
Customers and groupslightspeed_upsert_customer, lightspeed_customer_group_members
Store credit, gift cards, loyalty, returns, voids, registershigh-risk tools; see below
Undo something applied earlierlightspeed_revert_write with the old plan_id, then apply
See what is enabled, pending, or recently changedlightspeed_write_status

When a write is refused

  • "Writes are not enabled for account X." Writes are off for that account. Tell the user it is controlled by LIGHTSPEED_WRITE_ACCOUNTS in their credentials file (${CLAUDE_PLUGIN_DATA}/credentials.env on a plugin install). Do not edit that file unless they ask you to, and say a restart of the session is needed for it to take effect.
  • "High-risk write." Sales, registers, store credit, gift cards and loyalty also need LIGHTSPEED_WRITE_HIGH_RISK=true. Explain that these move money or guest balances before suggesting they turn it on.
  • No write tools at all. The server is read-only because no write account is configured. Same fix as the first point.
  • "No pending plan." The plan expired (15 minutes), was used, or the session restarted. Run the preview again.
  • "The record changed in Lightspeed after the preview." Someone edited it in the meantime. Preview again and show the new diff.

Domain facts that trip people up

  • There is no "set on-hand to N". Use an adjustment (delta) or a stocktake.
  • Tags, name, description, brand and category belong to the whole variant family; price and active flag belong to one variant.
  • Promotion times are store-local. Includes are AND-ed: brand + category narrows. To cover a family minus one flavor, include the family and exclude the variant. Name max 30 characters, description max 70.
  • A received consignment is permanent and stock appears after a background job that can take a few minutes.
  • A void can never be reversed. For a completed sale, a return is usually right, and the return tool only parks it for staff to finish at the register.

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.