Editor Config
Purpose
Drop a small, opinionated set of editor configuration files into a project. The
skill is the
source of truth — its bundled configs in
are what
every target repo gets. To update the canonical configs, edit the files in this
skill and commit; the next run propagates the change everywhere else.
When to Use This Skill
Trigger phrases: "editor config", "editor-config", "init editor", "setup editor",
"apply editor config", "sync editor config", "init zed", "init vscode", "set up
.zed", "set up .vscode", "configure editor".
Canonical Set
Two editors, each with one or more target files:
| Editor | Target | Source |
|---|
| Zed | | |
| VSCode | | assets/vscode/settings.json
|
| VSCode | | assets/vscode/extensions.json
|
Sync Algorithm
For each target file:
- Missing in target → write our copy verbatim.
- Already exists in target →
- files: deep-merge with our values winning every conflict.
Keys the user has that we do not define are preserved.
- : union the and
arrays. No duplicates, order preserved with our
entries appended first.
Existing files are read tolerantly —
line comments and
block
comments (valid in JSONC) are stripped before parsing. The output is always
plain JSON.
The skill prints a per-file plan (
,
,
) and asks for
confirmation before writing.
Asking the User
Every question in this skill is written as
options. Use that tool where
the host offers it, or the host's nearest structured-choice equivalent. Where the host has
neither, ask the same question in normal chat as a numbered list of 2–5 options —
recommended first, one short line of description each — and wait for the user to reply
with a number.
Workflow
-
Determine editor selection.
-
If arguments include
and/or
, use those.
-
Otherwise ask per Asking the User, accepting more than one pick:
Question: Which editor configs should I set up?
Header: Editors
Options:
- Zed (Recommended) — Apply .zed/settings.json
- VSCode — Apply .vscode/settings.json and .vscode/extensions.json
In chat, accept one or more numbers comma-separated (e.g.
).
-
Run the apply script for each selection.
bash
bash <skill-dir>/scripts/editor-config.sh [--dry-run] [--yes] <editor> [<editor> ...]
- — print the plan and exit
- / — skip the per-run confirmation
- , — usage
-
Review the plan. The script prints
, then a per-file action
(
,
,
).
-
Confirm. Type
to apply. Anything else aborts.
-
Verify. After apply, the changed files are listed. Run
/
in the target repo to inspect.
Edge Cases
- missing. The script requires for parsing and merging. Install
with (or your package manager).
- JSONC with non-standard syntax. The comment stripper handles and
. Trailing commas are not handled — if the existing file has them,
the script reports a parse error and exits without writing. Remove trailing
commas and re-run.
- Existing array contains a string we also define. The
union de-duplicates by exact string match, so no double entries appear.
- The user has set a key we also define to a different value. Ours wins —
this is the explicit design. If a user customization needs to survive,
remove that key from
assets/<editor>/settings.json
in this skill (the
canonical set).
Updating the Canonical Configs
The bundled files in
are the source of truth. Edit them in place and
commit; the next run in any other repo picks up the new content.
When adding a brand-new target file:
- Drop the file into .
- Add a row to the Canonical Set table above.
- Extend the editor block in (the
function and the array).
When adding a brand-new editor:
- Create with the relevant files.
- Add the editor to the script's list and add an
function.
- Add it to the Canonical Set table and the options.