Skip to content

Add skill: map-pdp-structure#83

Merged
timctfl merged 1 commit intomainfrom
map-pdp-structure
Apr 17, 2026
Merged

Add skill: map-pdp-structure#83
timctfl merged 1 commit intomainfrom
map-pdp-structure

Conversation

@timctfl
Copy link
Copy Markdown
Owner

@timctfl timctfl commented Apr 17, 2026

Summary

New skill: map-pdp-structure. Reverse-engineers a Shopify store's PDP structure from a connected reference product and produces a structured content template. Downstream PDP skills (rewrite-pdp-copy, write-product-descriptions, audit-pdp) consume this template to know where to read from and write to in Shopify.

One-time-per-store setup skill. Architecture doc calls it the highest-stakes piece of the Run experience; authored with that in mind.

What's in it

  • SKILL.md — goal-led brief for the model, self-contained for a fresh session.
  • skillshelf.yaml — metadata (category: catalog-operations, platforms: shopify, level: intermediate).
  • references/build_evidence_table.py — stdlib-only Phase 1 script. Chunks body_html on block elements, normalizes metafield values per type (JSON leaves, list items, rich_text strip, reference flagging), substring-matches every field value against the rendered page, and emits evidence + static/dynamic candidates.
  • references/output-schema.yaml — JSON Schema (draft 2020-12) enforcing the template shape with conditional requirements (metafield sources need namespace.key + type; external sources need source_detail; heading wrappers need heading text).
  • references/example-output.md — a worked example using the synthetic GreatOutdoors Co. cast per CLAUDE.md's no-real-brands rule.

End-to-end validation

Ran against three real stores covering the three PDP archetypes (metafield-first, body_html-heavy, theme-component) using Opus 4.7. All three produced schema-valid templates. Real-store data stayed outside the repo (scratch only, never committed).

Follow-up (platform-side, not in this PR)

The site repo companion PR wires up the execution config, data-key entry, and uses new execution-schema fields (format: structured, schema: skill, data_key, shopify_product input types, optional read_themes scope) that the current Zod schema in site/src/data/skill-meta.ts doesn't yet accept. Schema extension is tracked as pre-requisite platform work.

Test plan

  • SkillShelf validation CI passes on the new skill (frontmatter, directory layout, references)
  • python3 references/build_evidence_table.py --product-data <json> --rendered-pages <md> --output out.json runs against a sample product JSON + Jina markdown without error
  • references/output-schema.yaml parses as valid JSON Schema draft 2020-12
  • references/example-output.md's embedded JSON validates against references/output-schema.yaml

🤖 Generated with Claude Code

Reverse-engineers a Shopify store's PDP template structure from a
connected reference product. Identifies visible sections on the
rendered page, maps each one to its Shopify source (standard field,
specific metafield, or external theme/app content), classifies
dynamic vs static, and defines the body_html assembly pattern for
write-back.

The Phase 1 Python script builds a deterministic evidence table by
substring-matching every product field value against the rendered
page, including recursive flattening of JSON metafields, joining of
list metafields, and HTML stripping of rich_text metafields. The
LLM uses the evidence plus a screenshot and rendered markdown to
produce a structured template that validates against the declared
JSON Schema.

Validated end-to-end with Opus 4.7 against three real store
archetypes (metafield-first, body_html-heavy, theme-component).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@timctfl timctfl merged commit da98577 into main Apr 17, 2026
1 check passed
@timctfl timctfl deleted the map-pdp-structure branch April 17, 2026 01:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants