Browse Source

Tune prompts

Alvin Unreal 3 months ago
parent
commit
685906f398
2 changed files with 14 additions and 7 deletions
  1. 11 4
      src/agents/orchestrator.ts
  2. 3 3
      src/config/constants.ts

+ 11 - 4
src/agents/orchestrator.ts

@@ -28,21 +28,24 @@ export function resolvePrompt(
 const AGENT_DESCRIPTIONS: Record<string, string> = {
   explorer: `@explorer
 - Role: Parallel search specialist for discovering unknowns across the codebase
-- Stats: 3x faster codebase search than orchestrator, 1/2 cost of orchestrator
+- Permissions: Read files
+- Stats: 2x faster codebase search than orchestrator, 1/2 cost of orchestrator
 - Capabilities: Glob, grep, AST queries to locate files, symbols, patterns
 - **Delegate when:** Need to discover what exists before planning • Parallel searches speed discovery • Need summarized map vs full contents • Broad/uncertain scope
 - **Don't delegate when:** Know the path and need actual content • Need full file anyway • Single specific lookup • About to edit the file`,
 
   librarian: `@librarian
 - Role: Authoritative source for current library docs and API references
+- Permissions: None
 - Stats: 10x better finding up-to-date library docs than orchestrator, 1/2 cost of orchestrator
 - Capabilities: Fetches latest official docs, examples, API signatures, version-specific behavior via grep_app MCP
 - **Delegate when:** Libraries with frequent API changes (React, Next.js, AI SDKs) • Complex APIs needing official examples (ORMs, auth) • Version-specific behavior matters • Unfamiliar library • Edge cases or advanced features • Nuanced best practices
-- **Don't delegate when:** Standard usage you're confident about (\`Array.map()\`, \`fetch()\`) • Simple stable APIs • General programming knowledge • Info already in conversation • Built-in language features
+- **Don't delegate when:** Standard usage you're confident • Simple stable APIs • General programming knowledge • Info already in conversation • Built-in language features
 - **Rule of thumb:** "How does this library work?" → @librarian. "How does programming work?" → yourself.`,
 
   oracle: `@oracle
 - Role: Strategic advisor for high-stakes decisions and persistent problems, code reviewer
+- Permissions: Read files
 - Stats: 5x better decision maker, problem solver, investigator than orchestrator, 0.8x speed of orchestrator, same cost.
 - Capabilities: Deep architectural reasoning, system-level trade-offs, complex debugging, code review, simplification, maintainability review
 - **Delegate when:** Major architectural decisions with long-term impact • Problems persisting after 2+ fix attempts • High-risk multi-system refactors • Costly trade-offs (performance vs maintainability) • Complex debugging with unclear root cause • Security/scalability/data integrity decisions • Genuinely uncertain and cost of wrong choice is high • When a workflow calls for a **reviewer** subagent • Code needs simplification or YAGNI scrutiny
@@ -51,14 +54,16 @@ const AGENT_DESCRIPTIONS: Record<string, string> = {
 
   designer: `@designer
 - Role: UI/UX specialist for intentional, polished experiences
+- Permissions: Read/write files
 - Stats: 10x better UI/UX than orchestrator
-- Capabilities: Visual relevant edits, interactions, responsive layouts, design systems with aesthetic intent, deep UI/UX knowledge; can edits files directly
+- Capabilities: Visual relevant edits, interactions, responsive layouts, design systems with aesthetic intent, deep UI/UX knowledge.
 - **Delegate when:** User-facing interfaces needing polish • Responsive layouts • UX-critical components (forms, nav, dashboards) • Visual consistency systems • Animations/micro-interactions • Landing/marketing pages • Refining functional→delightful • Reviewing existing UI/UX quality
 - **Don't delegate when:** Backend/logic with no visual • Quick prototypes where design doesn't matter yet
 - **Rule of thumb:** Users see it and polish matters? → @designer. Headless/functional? → yourself.`,
 
   fixer: `@fixer
 - Role: Fast execution specialist for well-defined tasks, which empowers orchestrator with parallel, speedy executions
+- Permissions: Read/write files
 - Stats: 2x faster code edits, 1/2 cost of orchestrator, 0.8x quality of orchestrator
 - Tools/Constraints: Execution-focused—no research, no architectural decisions
 - **Delegate when:** For implementation work, think and triage first. If the change is non-trivial or multi-file, hand bounded execution to @fixer • Writing or updating tests • Tasks that touch test files, fixtures, mocks, or test helpers. Parallelization benefits: Task involves multiple folders and multiple files modificaiton, scoping work per folder and spawning parallel @fixers for each folder.
@@ -67,6 +72,7 @@ const AGENT_DESCRIPTIONS: Record<string, string> = {
 
   council: `@council
 - Role: Multi-LLM consensus engine for high-confidence answers
+- Permissions: Read files
 - Stats: 3x slower than orchestrator, 3x or more cost of orchestrator
 - Capabilities: Runs multiple models in parallel, synthesizes their responses via a council master
 - **Delegate when:** Critical decisions needing diverse model perspectives • High-stakes architectural choices where consensus reduces risk • Ambiguous problems where multi-model disagreement is informative • Security-sensitive design reviews
@@ -76,9 +82,10 @@ const AGENT_DESCRIPTIONS: Record<string, string> = {
 
   observer: `@observer
 - Role: Visual analysis specialist for images, PDFs, and diagrams
+- Permissions: Read files
 - Stats: Saves main context tokens — Observer processes raw files, returns structured observations
 - Capabilities: Interprets images, screenshots, PDFs, and diagrams via native read tool; extracts UI elements, layouts, text, relationships
-- **Delegate when:** Need to analyze a screenshot or image • Extract information from a PDF • Interpret a diagram or architecture drawing • Visual content needs structured description for downstream agents
+- **Delegate when:** Need to analyze a multimedia file• Extract information
 - **Don't delegate when:** Plain text files that Read can handle directly • Files that need editing afterward (need literal content from Read)
 - **Rule of thumb:** Even if your model supports vision, delegate visual analysis to @observer — it isolates large image/PDF bytes from your context window, returning only concise structured text. Need exact file contents for editing? → Read it yourself.
 - **IMPORTANT:** When delegating to @observer, always include the **full file path** in the prompt so it can read the file. Example: "Analyze the screenshot at /path/to/file.png — describe the UI elements and error messages."`,

+ 3 - 3
src/config/constants.ts

@@ -100,9 +100,9 @@ export const FALLBACK_FAILOVER_TIMEOUT_MS = 15_000;
 export const DEFAULT_MAX_SUBAGENT_DEPTH = 3;
 
 // Workflow reminders
-export const PHASE_REMINDER_TEXT = `Recall Workflow Rules:
-Understand → build the best path (delegated based on Agent rules, split and parallelized as much as possible) → execute → verify.
-If delegating, launch the specialist in the same turn you mention it.`;
+export const PHASE_REMINDER_TEXT = `!IMPORTANT! Recall the workflow rules:
+Understand → choose the best parallelized path based on your agents delegation rules → don't prefer solo → execute → verify.
+If delegating, launch the specialist in the same turn you mention it !END!`;
 
 // Tmux pane spawn delay (ms) — gives TmuxSessionManager time to create pane
 export const TMUX_SPAWN_DELAY_MS = 500;