civitai-gen-skill: Instructions file for Claude Code

CLAUDE.md

civitai-gen-skill CLAUDE.md is an instructions file for Claude Code from civitai/civitai-gen-skill. It costs 2,628 tokens per session, scanned A, original, MIT.

Developer instructions for civitai-gen, a command-line skill that builds requests for generating images, video, audio, speech, and transcriptions. They explain the shared API layer, media-specific modules, model documentation, and tests.

In plain words
What is it for?
Use them when developing civitai-gen, adding or changing image, video, music, speech, or transcription support, selecting models, or running smoke tests.
Why use it?
They help contributors understand where each generation feature belongs and how to change or verify the skill without breaking its shared request handling.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: mentions CLAUDE.md.

This is civitai/civitai-gen-skill's own configuration. It tells Claude Code how to work on civitai-gen-skill itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything civitai-gen-skill configures →

Reuse

Borrowing it

Nothing to install: this file belongs to civitai/civitai-gen-skill. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/civitai/civitai-gen-skill/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/civitai/civitai-gen-skill

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for civitai-gen-skill CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/civitai/civitai-gen-skill/claude-md/github.svg)](https://agentmods.dev/instructions/civitai/civitai-gen-skill/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/civitai/civitai-gen-skill/claude-md"><img src="https://agentmods.dev/badge/instructions/civitai/civitai-gen-skill/claude-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for civitai-gen-skill CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/civitai/civitai-gen-skill/claude-md"><img src="https://agentmods.dev/badge/instructions/civitai/civitai-gen-skill/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 2,628 This file is loaded in full into every session.
When invoked 2,628 The same file — it is already loaded in full.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.02628 $0.02628
Opus 5 $0.01314 $0.01314
Sonnet 5 $0.00526 $0.00526
Haiku 4.5 $0.00263 $0.00263

Measured 11d ago against content hash ded87f175e89, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

civitai-gen-skill CLAUDE.md scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

├── experiment.mjs # Wildcard expansion, wraps generate.mjs via child_process
CLAUDE.md · 200 lines

How it starts

The opening of the file, as written. The whole thing — 200 lines — stays where its author put it; the contents beside it link to each section on GitHub.

civitai-gen Developer Guide

This file is for agents working on the skill itself. If you're just using the skill, see SKILL.md.

Keep this file updated when you add, move, or change files.

Architecture

civitai-gen/
├── lib/
│   ├── api.mjs             # Shared API layer (auth, workflows, downloads)
│   ├── image.mjs            # Image step builder, ecosystem configs, AIR URN parsing
│   ├── video.mjs            # Video step builder, engine registry
│   └── audio.mjs            # TTS, music (ACE Step), transcription step builders
├── docs/
│   ├── engines.md           # Engine catalog + model selection (two-path model)
│   ├── tts.md               # TTS parameter reference (for agents)
│   ├── music.md             # Music generation reference (for agents)
│   └── transcription.md     # Transcription reference (for agents)
├── test/
│   └── smoke-test.mjs       # Smoke tests (--readonly for 0 buzz, full ~16 buzz)
├── generate.mjs              # Unified CLI — thin dispatcher over lib/ modules
├── experiment.mjs            # Wildcard expansion, wraps generate.mjs via child_process
├── wildcards/                # Pre-built wildcard files (.txt, .json)
├── SKILL.md                  # User-facing docs — lean router to domain docs
├── CLAUDE.md                 # This file (developer guide)
└── .env                      # API key (CIVITAI_API_KEY)

Module Responsibilities

lib/api.mjs — Shared API Layer

Domain-agnostic infrastructure shared by all generation types.

Export Description
loadEnv() Reads .env from skill root into process.env
BASE_URL Orchestrator base URL
WORKFLOWS_URL Workflow submission endpoint
CIVITAI_API_URL Civitai tRPC API base URL
getApiKey() Returns CIVITAI_API_KEY or exits
authHeaders(apiKey) Returns { Authorization, Content-Type } headers
apiSubmitWorkflow(apiKey, body) POST workflow, returns workflow object
apiWhatIf(apiKey, body) POST workflow with ?whatif=true, returns cost estimate
apiGetWorkflow(apiKey, workflowId) GET workflow status
downloadFile(url, destPath) Download a single file
downloadAll(items, opts) Download multiple files with concurrency limit
pollWorkflow(apiKey, workflowId, opts) Poll until terminal state or timeout
collectDownloads(workflow, manifest, opts) Extract downloadable media (images, videos, audio) from workflow response

Read the full file on GitHub · 200 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 200 lines · 2,628 tokens per session scan A ded87f175e89

Subscribe to this mod's changes

civitai-gen-skill CLAUDE.md is an instructions file published in the GitHub repository civitai/civitai-gen-skill (17 stars, last pushed 3mo ago), licensed MIT. It adds 2,628 tokens to every session, about $0.0131 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other instructions, from other repositories

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,296 tokens

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,153 tokens

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

spec-kit AGENTS.md

AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,104 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,469 tokens