Read from AGENTS.md before CONTEXT.md

This commit is contained in:
Alex Gleason committed 2025-08-31 20:44:50 -05:00
1 parent 3cdfe63d41
commit 39c526baf4
1 file changed
+5 -4
+5 -4
View File
@@ -57,22 +57,23 @@ export async function makeSystemPrompt(opts: MakeSystemPromptOpts): Promise<stri
// README.md not found, continue
}
// Add context from CONTEXT.md if it exists
// Add context from AGENTS.md if it exists
try {
const { text } = await getContext(fs, cwd);
const { text } = await getAgentContext(fs, cwd);
system += "\n\n" + text;
} catch {
// CONTEXT.md not found, continue
// AGENTS.md not found, continue
}
return system;
}
async function getContext(
async function getAgentContext(
fs: JSRuntimeFS,
cwd: string,
): Promise<{ filename: string; text: string }> {
const contextFiles = [
"AGENTS.md",
"CONTEXT.md",
"CLAUDE.md",
"codex.md",