oracle.ts 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. `;
  21. export function createOracleAgent(
  22. model: string,
  23. customPrompt?: string,
  24. customAppendPrompt?: string,
  25. ): AgentDefinition {
  26. let prompt = ORACLE_PROMPT;
  27. if (customPrompt) {
  28. prompt = customPrompt;
  29. } else if (customAppendPrompt) {
  30. prompt = `${ORACLE_PROMPT}\n\n${customAppendPrompt}`;
  31. }
  32. return {
  33. name: 'oracle',
  34. description:
  35. 'Strategic technical advisor. Use for architecture decisions, complex debugging, code review, simplification, and engineering guidance.',
  36. config: {
  37. model,
  38. temperature: 0.1,
  39. prompt,
  40. },
  41. };
  42. }