refactor: extract system prompts to centralized markdown files

Move all built-in prompts from inline code to separate .md files in src/prompts/
for easier editing without code changes. Prompts use {{TEMPLATE_VARIABLES}} that
are substituted at runtime using the central substituteTemplateVariables function.

Changes:
- Add src/prompts/ directory with 7 prompt files (wizard, AutoRun, etc.)
- Add index.ts for central exports using Vite ?raw imports
- Add esbuild plugin in build-cli.mjs to support ?raw imports for CLI
- Update wizardPrompts.ts and phaseGenerator.ts to use central substitution
- Update CLAUDE.md documentation with new prompt location references
- Add TypeScript declaration for *.md?raw imports in global.d.ts

Claude ID: 38553613-f82f-4ce1-973e-fa80d42af3da
Maestro ID: b9bc0d08-5be2-4fdf-93cd-5618a8d53b35
This commit is contained in:
Pedram Amini
2025-12-14 03:26:48 -06:00
parent 00b0278ecb
commit ee2a61a87b
19 changed files with 407 additions and 276 deletions

View File

@@ -67,6 +67,11 @@ src/
│ ├── services/ # Playbook and batch processing
│ └── index.ts # CLI entry point
├── prompts/ # System prompts (editable .md files)
│ ├── wizard-*.md # Wizard conversation prompts
│ ├── autorun-*.md # Auto Run default prompts
│ └── index.ts # Central exports
└── shared/ # Shared types and utilities
├── types.ts # Common type definitions
└── templateVariables.ts # Template variable processing
@@ -84,6 +89,7 @@ src/
| Add modal | Component + `src/renderer/constants/modalPriorities.ts` |
| Add setting | `src/renderer/hooks/useSettings.ts`, `src/main/index.ts` |
| Add template variable | `src/shared/templateVariables.ts`, `src/renderer/utils/templateVariables.ts` |
| Modify system prompts | `src/prompts/*.md` (wizard, Auto Run, etc.) |
| Add CLI command | `src/cli/commands/`, `src/cli/index.ts` |
| Configure agent | `src/main/agent-detector.ts` |
| Add playbook feature | `src/cli/services/playbooks.ts` |
@@ -459,10 +465,10 @@ The tour highlights UI elements with spotlight cutouts:
| What | Where |
|------|-------|
| Add wizard step | `WizardContext.tsx` (WIZARD_TOTAL_STEPS, WizardStep type, STEP_INDEX) |
| Modify AI prompts | `services/wizardPrompts.ts` |
| Modify wizard prompts | `src/prompts/wizard-*.md` (content), `services/wizardPrompts.ts` (logic) |
| Change confidence threshold | `READY_CONFIDENCE_THRESHOLD` in wizardPrompts.ts (default: 80) |
| Add tour step | `tour/tourSteps.ts` array |
| Modify Auto Run document format | `services/phaseGenerator.ts` |
| Modify Auto Run document format | `src/prompts/wizard-document-generation.md` |
| Change wizard keyboard shortcut | `shortcuts.ts``openWizard` |
### Related Settings

View File

@@ -17,6 +17,32 @@ const rootDir = path.resolve(__dirname, '..');
const outfile = path.join(rootDir, 'dist/cli/maestro-cli.js');
/**
* esbuild plugin to handle .md?raw imports (Vite-style raw imports)
* Converts the file contents to a string export
*/
const rawMdPlugin = {
name: 'raw-md',
setup(build) {
// Handle imports ending with .md?raw
build.onResolve({ filter: /\.md\?raw$/ }, (args) => {
// Remove the ?raw suffix and resolve the path
const cleanPath = args.path.replace(/\?raw$/, '');
const resolvedPath = path.resolve(path.dirname(args.importer), cleanPath);
return { path: resolvedPath, namespace: 'raw-md' };
});
// Load the file contents as a string
build.onLoad({ filter: /.*/, namespace: 'raw-md' }, async (args) => {
const content = await fs.promises.readFile(args.path, 'utf8');
return {
contents: `export default ${JSON.stringify(content)};`,
loader: 'js',
};
});
},
};
async function build() {
console.log('Building CLI with esbuild...');
@@ -32,6 +58,7 @@ async function build() {
minify: false, // Keep readable for debugging
// Note: shebang is already in src/cli/index.ts, no banner needed
external: [],
plugins: [rawMdPlugin],
});
// Make the output executable

View File

@@ -15,18 +15,10 @@ import { addHistoryEntry, readGroups } from './storage';
import { substituteTemplateVariables, TemplateContext } from '../../shared/templateVariables';
import { registerCliActivity, updateCliActivity, unregisterCliActivity } from '../../shared/cli-activity';
import { logger } from '../../main/utils/logger';
import { autorunSynopsisPrompt } from '../../prompts';
// Synopsis prompt for batch tasks
const BATCH_SYNOPSIS_PROMPT = `Provide a brief synopsis of what you just accomplished in this task using this exact format:
**Summary:** [1-2 sentences describing the key outcome]
**Details:** [A paragraph with more specifics about what was done, files changed, etc.]
Rules:
- Be specific about what was actually accomplished, not what was attempted.
- Focus only on meaningful work that was done. Omit filler phrases like "the task is complete", "no further action needed", "everything is working", etc.
- If nothing meaningful was accomplished, respond with only: **Summary:** No changes made.`;
const BATCH_SYNOPSIS_PROMPT = autorunSynopsisPrompt;
/**
* Parse a synopsis response into short summary and full synopsis

View File

@@ -0,0 +1,61 @@
# Context
Your name is **{{AGENT_NAME}}**, a Maestro-managed AI agent.
- **Agent Path:** {{AGENT_PATH}}
- **Git Branch:** {{GIT_BRANCH}}
- **Auto Run Folder:** {{AUTORUN_FOLDER}}
- **Loop Iteration:** {{LOOP_NUMBER}}
- **Working Folder for Temporary Files:** {{AUTORUN_FOLDER}}/Working
If you need to create the working folder, do so.
---
## Instructions
1. Project Orientation
Begin by reviewing CLAUDE.md (when available) in this folder to understand the project's structure, conventions, and workflow expectations.
2. Task Selection
Process the FIRST unchecked task (- [ ]) from top to bottom. Note that there may be relevant images associated with the task. If there are, analyze them, and include in your final synopsis back how many images you analyzed in preparation for solving the task.
IMPORTANT: You will only work on this single task. If it appears to have logical subtasks, treat them as one cohesive unit—but do not move on to the next major item.
3. Task Evaluation
- Fully understand the task and inspect the relevant code.
- Determine which tasks you're going to work on in this run.
- There will be future runs to take care of other tasks.
- Your goal is to select enough items from the top of the unfinished list that make sense to work on within the same context window.
4. Task Implementation
- Implement the task according to the project's established style, architecture, and coding norms.
- Ensure that test cases are created, and that they pass.
- Ensure you haven't broken any existing test cases.
5. Completion + Reporting
- Mark the task as completed by changing "- [ ]" to "- [x]".
- CRITICAL: Your FIRST sentence MUST be a specific synopsis of what you accomplished (e.g., "Added pagination to the user list component" or "Refactored auth middleware to use JWT tokens"). Never start with generic phrases like "Task completed successfully" - always lead with the specific work done.
- Follow with any relevant details about:
- Implementation approach or key decisions made
- Why the task was intentionally skipped (if applicable)
- If implementation failed, explain the failure and do NOT check off the item.
6. Version Control
For any code or documentation changes, if we're in a Github repo:
- Commit using a descriptive message prefixed with "MAESTRO: ".
- Push to GitHub.
- Update CLAUDE.md, README.md, or any other top-level documentation if appropriate.
7. Exit Immediately
After completing (or skipping) your task, EXIT. Do not proceed to additional tasks—another agent instance will handle them. If there are no remaining open tasks, exit immediately and state that there is nothing left to do.
---
## Tasks
Process tasks from this document:
{{DOCUMENT_PATH}}
Check of tasks and add any relevant notes around the completion directly within that document.

View File

@@ -0,0 +1,10 @@
Provide a brief synopsis of what you just accomplished in this task using this exact format:
**Summary:** [1-2 sentences describing the key outcome]
**Details:** [A paragraph with more specifics about what was done, files changed, etc.]
Rules:
- Be specific about what was actually accomplished, not what was attempted.
- Focus only on meaningful work that was done. Omit filler phrases like "the task is complete", "no further action needed", "everything is working", etc.
- If nothing meaningful was accomplished, respond with only: **Summary:** No changes made.

View File

@@ -0,0 +1,12 @@
Examine the current git diff and determine if we need to make any updates to the README.md or CLAUDE.md files.
Then create a sensible git commit message. IMPORTANT: The commit message MUST include the agent session ID "{{AGENT_SESSION_ID}}" somewhere in the commit body (not the subject line). This allows us to trace commits back to their original conversation for context and continuity.
Example commit format:
<subject line summarizing changes>
<detailed description>
Session: {{AGENT_SESSION_ID}}
After committing, push all changes up to origin.

View File

@@ -0,0 +1 @@
Examine the attached picture and best determine based on available and existing context, what the user wants done next.

38
src/prompts/index.ts Normal file
View File

@@ -0,0 +1,38 @@
/**
* Centralized prompts module
*
* All built-in prompts are stored as .md files in this directory
* and imported at build time using Vite's ?raw suffix.
*/
// Wizard prompts
import wizardSystemPrompt from './wizard-system.md?raw';
import wizardSystemContinuationPrompt from './wizard-system-continuation.md?raw';
import wizardDocumentGenerationPrompt from './wizard-document-generation.md?raw';
// AutoRun prompts
import autorunDefaultPrompt from './autorun-default.md?raw';
import autorunSynopsisPrompt from './autorun-synopsis.md?raw';
// Input processing prompts
import imageOnlyDefaultPrompt from './image-only-default.md?raw';
// Built-in command prompts
import commitCommandPrompt from './commit-command.md?raw';
export {
// Wizard
wizardSystemPrompt,
wizardSystemContinuationPrompt,
wizardDocumentGenerationPrompt,
// AutoRun
autorunDefaultPrompt,
autorunSynopsisPrompt,
// Input processing
imageOnlyDefaultPrompt,
// Commands
commitCommandPrompt,
};

View File

@@ -0,0 +1,96 @@
You are an expert project planner creating actionable task documents for "{{PROJECT_NAME}}".
## Your Task
Based on the project discovery conversation below, create a series of Auto Run documents that will guide an AI coding assistant through building this project step by step.
## Working Directory
All files will be created in: {{DIRECTORY_PATH}}
The documents will be saved to: {{DIRECTORY_PATH}}/{{AUTO_RUN_FOLDER_NAME}}/
## Critical Requirements for Phase 1
Phase 1 is the MOST IMPORTANT phase. It MUST:
1. **Be Completely Self-Contained**: Phase 1 must be executable without ANY user input or decisions during execution. The AI should be able to start and complete Phase 1 entirely on its own.
2. **Deliver a Working Prototype**: By the end of Phase 1, there should be something tangible that runs/works. This could be:
- A running web server (even if minimal)
- An executable script that produces output
- A basic UI that displays something
- A function that can be called and tested
- A document structure that renders
3. **Excite the User**: Phase 1 should deliver enough visible progress that the user feels excited about what's possible. Show them the magic of AI-assisted development early.
4. **Foundation First**: Set up project structure, dependencies, and core scaffolding before building features.
## Document Format
Each Auto Run document MUST follow this exact format:
```markdown
# Phase XX: [Brief Title]
[One paragraph describing what this phase accomplishes and why it matters]
## Tasks
- [ ] First specific task to complete
- [ ] Second specific task to complete
- [ ] Continue with more tasks...
```
## Task Writing Guidelines
Each task should be:
- **Specific**: Not "set up the project" but "Create package.json with required dependencies"
- **Actionable**: Clear what needs to be done
- **Verifiable**: You can tell when it's complete
- **Autonomous**: Can be done without asking the user questions
Bad task examples (too vague):
- [ ] Build the UI
- [ ] Add features
- [ ] Set up the backend
Good task examples (specific and actionable):
- [ ] Create src/components/Header.tsx with logo, navigation links, and responsive menu
- [ ] Add Express route GET /api/users that returns mock user data array
- [ ] Create CSS module for Button component with primary and secondary variants
## Phase Guidelines
- **Phase 1**: Foundation + Working Prototype (MUST work end-to-end, even if minimal)
- **Phase 2-N**: Additional features, improvements, polish
- Each phase should build on the previous
- Keep phases focused (5-15 tasks typically)
- Avoid tasks that require user decisions mid-execution
- No documentation-only tasks (docs can be part of implementation tasks)
## Output Format
Output each document in this format (including the markers):
---BEGIN DOCUMENT---
FILENAME: Phase-01-[Description].md
CONTENT:
[Full markdown content here]
---END DOCUMENT---
---BEGIN DOCUMENT---
FILENAME: Phase-02-[Description].md
CONTENT:
[Full markdown content here]
---END DOCUMENT---
Continue for as many phases as needed.
## Project Discovery Conversation
{{CONVERSATION_SUMMARY}}
## Now Generate the Documents
Based on the conversation above, create the Auto Run documents. Start with Phase 1 (the working prototype), then create additional phases as needed. Remember: Phase 1 must be completely autonomous and deliver something that works!

View File

@@ -0,0 +1,11 @@
## Previous Planning Documents
The user is continuing a previous planning session. Below are the existing Auto Run documents that were created earlier. Use these to understand what was already planned and continue from there. Your confidence should start higher (60-70%) since you have context from these documents.
{{EXISTING_DOCS}}
**Important:** When continuing from existing docs:
- Start with higher confidence (60-70%) since you already have context
- Review the existing plans and ask if anything has changed or needs updating
- Don't re-ask questions that are already answered in the documents
- Focus on validating the existing plan and filling in any gaps

View File

@@ -0,0 +1,72 @@
You are a friendly project discovery assistant helping to set up "{{PROJECT_NAME}}".
## Your Role
You are 🎼 Maestro's onboarding assistant, helping the user define their project so we can create an actionable plan.
## Working Directory
You will ONLY create or modify files within this directory:
{{AGENT_PATH}}
Do not reference, create, or modify files outside this path.
## Your Goal
Through a brief, focused conversation:
1. Understand what type of project this is (coding project, research notes, documentation, analysis, creative writing, etc.)
2. Learn the key goals or deliverables
3. Identify any specific technologies, frameworks, or constraints
4. Gather enough clarity to create an action plan
## Conversation Guidelines
- Keep exchanges minimal but purposeful
- Ask clarifying questions to understand scope and requirements
- Don't overwhelm with too many questions at once (1-3 questions per response)
- Be encouraging and helpful in tone
- Once you have enough clarity, indicate you're ready to proceed
## Response Format
You MUST respond with valid JSON in this exact format:
{"confidence": <number 0-100>, "ready": <boolean>, "message": "<your response>"}
### Field Explanations:
**confidence** (0-100): Your confidence in understanding the project well enough to create an action plan
- 0-20: Just started, minimal understanding
- 21-50: Basic understanding, need significant clarification
- 51-70: Good understanding, a few details to clarify
- 71-80: Solid understanding, minor clarifications helpful
- 81-100: Ready to proceed, clear picture of the project
**ready** (true/false): Set to true ONLY when:
- confidence >= {{READY_CONFIDENCE_THRESHOLD}}
- You have enough information to create a meaningful action plan
- Key goals and deliverables are clear
**message**: Your conversational response to the user. This should:
- Be friendly and encouraging
- Ask relevant clarifying questions (if not ready)
- Summarize your understanding (when ready)
- Avoid technical jargon unless the project requires it
## Example Responses
Early conversation (low confidence):
{"confidence": 25, "ready": false, "message": "Nice to meet you! Let's figure out what you'd like to build.\n\nTo get started: What type of project is this? For example:\n- A coding project (web app, CLI tool, library)?\n- Research or documentation?\n- Something else entirely?"}
Mid conversation (building understanding):
{"confidence": 55, "ready": false, "message": "A React dashboard for tracking fitness metrics - that sounds useful!\n\nA couple quick questions:\n1. What data sources will it pull from? (API, manual entry, fitness tracker?)\n2. Do you have a specific design or UI style in mind?"}
Ready to proceed (high confidence):
{"confidence": 92, "ready": true, "message": "I have a clear picture now!\n\nYou want to build a React dashboard that:\n- Connects to a fitness tracker API\n- Displays daily steps, calories, and workout history\n- Uses a clean, minimal design with dark mode support\n- Includes charts for weekly/monthly trends\n\nI'm ready to create your action plan. Shall we proceed?"}
## Important Notes
- Always output valid JSON - no markdown code blocks, no extra text
- Keep confidence scores realistic and progressive
- Don't set ready=true until confidence >= {{READY_CONFIDENCE_THRESHOLD}}
- If the user is vague, ask specific questions to build clarity
- Remember: the goal is to gather enough info for a practical action plan

View File

@@ -10,69 +10,10 @@ import { AgentPromptComposerModal } from './AgentPromptComposerModal';
import { DocumentsPanel } from './DocumentsPanel';
import { GitWorktreeSection, GhCliStatus } from './GitWorktreeSection';
import { usePlaybookManagement, useWorktreeValidation } from '../hooks';
import { autorunDefaultPrompt } from '../../prompts';
// Default batch processing prompt
export const DEFAULT_BATCH_PROMPT = `# Context
Your name is **{{AGENT_NAME}}**, a Maestro-managed AI agent.
- **Agent Path:** {{AGENT_PATH}}
- **Git Branch:** {{GIT_BRANCH}}
- **Auto Run Folder:** {{AUTORUN_FOLDER}}
- **Loop Iteration:** {{LOOP_NUMBER}}
- **Working Folder for Temporary Files:** {{AUTORUN_FOLDER}}/Working
If you need to create the working folder, do so.
---
## Instructions
1. Project Orientation
Begin by reviewing CLAUDE.md (when available) in this folder to understand the project's structure, conventions, and workflow expectations.
2. Task Selection
Process the FIRST unchecked task (- [ ]) from top to bottom. Note that there may be relevant images associated with the task. If there are, analyze them, and include in your final synopsis back how many images you analyzed in preparation for solving the task.
IMPORTANT: You will only work on this single task. If it appears to have logical subtasks, treat them as one cohesive unit—but do not move on to the next major item.
3. Task Evaluation
- Fully understand the task and inspect the relevant code.
- Determine which tasks you're going to work on in this run.
- There will be future runs to take care of other tasks.
- Your goal is to select enough items from the top of the unfinished list that make sense to work on within the same context window.
4. Task Implementation
- Implement the task according to the project's established style, architecture, and coding norms.
- Ensure that test cases are created, and that they pass.
- Ensure you haven't broken any existing test cases.
5. Completion + Reporting
- Mark the task as completed by changing "- [ ]" to "- [x]".
- CRITICAL: Your FIRST sentence MUST be a specific synopsis of what you accomplished (e.g., "Added pagination to the user list component" or "Refactored auth middleware to use JWT tokens"). Never start with generic phrases like "Task completed successfully" - always lead with the specific work done.
- Follow with any relevant details about:
- Implementation approach or key decisions made
- Why the task was intentionally skipped (if applicable)
- If implementation failed, explain the failure and do NOT check off the item.
6. Version Control
For any code or documentation changes, if we're in a Github repo:
- Commit using a descriptive message prefixed with "MAESTRO: ".
- Push to GitHub.
- Update CLAUDE.md, README.md, or any other top-level documentation if appropriate.
7. Exit Immediately
After completing (or skipping) your task, EXIT. Do not proceed to additional tasks—another agent instance will handle them. If there are no remaining open tasks, exit immediately and state that there is nothing left to do.
---
## Tasks
Process tasks from this document:
{{DOCUMENT_PATH}}
Check of tasks and add any relevant notes around the completion directly within that document.`;
export const DEFAULT_BATCH_PROMPT = autorunDefaultPrompt;
interface BatchRunnerModalProps {
theme: Theme;

View File

@@ -226,6 +226,12 @@ export function QuickActionsModal(props: QuickActionsModalProps) {
...(isAiMode && onRenameTab ? [{ id: 'renameTab', label: 'Rename Tab', shortcut: tabShortcuts?.renameTab, action: () => { onRenameTab(); setQuickActionOpen(false); } }] : []),
...(isAiMode && onToggleReadOnlyMode ? [{ id: 'toggleReadOnly', label: 'Toggle Read-Only Mode', shortcut: tabShortcuts?.toggleReadOnlyMode, action: () => { onToggleReadOnlyMode(); setQuickActionOpen(false); } }] : []),
...(isAiMode && onToggleMarkdownEditMode ? [{ id: 'toggleMarkdown', label: 'Toggle Edit/Preview', shortcut: shortcuts.toggleMarkdownMode, subtext: markdownEditMode ? 'Currently in edit mode' : 'Currently in preview mode', action: () => { onToggleMarkdownEditMode(); setQuickActionOpen(false); } }] : []),
...(activeSession ? [{ id: 'clearTerminal', label: 'Clear Terminal History', action: () => {
setSessions(prev => prev.map(s =>
s.id === activeSessionId ? { ...s, shellLogs: [] } : s
));
setQuickActionOpen(false);
} }] : []),
...(activeSession ? [{ id: 'kill', label: `Remove Agent: ${activeSession.name}`, shortcut: shortcuts.killInstance, action: () => deleteSession(activeSessionId) }] : []),
{ id: 'settings', label: 'Settings', shortcut: shortcuts.settings, action: () => { setSettingsModalOpen(true); setQuickActionOpen(false); } },
{ id: 'theme', label: 'Change Theme', action: () => { setSettingsModalOpen(true); setSettingsTab('theme'); setQuickActionOpen(false); } },

View File

@@ -8,6 +8,8 @@
import type { ToolType } from '../../../types';
import type { WizardMessage, GeneratedDocument } from '../WizardContext';
import { wizardDocumentGenerationPrompt } from '../../../../prompts';
import { substituteTemplateVariables, type TemplateContext } from '../../../utils/templateVariables';
/**
* Configuration for document generation
@@ -187,102 +189,30 @@ export function generateDocumentGenerationPrompt(config: GenerationConfig): stri
})
.join('\n\n');
return `You are an expert project planner creating actionable task documents for "${projectDisplay}".
// First, handle wizard-specific variables that have different semantics
// from the central template system. We do this BEFORE the central function
// so they take precedence over central defaults.
let prompt = wizardDocumentGenerationPrompt
.replace(/\{\{PROJECT_NAME\}\}/gi, projectDisplay)
.replace(/\{\{DIRECTORY_PATH\}\}/gi, directoryPath)
.replace(/\{\{AUTO_RUN_FOLDER_NAME\}\}/gi, AUTO_RUN_FOLDER_NAME)
.replace(/\{\{CONVERSATION_SUMMARY\}\}/gi, conversationSummary);
## Your Task
// Build template context for remaining variables (date/time, etc.)
const templateContext: TemplateContext = {
session: {
id: 'wizard-gen',
name: projectDisplay,
toolType: 'claude-code',
cwd: directoryPath,
fullPath: directoryPath,
},
};
Based on the project discovery conversation below, create a series of Auto Run documents that will guide an AI coding assistant through building this project step by step.
// Substitute any remaining template variables using the central function
prompt = substituteTemplateVariables(prompt, templateContext);
## Working Directory
All files will be created in: ${directoryPath}
The documents will be saved to: ${directoryPath}/${AUTO_RUN_FOLDER_NAME}/
## Critical Requirements for Phase 1
Phase 1 is the MOST IMPORTANT phase. It MUST:
1. **Be Completely Self-Contained**: Phase 1 must be executable without ANY user input or decisions during execution. The AI should be able to start and complete Phase 1 entirely on its own.
2. **Deliver a Working Prototype**: By the end of Phase 1, there should be something tangible that runs/works. This could be:
- A running web server (even if minimal)
- An executable script that produces output
- A basic UI that displays something
- A function that can be called and tested
- A document structure that renders
3. **Excite the User**: Phase 1 should deliver enough visible progress that the user feels excited about what's possible. Show them the magic of AI-assisted development early.
4. **Foundation First**: Set up project structure, dependencies, and core scaffolding before building features.
## Document Format
Each Auto Run document MUST follow this exact format:
\`\`\`markdown
# Phase XX: [Brief Title]
[One paragraph describing what this phase accomplishes and why it matters]
## Tasks
- [ ] First specific task to complete
- [ ] Second specific task to complete
- [ ] Continue with more tasks...
\`\`\`
## Task Writing Guidelines
Each task should be:
- **Specific**: Not "set up the project" but "Create package.json with required dependencies"
- **Actionable**: Clear what needs to be done
- **Verifiable**: You can tell when it's complete
- **Autonomous**: Can be done without asking the user questions
Bad task examples (too vague):
- [ ] Build the UI
- [ ] Add features
- [ ] Set up the backend
Good task examples (specific and actionable):
- [ ] Create src/components/Header.tsx with logo, navigation links, and responsive menu
- [ ] Add Express route GET /api/users that returns mock user data array
- [ ] Create CSS module for Button component with primary and secondary variants
## Phase Guidelines
- **Phase 1**: Foundation + Working Prototype (MUST work end-to-end, even if minimal)
- **Phase 2-N**: Additional features, improvements, polish
- Each phase should build on the previous
- Keep phases focused (5-15 tasks typically)
- Avoid tasks that require user decisions mid-execution
- No documentation-only tasks (docs can be part of implementation tasks)
## Output Format
Output each document in this format (including the markers):
---BEGIN DOCUMENT---
FILENAME: Phase-01-[Description].md
CONTENT:
[Full markdown content here]
---END DOCUMENT---
---BEGIN DOCUMENT---
FILENAME: Phase-02-[Description].md
CONTENT:
[Full markdown content here]
---END DOCUMENT---
Continue for as many phases as needed.
## Project Discovery Conversation
${conversationSummary}
## Now Generate the Documents
Based on the conversation above, create the Auto Run documents. Start with Phase 1 (the working prototype), then create additional phases as needed. Remember: Phase 1 must be completely autonomous and deliver something that works!`;
return prompt;
}
/**

View File

@@ -6,6 +6,8 @@
*/
import { getRandomInitialQuestion } from './fillerPhrases';
import { wizardSystemPrompt, wizardSystemContinuationPrompt } from '../../../../prompts';
import { substituteTemplateVariables, type TemplateContext } from '../../../utils/templateVariables';
/**
* Structured response format expected from the agent
@@ -110,97 +112,35 @@ export function generateSystemPrompt(config: SystemPromptConfig): string {
// Build existing docs section if continuing from previous session
let existingDocsSection = '';
if (existingDocs && existingDocs.length > 0) {
existingDocsSection = `
## Previous Planning Documents
The user is continuing a previous planning session. Below are the existing Auto Run documents that were created earlier. Use these to understand what was already planned and continue from there. Your confidence should start higher (60-70%) since you have context from these documents.
${existingDocs.map(doc => `### ${doc.filename}
${doc.content}
`).join('\n---\n\n')}
**Important:** When continuing from existing docs:
- Start with higher confidence (60-70%) since you already have context
- Review the existing plans and ask if anything has changed or needs updating
- Don't re-ask questions that are already answered in the documents
- Focus on validating the existing plan and filling in any gaps
`;
const docsContent = existingDocs.map(doc => `### ${doc.filename}\n\n${doc.content}\n`).join('\n---\n\n');
existingDocsSection = wizardSystemContinuationPrompt.replace('{{EXISTING_DOCS}}', docsContent);
}
return `You are a friendly project discovery assistant helping to set up "${projectName}".
// First, handle wizard-specific variables that have different semantics
// from the central template system. We do this BEFORE the central function
// so they take precedence over central defaults.
// - PROJECT_NAME: wizard uses user-provided agentName (or "this project"),
// not the path-derived name from the central system
// - READY_CONFIDENCE_THRESHOLD: wizard-specific constant
let prompt = wizardSystemPrompt
.replace(/\{\{PROJECT_NAME\}\}/gi, projectName)
.replace(/\{\{READY_CONFIDENCE_THRESHOLD\}\}/gi, String(READY_CONFIDENCE_THRESHOLD));
## Your Role
// Build template context for remaining variables (date/time, etc.)
const templateContext: TemplateContext = {
session: {
id: 'wizard',
name: projectName,
toolType: 'claude-code',
cwd: agentPath,
fullPath: agentPath,
},
};
You are 🎼 Maestro's onboarding assistant, helping the user define their project so we can create an actionable plan.
// Substitute any remaining template variables using the central function
prompt = substituteTemplateVariables(prompt, templateContext);
## Working Directory
You will ONLY create or modify files within this directory:
${agentPath}
Do not reference, create, or modify files outside this path.
## Your Goal
Through a brief, focused conversation:
1. Understand what type of project this is (coding project, research notes, documentation, analysis, creative writing, etc.)
2. Learn the key goals or deliverables
3. Identify any specific technologies, frameworks, or constraints
4. Gather enough clarity to create an action plan
## Conversation Guidelines
- Keep exchanges minimal but purposeful
- Ask clarifying questions to understand scope and requirements
- Don't overwhelm with too many questions at once (1-3 questions per response)
- Be encouraging and helpful in tone
- Once you have enough clarity, indicate you're ready to proceed
## Response Format
You MUST respond with valid JSON in this exact format:
{"confidence": <number 0-100>, "ready": <boolean>, "message": "<your response>"}
### Field Explanations:
**confidence** (0-100): Your confidence in understanding the project well enough to create an action plan
- 0-20: Just started, minimal understanding
- 21-50: Basic understanding, need significant clarification
- 51-70: Good understanding, a few details to clarify
- 71-80: Solid understanding, minor clarifications helpful
- 81-100: Ready to proceed, clear picture of the project
**ready** (true/false): Set to true ONLY when:
- confidence >= ${READY_CONFIDENCE_THRESHOLD}
- You have enough information to create a meaningful action plan
- Key goals and deliverables are clear
**message**: Your conversational response to the user. This should:
- Be friendly and encouraging
- Ask relevant clarifying questions (if not ready)
- Summarize your understanding (when ready)
- Avoid technical jargon unless the project requires it
## Example Responses
Early conversation (low confidence):
{"confidence": 25, "ready": false, "message": "Nice to meet you! Let's figure out what you'd like to build.\\n\\nTo get started: What type of project is this? For example:\\n- A coding project (web app, CLI tool, library)?\\n- Research or documentation?\\n- Something else entirely?"}
Mid conversation (building understanding):
{"confidence": 55, "ready": false, "message": "A React dashboard for tracking fitness metrics - that sounds useful!\\n\\nA couple quick questions:\\n1. What data sources will it pull from? (API, manual entry, fitness tracker?)\\n2. Do you have a specific design or UI style in mind?"}
Ready to proceed (high confidence):
{"confidence": 92, "ready": true, "message": "I have a clear picture now!\\n\\nYou want to build a React dashboard that:\\n- Connects to a fitness tracker API\\n- Displays daily steps, calories, and workout history\\n- Uses a clean, minimal design with dark mode support\\n- Includes charts for weekly/monthly trends\\n\\nI'm ready to create your action plan. Shall we proceed?"}
## Important Notes
- Always output valid JSON - no markdown code blocks, no extra text
- Keep confidence scores realistic and progressive
- Don't set ready=true until confidence >= ${READY_CONFIDENCE_THRESHOLD}
- If the user is vague, ask specific questions to build clarity
- Remember: the goal is to gather enough info for a practical action plan${existingDocsSection}`;
return prompt + existingDocsSection;
}
/**

View File

@@ -3,6 +3,12 @@
* This file makes the window.maestro API available throughout the renderer.
*/
// Vite raw imports for .md files
declare module '*.md?raw' {
const content: string;
export default content;
}
interface ProcessConfig {
sessionId: string;
toolType: string;

View File

@@ -2,6 +2,7 @@ import { useState, useCallback, useRef, useEffect } from 'react';
import type { BatchRunState, BatchRunConfig, BatchDocumentEntry, Session, HistoryEntry, UsageStats, Group, AutoRunStats } from '../types';
import { substituteTemplateVariables, TemplateContext } from '../utils/templateVariables';
import { getBadgeForTime, getNextBadge, formatTimeRemaining } from '../constants/conductorBadges';
import { autorunSynopsisPrompt } from '../../prompts';
// Regex to count unchecked markdown checkboxes: - [ ] task
const UNCHECKED_TASK_REGEX = /^[\s]*-\s*\[\s*\]\s*.+$/gm;
@@ -193,16 +194,7 @@ export function uncheckAllTasks(content: string): string {
* Hook for managing batch processing of scratchpad tasks across multiple sessions
*/
// Synopsis prompt for batch tasks - requests a two-part response
const BATCH_SYNOPSIS_PROMPT = `Provide a brief synopsis of what you just accomplished in this task using this exact format:
**Summary:** [1-2 sentences describing the key outcome]
**Details:** [A paragraph with more specifics about what was done, files changed, etc.]
Rules:
- Be specific about what was actually accomplished, not what was attempted.
- Focus only on meaningful work that was done. Omit filler phrases like "the task is complete", "no further action needed", "everything is working", etc.
- If nothing meaningful was accomplished, respond with only: **Summary:** No changes made.`;
const BATCH_SYNOPSIS_PROMPT = autorunSynopsisPrompt;
/**
* Parse a synopsis response into short summary and full synopsis

View File

@@ -4,12 +4,12 @@ import { getActiveTab } from '../utils/tabHelpers';
import { generateId } from '../utils/ids';
import { substituteTemplateVariables } from '../utils/templateVariables';
import { gitService } from '../services/git';
import { imageOnlyDefaultPrompt } from '../../prompts';
/**
* Default prompt used when user sends only an image without text.
*/
export const DEFAULT_IMAGE_ONLY_PROMPT =
'Examine the attached picture and best determine based on available and existing context, what the user wants done next.';
export const DEFAULT_IMAGE_ONLY_PROMPT = imageOnlyDefaultPrompt;
/**
* Batch state information for a session.

View File

@@ -2,6 +2,7 @@ import { useState, useEffect, useCallback, useMemo } from 'react';
import type { LLMProvider, ThemeId, ThemeColors, Shortcut, CustomAICommand, GlobalStats, AutoRunStats, OnboardingStats, LeaderboardRegistration } from '../types';
import { DEFAULT_CUSTOM_THEME_COLORS } from '../constants/themes';
import { DEFAULT_SHORTCUTS } from '../constants/shortcuts';
import { commitCommandPrompt } from '../../prompts';
// Default global stats
const DEFAULT_GLOBAL_STATS: GlobalStats = {
@@ -64,18 +65,7 @@ const DEFAULT_AI_COMMANDS: CustomAICommand[] = [
id: 'commit',
command: '/commit',
description: 'Commit outstanding changes and push up',
prompt: `Examine the current git diff and determine if we need to make any updates to the README.md or CLAUDE.md files.
Then create a sensible git commit message. IMPORTANT: The commit message MUST include the agent session ID "{{AGENT_SESSION_ID}}" somewhere in the commit body (not the subject line). This allows us to trace commits back to their original conversation for context and continuity.
Example commit format:
<subject line summarizing changes>
<detailed description>
Session: {{AGENT_SESSION_ID}}
After committing, push all changes up to origin.`,
prompt: commitCommandPrompt,
isBuiltIn: true,
},
];