fix(skills): reject invalid listing prices#472
Conversation
Greptile SummaryThis PR adds input validation to
Confidence Score: 5/5Safe to merge — the validation logic is correct, file writes are guarded, and the parsed value is consistently reused. The change is narrowly scoped to input validation in a single CLI action handler. Both guard conditions ( No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["sh1pt skills new --price <value>"] --> B["parseListingPrice(value)"]
B --> C{"^\\d+$ test\non value.trim()"}
C -- fail --> D["throw: --price must be a\nnon-negative integer sat amount"]
C -- pass --> E["Number.parseInt(normalized, 10)"]
E --> F{"Number.isSafeInteger(price)?"}
F -- false --> G["throw: --price must be ≤ Number.MAX_SAFE_INTEGER"]
F -- true --> H["return price"]
H --> I["Build manifest + marketplace commands using price"]
I --> J["Write sh1pt.skill.json"]
Reviews (2): Last reviewed commit: "test(skills): cover unsafe price values" | Re-trigger Greptile |
Fixes #457.
sh1pt skills new --pricenow validates listing prices before the manifest is written:0or25sh1pt.skill.jsonand generated marketplace commands so they cannot divergeVerification: the change is limited to the CLI command and its Vitest coverage. I could not run the repo test suite in this projectless workspace because the full sh1pt dependency checkout is not present here.