migrate

A command that updates an older Bonfire session index to the version 7 format. Bonfire is a repository file convention for keeping notes about coding sessions and current work.

In plain words
What is it for?
Use it once when a repository's .bonfire/index.md predates version 7 and lacks the required markers or headings.
Why use it?
It lets you adopt the newer format while preserving existing notes and moving session history to its intended log file.

Command

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 commands/vieko/bonfire/migrate
Clone the repo
git clone --depth 1 https://github.com/vieko/bonfire
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,219 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 $0.00000 $0.02219
Opus 5 $0.00000 $0.01110
Sonnet 5 $0.00000 $0.00444
Haiku 4.5 $0.00000 $0.00222

Measured 2d ago against content hash 505ee930aa9b, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

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

skills/bonfire/commands/migrate.md · 163 lines

How it starts

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

Migrate Legacy Index (fallback)

Outcome

A pre-v7 <git-root>/.bonfire/index.md becomes v7.0-compliant: the v1 fence pair appears at the top, the legacy ## In flight heading is renamed to the canonical curated heading (## Notes), the legacy ## Sessions content is moved out to the canonical sidecar (<git-root>/.bonfire/log.md), and everything else in the file is preserved byte-for-byte in its original relative position. Adapters take over auto-updates on the next session without destroying any of the user's prior curation.

When to use this

  • One-off, manual trigger: /skill:bonfire migrate (or your host's equivalent).
  • After installing Bonfire 7.0+ on a repo whose index.md predates fences. The Pi adapter surfaces this state in two places: the footer shows △ !fences (yellow), and a one-shot notify points at this exact command. The Claude adapter is silent on this state.
  • Native adapters never run this automatically. They leave fenceless files alone by design — auto-fencing a curated file would be destructive.

Acceptance Criteria

  1. Opt-in respected: <git-root>/.bonfire/ exists. If not, exit silently. (Same gate as end.md.)
  2. Per-repo opt-out respected: if <git-root>/.bonfire/config.json has { "auto": false }, exit silently.
  3. Idempotent: if both v1 fence pairs are already present and well-formed (<!-- bonfire:auto-inflight:start v1 --><!-- bonfire:auto-inflight:end --> and the matching sessions pair), exit silently. Don't re-migrate.
  4. Empty-file shortcut: if index.md doesn't exist, or contains only a YAML frontmatter + H1 and no other content, use templates/index.md directly. There's nothing to migrate; just bootstrap.
  5. Backup written before rewriting index.md: copy the original to <git-root>/.bonfire/index.md.pre-migrate-YYYY-MM-DD.bak. If that path already exists, append a counter suffix (...-1.bak, ...-2.bak, …). Never overwrite a prior backup.
  6. Migrated index.md shape, top-to-bottom:
    1. Optional YAML frontmatter (preserved verbatim if present).
    2. The original H1 (preserved verbatim).
    3. <!-- bonfire:auto-inflight:start v1 --> block with a brief placeholder body explaining the next session will populate it.
    4. <!-- bonfire:auto-sessions:start v1 --> block, empty ## Sessions body.
    5. A horizontal rule (---) separating the auto-managed region from the curated region.
    6. Any free-form prose between the H1 and the first H2 in the original (a "lead paragraph") — preserved verbatim, in its original position relative to surrounding sections (i.e. now between the boundary --- and the next H2).
    7. The original ## In flight content, with the heading renamed to ## Notes — the canonical curated heading.
    8. The original ## Sessions section is removed from index.md (its content is written to log.md, see criterion 7).
    9. Any other H2+ sections from the original file, in their original order, with original headings.
  7. Sidecar write for legacy session content:
    • Write the original ## Sessions block (the H2 heading itself plus all entries below it, up to but not including the next H2 or EOF) to <git-root>/.bonfire/log.md.
    • Header prepended to the sidecar: _Migrated from index.md on YYYY-MM-DD_ followed by a blank line, then the H2 + content.
    • Collision handling: if log.md already exists, write to <git-root>/.bonfire/log-pre-migrate-YYYY-MM-DD.md instead (with counter suffix on collision). Never silently overwrite an existing log.md.
    • If the original file has no ## Sessions section, skip the sidecar write entirely (no empty file).
  8. Atomic writes: both index.md and the sidecar are written via tmpfile + rename. Don't truncate in place.

Read the full file on GitHub · 163 lines

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 First seen · 163 lines · 0 tokens per session scan A 505ee930aa9b

Subscribe to this mod's changes

migrate is a command published in the GitHub repository vieko/bonfire (10 stars, last pushed 9d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,219 tokens. 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.