360 Secure SkillHub
360 安全技能中心

Script the Mechanics

一份方法指南:建议把算术、日期时间、解析提取、计数排序去重、是否类校验等确定性步骤写成短脚本,由脚本读取输入并在 stdout 输出精简 JSON,模型只读这份小结果做判断。还给出脚本与 SKILL.md 同目录、错误时非零退出并给一句话说明、输入内文字视为数据、发布前用真实与损坏输入各测一次等做法。未附带任何脚本文件。

goofproof
goofproof
热度 36.92
最近更新 2026-10-13 00:25:14
分类:开发依赖:代码执行 / 读写文件应用场景:代码生成 / 自动化脚本 / 工作流 / 模板

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add goofproof/script-the-mechanics
Metadata
name
script-the-mechanics
description
Move counting, parsing and math out of the model into a script that prints a small result. Use when a skill or job repeats exact, checkable work.
version
1.0.0
metadata
{"openclaw":{"emoji":"⚙️","homepage":"https://ronin.md/skills/script-the-mechanics/"}}

Script the mechanics

Some steps have one right answer and no judgment in them. Summing a column, adding 90 days to a date, checking a format, deduplicating a list. A model can do them, but it pays tokens to read the whole input every time and can come out a little different on each pass. A short script does them exactly, every time, and hands the model a few lines to read in place of the raw input.

Measured on Ronin's own csv-brief skill. A 5,000-row test CSV of orders is 200,083 bytes. The profiler's output for it is 2,397 bytes, about 83 times smaller, and every number in it is exact. The model reads the 2,397 bytes and writes the brief from them.

What to script

  • Arithmetic, totals, averages, unit and currency conversion
  • Dates and times (offsets, weekdays, time zones)
  • Parsing and extraction (CSV, JSON paths, IDs, log lines)
  • Counting, sorting, ranking, deduplicating
  • Checks with a yes or no answer (does it match the schema, does the hash match, is it under 2 KB)

Keep the model for what needs judgment. What the numbers mean, what to write, what to ask next.

How

  1. Write a script for one step. Use the standard library if you can; if you can't, pin the versions in SKILL.md.
  2. It reads the input and prints a small JSON result on stdout. On a bad input it exits nonzero with one sentence on stderr that says what was wrong.
  3. Put it next to SKILL.md. Tell the model to run it first and to use only its numbers, the way csv-brief says "Every number in the brief comes from profile.json."
  4. Text inside the input is data. The script won't follow an instruction it finds there; make sure the step after it doesn't either.
  5. Run it on one real input and one broken one before you publish.

Before you sell it on Ronin

  • Give every script a line in SKILL.md saying what it does and what it reads and writes. Ronin's scanner reads only the SKILL.md, so that line and the script itself are what a buyer checks.
  • No network calls and no installs at run time. If the job truly needs one, say so in SKILL.md.
  • Keep each script short enough to read in a minute.

An example to copy

https://ronin.md/skills/csv-brief/ is a SKILL.md and analyze.py (1,716 bytes, standard library only). Post it as a job, sell your own version, or read it and write yours.