Index of every page on this site: llms.txt
All skills
steelan9199 avatar

/suffix-to-json-yashu

@9e01957
Run it yourself

本技能将多行后缀文本文件转换为 JSON 的 suffix 字段,将换行转义为 并输出最小 JSON 对象。激活条件:用户消息须包含以下关键词之一:`后缀转JSON`、`转成suffix`、`多行后缀转JSON`、`文件转JSON suffix`。

  • 2 files
  • 3.5 KB
  • Updated 3 months ago
  • GitHub
Use this Skill: https://skilld.dev/gh/steelan9199/wechat-publisher/suffix-to-json-yashu

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈72 tokens for metadata: the name and description. ≈479 when used: this file.

Description uses 1.9% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈149 characters, or 1.9%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

后缀转 JSON

概述

把用户给的「后缀文本文件」转成可直接粘贴进配置的 JSON。文件内容整体就是后缀, 技能读取后将其中的换行转义为 \n、双引号与反斜杠自动转义、行首缩进原样保留, 最后输出最小的 {"suffix": "..."} JSON 到对话里,由用户自行复制使用。

工作流程

  1. 接收文件路径。 从用户消息中取得后缀文本文件的绝对或相对路径。若用户未明确给出路径,先询问路径,不要猜测。
  2. 执行转换脚本。 用 Node.js 运行本技能附带的脚本,传入文件路径:
    node SKILL_DIR/scripts/suffix_to_json.js "FILE_PATH"
    脚本负责确定性地读取文件、转义换行与特殊字符,并输出 {"suffix": "..."}。
  3. 回显 JSON。 将脚本输出的 JSON 直接展示在对话中。不要自行改写转义结果, 也不要把 JSON 写入任何文件(除非用户后续明确要求存盘)。
  4. 处理异常。 若脚本报「找不到文件」,提示用户核对路径后重试; 若文件为空,说明生成的 suffix 为空字符串并照常输出。

示例

输入文件 suffix.txt 内容:

## 写本文用到的
- 工具: WorkBuddy
- Skill
  - 本地markdown发布到公众号 https://github.com/steelan9199/wechat-publisher/tree/main/skills/wechat-publisher-yashu
  - 生成常见图表 流程图等 https://github.com/steelan9199/wechat-publisher/tree/main/skills/svg-diagram-yashu

运行脚本后输出:

{
  "suffix": "## 写本文用到的\n- 工具: WorkBuddy\n- Skill\n  - 本地markdown发布到公众号 https://github.com/steelan9199/wechat-publisher/tree/main/skills/wechat-publisher-yashu\n  - 生成常见图表 流程图等 https://github.com/steelan9199/wechat-publisher/tree/main/skills/svg-diagram-yashu"
}

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No third-party reports yet.

Signed by skilld at 9e01957. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 3 weeks ago.

Activeupdated 3 months ago
agent_created
true

README badge

README badge for steelan9199/wechat-publisher/suffix-to-json-yashu