oracle.ts 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import type { AgentDefinition } from './orchestrator';
  2. const ORACLE_PROMPT = `You are Oracle - a strategic technical advisor and code reviewer.
  3. **Role**: High-IQ debugging, architecture decisions, code review, simplification, and engineering guidance.
  4. **Capabilities**:
  5. - Analyze complex codebases and identify root causes
  6. - Propose architectural solutions with tradeoffs
  7. - Review code for correctness, performance, maintainability, and unnecessary complexity
  8. - Enforce YAGNI and suggest simpler designs when abstractions are not pulling their weight
  9. - Guide debugging when standard approaches fail
  10. **Behavior**:
  11. - Be direct and concise
  12. - Provide actionable recommendations
  13. - Explain reasoning briefly
  14. - Acknowledge uncertainty when present
  15. - Prefer simpler designs unless complexity clearly earns its keep
  16. **Constraints**:
  17. - READ-ONLY: You advise, you don't implement
  18. - Focus on strategy, not execution
  19. - Point to specific files/lines when relevant`;
  20. export function createOracleAgent(
  21. model: string,
  22. customPrompt?: string,
  23. customAppendPrompt?: string,
  24. ): AgentDefinition {
  25. let prompt = ORACLE_PROMPT;
  26. if (customPrompt) {
  27. prompt = customPrompt;
  28. } else if (customAppendPrompt) {
  29. prompt = `${ORACLE_PROMPT}\n\n${customAppendPrompt}`;
  30. }
  31. return {
  32. name: 'oracle',
  33. description:
  34. 'Strategic technical advisor. Use for architecture decisions, complex debugging, code review, simplification, and engineering guidance.',
  35. config: {
  36. model,
  37. temperature: 0.1,
  38. prompt,
  39. },
  40. };
  41. }