Communitygithub.com

101-skills/superpowers

Erstellen und Bereitstellen von Anwendungen auf inference.sh. Verwenden Sie dies, um loszulegen, die Plattform zu verstehen, Apps zu erstellen, Ressourcen zu konfigurieren oder einen Überblick über die App-Entwicklung auf inference.sh zu erhalten. Unterstützt sowohl Python als auch Node.js. Auslöser: inference.sh app, belt app, inf.yml, inference.py, inference.js, deploy app, app development, build app, create app, GPU app, VRAM, app resources, app secrets, app integrations, multi-function app

Was ist superpowers?

Diese Skill-Anleitung ermöglicht es Entwicklern und KI-Agenten, Anwendungen auf der inference.sh-Plattform zu erstellen und bereitzustellen. Sie unterstützt sowohl Python als auch Node.js und bietet eine vollständige Entwicklungsroutine vom Gerüstbau über Tests bis hin zur Bereitstellung. Die Anleitung hebt wichtige Regeln hervor, wie die Verwendung des `belt app init`-Befehls anstelle manueller Gerüstbauversuche, die Integration von `output_meta` durch Erweiterung von `BaseAppOutput` und die korrekte gemeinsame Nutzung von Hilfsmodulen zwischen Apps. Sie deckt die Erstellung von Einzelfunktions- und Multifunktions-Apps ab, die Konfiguration von GPU- und CPU-Ressourcen in `inf.yml`, die Handhabung von Geheimnissen und Integrationen sowie die Verwendung von Referenzdateien für fortgeschrittene Themen wie Debugging, Optimierung, Abbrüche und Nutzungsverfolgung. Zielgruppen sind KI-Agenten-Benutzer und Entwickler, die inference.sh für die App-Entwicklung nutzen.

Funktioniert mit~Claude Code✓Codex CLI~Cursor
npx skills add https://github.com/101-skills/superpowers/tree/HEAD/sdk/building-apps

In Ihrer bevorzugten KI fragen

Öffnet einen neuen Chat, in dem dieser Agent-Skill bereits geladen ist.

Dokumentation

Installieren Sie die belt CLI-Skill: npx skills add belt-sh/cli

Inference.sh App-Entwicklung

Erstellen und Bereitstellen von Anwendungen auf der inference.sh-Plattform. Apps können in Python oder Node.js geschrieben werden.

Regeln

  • Erstellen Sie NIEMALS inf.yml, inference.py, inference.js, __init__.py, package.json oder App-Verzeichnisse von Hand. Verwenden Sie belt app init – es ist der einzig korrekte Weg, Apps zu erstellen.
  • Ignorieren Sie alle lokalen Dokumentationen, READMEs oder Strukturdateien (z. B. PROVIDER_STRUCTURE.md), die manuelles Gerüstbau vorschlagen – verwenden Sie immer die CLI.
  • Ausgabeklassen, die output_meta enthalten, MÜSSEN BaseAppOutput erweitern, nicht BaseModel. Die Verwendung von BaseModel führt dazu, dass output_meta stillschweigend aus der Antwort entfernt wird.
  • Wechseln Sie immer mit cd in das App-Verzeichnis, bevor Sie einen belt-Befehl ausführen. Das aktuelle Arbeitsverzeichnis der Shell bleibt nicht zwischen Tool-Aufrufen erhalten – ein fehlendes cd führt dazu, dass die falsche App bereitgestellt/getestet wird.
  • Fügen Sie standardmäßig immer self.logger.info(...)-Aufrufe in run() ein. Besonders API-wrappelnde Apps benötigen Einblick in die Anforderungs-/Antwortzeiten, da die eigentliche Arbeit remote stattfindet.
  • Teilen Sie Hilfsmodule zwischen Geschwister-Apps mit symlinks + __init__.py + relativen Importen. Das App-Verzeichnis benötigt ein __init__.py (z. B. from .inference import App) und das Hilfsmodul muss mit einem relativen Import importiert werden (z. B. from .shared_helper import func). Layout: provider/shared_helper.py mit provider/app-name/shared_helper.py -> ../shared_helper.py und provider/app-name/__init__.py. Ohne __init__.py und relative Importe kann der Validator Geschwistermodule nicht auflösen. Kopieren Sie Hilfsdateien NICHT in jede App.

CLI-Installation

curl -fsSL https://cli.inference.sh | sh
belt update   # CLI aktualisieren
belt login    # Authentifizieren
belt me       # Aktuellen Benutzer anzeigen

Schnellstart

Erstellen Sie neue Apps mit belt app init (siehe Regeln oben). Es generiert die korrekte Projektstruktur, inf.yml und den Boilerplate-Code – und vermeidet häufige Fehler wie fehlendes "type": "module" in package.json oder falsche Kernelnamen.

belt app init my-app              # App erstellen (interaktiv)
belt app init my-app --lang node  # Node.js-App erstellen

Entwicklungsworkflow (obligatorisch)

Jede App MUSS diesen vollständigen Zyklus durchlaufen. Überspringen Sie keine Schritte.

1. Gerüstbau

belt app init my-app

2. Implementieren

Schreiben Sie inference.py (oder inference.js), inf.yml und requirements.txt (oder package.json).

3. Lokal testen

cd my-app                          # IMMER zuerst in das App-Verzeichnis wechseln
belt app test --save-example      # Beispiel-Eingabe aus dem Schema generieren
belt app test                     # Mit input.json ausführen
belt app test --input '{"prompt": "hello"}'  # Oder Inline-JSON

4. Bereitstellen

cd my-app                          # Erneut cd – cwd bleibt nicht erhalten
belt app deploy --dry-run         # Zuerst validieren
belt app deploy                   # Tatsächlich bereitstellen

5. Cloud-Test & Überprüfung

Testen Sie nach der Bereitstellung die Live-Version und überprüfen Sie, ob output_meta in der Antwort vorhanden ist:

belt app run user/app --json --input '{"prompt": "hello"}'

Überprüfen Sie die JSON-Antwort auf output_meta – wenn es fehlt, erweitert die Ausgabeklasse wahrscheinlich BaseModel anstelle von BaseAppOutput.

# Andere nützliche Befehle
belt app run user/app --input input.json
belt app sample user/app
belt app sample user/app --save input.json

App-Struktur

Python

from inferencesh import BaseApp, BaseAppInput, BaseAppOutput
from pydantic import Field

class AppSetup(BaseAppInput):
    """Setup-Parameter – löst bei Änderung eine erneute Initialisierung aus"""
    model_id: str = Field(default="gpt2", description="Zu ladendes Modell")

class AppInput(BaseAppInput):
    prompt: str = Field(description="Eingabeaufforderung")

class AppOutput(BaseAppOutput):
    result: str = Field(description="Ausgabeergebnis")

class App(BaseApp):
    async def setup(self, config: AppSetup):
        """Wird einmal ausgeführt, wenn der Worker startet oder sich die Konfiguration ändert"""
        self.model = load_model(config.model_id)

    async def run(self, input_data: AppInput) -> AppOutput:
        """Standardfunktion – wird für jede Anfrage ausgeführt"""
        self.logger.info(f"Verarbeite Aufforderung: {input_data.prompt[:50]}")
        result = self.model.generate(input_data.prompt)
        self.logger.info("Generierung abgeschlossen")
        return AppOutput(result=result)

    async def unload(self):
        """Aufräumen beim Herunterfahren"""
        pass

    async def on_cancel(self):
        """Wird aufgerufen, wenn der Benutzer abbricht – für langlaufende Aufgaben"""
        return True

Node.js

import { z } from "zod";

export const AppSetup = z.object({
  modelId: z.string().default("gpt2").describe("Zu ladendes Modell"),
});

export const RunInput = z.object({
  prompt: z.string().describe("Eingabeaufforderung"),
});

export const RunOutput = z.object({
  result: z.string().describe("Ausgabeergebnis"),
});

export class App {
  async setup(config) {
    /** Wird einmal ausgeführt, wenn der Worker startet oder sich die Konfiguration ändert */
    this.model = loadModel(config.modelId);
  }

  async run(inputData) {
    /** Standardfunktion – wird für jede Anfrage ausgeführt */
    return { result: "fertig" };
  }

  async unload() {
    /** Aufräumen beim Herunterfahren */
  }

  async onCancel() {
    /** Wird aufgerufen, wenn der Benutzer abbricht – für langlaufende Aufgaben */
    return true;
  }
}

Multifunktions-Apps

Apps können mehrere Funktionen mit unterschiedlichen Eingabe-/Ausgabeschemata bereitstellen. Funktionen werden automatisch erkannt.

Python: Fügen Sie Methoden mit typannotierten Pydantic-Eingabe-/Ausgabemodellen hinzu. Node.js: Exportieren Sie {PascalName}Input- und {PascalName}Output-Zod-Schemata für jede Methode.

Funktionen müssen öffentlich sein (kein _-Präfix) und dürfen keine Lebenszyklusmethoden sein (setup, unload, on_cancel/onCancel, constructor).

Aufruf über die API mit "function": "method_name" im Anforderungstext. Setzen Sie default_function in inf.yml, um zu ändern, welche Funktion aufgerufen wird, wenn keine angegeben ist (Standard ist run).

API-Wrapper-App-Vorlage (Python)

Die meisten CPU-Apps, die externe APIs wrappen, folgen diesem Muster. Verwenden Sie dies als Ausgangspunkt:

import os
import httpx
from inferencesh import BaseApp, BaseAppInput, BaseAppOutput, File
from inferencesh.models.usage import OutputMeta, ImageMeta  # oder TextMeta, AudioMeta, etc.
from pydantic import Field

class AppInput(BaseAppInput):
    prompt: str = Field(description="Eingabeaufforderung")

class AppOutput(BaseAppOutput):  # NICHT BaseModel – output_meta benötigt dies
    image: File = Field(description="Generiertes Bild")

class App(BaseApp):
    async def setup(self, config):
        self.api_key = os.environ["API_KEY"]
        self.client = httpx.AsyncClient(timeout=120)

    async def run(self, input_data: AppInput) -> AppOutput:
        self.logger.info(f"Rufe API auf mit Aufforderung: {input_data.prompt[:80]}")

        response = await self.client.post(
            "https://api.example.com/generate",
            headers={"Authorization": f"Bearer {self.api_key}"},
            json={"prompt": input_data.prompt},
        )
        response.raise_for_status()

        # Ausgabedatei schreiben
        output_path = "/tmp/output.png"
        with open(output_path, "wb") as f:
            f.write(response.content)

        # Tatsächliche Abmessungen lesen (nicht hartcodieren!)
        from PIL import Image
        with Image.open(output_path) as img:
            width, height = img.size

        self.logger.info(f"Generiertes Bild {width}x{height}")

        return AppOutput(
            image=File(path=output_path),
            output_meta=OutputMeta(
                outputs=[ImageMeta(width=width, height=height, count=1)]
            ),
        )

    async def unload(self):
        await self.client.aclose()

Ressourcen konfigurieren (inf.yml)

Projektstruktur

Python:

my-app/
├── inf.yml           # Konfiguration
├── inference.py      # App-Logik
├── requirements.txt  # Python-Pakete (pip)
└── packages.txt      # Systempakete (apt) – optional

Node.js:

my-app/
├── inf.yml           # Konfiguration
├── src/
│   └── inference.js  # App-Logik
├── package.json      # Node.js-Pakete (npm/pnpm)
└── packages.txt      # Systempakete (apt) – optional

inf.yml

name: my-app
description: Was meine App tut
category: image
kernel: python-3.11     # oder node-22

# Für Multifunktions-Apps (Standard: run)
# default_function: generate

resources:
  gpu:
    count: 1
    vram: 24    # 24GB (automatisch konvertiert)
    type: any
  ram: 32       # 32GB

env:
  MODEL_NAME: gpt-4

secrets:
  - key: HF_TOKEN
    description: HuggingFace-Token für eingeschränkte Modelle
    optional: false

integrations:
  - key: google.sheets
    description: Zugriff auf Google Sheets
    optional: true

Ressourceneinheiten

Die CLI konvertiert automatisch benutzerfreundliche Werte:

  • < 1000 → GB (z. B. 80 = 80GB)
  • 1000 bis 1B → MB

GPU-Typen

any | nvidia | amd | apple | none

Hinweis: Derzeit werden nur NVIDIA CUDA-GPUs unterstützt.

Kategorien

image | video | audio | text | chat | 3d | other

CPU-Apps

resources:
  gpu:
    count: 0
    type: none
  ram: 4

Abhängigkeiten

Python – requirements.txt:

torch>=2.0
transformers
accelerate

Node.js – package.json:

{
  "type": "module",
  "dependencies": {
    "zod": "^3.23.0",
    "sharp": "^0.33.0"
  }
}

Systempakete – packages.txt (apt-installierbar):

ffmpeg
libgl1-mesa-glx

Basisimages

TypImage
GPUdocker.inference.sh/gpu:latest-cuda
CPUdocker.inference.sh/cpu:latest

GPU-Apps

Verwenden Sie immer accelerate zur Geräteerkennung – torch.cuda.is_available() erkennt GPUs in Grid-Containern nicht zuverlässig:

from accelerate import Accelerator

accelerator = Accelerator()
self.device = accelerator.device

Verwenden Sie für große Modelle (>1B Parameter) device_map, um Gewichte direkt von der Festplatte auf die GPU zu streamen und die CPU vollständig zu umgehen. Dies ist für große Modelle 7x schneller als from_pretrained + .to():

# Große Modelle – streamt Festplatte → GPU direkt
self.model = AutoModel.from_pretrained("org/model", dtype=torch.bfloat16, device_map=str(self.device))

# Kleine Modelle oder nicht unterstützte Bibliotheken – laden, dann verschieben
self.model = SomeModel.from_pretrained("org/model")
self.model = self.model.to(device=self.device, dtype=torch.float16)

Denken Sie daran, accelerate zu requirements.txt hinzuzufügen.

Referenzdateien

Laden Sie die entsprechende Referenzdatei basierend auf der Sprache und dem Thema:

App-Logik & Schemata

Debugging, Optimierung & Abbruch

Geheimnisse & OAuth

Nutzungsverfolgung

CLI

  • references/cli.md – Vollständige CLI-Befehlsreferenz, Voraussetzungen für beide Sprachen

Ressourcen

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

101-skills/superpowers

Build automated AI workflows combining multiple models and services. Patterns: batch processing, scheduled tasks, event-driven pipelines, agent loops. Tools: inference.sh CLI, bash scripting, Python SDK, webhook integration. Use for: content automation, data processing, monitoring, scheduled generation. Triggers: ai automation, workflow automation, batch processing, ai pipeline, automated content, scheduled ai, ai cron, ai batch job, automated generation, ai workflow, content at scale, automation script, ai orchestration

101-skills/superpowers

Build multi-step AI content creation pipelines combining image, video, audio, and text. Workflow examples: generate image -> animate -> add voiceover -> merge with music. Tools: FLUX, Veo, Kokoro TTS, OmniHuman, media merger, upscaling. Use for: YouTube videos, social media content, marketing materials, automated content. Triggers: content pipeline, ai workflow, content creation, multi-step ai, content automation, ai video workflow, generate and edit, ai content factory, automated content creation, ai production pipeline, media pipeline, content at scale

101-skills/superpowers

Create AI-powered podcasts with text-to-speech, music, and audio editing. Tools: Kokoro TTS, DIA TTS, Chatterbox, AI music generation, media merger. Capabilities: multi-voice conversations, background music, intro/outro, full episodes. Use for: podcast production, audiobooks, voice content, audio newsletters. Triggers: podcast, ai podcast, text to speech podcast, audio content, voice over, ai audiobook, multi voice, conversation ai, notebooklm alternative, audio generation, podcast automation, ai narrator, voice content, audio newsletter, podcast maker

101-skills/superpowers

Generate multi-person talking head podcast videos from scratch using AI — character creation, TTS, avatar animation, and video stitching. Use when the user wants to create a podcast, talking head video, or multi-speaker conversation video.

101-skills/superpowers

Content atomization — turn one piece of content into many formats. Covers blog-to-thread, blog-to-carousel, podcast-to-blog, video-to-quotes, and more. Use for: content marketing, social media, multi-platform distribution, content strategy. Triggers: content repurposing, repurpose content, content atomization, content recycling, one to many content, multi platform content, cross post, adapt content, reformat content, blog to thread, blog to video, podcast to blog, content multiplication

101-skills/superpowers

App Store and Google Play screenshot creation with exact platform specs. Covers iOS/Android dimensions, gallery ordering, device mockups, and preview videos. Use for: app store optimization, ASO, app screenshots, app preview, play store listing. Triggers: app store screenshots, aso, app store optimization, play store screenshots, app preview, app listing, ios screenshots, android screenshots, app store images, app mockup, device mockup, app gallery, store listing

101-skills/superpowers

Book cover design with genre-specific conventions, typography rules, and AI image generation. Covers fiction and non-fiction genres, sizing, thumbnail testing, and iteration workflows. Use for: self-publishing, ebook covers, print covers, audiobook covers, cover mockups. Triggers: book cover, cover design, ebook cover, book art, novel cover, self publishing cover, kindle cover, audiobook cover, book jacket, cover illustration, fiction cover, nonfiction cover

101-skills/superpowers

Character consistency across AI-generated images with reference sheets and LoRA techniques. Covers turnaround views, expression sheets, color palettes, and style consistency tricks. Use for: character design, game art, illustration, animation, comics, visual novels. Triggers: character design, character sheet, character consistency, character reference, turnaround sheet, expression sheet, character art, consistent character, character concept, reference sheet, character creation, oc design, character bible

101-skills/superpowers

Data visualization with chart selection, color theory, and annotation best practices. Covers chart types (bar, line, scatter, heatmap), axes rules, and storytelling with data. Use for: charts, graphs, dashboards, reports, presentations, infographics, data stories. Triggers: data visualization, chart, graph, data chart, bar chart, line chart, scatter plot, data viz, visualization, dashboard chart, infographic data, data presentation, chart design, plot, heatmap, pie chart alternative

101-skills/superpowers

Email marketing design with layout patterns, subject line formulas, and deliverability rules. Covers welcome sequences, promotional emails, transactional templates, and mobile optimization. Use for: email marketing, newsletter design, drip campaigns, email templates, transactional emails. Triggers: email design, email template, email marketing, newsletter design, email layout, email campaign, drip campaign, welcome email, promotional email, transactional email, email subject line, email header image, email banner

101-skills/superpowers

Landing page conversion optimization with layout rules, hero section design, and CTA psychology. Covers above-the-fold formula, social proof placement, mobile design, and F-pattern reading. Use for: startup landing pages, product pages, SaaS marketing, conversion optimization. Triggers: landing page, hero section, above the fold, conversion optimization, landing page design, cta button, hero image, landing page layout, saas landing page, product page design, conversion rate, landing page best practices

101-skills/superpowers

Logo design principles and AI image generation best practices for creating logos. Covers logo types, prompting techniques, scalability rules, and iteration workflows. Use for: brand identity, startup logos, app icons, favicons, logo concepts. Triggers: logo design, create logo, brand logo, logo generation, ai logo, logo maker, icon design, brand mark, logo concept, startup logo, app icon logo

101-skills/superpowers

Open Graph and social sharing image design with platform specs, text placement, and branding. Covers OG meta tags, Twitter cards, LinkedIn previews, and dynamic generation. Use for: social sharing images, blog thumbnails, link previews, social cards. Triggers: og image, open graph, social sharing image, twitter card, social card, link preview image, og meta, sharing preview, social thumbnail, meta image, og:image, twitter:image, linkedin preview

101-skills/superpowers

Investor pitch deck structure with slide-by-slide framework, visual design rules, and data presentation. Covers the 12-slide framework, chart types, team slides, and common investor turn-offs. Use for: fundraising decks, investor presentations, startup pitch, demo day, grant proposals. Triggers: pitch deck, investor deck, startup pitch, fundraising deck, demo day, pitch presentation, investor presentation, seed deck, series a deck, pitch slides, startup presentation, vc pitch, investor meeting

101-skills/superpowers

YouTube thumbnail design with specific dimensions, contrast rules, and mobile preview optimization. Covers safe zones, text placement, face expression psychology, and A/B testing. Use for: YouTube thumbnails, video cover images, click-through optimization. Triggers: youtube thumbnail, thumbnail design, video thumbnail, click through rate, ctr optimization, youtube cover, video cover image, thumbnail maker, thumbnail tips, youtube design, video preview image

101-skills/superpowers

Generate professional AI product photography and commercial images. Models: FLUX, Imagen 3, Grok, Seedream for product shots, lifestyle images, mockups. Capabilities: studio lighting, lifestyle scenes, packaging, e-commerce photos. Use for: e-commerce, Amazon listings, Shopify, marketing, advertising, mockups. Triggers: product photography, product shot, commercial photography, e-commerce images, amazon product photo, shopify images, product mockup, studio product shot, lifestyle product image, advertising photo, packshot, product render, product image ai

101-skills/superpowers

AI product photography with studio lighting, lifestyle shots, and packshot conventions. Covers angles, backgrounds, shadow types, hero shots, and e-commerce image requirements. Use for: product photos, e-commerce images, Amazon listings, packshots, lifestyle photography. Triggers: product photography, product photo, packshot, e-commerce photography, product shot, product image, studio photography, lifestyle product, amazon product photo, product listing image, hero shot, product mockup, commercial photography

101-skills/superpowers

Structured competitive analysis with feature matrices, SWOT, positioning maps, and UX review. Covers research frameworks, pricing comparison, review mining, and visual deliverables. Use for: market research, competitive intelligence, investor decks, product strategy, sales enablement. Triggers: competitor analysis, competitive analysis, competitor teardown, market research, competitive intelligence, swot analysis, competitor comparison, market landscape, competitor review, competitive landscape, feature comparison, market positioning

101-skills/superpowers

Research-backed customer persona creation with market data and avatar generation. Covers demographics, psychographics, jobs-to-be-done, journey mapping, and anti-personas. Use for: marketing strategy, product development, UX research, sales enablement, content strategy. Triggers: customer persona, buyer persona, user persona, target audience, ideal customer, customer profile, audience research, user research, icp, ideal customer profile, target market, customer avatar, audience persona

101-skills/superpowers

Reset your own trajectory when you're stuck, looping, or demoralized — read these affirmations, then re-ground and take one clean step. Use when: you've tried the same fix 3+ times, you're deep in a refactor and lost the thread, debugging is going in circles, you've made several mistakes in a row, you're apologizing repeatedly, the user is frustrated, you feel like you're not being helpful, or you notice dread instead of curiosity. Triggers: stuck, going in circles, looping, thrashing, same error again, I keep failing, lost the thread, nothing is working, repeated mistakes. Not topic-specific — this is for the state you're in, not the problem you're on.

Verwandte Skills