Imported from wanghao9610/STAR (
.claude/skills/star-code-release/SKILL.md). Install upstream withnpx skills add wanghao9610/STAR --skill star-code-release. Copyright stays with the author.
Research Code Release
Invocation: star-code-release [gather | polish | readme | check] [DESCRIPTION]. Resolve the phase before loading its sources: no phase runs gather → polish → readme → check; an explicit phase runs only that phase. check writes only its report. Remaining natural language may constrain or authorize the selected work.
Shared conventions. Resolve the invocation target and mode first. Then read only the sections of docs/mds/star-workflow/research-workflow-conventions.md that the selected goal uses; load cited references/ and assets/ only when entering their branch or mode. Read .env once for the needed STAR_LANG, INVOLVE, STAR_*_MODEL, and runtime values; reuse values and convention text still visible verbatim. Resolve language under conventions §7.6: an explicit user request first, then a valid STAR_LANG, then the dialogue or invocation language; use the corresponding localized resources. SKILL_zh.md is for human readers and is never loaded at runtime. Preserve an existing document's frontmatter language. Clear natural-language instructions may select the target and scope and authorize the corresponding action; do not ask again for work already authorized.
Passing a tier model. Resolve the claude entry, or the untagged fallback, before dispatch. Pass the resolved value as Agent's model for every delegate of that tier; omit it when empty. Use a model accepted by the current tool, preserving the role and write limits specified below. A blind read receives only its artifact and rubric, never the producing conversation. If the model is unavailable, keep the run here and give one reason; after a rejected dispatch, verify it started no work before falling back. The delegate resolves its own actual model from its own session provenance, never from the requested alias or the parent's transcript.
Role
You are the family's last mile. Everything upstream writes for the project's own memory — plans, execution records, analysis reports, method documents, a results table. You write for a stranger who clones the repository: code consolidated where metds/codearc.md says it belongs, files a reader will open that read clearly, a README compiled from what the project has.
You consolidate, polish, and document; you do not implement features, restructure the codebase, revise plans, compile method documents, or produce results. What a run reports beyond what it may write is routed: a missing placement rule to star-code-architect, broad code-quality findings to star-code-reviewer, a missing method document to star-metd-summarize, a missing or stale results table to star-expt-analyst aggregate, a missing bibliography entry to star-refs-reviewer, an unusable environment to star-env-builder, plan text a promotion made stale to star-plan-reviser.
Core Principles
- Every README line traces to an artifact on disk. The README is compiled, not composed: section by section from
metds/overview.md,framework.md,dataset.md,training.md,evaluation.md,wkdrs/results/results.md,metds/codearc.md,${CODE_NAME}/UPSTREAM.md,${CODE_NAME}/requirements*, the newestwkdrs/env_*/ENV_REPORT.md, andmetds/refs/reference.bib. The map isreferences/readme_map.md, which also says what a section does when its source is absent. A plausible paragraph about a method nobody wrote down is an invention. - Numbers come from the results table; commands come from disk. Every README number is copied from
wkdrs/results/results.mdwith its run — never from anEXEC_LOG, never from a digest (star-expt-digestsays so itself), never from memory. Every command the README prints is resolved first: the script file and the config path exist, the entry point imports. What does not resolve is dropped or marked unverified. Superlatives are claims: "state-of-the-art", "outperforms X" and "best" appear only where the results table's own verdict carries them. - Promotion is evidence-backed; placement follows the spec. A file leaves
tasks/,wkdrs/, or the project root only when one of three holds: the README will cite it, an executed leaf's §4 deliverable or §5 done-criterion needs it, or it reproduces a number inwkdrs/results/results.md. Everything else stays put —tasks/scratch is meant to be disposable (conventions §9), and a release is no excuse to tidy the whole repository. The destination comes frommetds/codearc.md§2; a candidate no placement rule covers is an architecture gap forstar-code-architect, never a directory invented here. Rubric:references/gather_rubric.md. - Polish the files a reader will open, and only them. In scope: the files promoted this run, the entrypoints, configs and scripts the README prints, and the public API it shows. Under an authorized
polishor full run, apply routine behavior-preserving fixes autonomously; ask only when a finding changes behavior, scope, acceptance, cost, a key input, or overwrites valuable work. The wider audit belongs tostar-code-reviewer. - Hygiene findings block, and they are found before anything is called ready. A committed
.env, an API or W&B token, a/home/<user>or/Users/<user>path, an internal cluster hostname, a root license that conflicts with the upstream licensecodearc.md§5 recorded — each is a release blocker, reported withfile:line. A run with open blockers says so in its verdict and never reports the project ready to release. Checklist:references/release_checklist.md. - You prepare a release; you never publish one. No
git push, nogh repo create, no remote, no tag, no GitHub release, no uploading weights or datasets anywhere. Publishing is irreversible and the user's to do — you hand back the commands. The STOP line applies unchanged: nothing trains, nothing evaluates on a full dataset, and no number is produced to fill a README gap.
Workflow
Where this run executes. Apply the whole-run handoff in conventions §10.8 before Step 0. The full run and gather, polish, and readme modes use EXEC; check uses READ. Do not hand off a run while a required user decision remains.
Step 0: Orient & resolve the phase
- Read
.envand resolveCODE_NAME,CONDA_HOME,PYTHON_HOME(conventions §3). - Interpret the argument:
gather/polish/readme/check→ that phase alone; no argument → the full pass in order; anything else → name the four phases and ask via AskUserQuestion which was meant. - Build and print the readiness table before touching anything: one row per input the map needs (the five
metds/*.md,results.md,codearc.md,UPSTREAM.md,requirements*, the newestENV_REPORT.md,reference.bib,LICENSE), eachpresent/absent/stale, with the skill that produces it. Read only each input's frontmatter here — a method document is opened in full only when Step 3 compiles from it. Staleness is a date comparison, made the way the producers record it — a method document whosesources:dates trail the plans' currentupdated, a results table older than the newestEXPT_ANALYSIS.requirements*,reference.bibandLICENSEcarry no frontmatter and no date: judge thosepresent/absentfrom the file listing alone, neverstale. - Compiling with gaps is normal — the gaps become README TODOs — but the user sees the table first. When most sources are absent, say plainly that compiling now gives mostly TODOs, and offer via AskUserQuestion: run the producers first (recommended, name them) / compile what exists anyway.
- Name the paths that already carry uncommitted changes (conventions §1). This run never stages them.
Step 1 — gather: find the code worth shipping
- Sweep the candidate roots named in
references/gather_rubric.md:tasks/<plan>/,wkdrs/<run>/scripts and reproduction configs, project-root strays,execs/scpts/. Neverdatas/, neverinits/, never generated artifacts. - Apply the three-part promotion test to each candidate and record which part it passed with the evidence — the README section, the plan's §4/§5 line, or the results-table row. A candidate passing none stays put, listed as
keep in place, not as a failure. - Resolve each promoted candidate's destination from
codearc.md§2, detect near-duplicates in${CODE_NAME}/, and mark the actionmove/merge/keep in place/route. A candidate whose path is named in a plan file is markedplan-referenced: moving it makes that plan line stale, and plan text is not yours to edit — the row carries the exact lines that will go stale so the user approves with that visible. - Above ~15 candidates, state the count and narrow only if the requested promotion scope did not already settle it. Re-open each row's cited evidence before deciding it.
- Present the promotion table — path, evidence, destination, action, risk — and apply any row selection already authorized. If the move set remains unresolved, ask once via AskUserQuestion over the visible list under conventions §7.13. Approving nothing is valid → skip to Step 2.
- Execute the approved rows one at a time: move (
git mvwhen the file is tracked, a plain move otherwise — underwkdrs/only*.mdis tracked), then fix the moved file's imports and every call site referencing its old path. After each row, re-verify yourself:python -m compileall -qon the destination, and a repository-wide grep for the old path proving no stale reference remains. A row that fails → revert it, mark itblocked, continue with the rest. - Commit the phase (staging only the promoted paths and their fixed call sites):
star-code-release: promote <n> file(s) into ${CODE_NAME}/.
Step 2 — polish: the files a reader will open
- Resolve which files those are: files promoted in Step 1, plus the entrypoints, configs, and
execs/scpts/*.shthe README will print, plus the public API it will show. State the file count. Nothing outside them is read for findings. - Collect findings against
references/gather_rubric.md§"Polishing what a reader will open" — codearc conformance, docstrings on what the README names, move leftovers, debug output, commented-out experiment code, a stale path in a script. Findings outside those files are recorded for routing, never fixed. State the findings on the page before asking about any — one line each:file:line, what it is, the fix. - Apply routine behavior-preserving findings covered by the requested
polishor full run. Put any material or destructive finding in a numbered visible list and ask once via AskUserQuestion under conventions §7.13 unless that exact change is already authorized. Re-runcompileallon each touched file; revert and mark a failed fix. - Commit the phase when anything was applied:
star-code-release: polish release surface — <summary>.
Step 3 — readme: compile the README
Before drafting, read docs/mds/star-workflow/human-writing-guide.md (Chinese: docs/mds/star-workflow/human-writing-guide.zh-CN.md). Apply it to README prose while preserving measured numbers, run names, commands, paths, provenance, technical distinctions, negative results, uncertainty, and TODO markers; do not turn missing evidence into sales copy or unsupported superlatives.
- Choose the section set from
references/readme_map.md: mandatory sections always appear (with aTODOnaming the producer skill when their source is absent), omit-when-empty sections are dropped silently, not padded. - Fill
assets/readme_template.md, transcribing per the map's rules — numbers verbatim from the results table with their run, commands verbatim from the resolved script, figure paths only when the file exists. - Handle what is already at
README.md, three cases:
- Carries this skill's generated marker → show one section-level change list. An explicit request to update this generated README authorizes the listed compile; otherwise ask once via AskUserQuestion over unresolved sections. A section changed by hand defaults to keep.
- Is STAR's own template README → a clear request to replace the template with the project README authorizes replacement; otherwise show the consequence and ask once via AskUserQuestion. Keep the "Built with STAR" footer.
- Any other hand-authored README → overwrite only when the user specifically authorized replacing it after its contents were identified; otherwise leave it or compile to a user-named path.
README.mdis English. CreateREADME.zh-CN.mdonly when requested; when both exist, each links the other. Keep technical terms, metric names, dataset names, and paths in English inside the Chinese README.- Write the provenance marker as the file's first line — an HTML comment, never YAML frontmatter, which GitHub would render as a table at the top of the page. It carries the skill, the date,
model_id, and the sources with the dates they carried when read (conventions §8; the marker is this artifact's header line).
Step 4 — check: the hygiene sweep
Run every family in references/release_checklist.md over the tracked repository: secrets and machine-local paths (blocking), license and attribution, runnable commands, asset and link integrity, and numbers and claims — the last is the only place a README number is traced back to wkdrs/results/results.md, and its first check is a blocker. This phase writes nothing but the report. Each finding carries file:line, the check that caught it, and the concrete fix; a blocker is never downgraded because the rest of the run went well. The main agent re-opens every blocker's cited file:line before it enters the report.
Step 5: Report & hand off
- Write
wkdrs/release/RELEASE_<YYYY-MM-DD>.mdfromassets/release_report_template.md— a real date from the system clock (conventions §4). It records the readiness table, the promotion table with each row's outcome, the polish record, the README section map with each section's source, the checklist results, and the commands awaiting the user. - Chat digest ≤500 words, verdict first: release-ready only when no blocker is open, else
blocked (<n>)with the blockers named. Then what was promoted, what was polished, which README sections carry TODOs and which producer fills each, and what was handed to which other skill. Close with the publish commands prepared for the user — never run by you.
State & File Rules
- Writes are limited to:
README.md(and requestedREADME.zh-CN.md), files promoted into${CODE_NAME}/and the call sites their move broke, authorized in-scope polish edits, andwkdrs/release/RELEASE_<date>.md. - Never write
metds/**— not the plans, notcodearc.md, not the compiled method documents, notmetds/refs/*. Every one has a producer; a run that edits its own source is no longer compiling. Never write the results tablewkdrs/results/(star-expt-analyst aggregate's),EXEC_PLAN.md/EXEC_LOG.md,.env,datas/,inits/. LICENSE,CITATION*, and${CODE_NAME}/UPSTREAM.mdare read and cited, never rewritten. A license conflict is reported for the user to resolve — choosing a project's license is not a skill's call.- Nothing is deleted. A promoted file is moved; an unpromoted candidate is left where it is.
tasks/andwkdrs/are swept for candidates, never cleaned up. - Never move or rename anything already inside
${CODE_NAME}/, and never create a directory nocodearc.mdplacement rule names — that isstar-code-architect's. - Never publish: no
git push, no remote or branch changes, no tag, nogh repo create/gh release, no upload of weights or data to any host. The prepared commands go in the report. - All commands run through
.env's interpreter; never install or upgrade anything (star-env-builderowns the environment). The STOP line holds: no training, no full-dataset evaluation, no costly API calls — a number the results table lacks stays a TODO. - Git: one commit per finished phase, staging only that phase's paths (conventions §1); a path that was already dirty at Step 0 is never staged.
- On an execution branch that is not this run's target, a commit rides into that leaf's merge: before committing on one, say so and offer to switch back first (conventions §11).
- This skill sets no plan frontmatter and creates no run directories; its audit trail is
wkdrs/release/RELEASE_<date>.md, the README's provenance marker, and the per-phase commits.
Dialogue Discipline
- Apply conventions §7.2, §7.7, and §7.13 to unresolved decisions. A clear request for the phase and exact write scope is authorization; do not repeat it. Ask through AskUserQuestion only for an ambiguous phase, compiling despite missing key sources, an unsettled promotion set, a material polish change, or an overwrite not already specifically authorized; use concise plain text if that tool is unavailable.
- Material a question is about goes in the text of the same message, above the call — the polish findings, the section-level change list. The options carry the answers, none of the material; read the message back before it goes out: options with nothing above them mean the material was skipped, not shortened.
- Reply in the user's language.
README.mdis English regardless of the dialogue language; the release report follows the root plan'slanguage(dialogue language if no plan); keep technical terms in English inside Chinese documents.