terraphim/terraphim-ai/pre-llm-validate

Claude Code and agent skill by terraphim/terraphim-ai

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Install

npx vskill@latest install terraphim/terraphim-ai/pre-llm-validate

SKILL.md

Pre-LLM Validation

Use this skill to validate input before sending to LLMs. Ensures semantic coherence and domain relevance using the local knowledge graph.

When to Use

  • Before making LLM API calls with user-provided context
  • When validating that input contains relevant domain terms
  • To check semantic coherence of multi-concept queries
  • Pre-flight validation to reduce wasted LLM tokens

Validation Steps

1. Check Semantic Connectivity
bash
# Validate that input terms are semantically connected
terraphim-agent validate --connectivity --json "your input text"

Output interpretation:

  • connected: true - Input is semantically coherent, proceed with LLM call
  • connected: false - Input spans unrelated concepts, consider warning user
2. Check Domain Coverage
bash
# Find matched domain terms
terraphim-agent validate --json "your input text"

Output interpretation:

  • High match count - Input is domain-relevant
  • Low/zero matches - Input may be off-topic or use non-standard terminology
3. Suggest Corrections (Optional)

If terms aren't found, suggest alternatives:

bash
# Get fuzzy suggestions for potential typos
terraphim-agent suggest --fuzzy "unclear term" --threshold 0.6

Workflow Example

bash
# 1. Validate connectivity
RESULT=$(terraphim-agent validate --connectivity --json "$INPUT")
CONNECTED=$(echo "$RESULT" | jq -r '.connected')
if [ "$CONNECTED" = "false" ]; then
echo "Warning: Input spans unrelated concepts"
TERMS=$(echo "$RESULT" | jq -r '.matched_terms | join(", ")')
echo "Matched terms: $TERMS"
fi
# 2. Check domain coverage
MATCHES=$(terraphim-agent validate --json "$INPUT" | jq '.matched_count')
if [ "$MATCHES" -lt 2 ]; then
echo "Warning: Low domain coverage ($MATCHES terms)"
fi
# 3. Proceed with LLM call if validation passes

Integration with Hooks

This skill can be automated via the pre-tool-use hook:

bash
terraphim-agent hook --hook-type pre-tool-use --input "$JSON"

Configuration

  • --role - Specify role for domain-specific validation
  • --json - Machine-readable output for scripting
  • --threshold - Similarity threshold for fuzzy matching (default: 0.6)

Best Practices

  1. Advisory Mode: Use validation results as warnings, not blockers
  2. Role Selection: Match role to the domain of the query
  3. Threshold Tuning: Adjust fuzzy threshold based on domain vocabulary
  4. Caching: Cache validation results for repeated queries

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
54
Repository forks
4
7-day trend score
20

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
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/terraphim/terraphim-ai/pre-llm-validate/badge)](https://verified-skill.com/skills/terraphim/terraphim-ai/pre-llm-validate)

Something wrong with this skill or its page? Tell us.