agentleFS
meyverickmeyverick/agentic/skills/select-model/SKILL.md

select-model

Skill0 starsChanged 13 days agoISCView on GitHub

Intelligently and deterministically select the optimal LLM model, provider, and reasoning/thinking level for an engineering task based on prompt text and optional code references. Use when dynamically sizing models for tasks, dispatching subagents, or configuring execution runners. Do NOT use for running model inferences, managing credentials, or benchmarking code.

  • Reads credentials

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Target Specific Context: Do not pass the entire workspace root.

    line 67
  2. Very specific:

    If TYPESAFE_API_KEY is present in the environment: invoke default jev strategy for high semantic accuracy.

    line 79
  3. Very specific:

    If running offline, in CI, or without API keys: explicitly pass --strategy heuristic.

    line 80
  4. Very specific:

    When using default jev without TYPESAFE_API_KEY, the tool fails fast with exit status 1.

    line 87

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

select-model — Dynamic Model & Reasoning Selector

A standalone, decoupled skill and CLI utility that inspects task prompts and contextual code references to select the most appropriate and cost-effective LLM model, provider, and thinking level.

Core Mental Model

select-model acts as a pure decision engine. It does not execute inferences or modify application code. Instead, it inspects task complexity against an authoritative model catalog and emits an unconditional structured JSON parameter envelope to standard output.

Task Prompt + Code References
             │
             ▼
   [ select-model CLI ]
   ├── Strategy: TypeSafe Jev SDK (default) | Heuristic Matrix
   └── Catalog: references/models.json
             │
             ▼
{ model, provider, thinking_level, confidence, reasoning }

CLI Invocation & Options

The tool is authored in TypeScript and executed via bun:

bun scripts/select-model.ts \
  --prompt "<prompt>" \
  [--references <path...>] \
  [--strategy <jev|heuristic>] \
  [--catalog <path>]

Options

  • -p, --prompt <string> (required): Task intent, description, or instructions to analyze.
  • -r, --references <path...> (optional): One or more file or directory paths to include in evaluation context.
  • -s, --strategy <strategy> (optional, default: jev):
    • jev: Semantic classification via TypeSafe Jev SDK (@typesafe-ai/sdk). Requires TYPESAFE_API_KEY.
    • heuristic: Deterministic offline classifier scoring keyword taxonomy, prompt length, and AST/LOC metrics.
  • -c, --catalog <path> (optional): Path to custom models.json catalog (defaults to bundled references/models.json).
  • -h, --help: Display usage and exit.

Downstream Piping Recipes

Standard output is exclusively formatted JSON, making it directly consumable by shell pipelines or downstream runner scripts:

# Capture selection
PARAMS=$(bun scripts/select-model.ts \
  --strategy heuristic \
  --prompt "Refactor user authentication service" \
  --references ./src/auth.ts ./src/storage.ts)

MODEL=$(echo "$PARAMS" | jq -r .model)
PROVIDER=$(echo "$PARAMS" | jq -r .provider)
THINKING=$(echo "$PARAMS" | jq -r .thinking_level)

echo "Selected $MODEL ($PROVIDER) with thinking level: $THINKING"

Reference Curation Guidelines

  1. Target Specific Context: Do not pass the entire workspace root. Pass specific files or cohesive component directories relevant to the task.
  2. Automatic Default-Deny Exclusions: The scanner automatically skips:
    • Build & dependency artifacts: .git, node_modules, dist, target, vendor, .turbo.
    • Lockfiles: bun.lock, bun.lockb, package-lock.json, pnpm-lock.yaml, Cargo.lock.
    • Binaries, archives, and fonts (.wasm, .png, .zip, etc.).
    • Secret files: .env*, *.pem, *.key, id_rsa*, credentials.*.
  3. Context Budgeting: Ingestion is capped at 50 files and 500KB total text (max 2,000 lines per file). Excess files trigger a non-fatal warning on stderr.

Sequential Workflow

  1. Intake: Gather task description and identify relevant source reference paths.
  2. Strategy Selection:
    • If TYPESAFE_API_KEY is present in the environment: invoke default jev strategy for high semantic accuracy.
    • If running offline, in CI, or without API keys: explicitly pass --strategy heuristic.
  3. Execution: Run bun scripts/select-model.ts ....
  4. Validation: Emitted thinking_level is guaranteed to be clamped and supported by the selected model's levels list in models.json.

Gotchas & Failure Recovery

  • Missing TYPESAFE_API_KEY (Exit Code 1):
    • When using default jev without TYPESAFE_API_KEY, the tool fails fast with exit status 1.
    • Fix: Set export TYPESAFE_API_KEY=... or invoke with --strategy heuristic.
  • Explicit Sensitive File Path:
    • Passing .env directly will not leak credentials; the scanner will log a security warning to stderr and completely omit the file content.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.