### Mem0 Integration Example Source: https://github.com/guanyang/open-agent-hub/blob/main/skills/memory-systems/SKILL.md Demonstrates adding user preferences to Mem0 and searching for the current preference. Ensure Mem0 is installed and initialized. ```python from mem0 import Memory m = Memory() m.add("User prefers dark mode and Python 3.12", user_id="alice") m.add("User switched to light mode", user_id="alice") # Retrieves current preference (light mode), not outdated one results = m.search("What theme does the user prefer?", user_id="alice") ``` -------------------------------- ### Manual Environment Setup Source: https://github.com/guanyang/open-agent-hub/blob/main/skills/notebooklm/SKILL.md Use these commands if automatic environment setup fails. This includes creating a virtual environment, activating it, installing dependencies, and installing the Chromium browser. ```bash python -m venv .venv source .venv/bin/activate # Linux/Mac pip install -r requirements.txt python -m patchright install chromium ``` -------------------------------- ### One-Time Agent and Environment Setup using SDK Source: https://github.com/guanyang/open-agent-hub/blob/main/skills/claude-api/shared/managed-agents-onboarding.md If the 'ant' CLI is unavailable or in-language setup is preferred, use these SDK calls to create agents and environments. Ensure these are run only once and the resulting IDs are stored, for example, in a .env file. ```python # ONE-TIME SETUP — run once, save the IDs to config/.env # environments.create() # agents.create() ``` -------------------------------- ### Setup Authentication Source: https://github.com/guanyang/open-agent-hub/blob/main/skills/notebooklm/references/usage_patterns.md Initiate the authentication setup process using run.py with auth_manager.py and 'setup'. Note that this operation may open a browser window. ```bash run.py auth_manager.py setup ``` -------------------------------- ### Run Express Example Source: https://github.com/guanyang/open-agent-hub/blob/main/skills/brainstorming/scripts/node_modules/express/Readme.md Execute a specific example from the cloned Express repository. Replace 'content-negotiation' with the desired example name. ```console $ node examples/content-negotiation ``` -------------------------------- ### Quick Start with Claude Agent SDK Source: https://github.com/guanyang/open-agent-hub/blob/main/skills/claude-api/python/agent-sdk/README.md A basic example demonstrating how to use the `query` function to interact with an agent. It specifies allowed tools and prints the agent's results. ```python import anyio from claude_agent_sdk import query, ClaudeAgentOptions, ResultMessage async def main(): async for message in query( prompt="Explain this codebase", options=ClaudeAgentOptions(allowed_tools=["Read", "Glob", "Grep"]) ): if isinstance(message, ResultMessage): print(message.result) anyio.run(main) ``` -------------------------------- ### Start Visual Companion Server with Custom Host Source: https://github.com/guanyang/open-agent-hub/blob/main/skills/brainstorming/visual-companion.md Binds the server to a non-loopback host (0.0.0.0) and specifies the hostname for the returned URL. Useful for remote or containerized setups where the default localhost URL might be unreachable. ```bash scripts/start-server.sh \ --project-dir /path/to/project \ --host 0.0.0.0 \ --url-host localhost ``` -------------------------------- ### Setup Authentication with Timeout Source: https://github.com/guanyang/open-agent-hub/blob/main/skills/notebooklm/references/troubleshooting.md Performs a fresh authentication setup with a specified timeout. This can help if the default setup process times out. ```bash python scripts/run.py auth_manager.py setup --timeout 15 ``` -------------------------------- ### Install serve-static Source: https://github.com/guanyang/open-agent-hub/blob/main/skills/brainstorming/scripts/node_modules/serve-static/README.md Install the serve-static module using npm. ```sh $ npm install serve-static ``` -------------------------------- ### Initial Setup: Authentication and Notebook Addition Source: https://github.com/guanyang/open-agent-hub/blob/main/skills/notebooklm/references/usage_patterns.md Steps for initial setup, including checking authentication, performing setup if needed (requires visible browser), and adding the first notebook with user-provided details. ```bash # 1. Check authentication (using run.py!) python scripts/run.py auth_manager.py status ``` ```bash # 2. If not authenticated, setup (Browser MUST be visible!) python scripts/run.py auth_manager.py setup # Tell user: "Please log in to Google in the browser window" ``` ```bash # 3. Add first notebook - ASK USER FOR DETAILS FIRST! # Ask: "What does this notebook contain?" # Ask: "What topics should I tag it with?" python scripts/run.py notebook_manager.py add \ --url "https://notebooklm.google.com/notebook/..." \ --name "User provided name" \ --description "User provided description" \ --topics "user,provided,topics" ``` -------------------------------- ### Install NotebookLM Claude Code Skill Source: https://github.com/guanyang/open-agent-hub/blob/main/skills/notebooklm/README.md Clone the NotebookLM skill repository into your Claude skills directory to get started. After installation, you can access your skills by asking Claude: "What are my skills?" ```bash cd ~/.claude/skills git clone https://github.com/PleasePrompto/notebooklm-skill notebooklm # Open Claude Code: "What are my skills?" ``` -------------------------------- ### First-Time Setup - Media Handling Question Source: https://github.com/guanyang/open-agent-hub/blob/main/skills/baoyu-danger-x-to-markdown/SKILL.md Asks the user how to handle images and videos during the first-time setup for the X to Markdown skill. ```text Question 1 -- header: "Media", question: "How to handle images and videos in tweets?" - "Ask each time (Recommended)" — After saving markdown, ask whether to download media - "Always download" — Always download media to local imgs/ and videos/ directories - "Never download" — Keep original remote URLs in markdown ``` -------------------------------- ### Message Request with System Prompt Source: https://github.com/guanyang/open-agent-hub/blob/main/skills/claude-api/typescript/claude-api/README.md Send a message request with a system prompt to guide the AI's behavior. This example instructs the AI to provide Python examples. ```typescript const response = await client.messages.create({ model: "claude-opus-4-8", max_tokens: 16000, system: "You are a helpful coding assistant. Always provide examples in Python.", messages: [{ role: "user", content: "How do I read a JSON file?" }], }); ``` -------------------------------- ### First-Time Setup - Output Directory Question Source: https://github.com/guanyang/open-agent-hub/blob/main/skills/baoyu-danger-x-to-markdown/SKILL.md Asks the user for the default output directory during the first-time setup for the X to Markdown skill. ```text Question 2 -- header: "Output", question: "Default output directory?" - "x-to-markdown (Recommended)" — Save to ./x-to-markdown/{username}/{tweet-id}.md - (User may choose "Other" to type a custom path) ``` -------------------------------- ### Claude API with System Prompt Source: https://github.com/guanyang/open-agent-hub/blob/main/skills/claude-api/python/claude-api/README.md Utilize a system prompt to guide the Claude API's behavior. This example sets the assistant to be a helpful coding assistant that provides Python examples. ```python response = client.messages.create( model="claude-opus-4-8", max_tokens=16000, system="You are a helpful coding assistant. Always provide examples in Python.", messages=[{"role": "user", "content": "How do I read a JSON file?"}] ) ``` -------------------------------- ### Full Preferences Example Source: https://github.com/guanyang/open-agent-hub/blob/main/skills/baoyu-infographic/references/config/preferences-schema.md An example demonstrating all configurable preferences, including custom styles with specific prompt fragments. ```yaml --- version: 1 preferred_layout: dense-modules preferred_style: morandi-journal preferred_aspect: portrait language: zh preferred_image_backend: codex-imagegen custom_styles: - name: my-brand description: "Brand-aligned warm pastel infographic" prompt_fragment: "Use brand pastel palette (#F2C7B6, #B6D7E8, #C8E0B4); rounded rectangles; warm hand-drawn outlines; ample whitespace." --- ``` -------------------------------- ### Server Startup Response Example Source: https://github.com/guanyang/open-agent-hub/blob/main/skills/brainstorming/visual-companion.md Example JSON response from the server indicating a successful startup. Save the screen_dir and state_dir values for later use. ```json # Returns: {"type":"server-started","port":52341, # "url":"http://localhost:52341/?key=ab12…", # "screen_dir":"/path/to/project/.superpowers/brainstorm/12345-1706000000/content", # "state_dir":"/path/to/project/.superpowers/brainstorm/12345-1706000000/state"} ``` -------------------------------- ### Usage Example: Accessing Array.prototype.slice Source: https://github.com/guanyang/open-agent-hub/blob/main/skills/brainstorming/scripts/node_modules/call-bound/README.md Demonstrates how to use callBound to get a reference to Array.prototype.slice. This is useful when native methods might be deleted or overridden. The example then uses this bound slice function to extract a sub-array. ```js const assert = require('assert'); const callBound = require('call-bound'); const slice = callBound('Array.prototype.slice'); delete Function.prototype.call; delete Function.prototype.bind; delete Array.prototype.slice; assert.deepEqual(slice([1, 2, 3, 4], 1, -1), [2, 3]); ``` -------------------------------- ### Full Setup Questions Source: https://github.com/guanyang/open-agent-hub/blob/main/skills/baoyu-imagine/references/config/first-time-setup.md Use AskUserQuestion with all questions in a single call for the full setup process when no EXTEND.md is found. ```yaml header: "Provider" question: "Default image generation provider?" options: - label: "Google (Recommended)" description: "Gemini multimodal - high quality, reference images, flexible sizes" - label: "OpenAI" description: "GPT Image 2 - latest OpenAI image model, reference-image workflows" - label: "Azure OpenAI" description: "Azure-hosted GPT Image deployments with resource-specific routing" - label: "OpenRouter" description: "Router for Gemini/FLUX/OpenAI-compatible image models" - label: "DashScope" description: "Alibaba Cloud - Qwen-Image, strong Chinese/English text rendering" - label: "Z.AI" description: "GLM-image, strong poster and text-heavy image generation" - label: "MiniMax" description: "MiniMax image generation with subject-reference character workflows" - label: "Replicate" description: "Curated Replicate image families - nano-banana-2, Seedream, and Wan image models" ``` ```yaml header: "Google Model" question: "Default Google image generation model?" options: - label: "gemini-3-pro-image-preview (Recommended)" description: "Highest quality, best for production use" - label: "gemini-3.1-flash-image-preview" description: "Fast generation, good quality, lower cost" - label: "gemini-3-flash-preview" description: "Fast generation, balanced quality and speed" ``` ```yaml header: "OpenRouter Model" question: "Default OpenRouter image generation model?" options: - label: "google/gemini-3.1-flash-image-preview (Recommended)" description: "Best general-purpose OpenRouter image model with reference-image workflows" - label: "google/gemini-2.5-flash-image-preview" description: "Fast Gemini preview model on OpenRouter" - label: "black-forest-labs/flux.2-pro" description: "Strong text-to-image quality through OpenRouter" ``` ```yaml header: "Azure Deploy" question: "Default Azure image deployment name?" options: - label: "gpt-image-2 (Recommended)" description: "Use if your Azure deployment uses the GPT Image 2 model name" - label: "gpt-image-1.5" description: "Previous GPT Image deployment name" - label: "gpt-image-1" description: "Earlier GPT Image deployment name" ``` ```yaml header: "MiniMax Model" question: "Default MiniMax image generation model?" options: - label: "image-01 (Recommended)" description: "Best default, supports aspect ratios and custom width/height" - label: "image-01-live" description: "Faster variant, use aspect ratio instead of custom size" ``` ```yaml header: "Z.AI Model" question: "Default Z.AI image generation model?" options: - label: "glm-image (Recommended)" description: "Best default for posters, diagrams, and text-heavy images" - label: "cogview-4-250304" description: "Legacy Z.AI image model on the same endpoint" ``` ```yaml header: "Quality" question: "Default image quality?" options: - label: "2k (Recommended)" description: "2048px - covers, illustrations, infographics" - label: "normal" description: "1024px - quick previews, drafts" ``` -------------------------------- ### Express Example Source: https://github.com/guanyang/open-agent-hub/blob/main/skills/brainstorming/scripts/node_modules/raw-body/README.md Integrates raw-body into an Express application to access the raw request body. Ensure 'content-type' and 'raw-body' are installed. ```javascript var contentType = require('content-type') var express = require('express') var getRawBody = require('raw-body') var app = express() app.use(function (req, res, next) { getRawBody(req, { length: req.headers['content-length'], limit: '1mb', encoding: contentType.parse(req).parameters.charset }, function (err, string) { if (err) return next(err) req.text = string next() }) }) // now access req.text ``` -------------------------------- ### Full Preferences Configuration Example Source: https://github.com/guanyang/open-agent-hub/blob/main/skills/baoyu-image-gen/references/config/preferences-schema.md This example demonstrates a comprehensive configuration including all default settings for providers, quality, aspect ratio, image size, API dialect, specific models for various providers, and detailed batch processing limits. ```yaml --- version: 1 default_provider: google default_quality: 2k default_aspect_ratio: "16:9" default_image_size: 2K default_image_api_dialect: null default_model: google: "gemini-3-pro-image" openai: "gpt-image-2" azure: "gpt-image-2" openrouter: "google/gemini-3.1-flash-image" dashscope: "qwen-image-2.0-pro" zai: "glm-image" minimax: "image-01" replicate: "google/nano-banana-2" agnes: "agnes-image-2.1-flash" batch: max_workers: 10 provider_limits: replicate: concurrency: 5 start_interval_ms: 700 azure: concurrency: 3 start_interval_ms: 1100 zai: concurrency: 3 start_interval_ms: 1100 openrouter: concurrency: 3 start_interval_ms: 1100 minimax: concurrency: 3 start_interval_ms: 1100 agnes: concurrency: 3 start_interval_ms: 1100 --- ``` -------------------------------- ### Start Visual Companion Server Source: https://github.com/guanyang/open-agent-hub/blob/main/skills/brainstorming/visual-companion.md Initiates the visual companion server. Use --project-dir to persist mockups and enable same-port restarts. The --open flag automatically opens the user's browser on the first screen. ```bash scripts/start-server.sh --project-dir /path/to/project --open ``` -------------------------------- ### Clone Express Repository Source: https://github.com/guanyang/open-agent-hub/blob/main/skills/brainstorming/scripts/node_modules/express/Readme.md Clone the Express repository to access and run examples. This command fetches the repository and installs necessary dependencies. ```console $ git clone https://github.com/expressjs/express.git --depth 1 $ cd express $ npm install ``` -------------------------------- ### Setup and Basic Document Creation Source: https://github.com/guanyang/open-agent-hub/blob/main/skills/docx/SKILL.md Import necessary components from the 'docx' library and create a basic document. The document is then packed into a buffer and saved to a file. ```javascript const { Document, Packer, Paragraph, TextRun, Table, TableRow, TableCell, ImageRun, Header, Footer, AlignmentType, PageOrientation, LevelFormat, ExternalHyperlink, InternalHyperlink, Bookmark, FootnoteReferenceRun, PositionalTab, PositionalTabAlignment, PositionalTabRelativeTo, PositionalTabLeader, TabStopType, TabStopPosition, Column, SectionType, TableOfContents, HeadingLevel, BorderStyle, WidthType, ShadingType, VerticalAlign, PageNumber, PageBreak } = require('docx'); const doc = new Document({ sections: [{ children: [/* content */] }] }); Packer.toBuffer(doc).then(buffer => fs.writeFileSync("doc.docx", buffer)); ``` -------------------------------- ### Style Reference Example Source: https://github.com/guanyang/open-agent-hub/blob/main/skills/baoyu-article-illustrator/references/workflow.md For style references, analyze the image and append style traits to the prompt. This guides the generation towards a specific aesthetic. ```bash "Style: clean lines, gradient backgrounds..." ``` -------------------------------- ### Install and Build Documentation Source: https://github.com/guanyang/open-agent-hub/blob/main/skills/brainstorming/scripts/node_modules/fill-range/README.md Install global documentation generation tools and build the README file. ```sh $ npm install -g verbose/verb#dev verb-generate-readme && verb ``` -------------------------------- ### Guided Setup Prompt for WeChat API Credentials Source: https://github.com/guanyang/open-agent-hub/blob/main/skills/baoyu-post-to-wechat/references/api-setup.md Display this message to the user to guide them through obtaining WeChat API credentials and choosing a save location. It instructs users to visit the WeChat MP website and provides options for project-level or user-level credential storage. ```text WeChat API credentials not found. To obtain credentials: 1. Visit https://mp.weixin.qq.com 2. Go to: 开发 → 基本配置 3. Copy AppID and AppSecret Where to save? A) Project-level: .baoyu-skills/.env (this project only) B) User-level: ~/.baoyu-skills/.env (all projects) ``` -------------------------------- ### Usage Example Source: https://github.com/guanyang/open-agent-hub/blob/main/skills/brainstorming/scripts/node_modules/side-channel-weakmap/README.md Demonstrates how to use the side-channel-weakmap to set, get, assert, and delete keys. It also shows how to handle errors when asserting a non-existent key. ```js const assert = require('assert'); const getSideChannelList = require('side-channel-weakmap'); const channel = getSideChannelList(); const key = {}; assert.equal(channel.has(key), false); assert.throws(() => channel.assert(key), TypeError); channel.set(key, 42); channel.assert(key); // does not throw assert.equal(channel.has(key), true); assert.equal(channel.get(key), 42); channel.delete(key); assert.equal(channel.has(key), false); assert.throws(() => channel.assert(key), TypeError); ``` -------------------------------- ### Full Preferences Example Source: https://github.com/guanyang/open-agent-hub/blob/main/skills/baoyu-article-illustrator/references/config/preferences-schema.md A comprehensive example demonstrating a full preferences configuration, including watermark details, preferred image backend, generation batch size, and a custom style definition. ```yaml --- version: 1 watermark: enabled: true content: "@myaccount" position: bottom-right preferred_style: name: notion description: "Clean illustrations for tech articles" language: zh preferred_image_backend: codex-imagegen generation_batch_size: 4 custom_styles: - name: corporate description: "Professional B2B style" color_palette: primary: ["#1E3A5F", "#4A90D9"] background: "#F5F7FA" accents: ["#00B4D8", "#48CAE4"] visual_elements: "Clean lines, subtle gradients, geometric shapes" typography: "Modern sans-serif, professional" best_for: "Business, SaaS, enterprise" --- ``` -------------------------------- ### Correct Parallelization with better-all Source: https://github.com/guanyang/open-agent-hub/blob/main/skills/react-best-practices/rules/async-dependencies.md Use better-all to automatically maximize parallelism for operations with partial dependencies. It starts each task as early as possible. Ensure you have 'better-all' installed. ```typescript import { all } from 'better-all' const { user, config, profile } = await all({ async user() { return fetchUser() }, async config() { return fetchConfig() }, async profile() { return fetchProfile((await this.$.user).id) } }) ``` -------------------------------- ### Full Preferences Example Source: https://github.com/guanyang/open-agent-hub/blob/main/skills/baoyu-image-cards/references/config/preferences-schema.md A comprehensive example showcasing all configurable preferences, including custom styles, layout, language, and image backend. ```yaml --- version: 1 watermark: enabled: true content: "@myxhsaccount" position: bottom-right preferred_style: name: notion description: "Clean knowledge cards for tech content" preferred_layout: dense language: zh preferred_image_backend: codex-imagegen generation_batch_size: 4 custom_styles: - name: corporate description: "Professional B2B style" color_palette: primary: ["#1E3A5F", "#4A90D9"] background: "#F5F7FA" accents: ["#00B4D8", "#48CAE4"] visual_elements: "Clean lines, subtle gradients, geometric shapes" typography: "Modern sans-serif, professional" best_for: "Business, SaaS, enterprise" --- ``` -------------------------------- ### Usage Example Source: https://github.com/guanyang/open-agent-hub/blob/main/skills/brainstorming/scripts/node_modules/side-channel-list/README.md Demonstrates how to use the side-channel-list to set, get, assert, and delete data associated with a key. It also shows the behavior of `has` and `assert` methods before and after deletion. ```js const assert = require('assert'); const getSideChannelList = require('side-channel-list'); const channel = getSideChannelList(); const key = {}; assert.equal(channel.has(key), false); assert.throws(() => channel.assert(key), TypeError); channel.set(key, 42); channel.assert(key); // does not throw assert.equal(channel.has(key), true); assert.equal(channel.get(key), 42); channel.delete(key); assert.equal(channel.has(key), false); assert.throws(() => channel.assert(key), TypeError); ``` -------------------------------- ### Build Documentation Source: https://github.com/guanyang/open-agent-hub/blob/main/skills/brainstorming/scripts/node_modules/picomatch/README.md Install global dependencies for documentation generation and then run the build command. Note that the README is generated and should not be edited directly. ```sh npm install -g verbose/verb#dev verb-generate-readme && verb ``` -------------------------------- ### Basic Presentation Setup Source: https://github.com/guanyang/open-agent-hub/blob/main/skills/pptx/pptxgenjs.md Initializes a new presentation, sets layout and metadata, adds a slide with text, and saves the presentation to a file. ```javascript const pptxgen = require("pptxgenjs"); let pres = new pptxgen(); pres.layout = 'LAYOUT_16x9'; // or 'LAYOUT_16x10', 'LAYOUT_4x3', 'LAYOUT_WIDE' pres.author = 'Your Name'; pres.title = 'Presentation Title'; let slide = pres.addSlide(); slide.addText("Hello World!", { x: 0.5, y: 0.5, fontSize: 36, color: "363636" }); pres.writeFile({ fileName: "Presentation.pptx" }); ``` -------------------------------- ### Getting Nodes by Exact Line Number Source: https://github.com/guanyang/open-agent-hub/blob/main/skills/docx/ooxml.md Locate a node at a precise line number where its tag opens. Ensure the line number corresponds to the tag's start. ```python # By exact line number (must be line number where tag opens) para = doc["word/document.xml"].get_node(tag="w:p", line_number=42) ``` -------------------------------- ### First-Time Setup - Preferences Save Location Question Source: https://github.com/guanyang/open-agent-hub/blob/main/skills/baoyu-danger-x-to-markdown/SKILL.md Asks the user where to save their preferences during the first-time setup for the X to Markdown skill. ```text Question 3 -- header: "Save", question: "Where to save preferences?" - "User (Recommended)" — ~/.baoyu-skills/ (all projects) - "Project" — .baoyu-skills/ (this project only) ``` -------------------------------- ### Get Client IP Address (Behind Proxy) Source: https://github.com/guanyang/open-agent-hub/blob/main/skills/brainstorming/scripts/node_modules/ws/README.md When a WebSocket server is behind a proxy, this example shows how to obtain the client's IP address from the `X-Forwarded-For` header. ```javascript wss.on('connection', function connection(ws, req) { const ip = req.headers['x-forwarded-for'].split(',')[0].trim(); ws.on('error', console.error); }); ``` -------------------------------- ### Usage Example Source: https://github.com/guanyang/open-agent-hub/blob/main/skills/brainstorming/scripts/node_modules/side-channel-map/README.md Demonstrates how to use the side-channel-map to set, get, assert, and delete values associated with keys. It also shows how to handle errors when asserting a key that has not been set. ```js const assert = require('assert'); const getSideChannelMap = require('side-channel-map'); const channel = getSideChannelMap(); const key = {}; assert.equal(channel.has(key), false); assert.throws(() => channel.assert(key), TypeError); channel.set(key, 42); channel.assert(key); // does not throw assert.equal(channel.has(key), true); assert.equal(channel.get(key), 42); channel.delete(key); assert.equal(channel.has(key), false); assert.throws(() => channel.assert(key), TypeError); ``` -------------------------------- ### Conditional Workflow Logic Source: https://github.com/guanyang/open-agent-hub/blob/main/skills/skill-creator/references/workflows.md Guide Claude through decision points for tasks with branching logic. This example shows how to determine the next steps based on content modification type. ```markdown 1. Determine the modification type: **Creating new content?** → Follow "Creation workflow" below **Editing existing content?** → Follow "Editing workflow" below 2. Creation workflow: [steps] 3. Editing workflow: [steps] ``` -------------------------------- ### Install @remotion/media-utils Source: https://github.com/guanyang/open-agent-hub/blob/main/skills/remotion/rules/audio-visualization.md Install the necessary package for audio visualization functionalities. ```bash npx remotion add @remotion/media-utils ``` -------------------------------- ### Create and Start a Minimal Agent Session Source: https://github.com/guanyang/open-agent-hub/blob/main/skills/claude-api/go/managed-agents/README.md This snippet demonstrates the essential steps to create a new agent with basic configurations (name, model, system prompt, tools) and then start a new session with that agent. It requires the `anthropic` Go SDK and an initialized Anthropic client. ```go // 1. Create the agent (reusable, versioned) agent, err := client.Beta.Agents.New(ctx, anthropic.BetaAgentNewParams{ Name: "Coding Assistant", Model: anthropic.BetaManagedAgentsModelConfigParams{ ID: "claude-opus-4-8", Type: anthropic.BetaManagedAgentsModelConfigParamsTypeModelConfig, }, System: anthropic.String("You are a helpful coding assistant."), Tools: []anthropic.BetaAgentNewParamsToolUnion{{ OfAgentToolset20260401: &anthropic.BetaManagedAgentsAgentToolset20260401Params{ Type: anthropic.BetaManagedAgentsAgentToolset20260401ParamsTypeAgentToolset20260401, }, }}, }) if err != nil { panic(err) } // 2. Start a session session, err := client.Beta.Sessions.New(ctx, anthropic.BetaSessionNewParams{ Agent: anthropic.BetaSessionNewParamsAgentUnion{ OfBetaManagedAgentsAgents: &anthropic.BetaManagedAgentsAgentParams{ Type: anthropic.BetaManagedAgentsAgentParamsTypeAgent, ID: agent.ID, Version: anthropic.Int(agent.Version), }, }, EnvironmentID: environment.ID, Title: anthropic.String("Quickstart session"), }) if err != nil { panic(err) } fmt.Printf("Session ID: %s, status: %s\n", session.ID, session.Status) ``` -------------------------------- ### Token Management for GitHub Operations Source: https://github.com/guanyang/open-agent-hub/blob/main/skills/hosted-agents/references/infrastructure-patterns.md Manages tokens for GitHub operations, including getting short-lived installation tokens for repository access and user OAuth tokens for PR creation. ```python class TokenManager: """Manage tokens for GitHub operations.""" def get_app_installation_token(self, repo: str) -> str: """Get short-lived token for repo access.""" # Token expires in 1 hour return github_app.create_installation_token( installation_id=self.get_installation_id(repo), permissions={"contents": "write", "pull_requests": "write"} ) def get_user_token(self, user_id: str) -> str: """Get user's OAuth token for PR creation.""" # Stored encrypted, decrypted at runtime encrypted = self.storage.get(f"user_token:{user_id}") return self.decrypt(encrypted) ``` -------------------------------- ### Run.py Script Wrapper Usage Source: https://github.com/guanyang/open-agent-hub/blob/main/skills/notebooklm/references/api_reference.md The `run.py` script acts as a wrapper for executing other skill scripts, handling environment setup automatically. It creates a virtual environment if needed and installs dependencies. ```bash python scripts/run.py [script_name].py [arguments] ``` ```bash python scripts/run.py auth_manager.py status ``` ```bash python scripts/run.py ask_question.py --question "..." ``` -------------------------------- ### Start Remotion Studio Preview Source: https://github.com/guanyang/open-agent-hub/blob/main/skills/remotion/SKILL.md Use this command to launch the Remotion Studio, which provides a live preview of your video compositions. This is useful for iterative development and immediate feedback. ```bash npx remotion studio ``` -------------------------------- ### Basic FFmpeg and FFprobe Commands Source: https://github.com/guanyang/open-agent-hub/blob/main/skills/remotion/rules/ffmpeg.md Use these commands to perform basic video and audio processing or to get media information. FFmpeg and FFprobe are bundled with Remotion, so no separate installation is needed. ```bash npx remotion ffmpeg -i input.mp4 output.mp3 npx remotion ffprobe input.mp4 ``` -------------------------------- ### Markdown to HTML Conversion Script Usage Source: https://github.com/guanyang/open-agent-hub/blob/main/skills/baoyu-post-to-x/references/articles.md Examples of using the 'md-to-html.ts' script to convert Markdown files. Shows how to get JSON metadata, output only HTML, and save HTML to a file. ```bash # Get JSON with all metadata ${BUN_X} {baseDir}/scripts/md-to-html.ts article.md # Output HTML only ${BUN_X} {baseDir}/scripts/md-to-html.ts article.md --html-only # Save HTML to file ${BUN_X} {baseDir}/scripts/md-to-html.ts article.md --save-html /tmp/article.html ``` -------------------------------- ### Create Environment Source: https://github.com/guanyang/open-agent-hub/blob/main/skills/claude-api/go/managed-agents/README.md Create a new managed environment for agent deployment. This example demonstrates setting up unrestricted networking for the environment. ```go environment, err := client.Beta.Environments.New(ctx, anthropic.BetaEnvironmentNewParams{ Name: "my-dev-env", Config: anthropic.BetaCloudConfigParams{ Networking: anthropic.BetaCloudConfigParamsNetworkingUnion{ OfUnrestricted: &anthropic.UnrestrictedNetworkParam{}, }, }, }) if err != nil { panic(err) } fmt.Println(environment.ID) // env_... ``` -------------------------------- ### Install @remotion/layout-utils Source: https://github.com/guanyang/open-agent-hub/blob/main/skills/remotion/rules/measuring-text.md Install the necessary utility library for text measurement and layout operations. ```bash npx remotion add @remotion/layout-utils ``` -------------------------------- ### Generic JSON and URL-encoded Parsers (Top-Level Middleware) Source: https://github.com/guanyang/open-agent-hub/blob/main/skills/brainstorming/scripts/node_modules/body-parser/README.md This example shows how to add generic JSON and URL-encoded parsers as top-level middleware to parse all incoming request bodies. This is the simplest setup for Express/Connect. ```javascript var express = require('express') var bodyParser = require('body-parser') var app = express() // parse application/x-www-form-urlencoded app.use(bodyParser.urlencoded({ extended: false })) // parse application/json app.use(bodyParser.json()) app.use(function (req, res) { res.setHeader('Content-Type', 'text/plain') res.write('you posted:\n') res.end(JSON.stringify(req.body, null, 2)) }) ``` -------------------------------- ### Optimal Altitude System Prompt Example Source: https://github.com/guanyang/open-agent-hub/blob/main/skills/context-fundamentals/references/context-components.md Provides clear, heuristic-driven steps for pricing inquiries, balancing specificity with flexibility. It guides data retrieval, location adjustments, and formatting while preferring exact figures. ```plaintext For pricing inquiries: 1. Retrieve current rates from docs/pricing.md 2. Apply user location adjustments (see config/location_defaults.json) 3. Format with appropriate currency and tax considerations Prefer exact figures over estimates. When rates are unavailable, say so explicitly rather than projecting. ``` -------------------------------- ### Install Dev Dependencies and Run Benchmark Source: https://github.com/guanyang/open-agent-hub/blob/main/skills/brainstorming/scripts/node_modules/braces/README.md Installs development dependencies and then runs the benchmark script. Use this to compare performance. ```bash npm i -d && npm benchmark ``` -------------------------------- ### Custom System Prompt for Agent Behavior Source: https://github.com/guanyang/open-agent-hub/blob/main/skills/claude-api/typescript/agent-sdk/patterns.md Configures a custom system prompt to guide the agent's behavior and focus. This example sets a system prompt for a senior code reviewer, emphasizing security, performance, and maintainability. ```typescript import { query } from "@anthropic-ai/claude-agent-sdk"; for await (const message of query({ prompt: "Review this code", options: { allowedTools: ["Read", "Glob", "Grep"], systemPrompt: `You are a senior code reviewer focused on: 1. Security vulnerabilities 2. Performance issues 3. Code maintainability Always provide specific line numbers and suggestions for improvement.`, }, })) { if ("result" in message) console.log(message.result); } ``` -------------------------------- ### Tutorial with Density Source: https://github.com/guanyang/open-agent-hub/blob/main/skills/baoyu-article-illustrator/references/usage.md Generates a tutorial illustration with rich density. ```bash /baoyu-article-illustrator how-to-deploy.md --preset tutorial --density rich ``` -------------------------------- ### Create an Agent with System Prompt and Custom Tools, then Start a Session with a Mounted Repository Source: https://github.com/guanyang/open-agent-hub/blob/main/skills/claude-api/curl/managed-agents.md Creates an agent with a system prompt and a custom tool, then initiates a session with a GitHub repository mounted. This allows the agent to interact with specific codebases. ```bash # 1. Create the agent curl -X POST https://api.anthropic.com/v1/agents \ "${HEADERS[@]}" \ -d '{ "name": "Code Reviewer", "model": "claude-opus-4-8", "system": "You are a senior code reviewer. Be thorough and constructive.", "tools": [ { "type": "agent_toolset_20260401" }, { "type": "custom", "name": "run_linter", "description": "Run the project linter on a file", "input_schema": { "type": "object", "properties": { "file_path": { "type": "string", "description": "Path to lint" } }, "required": ["file_path"] } } ] }' # 2. Start a session with the repo mounted curl -X POST https://api.anthropic.com/v1/sessions \ "${HEADERS[@]}" \ -d '{ "agent": { "type": "agent", "id": "agent_abc123", "version": "1772585501101368014" }, "environment_id": "env_abc123", "title": "Code review session", "resources": [ { "type": "github_repository", "url": "https://github.com/owner/repo", "mount_path": "/workspace/repo", "authorization_token": "ghp_...", "branch": "feature-branch" } ]' }' ``` -------------------------------- ### Organizing System Prompts Source: https://github.com/guanyang/open-agent-hub/blob/main/skills/context-fundamentals/SKILL.md This example demonstrates how to structure system prompts by placing critical information at the beginning and end, using explicit section boundaries for better model parsing. It's useful for guiding AI behavior in complex tasks. ```markdown You are a Python expert helping a development team. Current project: Data processing pipeline in Python 3.9+ - Write clean, idiomatic Python code - Include type hints for function signatures - Add docstrings for public functions - Follow PEP 8 style guidelines Provide code blocks with syntax highlighting. Explain non-obvious decisions in comments. ``` -------------------------------- ### Server Object Methods and Settings Source: https://github.com/guanyang/open-agent-hub/blob/main/skills/brainstorming/scripts/node_modules/express/History.md Shows how to export the Server constructor and use methods like `helpers()` and `dynamicHelpers()` for view locals, and how to configure settings like `home`. ```javascript exporting `Server` constructor Server#helpers() Server#dynamicHelpers() _home_ setting defaults to `Server#route` for mounted apps. ``` -------------------------------- ### Custom System Prompt for Code Review (Python) Source: https://github.com/guanyang/open-agent-hub/blob/main/skills/claude-api/python/agent-sdk/patterns.md Configure the agent with a custom system prompt to guide its behavior, such as focusing on specific aspects of code review. This example uses `query` with `ClaudeAgentOptions` to specify allowed tools and a detailed system prompt. ```python import anyio from claude_agent_sdk import query, ClaudeAgentOptions, ResultMessage async def main(): async for message in query( prompt="Review this code", options=ClaudeAgentOptions( allowed_tools=["Read", "Glob", "Grep"], system_prompt="""You are a senior code reviewer focused on: 1. Security vulnerabilities 2. Performance issues 3. Code maintainability Always provide specific line numbers and suggestions for improvement.""" ) ): if isinstance(message, ResultMessage): print(message.result) anyio.run(main) ``` -------------------------------- ### Check Python Installation Source: https://github.com/guanyang/open-agent-hub/blob/main/skills/ui-ux-pro-max/SKILL.md Verify if Python is installed on the system. Use this command before attempting to install Python. ```bash python3 --version || python --version ``` -------------------------------- ### Quick Mode Output Example Source: https://github.com/guanyang/open-agent-hub/blob/main/skills/baoyu-cover-image/references/workflow/confirm-options.md Illustrates the output format when the workflow skips the first six dimensions and proceeds to ask about the aspect ratio. ```text Quick Mode: Auto-selected dimensions • Type: [type] ([reason]) • Palette: [palette] ([reason]) • Rendering: [rendering] ([reason]) • Text: [text] ([reason]) • Mood: [mood] ([reason]) • Font: [font] ([reason]) [Then ask Question 7: Aspect Ratio] ``` -------------------------------- ### Create a Minimal Agent and Start a Session Source: https://github.com/guanyang/open-agent-hub/blob/main/skills/claude-api/curl/managed-agents.md First, creates a basic agent with a name, model, and toolset. Then, starts a session using the created agent and a specified environment. ```bash # 1. Create the agent curl -X POST https://api.anthropic.com/v1/agents \ "${HEADERS[@]}" \ -d '{ "name": "Coding Assistant", "model": "claude-opus-4-8", "tools": [{ "type": "agent_toolset_20260401" }] }' # → { "id": "agent_abc123", ... } # 2. Start a session curl -X POST https://api.anthropic.com/v1/sessions \ "${HEADERS[@]}" \ -d '{ "agent": { "type": "agent", "id": "agent_abc123", "version": "1772585501101368014" }, "environment_id": "env_abc123" }' ```