Skip to content

feat(theia): add Eclipse Theia AI target - #4004

Merged
dyoshikawa merged 6 commits into
mainfrom
resolve-issue-3732-theia-target
Nov 26, 2026
Merged

dyoshikawa merged 6 commits into
mainfrom
resolve-issue-3732-theia-target

Conversation

@dyoshikawa

@dyoshikawa dyoshikawa commented Nov 26, 2026 •

Copy link
Copy Markdown
Owner

Summary

Adds a theia target for Eclipse Theia AI, the AI layer of the Theia IDE and of products built on the Theia platform. Every surface was checked against the Theia AI docs and the Theia source (packages/ai-core, packages/ai-mcp, packages/core preferences) on 2026-11-26.

Feature Project Global
rules AGENTS.md (root only, non-root rules folded in) —
commands .prompts/<name>.prompttemplate —
subagents .agents/agents/<id>/agent.md —
skills .agents/skills/<name>/SKILL.md ~/.agents/skills/<name>/SKILL.md
mcp ai-features.mcp.mcpServers in .theia/settings.json —

Changes

  • src/constants/theia-paths.ts, and TheiaRule / TheiaCommand / TheiaSubagent / TheiaSkill / TheiaMcp with unit tests, registered in each processor, the target tuples and tool-display.ts.
  • Commands: a new optional isImportable hook on the command factory lets import skip files in the commands directory that are not commands (.prompts/ also holds plain prompt fragments). The prompttemplate extension was added to the command meta.extension union.
  • MCP: .theia/settings.json is declared in the shared-config gateway (jsonc, fail closed on parse errors and non-object roots; mcp owns ai-features.mcp.mcpServers) and listed in SHARED_USER_MANAGED_CONFIG_PATHS (not gitignored, never created just to hold nothing). theia.mcpServers tool-scoped blocks are accepted.
  • e2e: theia added to the rules / commands / mcp / subagents / skills generate matrices (and global skills, orphan sweeps for subagents and skills, the non-deletable MCP check), plus dedicated tests for command import (non-command templates skipped), subagent import → generate (flat .agents/agents/*.md files of other targets left alone) and MCP merge/import (hand-written preference, comment and registryMetadata kept).
  • Docs: Theia notes in docs/reference/file-formats.md for every feature; README / supported-tools tables regenerated; docs-content.ts regenerated; cspell words.

Design decisions

  • Rules: Theia reads only the root AGENTS.md (no CLAUDE.md fallback, no nested files), so the target mirrors cortexcode (SingleRootFileRule, collisionPolicy: "fold", project only).
  • Commands: commandName defaults to the file name and commandDescription to the canonical description; the theia: section (e.g. commandArgumentHint, commandAgents) wins over generated keys. Because .prompts/ holds hand-written prompt fragments and agent prompt overrides, the target uses committedOutput (no --delete sweep, not gitignored) like lettacode's .commands/, and import reads only isCommand: true templates. A template whose frontmatter does not parse is treated as a non-command (Theia does the same) instead of failing the import. A custom WorkspaceTemplateDirectories value is not followed.
  • Subagents: Theia's loader rejects an agent.md whose name, description or defaultLLM is not a string, so description falls back to "" and defaultLLM to default/universal (Theia's own "Add Custom Agent" default) unless theia.defaultLLM is set; import keeps defaultLLM only when it differs. theia.id is dropped because Theia skips an agent whose id differs from its folder. An agent.md missing a required key is skipped with a warning on import (skipInvalidImportFiles). --delete removes .agents/agents/<id>/agent.md folders no rulesync subagent accounts for, including agents created in Theia's UI (documented: import first). The */agent.md pattern and the agentsmd/Antigravity *.md pattern in the same .agents/agents/ root never match each other's files.
  • Skills: TheiaSkill extends AgentsSkillsSkill unchanged, so the shared .agents/skills/ file (license/compatibility/metadata/allowed-tools and the agentsskills opt-ins included) is identical to the agentsskills output whichever target runs last (e2e covers both orders); there is no theia: skill section. The inherited Agent Skills checks warn about what Theia's loader skips (name not kebab-case or not matching the directory, description > 1024 chars). Global writes ~/.agents/skills/: the product-specific folder (~/.theia/skills/ for the platform, ~/.theia-ide/skills/ for the Theia IDE) differs per product, while ~/.agents/skills/ is read by all of them.
  • MCP: canonical url → serverUrl, headers → headers (in the preference schema and the MCP dialog); non-canonical keys (autostart, deferLoading, oauth, serverAuthToken, serverAuthTokenHeader, ...) pass through. disabled: true servers are skipped with a warning (no disable switch). The generated map replaces ai-features.mcp.mcpServers, but on a server that already exists every key Theia does not document as user configuration (e.g. the AI registry's registryMetadata, or a key a newer Theia adds) is kept. Every other preference and comment in .theia/settings.json is kept; the file is never deleted. On import, a server with any Theia-specific key (serverAuthToken, oauth, autostart, ...) goes whole into the tool-scoped theia.mcpServers block, so credentials never reach other targets; plain servers go to the shared mcpServers. The triage plan suggested extracting Authorization: Bearer headers into serverAuthToken; passing headers through is lossless and simpler, so that mapping was not added.
  • Global scope: only skills. The user prompt-template directory, global agent directory and user settings path differ per Theia-based product (Theia IDE vs. other products) and are not documented.

Skipped items

  • ignore / hooks / permissions: Theia AI documents no file surface for them.
  • Global commands / subagents / MCP: user paths are product-specific and undocumented.
  • .prompts/agents/ and .prompts/skills/ alternates: one canonical location is written (.agents/...), which Theia prefers for new agents.

Closes #3732

🤖 Generated with Claude Code

https://claude.ai/code/session_01JdNNKCxxrKAMDANMGDEGP4

dyoshikawa and others added 6 commits November 26, 2026 18:26
Add a `theia` target for Eclipse Theia AI (the AI layer of the Theia IDE
and Theia-based products):

- rules: workspace-root AGENTS.md only; non-root rules fold into it
- commands: `.prompts/<name>.prompttemplate` with `isCommand: true`,
  `commandName` and `commandDescription`; import reads only command
  templates, and `.prompts/` is never swept or gitignored
- subagents: `.agents/agents/<id>/agent.md` with the `name`,
  `description` and `defaultLLM` frontmatter Theia requires
- skills: `.agents/skills/` (project) and `~/.theia/skills/` (global)
- mcp: `ai-features.mcp.mcpServers` merged into `.theia/settings.json`,
  keeping other preferences, comments and Theia-managed server keys

Closes #3732

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JdNNKCxxrKAMDANMGDEGP4
- Skills reuse AgentsSkillsSkill so the shared .agents/skills file is
  identical to the agentsskills output in either target order, and the
  global scope writes ~/.agents/skills/, which every Theia product reads
- Skip agent.md files missing required keys on import with a warning
- Import Theia-specific MCP servers into the theia.mcpServers block so
  tokens never reach other targets
- Document that --delete removes UI-created custom agents

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JdNNKCxxrKAMDANMGDEGP4
…eia-target

# Conflicts:
#	src/generated/docs-content.ts
@dyoshikawa
dyoshikawa merged commit cddd8f8 into main Nov 26, 2026
10 checks passed
@dyoshikawa
dyoshikawa deleted the resolve-issue-3732-theia-target branch November 26, 2026 11:05
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.

Propose a Theia AI target: .prompts/ commands, .agents/agents, skills, MCP

1 participant