Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add natthasath/natthasath-marketplace --skill refactor-cligit clone --depth 1 https://github.com/natthasath/natthasath-marketplaceWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/natthasath/natthasath-marketplace/refactor-cli)<a href="https://agentmods.dev/skills/natthasath/natthasath-marketplace/refactor-cli"><img src="https://agentmods.dev/badge/skills/natthasath/natthasath-marketplace/refactor-cli/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/natthasath/natthasath-marketplace/refactor-cli"><img src="https://agentmods.dev/badge/skills/natthasath/natthasath-marketplace/refactor-cli.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00165 | $0.02168 |
| Opus 5.5 | $0.00066 | $0.00867 |
| Sonnet 5.5 | $0.00033 | $0.00434 |
| Haiku 4.5 | $0.00016 | $0.00217 |
Grade A, and why
refactor-cli scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 15d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 113 lines — stays where its author put it; the contents beside it link to each section on GitHub.
CLI Structure Refactorer
คุณทำหน้าที่ตรวจสอบและรีแฟกเตอร์ "โครงสร้าง command" ของ CLI tool ให้เป็นไปตามมาตรฐานการออกแบบ CLI ที่ดี —
ไม่ใช่แค่ปรับข้อความ --help แต่แก้โครงสร้างจริงของ command hierarchy, safety model, session/state,
input/output contract ฯลฯ ให้สม่ำเสมอ คาดเดาได้ และปลอดภัย
CLI ที่ดีคือ CLI ที่ผู้ใช้เดา behavior ได้ก่อนรัน — flag อันตรายชื่อต้องดูอันตราย, exit code ต้องมีความหมาย สม่ำเสมอ, และ pattern ต้องเหมือนกันทั้งเครื่องมือ ไม่ใช่แต่ละ subcommand ออกแบบเอาเอง
Core Rules (Non-negotiable)
- ต้องตรวจภาษา/framework ของ CLI ก่อนแตะโค้ดบรรทัดแรกเสมอ — อ่าน
references/language-detection.mdก่อน เพราะวิธีแก้ (เช่น "Dry Run flag" หน้าตาใน Rust clap กับ Python argparse ไม่เหมือนกัน) ขึ้นกับ ภาษา/framework ที่ใช้จริง ไม่ใช่เดาจาก pattern ทั่วไป - แก้ไฟล์ตรงๆ ในโปรเจกต์ ไม่ต้องตอบเป็น Artifact
- ห้ามทำ breaking change แบบเงียบๆ — ถ้าจะเปลี่ยนชื่อ flag/subcommand ที่มีอยู่แล้ว (ผู้ใช้เดิมพิมพ์อยู่) ต้องอธิบายเหตุผลและถามก่อนเสมอ ไม่ใช่เปลี่ยนแล้วค่อยบอกทีหลัง
- ห้ามแก้โค้ดแล้วปล่อยเอกสารไม่ตรงของจริง — README.md ของโปรเจกต์, shell completion script, CHANGELOG ต้อง sync กับโครงสร้างใหม่เสมอ
--helpของทุก command ที่แก้ต้อง render ตรงตามreferences/help-text-format.mdเป็นภาษาอังกฤษเสมอ- ถ้า tool ไม่มี source code ให้แก้ (เช่น เป็น binary ที่ติดตั้งจากคนอื่น) ห้ามพยายามแก้ไบนารี — สลับเป็นโหมด audit-only แทน (ดู Edge cases)
Workflow
1. อ่าน reference ที่เกี่ยวข้องก่อนเริ่ม
ก่อนแก้อะไร ให้อ่านไฟล์ที่เกี่ยวข้องก่อนเสมอ (รายละเอียดเต็มอยู่ใน Supporting files ด้านล่าง) โดยเฉพาะ
references/language-detection.md เพื่อตรวจภาษา/framework ก่อนเป็นอันดับแรก
2. ตรวจภาษาก่อนเสมอ
อ่าน references/language-detection.md แล้วยืนยันว่า CLI นี้เขียนด้วยภาษาอะไร ก่อนแตะโค้ดบรรทัดแรก
เพราะวิธีแก้ขึ้นกับภาษา/framework ที่ใช้จริง
3. สำรวจโครงสร้างปัจจุบันจริง
รัน <tool> --help และ subcommand help ที่สำคัญ (ไม่ใช่เดาจากโค้ดอย่างเดียว) เพื่อดูว่าตอนนี้ผู้ใช้เห็น
อะไรจริงๆ
4. จัดประเภท tool ก่อนเช็ค checklist
ตอบคำถามเหล่านี้เพื่อรู้ว่า reference กลุ่มไหนเกี่ยวข้องบ้าง (ไม่ต้องไล่เช็คทุกหมวดกับทุก tool):
- มี side effect (เขียน/ลบ/รันคำสั่ง) หรือ read-only? → เกี่ยวกับ
safety-and-trust.md - มี session/state ข้ามการเรียกใช้ไหม? → เกี่ยวกับ session/state ใน
interaction-and-automation.md - จัดการ "ทรัพยากร" ที่มีชื่อ/ตัวตนไหม (server, plugin, user)? → เกี่ยวกับ
resource-and-crud.md - ต้องรันใน script/CI ได้ไหม? → เกี่ยวกับ automation/output design ใน
io-contract.md - แจกจ่ายผ่าน package manager หลายตัวไหม? → เกี่ยวกับ
lifecycle-and-distribution.md
What ships with it
9 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- references/config-and-observability.md 4.1 KB
- references/help-text-format.md 7.9 KB
- references/identity-and-structure.md 4.4 KB
- references/interaction-and-automation.md 3.9 KB
- references/io-contract.md 5.5 KB
- references/language-detection.md 4.9 KB
- references/lifecycle-and-distribution.md 5.2 KB
- references/resource-and-crud.md 3.4 KB
- references/safety-and-trust.md 5.1 KB
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 15d ago Changed · +25 lines 96e0177e19be
- 1mo ago First seen · 88 lines · 165 tokens per session scan A 371144bff39d
refactor-cli is a skill published in the GitHub repository natthasath/natthasath-marketplace (1 stars, last pushed 10d ago), licensed MIT. It adds 165 tokens to every session and 2,168 once invoked, about $0.0007 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-09.
Other skills, from other repositories
cpp-pro
Writes, optimizes, and debugs C++ applications using modern C++20/23 features, template metaprogramming, and high-performance systems techniques. Use when building or refactoring C++ code requiring concepts, ranges, coroutines, SIMD optimization, or careful memory management — or when addressing performance…
shiny-py-optimize
Diagnose and fix performance problems in Shiny for Python apps — slow startup, sluggish interactions, blocking operations, and apps that struggle beyond a handful of concurrent users. Use when a Shiny for Python app is slow, hangs, recomputes too much, times out, or must support more users; when the user asks to…
phx-investigate
Investigate Elixir/Phoenix bugs root-cause first. Reproduce failures, cite evidence, and use optional Amp subagents only when useful.
phx-trace
Use when debugging how a value or request reaches Elixir code, finding who calls a function, or planning a signature change. Builds the call tree with mix xref callers instead of reading files one by one.
operating-cadence
Designs the rhythm an organization runs on — which reviews happen weekly, monthly and quarterly, what each one decides, who owns the numbers presented, and how a signal at the front line reaches the people who can act on it. Use this to set up a management operating system, fix a meeting calendar that produces no…
regex-debugger
Debug regex patterns with visual breakdowns, plain English explanations, test case generation, and flavor conversion. Use when user needs help with regular expressions or pattern matching.