Skip to content

Commit 4d10642

Browse files
committed
refactor(skills): replace subagent delegation guidance
1 parent 4d5c9f6 commit 4d10642

6 files changed

Lines changed: 61 additions & 138 deletions

File tree

skills/subagent-delegation/SKILL.md

Lines changed: 0 additions & 132 deletions
This file was deleted.

skills/subagents/SKILL.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
name: subagents
3+
description: Delegate focused work to isolated DevSpace coding agents.
4+
---
5+
6+
Each subagent is headless, has its own context window, cannot see the parent conversation, cannot ask the user, and cannot spawn subagents or workflows. Give every child a self-contained prompt with paths, constraints, and the expected report.
7+
8+
## Choose a target
9+
10+
Prefer a matching named profile from `open_workspace`. Use a raw provider when
11+
the user names that harness or no profile fits. Choose only profiles and
12+
providers returned by `open_workspace`.
13+
14+
## Write the brief
15+
16+
Describe the task directly. Include decisions and constraints that exist only
17+
in the parent conversation. Mention relevant paths or scope when useful. Do not
18+
repeat project instructions that the child can discover from the repository.
19+
20+
## Run and continue
21+
22+
```bash
23+
devspace agents run <profile-or-provider> "<brief>"
24+
devspace agents show <id>
25+
devspace agents run <id> "<follow-up>"
26+
devspace agents ls
27+
```
28+
29+
`run` with a profile or provider starts a child and returns its id. `show`
30+
reads its latest status and response. `run` with an existing id continues the
31+
same child session. `ls` lists sessions for the current project.
32+
33+
Do not invoke provider CLIs directly; use `devspace agents` so DevSpace keeps
34+
session and provider handling consistent.
35+
36+
## Model and effort overrides
37+
38+
Normally omit `--model` and `--effort`. When an exact override is needed, read
39+
`references/<provider>.md` first. Do not guess values or transfer an effort
40+
name between providers merely because both use the same word.
41+
42+
```bash
43+
devspace agents run <target> --model <model> --effort <effort> "<brief>"
44+
```
45+
46+
## Direct subagent or workflow
47+
48+
Use a direct subagent for one focused delegation or a follow-up with the same
49+
child. Use a dynamic workflow when the task needs programmed fan-out, stages,
50+
branching, nesting, or replay.

src/config.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@ assert.equal(resolveSubagentsFlag({}, { DEVSPACE_SUBAGENTS: "1" }), true);
5353
const seededConfigDir = mkdtempSync(join(tmpdir(), "devspace-seeded-skills-test-"));
5454
const seededSkillPaths = ensureDevspaceDefaultSkills({ DEVSPACE_CONFIG_DIR: seededConfigDir });
5555
assert.deepEqual(seededSkillPaths, [
56-
join(seededConfigDir, "skills", "subagent-delegation", "SKILL.md"),
56+
join(seededConfigDir, "skills", "subagents", "SKILL.md"),
5757
join(seededConfigDir, "skills", "dynamic-workflows", "SKILL.md"),
5858
]);
5959
assert.equal(existsSync(seededSkillPaths[0]), true);
6060
assert.equal(existsSync(seededSkillPaths[1]), true);
61-
assert.match(readFileSync(seededSkillPaths[0], "utf8"), /name: subagent-delegation/);
61+
assert.match(readFileSync(seededSkillPaths[0], "utf8"), /name: subagents/);
6262
assert.match(readFileSync(seededSkillPaths[1], "utf8"), /name: dynamic-workflows/);
6363
assert.deepEqual(ensureDevspaceDefaultSkills({ DEVSPACE_CONFIG_DIR: seededConfigDir }), []);
6464

src/skills.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ try {
204204
});
205205
assert.equal(
206206
loadWorkspaceSkills(experimentalConfig, projectRoot).skills.some(
207-
(skill) => skill.name === "subagent-delegation",
207+
(skill) => skill.name === "subagents",
208208
),
209209
true,
210210
);

src/skills.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ export interface SkillReadResolution {
2121
isSkillFile: boolean;
2222
}
2323

24-
const SUBAGENT_DELEGATION_NAME = "subagent-delegation";
24+
const SUBAGENTS_NAME = "subagents";
25+
const LEGACY_SUBAGENT_DELEGATION_NAME = "subagent-delegation";
2526
const DYNAMIC_WORKFLOWS_NAME = "dynamic-workflows";
2627

2728
function bundledSkillsDir(): string {
@@ -72,7 +73,11 @@ export function loadWorkspaceSkills(config: ServerConfig, cwd: string): LoadedSk
7273

7374
if (config.subagents) return result;
7475

75-
const gated = new Set<string>([SUBAGENT_DELEGATION_NAME, DYNAMIC_WORKFLOWS_NAME]);
76+
const gated = new Set<string>([
77+
SUBAGENTS_NAME,
78+
LEGACY_SUBAGENT_DELEGATION_NAME,
79+
DYNAMIC_WORKFLOWS_NAME,
80+
]);
7681
return {
7782
skills: result.skills.filter((skill) => !gated.has(skill.name)),
7883
diagnostics: result.diagnostics.filter((diagnostic) => {

src/user-config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export function generateOwnerToken(): string {
9797
return randomBytes(32).toString("base64url");
9898
}
9999

100-
const DEFAULT_SKILLS = ["subagent-delegation", "dynamic-workflows"] as const;
100+
const DEFAULT_SKILLS = ["subagents", "dynamic-workflows"] as const;
101101

102102
export function ensureDevspaceDefaultSkills(env: NodeJS.ProcessEnv = process.env): string[] {
103103
const seeded: string[] = [];

0 commit comments

Comments
 (0)