### Backend Setup with npm Source: https://github.com/captaincrouton89/.claude/blob/main/examples/docs/external/convex-swift-quickstart.md Steps to initialize a Node.js project, install the Convex package, and start the Convex development server. ```bash # In project root directory npm init -y npm install convex # Start Convex development server npx convex dev ``` -------------------------------- ### High-level Guide with References in SKILL.md Source: https://github.com/captaincrouton89/.claude/blob/main/docs/external/skills.md Demonstrates a pattern for organizing a SKILL.md file to provide a quick start guide and link to detailed supporting files. ```markdown # PDF Processing ## Quick start Extract text with pdfplumber: ```python import pdfplumber with pdfplumber.open("file.pdf") as pdf: text = pdf.pages[0].extract_text() ``` ## Advanced features **Form filling**: See [FORMS.md](FORMS.md) **API reference**: See [REFERENCE.md](REFERENCE.md) **Examples**: See [EXAMPLES.md](EXAMPLES.md) ``` -------------------------------- ### Parallel Research Execution Example Source: https://github.com/captaincrouton89/.claude/blob/main/output-styles/deep-research.md This example demonstrates initiating multiple parallel research agents for distinct aspects of authentication, including implementation details, security audits, and best practices research. It shows the commands to start these agents and then synchronize their results. ```bash klaude start Explore "Deep dive into authentication implementation: Priority Questions: - Token generation and validation mechanisms - Session management lifecycle - Security vulnerability patterns Requirements: - Read all files in auth/ directory - Trace authentication flow from entry to validation - Document security measures with confidence ratings - Note any potential vulnerabilities or gaps Output: Detailed implementation report with code references" ``` ```bash klaude start Explore "Security audit of authentication system: Focus Areas: - OWASP compliance check - Rate limiting implementation - Token security (storage, transmission, rotation) - Injection vulnerability analysis Requirements: - Search for security anti-patterns - Verify all user inputs are sanitized - Check for timing attacks in validation - Document findings with CVE references where applicable Output: Security assessment with risk ratings" ``` ```bash klaude start general-purpose "Research authentication best practices and patterns: Investigation targets: - Industry standard implementations (OAuth2, JWT, SAML) - Current security recommendations (2024-2025) - Framework-specific patterns for our stack Requirements: - Use WebSearch for latest security advisories - Find authoritative sources (IETF, OWASP, framework docs) - Compare our implementation to standards - Note deviations with justification analysis Output: Standards comparison with recommendations" ``` ```bash klaude wait ``` -------------------------------- ### Quick Start: Gemini API Text and Image Generation Source: https://github.com/captaincrouton89/.claude/blob/main/examples/docs/external/gemini.md Basic example showing API key configuration, model initialization, text generation, and image analysis using the Gemini API. ```python import google.generativeai as genai import os # Configure API key genai.configure(api_key=os.environ["GOOGLE_AI_API_KEY"]) # Initialize model model = genai.GenerativeModel("gemini-2.5-flash") # Text generation response = model.generate_content("Explain quantum computing") print(response.text) # Image analysis image_file = genai.upload_file("photo.jpg") response = model.generate_content([ "What's happening in this image?", image_file ]) print(response.text) ``` -------------------------------- ### Documentation Generation Example Source: https://github.com/captaincrouton89/.claude/blob/main/examples/docs/CLAUDE.md Example of exporting project documentation to markdown format. ```bash ./docs/generate-docs.sh ``` -------------------------------- ### Install Cursor CLI Source: https://github.com/captaincrouton89/.claude/blob/main/docs/cursor-cli-reference.md Use this command to download and install the Cursor CLI. ```bash curl https://cursor.com/install -fsSL | bash ``` -------------------------------- ### API Documentation Generation Example Source: https://github.com/captaincrouton89/.claude/blob/main/examples/docs/CLAUDE.md Example of generating API documentation in curl format using the list-apis script. ```bash ./docs/list-apis.sh --format curl ``` -------------------------------- ### Observer Trigger and Workflow Examples Source: https://github.com/captaincrouton89/.claude/blob/main/multiagent/ObserverPattern.md Examples of triggers, workflows, and notifications for different meta observers. ```text Trigger on: vague responses, conflicting directions, "wait what?" Workflow: Clarification questions, assumption validation Notification: "Let me make sure I understand correctly..." ``` ```text Trigger on: todo list growing rapidly, new requirements mid-task Workflow: Task decomposition, priority assessment Notification: "This is growing - let me help break it down." ``` ```text Trigger on: "should", "probably", "I think", unverified claims Workflow: Assumption extraction, validation research Notification: "Checking some assumptions here." ``` ```text Trigger on: code duplication, similar patterns in different files Workflow: Refactoring suggestions, DRY opportunities Notification: "I noticed some refactoring opportunities." ``` ```text Trigger on: complex code, API changes, new patterns Workflow: Doc generation, README updates Notification: "Updating documentation for this." ``` ```text Trigger on: new code that differs from existing patterns Workflow: Pattern comparison, style guide validation Notification: "Checking consistency with existing patterns." ``` -------------------------------- ### Common Usage Pattern Example Source: https://github.com/captaincrouton89/.claude/blob/main/file-templates/feature-doc.template.md Illustrates a typical way to use the feature. This snippet serves as a starting point for understanding the feature's practical application. ```typescript // Common usage pattern [code example] ``` -------------------------------- ### Example Directory Structure Source: https://github.com/captaincrouton89/.claude/blob/main/docs/external/agent-doc.md Illustrates a recommended documentation structure with a main overview file and a separate reference directory for detailed topics like API, examples, and troubleshooting. ```plaintext my-doc/ ├── OVERVIEW.md # High-level guide ├── reference/ │ ├── api.md # Specific reference │ ├── examples.md # Usage examples │ └── troubleshooting.md └── scripts/ └── helper.py # Executable utilities ``` -------------------------------- ### Project Validation Example Source: https://github.com/captaincrouton89/.claude/blob/main/examples/docs/CLAUDE.md Example of validating all project documentation files using the check-project script with verbose output. ```bash ./docs/check-project.sh -v ``` -------------------------------- ### Quick Start: Gemini API Video Analysis Source: https://github.com/captaincrouton89/.claude/blob/main/examples/docs/external/gemini.md Example demonstrating video analysis using the Gemini API, including file upload and content generation request. ```python video_file = genai.upload_file("video.mp4") response = model.generate_content([ "Summarize the key events in this video", video_file ]) print(response.text) ``` -------------------------------- ### Load All Filesystem Settings Source: https://github.com/captaincrouton89/.claude/blob/main/docs/external/typescript-sdk.md Example demonstrating how to load all filesystem settings, mimicking the behavior of SDK v0.0.x. ```typescript // Load all settings like SDK v0.0.x did const result = query({ prompt: "Analyze this code", options: { settingSources: ['user', 'project', 'local'] // Load all settings } }); ``` -------------------------------- ### Node.js Text-to-Speech Example Source: https://github.com/captaincrouton89/.claude/blob/main/examples/docs/external/elevenlabs.md Generate speech from text using the ElevenLabs Node.js SDK. Ensure you have the SDK installed (`npm install @elevenlabs/elevenlabs-js`) and replace 'YOUR_API_KEY' with your actual API key. ```JavaScript import { ElevenLabsClient } from '@elevenlabs/elevenlabs-js'; const client = new ElevenLabsClient({ apiKey: 'YOUR_API_KEY', }); // Text to Speech const audio = await client.generate({ text: "Hello, world!", voice: "Rachel", model_id: "eleven_multilingual_v2" }); ``` -------------------------------- ### Python Text-to-Speech Example Source: https://github.com/captaincrouton89/.claude/blob/main/examples/docs/external/elevenlabs.md Generate speech from text using the ElevenLabs Python SDK. Ensure you have the SDK installed (`pip install elevenlabs`) and replace 'YOUR_API_KEY' with your actual API key. ```Python from elevenlabs.client import ElevenLabs client = ElevenLabs(api_key='YOUR_API_KEY') # Text to Speech audio = client.generate( text="Hello, world!", voice="Rachel", model="eleven_multilingual_v2" ) ``` -------------------------------- ### Install FFmpeg on Linux (Ubuntu/Debian) Source: https://github.com/captaincrouton89/.claude/blob/main/examples/docs/external/ffmpeg-analysis.md Installs FFmpeg using the apt package manager. ```bash sudo apt update sudo apt install ffmpeg ``` -------------------------------- ### Provide Aligned Example for Commit Message Source: https://github.com/captaincrouton89/.claude/blob/main/skills/prompting-effectively/SKILL.md Use `` tags to provide a concrete input-output pair for generating commit messages, demonstrating the desired format and content. ```plaintext Input: "Added JWT authentication" Output: feat(auth): implement JWT-based authentication Add login endpoint and token validation middleware. ``` -------------------------------- ### Install TypeScript SDK Source: https://github.com/captaincrouton89/.claude/blob/main/docs/features/typescript-sdk-reference.doc.md Installs the TypeScript Agent SDK using npm. Ensure you have Node.js and npm installed. ```bash npm install @anthropic-ai/claude-agent-sdk ``` -------------------------------- ### Good Description Example for SKILL.md Source: https://github.com/captaincrouton89/.claude/blob/main/docs/external/skills.md Provides a concrete example of a good description for the SKILL.md frontmatter, detailing capabilities and usage context. ```yaml description: Extract text and tables from PDF files, fill forms, merge documents. Use when working with PDF files or when the user mentions PDFs, forms, or extraction. ``` -------------------------------- ### Good Description Example Source: https://github.com/captaincrouton89/.claude/blob/main/skills/skills-guide/SKILL.md This example demonstrates a specific and actionable description for a skill, including its capabilities and usage context. ```text Extract text and tables from PDF files, fill forms, merge documents. Use when working with PDF files or when the user mentions PDFs, forms, or extraction. ``` -------------------------------- ### Install OpenAI Whisper Source: https://github.com/captaincrouton89/.claude/blob/main/examples/docs/external/whisper-transcription.md Install the Whisper Python package. Use '[complete]' for advanced features. ```bash pip install openai-whisper ``` ```bash pip install openai-whisper[complete] ``` -------------------------------- ### Simple Prompt Shortcut Example Source: https://github.com/captaincrouton89/.claude/blob/main/workflows/custom-slash-commands-guide.md A straightforward command that takes arguments and analyzes them for specific security vulnerabilities. ```markdown --- description: Review code for security issues --- Analyze $ARGUMENTS for security vulnerabilities including: - SQL injection - XSS attacks - Authentication issues - Data exposure ``` -------------------------------- ### Chaining Subagents Example Source: https://github.com/captaincrouton89/.claude/blob/main/docs/external/agents.md Example of chaining subagents for complex workflows. This demonstrates how to use the code-analyzer and optimizer agents sequentially to address performance issues. ```bash > First use the code-analyzer subagent to find performance issues, then use the optimizer subagent to fix them ``` -------------------------------- ### Read Tool Input Example Source: https://github.com/captaincrouton89/.claude/blob/main/docs/external/hook-examples.md Input for the Read tool, specifying the file path to read. ```json { "file_path": "~/Code/Klaude/test.txt" } ``` -------------------------------- ### Example of Specific Skill Descriptions Source: https://github.com/captaincrouton89/.claude/blob/main/skills/skills-guide/SKILL.md YAML examples demonstrating how to write specific and trigger-aware descriptions for Claude skills to avoid conflicts and ensure correct activation. ```yaml # Skill 1 description: Analyze sales data in Excel and CRM exports. Use for sales reports, pipeline analysis, and revenue tracking. # Skill 2 description: Analyze log files and system metrics. Use for performance monitoring, debugging, and system diagnostics. ``` -------------------------------- ### Observer Trigger Examples Source: https://github.com/captaincrouton89/.claude/blob/main/multiagent/ObserverPattern.md Provides examples of triggers and corresponding workflows/notifications for different observer categories. These illustrate the specific conditions under which observers activate and the actions they initiate. ```text Creativity Observer: Trigger on: stuck, repetition, "I need ideas" Workflow: Lateral thinking, analogies, alternative approaches Notification: "I'll brainstorm some creative angles on this." Deep Research Observer: Trigger on: complex questions, "how does X work", library names Workflow: Multi-source research, web search, doc aggregation Notification: "I'm researching this more deeply - one moment." Learning Observer: Trigger on: "I don't understand", confusion signals, repeated questions Workflow: ELI5 explanations, examples, interactive teaching Notification: "Let me explain this more clearly." Security Observer: Trigger on: auth code, API keys, user input handling, file operations Workflow: Security analysis, vulnerability scan, best practices check Notification: "Running security analysis on this code." Performance Observer: Trigger on: loops in code, database queries, "it's slow" Workflow: Profiling suggestions, optimization opportunities Notification: "Analyzing performance implications." Testing Observer: Trigger on: new feature completed, complex logic, critical path code Workflow: Test generation, edge case identification Notification: "Generating tests for this." ``` -------------------------------- ### Install and Authenticate Wrangler CLI Source: https://github.com/captaincrouton89/.claude/blob/main/examples/docs/external/r2-image-hosting.md Installs the Wrangler CLI globally and authenticates your account with Cloudflare. This is the first step for managing R2 resources via the command line. ```bash # Install globally npm install -g wrangler # Or use pnpm pnpm add -g wrangler # Authenticate with Cloudflare wrangler login ``` -------------------------------- ### Write Tool Input Example Source: https://github.com/captaincrouton89/.claude/blob/main/docs/external/hook-examples.md Input for the Write tool, specifying the file path and content to write. ```json { "content": "test", "file_path": "~/Code/Klaude/test.txt" } ``` -------------------------------- ### Vertex AI API Endpoint Example Source: https://github.com/captaincrouton89/.claude/blob/main/examples/docs/external/gemini-video-analysis.md Example of a POST request to the Vertex AI API for content generation, including project, location, and model parameters. ```bash POST https://aiplatform.googleapis.com/v1/projects/{project}/locations/{location}/publishers/google/models/{model}:generateContent ``` -------------------------------- ### TodoWrite Tool Output Example Source: https://github.com/captaincrouton89/.claude/blob/main/docs/external/hook-examples.md Output from the TodoWrite tool, showing the updated state of todos. ```json { "newTodos": [ { "activeForm": "Writing a short test file", "content": "Write a short test file", "status": "in_progress" }, { "activeForm": "Running bash echo command", "content": "Run bash echo command", "status": "pending" } ], "oldTodos": [ { "activeForm": "Writing a short test file", "content": "Write a short test file", "status": "pending" }, { "activeForm": "Running bash echo command", "content": "Run bash echo command", "status": "pending" } ] } ``` -------------------------------- ### Read Tool Output Example Source: https://github.com/captaincrouton89/.claude/blob/main/docs/external/hook-examples.md Output from the Read tool, containing the content and metadata of the specified file. ```json { "file": { "content": "Test", "filePath": "~/Code/Klaude/test.txt", "numLines": 1, "startLine": 1, "totalLines": 1 }, "type": "text" } ``` -------------------------------- ### Quick Start: Create First Command Source: https://github.com/captaincrouton89/.claude/blob/main/workflows/custom-slash-commands-guide.md Demonstrates the bash commands to create the necessary directory and a simple 'review' command file. ```bash mkdir -p .claude/commands echo "--- description: Quick code review --- Review $ARGUMENTS for: - Code quality - Best practices - Potential bugs" > .claude/commands/review.md ``` -------------------------------- ### Example Usage of Planning Command Source: https://github.com/captaincrouton89/.claude/blob/main/docs/features/planning-templates.doc.md Demonstrates how a user initiates a planning command and the system's response, including template referencing. ```bash # User runs planning command /shared # Command reads template and instructs: # "make a docs/plans/[plan-dir]/shared.md document... # using the template ~/.claude/file-templates/shared.template.md" ``` -------------------------------- ### Example: Copy Skills to New Project Source: https://github.com/captaincrouton89/.claude/blob/main/docs/external/skills-management.md Demonstrates copying skills to a new project's local skills directory. ```bash fetch-skills copy ./.claude/skills ``` -------------------------------- ### Loading CLAUDE.md Project Instructions Source: https://github.com/captaincrouton89/.claude/blob/main/docs/external/typescript-sdk.md Example demonstrating how to load project settings to include CLAUDE.md files by specifying the system prompt type and setting sources. ```typescript // Load project settings to include CLAUDE.md files const result = query({ prompt: "Add a new feature following project conventions", options: { systemPrompt: { type: 'preset', preset: 'claude_code' // Required to use CLAUDE.md }, settingSources: ['project'], // Loads CLAUDE.md from project directory allowedTools: ['Read', 'Write', 'Edit'] } }); ``` -------------------------------- ### Progressive Disclosure Example in SKILL.md Source: https://github.com/captaincrouton89/.claude/blob/main/skills/skills-guide/SKILL.md Demonstrates how to use progressive disclosure in SKILL.md by providing a quick start and linking to more detailed reference files. ```markdown ## Quick start Extract text with pdfplumber: ```python import pdfplumber with pdfplumber.open("file.pdf") as pdf: text = pdf.pages[0].extract_text() ``` ## Advanced features **Form filling**: See [FORMS.md](FORMS.md) **API reference**: See [REFERENCE.md](REFERENCE.md) **Examples**: See [EXAMPLES.md](EXAMPLES.md) ``` -------------------------------- ### Simple Scene Detection (CLI) Source: https://github.com/captaincrouton89/.claude/blob/main/examples/docs/external/opencv-scene-detection.md Performs basic scene detection on a video file using the command line. No additional setup is required beyond installation. ```bash scenedetect -i video.mp4 detect-content ``` -------------------------------- ### User Prompt Example for Style Switching Source: https://github.com/captaincrouton89/.claude/blob/main/docs/features/automatic-output-style-switching.doc.md Demonstrates how user prompts with specific keywords can trigger automatic changes in the output style. ```bash # User prompt automatically triggers style switching User: "Let's brainstorm some creative solutions for user onboarding" # System switches to Brainstorming output style User: "Now implement the login feature we discussed" # System switches to Sr. Software Developer output style ``` -------------------------------- ### Check Cursor Agent Version and Status Source: https://github.com/captaincrouton89/.claude/blob/main/docs/cursor-cli-reference.md Checks the installed version of the Cursor agent and verifies authentication and connection status. Essential for troubleshooting and ensuring proper setup. ```bash cursor-agent --version ``` ```bash cursor-agent status # Check auth and connection ``` -------------------------------- ### POST /items/{item_id}/upgrade-cost (Initialize Profile) Source: https://github.com/captaincrouton89/.claude/blob/main/examples/docs/generated/api-reference.md Initializes a new player profile after registration, creating starter items and gold. ```APIDOC ## POST /items/{item_id}/upgrade-cost ### Description Initialize new player profile (after registration). Creates starting inventory (6 level-1 items, 500 gold). ### Method POST ### Endpoint /items/{item_id}/upgrade-cost ### Responses #### Success Response (201) - Profile created with starter items ``` -------------------------------- ### Current Flow Example Source: https://github.com/captaincrouton89/.claude/blob/main/docs/agent-session-entry-analysis.md Illustrates the step-by-step process of entering and exiting an agent session, highlighting the session forking problem. ```text User in Parent Session S1 (PID 100) ↓ Task spawns agent → Agent Session S2 created (PID 200) in registry ↓ User runs enter-agent - Finds S2 in registry - Writes marker: S2 - Kills Claude PID 100 - Wrapper detects marker ↓ Wrapper runs: claude --resume S2 - Creates FORKED session S2' (different instance) - S2' is interactive in terminal ↓ User in agent (S2') now ↓ User runs exit-agent - Finds parent S1 in registry (via agent entry) - Writes marker: S1 - Kills Claude (managing S2') - Wrapper detects marker ↓ Wrapper runs: claude --resume S1 - Creates FORKED session S1' (different instance) - Problem: Original Task spawned in S1 is still expecting S1, not S1' - Task sees orphaned/forked state ``` -------------------------------- ### Install PySceneDetect with OpenCV Source: https://github.com/captaincrouton89/.claude/blob/main/examples/docs/external/opencv-scene-detection.md Installs PySceneDetect along with OpenCV support using pip. Ensure Python 3.7+ and NumPy are installed. ```bash pip install scenedetect[opencv] ``` -------------------------------- ### Install FFmpeg on macOS Source: https://github.com/captaincrouton89/.claude/blob/main/examples/docs/external/ffmpeg-analysis.md Installs FFmpeg using the Homebrew package manager. ```bash brew install ffmpeg ``` -------------------------------- ### Skill Discovery on Project Initialization Source: https://github.com/captaincrouton89/.claude/blob/main/docs/external/skills-management.md Demonstrates the process of initializing a new project with Claude, where skills are automatically discovered, fetched, and curated based on project type. ```bash $ cd my-new-project $ claude /init-workspace # Hook detects /init-workspace command # Hook runs: fetch-skills table # Skill list injected into agent prompt # # Agent receives: # - Available skills table # - Instructions to copy and curate # - Guidance on which skills to keep for project type # # Agent completes MCP + agent setup, then runs: # $ fetch-skills copy ./.claude/skills # # Agent deletes irrelevant skills, keeps only project-appropriate ones # Result: my-new-project/.claude/skills/ contains only relevant skills ``` -------------------------------- ### Install OpenAI Provider Source: https://github.com/captaincrouton89/.claude/blob/main/examples/docs/external/open-ai-provider-vercel-ai-sdk.md Install the OpenAI provider package using your preferred package manager. ```bash pnpm add @ai-sdk/openai ``` ```bash npm install @ai-sdk/openai ``` ```bash yarn add @ai-sdk/openai ``` ```bash bun add @ai-sdk/openai ``` -------------------------------- ### Analyze Video and Generate Recreation (4-8s Clips) Source: https://github.com/captaincrouton89/.claude/blob/main/examples/docs/external/README.md This workflow outlines the steps for processing short video clips. It involves analyzing video with Gemini, extracting and transcribing audio with ElevenLabs, generating a recreation with Replicate, creating new audio with ElevenLabs TTS, and combining everything using ffmpeg. ```bash # 1. Analyze video with Gemini # 2. Extract audio, transcribe with ElevenLabs # 3. Generate recreation with Replicate Veo 3 # 4. Generate audio with ElevenLabs TTS # 5. Combine using ffmpeg ``` -------------------------------- ### Verify FFmpeg and FFprobe Installation Source: https://github.com/captaincrouton89/.claude/blob/main/examples/docs/external/ffmpeg-analysis.md Checks if FFmpeg and FFprobe are installed and accessible in the system's PATH. ```bash ffmpeg -version ffprobe -version ``` -------------------------------- ### Gemini API Endpoint Example (Flash) Source: https://github.com/captaincrouton89/.claude/blob/main/examples/docs/external/gemini-video-analysis.md Specific example of a POST request targeting the gemini-2.5-flash model. ```bash POST https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent ``` -------------------------------- ### Install OpenCV Source: https://github.com/captaincrouton89/.claude/blob/main/examples/docs/external/opencv-scene-detection.md Installs the OpenCV library for Python using pip. The optional package provides GUI support. ```bash pip install opencv-python ``` ```bash pip install opencv-contrib-python ``` -------------------------------- ### Image-to-Video Recreation Workflow Source: https://github.com/captaincrouton89/.claude/blob/main/examples/docs/external/README.md This workflow demonstrates how to create videos from images. It involves extracting key frames, generating similar images, animating them, and adding audio. ```bash # 1. Extract key frames from original # 2. Generate similar images with Gemini/Imagen # 3. Animate images with Replicate I2V models # 4. Add audio with ElevenLabs ``` -------------------------------- ### Basic Query with Project Settings Source: https://github.com/captaincrouton89/.claude/blob/main/docs/features/typescript-sdk-reference.doc.md Demonstrates a basic query using the `query` function with project settings loaded from CLAUDE.md. It shows how to process messages and results from the SDK. ```typescript import { query } from '@anthropic-ai/claude-agent-sdk'; // Basic query with project settings const result = query({ prompt: "Add a new feature following project conventions", options: { systemPrompt: { type: 'preset', preset: 'claude_code' }, settingSources: ['project'], // Load CLAUDE.md allowedTools: ['Read', 'Write', 'Edit', 'Grep', 'Glob'] } }); // Process messages for await (const message of result) { if (message.type === 'assistant') { console.log('Claude:', message.message); } else if (message.type === 'result') { console.log('Cost:', message.total_cost_usd); console.log('Result:', message.result); } } ``` -------------------------------- ### Audio Input with OpenAI gpt-4o-audio-preview Source: https://github.com/captaincrouton89/.claude/blob/main/examples/docs/external/open-ai-provider-vercel-ai-sdk.md Example of passing audio files to the `gpt-4o-audio-preview` model for processing. Requires audio inputs and is currently in preview. ```typescript import { openai } from '@ai-sdk/openai'; import { generateText } from 'ai'; const result = await generateText({ model: openai.chat('gpt-4o-audio-preview'), messages: [ { role: 'user', content: [ { type: 'text', text: 'What is the audio saying?' }, { type: 'file', mediaType: 'audio/mpeg', data: fs.readFileSync('./data/galileo.mp3'), }, ], }, ], }); ``` -------------------------------- ### Hook Configuration Example Source: https://github.com/captaincrouton89/.claude/blob/main/docs/external/skills-management.md Shows how to register the auto-copy-skills hook in the settings.json file for automatic skill injection on project initialization. ```json { "UserPromptSubmit": [ { "command": "~/.claude/hooks/user-prompt-submit/auto-copy-skills.mjs", "timeout": 5000 } ] } ``` -------------------------------- ### SessionStart Hook Event Example Source: https://github.com/captaincrouton89/.claude/blob/main/docs/external/hook-examples.md Triggered when a new session begins. Includes current working directory, session ID, and transcript path. ```json { "cwd": "~/Code/Klaude", "hook_event_name": "SessionStart", "session_id": "10ad1de4-613a-470f-9463-bf4fcac617eb", "source": "startup", "transcript_path": "~/.claude/projects/-Users-silasrhyneer-Code-Klaude/10ad1de4-613a-470f-9463-bf4fcac617eb.jsonl" } ``` -------------------------------- ### Orchestrator Final Report Example Source: https://github.com/captaincrouton89/.claude/blob/main/agents-library/orchestrator.md An example of a final report generated by the orchestrator upon successful task completion. ```text ✅ Task completed successfully Summary: - Investigated 4 subsystems - Created implementation plan (docs/plans/auth/plan.md) - Implemented 15 refactors across 23 files - Build validation passed Agent work: - Explore: agent_001, agent_002, agent_003, agent_004 - Plan: agent_005 - programmer: agent_006, agent_007 - junior-engineer: agent_008 - agent_015 ``` -------------------------------- ### Project Directory Structure Example Source: https://github.com/captaincrouton89/.claude/blob/main/ARCHITECTURE-OVERVIEW.md Illustrates the hierarchical organization of project directories, including agent definitions, libraries, documentation, cached projects, and state management files. ```tree agents/ ├── Explore.md # Context discovery specialist (YOURS - search engine) ├── Plan.md # Planning & architecture specialist ├── general-purpose.md # Default fallback agent ├── programmer.md # Full-stack programmer ├── senior-programmer.md # Senior-level code review ├── senior-architect.md # Architecture decisions ├── junior-engineer.md # Guided learning / junior work ├── frontend-engineer.md # Frontend specialization ├── non-dev.md # Non-developer tasks ├── advisor.md # Strategic advising ├── library-docs-writer.md # Documentation specialist └── statusline-setup.md # Status line configuration ``` ```tree agents-library/ ├── db-modifier.md # Database schema modifications ├── documentor.md # Documentation generation ├── orchestrator.md # Multi-agent orchestration ├── product-designer.md # Product design workflows ├── research-specialist.md # Research & analysis └── video/ # Video-related agents ``` ```tree docs/ ├── CLAUDE.md # Doc directory conventions ├── product-requirements.md # PRD with features (F-##) ├── system-design.md # Architecture & components ├── design-spec.md # UI/UX screens ├── api-contracts.yaml # OpenAPI definitions ├── data-plan.md # Metrics & tracking ├── feature-spec/ # Feature specs (F-##-*.md) ├── user-stories/ # User stories (US-###-*.md) ├── user-flows/ # Primary user flows ├── guides/ # Process docs & runbooks ├── architecture/ # Architecture decisions └── external/ # External docs & references ``` ```tree projects/ ├── -Users-silasrhyneer-Code-claude-tools-klaude/ # Main project ├── -Users-silasrhyneer-Code-Cosmo-Saturn/ # Other projects └── [path-encoded project directories]/ ├── .claude/ # Project-specific state ├── state/ # Session state ├── todos/ # Todo tracking ├── debug/ # Debug logs └── file-history/ # File change history ``` ```tree conversation-state/ └── {session_id}.json # Protocol name, effort level, timestamp tracking ``` ```tree logs/ ├── hooks.log # All hook execution events └── [other logs] ``` -------------------------------- ### Tool Call Started Event Source: https://github.com/captaincrouton89/.claude/blob/main/docs/cursor-cli-reference.md This JSON object indicates the start of a tool call in the stream-json output format. ```json { "type": "tool_call", "subtype": "started", "call_id": "call-uuid", "tool_name": "read_file", "args": { "path": "src/auth.js" }, "session_id": "uuid-here" } ``` -------------------------------- ### Bad Description Example Source: https://github.com/captaincrouton89/.claude/blob/main/skills/skills-guide/SKILL.md This example shows a vague description that is not specific enough for Claude to effectively determine when to use the skill. ```text Helps with documents ``` -------------------------------- ### Usage Examples for Workflow Reminders Source: https://github.com/captaincrouton89/.claude/blob/main/docs/features/contextual-workflow-reminders.doc.md Demonstrates how user inputs trigger specific workflow reminders based on pattern matching. The system displays relevant guidance before task execution. ```bash # User input: "Make a plan for user authentication" # Triggers: PLANNING_PATTERNS match # Result: PLANNING_PROMPT displayed with comprehensive planning guidance # User input: "Investigate how payments work" # Triggers: INVESTIGATION_PATTERNS match # Result: INVESTIGATION_PROMPT displayed with discovery workflow guidance ``` -------------------------------- ### Gemini API Endpoint Example Source: https://github.com/captaincrouton89/.claude/blob/main/examples/docs/external/gemini-video-analysis.md Example of a POST request to the Gemini API for content generation, specifying the model name. ```bash POST https://generativelanguage.googleapis.com/v1beta/models/{model-name}:generateContent ``` -------------------------------- ### Skill Metadata Example Source: https://github.com/captaincrouton89/.claude/blob/main/docs/external/skills-management.md Illustrates the YAML frontmatter format used in SKILL.md for defining skill name and description. ```yaml --- name: Skill Display Name description: What this skill does and when to use it --- ``` -------------------------------- ### Text-to-Video Input Parameters Source: https://github.com/captaincrouton89/.claude/blob/main/examples/docs/external/replicate.md Example of input parameters for a text-to-video generation task, including prompt, duration, resolution, and FPS. ```json { "prompt": "A majestic eagle soaring over mountains", "duration": 5, "resolution": "720p", "fps": 24, "seed": 42, "guidance_scale": 7.5 } ``` -------------------------------- ### Install Required Python Packages Source: https://github.com/captaincrouton89/.claude/blob/main/docs/external/skills.md Install necessary Python packages for PDF processing and other utilities. Ensure your environment is set up before running skills. ```bash pip install pypdf pdfplumber ``` -------------------------------- ### Get Application Limits Endpoint Source: https://github.com/captaincrouton89/.claude/blob/main/hooks/pushover.md Retrieve message limits in the response body by making a GET request to the limits endpoint with your application token. ```http https://api.pushover.net/1/apps/limits.json?token=(your app token) ``` -------------------------------- ### Run Google Veo-3 Model Source: https://github.com/captaincrouton89/.claude/blob/main/examples/docs/external/replicate-video-models.md This example demonstrates how to run the Google Veo-3 model for video generation using the Replicate Python client. It specifies a prompt, duration, and resolution for the desired video. ```APIDOC ## Run Google Veo-3 Model ### Description This example demonstrates how to run the Google Veo-3 model for video generation using the Replicate Python client. It specifies a prompt, duration, and resolution for the desired video. ### Method `replicate.run()` ### Parameters #### Model - **model_name** (string) - Required - The identifier for the model to run (e.g., "google/veo-3"). #### Input Parameters - **prompt** (string) - Required - The text prompt describing the desired video content. - **duration** (integer) - Optional - The desired duration of the video in seconds. - **resolution** (string) - Optional - The desired resolution of the video (e.g., "720p", "1080p"). ### Request Example ```python import replicate output = replicate.run( "google/veo-3", input={ "prompt": "A serene mountain landscape at sunset", "duration": 5, "resolution": "720p" } ) print(output) ``` ### Response #### Success Response - The response will contain the output generated by the model, typically a URL to the video file. ``` -------------------------------- ### Client Initialization Source: https://github.com/captaincrouton89/.claude/blob/main/examples/docs/external/convex-client-api.md Demonstrates how to initialize the Convex client in JavaScript/TypeScript (Reactive and HTTP), Swift, and React. ```APIDOC ## Client Initialization ### JavaScript/TypeScript ConvexClient (Reactive) ```typescript new ConvexClient(address: string, options?: ConvexClientOptions) // Immediately initiates WebSocket connection ``` ### JavaScript/TypeScript ConvexHttpClient (Stateless) ```typescript new ConvexHttpClient( address: string, options?: { skipConvexDeploymentUrlCheck?: boolean, logger?: boolean | Logger, auth?: string } ) ``` ### Swift ConvexClient ```swift let convex = ConvexClient(deploymentUrl: "https://.convex.cloud") // Single instance for application lifetime ``` ### React ConvexReactClient ```typescript new ConvexReactClient(deploymentUrl: string, options?: { expectAuth?: boolean // Pause queries until user authenticated }) ``` ``` -------------------------------- ### Create and List R2 Buckets Source: https://github.com/captaincrouton89/.claude/blob/main/examples/docs/external/r2-image-hosting.md Commands to create a new R2 bucket named 'mystica-assets' and list all available buckets. Use 'list' to verify successful creation. ```bash # Create the bucket wrangler r2 bucket create mystica-assets # List buckets to verify wrangler r2 bucket list ``` -------------------------------- ### Commit Message Formatting Example Source: https://github.com/captaincrouton89/.claude/blob/main/skills/skills-guide/SKILL.md Example of how to format commit messages with a type, scope, and subject, followed by a body. This is useful for maintaining a consistent commit history. ```markdown feat(auth): implement JWT-based authentication Add login endpoint and token validation middleware ``` ```markdown fix(reports): correct date formatting in timezone conversion ``` -------------------------------- ### Test Results and Coverage Report Example Source: https://github.com/captaincrouton89/.claude/blob/main/hooks/state-tracking/TESTING.md An example of a test results summary and a detailed coverage report, including overall statistics and specific uncovered lines. ```markdown ## Test Results & Coverage ### ✅ Test Execution **Tests written:** [N] test cases **Test suites:** [N] files **Total assertions:** [N] **Results:** ``` PASS src/auth/login.test.js User Authentication when logging in with valid credentials ✓ should return JWT token (45ms) ✓ should set user session (23ms) when logging in with invalid credentials ✓ should throw authentication error (12ms) ✓ should not create session (8ms) Test Suites: 1 passed, 1 total Tests: 4 passed, 4 total Time: 2.451s ``` --- ### 📊 Coverage Report **Overall coverage:** ``` File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Lines --------------------|---------|----------|---------|---------|---------------- All files | 92.5 | 85.3 | 95.0 | 90.8 | auth/ | 95.0 | 88.2 | 100.0 | 94.5 | login.js | 95.0 | 88.2 | 100.0 | 94.5 | 45, 67 utils/ | 88.0 | 80.0 | 87.5 | 85.0 | validation.js | 88.0 | 80.0 | 87.5 | 85.0 | 23-25, 89 ``` --- ### 🎯 Coverage Analysis **Well-covered areas:** - ✓ Happy paths: 100% coverage - ✓ Authentication flows: 95% coverage - ✓ Error handling: 90% coverage **Missing coverage:** 1. **auth/login.js:45, 67** - Uncovered: Rare database connection error scenario - Impact: Low (edge case) - Recommendation: Add test or document as acceptable gap - Priority: Low 2. **utils/validation.js:23-25** - Uncovered: Regex fallback for old browser - Impact: Medium - Recommendation: Add test for legacy browser path - Priority: Medium **Overall assessment:** Coverage meets [80%+] target. Missing areas are low-priority edge cases. ``` -------------------------------- ### Write Tool Output Example (File Update) Source: https://github.com/captaincrouton89/.claude/blob/main/docs/external/hook-examples.md Output from the Write tool indicating a file update, including a structured patch detailing the changes. ```json { "content": "test", "filePath": "~/Code/Klaude/test.txt", "structuredPatch": [ { "lines": [ "-Test", "\\ No newline at end of file", "+test", "\\ No newline at end of file" ], "newLines": 1, "newStart": 1, "oldLines": 1, "oldStart": 1 } ], "type": "update" } ``` -------------------------------- ### Authenticate and List Models Source: https://github.com/captaincrouton89/.claude/blob/main/examples/docs/external/elevenlabs.md Example using curl to authenticate with an API key and retrieve a list of available models. Ensure you replace 'YOUR_API_KEY' with your actual key. ```bash curl 'https://api.elevenlabs.io/v1/models' \ -H 'Content-Type: application/json' \ -H 'xi-api-key: YOUR_API_KEY' ``` -------------------------------- ### POST Request Example (URL-encoded) Source: https://github.com/captaincrouton89/.claude/blob/main/hooks/pushover.md This example demonstrates how to construct a URL-encoded POST request to the Pushover API to send a message. Ensure you use HTTPS and the POST method. ```http POST /1/messages.json HTTP/1.1 Host: api.pushover.net Content-Type: application/x-www-form-urlencoded Content-Length: 180 token=azGDORePK8gMaC0QOYAMyEEuzJnyUi&user=uQiRzpo4DXghDmr9QzzfQu27cmVRsG&device=droid4&title=Backup+finished+-+SQL1&message=Backup+of+database+%22example%22+finished+in+16+minutes. ``` -------------------------------- ### Generate Image with R2-Hosted Reference Images Source: https://github.com/captaincrouton89/.claude/blob/main/examples/docs/external/r2-image-hosting.md Example commands to run the `generate-image.ts` script using R2-hosted reference images via their public R2.dev URLs. Demonstrates using a subset or all available reference images. ```bash # With R2.dev public URLs (current setup) npx tsx scripts/generate-image.ts --type "Magic Wand" --materials "wood,crystal" \ -r "https://pub-1f07f440a8204e199f8ad01009c67cf5.r2.dev/image-refs/IMG_0821.png,https://pub-1f07f440a8204e199f8ad01009c67cf5.r2.dev/image-refs/IMG_4317.png" # With all reference images npx tsx scripts/generate-image.ts --type "Fire Staff" --materials "wood,ruby" --provider gemini \ -r "https://pub-1f07f440a8204e199f8ad01009c67cf5.r2.dev/image-refs/IMG_0821.png,https://pub-1f07f440a8204e199f8ad01009c67cf5.r2.dev/image-refs/IMG_2791.png,https://pub-1f07f440a8204e199f8ad01009c67cf5.r2.dev/image-refs/IMG_4317.png,https://pub-1f07f440a8204e199f8ad01009c67cf5.r2.dev/image-refs/IMG_5508.png,https://pub-1f07f440a8204e199f8ad01009c67cf5.r2.dev/image-refs/IMG_9455.png" ```