agentleFS
DshamirDshamir/slm-forge/skills/forge-synth/SKILL.md

forge-synth

Skill1 starsChanged 6 months agoMITView on GitHub

Generates Q/A pairs from cleaned passages via Claude Haiku. Converts a pretrain corpus (raw text chunks) into proper SFT chat-format training data (3 Q/A pairs per passage — factual + mechanism + clinical). Critical phase — without this, lora-sft regimes degenerate into raw-text continuation pretending to be SFT.

  • Reads credentials

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 1 is distinctive, and 1 is 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.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Skipped: when input is already chat-jsonl format.

    line 11
  2. Very specific:

    If qa.jsonl exists, resumes from where it left off (uses passage_id as the dedup key).

    line 46

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 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

forge-synth

When this fires

Phase position: SYNTH — after AUDIT, before SHAPE. Skipped when input is already chat-jsonl format.

What it does

  1. Reads the audited pretrain corpus from data/audited/cleaned.jsonl (or prepped.jsonl if no audit phase ran)
  2. For each passage, calls Claude Haiku to generate exactly 3 Q/A pairs:
    • factual recall
    • mechanism / "why does this work"
    • clinical / practical
  3. Strict grounding (answers must come from passage)
  4. Filter rule-based junk (short answers, "according to the passage" framing, generic AI questions)
  5. Emit chat-format JSONL: {id, format:"chat", messages:[{role:user,content:Q},{role:assistant,content:A}], metadata}

Inputs

  • run_id
  • Reads audited/cleaned.jsonl or prepped.jsonl from run dir or S3
  • ANTHROPIC_API_KEY (from /tmp/forge-creds.env)

Outputs

  • slm-forge/.runs/<run_id>/qa.jsonl — raw synthesis output (one record per Q/A pair)
  • slm-forge/.runs/<run_id>/qa-filtered.jsonl — after rule-based filter
  • slm-forge/.runs/<run_id>/synth-stats.json — token usage + cost
  • Updates manifest: artifacts.synth_corpus_s3

Concurrency

12 parallel requests via asyncio.Semaphore. ~50 sec per 100 passages.

Cost

Haiku 4.5 at $1/M input + $5/M output. Average ~$0.0026 per passage. 1500 passages → ~$4.

Idempotent

If qa.jsonl exists, resumes from where it left off (uses passage_id as the dedup key).

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.