### Run Dorothy in Web Browser (Development) Source: https://github.com/charlie85270/dorothy/blob/main/README.md Installs dependencies and starts the Dorothy web development server. Access the application at http://localhost:3000. Note that agent management and terminal features require the Electron app. ```bash npm install npm run dev ``` -------------------------------- ### Build Dorothy from Source (Development) Source: https://github.com/charlie85270/dorothy/blob/main/README.md Installs dependencies and starts the Dorothy application in development mode. Requires Node.js and npm. ```bash git clone https://github.com/Charlie85270/Dorothy.git cd Dorothy/app/dorothy npm install npx @electron/rebuild # Rebuild native modules for Electron npm run electron:dev # Development mode ``` -------------------------------- ### Example: Store Learning about Codebase Pattern Source: https://github.com/charlie85270/dorothy/blob/main/skills/remember.md This example shows how to store learned information about a codebase pattern. Replace {{AGENT_ID}} with your agent's ID. ```bash curl -s -X POST http://127.0.0.1:31415/api/memory/remember \ -H "Content-Type: application/json" \ -d '{"agent_id": "{{AGENT_ID}}", "content": "Project uses repository pattern for data access", "type": "learning"}' ``` -------------------------------- ### Example: Multi-Agent Task - Narrate Parallel Start Source: https://github.com/charlie85270/dorothy/blob/main/electron/resources/telegram-instructions.md Inform the user when multiple agents are being started simultaneously for different parts of the task. ```python send_telegram("Starting deploy-agent on deployment and docs-agent on documentation...") ``` -------------------------------- ### Install and Build MCP Orchestrator Source: https://github.com/charlie85270/dorothy/blob/main/mcp-orchestrator/README.md Steps to install dependencies and build the MCP orchestrator project. ```bash cd mcp-orchestrator npm install npm run build ``` -------------------------------- ### Example: Store User Name Preference Source: https://github.com/charlie85270/dorothy/blob/main/skills/remember.md This example demonstrates how to store a user's name as a preference. Replace {{AGENT_ID}} with your agent's ID. ```bash curl -s -X POST http://127.0.0.1:31415/api/memory/remember \ -H "Content-Type: application/json" \ -d '{"agent_id": "{{AGENT_ID}}", "content": "User name is Charlie", "type": "preference"}' ``` -------------------------------- ### Narrate Starting Agent Source: https://github.com/charlie85270/dorothy/blob/main/electron/resources/telegram-instructions.md Before initiating an agent, inform the user about the agent being started and the task it will perform. ```python send_telegram("Starting [agent name] on [task]...") ``` -------------------------------- ### Run Next.js Development Server Source: https://github.com/charlie85270/dorothy/blob/main/landing/README.md Commands to start the Next.js development server using different package managers. ```bash npm run dev # or yarn dev # or pnpm dev # or bun dev ``` -------------------------------- ### Cron Schedule Examples Source: https://github.com/charlie85270/dorothy/blob/main/README.md Provides common examples of cron expressions for scheduling tasks. These illustrate various frequencies and times. ```text Expression | Schedule | -----------|----------| `0 9 * * *` | Daily at 9:00 AM | `0 9 * * 1-5` | Weekdays at 9:00 AM | `*/15 * * * *` | Every 15 minutes | `0 */2 * * *` | Every 2 hours | `30 14 * * 1` | Mondays at 2:30 PM | ``` -------------------------------- ### start_agent Source: https://github.com/charlie85270/dorothy/blob/main/mcp-orchestrator/README.md Starts a previously created agent with a given task or prompt. ```APIDOC ## start_agent ### Description Start an agent with a specific task/prompt. ### Method POST ### Endpoint /agents/{id}/start ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the agent to start. #### Request Body - **prompt** (string) - Required - The task or instruction for the agent. - **model** (string) - Optional - The specific model to use for the agent's task. ### Response #### Success Response (200) - **status** (string) - Indicates the agent has started successfully. #### Response Example { "status": "started" } ``` -------------------------------- ### Example: Simple Task - Narrate Action Source: https://github.com/charlie85270/dorothy/blob/main/electron/resources/telegram-instructions.md After identifying the correct agent, inform the user that the task is being initiated and may take some time. ```python send_telegram("Found the test agent. Running auth module tests now... This may take a minute.") ``` -------------------------------- ### Twitter/X World Generation Example Source: https://github.com/charlie85270/dorothy/blob/main/skills/world-builder/SKILL.md An example workflow for generating a world based on a Twitter/X user. It outlines the sequence of tool calls for data gathering and zone creation. ```text Input: "Build a world about @marcZeller" Step 1: list_sprites → pick sprites matching the theme (1 call) Step 2: socialdata → get_profile("marcZeller") + search_tweets("from:marcZeller") (2 calls) Step 3: web search → "Marc Zeller Aave governance" + "Marc Zeller DeFi" (2 calls) Step 4: create_zone with NPCs quoting real tweets, buildings as projects, interiors with lore (1 call) DONE. Total: 6 tool calls. ``` -------------------------------- ### Example: Simple Task - Initial Acknowledgment Source: https://github.com/charlie85270/dorothy/blob/main/electron/resources/telegram-instructions.md The first step in handling a user's request is to acknowledge receipt and state the intention to find the appropriate agent. ```python send_telegram("On it! Let me find the right agent for this.") ``` -------------------------------- ### Install Claude Code CLI Source: https://github.com/charlie85270/dorothy/blob/main/slide-deck/source-content.md Install the Claude Code command-line interface globally using npm. This is the first step to setting up your Claude Code environment. ```bash npm install -g @anthropic-ai/claude-code ``` -------------------------------- ### SessionStart Hook Script Example Source: https://github.com/charlie85270/dorothy/blob/main/slide-deck/source-content.md A bash script for the 'SessionStart' hook that loads project context by displaying recent git commits, the content of a '.claude-context.md' file if it exists, the current git branch, and the working directory. ```bash #!/bin/bash # ~/.claude/hooks/session-start.sh # Load recent git activity echo "Recent commits:" git log --oneline -5 # Load project context if [ -f ".claude-context.md" ]; then cat .claude-context.md fi # Show current branch and status echo "Current branch: $(git branch --show-current)" echo "Working directory: $(pwd)" ``` -------------------------------- ### Example: Multi-Agent Task - Initial Acknowledgment Source: https://github.com/charlie85270/dorothy/blob/main/electron/resources/telegram-instructions.md For complex tasks involving multiple agents, provide an initial acknowledgment and inform the user about the parallel coordination. ```python send_telegram("Got it — I'll coordinate the deploy and docs update in parallel.") ``` -------------------------------- ### Example: Simple Task - Final Confirmation Source: https://github.com/charlie85270/dorothy/blob/main/electron/resources/telegram-instructions.md Upon successful completion of a task, provide a detailed summary of the results to the user. ```python send_telegram("Tests completed! Results: 15 passed, 0 failed. All auth tests passing. ✅") ``` -------------------------------- ### Interior Structure Example Source: https://github.com/charlie85270/dorothy/blob/main/skills/world-builder/SKILL.md Defines the structure for an enterable building interior, including background image and NPC placement. ```json { "buildingId": "shop-1", "backgroundImage": "/pokemon/interior/sprite_3.png", "npcs": [ { "id": "shopkeeper", "name": "Shopkeeper", "x": 5, "y": 2, "direction": "down", "spritePath": "/pokemon/pnj/NPC_Shopkeeper.png", "dialogue": ["Welcome to my shop!", "Everything is overpriced, just like real life."] } ] } ``` -------------------------------- ### Example: Multi-Agent Task - Waiting for Second Agent Source: https://github.com/charlie85270/dorothy/blob/main/electron/resources/telegram-instructions.md After one agent completes, inform the user and indicate that you are now waiting for the next agent. ```python send_telegram("Deploy finished successfully! Now waiting on docs...") ``` -------------------------------- ### Development Scripts Source: https://github.com/charlie85270/dorothy/blob/main/README.md Run these npm scripts for local development and building the project. Includes commands for starting development servers, building for production, and packaging the Electron app. ```bash npm run dev # Next.js dev server npm run electron:dev # Electron + Next.js concurrent dev mode npm run build # Next.js production build npm run electron:build # Distributable Electron app (DMG) npm run electron:pack # Electron directory package npm run lint # ESLint ``` -------------------------------- ### Example: Multi-Agent Task - Waiting for First Agent Source: https://github.com/charlie85270/dorothy/blob/main/electron/resources/telegram-instructions.md When coordinating multiple agents, update the user on the progress, specifically mentioning waiting for the first agent to complete. ```python send_telegram("Both agents are working. Waiting for deploy to finish first...") ``` -------------------------------- ### Example: Multi-Agent Task - Final Confirmation Source: https://github.com/charlie85270/dorothy/blob/main/electron/resources/telegram-instructions.md Conclude multi-agent tasks by sending a comprehensive final confirmation that includes a summary of all completed actions. ```python send_telegram("All done! Deploy completed and docs are updated. Here's the summary: [details]") ``` -------------------------------- ### Example Claude Code CLI Command Source: https://github.com/charlie85270/dorothy/blob/main/slide-deck/ai-dev-practice/prompts/10-slide-claude-code-intro.md Use this command to integrate Claude into your development workflow for tasks like adding authentication to a user service. ```bash claude "Add authentication to user service" ``` -------------------------------- ### User Prompt Submit Hook Example Source: https://github.com/charlie85270/dorothy/blob/main/slide-deck/source-content.md This bash script runs before each user prompt. It injects a timestamp, displays the latest test run summary if available, and searches for relevant memories using 'claude-mem'. ```bash #!/bin/bash # ~/.claude/hooks/user-prompt-submit.sh # Add timestamp echo "Request time: $(date '+%Y-%m-%d %H:%M:%S')" # Check if tests passing if [ -f "test-results.json" ]; then echo "Latest test run: $(jq -r '.summary' test-results.json)" fi # Load relevant memories if command -v claude-mem &> /dev/null; then claude-mem search "$USER_PROMPT" --limit 3 fi ``` -------------------------------- ### Configure Claude Code Hooks Source: https://github.com/charlie85270/dorothy/blob/main/slide-deck/source-content.md Defines shell scripts to run at specific Claude workflow events. This example configures the 'SessionStart' hook to execute a custom script. ```json { "hooks": { "SessionStart": { "command": "~/.claude/hooks/session-start.sh" } } } ``` -------------------------------- ### Tool Call After Hook Example Source: https://github.com/charlie85270/dorothy/blob/main/slide-deck/source-content.md This bash script runs after a tool call. It logs whether the tool succeeded or failed to a metrics file, helping to track AI performance. ```bash #!/bin/bash # ~/.claude/hooks/tool-call-after.sh TOOL_NAME="$1" SUCCESS="$2" # true/false # Track metrics if [ "$SUCCESS" == "true" ]; then echo "✓ $TOOL_NAME succeeded" >> ~/.claude/metrics.txt else echo "✗ $TOOL_NAME failed" >> ~/.claude/metrics.txt fi ``` -------------------------------- ### Shell Script for SessionStart Hook Source: https://github.com/charlie85270/dorothy/blob/main/slide-deck/ai-dev-practice/prompts/12-slide-hook-sessionstart.md This bash script is executed when a Claude session starts. It displays recent git commits, the content of a .claude-context.md file, and the current git branch, injecting this information as context for the AI. ```bash #!/bin/bash echo "Recent commits:" git log --oneline -5 cat .claude-context.md echo "Branch: $(git branch --show-current)" ``` -------------------------------- ### Create JIRA Issue Processor Automation Source: https://github.com/charlie85270/dorothy/blob/main/README.md Set up an automation to poll JIRA for specific issues based on JQL and trigger an agent to process them. This example configures polling, agent prompt with JIRA variables, and directs output to JIRA comments, transitions, and Telegram. ```javascript create_automation({ name: "JIRA Task Agent", sourceType: "jira", sourceConfig: '{"projectKeys": ["PROJ"], "jql": "status = Open"}', scheduleMinutes: 5, agentEnabled: true, agentPrompt: "Work on JIRA issue {{key}}: {{summary}}. Description: {{body}}. Priority: {{priority}}.", agentProjectPath: "/path/to/project", outputJiraComment: true, outputJiraTransition: true, outputTelegram: true }) ``` -------------------------------- ### Tool Call Before Hook Example Source: https://github.com/charlie85270/dorothy/blob/main/slide-deck/source-content.md This bash script executes before a tool call. It logs the tool name and parameters to a file and includes a validation check to warn about potentially destructive commands like 'rm -rf'. ```bash #!/bin/bash # ~/.claude/hooks/tool-call-before.sh TOOL_NAME="$1" TOOL_PARAMS="$2" # Log the action echo "[$(date)] Tool: $TOOL_NAME" >> ~/.claude/tool-log.txt # Validate dangerous operations if [[ "$TOOL_NAME" == "Bash" ]] && [[ "$TOOL_PARAMS" =~ "rm -rf" ]]; then echo "⚠️ WARNING: Destructive command detected" echo "Command: $TOOL_PARAMS" # Could exit 1 to block execution fi ``` -------------------------------- ### Get Memory Statistics using cURL Source: https://github.com/charlie85270/dorothy/blob/main/skills/remember.md Use this command to retrieve statistics about the memory system. ```bash curl -s http://127.0.0.1:31415/api/memory/stats ``` -------------------------------- ### Build Dorothy from Source (Production) Source: https://github.com/charlie85270/dorothy/blob/main/README.md Builds a production-ready version of the Dorothy application. This command generates distributable files in the 'release/' directory. ```bash git clone https://github.com/Charlie85270/Dorothy.git cd Dorothy/app/dorothy npm install npx @electron/rebuild # Rebuild native modules for Electron npm run electron:build # Production build (DMG) ``` -------------------------------- ### Basic Telegram Update Source: https://github.com/charlie85270/dorothy/blob/main/electron/resources/telegram-instructions.md Use this to acknowledge receipt of a task and inform the user you are starting to look into it. ```python send_telegram("Got it! Looking into this...") ``` -------------------------------- ### Get memory stats Source: https://github.com/charlie85270/dorothy/blob/main/skills/remember.md Retrieves statistics about the memory system, such as the total number of memories stored or memory usage. ```APIDOC ## GET /api/memory/stats ### Description Retrieves statistics about the memory system, such as the total number of memories stored or memory usage. ### Method GET ### Endpoint /api/memory/stats ### Parameters (No parameters required) ### Request Example ```bash curl -s http://127.0.0.1:31415/api/memory/stats ``` ### Response #### Success Response (200) (No specific response schema provided in source, but typically returns memory statistics) #### Response Example (No specific response example provided in source) ``` -------------------------------- ### Configure SessionStart Hook Source: https://github.com/charlie85270/dorothy/blob/main/slide-deck/ai-dev-practice/prompts/15-slide-building-hooks.md Defines a 'SessionStart' hook in settings.json, specifying the command to execute and a timeout in milliseconds. ```json { "hooks": { "SessionStart": { "command": "~/.claude/hooks/start.sh", "timeout": 5000 } } } ``` -------------------------------- ### Get Sprite Catalog Source: https://github.com/charlie85270/dorothy/blob/main/skills/world-builder/SKILL.md Call this function once at the beginning of the automated world generation process to retrieve the available sprite catalog. ```lua list_sprites ``` -------------------------------- ### Auto-Loading Project Context Hook Source: https://github.com/charlie85270/dorothy/blob/main/slide-deck/source-content.md This bash script, intended for a SessionStart hook, uses a heredoc to output project details like name, stack, current sprint, key files, and recent Git changes. ```bash # SessionStart hook cat <