Skip to content

Add Zed host support (--host zed)#1785

Open
jeffwitters wants to merge 3 commits into
garrytan:mainfrom
jeffwitters:add-zed-host
Open

Add Zed host support (--host zed)#1785
jeffwitters wants to merge 3 commits into
garrytan:mainfrom
jeffwitters:add-zed-host

Conversation

@jeffwitters
Copy link
Copy Markdown

@jeffwitters jeffwitters commented May 29, 2026

Summary

Adds Zed as a supported host (--host zed), including:

  • hosts/zed.ts — host config targeting ~/.agents/skills/gstack
  • hosts/index.ts — registers zed in the host registry
  • setup — wires up --host zed through the validation allowlist, install flags, auto-detection, and install block
  • scripts/host-config.ts — new optional maxFileBytes field on HostConfig
  • scripts/gen-skill-docs.tstruncateToMaxBytes() helper called after header insertion

Details

Zed uses the same SKILL.md format as gstack, so skills translate cleanly.

Field Value Reason
globalRoot .agents/skills/gstack Zed's global skill path: ~/.agents/skills/
localSkillRoot .agents/skills/gstack Zed's project-local path: <worktree>/.agents/skills/
hostSubdir .zed Unique subdir for generated docs (avoids collision with codex's .agents)
frontmatter allowlist name + description Only fields Zed's SKILL.md spec requires
descriptionLimit 1024 / truncate Zed enforces a 1024-char description max
maxFileBytes 100 * 1024 Zed enforces a 100KB hard limit per SKILL.md (MAX_SKILL_FILE_SIZE in crates/agent_skills)
skipSkills codex Codex CLI skill is not relevant to Zed
suppressedResolvers GBRAIN_CONTEXT_LOAD, GBRAIN_SAVE_RESULTS Same as cursor/opencode

100KB file size limit

Zed rejects any SKILL.md over 100KB. Seven gstack skills exceed this limit (ship 168KB, plan-ceo-review 132KB, office-hours 112KB, plan-design-review 108KB, plan-devex-review 106KB, spec 104KB, plan-eng-review 103KB).

Rather than skipping these skills entirely, this PR introduces a maxFileBytes field on HostConfig. When set, truncateToMaxBytes() is called in processTemplate() after the generated header is inserted (so header bytes count toward the budget). It trims the body at the last complete line that fits and appends a one-line notice pointing to the full skill in the source tree.

Install

./setup --host zed

Skills install to ~/.agents/skills/. Auto-detection via --host auto also picks up Zed if the zed binary is on $PATH.

Test plan

  • ./setup --host zed creates skills under ~/.agents/skills/
  • Each generated SKILL.md contains only name and description frontmatter fields
  • No generated SKILL.md exceeds 100KB
  • Skills that were truncated end with the truncation notice
  • Path references in skill content use ~/.agents/skills/gstack not ~/.claude/skills/gstack
  • codex skill is excluded from generated output
  • --host auto installs for Zed when zed is on $PATH

cartisien-dev and others added 3 commits May 29, 2026 08:38
Installs gstack skills to ~/.agents/skills/gstack, matching Zed's
global skill directory convention per https://zed.dev/docs/ai/skills.

- globalRoot / localSkillRoot: .agents/skills/gstack
- hostSubdir: .agents
- frontmatter allowlist: name + description (1024 char limit, truncate)
- pathRewrites: .claude/skills → .agents/skills
- skipSkills: codex (Claude Code-specific)
- suppressedResolvers: GBRAIN_CONTEXT_LOAD, GBRAIN_SAVE_RESULTS

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add 'zed' to the validation allowlist (was failing with unknown host error)
- Add INSTALL_ZED=0 flag and elif branch
- Auto-detect zed in --host auto mode
- Add install block that generates .zed/skills/ via gen:skill-docs,
  then copies to ~/.agents/skills/ (Zed's global skill directory)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Zed enforces a hard 100KB ceiling on SKILL.md files (MAX_SKILL_FILE_SIZE
in crates/agent_skills/agent_skills.rs). Seven gstack skills exceed this:
ship (168KB), plan-ceo-review (132KB), office-hours (112KB),
plan-design-review (108KB), plan-devex-review (106KB), spec (104KB),
plan-eng-review (103KB).

Changes:
- host-config.ts: add optional `maxFileBytes` field to HostConfig
- gen-skill-docs.ts: add truncateToMaxBytes() helper; call it in
  processTemplate() after the generated header is inserted (so header
  bytes are included in the budget). Truncates at last complete line
  that fits, appends a one-line notice pointing to the full Claude skill.
- hosts/zed.ts: set maxFileBytes: 100 * 1024

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants