/workflows:expert-productionfrom workflows
Packages code, data, and workpapers behind an expert report into a verifiable production archive (7z) with a runbook, manifest, and computed closure for court or counsel delivery.
Ships in workflows. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
work with a computed gateWhat this skill carries — grep references/ for any subject the names below miss:
!d=${CLAUDE_SKILL_DIR}; command -v skill-toc >/dev/null 2>&1 && exec skill-toc "$d"; s=$HOME/.claude/skills/plugin-utils/bin/skill-toc; [ -x "$s" ] && exec "$s" "$d"; echo "(skill-toc unavailable: references and scripts are NOT listed here — install the plugin-utils plugin, or start a new session so its bin/ reaches PATH)"
The lifecycle is work. Read it and follow it.
This file is a delta: the CLARIFY axes, the production SPEC, the task rows, the lens, the one
mechanical entry point, the refs and the authority text. It ships no workflow.js.
The package is judged by one command, never by the agents that built it.
package-check.sh rebuilds the 7z from the stage,
extracts it fresh and runs four legs over the extraction — archive, code, leak, rerun — on
the production SPEC at the sha256 the approved plan records. Its exit code is the whole mechanical
verdict; the lens judges only what no exit code decides. Every SPEC key, the MANIFEST.csv format
and the runbook command block: references/production-spec.md.
Work in production/ in the analysis repo, gitignored:
| path | holds | ships |
|---|---|---|
production/<name>/ | the stage: code/ (the closure and its pinned environment), data/, figures/, the workbook, the runbook PDF, README.md, MANIFEST.csv | as the archive's one top folder |
production/<name>.7z | the archive, beside the stage, never inside it | yes |
production/<name>-runbook/ | the runbook Markdown and its screenshots | never |
production/<name>.spec.json | the production SPEC, the gate's input | never |
Scope is the computed closure. Walk the import graph from the SPEC's entry_scripts and ship
that closure, the processed data it reads, the figures the deliverable uses, the workbook and the
runbook PDF; nothing else is owed. Delete superseded exhibits, alternate versions and the code that
builds them. Shrink a config shared with another study to the constants the shipped code reads.
Never explain an omission: the explanation names the thing.
Final work product only. Ship nothing that records how the result was reached: no drafts, prompt
iterations, agent reports, working notes, batch or job ids, or names of RAs and staff. The replay
set — the decisions file, the manifest/ dir and the replay command
(references/replay.md) — is internal: ds runs it as
its R1 check, and it never ships. Strip every comment and docstring from the packaged code with
strip_code.py, never a regex; never touch the repo's
own code.
Processed data, never raw. Ship the processed tables the packaged code loads (CSV or parquet). Raw sources — filings, downloaded corpora, vendor extracts — stay out; the runbook says how to retrieve them. Never ship one table in two formats.
7z, never zip. Zip stores mtime at two-second resolution with no timezone. Build with
bsdtar --format 7zip, one top folder named for the production.
Stage with cp -p; MANIFEST.csv is the last write. Only stripped or rewritten files carry a
staging mtime. Run manifest.py after the last change to
the stage; the archive leg checks every row against a fresh extraction, never against the stage.
Never run, lint or test inside the stage. A __pycache__, .ruff_cache or .pytest_cache
there fails the archive leg; copy the stage elsewhere to try it.
Scrub every metadata field but the two dates, inside the build. Keep the creation and
modification dates; strip author, title, generator and OS strings, PDF Info and XMP, OOXML
docProps and PNG text chunks. Scrub after the last generation step and before the manifest:
scrub_metadata.py for the workbook and PNGs;
build-runbook.sh scrubs its own PDF. Fix a generator that stamps a fixed creation date (python-docx
does) in the build, never in the scrub.
Timestamps are not proof. File mtimes, the manifest column, dcterms:created and the PDF
CreationDate are the producing party's own assertion: never call them proof of when work was done,
to the client or in a declaration. Anchor time with a party that has no stake — a hash stated in a
filed document; a DKIM-signed email, for what actually arrived; an RFC 3161 token over the archive's
sha256 from a public TSA (openssl ts -query, the .tsr kept beside the archive), sent only with
the user's approval and never with the file. Git commit dates are not an anchor.
Redact by destroying pixels. Crop, or paint the raster with a solid fill before it enters the
document (magick raw.png -fill '#fff' -draw 'rectangle x1,y1 x2,y2' out.png). A box drawn over an
image or text still extracts with pdfimages or pdftotext, and pixelation over a known font is
recoverable. Keep the raw capture outside the stage and the runbook dir.
Build it with the xlsx skill: one tab per processed table, then computation tabs recomputing every
headline number with LIVE formulas (COUNTIFS, SUMPRODUCT) over those tabs, never a typed value.
Zero formula errors; every total equals the deliverable.
When a deliverable value differs from what the code produces, the row carries a
Hand-checked against the filing flag column and a Filing quote (hand check) column filled from
that decision's quote field in the internal decisions file — the quote only, never its reason,
decider, date, decision id or pipeline value. List each entity the deliverable excludes as
Not counted (hand-checked). Never copy the decisions file into the package.
The short path to reproduce the deliverable from the shipped data first, then the provenance table: one row per figure and headline number, naming the number, the script or function computing it, its input file and that file's row count. Read every value off the staged data, never out of the report.
A minimal, final PDF for a competent computer user who does not program:
runbook_source and build the PDF with
build-runbook.sh. Ship no .md or .typ copy.command, with no comments and paths
relative to runbook_cwd, never a home path.work's Phase 1, on these axes, before any reconnaissance. Each answer becomes a SPEC key:
.py that only a shipped
.sh runs is one of them), where their local imports live, the third-party modules they need,
and the repo file each packaged .py comes from → entry_scripts, python_paths,
third_party, sources.name.extra_files.workbook.¶ and footnote cites, any username besides $USER → leak_terms,
usernames.reruns. Refuse "none": an empty reruns
fails the gate.Take work's remaining axes as work states them, with three bindings: observable success is
package-check.sh; the review surface is Phase 5's; skip the agent-team axis, since the run writes.
Do not plan until every SPEC key has an answer.
work's Phase 2. Open the plan with frontmatter workflow: expert-production, so a context clear
at approval resumes here. Three domain additions:
EnterPlanMode at production/<name>.spec.json, every key per
references/production-spec.md. Never under the plans directory, which holds only the plan, and
never in any task's writablePaths: an implementer that could edit it could edit what judges it.--spec-sha256 argument of the one
mechanical check, so approving the plan approves the SPEC.refs and a redDisposition. Run
sizing: 4 implementers + 4 verifiers + 1 lens = 9 agents.work's Phase 3 unchanged.
Put the args in the plan's <!-- work:dispatch --> block and dispatch with work's own
work-dispatch.sh, never a hand-written runner line, which skips its plan-lint and probe gates.
work owns the wait and the result handling; work-result.sh reads the verdict.
bash ${CLAUDE_PLUGIN_ROOT}/skills/work/scripts/work-dispatch.sh # armed plan; or pass one
bash ${CLAUDE_PLUGIN_ROOT}/skills/work/scripts/work-dispatch.sh --provider codex # "run this through codex"
Forward a provider named in $ARGUMENTS, however it is spelled, as --provider <name>.
const projectDir = /* the analysis repo */
const goal = /* one sentence */
const specPath = /* absolute path of production/<name>.spec.json */
const specSha = /* its sha256, recorded in the plan */
const stage = /* the SPEC's stage, relative to projectDir: production/<name> */
const archive = /* the SPEC's archive, relative to projectDir: production/<name>.7z */
const runbookDir = /* the dir holding the SPEC's runbook_source, relative to projectDir */
const workbook = /* the SPEC's workbook */
const runbookPdf = /* the SPEC's runbook_pdf */
const args = {
projectDir,
goal,
// The plan's table verbatim. Every row carries refs and a redDisposition.
tasks: [
{ id: "T1",
name: "stage the code closure",
work: "Walk the import graph (ast) from the SPEC's entry_scripts, resolving local imports against its python_paths, and stage exactly that closure plus the pinned environment file (pixi.toml and pixi.lock, or requirements.txt) under the stage's code/ dir with cp -p. Reduce a shared config to the constants the shipped code reads. Then strip every staged .py with `python3 -I ${CLAUDE_PLUGIN_ROOT}/skills/expert-production/scripts/strip_code.py --in-place <files>`, which keeps a __doc__ assignment for a module that reads __doc__ and refuses a file that would not parse. Never run, lint or test the staged copy in place, and never edit the repo's own code.",
writablePaths: [`${stage}/code/`],
acceptance: "Every .py under code/ is reached by the import walk from an entry script, every local import in code/ resolves to a file under code/, and no staged .py holds a COMMENT token (a line-1 shebang aside) or a docstring.",
redDisposition: "no-behaviour: a staged artifact; package-check.sh judges the package whole",
refs: ["${CLAUDE_PLUGIN_ROOT}/skills/expert-production/SKILL.md",
"${CLAUDE_PLUGIN_ROOT}/skills/expert-production/references/production-spec.md"] },
{ id: "T2",
name: "stage processed data, figures and the workbook",
work: "Copy with cp -p the processed tables the closure loads (the SPEC's extra_files) into data/ and the figures the deliverable uses into figures/: never a raw source, never one table in two formats. Build the workbook with the xlsx skill per this skill's workbook rules: one tab per processed table, live formulas recomputing every headline number, zero formula errors, totals equal to the deliverable. Where the deliverable departs from the code's output, fill the 'Hand-checked against the filing' flag and the 'Filing quote (hand check)' column with that decision's quote alone, read from the internal decisions file, and list each excluded entity as 'Not counted (hand-checked)'. Never copy the decisions file. Last, scrub the workbook and every PNG with `uv run ${CLAUDE_PLUGIN_ROOT}/skills/expert-production/scripts/scrub_metadata.py <files>`.",
writablePaths: [`${stage}/data/`, `${stage}/figures/`, `${stage}/${workbook}`],
acceptance: "Every extra_files path exists in the stage; each headline number is a cell holding a formula in the workbook's sheet XML, and no cell holds #REF!, #DIV/0!, #VALUE! or #NAME?; the workbook's docProps/core.xml holds only dcterms:created and dcterms:modified.",
redDisposition: "no-behaviour: a staged artifact; package-check.sh judges the package whole",
refs: ["${CLAUDE_PLUGIN_ROOT}/skills/expert-production/SKILL.md",
"${CLAUDE_PLUGIN_ROOT}/skills/expert-production/references/production-spec.md",
"${CLAUDE_PLUGIN_ROOT}/skills/expert-production/references/replay.md"] },
{ id: "T3",
name: "write and build the runbook",
work: "Write the runbook Markdown at the SPEC's runbook_source, its screenshots beside it, per this skill's runbook rules: each command alone in a fenced block whose info string is command, paths relative to runbook_cwd. Crop or paint redactions into the raster before embedding. Build the PDF into the stage with `bash ${CLAUDE_PLUGIN_ROOT}/skills/expert-production/scripts/build-runbook.sh --source <runbook_source> --out <stage>/<runbook_pdf> --date <production date>`, which wraps long commands, compiles with Typst and scrubs the metadata. Neither the Markdown nor the screenshots ship.",
writablePaths: [`${runbookDir}/`, `${stage}/${runbookPdf}`],
acceptance: "The runbook PDF exists in the stage, pdfinfo prints no Title, Author, Creator or Producer line for it, and every command block of the runbook source appears in its pdftotext output once whitespace and backslash continuations are joined.",
redDisposition: "no-behaviour: a staged artifact; package-check.sh judges the package whole",
refs: ["${CLAUDE_PLUGIN_ROOT}/skills/expert-production/SKILL.md",
"${CLAUDE_PLUGIN_ROOT}/skills/expert-production/references/production-spec.md"] },
{ id: "T4",
name: "README provenance table, MANIFEST and archive",
work: "Write README.md per this skill's README rules: the short path first, then the provenance table, one row per figure and headline number with the script or function, the input file and its row count, each read off the staged data and never copied from the report; nothing about work outside the deliverable. Then, as the last write to the stage, run `python3 -I ${CLAUDE_PLUGIN_ROOT}/skills/expert-production/scripts/manifest.py <stage>`, and build the archive with `bsdtar --format 7zip -cf <archive> -C <stage parent> <name>`.",
writablePaths: [`${stage}/README.md`, `${stage}/MANIFEST.csv`, archive],
acceptance: "README.md holds a provenance table with a row-count column; MANIFEST.csv has the header path,bytes,sha256,modified_utc and exactly one row per staged file but itself; bsdtar -tf on the archive lists a single top folder named for the production.",
redDisposition: "no-behaviour: a staged artifact; package-check.sh judges the package whole",
dependsOn: ["T1", "T2", "T3"],
refs: ["${CLAUDE_PLUGIN_ROOT}/skills/expert-production/SKILL.md",
"${CLAUDE_PLUGIN_ROOT}/skills/expert-production/references/production-spec.md"] },
],
// ONE entry point: four legs, none short-circuiting; a new deterministic check is a leg of
// package-check.sh, never a second entry. The sha256 is the literal the plan records.
mechanicalChecks: [
{ name: "production",
cmd: `bash ${CLAUDE_PLUGIN_ROOT}/skills/expert-production/scripts/package-check.sh --spec ${specPath} --spec-sha256 ${specSha}` },
],
// One lens after verification and the gate: only the residue no exit code decides.
// Both texts live in ${CLAUDE_PLUGIN_ROOT}/skills/expert-production/presets.json, expanded at dispatch; an `extra` string on either carries plan-specific additions. The lens `refs` repeat the preset's so wc-probe P7 can resolve them.
lens: { preset: "expert-production",
refs: ["${CLAUDE_PLUGIN_ROOT}/skills/expert-production/SKILL.md",
"${CLAUDE_PLUGIN_ROOT}/skills/expert-production/references/production-spec.md"] },
authorityExtra: { preset: "expert-production" },
verifierAgentType: "Explore",
}
Pin verifierAgentType and the lens agentType to Explore: no Edit and no Write, so a judge
cannot modify the package it judges, and Bash stays for unzip, pdftotext and pdfimages. Leave
implementerAgentType unset: the rows copy, strip, build and scrub with scripts, and no custom
prompt, hook or preloaded skill justifies an agent.
Handle the result per work's Phase 4; mechanicalThatFailed names production, and its
leg <name> exit=<n> lines name the failing leg.
work's Phase 5, with two bindings.
Review before transmission. A sent production cannot be recalled, which is the irreversible case
work reserves review-before-delivery for.
Review the extracted archive plus a findings file, never a repo diff. The stage is gitignored,
so -w returns unreviewed. Extract the archive the gate rebuilt into a fresh review folder, write
work's read-only findings file into the same folder, and open both with one --file:
V=.work/<run-id>/review; mkdir -p "$V"
bsdtar -xf production/<name>.7z -C "$V" # exactly what the recipient will open
# write "$V/findings.md": transcribed from result.json per work's findings-file table
bash ${CLAUDE_PLUGIN_ROOT}/skills/work/scripts/human-review-gate.sh --file "$V" --no-update-check
Write findings.md per work's What the findings file must contain — transcription, not
judgement — with the four leg <name> exit=<n> lines copied verbatim from mechanical[]. Open the
runbook PDF and the workbook beside tuicr. On approved, transmit through counsel's file-transfer
service and confirm receipt; mail filters strip archive attachments.
| Situation | Wrong move | Right move |
|---|---|---|
| About to run, lint or test the staged code | run it in the stage | copy the stage elsewhere first |
A staged file needs a fix after MANIFEST.csv was written | edit it and move on | edit it, then re-run manifest.py |
| The SPEC needs a change after approval | edit it and dispatch | re-hash it, amend --spec-sha256 in the plan, re-hash the plan; a moved hash is exit 2 |
| About to write the SPEC beside the plan | "it belongs with the plan" | production/<name>.spec.json; the plans directory holds only the plan |
| A deliverable value departs from the code's output | type the decided value into the workbook | flag it Hand-checked against the filing, the quote alone in Filing quote (hand check); an excluded entity is Not counted (hand-checked) |
| About to explain an override in the README or runbook | a sentence on why the value changed | nothing: the flag and the quote are the whole shipped record |
| About to stage the whole repo, or a figure the deliverable does not use | "more is safer" | the closure; delete the figure and the code that builds it |
| Another deterministic check is needed | a second mechanicalChecks entry | a leg of package-check.sh; P10 refuses a second entry |
Something work does not obviously do | write an expert-production/workflow.js | ask which work parameter is missing |
assets/runbook.typ (opens in a new tab)assets/term.typ (opens in a new tab)package.json (opens in a new tab)presets.json (opens in a new tab)references/production-spec.md (opens in a new tab)references/replay.md (opens in a new tab)scripts/build-runbook.sh (opens in a new tab)scripts/manifest.py (opens in a new tab)scripts/manifest_test.py (opens in a new tab)scripts/package-check.sh (opens in a new tab)scripts/package_check.py (opens in a new tab)scripts/scrub_metadata.py (opens in a new tab)scripts/scrub_metadata_test.py (opens in a new tab)scripts/strip_code.py (opens in a new tab)scripts/strip_code_test.py (opens in a new tab)scripts/wrap_commands.py (opens in a new tab)scripts/wrap_commands_test.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Claude Code refuses to install this plugin
As a github or url source: Failed to clone repository: fatal: clone of '[email protected]:edwinhu/bmll-skill.git' into submodule path 'skills/bmll' failed
Checked against Claude Code 2.1.332's install rules. The listing below is what the repository ships; Claude Code cannot install it as published.
86 skills in this plugin
/afkUse when the user says '/afk', 'afk', 'going to bed', 'I'm going to sleep', 'work autonomously', 'work on this overnight', 'don't ask me questions', 'while I'm away', or 'do whatever you think is best'. NOT for questions about overnight returns, rates or anything financial; NOT for asking how the mode works./ai-anti-patternsALWAYS load before finalizing ANY written prose, and whenever text is suspected of being machine-written - "does this sound like AI", "make this sound human", "clean up the AI-isms", "did a bot write this", "check this draft before I send it", "review this for AI tells", "this reads like ChatGPT", "review this for mannered prose", "is this too writerly", "is this student paper AI-generated", or before handing back any draft, memo, email, or article you wrote. Use proactively even if the user never mentions AI writing./Other plugins' skills for the same job