feat: init sproutclaw-web — Go+Gin backend + React frontend
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
17
backend/internal/services/system_prompt.go
Normal file
17
backend/internal/services/system_prompt.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package services
|
||||
|
||||
import "os"
|
||||
|
||||
// ReadSystemPrompt reads AGENTS.md content.
|
||||
func ReadSystemPrompt(path string) (string, error) {
|
||||
data, err := os.ReadFile(path)
|
||||
if os.IsNotExist(err) {
|
||||
return "", nil
|
||||
}
|
||||
return string(data), err
|
||||
}
|
||||
|
||||
// WriteSystemPrompt writes AGENTS.md content.
|
||||
func WriteSystemPrompt(path, content string) error {
|
||||
return os.WriteFile(path, []byte(content), 0o644)
|
||||
}
|
||||
Reference in New Issue
Block a user