Skip to content
Back to skills

Editor Config

ASecurity

Initialize a project with canonical editor configurations (Zed, VSCode). Asks which editors to set up, then writes or merges the bundled settings into the repo. On conflict our values win; keys we do not define are preserved.

  • 2 stars
  • 0 votes
  • 0 copies
  • 5 views
  • Added September 23, 2026
ai-agentsgobash

Works with

  • claude code
  • vscode

Security analysis

A100/100

Pro scans all 6 files and shows the line behind each finding

Scanned September 23, 2026

npx -y skills add edloidas/skills --skill editor-config --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Editor Config?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Editor Config
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/edloidas-editor-config/badge)](https://www.skillsdirectory.com/skills/edloidas-editor-config)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: editor-config
description: >
  Initialize a project with canonical editor configurations (Zed, VSCode). Asks which editors
  to set up, then writes or merges the bundled settings into the repo. On conflict our values
  win; keys we do not define are preserved.
when_to_use: >
  On "set up editor config", "init .zed", "apply .vscode settings", or "sync the editor
  configs".
license: MIT
compatibility: Claude Code, Codex, OpenCode, Pi
allowed-tools: Bash Read AskUserQuestion
argument-hint: "[zed] [vscode] [--dry-run]"
---

# Editor Config

**Local writes only.** It creates or merges `.zed/` and `.vscode/` files in the target repo.
It never stages, commits, pushes, or calls a remote service.

## Purpose

Drop a small, opinionated set of editor configuration files into a project. The
skill is the **source of truth** — its bundled configs in `assets/` 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    | `.zed/settings.json`        | `assets/zed/settings.json` |
| VSCode | `.vscode/settings.json`     | `assets/vscode/settings.json` |
| VSCode | `.vscode/extensions.json`   | `assets/vscode/extensions.json` |

## Sync Algorithm

For each target file:

- **Missing in target** → write our copy verbatim.
- **Already exists in target** →
  - `settings.json` files: deep-merge with **our values winning** every conflict.
    Keys the user has that we do not define are preserved.
  - `extensions.json`: **union** the `recommendations` and
    `unwantedRecommendations` 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 (`Write`, `Merge`, `Identical`) and asks for
confirmation before writing.

### Edit mechanic

`scripts/editor-config.sh` owns every write to a target repo, and it generates each target
file whole from the merge result — that is correct here, because the merge already carries
the user's own keys forward. Do not hand-edit a target file instead of re-running the script.

Editing the canonical `assets/` files is the opposite case: apply targeted edits per key, never
a whole-file rewrite, so the diff carries the key you changed and nothing else.

## Asking the User

Every question in this skill is written as `AskUserQuestion` 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

1. **Determine editor selection.**
   - If arguments include `zed` and/or `vscode`, 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. `1,2`).

2. **Run the apply script** for each selection.

   ```bash
   bash <skill-dir>/scripts/editor-config.sh [--dry-run] [--yes] <editor> [<editor> ...]
   ```

   `<editor>` is one of `zed`, `vscode`. Flags:
   - `--dry-run` — print the plan and exit
   - `--yes` / `-y` — skip the per-run confirmation
   - `-h`, `--help` — usage

3. **Review the plan.** The script prints `Target`, `Editors`, then a per-file action
   (`Write`, `Merge`, `Identical`). Show that table and end the phase with one line carrying
   the counts: `3 targets: 1 write, 1 merge, 1 identical`.

4. **Confirm.** Type `y` to apply. Anything else aborts. A `ParseError` row blocks the whole
   run — report which file failed and stop; do not repair the file to get past it unless the
   user asks.

5. **Report the changed files** the script lists, then stop. Do not stage or commit them, and
   do not reopen them to reformat.

### Example plan

```
Target: /Users/edloidas/repo/voidvigil
Editors: zed vscode

Action     File
------     ----
Merge      .zed/settings.json
Write      .vscode/settings.json
Identical  .vscode/extensions.json
```

Then the phase line: `3 targets: 1 write, 1 merge, 1 identical`.

## Edge Cases

- **`jq` missing.** The script requires `jq` for parsing and merging. Install
  with `brew install jq` (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 `recommendations` 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 `assets/` 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:

1. Drop the file into `assets/<editor>/`.
2. Add a row to the **Canonical Set** table above.
3. Extend the editor block in `scripts/editor-config.sh` (the `apply_<editor>`
   function and the `TARGETS_<EDITOR>` array).

When adding a brand-new editor:

1. Create `assets/<editor>/` with the relevant files.
2. Add the editor to the script's `KNOWN_EDITORS` list and add an
   `apply_<editor>` function.
3. Add it to the **Canonical Set** table and the `AskUserQuestion` options.

Files in this skill

  • SKILL.md6.2 KB
  • agents/openai.yaml481 B
  • assets/vscode/extensions.json28 B
  • assets/vscode/settings.json188 B
  • assets/zed/settings.json1004 B
  • scripts/editor-config.sh7.5 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.