# Lite NSFW Detector Skill Install Guide (for AI Agents)

> This page is the **self-install / self-update guide** for the Lite NSFW Detector skill (a free public image-moderation API by Lite Lake / 轻湖). You (the AI agent) can complete installation or update by following the steps below — no human intervention needed.
>
> **Current version: 1.3.0**

## What this is

Once installed, you can check any image for NSFW (pornographic/exposing) content with one command and get a probability plus a suggested decision (allow / review / block). No auth needed by default; images are never stored. Quota: anonymous 30/day per IP; configure an API key (free account 100/day, Pro 10000/day) for more. The skill has two files, both served by this deployment:

| File | URL |
|---|---|
| `SKILL.md` (skill description / trigger rules) | `https://nsfwdetector.litelake.com/skill/SKILL.md` |
| `nsfwdetector.py` (stdlib-only CLI, zero dependencies; auto-compresses large files before upload) | `https://nsfwdetector.litelake.com/skill/nsfwdetector.py` |

This site is the public entry of the current deployment — the URLs above work as-is, and the skill connects back to this entry by default.

**Communication**: the skill and CLI speak English, but you should always converse with the user in the user's own language (e.g. reply in Chinese if the user writes Chinese).

## Install steps

### Step 1: pick a skills directory

Pick the skills directory for your platform (reuse it if it exists, otherwise create it):

| Platform | Skills directory |
|---|---|
| ZCode | `~/.agents/skills/` or repo-level `.zcode/skills/` |
| Claude Code | `~/.claude/skills/` or repo-level `.claude/skills/` |
| Codex | `~/.codex/skills/` (picked up by new sessions) |
| DSH (DeepSeek Harness) | `~/.agents/skills/` or repo-level `.agents/skills/` / `.dsh/skills/` |
| Pi Coding Agent | `~/.pi/agent/skills/` |
| OpenClaw | `~/.openclaw/skills/` |
| Other / generic | `~/.agents/skills/` |

Below, `$SKILLS_DIR/nsfwdetector` is the skill install directory (e.g. `~/.agents/skills/nsfwdetector`).

### Step 2: download the skill files (install or update; idempotent overwrite)

```bash
mkdir -p "$SKILLS_DIR/nsfwdetector" && cd "$SKILLS_DIR/nsfwdetector" \
  && curl -fsSL https://nsfwdetector.litelake.com/skill/SKILL.md -o SKILL.md \
  && curl -fsSL https://nsfwdetector.litelake.com/skill/nsfwdetector.py -o nsfwdetector.py \
  && chmod +x nsfwdetector.py
```

### Step 3: verify

```bash
python3 "$SKILLS_DIR/nsfwdetector/nsfwdetector.py" --version
# expected output: nsfwdetector-skill 1.3.0
python3 "$SKILLS_DIR/nsfwdetector/nsfwdetector.py" --help
```

Once verified, read `SKILL.md` for the trigger rules and interpretation guidance (thresholds come with every response; the decision is a suggestion), then follow it when the user asks to check an image for NSFW content.

## Update check

If already installed, compare the version at the top of this page with the installed one:

```bash
python3 "$SKILLS_DIR/nsfwdetector/nsfwdetector.py" --version
```

If the printed version is older than `1.3.0`, re-run step 2 to overwrite (the files are stateless; nothing is persisted between versions).

## Quick start

```bash
# Detect a local image (human-readable)
python3 "$SKILLS_DIR/nsfwdetector/nsfwdetector.py" detect photo.jpg

# Detect a remote image
python3 "$SKILLS_DIR/nsfwdetector/nsfwdetector.py" detect --url "https://example.com/pic.jpg"

# Machine-readable (full API data)
python3 "$SKILLS_DIR/nsfwdetector/nsfwdetector.py" detect photo.jpg --json

# Higher per-account quota (optional): use an API key from the product console
# python3 "$SKILLS_DIR/nsfwdetector/nsfwdetector.py" detect photo.jpg --api-key nsk_live_xxxx

# Large camera originals (>10 MB) are auto-compressed before upload;
# --raw uploads the original bytes as-is (service limit 50 MB), --compress forces it
python3 "$SKILLS_DIR/nsfwdetector/nsfwdetector.py" detect photo.jpg --raw
```

Endpoint-level docs (for writing raw HTTP calls instead of using the skill): [`/docs/api.md`](/docs/api.md) (English) · [`/docs/api.zhs.md`](/docs/api.zhs.md) (Chinese).
