Section Merger logo

Section Merger

Community
WILLOSCAR
section-merger

Deterministically merge the final fingerprinted section snapshot into `output/DRAFT.md`, preserving outline order and inserting transitions only when explicitly enabled.

Overview

PublisherWILLOSCAR
Repositoryresearch-units-pipeline-skills
Skill namesection-merger
Stars
513
Forks
39
Bundled files
1
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 1 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by WILLOSCAR on GitHub. Read the source before you install it.

Installation

Install the Section Merger AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/WILLOSCAR/research-units-pipeline-skills/tree/main/.codex/skills/section-merger
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/WILLOSCAR/research-units-pipeline-skills.git /tmp/research-units-pipeline-skills
mkdir -p .claude/skills
cp -r /tmp/research-units-pipeline-skills/.codex/skills/section-merger .claude/skills/section-merger
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Section Merger in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Section Merger on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Section Merger is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Section Merger

Triggers & routing

  • Trigger: merge sections, merge draft, combine section files, sections/ -> output/DRAFT.md, 合并小节, 拼接草稿.
  • Use when: you have per-unit prose files under sections/ and want a single output/DRAFT.md for polishing/review/LaTeX.

Goal: assemble a paper-like output/DRAFT.md from:

  • sections/ (per-section/per-subsection prose)
  • outline/transitions.md (optional hand-off suggestions; generated by transition-weaver)
  • outline/tables_appendix.md (reader-facing Appendix tables; generated by appendix-table-writer)

Merge order is driven by outline/outline.yml. The draft title is derived from GOAL.md when present. When sections/sections_manifest.jsonl is supplied by the Pipeline contract, every merged section must match its recorded bytes and SHA-256 hash.

This skill is deterministic: it does not rewrite content or invent prose; it only merges already-generated artifacts.

Transitions (explicit opt-in)

  • By default, generated transitions are not inserted.
  • To insert H3 transitions, create outline/transitions.insert_h3.ok.
  • To insert H2 transitions, create outline/transitions.insert_h2.ok.
  • Format contract: H3 entries use - 3.1 -> 3.2: <text>.
  • Compatibility: → is accepted, but -> is the preferred contract (avoids control-character encoding issues).
  • Treat transitions as injected draft text: run post-merge-voice-gate after merging, and route fixes back to outline/transitions.md (do not patch the merged draft).

Tables (two layers)

This pipeline uses two table layers:

  • outline/tables_index.md (internal index; produced by table-filler)

    • planning/debugging artifact
    • should NOT be inserted into the paper
  • outline/tables_appendix.md (reader-facing Appendix tables; produced by appendix-table-writer)

    • publishable tables (clean layout + high information density)
    • inserted by section-merger under a single Appendix heading

Appendix insertion behavior

  • section-merger inserts outline/tables_appendix.md at the end of the draft under ## Appendix: Tables.
  • The inserted block is heading-free (any accidental # headings inside the tables file are stripped).
  • Opt-out (rare): create outline/tables.insert.off in the workspace.

Inputs

  • outline/outline.yml (drives section/subsection order)
  • outline/transitions.md (required)
  • sections/sections_manifest.jsonl (required by the executable survey Pipeline; freshness gate)
  • GOAL.md (optional title)

For arxiv-survey pipelines (default contract):

  • outline/tables_appendix.md (required unless opted out)

Outputs

  • output/DRAFT.md
  • output/MERGE_REPORT.md

Script

Quick Start

  • uv run python .codex/skills/section-merger/scripts/run.py --help
  • uv run python .codex/skills/section-merger/scripts/run.py --workspace <workspace>

All Options

  • --workspace <workspace> (required)
  • --unit-id <id> (optional; used only for runner bookkeeping)
  • --inputs <a;b;c> (optional; override inputs; defaults are profile-aware)
  • --outputs <draft_rel;report_rel> (optional; defaults to output/DRAFT.md;output/MERGE_REPORT.md)
  • --checkpoint <C#> (optional; ignored by the merger)

Examples

  • Merge with defaults (profile-aware table insertion):

    uv run python .codex/skills/section-merger/scripts/run.py --workspace <workspace>

  • Merge with explicit outputs:

    uv run python .codex/skills/section-merger/scripts/run.py --workspace <workspace> --outputs output/DRAFT.md;output/MERGE_REPORT.md

Troubleshooting

Issue: merge report says a subsection file is missing

Likely cause:

  • A required sections/*.md file has not been written yet.

Fix:

  • Write the missing units under sections/ (typically via subsection-writer) and rerun merge.

Issue: Appendix tables are missing in the merged draft

Fix:

  • Ensure outline/tables_appendix.md exists and contains the profile minimum (course paper: >=1; survey/deep: >=2) with no placeholders.
  • Ensure you did not create outline/tables.insert.off.
  • Rerun section-merger.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Section Merger AI skill do?

Deterministically merge the final fingerprinted section snapshot into `output/DRAFT.md`, preserving outline order and inserting transitions only when explicitly enabled.

Why use Section Merger on TypingMind?

Because you install it once and use it with any model. Section Merger is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Section Merger in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/WILLOSCAR/research-units-pipeline-skills/tree/main/.codex/skills/section-merger. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Section Merger?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Section Merger?

As many as you like. As long as a model supports skills, you can use Section Merger with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Section Merger AI skill free?

It is published on GitHub by WILLOSCAR. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇