Adapter skill that polishes text fields inside JSON files by extracting them, delegating to the copywriter skill for polishing, and writing the polished text back. Use when the user wants to polish, improve, or copywrite text inside a JSON file — plugin descriptions, IS/DOES/MEANS propositions, category names, claim statements, or any string fields in structured JSON data. Triggers include "polish JSON", "copywrite marketplace.json", "improve descriptions in plugin.json", "polish fields in JSON", or any /copywrite invocation targeting a .json file with --fields.
From cogni-copywritingnpx claudepluginhub cogni-work/insight-wave --plugin cogni-copywritingThis skill is limited to using the following tools:
Provides checklists to review code for functionality, quality, security, performance, tests, and maintainability. Use for PRs, audits, team standards, and developer training.
Guides browser automation with Playwright, Puppeteer, Selenium for e2e testing and scraping. Teaches reliable selectors, auto-waits, isolation to fix flaky tests.
Enforces A/B test setup with gates for hypothesis locking, metrics definition, sample size calculation, assumptions checks, and execution readiness before implementation.
Adapter that bridges JSON files to the copywriter skill. Extracts text fields from JSON, builds a temporary markdown file with field delimiters, delegates polishing to the copywriter skill, parses polished text back, and updates the JSON file.
| Param | Required | Default | Description |
|---|---|---|---|
FILE_PATH | yes | — | Absolute path to .json file |
FIELDS | yes | — | Dot-path field selector (e.g. plugins[*].description) |
SCOPE | no | tone | Passed to copywriter (tone is the right default for short JSON text) |
MODE | no | standard | sales for IS/DOES/MEANS fields |
DRY_RUN | no | false | Show before/after without writing |
Simple dot-path with [*] for arrays:
description — single root fieldplugins[*].description — description of every plugin in array[*].dimension_name — field in root-level arrayplugins[*].description,plugins[*].keywords — comma-separated multi-field.json extension. into segments[*], iterate over all array elementsplugins[0].description)ERROR: No matching string fields found for selector "{FIELDS}" in {FILE_PATH}
Possible causes:
- Field path does not exist in the JSON structure
- All matching values are non-strings or shorter than 10 characters
Tip: Use a JSON viewer to inspect the file structure, then retry with corrected --fields
Assemble extracted texts into a single temporary markdown file with field delimiters:
<!-- COPY-JSON SOURCE: {FILE_PATH} -->
<!-- FIELDS: {FIELDS} -->
<!-- FIELD: plugins[0].description -->
Claim verification and management system. Verifies sourced claims against primary documents...
<!-- FIELD: plugins[1].description -->
Obsidian integration for Claude Code workplaces. Syncs vault structure...
Write to {dir}/.{basename}.copywrite-tmp.md where {dir} is the directory of FILE_PATH and {basename} is the JSON filename without extension
Invoke the copywriter skill:
Skill: cogni-copywriting:copywriter
FILE_PATH = {path to temp MD}
SCOPE = {SCOPE parameter, default: tone}
Additional instructions to copywriter:
<!-- FIELD: ... --> comment delimiters exactly as-is**bold**, # headings, - lists)Wait for copywriter skill completion
<!-- FIELD: ... --> delimiters to recover per-field text**, __, # , - list markers, or | table | syntax (these don't belong in JSON string values)[P1-1] or similar citation markers, they must still be presentBackup: Copy FILE_PATH to {dir}/.{basename}.pre-copy-json.json
Read the original JSON file fresh (to avoid stale data)
For each validated polished field, update the value at its concrete JSON path
Write the updated JSON back to FILE_PATH, preserving original indentation (detect indent from file: typically 2 or 4 spaces)
If DRY_RUN=true: show the before/after diff for each field WITHOUT writing to the JSON file, then skip the backup and write steps
Return summary:
**JSON Copywriting Complete**: {basename}.json
**Fields polished**: {count} of {total_matched}
| Field | Before (truncated) | After (truncated) |
|-------|--------------------|-------------------|
| plugins[0].description | Original text here... | Polished text here... |
| plugins[1].description | Original text here... | Polished text here... |
**Backup**: .{basename}.pre-copy-json.json
**Next step**: Review the changes with `git diff {basename}.json`
ERROR: File not found: {FILE_PATH}
Usage: /copywrite <file.json> --fields="<selector>"
Example: /copywrite marketplace.json --fields="plugins[*].description"
ERROR: copy-json skill requires a .json file, got: {extension}
For markdown files, use the copywriter skill directly:
/copywrite document.md
ERROR: --fields parameter is required for JSON files
Usage: /copywrite <file.json> --fields="<selector>"
Examples:
--fields="description" Single field
--fields="plugins[*].description" Array field
--fields="*.IS,*.DOES,*.MEANS" Multiple fields
ERROR: Failed to parse {FILE_PATH} as valid JSON
Details: {parse_error}
Ensure the file contains valid JSON before running copy-json.
ERROR: Copywriter skill failed during polishing
Details: {error}
The original JSON file has not been modified.
Troubleshooting:
1. Check that cogni-copywriting plugin is installed
2. Verify the temp MD file was created at {tmp_path}
3. Try polishing the temp MD manually: /copywrite {tmp_path}
plugins[*].description:FUNCTION resolve(json, path_segments, current_path=""):
IF path_segments is empty:
IF json is string AND length >= 10:
RETURN [(current_path, json)]
ELSE:
RETURN []
segment = path_segments[0]
remaining = path_segments[1:]
IF segment contains "[*]":
key = segment before "[*]"
array = json[key] if key else json
results = []
FOR i, item IN enumerate(array):
concrete = current_path + key + "[" + i + "]"
results += resolve(item, remaining, concrete + ".")
RETURN results
ELSE:
RETURN resolve(json[segment], remaining, current_path + segment + ".")
FUNCTION write_back(json, concrete_path, value):
segments = parse_concrete_path(concrete_path)
# e.g. "plugins[0].description" → ["plugins", 0, "description"]
target = json
FOR segment IN segments[:-1]:
target = target[segment]
target[segments[-1]] = value
Skills Used:
Delegation Pattern:
This adapter pattern means copy-json benefits from all future copywriter improvements without changes.