Skip to content

narrative-io/narrative-skills-marketplace / plugins/narrative-common/skills/generate-rosetta-stone-mappings

generate-rosetta-stone-mappings

Verified

Generate, evaluate, and improve Rosetta Stone attribute mappings for a Narrative dataset. Use when: "map this dataset to Rosetta Stone", "suggest normalized attributes for dataset N", "evaluate the mappings on dataset N", "why is this mapping low confidence", "fix this expression", "improve this NQL mapping expression". (narrative-common)

FileKindSize
SKILL.mdskill md16.1 KB
SKILL.md.tmplother13.6 KB
references/DATASET_DESCRIBE.mdmarkdown2.6 KB
references/HARNESS_FALLBACK.mdmarkdown1.4 KB
references/HARNESS_FALLBACK.md.tmplother937 B
references/MODES.mdmarkdown3.2 KB

references/MODES.md

View on GitHub
# Alternate Entry Modes

The main procedure assumes the default flow: a fresh dataset with no
existing mappings, ending in a hand-off to `/apply-rosetta-stone-mappings`.
This file covers two alternate entry points that short-circuit that
flow when the user is touching up prior work rather than mapping a
new dataset.

Step 6 (the apply hand-off) is **skipped** for both modes below — the
output here is a scorecard or a one-line revision, not a deploy set.

## Evaluate existing mappings

If `narrative_datasets_describe` (with `include: ["mappings"]`)
returns a non-empty `mappings[]` array, or the user said "evaluate" /
"rate" / "why is X low confidence":

1. Skip the attribute-search step — the target attribute is already
   chosen. Pass the existing attribute IDs as an array to
   `narrative_attributes_describe(attribute_ids: [<id>, ...])`.
2. For each existing mapping, build a query that selects the mapping
   expression and the underlying source columns with a `limit` cap,
   and submit it via `narrative_nql_execute(nql: '...')`. That returns
   a workflow run: find the job it enqueued with
   `narrative_jobs_search(workflow_run_id: "<run_id>")`, follow
   `narrative_jobs_describe(job_ids: ["<job_id>"])` until `state` is
   `completed`, then read the result rows to see what the mapping
   actually produces.
3. Score confidence per the main procedure's table, using *execution
   evidence* not just static reasoning.
4. Present a human-readable scorecard to the user — a row per existing
   mapping with `attribute_id`, `confidence`, `reasoning`, and an
   optional `suggested_fix`. For object_mappings include per-property
   scores (one entry per property_mapping path). Surface any
   dataset-wide warnings underneath. Do not print the underlying
   JSON unless the user asks.
5. Include a `suggested_fix` on any recommendation that has a concrete,
   testable replacement expression. Validate every `suggested_fix`
   expression with `narrative_nql_validate` first.
6. Flag a mapping whose attribute a derivation rule reaches from
   another mapping on the dataset, whatever columns it reads, using
   the `derivations` lines from step 1. Recommend deleting it: the rule already gives the
   dataset that attribute, and the stored mapping replaces the rule.
   The rules skill's "Map the source of a derivation" section
   (`../rosetta-stone-mapping-rules/SKILL.md`) says when a direct
   mapping is still right.

## Improve a single mapping expression

If the user pasted an expression and feedback (e.g., "lowercase the
emails, our match rate is bad"):

1. Pull the existing sample via
   `narrative_datasets_describe(dataset_ids: [<id>], include: ["sample"])`
   so you can see what the relevant column actually contains. Only
   enqueue a fresh `narrative_dataset_request_sample` if the existing
   sample is stale or missing.
2. Generate a single revised expression.
3. Validate it: wrap as a select and call `narrative_nql_validate(nql: ...)`.
   If it fails, fix and revalidate.
4. Show the user the revised `expression`, its `confidence`, a one-line
   `reasoning`, and any `warnings`. Keep it terse — one expression,
   one paragraph of justification. No JSON envelope.

Do not re-run the full generation flow for a one-line improvement.
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 194kUpdated Claude CodeCodexVerifiedInstall