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
- Distinctive: line 8
Every write here is two steps, and only the second one changes anything.
- Very specific: line 10
Preview: Call the purpose-built write tool.
- Very specific: line 13
Apply: After the user has seen the preview and said yes, call lightspeed_apply_write with that plan_id and the confirm phrase copied …
- Distinctive: line 23
One plan, one yes: If the user changes anything about the request, run the preview again.
- Distinctive: line 28
Relay warnings and UNVERIFIED labels: If the preview says an endpoint is unverified, or that a step cannot be undone, say so plainly before …
- Distinctive: line 31
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.
≈ “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.
Files
Changing data in Lightspeed X
Every write here is two steps, and only the second one changes anything.
- Preview. Call the purpose-built write tool. It reads current state,
validates, and returns a diff, the exact requests, a
plan_idand aconfirmphrase. Nothing is sent. - Apply. After the user has seen the preview and said yes, call
lightspeed_apply_writewith thatplan_idand theconfirmphrase 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 products | lightspeed_update_product_tags (merges by name, creates missing tags) |
| Change a product's name, price, brand, category, active flag | lightspeed_update_product |
| Create a product or variant family | lightspeed_create_product |
| Stop selling something | lightspeed_update_product with is_active: false (prefer over delete) |
| Create or edit a promotion | lightspeed_upsert_promotion |
| Retire a promotion | lightspeed_archive_promotion (there is no promotion delete) |
| Brands, suppliers, tags, categories, price books, webhooks | lightspeed_manage_* |
| Move stock between stores | lightspeed_create_consignment type OUTLET, then lightspeed_advance_consignment SENT, then RECEIVED at the destination |
| Raise a purchase order | lightspeed_create_consignment type SUPPLIER |
| Receive a delivery | lightspeed_advance_consignment RECEIVED with received counts, or receive_all |
| Write off damage/theft, add found stock | lightspeed_adjust_stock (quantity is a delta, sign must match the reason) |
| Recount a store | lightspeed_create_consignment type STOCKTAKE |
| Reorder rules | lightspeed_set_reorder_points |
| Customers and groups | lightspeed_upsert_customer, lightspeed_customer_group_members |
| Store credit, gift cards, loyalty, returns, voids, registers | high-risk tools; see below |
| Undo something applied earlier | lightspeed_revert_write with the old plan_id, then apply |
| See what is enabled, pending, or recently changed | lightspeed_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_ACCOUNTSin their credentials file (${CLAUDE_PLUGIN_DATA}/credentials.envon 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.
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
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.

