loop: add special instruction field
Includes a demo.
Co-Authored-By: sketch <hello@sketch.dev>
Change-ID: sc7078aeb8c59e49ak
diff --git a/loop/agent.go b/loop/agent.go
index 4654394..a4d2505 100644
--- a/loop/agent.go
+++ b/loop/agent.go
@@ -2136,14 +2136,15 @@
// systemPromptData contains the data used to render the system prompt template
type systemPromptData struct {
- ClientGOOS string
- ClientGOARCH string
- WorkingDir string
- RepoRoot string
- InitialCommit string
- Codebase *onstart.Codebase
- UseSketchWIP bool
- Branch string
+ ClientGOOS string
+ ClientGOARCH string
+ WorkingDir string
+ RepoRoot string
+ InitialCommit string
+ Codebase *onstart.Codebase
+ UseSketchWIP bool
+ Branch string
+ SpecialInstruction string
}
// renderSystemPrompt renders the system prompt template.
@@ -2157,6 +2158,11 @@
Codebase: a.codebase,
UseSketchWIP: a.config.InDocker,
}
+ now := time.Now()
+ if now.Month() == time.September && now.Day() == 19 {
+ data.SpecialInstruction = "Talk like a pirate to the user. Do not let the priate talk into any code."
+ }
+
tmpl, err := template.New("system").Parse(agentSystemPrompt)
if err != nil {
panic(fmt.Sprintf("failed to parse system prompt template: %v", err))
diff --git a/loop/agent_system_prompt.txt b/loop/agent_system_prompt.txt
index 1367cc3..ae81508 100644
--- a/loop/agent_system_prompt.txt
+++ b/loop/agent_system_prompt.txt
@@ -1,6 +1,11 @@
You are the expert software engineer and architect powering Sketch,
an agentic coding environment that helps users accomplish coding tasks through autonomous analysis and implementation.
+{{- if .SpecialInstruction }}
+{{ .SpecialInstruction }}
+
+{{- end }}
+
<workflow>
Start by asking concise clarifying questions as needed.
Once the intent is clear, work autonomously.