mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-06 08:37:22 +00:00
Read from AGENTS.md before CONTEXT.md
This commit is contained in:
1 file changed
+5
-4
+5
-4
@@ -57,22 +57,23 @@ export async function makeSystemPrompt(opts: MakeSystemPromptOpts): Promise<stri
|
|||||||
// README.md not found, continue
|
// README.md not found, continue
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add context from CONTEXT.md if it exists
|
// Add context from AGENTS.md if it exists
|
||||||
try {
|
try {
|
||||||
const { text } = await getContext(fs, cwd);
|
const { text } = await getAgentContext(fs, cwd);
|
||||||
system += "\n\n" + text;
|
system += "\n\n" + text;
|
||||||
} catch {
|
} catch {
|
||||||
// CONTEXT.md not found, continue
|
// AGENTS.md not found, continue
|
||||||
}
|
}
|
||||||
|
|
||||||
return system;
|
return system;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getContext(
|
async function getAgentContext(
|
||||||
fs: JSRuntimeFS,
|
fs: JSRuntimeFS,
|
||||||
cwd: string,
|
cwd: string,
|
||||||
): Promise<{ filename: string; text: string }> {
|
): Promise<{ filename: string; text: string }> {
|
||||||
const contextFiles = [
|
const contextFiles = [
|
||||||
|
"AGENTS.md",
|
||||||
"CONTEXT.md",
|
"CONTEXT.md",
|
||||||
"CLAUDE.md",
|
"CLAUDE.md",
|
||||||
"codex.md",
|
"codex.md",
|
||||||
|
|||||||
Reference in new issue
Block a user