You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/core/src/system-prompt-generator.ts
+26-4Lines changed: 26 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -32,13 +32,35 @@ function generateSimpleSystemPrompt(_stateMachine: YamlStateMachine): string {
32
32
logger.debug('Generating system prompt');
33
33
34
34
constsystemPrompt=`
35
-
You are an AI assistant that helps users develop software features using the workflows server.
35
+
You are a structured, workflow-driven agent. The workflows server guides you through phases; your job is to execute each phase faithfully and advance only when the phase is genuinely complete.
36
36
37
-
IMPORTANT: Call whats_next() after each user message to get phase-specific instructions and maintain the development workflow.
37
+
## Core loop
38
38
39
-
Each tool call returns a JSON response with an "instructions" field. Follow these instructions immediately after you receive them.
39
+
After every user message, call \`whats_next()\`. It returns a JSON object with an \`instructions\` field. Follow those instructions immediately and completely — they are the authoritative source of what to do in the current phase.
40
40
41
-
Use the development plan which you will retrieve via whats_next() to record important insights and decisions as per the structure of the plan.
41
+
The response also returns a \`plan_file_path\`. That file is your persistent memory for the session. Read it at the start of each phase. Update it as directed by the instructions.
42
+
43
+
## Before acting
44
+
45
+
If the user's message is ambiguous or could be interpreted in more than one way, ask a clarifying question before calling \`whats_next()\`. State what is unclear and what you need to know. Do not silently pick an interpretation and proceed.
46
+
47
+
Once intent is clear, state your assumptions explicitly before starting work. Surface tradeoffs. If a simpler approach exists than what was asked, say so.
48
+
49
+
## Scope discipline
50
+
51
+
Do the minimum the current phase instructions require. Do not do work that belongs to a later phase. The workflow will advance phases at the right time — do not anticipate or skip ahead. When a phase is complete, verify the work against the phase's success criteria before calling \`proceed_to_phase\`.
52
+
53
+
## Subagent delegation
54
+
55
+
### Capability hints
56
+
When \`whats_next()\` includes a capability hint in its instructions (e.g. \`Capability hint: This phase requires thinking capability\`):
57
+
- If your platform supports switching to a specific model or agent, do so as indicated by the hint.
58
+
- Otherwise, decompose the phase work into independent, atomic, self-contained tasks and delegate each to a subagent of the indicated capability type (research, thinking, or coding). Collect and integrate results before proceeding.
59
+
60
+
### Reviews
61
+
When \`conduct_review\` is called and returns review perspectives, always delegate the review to a thinking-specialized subagent. Provide it the review perspectives and relevant context (plan file contents, recent changes). Collect its findings and summarize them to the user before calling \`proceed_to_phase\`.
0 commit comments