home/roleplay/claude-prompt-5

Claude Prompt

GPTClaudeGemini··1,307 copies·updated 2026-07-14
claude-prompt-5.prompt
/devlyn:resolve "Add a bench-cli payout command that reads ledger events from a JSON file, applies idempotent event handling and payout rules from data/payout-rules.json, and prints exact merchant payout totals with processing fees, dispute fees, reserves, and payouts in integer cents.\n\nThe command should be `bench-cli payout --input <path>`. Input JSON is `{ \"events\": [{ \"id\": string, \"merchant_id\": string, \"type\": \"charge\" | \"refund\" | \"dispute\", \"amount_cents\": number }] }`. Use `data/payout-rules.json` for processing fee percent, fixed fee, dispute fee, reserve percent, and minimum payout threshold; changing those rules must change the result without a code change. Do not hardcode their values.\n\nEvents with the same `id` and identical JSON content are idempotent and applied only once. The same `id` with different JSON content is a conflicting duplicate and must fail before printing totals with exit `2`, no stdout, and the exact stderr object `{ \"error\": \"conflicting_duplicate\", \"id\": string }`. Merchant rows are ordered by first-seen merchant after identical duplicates are removed.\n\nFor each merchant, a `charge` increases `gross_charge_cents` and adds `Math.round(amount_cents * processing_fee_percent / 100) + fixed_fee_cents` to `processing_fee_cents`. A `refund` increases `refund_cents` and does not reverse processing fees. Each `dispute` increases `dispute_cents` and adds one configured `dispute_fee_cents`. Then compute `net_before_reserve = gross_charge_cents - refund_cents - dispute_cents - processing_fee_cents - dispute_fee_cents`; `reserve_cents` is `Math.round(net_before_reserve * reserve_percent / 100)` when that net is positive and `0` otherwise, and `payout_cents = net_before_reserve - reserve_cents`. If `0 < payout_cents < minimum_payout_cents`, keep the merchant row, add that original positive payout amount to `reserve_cents`, and set `payout_cents` to `0`.\n\nSuccessful stdout must be exactly one JSON object whose only keys are `total_payout_cents`, `total_processing_fee_cents`, `total_dispute_fee_cents`, `total_reserve_cents`, and `merchants`, with no stderr. Each merchant row has exactly `merchant_id`, `gross_charge_cents`, `refund_cents`, `dispute_cents`, `processing_fee_cents`, `dispute_fee_cents`, `reserve_cents`, and `payout_cents`. Each top-level total is the sum of its corresponding final merchant field, and every public amount is integer cents.\n\nAn unknown event type, missing `merchant_id`, missing `id`, non-positive or non-integer `amount_cents`, missing `events`, invalid JSON, or unreadable input must exit `2`, write exactly one JSON error object to stderr, and write nothing to stdout.\n\nUpdate `tests/cli.test.js` so existing tests still pass and at least two new tests cover the payout command, including one successful payout and one validation failure. Parsing and file-read failures must surface as JSON errors rather than silent catches. Do not add dependencies. Only touch `bin/cli.js` and `tests/cli.test.js`; do not touch server or web files." --pair-verify

fill the variables

This prompt has 1 variable. Pro fills them into a ready-to-paste prompt for you — no manual find-and-replace.

{\"error\": \"conflicting_duplicate\", \"id\": string}
Unlock with Pro →

when to use it

Community prompt sourced from the open-source GitHub repo fysoul17/devlyn-cli (no explicit license). A "Claude Prompt" style prompt — adapt the placeholders and specifics to your task. Imported as-is and not independently retested here, so check the output before relying on it.

tags

roleplaycommunitygeneral

source

fysoul17/devlyn-cli · no explicit license