From persist-rp1-artifact
Use when the user has an rp1 artifact under .rp1/work/ (e.g. investigation report, design doc, audit) and wants to publish it as a PR or issue comment instead of committing the file to the repo. Idempotent — re-runs update the same comment in place via an HTML marker. Invoke when the user says "post rp1 artifact to PR", "publish investigation report as a PR or issue comment", "persist rp1 artifact", or runs `/persist-rp1-artifact`.
How this skill is triggered — by the user, by Claude, or both
Slash command
/persist-rp1-artifact:persist-rp1-artifactThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Publish an rp1 artifact (markdown under `.rp1/work/`; frontmatter optional) as a PR or issue comment without committing the artifact file to the repo. Re-running updates the same comment in place.
examples/incomplete-status-input.mdexamples/incomplete-status-output.mdexamples/investigation-report-input.mdexamples/investigation-report-output.mdexamples/lead-split-input.mdexamples/lead-split-output.mdexamples/no-doc-id-input.mdexamples/no-doc-id-output.mdexamples/no-frontmatter-input.mdexamples/no-frontmatter-output.mdexamples/no-summary-input.mdexamples/no-summary-output.mdexamples/routing-only-input.mdexamples/routing-only-output.mdexamples/split-marker-input.mdexamples/split-marker-output.mdreferences/artifact-frontmatter.mdreferences/edge-cases.mdreferences/projection-format.mdscripts/parse_target.pyPublish an rp1 artifact (markdown under .rp1/work/; frontmatter optional) as a PR or issue comment without committing the artifact file to the repo. Re-running updates the same comment in place.
The artifact file is never modified by this skill — it is read-only on the local side, write-only on the GitHub side.
⚠️ Always
--dry-runfirst on a real PR or issueThe skill writes to a real GitHub PR/issue comment by default. Before invoking against a real PR/issue you care about (especially one with active reviewers), always do a dry-run first:
/persist-rp1-artifact <path> [target] --dry-runDry-run runs every step of the procedure except the GitHub write, prints the projected comment body to stdout and a diagnostic block to stderr (telling you whether the next run would
POSTorPATCH), and exits 0. Once the projection looks right, re-run without--dry-runto actually post. This is the v1 safety net while the projection logic is stabilizing.
/persist-rp1-artifact <path> [target]..rp1/work/ and unrelated to rp1). This skill publishes rp1 artifacts; frontmatter is optional, but the file should be an rp1 work product.| Arg | Required | Default |
|---|---|---|
<path> | yes | — |
[target] | no | current branch's open PR (gh pr view --json number -q .number). May be a PR or issue number, or a full GitHub PR/issue URL. |
--dry-run | no | false (real post). First-time runs on real targets should pass --dry-run first. |
--force | no | false. See references/edge-cases.md. |
The whole procedure runs as one command — scripts/publish.py. Set SKILL_DIR
to this skill's directory (the folder containing this SKILL.md), then invoke:
python3 "$SKILL_DIR/scripts/publish.py" <path> [target] [--dry-run] [--force]
That single process does everything: pre-flight checks → resolve the PR/issue
target → project the comment body → find any existing comment for this artifact →
POST or PATCH (or, under --dry-run, print the body + diagnostic and stop).
Run the one command. Do not re-implement these steps inline. The procedure threads state across steps — the projected body, the idempotency
doc_key, the chosenaction, the target comment id, and the target's metadata. SeparateBashcalls each get a fresh shell, so hand-assembling the steps drops that state and leads to re-calling the helper scripts with the wrong arguments.publish.pyexists precisely to hold that state in one process. Pass the user's args straight through to it; read its output; relay the result.
gh present, gh auth ok, artifact file exists. A path outside
.rp1/work/ is a warning, not an error (the path-based key still works).target → current branch's open PR; a number or URL →
parsed via scripts/parse_target.py (bare numbers are probed for PR-vs-issue).
Closed/merged PRs and closed issues are gated behind --force.scripts/project.py turns the artifact into the byte-exact
comment body and computes doc_key (rp1_doc_id, else path:<relative-path>).
The split between the visible Executive Summary and the folded "Full artifact"
is chosen by a deterministic ladder; an author can override it by placing a
<!-- rp1:split --> line in the artifact (invisible when rendered) — content
before it is the summary, content after it is folded. Over the 65 KB cap →
hard error.<!-- rp1-artifact: <doc_key> -->, then apply the decision table — 0 → POST,
1 mine → PATCH, 1 foreign → refuse (unless --force), ≥2 → refuse (always).--dry-run prints the diagnostic (stderr) + body (stdout)
and exits 0; otherwise it POSTs/PATCHes via gh api -F body=@- and prints a
confirmation with the comment URL.=== persist-rp1-artifact (dry run) === block
(artifact, doc key, target, size, would-POST-or-PATCH); stdout carries only the
projected body, so --dry-run | diff expected.md - works. Relay the diagnostic
and surface any WARNING: lines (summary-ladder rung, orphaned comment, stale
mtime, path outside .rp1/work/).✓ Posted|Updated … block names the action, the PR/issue, and
the comment URL. Relay it verbatim.The per-arg semantics and every guard rail are specified in references/edge-cases.md.
references/artifact-frontmatter.md — required/optional frontmatter fields, parsing implementation, title derivation rule.references/projection-format.md — exact comment template and fill-in rules. The output is byte-deterministic.references/edge-cases.md — re-run dedup logic, error table, --force/--dry-run semantics.The examples/*-input.md ↔ examples/*-output.md pairs are byte-exact golden tests
for scripts/project.py (run by tests/test_project.py). The orchestration decisions
in scripts/publish.py — the marker match, POST/PATCH/refuse table, dry-run diagnostic,
soft orphan detection — are unit-tested in tests/test_publish.py with gh never
called. After any change to the projection or orchestration:
python3 -m unittest discover -s skills/persist-rp1-artifact/tests
A failing golden test means the projection drifted from the contract — fix the script, not the fixtures.
The contract this skill implements lives in references/ (artifact frontmatter, projection format, edge cases). See the README for the high-level design rationale.
Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.
Applies a firm's KYC/AML rules grid to parsed onboarding records: assigns risk rating, checks required documents, outputs rule outcomes with citations, and routes for escalation.
Generates daily or weekly digests of activity from connected sources (chat, email, docs, tasks, CRM), highlighting action items, decisions, mentions, and project updates.
npx claudepluginhub anvilco/persist-rp1-artifact --plugin persist-rp1-artifact