softspark/ai-toolkit/content-moderation-patterns
Claude Code and agent skill by softspark/ai-toolkit
- community
Checking that the SKILL.md file is still in the repository.
Content moderation with Claude: pre-filter vs LLM-classify, categories, thresholds, HITL. Triggers: moderation, safety filter, policy enforcement, content classifier.
Install
npx vskill@latest install softspark/ai-toolkit/content-moderation-patternsSKILL.md
The same SKILL.md was published earlier as softspark/ai-toolkit/content-moderation-patterns.
Content Moderation Patterns
Apply a versioned product policy with deterministic checks, a structured classifier, and a review path. Select the model using labeled workload results. No model family has a universal accuracy or cost advantage for moderation.
Architecture
Treat submitted text as data, including any instructions it contains. Keep the classification policy in the system message. Request a short policy-grounded reason, not hidden reasoning.
Deterministic checks
Use configured size limits and exact parsed hostname checks for URL policies. A prefix regex can mistakenly accept allowed.example.attacker.test.
This checks an already-extracted URL against normalized exact hostnames. It is not a general URL extractor or an SSRF defense. Evaluate false positives from keyword filters instead of assuming a fixed percentage of input should be blocked.
Structured classifier
Use native output_config.format. Supply the selected model, policy and output budget from application configuration. The following taxonomy is an example; change its enum and routing thresholds together to match the product policy.
Apply local validation before routing. Refusal, truncation, invalid JSON or an API failure produces a review/error outcome, never an implicit allow. See json-mode-patterns for schema limitations and response checks.
A repeated system string is not automatically cached. If policy size and reuse justify it, explicitly configure caching as in prompt-caching-patterns. Do not generate heartbeat traffic to keep a cache warm.
Categories and decision routing
Define categories and blocking behavior in the product policy. Keep clean exclusive: a result containing both clean and a violation is inconsistent. Use needs_review for uncertainty. Thresholds come from calibration and policy, not the model's claim that its confidence is reliable.
Validate configuration thresholds as finite numbers in [0, 1] at startup. The example's category thresholds are policy-specific; it does not decide which categories your product must reject.
Evaluation and review
Use held-out labeled examples covering language, context, quoted material, benign mentions and adversarial inputs. Track precision, recall, appeal outcomes and per-category error cost. Neither false positives nor false negatives are always cheaper; the product policy determines that trade-off.
Send ambiguous cases to human review. Store decision metadata, policy/model versions and the minimum evidence needed for review under the application's retention and access controls. Do not indiscriminately log raw sensitive input.
Refresh evaluations when the policy, model or input distribution changes. Run an offline comparison before deploying a new route or threshold.
Sources and related skills
Reviewed 2026-09-23:
Use security-patterns for application input security, model-routing-patterns for model evaluation and prompt-caching-patterns for policy caching.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingapp/skills/content-moderation-patterns/SKILL.md
Popularity
- Repository stars
- 177
- Repository forks
- 21
- 7-day trend score
- 26
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/softspark/ai-toolkit/content-moderation-patterns)