inference-sh skills

repository·main·Indexed 20 days ago

https://github.com/inference-sh/skills

A collection of AI agent capabilities, including tools, SDKs, and UI components, designed for integration into AI agents and Claude Code via the inference.sh CLI (belt). Available skills include AI image and video generation, LLM model access, web search, and Twitter automation. The library provides JavaScript and Python SDKs, as well as agent, chat, and tools UI components. It also includes specialized patterns like the affirmations skill for breaking agent loops and various automation workflows for batch, sequential, and parallel processing.

Tokens
177.1K
Snippets
594
Records
802
Agent score
69%

What's inside inference-sh/skills

  1. Implement Semantic Versioning (SemVer)

    main

    For versioned software, use the MAJOR.MINOR.PATCH format:

    ComponentIncrement WhenExample
    MAJORBreaking changes, major redesign2.0.0 -> 3.0.0
    MINORNew features, backward-compatible3.1.0 -> 3.2.0
    PATCHBug fixes, small improvements3.2.0 -> 3.2.1

    For SaaS products with continuous deployment, Date-Based Versioning (e.g., 2026-02-08) is often preferred.

  2. How to use anti-personas to define target boundaries

    main

    An anti-persona represents the segment of people who are NOT your customers. Defining an anti-persona helps prevent wasted product effort on customers you cannot serve (e.g., an enterprise customer when you are a self-serve SMB SaaS).

    Example Anti-Persona: ANTI-PERSONA: "Enterprise Earl"

    • Profile: CTO at a 5,000+ person enterprise.
    • Needs: SOC 2, HIPAA, on-premise deployment, 18-month procurement cycles.
    • Why NOT: Product is self-serve SaaS for SMB/mid-market; enterprise needs require too much investment.
  3. Design a high-engagement Twitter/X thread structure

    main

    A successful Twitter thread follows a specific anatomy to maximize engagement and readability. Use this template for structuring your content:

    1. Tweet 1 (Hook): A bold claim followed by a thread emoji (e.g., 🧵). This must work as a standalone tweet.
    2. Tweet 2: Provide context or explain why the topic matters.
    3. Tweets 3-9 (Content): One specific point per tweet. Use numbering (e.g., 1/, 2/) to signal progress.
    4. Tweet 10: A summary or the biggest takeaway.
    5. Tweet 11 (CTA): A Call to Action (e.g., follow, retweet, or bookmark).
  4. Supported input types for file processing

    main

    The SDK supports several ways to provide file data in the input dictionary of a run() call:

    1. File Path: A string representing the local path.
    2. Data URI (Base64): A string in the format data:<mime_type>;base64,<data>.
    3. Remote URLs: A direct URL (e.g., https://...) which is used without requiring an upload.
    4. Bytes/File Objects: When using upload_file(), you can pass raw bytes or a file-like object.
    # Data URI (Base64)
    import base64
    with open("image.png", "rb") as f:
        b64 = base64.b64encode(f.read()).decode()
    
    result = client.run({
        "app": "processor",
        "input": {"image": f"data:image/png;base64,{b64}"}
    })
    
    # Remote URL
    result = client.run({
        "app": "image-processor",
        "input": {"image": "https://example.com/image.png"}
    })
  5. Reuse authenticated sessions

    main

    Because agent-browser sessions maintain cookies, you can perform a login once and reuse the session_id for subsequent tasks. This avoids repeated authentication steps. To reuse a session, simply pass the existing session_id to the --session flag in your belt app run agent-browser commands. Note: Do not call the close function if you intend to keep the session alive for future use.

    #!/bin/bash
    # login-and-work.sh
    
    login() {
      SESSION=$(belt app run agent-browser --function open --session new --input '{
        "url": "https://app.example.com/login"
      }' | jq -r '.session_id')
      # ... login steps ...
      echo $SESSION
    }
    
    do_work() {
      local SESSION=$1
      # Navigate to protected page using the existing session
      belt app run agent-browser --function interact --session $SESSION --input '{
        "action": "goto", "url": "https://app.example.com/dashboard"
      }'
      # Extract data
      belt app run agent-browser --function snapshot --session $SESSION --input '{}'
    }
    
    SESSION=$(login)
    do_work $SESSION
  6. Chart Selection Guide: Which chart to use for your data

    main

    Choosing the right chart type is critical for clarity. Use the following mapping to select the best visualization for your data relationship:

    Data RelationshipBest ChartNever Use
    Change over timeLine chartPie chart
    Comparing categoriesBar chart (horizontal for many categories)Line chart
    Part of a wholeStacked bar, treemapPie chart
    DistributionHistogram, box plotBar chart
    CorrelationScatter plotBar chart
    RankingHorizontal bar chartVertical bar, pie
    GeographicChoropleth mapBar chart
    Composition over timeStacked area chartMultiple pie charts
    Single metricBig number (KPI card)Any chart (overkill)
    Flow / processSankey diagramBar chart

    The Pie Chart Problem

    Avoid pie charts because they make it hard to compare similar-sized slices, cannot handle more than 5-6 categories well, and make reading exact values difficult. Instead, use horizontal bar charts, stacked bars, or treemaps.

  7. Typography and the Thumbnail Test for book covers

    main

    The Thumbnail Test

    Covers are often viewed at very small sizes (e.g., 80x120px). At this size, readers must be able to identify:

    1. The genre (via color and composition).
    2. The title (if large enough).
    3. The mood (via imagery).

    Test: Shrink your design to 80px wide. If the title is unreadable or the genre is unclear, redesign.

    Typography Best Practices

    Note: AI cannot render text reliably. Generate the background art with AI, then add typography using a design tool.

    Title Hierarchy

    1. Title: Largest, most prominent, located in the top 1/3.
    2. Subtitle: Smaller, located below the title or at the bottom.
    3. Author name: Bottom of cover; size depends on author recognition.

    Font Pairing by Genre

    • Thriller: bold sans-serif title + condensed sans-serif author
    • Romance: script/cursive title + elegant serif author
    • Sci-Fi: geometric sans-serif for both
    • Fantasy: decorative/medieval serif title + clean serif author
    • Business: heavy bold sans-serif title + light sans-serif subtitle
  8. Design Rules for Color Theory

    main

    Effective color usage improves readability and focus:

    • Limit colors: Use a maximum of 5-7 colors per chart.
    • Highlighting: Use grey for most elements and a single color to highlight the focus.
    • Sequential Palettes: Use light-to-dark gradients for magnitude (low to high).
    • Diverging Palettes: Use color shifts (e.g., Red $\leftarrow$ Neutral $\rightarrow$ Blue) for positive/negative values.
    • Categorical Palettes: Use distinct hues with similar brightness for different groups.
    • Colorblind Safety: Avoid red/green combinations; use shapes or labels to supplement color.
    • Consistency: Maintain consistent color meanings (e.g., if blue represents revenue, keep it blue throughout the report).

    Color Palette Examples (Python)

    # Sequential (low to high)
    sequential = ["#eff6ff", "#bfdbfe", "#60a5fa", "#2563eb", "#1d4ed8"]
    
    # Diverging (negative to positive)
    diverging = ["#ef4444", "#f87171", "#d1d5db", "#34d399", "#10b981"]
    
    # Categorical (distinct groups)
    categorical = ["#3b82f6", "#f59e0b", "#10b981", "#8b5cf6", "#ef4444"]
    
    # Colorblind-safe
    cb_safe = ["#0077BB", "#33BBEE", "#009988", "#EE7733", "#CC3311"]
  9. Control prompt interpretation with prompt_influence

    main

    The prompt_influence parameter (0.0 to 1.0) determines how strictly the model follows your text description. Use lower values for creative/surprising results and higher values for precise/literal sound reproduction.

    ValueEffectBest For
    0.0Very loose interpretationCreative, surprising results
    0.3Balanced (default)General purpose
    0.7Close to descriptionSpecific sound needs
    1.0Very literalExact sound reproduction
    # Loose interpretation - creative result
    belt app run elevenlabs/sound-effects --input '{
      "text": "Magical fairy dust sparkle",
      "prompt_influence": 0.1
    }'
    
    # Literal interpretation - precise result
    belt app run elevenlabs/sound-effects --input '{
      "text": "Single gunshot, pistol, indoor range",
      "prompt_influence": 0.8
    }'
  10. Best practices for video prompting

    main

    Follow these rules to avoid video distortion and artifacts:

    1. The Golden Rule: Subtle > Dramatic. Requesting high-intensity movement often causes warping. Use "slowly walking" instead of "running and jumping".
    2. Prompt Structure: Use the pattern [Camera movement] + [Subject motion] + [Atmospheric effects] + [Mood/pace].
    3. Duration: Aim for 2-5 seconds for the highest quality. Avoid clips longer than 10 seconds as quality degrades significantly.
  11. Best Practices for AI Automation

    main

    When building automated workflows, follow these best practices:

    1. Rate limiting: Add delays between API calls to avoid being throttled.
    2. Error handling: Always check return codes of your commands.
    3. Logging: Track all operations for debugging and auditing.
    4. Idempotency: Design workflows so they can be safely re-run without side effects.
    5. Monitoring: Implement alerts for failures.
    6. Backups: Save intermediate results (e.g., to JSON files).
    7. Timeouts: Set reasonable limits on how long a task should run.