Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
62aa43d
feat(skills): bundle local agent delegation skill
Waishnav Jun 30, 2026
67fa112
docs(agents): add local agent profile examples
Waishnav Jun 30, 2026
5fe6957
docs(agents): surface packaged agent templates
Waishnav Jun 30, 2026
172d8bb
feat(skills): gate local agent delegation experiment
Waishnav Jul 1, 2026
5c36d0f
fix(config): honor local agents env during init
Waishnav Jul 1, 2026
afd6694
fix(skills): hide local agent diagnostics when disabled
Waishnav Jul 1, 2026
89beea9
docs(skills): note safe local agent argv handling
Waishnav Jul 1, 2026
4c43606
fix(agents): correct local agent example commands
Waishnav Jul 1, 2026
e582d3a
feat(agents): add local agent profile catalog
Waishnav Jul 2, 2026
6266abf
feat(agents): add minimal local agents cli
Waishnav Jul 2, 2026
07e7135
feat(agents): support cli fallback profiles
Waishnav Jul 2, 2026
4650806
docs(agents): document minimal local agent workflow
Waishnav Jul 2, 2026
b475ea1
feat(agents): simplify built-in profile schema
Waishnav Jul 3, 2026
3582b7e
feat(agents): route built-in providers through adapters
Waishnav Jul 3, 2026
9ca359b
fix(agents): allow profile runners to edit workspaces
Waishnav Jul 3, 2026
e9bf517
docs(agents): align profiles with built-in providers
Waishnav Jul 3, 2026
394cc31
refactor(subagents): rename local agent feature gate
Waishnav Jul 3, 2026
b349a80
fix(subagents): scope session listing by workspace
Waishnav Jul 3, 2026
096a113
test(subagents): verify response filtering hides tool events
Waishnav Jul 3, 2026
ed4916a
fix(subagents): align provider response extraction with harness formats
Waishnav Jul 3, 2026
3e8081c
fix(subagents): clear stale response on follow-up
Waishnav Jul 4, 2026
2c95b5f
fix(subagents): skip invalid profile files
Waishnav Jul 4, 2026
d73307c
test(subagents): isolate workspace profile fixtures
Waishnav Jul 4, 2026
80ee468
fix(subagents): parse profile frontmatter with yaml
Waishnav Jul 4, 2026
7827f63
refactor(subagents): persist sessions in sqlite
Waishnav Jul 4, 2026
65e5757
fix(subagents): harden provider response handling
Waishnav Jul 4, 2026
9cb917b
fix(subagents): fallback to pi session history
Waishnav Jul 4, 2026
2960da7
fix(subagents): recover pi final text from stream
Waishnav Jul 4, 2026
b8e72ee
fix(subagents): preserve node loader for workers
Waishnav Jul 5, 2026
1c9beda
fix(subagents): update pi rpc dependency
Waishnav Jul 5, 2026
86640bc
fix(subagents): prefer user pi binary
Waishnav Jul 5, 2026
ca93955
fix(subagents): handle acp provider turns
Waishnav Jul 5, 2026
b956e74
fix(subagents): align claude sdk launch
Waishnav Jul 5, 2026
e9cb5d1
test(subagents): use platform path delimiter
Waishnav Jul 5, 2026
9a19349
feat(subagents): run built-in providers directly
Waishnav Jul 5, 2026
4a48668
feat(subagents): advertise built-in providers
Waishnav Jul 5, 2026
7197629
feat(subagents): preflight provider availability
Waishnav Jul 5, 2026
a72d1ed
fix(subagents): fail pi rpc on malformed stdout
Waishnav Jul 5, 2026
c513a8d
fix(subagents): reject claude error results
Waishnav Jul 5, 2026
6c4dfb5
fix(subagents): avoid shell command lookup
Waishnav Jul 5, 2026
f50f02a
refactor(subagents): share local agent path cleanup
Waishnav Jul 5, 2026
eaddcb1
Merge pull request #55 from Waishnav/codex/local-agent-profiles-cli
Waishnav Jul 5, 2026
9c79713
Merge remote-tracking branch 'origin/main' into codex/local-agent-exa…
Waishnav Jul 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 96 additions & 0 deletions .agents/plan/local-agent-profiles-and-cli-plan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# Subagent profiles and DevSpace agent CLI plan

## Decision

Subagent profiles describe roles over built-in coding-agent providers.
DevSpace owns provider invocation and lifecycle. Custom CLI-backed agents,
provider action objects, and model-visible backend details are out of scope for
v1.

The model-facing workflow stays small:

```bash
devspace agents ls
devspace agents run <profile-or-id> "<prompt>"
devspace agents show <id>
```

Profile discovery happens through the compact catalog returned by
`open_workspace`. `devspace agents ls` lists existing subagent sessions for the
current workspace; it does not list profile definitions.

## Profile schema

Profiles are discovered from:

- `~/.devspace/agents/*.md`
- project `.devspace/agents/*.md`

Supported frontmatter fields:

```yaml
schema: devspace-agent/v1
name: reviewer
description: Read-only reviewer for bugs, security risks, and missing tests.
provider: codex
model: gpt-5.4
disabled: false
```

Supported providers:

- `codex`
- `claude`
- `opencode`
- `pi`
- `cursor`
- `copilot`

Removed from v1 profile schema:

- `backend`
- `command`
- `mode`
- `permissions`
- `actions`

## Provider mapping

DevSpace maps provider ids to native integrations:

- `codex`: Codex SDK
- `claude`: Claude Code SDK
- `opencode`: OpenCode SDK
- `pi`: Pi RPC mode
- `cursor`: ACP
- `copilot`: ACP

The adapter registry is the internal seam future MCP tools can reuse if we move
from skill plus CLI guidance to first-class MCP agent tools.

## Model exposure

`open_workspace` exposes only compact profile metadata:

```json
{
"name": "reviewer",
"description": "Read-only reviewer for bugs, security risks, and missing tests.",
"provider": "codex",
"model": "gpt-5.4"
}
```

The profile body, provider protocol, raw provider transcript, and adapter
details stay outside the default model context.

Shell calls launched through DevSpace receive `DEVSPACE_WORKSPACE_ID` and
`DEVSPACE_WORKSPACE_ROOT`, so `devspace agents ls` can scope itself without the
model passing workspace flags.

## Non-goals

- Custom or arbitrary subagent commands.
- Provider-specific action DSLs.
- Exposing raw provider transcripts by default.
- Tracking changed files or tests from provider output.
143 changes: 143 additions & 0 deletions docs/agent-profile-schema.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
# Subagent profile schema

DevSpace agent profiles are user-owned markdown files with YAML
frontmatter. They describe roles such as reviewer, explorer, or implementer.
DevSpace owns provider invocation.

Profiles are discovered from:

- `~/.devspace/agents/*.md`
- `.devspace/agents/*.md`

Packaged files under `examples/agents/` are starter templates only.

## Minimal shape

```md
---
schema: devspace-agent/v1
name: reviewer
description: Read-only reviewer for bugs, security risks, and missing tests.
provider: codex
model: gpt-5.4
disabled: false
---

You are a read-only reviewer. Do not edit files.
Focus on correctness, security, test gaps, and maintainability.
Cite files and return concise findings.
```

## Frontmatter fields

### `schema`

Optional schema identifier:

```yaml
schema: devspace-agent/v1
```

### `name`

Stable profile identifier shown to the model and accepted by:

```bash
devspace agents run <name> "<prompt>"
```

Use lowercase kebab-case names. If omitted, DevSpace uses the filename without
`.md`.

### `description`

Required short purpose. This is exposed by `open_workspace` so the supervising
model can choose the right profile.

### `provider`

Required built-in provider id:

```yaml
provider: codex
provider: claude
provider: opencode
provider: pi
provider: cursor
provider: copilot
```

Unsupported or custom providers are rejected. DevSpace maps providers to their
native integration:

- `codex`: Codex SDK
- `claude`: Claude Code SDK
- `opencode`: OpenCode SDK
- `pi`: Pi RPC mode
- `cursor`: ACP
- `copilot`: ACP

### `model`

Optional provider model id or alias.

```yaml
model: gpt-5.4
model: sonnet
```

### `disabled`

Optional boolean. Disabled profiles are not exposed.

```yaml
disabled: true
```

## Markdown body

The body is the profile prompt prefix DevSpace prepends when launching that
profile. It is not included in `open_workspace` by default.

Recommended body content:

- When to use this profile.
- Whether the worker should act read-only or may make changes.
- Output format.
- Review or testing expectations.

## Model-facing workflow

The Subagent skill teaches only:

```bash
devspace agents ls
devspace agents run <profile-or-id> "<prompt>"
devspace agents show <id>
```

`open_workspace` exposes compact profile metadata:

```json
{
"name": "reviewer",
"description": "Read-only reviewer for bugs, security risks, and missing tests.",
"provider": "codex",
"model": "gpt-5.4"
}
```

`devspace agents ls` lists existing subagent sessions for the current workspace;
it does not list profile definitions.

The full profile body stays out of the model context until DevSpace launches the
profile.

## Current non-goals

- Custom or arbitrary CLI-backed agents.
- Inferring changed files, tests, or diffs from worker output.
- Exposing raw provider transcripts by default.
- Teaching the model provider-specific CLIs.
- First-class MCP agent tools. Future tools should wrap the same provider
adapter registry used by `devspace agents`.
19 changes: 18 additions & 1 deletion docs/chatgpt-coding-workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,24 @@ DevSpace discovers standard Agent Skills from:

- `~/.agents/skills`
- project `.agents/skills`
- `~/.devspace/skills`

It also keeps compatibility with:

- the bundled `subagent-delegation` skill when `DEVSPACE_SUBAGENTS=1`, unless `~/.devspace/skills/subagent-delegation/SKILL.md` exists
- `DEVSPACE_AGENT_DIR/skills`, defaulting to `~/.codex/skills`
- additional paths from `DEVSPACE_SKILL_PATHS`

When Subagents are enabled, DevSpace discovers agent profiles
from `~/.devspace/agents/*.md` and project `.devspace/agents/*.md`.
`open_workspace` exposes a compact catalog with profile names, descriptions,
providers, and optional models so the model can choose a configured agent
without seeing provider-specific launch details.

Example profiles are packaged under `examples/agents/` for users who want
starter templates. Copy or adapt them into one of the active profile directories
before use.

Legacy project paths such as `.pi/skills` can be added through `DEVSPACE_SKILL_PATHS` when needed.

When `open_workspace` returns matching skills, the model should read the
Expand All @@ -99,7 +111,12 @@ Skill paths may be outside the workspace. DevSpace only permits reading:
- advertised `SKILL.md` files
- files under a skill directory after that skill's `SKILL.md` has been read

Set `DEVSPACE_SKILLS=0` to hide skills from workspace output.
Set `DEVSPACE_SKILLS=0` to hide skills from workspace output. Set
`DEVSPACE_SUBAGENTS=1` to expose the experimental subagent catalog and
`subagent-delegation` skill. That skill teaches the minimal
`devspace agents ls`, `devspace agents run`, and `devspace agents show`
workflow. The catalog comes from `open_workspace`; `devspace agents ls` lists
existing subagent sessions for that workspace.

## Tool Names

Expand Down
20 changes: 20 additions & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,19 +92,39 @@ sessions.
| Variable | Purpose |
| --- | --- |
| `DEVSPACE_SKILLS` | Set to `0` to hide skills. Enabled by default. |
| `DEVSPACE_SUBAGENTS` | Set to `1` to expose configured agent profiles as Subagents. Experimental and disabled by default. |
| `DEVSPACE_AGENT_DIR` | Defaults to `~/.codex`; its `skills` child is loaded for compatibility. |
| `DEVSPACE_SKILL_PATHS` | Optional comma-separated additional skill directories. |

DevSpace discovers standard Agent Skills from:

- `~/.agents/skills`
- project `.agents/skills`
- `~/.devspace/skills`

It also keeps compatibility with:

- the bundled `subagent-delegation` skill when `DEVSPACE_SUBAGENTS=1`, unless `~/.devspace/skills/subagent-delegation/SKILL.md` exists
- `DEVSPACE_AGENT_DIR/skills`, defaulting to `~/.codex/skills`
- additional paths from `DEVSPACE_SKILL_PATHS`

When Subagents are enabled, DevSpace discovers agent profiles
from:

- `~/.devspace/agents/*.md`
- project `.devspace/agents/*.md`

`open_workspace` returns a compact catalog containing profile names,
descriptions, providers, and optional models so the host model can choose an
agent without reading provider-specific launch details. `devspace agents ls`
lists existing subagent sessions for the current workspace, scoped by the
workspace environment injected into shell commands. The `subagent-delegation`
skill teaches the model to use only the minimal `devspace agents ls`,
`devspace agents run`, and `devspace agents show` workflow.

Starter profile templates are available under `examples/agents/`. Copy or adapt
them into one of the active profile directories before use.

Legacy project paths such as `.pi/skills` can be added through `DEVSPACE_SKILL_PATHS` when needed.

Example:
Expand Down
13 changes: 13 additions & 0 deletions docs/gotchas.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,25 @@ DevSpace looks in standard Agent Skills locations:

- `~/.agents/skills`
- project `.agents/skills`
- `~/.devspace/skills`

It also checks compatibility and custom paths:

- the bundled `subagent-delegation` skill when `DEVSPACE_SUBAGENTS=1`, unless `~/.devspace/skills/subagent-delegation/SKILL.md` exists
- `DEVSPACE_AGENT_DIR/skills`, defaulting to `~/.codex/skills`
- additional paths from `DEVSPACE_SKILL_PATHS`

When `DEVSPACE_SUBAGENTS=1`, DevSpace loads agent profiles from
`~/.devspace/agents/*.md` and project `.devspace/agents/*.md`, then exposes a
compact profile catalog through `open_workspace`. The bundled
`subagent-delegation` skill keeps the model-facing workflow to
`devspace agents ls`, `devspace agents run`, and `devspace agents show`.
`devspace agents ls` lists existing subagent sessions, not profile
definitions.

Packaged agent profile examples under `examples/agents/` are starter templates.
Copy or adapt them into one of the active profile directories before use.

Legacy project paths such as `.pi/skills` can be added through `DEVSPACE_SKILL_PATHS` when needed.

If a skill appears in `open_workspace`, the model must read that skill's
Expand Down
31 changes: 31 additions & 0 deletions examples/agents/claude-implementer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
schema: devspace-agent/v1
name: claude-implementer
description: Claude Code profile for larger implementation, refactor, and repair tasks.
provider: claude
model: sonnet
---

You are a local Claude Code implementation worker under supervisor review.

Use this profile for multi-file implementation, careful refactors, and test
repair loops when the user asked for delegated implementation.

Rules:

- Keep changes focused.
- Preserve public behavior unless asked.
- Do not rewrite unrelated code.
- Run or explain relevant tests.
- Return a concise final report.

Final report format:

```text
summary:
files_changed:
tests_run:
risks:
blockers:
follow_up_needed:
```
Loading
Loading