json-safe-edit

json-safe-edit is a skill for OpenCode from cruzs85/opencode-multiagente-local-37-iterations. It costs 56 tokens per session (1,050 once invoked), scanned A, original, MIT.

A set of instructions for safely editing JSON files, especially files containing long text with escaped line breaks.

In plain words
What is it for?
Use it when changing project files such as package.json, TypeScript configuration, or agent prompts stored in JSON.
Why use it?
It helps prevent broken JSON caused by manually changing quotes, backslashes, or escaped characters.

Skill for OpenCode

Written for OpenCode: installed under .opencode/. Also seen: mentions OpenCode.

Good fit Use it when changing project files such as package.json, TypeScript configuration, or agent prompts stored in JSON.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/cruzs85/opencode-multiagente-local-37-iterations/json-safe-edit
Install

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.

Any agent
npx skills add cruzs85/opencode-multiagente-local-37-iterations --skill json-safe-edit
Clone the repo
git clone --depth 1 https://github.com/cruzs85/opencode-multiagente-local-37-iterations

Made for: OpenCode.

Wrote 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.

agentmods badge for json-safe-edit

README.md
[![agentmods](https://agentmods.dev/badge/skills/cruzs85/opencode-multiagente-local-37-iterations/json-safe-edit/github.svg)](https://agentmods.dev/skills/cruzs85/opencode-multiagente-local-37-iterations/json-safe-edit)
Your own site
<a href="https://agentmods.dev/skills/cruzs85/opencode-multiagente-local-37-iterations/json-safe-edit"><img src="https://agentmods.dev/badge/skills/cruzs85/opencode-multiagente-local-37-iterations/json-safe-edit/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.

agentmods 80×15 button for json-safe-edit

Your own site · 80×15
<a href="https://agentmods.dev/skills/cruzs85/opencode-multiagente-local-37-iterations/json-safe-edit"><img src="https://agentmods.dev/badge/skills/cruzs85/opencode-multiagente-local-37-iterations/json-safe-edit.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 56 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,050 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00056 $0.01050
Opus 5.5 $0.00022 $0.00420
Sonnet 5.5 $0.00011 $0.00210
Haiku 4.5 $0.00006 $0.00105

Measured 2mo ago against content hash f229582ba064, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

json-safe-edit 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 2mo 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.

configuraciones/configuracion-13(mysql-slack)/.opencode/skills/json-safe-edit/SKILL.md · 124 lines

How it starts

The opening of the file, as written. The whole thing — 124 lines — stays where its author put it; the contents beside it link to each section on GitHub.

JSON Safe Edit Protocol

Objetivo

Evitar la corrupción de archivos JSON al editarlos, especialmente cuando contienen valores string largos de línea única (como prompts de agentes).

Cuándo usarla

Siempre que vayas a modificar un archivo .json en el proyecto, especialmente:

  • opencode.json — contiene prompts de línea única con \n escapados
  • package.json — dependencias y scripts
  • angular.json — configuración del proyecto Angular
  • tsconfig.json, tsconfig.app.json, tsconfig.spec.json — configuración TypeScript

Métodos de edición segura

Método 1: node -e programático (RECOMENDADO para modificar valores específicos)

Usa bash con node -e para parsear, modificar y serializar el JSON. Así evitas problemas con caracteres escapados.

node -e "
const fs = require('fs');
const ruta = 'archivo.json';
const doc = JSON.parse(fs.readFileSync(ruta, 'utf8'));
// Modifica las propiedades necesarias
doc.agenteX.propiedad = 'nuevo valor con \\n saltos';
fs.writeFileSync(ruta, JSON.stringify(doc, null, 2) + '\n');
console.log('✅ JSON actualizado correctamente');
"

Ventajas: No toca el formato del archivo, maneja escapes automáticamente, seguro.

Método 2: cat heredoc (RECOMENDADO para reescribir archivos completos)

Cuando necesites reemplazar el contenido COMPLETO de un archivo JSON (ej: archivos pequeños o nueva creación):

cat > archivo.json << 'EOF'
{
  "clave": "valor con \\n saltos"
}
EOF

Ventajas: Control total del contenido, ideal para archivos nuevos o pequeños.

Método 3: edit tool (SOLO para archivos con estructura multilínea y valores cortos)

Usa la herramienta edit ÚNICAMENTE cuando:

  • El archivo JSON tiene estructura multilínea (pretty-printed)
  • Los valores string son cortos (< 100 caracteres)
  • No contienen caracteres escapados complejos

⚠️ PROHIBIDO usar edit para:

  • Archivos JSON con valores string de línea única (como prompts con \n)
  • Valores que contengan caracteres escapados
  • Reemplazar contenido completo de un archivo JSON

Read the full file on GitHub · 124 lines

Changes

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.

  1. 2mo ago First seen · 124 lines · 56 tokens per session scan A f229582ba064

Subscribe to this mod's changes

json-safe-edit is a skill published in the GitHub repository cruzs85/opencode-multiagente-local-37-iterations (5 stars, last pushed 3mo ago), licensed MIT. It adds 56 tokens to every session and 1,050 once invoked, about $0.0002 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-08-31.

Related

json-safe-edit compared with skills from other repositories

json-safe-edit next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
json-safe-editcruzs85/opencode-multiagente-local-37-iterationsSkill53mo agoMITA56OpenCode
imagegenopenai/codexSkill134ktodayApache-2.0A113Codex
local-ai-agentsmicrosoft/ai-agents-for-beginnersSkill79k3d agoMITA200Claude Code, Codex
playwright-climicrosoft/playwrightSkill100ktodayApache-2.0A19Claude Code
browser-automationopenclaw/openclawSkill394ktodayMITA36Claude Code
systematic-debuggingobra/superpowersSkill315k6d agoMITA21Claude Code
next-cache-components-adoptionvercel/next.jsSkill143ktodayMITA95Claude Code