Files
our-claude-skills/custom-skills/16-seo-schema-validator/code/CLAUDE.md
Andrew Yim 4f48ba3c59 feat(seo-schema-validator): back the upgraded SKILL.md with a working 5-layer pipeline
The "Upgrade Schema Validator" commit added SKILL.md referencing files that did
not exist. Implement them so the skill actually runs:

- scripts/validate_schema.py — 5-layer offline validator (L0 coverage, L1 syntax,
  L2 vocabulary/value-format, L3 rich-result, L4 consistency) with xlsx/csv/jsonl/
  json/dir/live-URL adapters. Gate = zero P0; exits 1 on failure.
- scripts/schema_rules.json — curated hotel-focused, offline rule set (edit-only
  extension point).
- scripts/make_sample.py + fixtures/sample_schema.csv — deliberately flawed fixture
  seeding ≥1 defect per layer; used to self-test.
- references/ — validation-methodology, defect-taxonomy (25 codes), hotel-type-map.
- templates/ — client-qa-report, decision-log.
- code/CLAUDE.md — redirect legacy single-URL tool to the new pipeline.

Noise control: MISSING_RECOMMENDED aggregated one-line-per-node; unexpected-property
checks opt-in via --strict. Generalized client-specific shilla-type-map → hotel-type-map.
Self-tested: default P0=5/P1=4/P2=14 FAIL, --strict --no-recommended P2=0, adapters verified.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-27 23:48:51 +09:00

58 lines
2.5 KiB
Markdown

# CLAUDE.md — seo-schema-validator (Claude Code)
## Canonical entry point
This skill was upgraded to a **5-layer dataset-QA pipeline**. The authoritative
directive and run instructions live in the skill root:
- **`../SKILL.md`** — modes, the 5 layers, stage gates, how to run.
- **`../scripts/validate_schema.py`** — the validator (run this, not the legacy script below).
- **`../scripts/schema_rules.json`** — the offline rule set (edit this to add a type/rule).
- **`../references/`** — `validation-methodology.md`, `defect-taxonomy.md`, `hotel-type-map.md`.
- **`../templates/`** — `client-qa-report-template.md`, `decision-log.md`.
```bash
# Primary use — QA an AUTHORED dataset before the client sees it (Mode A)
python ../scripts/validate_schema.py DATASET.xlsx --url-list URLLIST.xlsx --out schema_qa_out
# Highest-signal pre-review gate
python ../scripts/validate_schema.py DATASET.csv --strict --no-recommended --out qa_strict
# Try the bundled flawed fixture first
python ../scripts/make_sample.py
python ../scripts/validate_schema.py ../fixtures/sample_schema.csv --out demo_out
# Post-deploy live audit (Mode B) — feeds seo-comprehensive-audit stage 4
python ../scripts/validate_schema.py --live https://example.com --out live_out
```
Gate rule: **PASS = zero P0.** The process exits 1 when the gate fails, so it stops
`&&` chains and CI. Only P0-free entries advance to client review.
## Legacy single-URL tool (kept for quick one-offs)
`scripts/schema_validator.py --url <URL>` extracts and validates structured data from
one live page (JSON-LD / Microdata / RDFa via extruct). It predates the pipeline and is
**not** the gate. For any dataset or client-facing QA, use `validate_schema.py` above.
```bash
pip install -r scripts/requirements.txt # extruct, jsonschema, rdflib, lxml, requests
python scripts/schema_validator.py --url https://example.com --json
```
## Notion output (OurDigital SEO Audit Log)
When a run is part of an OurDigital/D.intelligence audit, log a summary to the SEO Audit
Log database. Per the user-level Notion rule, push **page content** with the
`notion-writer` skill; use Notion MCP only for **properties** (Status, Category, etc.).
| Field | Value |
|-------|-------|
| Database ID | `2c8581e5-8a1e-8035-880b-e38cefc2f3ef` |
| Category | `Schema/Structured Data` |
| Priority | map gate: FAIL→Critical/High, PASS-with-P1→Medium, PASS-clean→Low |
| Audit ID | `SCHEMA-YYYYMMDD-NNN` |
Report content in Korean; keep technical terms (Schema, JSON-LD, rich result) and
URLs/code unchanged.