import { readFileSync } from "node:fs";
import { resolve } from "node:path";
import { renderMdx } from "smithers-orchestrator";
import SystemPromptMdx from "./prompts/system-prompt.mdx";
const ROOT = resolve(new URL("../..", import.meta.url).pathname);
const PROMPTS = resolve(new URL("./prompts", import.meta.url).pathname);
function readDoc(path: string): string {
try { return readFileSync(resolve(ROOT, path), "utf8"); }
catch { return `[Could not read ${path}]`; }
}
function readPrompt(filename: string): string {
try { return readFileSync(resolve(PROMPTS, filename), "utf8"); }
catch { return `[Could not read prompt: ${filename}]`; }
}
const ClaudeMd = () => readDoc("CLAUDE.md");
const Architecture = () => readPrompt("architecture.md");
const CodingStandards = () => readPrompt("coding-standards.md");
const GitRules = () => readPrompt("git-rules.md");
const AlwaysGreen = () => readPrompt("always-green.md");
export const SYSTEM_PROMPT = renderMdx(SystemPromptMdx, {
components: {
ClaudeMd,
Architecture,
CodingStandards,
GitRules,
AlwaysGreen,
},
});