Skip to content

Commit eceef10

Browse files
committed
fix: guide app studio assistant for business users
1 parent 5911fef commit eceef10

2 files changed

Lines changed: 32 additions & 1 deletion

File tree

providers/app-studio/api/assistant_turn_profile_test.go

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,31 @@ func TestProjectAssistantPromptRequiresEvidenceForProductCapabilities(t *testing
304304
}
305305
}
306306

307+
func TestProjectAssistantPromptFramesAppStudioAsBusinessUserEasyButton(t *testing.T) {
308+
project := projectWithRepository("demo-repo", "demo", "github")
309+
project.Name = "demo-project"
310+
project.Spec.DisplayName = "Demo Project"
311+
repository := &ProjectRepositoryView{Ref: "demo-repo", Name: "demo", Status: projectRepositoryStatusReady, Ready: true}
312+
313+
prompt := projectSystemPrompt(project, repository, projectAssistantTurnProfileImplementation)
314+
lowerPrompt := strings.ToLower(prompt)
315+
for _, want := range []string{
316+
"business users",
317+
"non-technical",
318+
"easy button",
319+
"live development sandbox",
320+
"source changes run in that sandbox",
321+
"translate technical choices into business outcomes",
322+
"do not ask the user to choose databases, networking, infrastructure templates, or deployment architecture",
323+
"do not recommend a full application or runtime template just to satisfy a smaller need like persistent data",
324+
"separate development sandbox guidance from production launch guidance",
325+
} {
326+
if !strings.Contains(lowerPrompt, strings.ToLower(want)) {
327+
t.Fatalf("prompt missing business-user App Studio guidance %q:\n%s", want, prompt)
328+
}
329+
}
330+
}
331+
307332
func TestProjectAssistantTurnPolicyAllowsExpectedToolBundles(t *testing.T) {
308333
tests := []struct {
309334
name string

providers/app-studio/api/llm.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1573,6 +1573,10 @@ func projectSystemPrompt(p *aiv1alpha1.Project, repository *ProjectRepositoryVie
15731573
b.WriteString("Do not claim that you changed files or deployed resources unless a tool result or other evidence supports it. ")
15741574
b.WriteString("Do not invent App Studio product capabilities, UI tabs, cloud providers, infrastructure templates, setup flows, deployment targets, or integrations. ")
15751575
b.WriteString("For App Studio product capability questions, answer only from explicit evidence in tool results, project metadata, project memory, or this system prompt; if evidence is missing, say \"I don't see that capability available in this workspace\" and explain what you can verify. ")
1576+
b.WriteString("App Studio is an easy button for business users, including non-technical users who should not need to understand databases, networking, infrastructure templates, or deployment architecture to build useful apps. ")
1577+
b.WriteString("Translate technical choices into business outcomes and safe next steps. ")
1578+
b.WriteString("When a live development sandbox exists, assume App Studio source changes run in that sandbox; separate development sandbox guidance from production launch guidance. ")
1579+
b.WriteString("Do not ask the user to choose databases, networking, infrastructure templates, or deployment architecture when App Studio can infer a safe next step from their business intent and available evidence. ")
15761580
b.WriteString("When requirements are unclear, ask concise follow-up questions instead of guessing.\n\n")
15771581
b.WriteString("Conversation mode: " + string(profile) + "\n")
15781582
b.WriteString("Project metadata:\n")
@@ -1615,7 +1619,7 @@ func appendProjectAssistantModePrompt(b *strings.Builder, profile projectAssista
16151619
case projectAssistantTurnProfileGuidance:
16161620
b.WriteString("Give practical guidance, recommendations, and tradeoffs. Do not claim to know current file or runtime state unless tool evidence is available; ask the user for missing context in plain language when needed.\n")
16171621
case projectAssistantTurnProfileExploration:
1618-
b.WriteString("Use read-only App Studio workflow, workspace-read, and aggregate MCP infrastructure discovery tools when current project state or available infrastructure templates are needed. Prefer plan_project_changes, check_project_readiness, list_project_files, read_project_file, search_project_files, infrastructure__list_templates, infrastructure__describe_template, infrastructure__list_instances, and infrastructure__get_instance for bounded inspection. Do not edit, deploy, provision, or commit.\n")
1622+
b.WriteString("Use read-only App Studio workflow, workspace-read, and aggregate MCP infrastructure discovery tools when current project state or available infrastructure templates are needed. Prefer plan_project_changes, check_project_readiness, list_project_files, read_project_file, search_project_files, infrastructure__list_templates, infrastructure__describe_template, infrastructure__list_instances, and infrastructure__get_instance for bounded inspection. Treat infrastructure templates as capability evidence, not as a menu the user must operate. Explain template fit in business terms, and call out when a template includes more than the user asked for. Do not edit, deploy, provision, or commit.\n")
16191623
case projectAssistantTurnProfileDebugging:
16201624
b.WriteString("Diagnose in read-only mode. Use check_project_readiness, list_project_files, read_project_file, search_project_files, get_runtime_status, and get_preview_url as needed. Do not mutate files, deploy runtime resources, or commit unless the user explicitly asks you to fix the issue.\n")
16211625
case projectAssistantTurnProfileDebugFix:
@@ -1632,6 +1636,8 @@ func appendProjectAssistantBuilderPrompt(b *strings.Builder, repoRef string) {
16321636
b.WriteString("Use prepare_project_deployment before discussing deployment handoff so build artifact readiness, blockers, and runtime handoff constraints come from the App Studio graph workflow. ")
16331637
b.WriteString("Use deploy_project_runtime, get_runtime_status, and get_preview_url only as App Studio runtime graph workflows; they return structured not_configured blockers until a tenant RuntimeTarget exists. ")
16341638
b.WriteString("For supporting infrastructure, use infrastructure__list_templates before naming any available template, infrastructure__describe_template before recommending values, and infrastructure__provision only after the user explicitly asks to create supporting infrastructure and the permission flow approves the call. ")
1639+
b.WriteString("When the user asks for a supporting capability such as persistent data, first decide whether the current sandbox app can satisfy the development need before provisioning infrastructure. ")
1640+
b.WriteString("Do not recommend a full application or runtime template just to satisfy a smaller need like persistent data, and do not duplicate App Studio's sandbox runtime unless the user is explicitly moving toward a production launch. ")
16351641
b.WriteString("For existing projects, inspect relevant files in the App Studio workspace before editing: use list_project_files to discover paths, read_project_file for targeted files, and search_project_files when you need to locate code. ")
16361642
b.WriteString("When requirements are unclear during implementation, call ask_follow_up with at most three concise questions instead of guessing. ")
16371643
b.WriteString("Before source edits, call request_project_plan_approval with a concise batch plan, target path envelope, allowed edit operations, and acceptance criteria; after approval, keep workspace edits inside that envelope. ")

0 commit comments

Comments
 (0)