一键导入
update-r-news
Draft or update an R package NEWS file from git commit history, examining diffs when commit messages are vague
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Draft or update an R package NEWS file from git commit history, examining diffs when commit messages are vague
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Analyze R/Bioconductor package structure to extract key information about its purpose, exports, and characteristics
Verify that waldronlab/ai-agent-skills are available and help users find the right skill
Update existing AI instruction documentation when an R/Bioconductor package changes
Validate that a skill conforms to the ai-agent-skills repository standards
Create complete AI instruction documentation for an R/Bioconductor package in .github/instructions/
Help create a new AI agent skill through collaborative Q&A
| name | update-r-news |
| description | Draft or update an R package NEWS file from git commit history, examining diffs when commit messages are vague |
| version | 1.0.0 |
| category | r-packages |
| tags | ["r-packages","documentation","git","changelog","news","bioconductor"] |
| author | waldronlab |
Draft or update an R package NEWS file (NEWS.md, NEWS, or NEWS.Rd) from the git commit history since the last Bioconductor release. When commit messages are too vague to classify, the skill inspects the associated diff to infer what changed. All drafts are shown for review and confirmation before writing to disk.
This skill is designed for Bioconductor packages on the devel branch, where the current development version is odd-numbered (e.g. 1.19.x) and the upcoming release will be even-numbered (e.g. 1.20.0).
Invoke this skill when you want to draft or update a package NEWS file:
DESCRIPTION file)git available on PATH)NEWS.md, NEWS, or NEWS.Rd) may already exist, but is not requiredCheck the package root for these files in priority order:
NEWS.md (markdown)NEWS.Rd (R documentation format)NEWS (plain text, Bioconductor-style)If exactly one is found, use it. If multiple exist, ask the user which one to update. If none exist, ask which format to create (default: NEWS.md).
Record the detected file path and format for use throughout the remaining steps.
Parse DESCRIPTION to extract the Version: field. In Bioconductor's versioning convention, the devel branch carries an odd minor version (the Y in X.Y.Z), while each released version has an even Y.
Examples:
1.19.4 → upcoming release is 1.20.02.5.7 → upcoming release is 2.6.00.99.3 → this is a new package submission (version below 1.0.0)This derived release version will be the heading for the new NEWS block.
Bioconductor packages do not use git tags for releases. Instead, the commit range is determined by searching the git log for a specific release-bump commit message.
Step 3a — Search for the release-bump commit
Run:
git log --oneline --all
Search for a commit whose message matches this exact literal pattern (these commits are applied en masse by Bioconductor and do not include the actual package version number):
bump x.y.z version to even y prior to creation of RELEASE_
For example, for the Bioconductor 3.18 release:
a1b2c3d bump x.y.z version to even y prior to creation of RELEASE_3_18 branch
Step 3b — Find the devel-version bump commit that follows
Immediately after the release-bump commit, Bioconductor applies a second en-masse commit that increments the devel branch back to an odd minor version. Its message matches the literal pattern:
bump x.y.z version to odd y following creation of RELEASE_
For example:
b2c3d4e bump x.y.z version to odd y following creation of RELEASE_3_18 branch
This second commit (<devel-bump-sha>) is the starting point for the commit range. Use <devel-bump-sha>..HEAD as the range.
To locate it, find the oldest commit returned by:
git log --oneline <release-bump-sha>..HEAD
Step 3c — Handle new packages (no release-bump commit found)
If no release-bump commit is found in the history:
Version: field from DESCRIPTION.1.0.0 (e.g. 0.99.3): treat the entire commit history as the range (i.e. git log --oneline from the first commit to HEAD) and note that this appears to be a new package submission.1.0.0 or higher but no release-bump commit is found: do not guess. Ask the user to supply a starting commit SHA (see Error Handling).Step 3d — Handle an existing NEWS entry for the upcoming release
If the NEWS file already has a section heading for the upcoming release version, offer to append new commits since the last commit already covered rather than regenerating the entire block.
Retrieve commits for the determined range:
git log <range> --oneline
Also retrieve merge commits separately:
git log <range> --merges --format="%H %s %b"
For each merge commit in the log, attempt to extract the pull request title:
Merge pull request #NNN from <branch> followed by the PR title on the next linegit show <sha> --format="%b" -s) to extract the PR titleFor non-merge commits, use the commit subject line directly.
For each commit, evaluate its message for vagueness using these criteria — a commit is vague if it meets any of the following:
Word count rule: The commit message (after stripping conventional-commit type prefixes like fix:, feat:, chore:) contains 3 words or fewer.
Filler phrase rule: The lowercased message matches any of these patterns:
fix, update, wip, cleanup, refactor, changes, misc, tweaks, improvementsminor update, minor fix, minor changes, api update, small fix, small update, bug fix, quick fix, more fixes, various fixes, various changesSplit all commits into two lists: specific and vague.
For each vague commit, run:
git show <sha> --stat --patch -- R/ src/ DESCRIPTION NAMESPACE
Limiting the diff to code-bearing paths avoids noise from unrelated files.
From the diff, summarise:
+ and - diff lines for patterns such as function(, setGeneric(, setClass(, setMethod(, setRefClass(, R6Class(, export( — note added (+) vs removed (-) occurrences; this list is representative and agents may extend it based on what they observe in the diffIf a diff is very large (> 500 changed lines total), summarise by file rather than by line to avoid context overflow.
Combine the diff summary with the original vague commit message to produce an enriched description to use in subsequent steps.
If the NEWS file already exists, read its content and extract all unique category/section headings currently in use. Examples vary by package — typical headings include NEW FEATURES, BUG FIXES, SIGNIFICANT USER-VISIBLE CHANGES, DEPRECATED AND DEFUNCT, INTERNAL CHANGES, and others.
Use these detected headings as the allowed category set for the new entries. If no headings can be detected (e.g. the file is new or has no previous entries), present a default set for the user to choose from and allow custom headings.
For each commit (using the enriched description for previously vague commits), assign it to one of the detected categories:
NEW FEATURES (or equivalent)BUG FIXES (or equivalent)Deprecated/defunct patterns → DEPRECATED AND DEFUNCT (or equivalent)SIGNIFICANT USER-VISIBLE CHANGES (or equivalent)DESCRIPTION-only → INTERNAL CHANGES (or equivalent)INTERNAL CHANGES or MISCELLANEOUS if that heading exists — and always mark it with a # TODO: verify category annotation so the user can reclassify it during the preview stepGroup entries by category under the upcoming release version heading.
Format entries according to the detected NEWS file format:
NEWS.md (markdown):
# Changes in version 1.20.0
## NEW FEATURES
- Description of new feature (#abc1234)
## BUG FIXES
- Description of fix (#def5678)
NEWS (plain text, Bioconductor-style):
Changes in version 1.20.0 (YYYY-MM-DD)
+ NEW FEATURES
o Description of new feature (commit abc1234)
+ BUG FIXES
o Description of fix (commit def5678)
NEWS.Rd (R documentation format):
\section{Changes in version 1.20.0}{
\subsection{NEW FEATURES}{
\itemize{
\item Description of new feature (commit abc1234)
}
}
\subsection{BUG FIXES}{
\itemize{
\item Description of fix (commit def5678)
}
}
}
Each bullet/item:
# TODO: verify category (NEWS.md/NEWS) or a comment equivalent to flag uncertain entriesDisplay the complete drafted NEWS block in the chat. Also provide a brief summary:
Ask for confirmation before writing:
Does this NEWS draft look correct?
[yes] - write to <filename>
[edit] - specify which entries to revise
[abort] - discard and exit
If the user requests edits, apply them interactively and show the updated preview again before writing.
Do not write to disk until the user confirms.
Once confirmed:
✅ NEWS updated for version X.Y.Z — N entries across K categories written to <filename>NEWS.md, NEWS, or NEWS.Rd file on diskDESCRIPTION missing): abort with "No DESCRIPTION file found — run this skill from an R package root"git not on PATH: abort with "git is not available — install git and ensure it is on your PATH"<starting-commit> — NEWS is already up to date"Invocation: "Update the NEWS file from recent commits"
Scenario: Package with prior releases; all commits since the previous release have descriptive messages.
Process:
NEWS.md, detects existing headings NEW FEATURES and BUG FIXES1.20.0 from current devel 1.19.4"bump x.y.z version to even y prior to creation of RELEASE_3_18 branch", then locates the subsequent devel-bump commit "bump x.y.z version to odd y following creation of RELEASE_3_18 branch" (b2c3d4e)b2c3d4e..HEAD — none are vagueNEWS.mdInvocation: "Generate a changelog based on git commits"
Scenario: Several commits have messages like "API update", "fix", and "wip".
Process:
NEWS.md; locates release-bump and subsequent devel-bump commita1b2c3d): inspects diff, finds returnSamples() signature changed — classifies as SIGNIFICANT USER-VISIBLE CHANGESe4f5a6b): inspects diff, finds test file edit — classifies as BUG FIXESc7d8e9f): diff shows only internal helper changes — classifies as INTERNAL CHANGESInvocation: "Add a NEWS entry for the upcoming release"
Scenario: New package submission; DESCRIPTION shows Version: 0.99.3; no release-bump commit exists.
Process:
NEWS.md0.99.3 (below 1.0.0) — treat entire commit history as the rangeNEWS.md with the new blockInvocation: "Update the NEWS file"
Scenario: Package is at 1.3.2 on devel but has no release-bump commit (e.g. history was rewritten or imported without full history).
Process:
1.3.2 (≥ 1.0.0) — cannot determine range safelyf9e8d7c; skill uses f9e8d7c..HEAD as the range and proceeds normallyInvocation: "Draft NEWS entries from git history"
Scenario: Repository uses GitHub pull requests merged with squash-merge.
Process:
(#45) referencedevel branch carries odd-numbered minor versions and each release has an even minor version; no git tags are used or requiredR/, src/, DESCRIPTION, and NAMESPACE to avoid irrelevant noise from documentation or test-only commitsgit and file readsRelated: See analyze-r-package for package structure analysis. See SKILL_STANDARD.md for skill format details.