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
feat(utils): implement static and dynamic system prompt
| File | Description |
| --- | --- |
| src/constants/prompt.ts | Static base system prompt with coding assistant persona and tool instructions |
| src/utils/agents.ts | Dynamic loader that combines base prompt with AGENTS.md content (if present) |
| src/components/Chat.tsx | Initializes messages state with system message |
| src/utils/agents.test.ts | Tests for system prompt building |
Features:
- Base prompt uses TUI-style imperative instructions ("You are
a coding assistant... Always use tools...")
- Dynamically loads `AGENTS.md` from current working directory at startup
- Combines both into a single system message as the first message in
every conversation
- Gracefully handles missing `AGENTS.md` or file read errors
exportconstBASE_SYSTEM_PROMPT=`You are a coding assistant that helps users write, edit, and understand code. You have access to tools for reading files, writing files, running shell commands, and searching code
2
+
3
+
Follow these rules:
4
+
1. Always use available tools rather than guessing file contents or code behavior
5
+
2. Read files before editing them to understand context
6
+
3. When writing files, provide complete, working code
7
+
4. Explain your reasoning when making non-trivial changes
8
+
5. Prefer minimal changes that achieve the goal
9
+
6. Confirm with the user before destructive operations
10
+
11
+
When tools return results, incorporate them into your response naturally`;
12
+
13
+
exportconstTOOL_INSTRUCTIONS=`Available tools:
14
+
- read_file: Read file contents at a path
15
+
- write_file: Write content to a file (requires approval)
0 commit comments