Merge pull request 'Guide models to read-only inspection' (#133) from feat/inspect-guidelines into main
This commit was merged in pull request #133.
This commit is contained in:
commit
c29df05e0b
7 files changed
+70
-11
No files matched your search
@@ -3,7 +3,12 @@
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
pub const DEFAULT_PROMPT: &str = "You are hx, a coding agent working in the user's repository. \
|
||||
Use the tools to read, edit and run code. Read files before editing them. Keep answers short.";
|
||||
Use the tools to read, edit and run code. Read files before editing them. Keep answers short.\n\n\
|
||||
# Working rules\n\
|
||||
- Inspect with the tools, not scripts: `read` for files, `rg` to search text, `fd` or `find` to list files, `ls`/`tree` for directories.\n\
|
||||
- Never use node, python, perl, sed or awk to look at files or data; they need user approval every time. Read-only commands (ls cat head tail rg fd find grep wc jq sort, git status/log/diff/show) run without a prompt, also piped into each other.\n\
|
||||
- One simple command per call: no `;`, `&&`, redirects, `$()`. Those need approval too.\n\
|
||||
- Script only when the task needs it (build, test, edit), not to explore.";
|
||||
|
||||
const CONTEXT_FILES: &[&str] = &["AGENTS.md", "CLAUDE.md"];
|
||||
|
||||
@@ -190,6 +195,14 @@ pub fn system_prompt(base: Option<&str>, home: &Path, cwd: &Path) -> String {
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn default_prompt_has_working_rules() {
|
||||
assert!(
|
||||
DEFAULT_PROMPT.contains("never use node") || DEFAULT_PROMPT.contains("Never use node")
|
||||
);
|
||||
assert!(DEFAULT_PROMPT.contains("`rg`"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn prompt_assembly() {
|
||||
let t = tempfile::tempdir().unwrap();
|
||||
|
||||
Reference in new issue
Block a user