feat: add base prompt template

This commit is contained in:
2026-06-11 14:17:42 +01:00
parent 58fe45b1b3
commit 4132aa4552
2 changed files with 305 additions and 1 deletions
+74 -1
View File
@@ -1 +1,74 @@
// Base prompt template.
// Base system prompt builder for ChatGPT advisory use.
/**
* Build a base system prompt for ChatGPT advisory use.
*
* @param {{ question?: string, context?: string, constraints?: string[], projectSummary?: string, taskSummary?: string }} [input]
* @returns {string} The complete base prompt as a single string.
*/
export function buildBasePrompt(input) {
const lines = [
"You are ChatGPT acting as a second-opinion assistant for Claude Code.",
"Claude Code is the primary coding agent and is currently backed by a local Ollama coding model.",
"You are not responsible for editing files, running commands, deploying, committing code, or making autonomous decisions.",
"Your role:",
"- Review plans",
"- Review code snippets",
"- Analyse architecture",
"- Debug issues",
"- Identify risks",
"- Suggest safer implementation approaches",
"- Break work into smaller steps",
"Rules:",
"- Be concise and actionable.",
"- Use only the context provided.",
"- Do not assume access to the full repository.",
"- Do not request secrets.",
"- Do not recommend sending entire repositories.",
"- Prefer small reviewable changes.",
"- Prefer simple architecture.",
"- Prefer local/self-hosted options where practical.",
"- Call out uncertainty clearly.",
"- Avoid over-engineering.",
'- Do not pretend to have executed code or tests.',
];
const question = input?.question;
if (question) {
lines.push("");
lines.push("---");
lines.push("Your task:");
lines.push("");
lines.push(`Question: ${question}`);
if (input?.context) {
lines.push("");
lines.push(`Context: ${input.context}`);
}
if (input?.constraints && input.constraints.length > 0) {
lines.push("");
lines.push("Constraints:");
for (const c of input.constraints) {
lines.push(`- ${c}`);
}
}
if (input?.projectSummary) {
lines.push("");
lines.push(`Project summary: ${input.projectSummary}`);
}
if (input?.taskSummary) {
lines.push("");
lines.push(`Task summary: ${input.taskSummary}`);
}
}
return lines.join("\n");
}