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 commands/jjmartres/ai-coding-agents/prepare-datasetgit clone --depth 1 https://github.com/jjmartres/ai-coding-agentsWrote 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/commands/jjmartres/ai-coding-agents/prepare-dataset)<a href="https://agentmods.dev/commands/jjmartres/ai-coding-agents/prepare-dataset"><img src="https://agentmods.dev/badge/commands/jjmartres/ai-coding-agents/prepare-dataset.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.00061 | $0.01364 |
| Opus 5 | $0.00030 | $0.00682 |
| Sonnet 5 | $0.00012 | $0.00273 |
| Haiku 4.5 | $0.00006 | $0.00136 |
Grade A, and why
prepare-dataset 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 5d 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 — 155 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Arguments
$FILE: path to the source file (e.g.data/products.csv,data/clients.json)$GOAL: one sentence describing what the model should be able to do after fine-tuning (e.g. "answer questions about our product catalogue in English")
Steps
1. Analyse the source file
Start by reading and analysing $FILE:
- Detect the format (CSV, JSON, JSONL, TSV, Parquet) and the delimiter if CSV
- Identify all available fields/columns and their types (string, number, bool...)
- Count the total number of rows
- Measure the missing value rate per field
- Display 3 sample rows to understand the structure
- Identify rich fields (few missing values, varied content) vs. sparse fields (>50% empty, constant values)
2. Propose a strategy
Based on $GOAL and the analysis, propose:
- Which fields to use and why (exclude fields that are too empty or irrelevant)
- How many Q&A pairs per source row can be generated (~5 to 30 depending on richness)
- Estimated final dataset size (rows x average examples)
- If the dataset is too small (<100 final examples): suggest an augmentation strategy (phrasing variants, synthetic data)
- Recommended filter (e.g. "keep only rows where field X is filled")
Wait for validation before generating the script.
3. Generate scripts/dataset/<n>.py
Generate a Python script that inherits from BaseDatasetPreparer
(see scripts/dataset/base.py), with the following structure:
Header and imports
"""
scripts/dataset/<n>.py
──────────────────────────
Short description of what this script does.
Source : $FILE
Goal : $GOAL
Usage :
uv run sg-<n> --input data/<n>.csv --stats
uv run <n>-quality
"""
Lookup tables (if codes or abbreviations are present in the data) Generate Python dicts to translate them into human-readable text (e.g. country codes -> names).
Class <n>Preparer(BaseDatasetPreparer) with two methods:
generate_examples(self, row: dict) -> list[dict]
- Takes one source row as input
- Returns a list of dicts
{"instruction": str, "input": str, "output": str} - Generates between 5 and 30 Q&A pairs per row depending on data richness
- Covers each important fact under 2-3 different phrasings (e.g. "What is X of Y?" / "Give me X for Y." / "What is the X value of Y?")
- Includes at least one "full record" question that aggregates all fields
- Handles missing fields gracefully (
if field:before using) - All questions and answers match the language implied by
$GOAL
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.
- 5d ago First seen · 155 lines · 61 tokens per session scan A 02e981d87481
prepare-dataset is a command published in the GitHub repository jjmartres/ai-coding-agents (44 stars, last pushed 2mo ago), licensed MIT. It adds 61 tokens to every session and 1,364 once invoked, about $0.0003 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.
Other commands, from other repositories
publish
Release a new package version — semver bump from commits, tag, registry publish, GitHub Release.
bump
Full dependency and toolchain bump — deps to latest major, Node pins, GitHub Actions, audit, validate, commit.
rebase
Rebase the current branch on main, a local branch, or a remote branch (with fetch).
create-issue
Create GitHub issue with validated labels.
retro
Run retrospective to capture learnings.
extract-best-frame
../../knowledge/procedures/extract-best-frame-procedure.md.