# Schema Normalizer

Normalize cross-skill JSONL interfaces (ids + titles + citation key formats) so...

- Repository: https://github.com/WILLOSCAR/research-units-pipeline-skills (517 stars)
- Category: Engineering
- License: see repository
- Last updated: 2026-10-05
- Runs scripts: yes, review before use

## Install

Claude Code: `npx skills add WILLOSCAR/research-units-pipeline-skills --skill schema-normalizer -g -a claude-code -y`
Codex: `npx skills add WILLOSCAR/research-units-pipeline-skills --skill schema-normalizer -g -a codex -y`
Cursor: `npx skills add WILLOSCAR/research-units-pipeline-skills --skill schema-normalizer -g -a cursor -y`
Gemini CLI: `npx skills add WILLOSCAR/research-units-pipeline-skills --skill schema-normalizer -g -a gemini-cli -y`

## Description

Normalize cross-skill JSONL interfaces (ids + titles + citation key formats) so downstream skills do not rely on best-effort joins.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Schema Normalizer (NO PROSE)

## Triggers & routing

- **Trigger**: schema normalize, jsonl contract, interface drift, join drift, 字段不一致, schema 规范化.
- **Use when**: you have generated C2-C4 JSONL artifacts (outline/briefs/bindings/packs/anchors) and want deterministic, stable fields before self-loops/writing.


Purpose: close a common failure mode in skills-first pipelines: **schema drift** across JSONL artifacts.

When fields are inconsistent (missing ids/titles, mixed citation-key formats), downstream skills start doing best-effort joins and fragile parsing.
This skill makes the interface explicit and deterministic.

## Inputs

- `outline/outline.yml` (source of truth for section/subsection ids + titles)
- Optional (for citation-key sanity): `citations/ref.bib`
- Default JSONL artifacts to normalize (arxiv-survey(-latex) C4 bridge):
  - `outline/subsection_briefs.jsonl`
  - `outline/chapter_briefs.jsonl`
  - `outline/evidence_bindings.jsonl`
  - `outline/evidence_drafts.jsonl`
  - `outline/anchor_sheet.jsonl`
- Optional (run after writer packs are generated):
  - `outline/writer_context_packs.jsonl`

## Outputs

- `output/SCHEMA_NORMALIZATION_REPORT.md` (always written; PASS/FAIL + what changed)
- The processed JSONL files are normalized **in place** (a `.bak.*` is created if changes are applied).

## What gets normalized

### 1) IDs + titles (join keys)

For any record with `sub_id: "<H2>.<H3>"`:
- Ensure `section_id` exists (derived from the prefix before the dot)
- Ensure `title`, `section_title` exist (filled from `outline/outline.yml`)

For any record with `section_id: "<H2>"`:
- Ensure `section_title` exists (filled from `outline/outline.yml`)

### 2) Citation key format (reduce parsing drift)

Within these C2-C4 JSONL artifacts, normalize citation keys so they are **raw BibTeX keys** (no `@` prefix):
- `"citations": ["smith2023", "jones2024"]`

The rest: https://github.com/WILLOSCAR/research-units-pipeline-skills/blob/HEAD/.codex/skills/schema-normalizer/SKILL.md
