Asteriya-PhD

structured-content-factory

Five engineering primitives for batch structured content generation — Schema First, Anti-Pollution, Tiered Audit, Single Truth Registry, Tier Retry. Use when generating 50+ structured content cards (法律条文 / 词条 / 商品 / 报告 / 菜谱 / etc.) and needing reproducible quality at scale.

Asteriya-PhD 0 Updated 3w ago

Resources

13
GitHub

Install

npx skillscat add asteriya-phd/structured-content-factory

Install via the SkillsCat registry.

SKILL.md

🌐 English | 中文

Structured Content Factory

Five primitives distilled from running 600+ pages of batch structured content through real LLM pipelines. Pick the primitives that fit; skip the rest.

The Five Primitives

  1. Schema First — design the JSON schema + validation rules before writing prompts. Schema is the contract; prompts serve it.
  2. Anti-Pollution — block 4 recurring LLM failure modes before they reach the audit stage.
  3. Tiered Audit — Layer 1 heuristic (free, 1s/item) + Layer 2 LLM (smart-routed, ~30% of items). ROI: 60-70% cost reduction vs. blanket LLM audit.
  4. Single Truth Registry — one git-tracked JSON file as the canonical state of every item across sessions. Replaces ad-hoc test_results/ folders.
  5. Tier Retry — Tier 1 (5 min, fix weak fields) / Tier 2 (20 min, full rewrite) / Tier 3 (≤45 min, flag irreducible-<Y> and skip).

Read `references/01-schema-first.md` through 05-tier-retry.md for the full anatomy.

Quick Start (5 minutes)

# 1. Clone
git clone https://github.com/liuzhewen/structured-content-factory.git
cd structured-content-factory

# 2. Run L1 audit on a demo domain
python3 scripts/smart_audit.py --curated examples/classical-poetry/data --dry-run --json

# 3. Apply audit + build registry
python3 scripts/smart_audit.py --curated examples/classical-poetry/data
python3 scripts/update_registry.py --rebuild --curated examples/classical-poetry/data

# 4. Verify
python3 scripts/validate_registry.py examples/classical-poetry/registry.json --strict

See `docs/quickstart.md` for the full walkthrough.

CLI Cheatsheet

Script Common Flags
smart_audit.py --curated <dir> --dry-run --json --limit N --sample-rate 0.1 --force
update_registry.py --rebuild --from-file <path> --from-dir <dir> --from-stdin --stats
validate_registry.py <registry.json> --strict --stats
backfill_fields.py --curated <dir> --check --apply --only <fields>

When This Skill Fits

✅ You are producing 50+ structured content cards (any domain).
✅ Items share a schema (12-20 fields each).
✅ You need reproducible quality scoring, not "looks good".
✅ Single-source-of-truth state matters (cross-session, cross-team).

❌ You are writing 1-10 hand-crafted articles — skip this skill.
❌ Your content has no schema — start with references/01-schema-first.md before anything else.

Boundaries (what this is NOT)

  • ❌ Not an LLM provider wrapper. Use any LLM SDK; scripts only route calls.
  • ❌ Not a frontend renderer. Render however you like.
  • ❌ Not a governance framework. No release gates, no claim guards, no evidence ledger.
  • ❌ Not gaokao-specific. Generic 5 primitives work for any batch content domain.

Extension Points

Override 4 hooks in your project's config:

  1. style_to_category_map — style label → category
  2. category_keywords — title/category keywords → subcategory regex
  3. category_palette — category → theme_palette
  4. l1_rules_path — path to your domain-specific anti-pollution rules YAML

See `docs/architecture.md` for how to wire them.

Categories