### Add Memory - Setup Knowledge Source: https://github.com/ishaan1013/shadow/blob/main/apps/server/src/agent/tools/prompts/add_memory/instructions.md Use this snippet to document critical project setup, installation, or configuration steps. This is particularly useful for remembering essential commands or procedures that are easy to forget. ```javascript add_memory({ content: "Run 'npm run db:push' to sync Prisma schema changes to database. Required after schema modifications before server restart.", category: "SETUP", explanation: "Critical setup step that's easy to forget" }) ``` -------------------------------- ### Install Dependencies Source: https://github.com/ishaan1013/shadow/blob/main/README.md Clone the repository and install project dependencies using npm. ```bash git clone cd shadow npm install ``` -------------------------------- ### Start Development Servers Source: https://github.com/ishaan1013/shadow/blob/main/README.md Start all development services or specific services using npm run dev with filters. ```bash # Start all services npm run dev # Or start specific services npm run dev --filter=frontend npm run dev --filter=server npm run dev --filter=sidecar ``` -------------------------------- ### List Memories - Architecture Understanding Source: https://github.com/ishaan1013/shadow/blob/main/apps/server/src/agent/tools/prompts/list_memories/instructions.md Employ this example to access past architectural patterns and decisions before introducing new features. A specific explanation helps in retrieving relevant information. ```javascript list_memories({ explanation: "Understanding existing patterns before adding new API endpoints" }) ``` -------------------------------- ### Manage Shadow Infrastructure Components Source: https://github.com/ishaan1013/shadow/blob/main/scripts/README.md Scripts for deploying specific infrastructure components or cleaning up the entire setup. Use these for targeted deployments or removal of resources. ```bash # Deploy only EKS cluster with Kata Containers ./scripts/deploy-remote-infrastructure.sh ``` ```bash # Deploy only ECS backend service ./scripts/deploy-backend-ecs.sh ``` ```bash # Deploy complete infrastructure (EKS + ECS) ./scripts/deploy-full-infrastructure.sh ``` ```bash # Clean up infrastructure ./scripts/cleanup-infrastructure.sh ``` -------------------------------- ### Non-interactive npm Install Source: https://github.com/ishaan1013/shadow/blob/main/apps/server/src/agent/tools/prompts/run_terminal_cmd/instructions.md Use the --yes flag for non-interactive package installations to avoid prompts. ```bash npm install --yes ``` -------------------------------- ### List Memories - Starting New Task Source: https://github.com/ishaan1013/shadow/blob/main/apps/server/src/agent/tools/prompts/list_memories/instructions.md Use this snippet to retrieve memories when beginning a new task, providing context for the upcoming work. Include a clear explanation of why memories are needed. ```javascript list_memories({ explanation: "Reviewing repository context before implementing user authentication system" }) ``` -------------------------------- ### Update Todo List Status Source: https://github.com/ishaan1013/shadow/blob/main/apps/server/src/agent/tools/prompts/todo_write/instructions.md Use this to update the status of existing tasks, such as marking a task as completed and starting a new one. Set merge to true to add to or modify the existing list. ```javascript // When starting a new task todo_write({ merge: true, todos: [ {id: "auth", content: "Implement user authentication", status: "completed"}, {id: "api", content: "Create REST API endpoints", status: "in_progress"} ], explanation: "Updating status as I begin API implementation" }) ``` -------------------------------- ### Regex Escaping Examples Source: https://github.com/ishaan1013/shadow/blob/main/apps/server/src/agent/tools/prompts/grep_search/instructions.md Special characters in regex patterns must be escaped to be treated as literal characters. This ensures accurate matching of symbols, function calls, file names, and logical operators. ```regex function\( ``` ```regex value\[index\] ``` ```regex file\.txt ``` ```regex user\|admin ``` -------------------------------- ### Deploy Shadow Application Source: https://github.com/ishaan1013/shadow/blob/main/scripts/README.md Execute the script to deploy the complete Shadow platform after the infrastructure is set up. ```bash # Deploy complete platform ./scripts/deploy-full-infrastructure.sh ``` -------------------------------- ### Build Applications Source: https://github.com/ishaan1013/shadow/blob/main/README.md Build all project packages and applications, or target specific applications for building. ```bash # Build all packages and apps npm run build ``` ```bash # Build specific app npm run build --filter=frontend ``` ```bash npm run build --filter=server ``` ```bash npm run build --filter=sidecar ``` -------------------------------- ### Create Initial Todo List Source: https://github.com/ishaan1013/shadow/blob/main/apps/server/src/agent/tools/prompts/todo_write/instructions.md Use this to create a new, comprehensive task list for a complex project. Set merge to false to replace any existing todos. ```javascript todo_write({ merge: false, todos: [ {id: "setup", content: "Set up project structure", status: "completed"}, {id: "auth", content: "Implement user authentication", status: "in_progress"}, {id: "api", content: "Create REST API endpoints", status: "pending"}, {id: "frontend", content: "Build React frontend", status: "pending"}, {id: "tests", content: "Write unit tests", status: "pending"} ], explanation: "Creating comprehensive task list for user management system" }) ``` -------------------------------- ### Configure Local PostgreSQL Database Source: https://github.com/ishaan1013/shadow/blob/main/README.md Create a local PostgreSQL database named 'shadow_dev' and update the database URL in packages/db/.env. Then, generate the Prisma client and push the schema. ```bash # Create local PostgreSQL database psql -U postgres -c "CREATE DATABASE shadow_dev;" # Update packages/db/.env with your database URL DATABASE_URL="postgres://postgres:@127.0.0.1:5432/shadow_dev" # Generate Prisma client and push schema npm run generate npm run db:push ``` -------------------------------- ### Frontend Environment Configuration Source: https://github.com/ishaan1013/shadow/blob/main/README.md Configure environment variables for the frontend, including the server URL, Vercel environment, and GitHub authentication details. ```bash # Point frontend to your server if needed NEXT_PUBLIC_SERVER_URL=http://localhost:4000 # Marks environment; any value other than "production" enables local behavior NEXT_PUBLIC_VERCEL_ENV=development GITHUB_PERSONAL_ACCESS_TOKEN=ghp_xxx GITHUB_CLIENT_ID= GITHUB_CLIENT_SECRET= ``` -------------------------------- ### Configure AWS SSO and Deploy Remote Infrastructure Source: https://github.com/ishaan1013/shadow/blob/main/scripts/README.md Configure AWS Single Sign-On for the 'ID' profile and then deploy the remote infrastructure, which includes the EKS cluster with Kata Containers. This process can take 25-35 minutes. ```bash # Configure AWS SSO aws configure sso --profile=ID # Deploy infrastructure (25-35 minutes) ./scripts/deploy-remote-infrastructure.sh ``` -------------------------------- ### Database Troubleshooting Source: https://github.com/ishaan1013/shadow/blob/main/CLAUDE.md Commands to reset the development database and regenerate the Prisma client. ```bash # Reset development database npm run db:push:reset # Regenerate Prisma client npm run generate ``` -------------------------------- ### Server Environment Configuration Source: https://github.com/ishaan1013/shadow/blob/main/README.md Configure required and optional environment variables for the server, including database URL, authentication secret, GitHub token, execution mode, and Pinecone settings. ```bash # Required DATABASE_URL="postgres://postgres:@127.0.0.1:5432/shadow_dev" BETTER_AUTH_SECRET="dev-secret" GITHUB_PERSONAL_ACCESS_TOKEN=ghp_xxx # Local mode NODE_ENV=development AGENT_MODE=local # Optional: Pinecone for semantic search PINECONE_API_KEY="" # TODO: Set this to your Pinecone API key PINECONE_INDEX_NAME="shadow" # Workspace directory for local agent: WORKSPACE_DIR= # TODO: Set this to your local workspace directory ``` -------------------------------- ### Copy Environment Templates Source: https://github.com/ishaan1013/shadow/blob/main/README.md Copy template environment files to create new environment configuration files for server, frontend, and database. ```bash cp apps/server/.env.template apps/server/.env cp apps/frontend/.env.template apps/frontend/.env cp packages/db/.env.template packages/db/.env ``` -------------------------------- ### Run Project Checks Source: https://github.com/ishaan1013/shadow/blob/main/CLAUDE.md Execute type checking and linting for the project. ```bash npm run check-types npm run lint ``` -------------------------------- ### Run Linting and Formatting Checks Source: https://github.com/ishaan1013/shadow/blob/main/README.md Execute linting, formatting, and type checking across all packages and applications within the project. ```bash # Lint all packages and apps npm run lint ``` ```bash # Format code with Prettier npm run format ``` ```bash # Type checking npm run check-types ``` -------------------------------- ### Deploy Infrastructure Scripts Source: https://github.com/ishaan1013/shadow/blob/main/CLAUDE.md Scripts for deploying and cleaning up cloud infrastructure, including EKS clusters and ECS services. ```bash # Deploy EKS cluster with Kata Containers ./scripts/deploy-remote-infrastructure.sh # Deploy ECS backend service ./scripts/deploy-backend-ecs.sh # Infrastructure cleanup ./scripts/cleanup-infrastructure.sh ``` -------------------------------- ### Set Development Environment Variables Source: https://github.com/ishaan1013/shadow/blob/main/README.md Configure local development environment variables, including authentication secrets and database connection strings. ```bash BETTER_AUTH_SECRET=dev-secret ``` ```bash DATABASE_URL="postgres://postgres:@127.0.0.1:5432/shadow_dev" DIRECT_URL="postgres://postgres:@127.0.0.1:5432/shadow_dev" ``` -------------------------------- ### Manage Database Operations with Prisma Source: https://github.com/ishaan1013/shadow/blob/main/README.md Commands for database schema generation, migration, and management using Prisma. ```bash # Generate Prisma client from schema npm run generate ``` ```bash # Push schema changes to database (for development) npm run db:push ``` ```bash # Reset database and push schema (destructive) npm run db:push:reset ``` ```bash # Open Prisma Studio GUI npm run db:studio ``` ```bash # Run migrations in development npm run db:migrate:dev ``` -------------------------------- ### Build and Type Checking Source: https://github.com/ishaan1013/shadow/blob/main/CLAUDE.md Commands to resolve module resolution issues by rebuilding the project and to check for type errors. ```bash # Module resolution issues npm run build # Type checking issues npm run check-types ``` -------------------------------- ### Server Testing Commands Source: https://github.com/ishaan1013/shadow/blob/main/CLAUDE.md Commands for running type checking and linting on the server project using npm filters. ```bash # Server testing npm run check-types --filter=server npm run lint --filter=server ``` -------------------------------- ### Database Schema Management Source: https://github.com/ishaan1013/shadow/blob/main/CLAUDE.md Commands for pushing development database schema changes and applying production migrations. ```bash # Development npm run db:push # Production migrations npm run db:migrate:dev npm run db:migrate:deploy ``` -------------------------------- ### Frontend Testing Commands Source: https://github.com/ishaan1013/shadow/blob/main/CLAUDE.md Commands for running type checking and linting on the frontend project using npm filters. ```bash # Frontend testing npm run check-types --filter=frontend npm run lint --filter=frontend ``` -------------------------------- ### Add Memory - Architecture Pattern Source: https://github.com/ishaan1013/shadow/blob/main/apps/server/src/agent/tools/prompts/add_memory/instructions.md Use this snippet to record key architectural decisions, system design, component relationships, or data flow. This helps in remembering critical design choices for future development. ```javascript add_memory({ content: "Uses Turborepo monorepo with shared packages. Frontend (Next.js) communicates with server via WebSocket for real-time updates. Agent execution can run in local or remote mode via tool executor abstraction.", category: "ARCHITECTURE", explanation: "Recording key architectural decisions for future development" }) ``` -------------------------------- ### Database Model Relationships in TypeScript Source: https://github.com/ishaan1013/shadow/blob/main/CLAUDE.md Illustrates the one-to-many and many-to-one relationships between core database models like User, Task, ChatMessage, and Memory. ```typescript User -> Task (one-to-many) Task -> ChatMessage (one-to-many) Task -> Memory (one-to-many) Task -> Todo (one-to-many) Task -> CodebaseUnderstanding (many-to-one) ``` -------------------------------- ### Add Memory - Bug Pattern Source: https://github.com/ishaan1013/shadow/blob/main/apps/server/src/agent/tools/prompts/add_memory/instructions.md Use this snippet to document known issues, gotchas, or troubleshooting steps related to specific components or behaviors. This helps in avoiding future confusion and speeds up debugging. ```javascript add_memory({ content: "Checkbox onCheckedChange receives boolean | 'indeterminate' but can cast to boolean for simple toggles. Radix UI never actually passes indeterminate for basic checkboxes.", category: "BUGS", explanation: "Documenting UI component behavior to avoid future confusion" }) ``` -------------------------------- ### Find Import Statements Source: https://github.com/ishaan1013/shadow/blob/main/apps/server/src/agent/tools/prompts/grep_search/instructions.md Use this pattern to find import statements, particularly those importing from React. It matches 'import', followed by any characters, 'from', any characters, and 'react'. ```regex import.*from.*react ``` -------------------------------- ### List Memories - Debugging Context Source: https://github.com/ishaan1013/shadow/blob/main/apps/server/src/agent/tools/prompts/list_memories/instructions.md Utilize this snippet for debugging purposes to check for known issues or solutions from previous sessions. Provide a concise explanation related to the problem being investigated. ```javascript list_memories({ explanation: "Checking for known issues related to database connection problems" }) ``` -------------------------------- ### Find Function Definitions Source: https://github.com/ishaan1013/shadow/blob/main/apps/server/src/agent/tools/prompts/grep_search/instructions.md This regex pattern helps identify function definitions in the code. It specifically looks for the keyword 'function' followed by a space and a function name. ```regex function myFunction\( ``` -------------------------------- ### Find TODO Comments Source: https://github.com/ishaan1013/shadow/blob/main/apps/server/src/agent/tools/prompts/grep_search/instructions.md Use this pattern to locate all lines containing 'TODO' comments within the codebase. This is useful for tracking outstanding tasks or issues. ```regex TODO: ``` -------------------------------- ### Remove Memory After Architecture Change Source: https://github.com/ishaan1013/shadow/blob/main/apps/server/src/agent/tools/prompts/remove_memory/instructions.md Use this snippet to remove memories related to previous architectural patterns that are no longer applicable. Provide a clear explanation for the removal. ```javascript remove_memory({ memoryId: "mem_def456", explanation: "Removed old WebSocket implementation, this pattern no longer applies" }) ``` -------------------------------- ### Avoid Pager Output Source: https://github.com/ishaan1013/shadow/blob/main/apps/server/src/agent/tools/prompts/run_terminal_cmd/instructions.md Append | cat to commands that might produce pager output to ensure all content is displayed. ```bash npm test | cat ``` -------------------------------- ### Run Long-Running Commands in Background Source: https://github.com/ishaan1013/shadow/blob/main/apps/server/src/agent/tools/prompts/run_terminal_cmd/instructions.md Set is_background=true for commands that are expected to run for an extended period. ```bash npm run dev with is_background=true ``` -------------------------------- ### Remove Incorrect Memory Source: https://github.com/ishaan1013/shadow/blob/main/apps/server/src/agent/tools/prompts/remove_memory/instructions.md Use this snippet to remove memories containing misinformation or misidentified patterns. The `explanation` should clarify the correction. ```javascript remove_memory({ memoryId: "mem_ghi789", explanation: "This bug pattern was misidentified, actual issue was different" }) ``` -------------------------------- ### Remove Outdated Memory Source: https://github.com/ishaan1013/shadow/blob/main/apps/server/src/agent/tools/prompts/remove_memory/instructions.md Use this snippet to remove a memory that is no longer accurate due to code changes. Ensure the `memoryId` is correct. ```javascript remove_memory({ memoryId: "mem_abc123", explanation: "Database schema has changed, this setup information is outdated" }) ``` -------------------------------- ### Message Part Types in TypeScript Source: https://github.com/ishaan1013/shadow/blob/main/CLAUDE.md Defines the discriminated union types for structured message parts used in real-time streaming via Socket.IO. ```typescript // Message part types in streaming - TextPart: Regular text content - ReasoningPart: AI reasoning with signatures - ToolCallPart: Tool execution requests - ToolResultPart: Tool execution results - ErrorPart: Error information ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.