This commit is contained in:
Harivansh Rathi 2026-03-05 22:17:20 -08:00
parent 0973c1cbc5
commit 3cf69a35f8
5 changed files with 123 additions and 14 deletions

View file

@ -269,6 +269,16 @@ Content`,
expect(agentsFiles.some((f) => f.path.includes("AGENTS.md"))).toBe(true);
});
it("should discover SOUL.md from the project root", async () => {
writeFileSync(join(cwd, "SOUL.md"), "# Soul\n\nBe less corporate.");
const loader = new DefaultResourceLoader({ cwd, agentDir });
await loader.reload();
const { agentsFiles } = loader.getAgentsFiles();
expect(agentsFiles.some((f) => f.path.endsWith("SOUL.md"))).toBe(true);
});
it("should discover SYSTEM.md from cwd/.pi", async () => {
const piDir = join(cwd, ".pi");
mkdirSync(piDir, { recursive: true });

View file

@ -76,4 +76,21 @@ describe("buildSystemPrompt", () => {
expect(prompt.match(/- Use dynamic_tool for summaries\./g)).toHaveLength(1);
});
});
describe("SOUL.md context", () => {
test("adds persona guidance when SOUL.md is present", () => {
const prompt = buildSystemPrompt({
contextFiles: [
{
path: "/tmp/project/SOUL.md",
content: "# Soul\n\nBe sharp.",
},
],
skills: [],
});
expect(prompt).toContain("If SOUL.md is present, embody its persona and tone.");
expect(prompt).toContain("## /tmp/project/SOUL.md");
});
});
});