Skip to content

Commit 1aa0f2a

Browse files
solanabclay-good
andauthored
feat(init): add shared agents skills target (#1303)
Co-authored-by: Clay Good <hi@claygood.com>
1 parent 1014c59 commit 1aa0f2a

18 files changed

Lines changed: 239 additions & 18 deletions

File tree

.changeset/add-agents-tool.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@fission-ai/openspec": minor
3+
---
4+
5+
Add the vendor-neutral `agents` target: `openspec init --tools agents` installs the workflow skills to `.agents/skills/openspec-*/SKILL.md`, the shared location AGENTS.md-compatible assistants read. It is skills-only, so no slash commands are generated. Because `agents` is now a real target, `--tools all` includes it and creates `.agents/skills/` where it previously did not.

docs/cli.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ openspec init [path] [options]
107107

108108
The welcome animation is also skipped when the `OPENSPEC_NO_ANIMATION` environment variable is set (any value, including empty), when `NO_COLOR` is set to a non-empty value, or when the OS reduced-motion preference is enabled (macOS Reduce Motion, GNOME animations disabled).
109109

110-
**Supported tool IDs (`--tools`)**`windsurf` is also accepted, as an alias for `devin`: `amazon-q`, `antigravity`, `auggie`, `bob`, `claude`, `cline`, `codeartsagent`, `codex`, `devin`, `forgecode`, `codebuddy`, `continue`, `costrict`, `crush`, `cursor`, `factory`, `gemini`, `github-copilot`, `hermes`, `iflow`, `junie`, `kilocode`, `kimi`, `kiro`, `lingma`, `vibe`, `oh-my-pi`, `opencode`, `pi`, `qoder`, `qwen`, `roocode`, `trae`, `zcode`
110+
**Supported tool IDs (`--tools`)**`windsurf` is also accepted, as an alias for `devin`: `amazon-q`, `antigravity`, `auggie`, `bob`, `claude`, `cline`, `codeartsagent`, `codex`, `devin`, `forgecode`, `codebuddy`, `continue`, `costrict`, `crush`, `cursor`, `factory`, `gemini`, `github-copilot`, `hermes`, `iflow`, `junie`, `kilocode`, `kimi`, `kiro`, `lingma`, `vibe`, `oh-my-pi`, `opencode`, `pi`, `qoder`, `qwen`, `roocode`, `trae`, `zcode`, `agents`
111111

112112
> This list mirrors `AI_TOOLS` in `src/core/config.ts`. See [Supported Tools](supported-tools.md) for each tool's skill and command paths.
113113
@@ -144,6 +144,7 @@ openspec/
144144
.claude/skills/ # Claude Code skills (if claude selected)
145145
.cursor/skills/ # Cursor skills (if cursor selected)
146146
.cursor/commands/ # Cursor OPSX commands (if delivery includes commands)
147+
.agents/skills/ # Shared skills for AGENTS.md-compatible tools (if agents selected)
147148
... (other tool configs)
148149
```
149150

docs/commands.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ Different AI tools use slightly different command syntax. Use the format that ma
673673
|--------------------------|----------------|---------------|
674674
| `.../commands/opsx/<id>.*` | `/opsx:propose`, `/opsx:apply` | Claude Code, Gemini CLI, Crush |
675675
| `.../opsx-<id>.*` | `/opsx-propose`, `/opsx-apply` | Cursor, Devin Desktop, Copilot (IDE), Trae, Oh My Pi |
676-
| none — skills only | `/openspec-propose`, `/openspec-apply-change` | CodeArts, ForgeCode, Hermes, Mistral Vibe |
676+
| none — skills only | `/openspec-propose`, `/openspec-apply-change` | CodeArts, ForgeCode, Hermes, Mistral Vibe, shared `.agents` |
677677
| none — Kimi Code | `/skill:openspec-propose` | Kimi Code |
678678
| none — Codex CLI | `$openspec-propose` | Codex |
679679

docs/how-commands-work.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ The intent is identical everywhere. The spelling follows the file your tool load
7878
| `.../commands/opsx/<id>.*` | `/opsx:propose` | Claude Code, Gemini CLI, Crush |
7979
| `.../opsx-<id>.*` | `/opsx-propose` | Cursor, GitHub Copilot (IDE), Devin Desktop, Trae, Oh My Pi |
8080
| `.amazonq/prompts/opsx-<id>.md` | `@opsx-propose` | Amazon Q Developer |
81-
| none — skills only | `/openspec-propose` | CodeArts, ForgeCode, Hermes, Mistral Vibe |
81+
| none — skills only | `/openspec-propose` | CodeArts, ForgeCode, Hermes, Mistral Vibe, shared `.agents` |
8282
| none — Kimi Code | `/skill:openspec-propose` | Kimi Code |
8383
| none — Codex CLI | `$openspec-propose` | Codex |
8484

@@ -114,7 +114,7 @@ See [Supported Tools](supported-tools.md) for the exact paths per tool, and [Mig
114114

115115
Quick checks, fastest first:
116116

117-
1. **Type a slash in your AI chat.** Start typing `/opsx` and watch for autocomplete suggestions. If they appear, you're set. On a skills-only tool (Codex, Kimi Code, CodeArts, ForgeCode, Hermes, Mistral Vibe) `/opsx` never completes even on a healthy install — try the skill name from the table above instead.
117+
1. **Type a slash in your AI chat.** Start typing `/opsx` and watch for autocomplete suggestions. If they appear, you're set. On a skills-only tool (Codex, Kimi Code, CodeArts, ForgeCode, Hermes, Mistral Vibe, or the shared `.agents` target) `/opsx` never completes even on a healthy install — try the skill name from the table above instead.
118118
2. **Look for the files.** For Claude Code, check that `.claude/skills/` contains `openspec-*` folders. Other tools use their own directories ([Supported Tools](supported-tools.md) lists them).
119119
3. **Re-run setup.** From your project root, run `openspec update`. This regenerates the skill and command files for whatever tools you configured.
120120
4. **Restart your assistant.** Many tools scan for skills and commands at startup, so a fresh window can be the missing step.

docs/supported-tools.md

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ way it loads the file OpenSpec wrote. Find your tool's command path in the
3333
| `.../opsx-<id>.*` — the filename is the command | `/opsx-<id>` | Every other tool with generated command files, except Amazon Q and Devin |
3434
| `.devin/workflows/opsx-<id>.md` — read by only one of Devin's two agents | `/opsx-<id>` on Devin Desktop, `/openspec-<skill>` on Devin Local | Devin Desktop\*\*\*\* |
3535
| `.amazonq/prompts/opsx-<id>.md` — a prompt, not a command | `@opsx-<id>` | Amazon Q Developer |
36-
| none — skills only | `/openspec-<skill>` | CodeArts, ForgeCode, Hermes, Mistral Vibe |
36+
| none — skills only | `/openspec-<skill>` | CodeArts, ForgeCode, Hermes, Mistral Vibe, shared `.agents` |
3737
| none — Kimi Code | `/skill:openspec-<skill>` | Kimi Code |
3838
| none — Codex CLI | `$openspec-<skill>` | Codex ([`/openspec-<skill>` is not recognized](https://github.com/openai/codex/issues/11817)) |
3939

@@ -98,13 +98,50 @@ to read the hint.
9898
| [Zoo Code](https://github.com/Zoo-Code-Org/Zoo-Code) (`roocode`) | `.roo/skills/openspec-*/SKILL.md` | `.roo/commands/opsx-<id>.md` |
9999
| Trae (`trae`) | `.trae/skills/openspec-*/SKILL.md` | `.trae/commands/opsx-<id>.md` |
100100
| ZCode (`zcode`) | `.zcode/skills/openspec-*/SKILL.md` | `.zcode/commands/opsx/<id>.md` |
101+
| Shared `.agents` skills (`agents`) | `.agents/skills/openspec-*/SKILL.md` | Not generated (no command adapter; use skill-based `/openspec-*` invocations) |
101102

102103
\*\* GitHub Copilot prompt files are recognized as custom slash commands in IDE extensions (VS Code, JetBrains, Visual Studio). Copilot CLI does not currently consume `.github/prompts/*.prompt.md` directly.
103104

104105
\*\*\* Hermes loads skills from `~/.hermes/skills/` by default. To use project-local OpenSpec skills, add the project `.hermes/skills/` directory to `skills.external_dirs` in `~/.hermes/config.yaml`; Hermes then exposes skills with user-facing slash invocations such as `/openspec-propose`.
105106

106107
\*\*\*\* Windsurf was [rebranded to Devin Desktop](https://docs.devin.ai/desktop/devin-desktop-faq) on June 2, 2026, and its config directory moved: `.devin/` is the preferred read + write location, `.windsurf/` a legacy read-only fallback. OpenSpec follows the rename — the tool id is `devin`, and `--tools windsurf` still resolves to it so existing setup scripts keep working. A project still holding OpenSpec files in `.windsurf/` is offered the move on the next `openspec update`; declining leaves them in place, and files you wrote yourself are never touched. Workflows are invoked by filename, so `.devin/workflows/opsx-apply.md` is `/opsx-apply`. The [Devin Local agent does not support workflows](https://docs.devin.ai/desktop/devin-local) — only skills, and it does not read `.windsurf/` at all — so whenever OpenSpec writes Devin skills it keeps their bodies, and the getting-started hint, on `/openspec-*` skill invocations, which work on both agents. Under commands-only delivery no skills are written and both fall back to `/opsx-*`.
107108

109+
### When to pick the shared `.agents` target
110+
111+
`agents` is the vendor-neutral option: it writes skills to `.agents/skills/`, the
112+
shared root many agent tools read, instead of a tool-specific directory.
113+
114+
| Situation | Pick |
115+
|-----------|------|
116+
| Your tool has its own row above | Its own ID — you get that tool's integration, including slash commands where it supports them |
117+
| Several agents on one repo, all reading `.agents/skills` | `agents` — one skill tree instead of one per tool |
118+
| Your tool isn't listed yet but reads `.agents/skills` | `agents` |
119+
120+
Selecting it alongside a tool-specific ID is fine; each writes to its own root.
121+
OpenSpec also offers it automatically once a project has a `.agents/skills/`
122+
directory — a bare `.agents/` is not enough, since tools use that root for rules
123+
and subagent definitions too. Note `.agents` is not `.agent`: the singular
124+
directory belongs to Antigravity.
125+
126+
Two things to know:
127+
128+
- **Skills only.** No command adapter exists, so no `opsx-*` command files are
129+
written; with a commands-inclusive delivery mode `openspec init` lists `agents`
130+
among the tools it reports under `Commands skipped for: … (no adapter)`.
131+
Invoke the workflows by skill name —
132+
most assistants that read `.agents/skills` spell that `/openspec-propose`, the form
133+
OpenSpec's setup hint prints. The target is vendor-neutral, so check your
134+
assistant's own docs if it uses another form.
135+
- **No `AGENTS.md` is created or edited.** The target is the `.agents/` directory.
136+
If your root `AGENTS.md` still carries OpenSpec marker blocks from an older
137+
version, `openspec update` strips them — see the [Migration Guide](migration-guide.md).
138+
139+
Because `.agents/skills/` is shared, it is worth knowing what OpenSpec claims there:
140+
it writes, refreshes, and removes only the `openspec-*` skill directories for your
141+
selected workflows. Anything else in that directory is left alone. Treat the
142+
`openspec-*` names as OpenSpec's — edits inside them are replaced on the next
143+
`openspec update`, the same as for every other tool.
144+
108145
## Non-Interactive Setup
109146

110147
For CI/CD or scripted setup, use `--tools` (and optionally `--profile`):
@@ -123,7 +160,7 @@ openspec init --tools none
123160
openspec init --profile core
124161
```
125162

126-
**Available tool IDs (`--tools`)**`windsurf` is also accepted, as an alias for `devin`: `amazon-q`, `antigravity`, `auggie`, `bob`, `claude`, `cline`, `codeartsagent`, `codex`, `devin`, `forgecode`, `codebuddy`, `continue`, `costrict`, `crush`, `cursor`, `factory`, `gemini`, `github-copilot`, `hermes`, `iflow`, `junie`, `kilocode`, `kimi`, `kiro`, `lingma`, `vibe`, `oh-my-pi`, `opencode`, `pi`, `qoder`, `qwen`, `roocode`, `trae`, `zcode`
163+
**Available tool IDs (`--tools`)**`windsurf` is also accepted, as an alias for `devin`: `amazon-q`, `antigravity`, `auggie`, `bob`, `claude`, `cline`, `codeartsagent`, `codex`, `devin`, `forgecode`, `codebuddy`, `continue`, `costrict`, `crush`, `cursor`, `factory`, `gemini`, `github-copilot`, `hermes`, `iflow`, `junie`, `kilocode`, `kimi`, `kiro`, `lingma`, `vibe`, `oh-my-pi`, `opencode`, `pi`, `qoder`, `qwen`, `roocode`, `trae`, `zcode`, `agents`
127164

128165
## Workflow-Dependent Installation
129166

docs/troubleshooting.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ If `/opsx:propose` (or your tool's equivalent) doesn't appear or doesn't do anyt
5959

6060
5. **Check you initialized this project.** Skills are written per project. If you cloned a repo or switched folders, run `openspec init` (or `openspec update`) there.
6161

62-
6. **Confirm your tool supports command files.** Codex, CodeArts, ForgeCode, Hermes, Kimi Code and Mistral Vibe don't get generated `opsx-*` command files; they use skill-based invocations instead, so `/opsx` will never autocomplete for them. Type `$openspec-propose` in Codex, `/skill:openspec-propose` in Kimi Code, and `/openspec-propose` in the rest. Amazon Q does get command files, but loads them into its prompt library rather than its slash menu — type `@opsx-propose` there, not `/opsx`. Every tool's form is listed in [How To Invoke](supported-tools.md#how-to-invoke).
62+
6. **Confirm your tool supports command files.** Codex, CodeArts, ForgeCode, Hermes, Kimi Code, Mistral Vibe and the shared `.agents` target don't get generated `opsx-*` command files; they use skill-based invocations instead, so `/opsx` will never autocomplete for them. Type `$openspec-propose` in Codex, `/skill:openspec-propose` in Kimi Code, and `/openspec-propose` in the rest. The shared `.agents` target is vendor-neutral, so `/openspec-propose` is the common form rather than a guaranteed one — if your assistant does not answer to it, check its own docs for how it invokes a skill. Amazon Q does get command files, but loads them into its prompt library rather than its slash menu — type `@opsx-propose` there, not `/opsx`. Every tool's form is listed in [How To Invoke](supported-tools.md#how-to-invoke).
6363

6464
## Working with changes
6565

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
schema: spec-driven
2+
created: 2026-07-29
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
## Why
2+
3+
`.agents/skills` has become the shared, vendor-neutral location modern agent tools read. OpenSpec already carried an `agents` entry in `AI_TOOLS`, but with `available: false` and no `skillsDir` it was unreachable — every real gate keys off `skillsDir`. Teams running several agents on one repo, or a tool with no first-class integration yet, had to generate for some other tool and move the files by hand (#1480), or pick a vendor target they do not use (#1104, #653).
4+
5+
## What Changes
6+
7+
- Enable `agents` in `AI_TOOLS` with `skillsDir: '.agents'`, making it selectable interactively and via `--tools agents`.
8+
- Scope detection to `detectionPaths: ['.agents/skills']` so a bare `.agents/` written by another framework does not select — or silently install into — the target.
9+
- Rename the entry to `Shared .agents skills`. The old label said "AGENTS.md", but OpenSpec writes no `AGENTS.md` — it strips its markers out of one.
10+
- Document the target, including when to prefer it over a tool-specific integration.
11+
12+
## Capabilities
13+
14+
### New Capabilities
15+
16+
_None._
17+
18+
### Modified Capabilities
19+
20+
- `ai-tool-paths`: define the `.agents` skills root and its scoped detection path
21+
- `cli-init`: record that the shared target installs skills and skips command generation
22+
23+
## Impact
24+
25+
- `src/core/config.ts` - enable the `agents` entry, scope detection, correct the label
26+
- `.changeset/add-agents-tool.md` - minor release note, including the `--tools all` behavior change
27+
- `docs/supported-tools.md`, `docs/cli.md`, `docs/commands.md`, `docs/how-commands-work.md`, `docs/troubleshooting.md` - list `agents` among skills-only tools and explain when to choose it
28+
- `test/core/*`, `test/commands/*`, `test/cli-e2e/*` - cover init, update, detection, and the deprecated alias
29+
30+
## Non-Goals
31+
32+
- No command adapter for `agents`. There is no cross-vendor slash-command format, so commands stay skills-only (the Kimi/Hermes pattern).
33+
- No `.pi`, `.codex`, or `.agent` migration into `.agents`. Moving vendor tools to the shared root is separate work (#830, #1157).
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# ai-tool-paths Delta Specification
2+
3+
## ADDED Requirements
4+
5+
### Requirement: Shared .agents skills target
6+
7+
OpenSpec SHALL provide a vendor-neutral `agents` tool target rooted at the shared `.agents` directory, for assistants that read skills from the shared location rather than a vendor-specific one.
8+
9+
#### Scenario: Shared agents target paths defined
10+
11+
- **WHEN** looking up the `agents` tool
12+
- **THEN** `skillsDir` SHALL be `.agents`
13+
14+
#### Scenario: Detection keys off the shared skills subtree
15+
16+
- **WHEN** a project contains a `.agents/skills` path
17+
- **THEN** OpenSpec SHALL detect `agents` as an available target
18+
19+
#### Scenario: A bare shared root does not select the target
20+
21+
- **GIVEN** a project contains `.agents` but no `.agents/skills` path
22+
- **WHEN** OpenSpec detects available tools
23+
- **THEN** `agents` SHALL NOT be reported as available
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# cli-init Delta Specification
2+
3+
## ADDED Requirements
4+
5+
### Requirement: Shared .agents target initialization
6+
7+
`openspec init` SHALL accept the shared `agents` target wherever tool IDs are selected, and SHALL treat it as a skills-only tool.
8+
9+
#### Scenario: Non-interactive selection of the shared target
10+
11+
- **WHEN** the user runs `openspec init --tools agents`
12+
- **THEN** OpenSpec SHALL generate skills for the `agents` target
13+
- **AND** initialization SHALL NOT fail because `agents` has no registered command adapter
14+
15+
#### Scenario: Shared agents target skips command-file generation
16+
17+
- **GIVEN** the configured delivery includes command generation
18+
- **WHEN** the user selects the shared `agents` target during initialization
19+
- **THEN** command-file generation SHALL be skipped because no `agents` adapter is registered
20+
- **AND** `agents` SHALL be listed among the tools reported as having commands skipped

0 commit comments

Comments
 (0)