/computational-research:project-provenance runs instead · from computational-research
Records the prompts/intent behind generated artifacts (notebooks, code, wiki articles, work items) in an append-only ledger and embeds back-pointers. Off by default; toggled per project in CLAUDE.md.
This skill never runs in Claude Code
It ships in computational-research at skills/, but /computational-research:project-provenance (a command, or a skill Claude Code finds first) has the same name: typing it, or Claude choosing it, runs that one instead.
Record what was asked to produce a generated artifact.
The plugin already records who generated code (git Co-Authored-By trailer) and what changed (Wiki/Status.md, Work ## Progress).
Provenance fills the remaining gap: the originating prompt/intent behind each artifact.
This mirrors the existing ## Recover convention (see wiki-add-resource): plain markdown, git-tracked, machine-readable, no database.
It is optional — nothing here runs unless the project toggle is on, except § Document provenance, which every revised document keeps.
/project-provenance.When the toggle is on and an artifact is generated:
Wiki/Prompts.md (§ The central ledger).Provenance is opt-in per project, declared in the project's CLAUDE.md:
## Provenance
Prompt tracking: **off**
<!-- When on, generated artifacts record their originating prompt/intent in
Wiki/Prompts.md and carry an embedded back-pointer. See the `project-provenance` skill. -->
Before recording anything, check the toggle:
grep -qiE 'prompt tracking:[[:space:]]*\*{0,2}on' CLAUDE.md && echo on || echo off
Wiki/Prompts.md, never embed back-pointers.
Stay silent — do not nag the user to turn it on.To flip the toggle, edit the Prompt tracking: line in CLAUDE.md (and seed Wiki/Prompts.md the first time it goes on — see Turning it on).
One small set of fields, reused in the ledger and in every embedded back-pointer:
| Field | Meaning |
|---|---|
date | Absolute YYYY-MM-DD (from the current date). |
artifact | Path relative to project root (Code/Artifacts/Ricci_260919.nb, Code/Curvature.wl). |
intent | One-line distilled goal. Always present. |
prompt | Verbatim user request. Optional — include when short, or when the user asks. |
generator | The skill that produced it (notebook-create, wiki-update, …). |
model | Model id (e.g. claude-opus-4-8). |
source | Notebooks only: the .md source path beside the notebook. |
Fidelity: default to a concise one-line intent.
Add the verbatim prompt when the request is short, reproducibility matters, or the user asks for it.
Do not paste long conversational text into the ledger.
Wiki/Prompts.mdAppend-only, newest at the bottom (matching the Work ## Progress convention).
One ### block per generation event:
# Prompt Ledger
Append-only record of the prompts/intent behind generated artifacts.
Toggle in CLAUDE.md (`Prompt tracking`). See the `project-provenance` skill for the format.
### 2026-05-29 — Code/Artifacts/RicciCurvature_260529.nb
- **Intent:** Explore Ollivier–Ricci curvature on graphs with pastel plots
- **Prompt:** "make a notebook about ollivier ricci curvature on graphs"
- **Generator:** notebook-create · claude-opus-4-8
- **Source:** Code/Artifacts/RicciCurvature_260529.md
Omit lines that don't apply (e.g. no Source: for a .wl file; drop Prompt: when you're only keeping the distilled intent).
Register the ledger once in Wiki/Index.md under a ## Prompts section:
## Prompts
- [Prompt Ledger](Prompts.md) — prompts/intent behind generated artifacts
In addition to the ledger entry, embed provenance inside each artifact so it survives when the file is shared standalone.
Write a leading HTML comment into the artifact's .md source.
HTML comments are dropped by the {"Markdown","Notebook"} importer, so they never become cells:
<!-- provenance:
intent: Explore Ollivier–Ricci curvature on graphs
prompt: "make a notebook about ollivier ricci curvature on graphs"
generator: notebook-create
model: claude-opus-4-8
date: 2026-05-29 -->
# Ollivier–Ricci Curvature
The comment is the durable record; the generated .nb mirrors it in TaggingRules under the "Provenance" key — Wolfram's native, non-rendering metadata slot.
Who injects it depends on the generation path:
ExportString with the merge helper below.Scripts/generate_notebooks.wls): the script parses the comment and injects it itself — do not pre-strip the comment or write TaggingRules by hand there.When the comment is absent, the .nb is generated exactly as before (no "Provenance" key).
See notebook-create.
TaggingRules is a shared slot — merge by key, never replace the option.
paper-create-notebook stores its per-cell fingerprint there under the "ResearchNotebook" key, so a writer that sets a literal TaggingRules -> {...} erases the other key.
Every writer stamps through this helper (canonical here; verified to survive the ExportString/ImportString round-trip with both keys intact):
stampTaggingRule[ nb_Notebook, key_String -> value_ ] :=
With[ { existing = Replace[ TaggingRules /. Options[ nb ], TaggingRules -> {} ] },
Notebook[ First @ nb,
Sequence @@ FilterRules[ Options[ nb ], Except[ TaggingRules ] ],
TaggingRules -> Normal @ Append[ Association @ existing, key -> value ] ]
]
stampTaggingRule[ nb, "Provenance" -> prov ] adds or updates the provenance without touching any other TaggingRules key or notebook option; stamping only touches options, so an already-computed cell fingerprint stays valid.
To read it back from a notebook:
"Provenance" /. (TaggingRules /. Options[Import["Code/Artifacts/Name_260919.nb"], TaggingRules])
Kernel/*.wl, Code/*.wl)A header comment above the file or the function:
(* Provenance: 2026-05-29 · intent: Wasserstein-1 distance on graphs
ledger: Wiki/Prompts.md *)
A ## Provenance section at the bottom of the article, mirroring ## Recover:
## Provenance
- Intent: ...
- Generated: 2026-05-29 · wiki-update · claude-opus-4-8
- Ledger: Wiki/Prompts.md
Work/<bucket>/<Name>.md)Capture the originating request in the Spec; each session's prompt goes to the ledger, not the item file:
## Prompt history: the verbatim request that prompted the item, dated, plus any later user request that reshaped it (older items carry an Origin: line in ## Spec instead).Wiki/Prompts.md: one ledger entry per session, which the item's ## Progress line links.
The item file carries no Prompt: field — one fact, one destination (see backlog-add, The item file format).When the user asks to enable provenance:
Prompt tracking: **on** in the project's CLAUDE.md (add the ## Provenance section if absent).Wiki/Prompts.md with the header shown above (if it doesn't exist).## Prompts entry to Wiki/Index.md.To disable, set Prompt tracking: **off**.
Leave existing entries in place — they are part of the git history.
When the user wants to record provenance for something just produced (or an older artifact), append a ledger entry and add the matching embedded back-pointer using the rules above. Distil the intent from the conversation; include the verbatim prompt only if it's short or requested.
A document under revision remembers how it was revised.
This is separate from the toggle above and is always on: every document a revision round works on has a provenance file, whatever the toggle says.
The ledger records the prompt behind each artifact; a document's provenance file records what the user asked of that one document, where, and what came back.
document-revise writes it during a round; the generating skills write its first request.
One per stem, beside the document: Note_260927.provenance.md beside Note_260927.tex, Note_260927_2.tex, …
A folder-shaped artifact keeps it beside the folders, as Name_YYMMDD.provenance.md.
k+1./project-clean leaves it in place, so it stays in view beside the latest version.# Note_260927 — provenance
## Rules
- Write "it is shown", never "we show". *(r2, H1–H4)*
- Example graphs have at most 10 vertices. *(r3, N2)*
## Requests
- 2026-09-27 — "make a note on geodesic pools" *(v1, paper-create-note)*
- 2026-09-28 — "proofs shorter everywhere" *(chat, before r3)*
## Rounds
### r3 — 2026-09-28, v2 → v3
- N1 · `Note_260927_2.md` L41–47 (Example 2) · "make this example smaller" → 6-cycle
- N2 · L88 · "cite the source" → not done, no source in Resources/
- H1 · L12 · "we show" → "it is shown"
## Rules — a short list, one imperative line each, ending with where it came from.## Requests — what the user asked about this document outside its notes, dated: the request that produced version 1 first, then each chat request, with when it came.## Rounds — one entry per round, newest at the bottom: r<k+1> is the round that wrote version k+1 from version k.Each line of a round is one note (N) or one hand edit (H), numbered from 1 within the round, so r3 N2 names one note for good:
| Field | Meaning |
|---|---|
| file | the file the lines belong to, written once per round and then left out |
| lines | L41–47 in version k as the user left it; after L52 for something added between lines; L? when unknown |
| passage | the passage it was about, quoted or named ("Example 2"), so the record still reads after lines move in later versions |
| text | the note's words, or the hand edit as before → after (a one-line summary for a long one) |
| outcome | for a note, what was done, or not done and why |
The skill that generates a document starts its provenance file:
<stem>.provenance.md with an empty ## Rules, one line under ## Requests — the date, the user's request in their words (shortened if long), and (v1, <skill>) — and an empty ## Rounds..tex, .typ, .md, code), the .md source of a notebook, and the provenance file, staged by name; never a generated .nb.
This commit is the baseline that hand edits of a text file are measured against.no baseline in the file's ## Requests line; the first round then records edits as no baseline.Which lines a note is stored against:
.tex, .typ, .md, code): lines of the file itself..nb.
Each generated cell carries its source line range in its own TaggingRules, as "SourceLines" -> { first, last }, stamped at generation by SourceLineNotebook in scripts/source_lines.wl; CellSourceLines[ cell ] reads it.
A Markdown block that converts to several cells — a paragraph holding a display equation, a list item with a nested one — gives each of them the block's range.
Head cells built from the frontmatter, the [ LLM Generated ] line and embedded Outputs carry none.
A note in a cell maps to that cell's lines; a note in a cell the user added maps to after L<n>, the last line of the cell above it.
A notebook generated before cells carried line ranges has none: its notes are anchored by quoted passage only, with L?.What the user changed by hand, found without asking them:
.md holds what Claude wrote, so both sides of the edit are known.
No git is needed.git diff between version k as Claude committed it and the file as the user left it, taken before the round commits version k.k was never committed as written, or a notebook without fingerprints: the round records H · no baseline and draws no rules from edits.A note is not a hand edit, but both of these report it as one: the git diff holds every line the user added a note on, and the fingerprint marks every annotated cell as edited.
Take the notes out before deciding.
A diff line that is only a note is not an edit; a cell is hand-edited only when its content with each note deleted — StringReplace[ s, " "... ~~ "<<" ~~ Shortest[ ___ ] ~~ ">>" -> "" ] on its strings, and a string left empty dropped from its TextData — still misses its recorded hash.
A rule is what keeps a correction from being needed twice.
## Rules differs from its last commit — is theirs (document-revise § Protected content) and is not reworded or dropped on Claude's initiative.Each round reads ## Rules and the last two rounds first, records its notes, hand edits and requests, and checks the new version against every rule and every earlier hand edit before writing it — the steps are in round.md.
Out of scope: memory across unrelated documents, and any database.
These skills check the toggle and, when on, record provenance in this format:
TaggingRules itself via stampTaggingRule; on the batch fallback the script propagates the comment.TaggingRules -> { "Provenance" -> prov } through MathNotebookDocument, and the later fingerprint stamp merges its "ResearchNotebook" key alongside it.## Provenance section to newly generated articles and a ledger entry.## Prompt history; each session's prompt goes to the ledger, and the ## Progress line links it.This skill is the single source of truth for the format — the others reference it rather than redefining it.
Wiki/Status.md already carry those.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
computational-research@WolframInstitute is listed by wolframinstitute/claudepluginmarketplace — review the source before installing
npx claudepluginhub wolframinstitute/claudepluginmarketplace --plugin computational-research30 skills in this plugin
/backlog-addCreate and manage work items in the top-level Work/ folder — each a multi-session effort with a Spec (what to build), a Tasks checklist (one task ≈ one session), and a Progress log. This is the project's execution state, separate from the Wiki knowledge base. Use for: "new work item", "start a work item", "spec out X", "plan for X", "break X into tasks", "track this across sessions", "add a task", "update the spec", or the /backlog-add command. Creates Work/Backlog/<Name>.md, bootstrapping the folder if missing. A work item's status is its folder (Backlog/Ready/Active/UnderReview/Done/Dropped), not a field. Specs follow the document-revise protocol; shaping one together with the user over a long sitting is the backlog-refine skill. Do NOT trigger on casual uses of the word "work".
/backlog-autolabWork the Work/ backlog autonomously from an ordinary chat, where the operator can watch it: this chat becomes the orchestrator and dispatches one background subagent per task, each a cold backlog-run run in the item's own git worktree on work/<Item>, visible live in the Agent map and steerable by message. Settles permissions in one preflight before the operator leaves, queues several eligible items, verifies every task the way backlog-run-scheduled does, halts only the item that fails, and ends with a digest per item. Use when the user says "autolab", "run the backlog", "let the agents work the backlog", "work these items autonomously here", "work the queue while I'm away", or runs /backlog-autolab.
/backlog-boardPublish and sync the work board — a private claude.ai page, readable on a phone, that shows every Work/ item under a root (one repo or a folder of repos): what needs the user, what is under review, active, ready and in the backlog, each item rendered and clickable. On the page the user edits the human sections, approves moves (Backlog → Ready, Accept, Send back), leaves notes, files new items and asks Claude about an item; those changes wait on the page until a session syncs them into the files. Use for: "sync the board", "refresh the board", "publish the board", "set up a board", or the /backlog-board command. Never on a timer — a sync is always the user's request.
/backlog-infoGo through the whole Work/ backlog with the user: read every item in Backlog/, Ready/ and UnderReview/ and every work/<Item> branch, and report what waits on the user (a review, a halted run's question, a Waiting-on line, queued board changes), what is stale (no Progress for a month, or a premise the code no longer has), which items overlap, and what to refine, merge, split or drop next. Changes nothing until the user says so; then each move is a git mv and an index update. Never moves an item to Ready and never syncs the board. Use for: "go through the backlog", "backlog info", "what's in the backlog", "what waits on me", "clean up the backlog", "what next", or the /backlog-info command. Not for shaping one item (backlog-refine) or reviewing a finished one (backlog-review).
/backlog-refineShape a Work/Backlog item together with the user over a long sitting until it is ready to be worked — the user writes the human parts (Summary, Motivation, Acceptance criteria, any detail they care about) in their editor, while the LLM researches the code and wiki, writes the Technical details, keeps a list of open questions, and proposes the tasks and their routing. Ends with a readiness check and, on the user's word, the move to Work/Ready/ where /backlog-run-scheduled may pick it up. Use for: "refine X", "let's work on the backlog", "shape this item", "backlog refinement", "get X ready", or the /backlog-refine command. Not for executing tasks (backlog-run) or filing a quick new item (backlog-add).
/backlog-reviewReview a finished Work/ item with the user: find it in Work/UnderReview/ or on its unmerged work/<Item> branch, show the run digest, walk the Acceptance criteria one by one with the test instructions of the tasks that serve each, run the checks that can be run, and end on the user's verdict — accept (merge the branch, item to Done/) or send back (merge the branch, a new task from the user's words, item to Active/). Nothing is fixed during the review. Use for: "review X", "review the item", "check the finished item", "accept X", "send X back", "merge the item branch", or the /backlog-review command. Not for running tasks (backlog-run) or going through the whole backlog (backlog-info).
Other plugins' skills for the same job