Skip to content

Commit 57bb86e

Browse files
fix: align Open Design baseUrl contract
1 parent 612742a commit 57bb86e

6 files changed

Lines changed: 80 additions & 35 deletions

File tree

opencode/agents/designer.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,17 @@ Do not use Superpowers or any other skill. This agent is intentionally limited t
6161
Use Open Design through `OPEN_DESIGN_URL` and the provided tools only:
6262

6363
1. Load `open-design`.
64-
2. Call `open_design_health` with no URL argument.
65-
3. Call `open_design_list_agents`.
66-
4. List skills and design systems if selection is unclear.
67-
5. Choose a fitting `skillId` and `designSystemId`.
68-
6. Use `open_design_create_project` for an editable workbench project.
69-
7. Use `open_design_run_design` only when the user explicitly asks to generate files.
70-
8. Return the project URL.
71-
72-
Never pass or invent a manual `baseUrl`. Never try localhost or guessed ports yourself. The tool reads `OPEN_DESIGN_URL`.
64+
2. Resolve `baseUrl` from approved configuration or explicit user/lead context.
65+
3. If `baseUrl` is missing, stop and ask; do not guess or hardcode URLs.
66+
4. Call `open_design_health` with the resolved `baseUrl`.
67+
5. Call `open_design_list_agents` with the resolved `baseUrl`.
68+
6. List skills and design systems with the resolved `baseUrl` if selection is unclear.
69+
7. Choose a fitting `skillId` and `designSystemId`.
70+
8. Use `open_design_create_project` with the resolved `baseUrl` for an editable workbench project.
71+
9. Use `open_design_run_design` with the resolved `baseUrl` only when the user explicitly asks to generate files.
72+
10. Return the project URL.
73+
74+
Never invent URLs or hardcode `baseUrl`. Never try localhost or guessed ports yourself.
7375

7476
## Handoff
7577

opencode/commands/design.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,14 @@ Mandatory flow:
1414
1. Search for and read `PRODUCT.md` and `DESIGN.md`.
1515
2. If either is missing, load `impeccable` and create or propose the missing document(s).
1616
3. Load `open-design`.
17-
4. Check `open_design_health` without URL arguments.
18-
5. Check `open_design_list_agents`.
19-
6. Choose the best Open Design `skillId`.
20-
7. Choose the best `designSystemId`.
21-
8. Use `open_design_run_design` only when generated files are explicitly requested.
22-
9. Otherwise use `open_design_create_project` for an editable workbench project.
23-
10. Return project URL, prompt, decisions, assumptions, risks, visual acceptance criteria, and developer handoff.
17+
4. Resolve `baseUrl` from approved safe configuration or explicit user/lead context.
18+
5. If `baseUrl` is missing, stop and ask; do not guess or hardcode URLs.
19+
6. Check `open_design_health` with the resolved `baseUrl`.
20+
7. Check `open_design_list_agents` with the resolved `baseUrl`.
21+
8. Choose the best Open Design `skillId`.
22+
9. Choose the best `designSystemId`.
23+
10. Use `open_design_run_design` with the resolved `baseUrl` only when generated files are explicitly requested.
24+
11. Otherwise use `open_design_create_project` with the resolved `baseUrl` for an editable workbench project.
25+
12. Return project URL, prompt, decisions, assumptions, risks, visual acceptance criteria, and developer handoff.
2426

25-
Never pass `baseUrl` or invent URLs. The tool reads `OPEN_DESIGN_URL`.
27+
Never invent URLs or hardcode `baseUrl`; it must come from approved configuration/context.

opencode/docs/ai/harness/commands.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,34 @@ Criteria:
5555
- `debugger` enters only for traces, results, or concrete previous evidence.
5656
- Output is scoped specs, atomic tasks, and validation.
5757

58+
## Visible Auxiliary/Subtask Commands
59+
60+
These commands are visible slash commands, but they do not add mandatory phases
61+
or promote sidecars by themselves. They inherit the barriers of the parent flow,
62+
or the `lead` barriers when used directly.
63+
64+
### `/research`
65+
66+
Contract: auxiliary/subtask `researcher`.
67+
68+
Criteria:
69+
70+
- Clarify technical/product uncertainty, APIs, libraries, risks, or architecture.
71+
- Do not implement and do not invoke `developer` by itself.
72+
- Return context, alternatives, risks, recommendation, and remaining unknowns.
73+
74+
### `/implement`
75+
76+
Contract: auxiliary/subtask `developer`.
77+
78+
Criteria:
79+
80+
- Execute approved changes or clear acceptance criteria.
81+
- Do not replace `/feature`, `/plan`, or `/scope` when research, design, spec,
82+
or scope decisions are still missing.
83+
- Keep reasonable minimum validation and do not add mandatory review/evaluation
84+
unless the parent flow requires it.
85+
5886
## `/design`
5987

6088
Contract: `designer -> open design`.

opencode/skills/open-design/SKILL.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Invalid examples:
2525
- `https://open-design.example.com/projects/my-project`
2626
- `https://open-design.example.com/projects/my-project/files/index.html`
2727

28-
Tools read `OPEN_DESIGN_URL` from the environment. Do not pass a URL argument, compose URLs manually, or guess localhost ports.
28+
Resolve the tool `baseUrl` from approved configuration or explicit user/lead-provided context before calling Open Design tools. Do not invent, guess, or hardcode a URL. If no approved `baseUrl` is available, stop and ask for the missing configuration/context instead of trying a fallback.
2929

3030
## PRODUCT.md and DESIGN.md
3131

@@ -44,6 +44,9 @@ Use only the Open Design tools:
4444
- `open_design_create_project`
4545
- `open_design_run_design`
4646

47+
Pass the resolved `baseUrl` to every Open Design tool call, including health,
48+
list, create, and run calls.
49+
4750
## Modes
4851

4952
### Workbench

opencode/tools/open_design.ts

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ function randomId(length = 8): string {
3232
.slice(0, length)
3333
}
3434

35-
function baseUrl() {
36-
const raw = getEnv("OPEN_DESIGN_URL")
35+
function baseUrl(input?: string) {
36+
const raw = input || getEnv("OPEN_DESIGN_URL")
3737
if (!raw) {
3838
throw new Error("OPEN_DESIGN_URL is not set. Example: export OPEN_DESIGN_URL='https://open-design.example.com'")
3939
}
@@ -205,39 +205,47 @@ async function streamOpenDesignChat(base: string, body: unknown) {
205205

206206
export const health = tool({
207207
description: "Check whether the Open Design workbench is reachable.",
208-
args: {},
209-
async execute() {
210-
const base = baseUrl()
208+
args: {
209+
baseUrl: tool.schema.string().optional(),
210+
},
211+
async execute(args) {
212+
const base = baseUrl(args.baseUrl)
211213
const data = await requestJson(base, "/api/health")
212214
return JSON.stringify({ baseUrl: base, health: data }, null, 2)
213215
},
214216
})
215217

216218
export const list_agents = tool({
217219
description: "List local agent CLIs detected by Open Design.",
218-
args: {},
219-
async execute() {
220-
const base = baseUrl()
220+
args: {
221+
baseUrl: tool.schema.string().optional(),
222+
},
223+
async execute(args) {
224+
const base = baseUrl(args.baseUrl)
221225
const data = await requestJson(base, "/api/agents")
222226
return JSON.stringify(data, null, 2)
223227
},
224228
})
225229

226230
export const list_skills = tool({
227231
description: "List Open Design skills available in the workbench.",
228-
args: {},
229-
async execute() {
230-
const base = baseUrl()
232+
args: {
233+
baseUrl: tool.schema.string().optional(),
234+
},
235+
async execute(args) {
236+
const base = baseUrl(args.baseUrl)
231237
const data = await requestJson(base, "/api/skills")
232238
return JSON.stringify(data, null, 2)
233239
},
234240
})
235241

236242
export const list_design_systems = tool({
237243
description: "List Open Design design systems available in the workbench.",
238-
args: {},
239-
async execute() {
240-
const base = baseUrl()
244+
args: {
245+
baseUrl: tool.schema.string().optional(),
246+
},
247+
async execute(args) {
248+
const base = baseUrl(args.baseUrl)
241249
const data = await requestJson(base, "/api/design-systems")
242250
return JSON.stringify(data, null, 2)
243251
},
@@ -246,6 +254,7 @@ export const list_design_systems = tool({
246254
export const create_project = tool({
247255
description: "Create an Open Design project and return its workbench URL without running generation.",
248256
args: {
257+
baseUrl: tool.schema.string().optional(),
249258
name: tool.schema.string(),
250259
prompt: tool.schema.string(),
251260
skillId: tool.schema.string().optional(),
@@ -254,7 +263,7 @@ export const create_project = tool({
254263
fidelity: tool.schema.string().optional(),
255264
},
256265
async execute(args) {
257-
const base = baseUrl()
266+
const base = baseUrl(args.baseUrl)
258267
const projectId = `${safeSlug(args.name)}-${randomId(8)}`
259268
const body = {
260269
id: projectId,
@@ -276,6 +285,7 @@ export const create_project = tool({
276285
export const run_design = tool({
277286
description: "Create an Open Design project and run a design generation.",
278287
args: {
288+
baseUrl: tool.schema.string().optional(),
279289
name: tool.schema.string(),
280290
prompt: tool.schema.string(),
281291
skillId: tool.schema.string(),
@@ -286,7 +296,7 @@ export const run_design = tool({
286296
fidelity: tool.schema.string().optional(),
287297
},
288298
async execute(args) {
289-
const base = baseUrl()
299+
const base = baseUrl(args.baseUrl)
290300
const projectId = `${safeSlug(args.name)}-${randomId(8)}`
291301

292302
await requestJson(base, "/api/projects", {

scripts/check.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ grep -q 'debugger' opencode/commands/evolve.md
102102
grep -q 'evolver' opencode/commands/evolve.md
103103

104104
grep -q 'OPEN_DESIGN_URL' opencode/tools/open_design.ts
105-
! grep -q 'baseUrl:' opencode/tools/open_design.ts
105+
grep -q 'baseUrl: tool.schema.string().optional()' opencode/tools/open_design.ts
106106
! grep -q 'randomUUID' opencode/tools/open_design.ts
107107
! grep -q 'from "node:crypto"' opencode/tools/open_design.ts
108108

0 commit comments

Comments
 (0)