Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/avanturer/claude-bestpractice/llm-first-codenpx skills add avanturer/claude-bestpractice --skill llm-first-codegit clone --depth 1 https://github.com/avanturer/claude-bestpracticeWrote 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.
[](https://agentmods.dev/skills/avanturer/claude-bestpractice/llm-first-code)<a href="https://agentmods.dev/skills/avanturer/claude-bestpractice/llm-first-code"><img src="https://agentmods.dev/badge/skills/avanturer/claude-bestpractice/llm-first-code.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00035 | $0.00868 |
| Opus 5 | $0.00017 | $0.00434 |
| Sonnet 5 | $0.00007 | $0.00174 |
| Haiku 4.5 | $0.00003 | $0.00087 |
Grade A, and why
llm-first-code scanned grade A with 0 findings 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 4d 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.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 75 lines — stays where its author put it; the contents beside it link to each section on GitHub.
LLM-first code
The person who owns this repository reads almost none of the code. You read all of it, repeatedly, in fresh contexts with no memory of having written it. Optimise for that reader.
The rule that replaces most comments
If you are about to write a comment describing what a value is, write a type instead. A type is checked; a comment is a claim nobody verifies. 94% of LLM compile errors are type errors, and type constraining halves them.
Workflow
- Types first. Full annotations. No
Any, no bare generics, no untyped*args/**kwargs, no unlabelled suppressions. A suppression carries its error code or it does not ship. - Write a docstring only if it carries something non-derivable. Preconditions, invariants, why-not-what, the failure mode, the thing that will surprise the next reader. If the signature already says it, say nothing.
- Never restate the signature.
Args:,Returns:,Parameters:,:param:,@paramare banned outright. They duplicate what types already state, they cost context on every read, and they rot independently of the code. - Comment the decision, not the mechanism.
# sorted by mtime because the caller pages from newestis worth its tokens.# sort the listis not. - When you change a signature, change its docstring in the same edit. A gate
hashes
(param names, param types, return type)and fails the commit when the signature moved and the docstring did not. - Delete before correcting. Remediation order for a wrong comment is: delete it, then consider rewriting. A deleted comment costs nothing; a stale one actively misleads.
Why staleness is the whole point
Stale context is measurably worse than none. Retrieval carrying only outdated material induced calls to dead APIs on 15 of 17 samples; retrieval carrying nothing produced 0 of 17. Without context a model fails visibly. With stale context it binds confidently to something that no longer exists.
What ships with it
1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
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.
- 4d ago First seen · 75 lines · 35 tokens per session scan A 39287d2d74bb
llm-first-code is a skill published in the GitHub repository avanturer/claude-bestpractice (1 stars, last pushed today), licensed MIT. It adds 35 tokens to every session and 868 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
nowait-reasoning-optimizer
Implements the NOWAIT technique for efficient reasoning in R1-style LLMs. Use when optimizing inference of reasoning models (QwQ, DeepSeek-R1, Phi4-Reasoning, Qwen3, Kimi-VL, QvQ), reducing chain-of-thought token usage by 27-51% while preserving accuracy. Triggers on "optimize reasoning", "reduce thinking tokens"…
prompt-lookup
Activates when the user asks about AI prompts, needs prompt templates, wants to search for prompts, or mentions prompts.chat. Use for discovering, retrieving, and improving prompts.
loom-prompt-engineering
Designs and optimizes prompts for large language models including system prompts, agent signals, and few-shot examples.
strategy
Run structured brainstorming sessions (divergent/convergent), improve prompts with 7-dimension framework, and apply decision frameworks (RICE, weighted scoring, first principles, pre-mortem).
prompt-engineering
Create, update, review, or discuss an LLM prompt — a system prompt, a skill, or an agent. Use when writing or improving a prompt, discussing a skill or agent, diagnosing prompt failures, or when the user says a prompt needs work.
ai-observability-promptfoo
Testing and evaluation framework for LLM prompts and applications -- promptfooconfig.yaml, assertions, model-graded evals, red teaming, CI/CD integration, custom providers, and comparative evaluation.