library-first

library-first is a skill for Claude Code, Codex from bearded-illirian/trailmark. It costs 77 tokens per session (1,736 once invoked), scanned A, original, MIT.

A planning process that checks existing libraries and components before a fast-track coding task. It documents what will be reused, what must be built, and the expected code size.

In plain words
What is it for?
Use it to compare reuse options, estimate implementation effort, record watchpoints, and approve the approach before planning the task.
Why use it?
It helps avoid writing unnecessary new code and makes the proposed implementation visible before work begins.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents); $skill-name invocation.

Good fit Use it to compare reuse options, estimate implementation effort, record watchpoints, and approve the approach before planning the task.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/bearded-illirian/trailmark/library-first
Install

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.

Any agent
npx skills add bearded-illirian/trailmark --skill library-first
Clone the repo
git clone --depth 1 https://github.com/bearded-illirian/trailmark

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for library-first

README.md
[![agentmods](https://agentmods.dev/badge/skills/bearded-illirian/trailmark/library-first.svg)](https://agentmods.dev/skills/bearded-illirian/trailmark/library-first)
Your own site
<a href="https://agentmods.dev/skills/bearded-illirian/trailmark/library-first"><img src="https://agentmods.dev/badge/skills/bearded-illirian/trailmark/library-first.svg" alt="Measured on agentmods" height="20"></a>
Per session 77 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,736 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00077 $0.01736
Opus 5 $0.00039 $0.00868
Sonnet 5 $0.00015 $0.00347
Haiku 4.5 $0.00008 $0.00174

Measured 3d ago against content hash a95f682b2055, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

library-first 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 3d 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.

adapters/codex/.agents/skills/library-first/SKILL.md · 203 lines

How it starts

The opening of the file, as written. The whole thing — 203 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Library-First Protocol

Runs first in a fast-track task. Does nothing until explicit user approval.

Input

The approved flow-first-{N}.{R}.md with Landscape and Solution cells identifying what exists vs what needs building.

Output

A LOC table with 5 columns (What we do / Source / What we use / LOC / Type) plus Watchpoints and Out-of-scope blocks, saved as library-first-{N}.{R}.md.

Hands off to

plan-first (auto-invoked after user approval).


Step 0 — Check task context

Check: are {log_dir} and {slug} known in the current session?

If yes — continue. If no — list the latest task folders under {tasks_root}/log/ and ask which is current, then set {slug} and {log_dir}. Cannot skip — without {log_dir} the artifact won't be saved.


Step 0.5 — Chain verification

If {N} is known — check for a flow-first artifact:

ls "{log_dir}"/flow-first-{N}.*.md 2>/dev/null | head -1

File found → continue. Not found → invoke Skill(flow-first) and resume after it completes. {N} unknown → silently skip.

Step 0.5.1 — Read and extract Solution

From the flow-first file extract: Landscape / Problem / Solution / Result across three axes (UI / DB / Integrations).

Use Solution as the basis for atoms in Step 1. Use Landscape for the "Source" field: existing component mentioned → Library ✅; not mentioned → From scratch ⚠️.

If the flow-first table is empty or all cells say "not involved" — prompt once to repeat flow-first; on retry, continue with what's there.


Step 1 — Task analysis

Break the task into atomic parts. For each part determine:

  • Source: existing component/library → Library ✅; nothing suitable → From scratch ⚠️
  • What we use: specific file/component name. If from scratch — "no ready-made"
  • LOC: approximate new lines. Library — 0 or minimum for integration

Step 2 — Output the table

| # | What we do        | Source          | What we use     | LOC | Type     |
|---|-------------------|-----------------|-----------------|-----|----------|
| 1 | [action]          | Library ✅       | [file]          | 0   | ui       |
| 2 | [action]          | From scratch ⚠️  | no ready-made   | ~40 | ai-skill |

Total new lines of code: ~40

Read the full file on GitHub · 203 lines

Files

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.

Changes

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.

  1. 3d ago Changed a95f682b2055
  2. 7d ago First seen · 203 lines · 77 tokens per session scan A 0c22b17381fd

Subscribe to this mod's changes

library-first is a skill published in the GitHub repository bearded-illirian/trailmark (19 stars, last pushed 5d ago), licensed MIT. It adds 77 tokens to every session and 1,736 once invoked, about $0.0004 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-30.

Related

Other skills, from other repositories

mission-control

Interact with Mission Control — AI agent orchestration dashboard. Use when registering agents, managing tasks, syncing skills, or querying agent/task status via MC APIs.

builderz-labs/mission-control · 34 tokens

afrexai-compliance-engine

Your AI compliance officer. Guides startups and scale-ups through SOC 2, ISO 27001, GDPR, HIPAA, and PCI DSS — from zero to audit-ready. No consultants needed.

aAAaqwq/AGI-Super-Team · 0 tokens

after-sales

Use when managing post-purchase experience, building customer loyalty, or increasing repeat purchases.

aAAaqwq/AGI-Super-Team · 19 tokens

competitive-offer-architect

Design irresistible offer packages with real salary benchmarks, negotiation playbooks, and competitive counter-strategies. Co-designed with Siku (司库). Includes total compensation calculator, negotiation scripts, and BATNA analysis.

aAAaqwq/AGI-Super-Team · 48 tokens

bankr

AI-powered crypto trading agent and LLM gateway via natural language. Use when the user wants to trade crypto, check portfolio balances, view token prices, transfer crypto, manage NFTs, use leverage, bet on Polymarket, deploy tokens, set up automated trading, sign and submit raw transactions, or access LLM models…

aAAaqwq/AGI-Super-Team · 96 tokens

ai-viral-team-script-writing

A guide for writing short-video scripts and shot lists, including dialogue, camera direction, character actions, mood, music, hooks, and endings. A shot list describes what happens in each camera shot.

aAAaqwq/AGI-Super-Team · 169 tokens