flow-first

flow-first is a skill for Claude Code, Codex from bearded-illirian/trailmark. It costs 102 tokens per session (2,371 once invoked), scanned A, original, MIT.

A short alignment process that builds a shared understanding of one task section before planning begins. It reads two or three user-chosen reference points, such as a file, database table, route, or service, and organizes findings in a table covering the interface, data, and connections to other systems.

In plain words
What is it for?
Use it before searching for reusable solutions or making a plan when the agent needs focused context about how a task fits the project.
Why use it?
It prevents planning from being based on guesses about the wrong part of the project. The user reviews the understanding before the next step starts.

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.

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.

agentmods
npx agentmods add skills/bearded-illirian/trailmark/flow-first
Any agent
npx skills add bearded-illirian/trailmark --skill flow-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 flow-first

README.md
[![agentmods](https://agentmods.dev/badge/skills/bearded-illirian/trailmark/flow-first.svg)](https://agentmods.dev/skills/bearded-illirian/trailmark/flow-first)
Your own site
<a href="https://agentmods.dev/skills/bearded-illirian/trailmark/flow-first"><img src="https://agentmods.dev/badge/skills/bearded-illirian/trailmark/flow-first.svg" alt="Measured on agentmods" height="20"></a>
Per session 102 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,371 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00102 $0.02371
Opus 5 $0.00051 $0.01185
Sonnet 5 $0.00020 $0.00474
Haiku 4.5 $0.00010 $0.00237

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

Security

Grade A, and why

flow-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 2d 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/flow-first/SKILL.md · 294 lines

How it starts

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

Flow-First Protocol

Input

The block's task description plus 2-3 anchors (file / DB table / route / service / UI component) from the user.

Output

A 4×3 table (Landscape / Problem / Solution / Result across UI / DB / Integrations) saved as flow-first-{N}.{R}.md.

Hands off to

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


Introduction

An understanding-alignment protocol before moving to library-first.

Why it's needed: library-first assumes the agent already understands what is being done and at which levels. Without that understanding, library-first is built on guesses — wrong layer searched, wrong LOC estimate, wrong "ready-made" solution. flow-first closes that gap in 5-10 minutes before planning begins.

Key principle: the agent reads only what the user specified — 2-3 anchors (file, table, route, service). No project-wide scanning.


Step 0 — Check task context

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

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


Step 0.5 — Incoming-artifact calibration

flow-first can be invoked inside a per-block cycle or manually. Read earlier artifacts if present:

ls "{log_dir}"/idea-first-*.md 2>/dev/null | head -1
ls "{log_dir}"/habit-first-*.md 2>/dev/null | head -1
ls "{log_dir}"/research-doc.md 2>/dev/null | head -1
  • idea-first-*.md → extract task type (product/feature/fix) and scope
  • habit-first-*.md → behavioural context for new-product tasks
  • research-doc.md → ready comparison "as is vs should be"

If none found — continue. flow-first works without them.

Step 0.5.0 — UPDATE block status pending → open

Move current block from pending to open:

sqlite3 {routing_db} \
  "UPDATE task_blocks SET status='open'
   WHERE task_id='{slug}' AND block_num={N} AND status='pending';"

Read the full file on GitHub · 294 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. 2d ago Changed f6b59cafca94
  2. 6d ago First seen · 294 lines · 102 tokens per session scan A 5727508a2fe3

Subscribe to this mod's changes

flow-first is a skill published in the GitHub repository bearded-illirian/trailmark (19 stars, last pushed 4d ago), licensed MIT. It adds 102 tokens to every session and 2,371 once invoked, about $0.0005 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.