一键导入
pharaoh-release
Use when preparing a release, generating changelogs from requirements, or summarizing requirement changes for version management
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when preparing a release, generating changelogs from requirements, or summarizing requirement changes for version management
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when a developer wants to add a feature, capability, or behaviour change to a project that uses sphinx-needs and a V-model artefact structure, before any requirement or code is written. Triggers on "add a feature", "implement X", "let's build Y", or "do spec-driven development" in a project with .pharaoh/project/ tailoring.
Use when analyzing the impact of changing a requirement, specification, or any sphinx-needs item, including traceability to code via codelinks
Use when recording a design decision as a traceable sphinx-needs object with alternatives, rationale, and links to affected requirements
Use when checking for gaps, redundancies, and inconsistencies in sphinx-needs requirements, or validating traceability completeness
Use when reading one source file and emitting one or more requirement RST directives (typed by `target_level`) describing the observable behavior in that file. Queries shared Papyrus for canonical terms before naming concepts; writes newly surfaced concepts back. Does not draft architecture, plans, or FMEA.
Use when drafting a single sphinx-needs architecture element from one parent requirement. The artefact type is parameterised via `target_level` (any catalog-declared architecture type — e.g. `arch`, `swarch`, `sys-arch`, `module`, `component`, `interface`). Emits an RST directive block linking back to the parent via `:satisfies:`.
| name | pharaoh-release |
| description | Use when preparing a release, generating changelogs from requirements, or summarizing requirement changes for version management |
This skill's visible output is the full release report (changelog plus release summary) as defined in Step 7. The report is mandatory. Every invocation MUST emit the complete report. The session-state update is internal bookkeeping. The skill is self-terminating. No interactive prompt at the end of the turn.
Failure modes:
File-save behaviour is controlled by an input flag (save_artifacts), not an interactive prompt. See Step 7.2 below.
Generate release artifacts from sphinx-needs changes. This skill identifies which requirements, specifications, implementations, and test cases changed between releases, produces structured changelogs and release notes, and computes traceability coverage metrics suitable for safety-critical audit trails. In enforcing mode, release is gated by prior verification (and optionally MECE analysis).
save_artifacts (optional, default none): one of none | changelog | release_notes | both. Controls whether the skill writes the rendered changelog/release-notes artifacts to disk in addition to emitting them in the turn output. Pass explicitly when calling non-interactively. Defaults to none so a bare invocation never silently writes files.This skill has workflow gates. Follow the strictness check in Step 1 before proceeding to the release process.
Execute the following steps in order.
Follow the decision flow defined in skills/shared/strictness.md, Section 5.
pharaoh.toml in the workspace root.[pharaoh] to determine the strictness level ("advisory" or "enforcing").[pharaoh.workflow] for the gate settings:
require_verification (default: true)require_mece_on_release (default: false)pharaoh.toml does not exist, treat strictness as "advisory".If strictness = "advisory":
| Missing prerequisite | Tip |
|---|---|
| no review skill run | Tip: Consider running the appropriate review skill (e.g. pharaoh:req-review) to validate implementations before release. |
pharaoh:mece not run | Tip: Consider running pharaoh:mece to check for gaps before release. |
Do not show a tip if the corresponding workflow gate is disabled in pharaoh.toml
(e.g., do not show the MECE tip if require_mece_on_release = false).
If strictness = "enforcing":
.pharaoh/session.json (see skills/shared/strictness.md, Section 4).require_verification = true):
changes dictionary in session state.verified = true.verified = false or is missing from session state, block:
Blocked: Verification required before release.
Run the appropriate review skill (e.g. pharaoh:req-review) to validate implementations first.
Unverified needs:
- REQ_001 (authored but not verified)
- SPEC_003 (authored but not verified)
require_mece_on_release = true):
global.mece_checked in session state.mece_checked = false or null, block:
Blocked: MECE analysis required before release.
Run pharaoh:mece to check for gaps first.
If the user explicitly requests to skip a gate check (e.g., "proceed anyway" or "skip the check"), respect the request. Log a warning:
Warning: Skipping verification gate at user request. Workflow compliance is not guaranteed.
Proceed with Step 2. Do not update session state to indicate the prerequisite was met.
Follow the instructions in skills/shared/data-access.md to:
ubproject.toml, conf.py, source directories).pharaoh.toml for traceability requirements (required_links).After completing data access, present the detection summary before proceeding:
Project: <name> (<config source>)
Types: <list of directive names>
Links: <list of link type names>
Data source: <tier used>
Needs found: <count>
Strictness: <advisory|enforcing>
If detection fails (no project found, no needs in source files), report the issue and ask the user for guidance. Do not proceed with empty data.
Identify which version this release covers and what to compare against.
Ask the user for the release version if not already provided:
What version is this release?
- Enter a version string (e.g., v1.2.0)
- Or type "since last release" to auto-detect from the latest git tag
If the user provides a version string, record it as the release version.
Determine the baseline to compare against:
If the user said "since last release" or provided no baseline:
git tag --sort=-v:refname to list tags in reverse version order.Comparing against: <tag> (<date>)
Proceed? [yes/no]
If the user provided a specific baseline (a tag, branch, or commit):
git rev-parse <ref>.Use git to find which documentation files changed between the baseline and HEAD:
git diff --name-only <baseline>..HEAD -- <source_directories>
Filter to only RST and MD files (the files that can contain need directives). Record the list of changed files.
If ubc diff is available (the ubc CLI was detected and supports the diff
subcommand), prefer it for structural diff:
ubc diff <baseline>..HEAD --format json
This provides a precise need-level diff rather than file-level, which is more accurate for detecting added, modified, and removed needs.
Categorize every need change into one of three buckets: new, modified, or removed.
If ubc diff is available and returned JSON output in Step 3c, parse it directly.
The output provides need-level changes with before/after states. Map each entry to
the appropriate bucket.
If ubc diff is not available, analyze changes manually:
Find new needs:
git diff <baseline>..HEAD -- <file>.+) that contain
need directives: .. <type>:: where <type> is one of the configured
directive names.Find removed needs:
-) that contain
need directives.git show <baseline>:<file>
to read the old content).Find modified needs:
Organize all changes into a structured summary:
Changes detected:
New needs: <count> (<breakdown by type>)
Modified needs: <count> (<breakdown by type>)
Removed needs: <count> (<breakdown by type>)
Unchanged: <count>
For each modified need, also identify its impact chain: the set of needs linked to it (upstream and downstream) that may be affected by the change. Use the link graph built in Step 2 to trace one level in each direction.
Build a structured changelog from the change summary.
Use the following markdown template. Group changes by need type. Within each group, sort by need ID.
## Release <version> - <date>
### Summary
- **<count>** new needs added
- **<count>** needs modified
- **<count>** needs removed
- **<total>** total needs in project
### New Requirements
- **REQ_004**: <title> [<status>]
<brief description or first sentence of content>
### New Specifications
- **SPEC_005**: <title> [<status>]
Linked to: REQ_004
### New Implementations
- (none)
### New Test Cases
- (none)
### Modified Requirements
- **REQ_001**: <title>
- <attribute>: <old value> -> <new value>
- Impact: <list of directly linked need IDs that may need review>
### Modified Specifications
- **SPEC_001**: <title>
- content: updated acceptance criteria
- Impact: IMPL_001, TEST_001
### Modified Implementations
- (none)
### Modified Test Cases
- (none)
### Removed Requirements
- (none)
### Removed Specifications
- (none)
### Removed Implementations
- (none)
### Removed Test Cases
- (none)
### Traceability Changes
- New links: <list of new link pairs, e.g., SPEC_005 -> REQ_004>
- Removed links: <list of removed link pairs>
- Modified links: <list of needs whose link targets changed>
### Verification Status
- All modified needs verified: <yes/no>
- Unverified needs: <list of IDs, or "none">
- MECE analysis: <passed / not run>
- Open MECE issues: <count, or "N/A">
Adapt the type sections to the project's configured types. If the project
defines custom types beyond the standard four (e.g., story, hazard,
constraint), generate sections for each type that has changes. Omit type
sections that have no changes in any category (no new, no modified, no removed).
For each need type defined in the project configuration, generate the
corresponding "New", "Modified", and "Removed" sections only if that type has at
least one change. Use the type's title field from the configuration for the
section heading (e.g., "New Hazard Analyses" for a type with title = "Hazard Analysis").
Populate the verification status from session state (.pharaoh/session.json):
changes.<need_id>.verified for each modified or new need.global.mece_checked for MECE status.Verification Status
- Session state not available. Run the appropriate review skill and pharaoh:mece for status.
Produce a high-level summary with coverage metrics.
Count all needs in the current project by type and status:
Needs Inventory
===============
Type Total draft approved implemented verified
Requirement 12 2 5 3 2
Specification 10 1 4 3 2
Implementation 8 0 2 4 2
Test Case 7 0 1 3 3
--------------------------------------------------------------
Total 37 3 12 13 9
Adapt the status columns to the project's actual status values. If the project
uses different statuses (e.g., open, in_progress, closed), use those instead.
Calculate coverage percentages based on required_links from pharaoh.toml:
For each required link chain (e.g., "req -> spec"):
req needs).spec).coverage = linked_count / total_count * 100Present as:
Traceability Coverage
=====================
Chain Covered Total Coverage
req -> spec 10 12 83.3%
spec -> impl 8 10 80.0%
impl -> test 7 8 87.5%
Full chain (req->test) 6 12 50.0%
The "Full chain" row traces the complete path from top-level needs to leaf needs. A source need is "fully covered" only if there is a complete path through all intermediate types to the final type in the chain.
If required_links is not configured, skip this section and note:
Traceability coverage: Not configured.
Add [pharaoh.traceability] required_links to pharaoh.toml to enable coverage metrics.
If pharaoh:mece was run in this session (check global.mece_checked in session
state), summarize any open issues that were identified:
verified need linked to a draft specification)If MECE was not run, note:
MECE Issues: Not available (pharaoh:mece has not been run this session).
If sphinx-codelinks is enabled, include a code traceability summary:
Code Traceability
=================
Needs with code references: <count> / <total>
Code files referencing needs: <count>
The sub-steps below run in this fixed order: session-state update first
(internal bookkeeping), then artifact writes per the save_artifacts input
flag (silent side effects), and finally the visible release report. The
report is the LAST instruction in the skill so it is the last visible turn
content. The skill MUST end the turn after the report. No interactive
prompts.
Run this BEFORE emitting any visible output. Update .pharaoh/session.json:
global.last_release to the current ISO 8601 timestamp.updated to the current ISO 8601 timestamp..pharaoh/session.json.This is internal bookkeeping. It MUST NOT produce any visible turn output.
save_artifacts input flagBranch on the save_artifacts input value (default none):
none: do nothing. The output was already presented.changelog: append the changelog entry to CHANGELOG.md (Option 1 logic below).release_notes: write docs/releases/<version>.md (Option 2 logic below).both: execute both branches in order.Do NOT ask the user. Callers that want to choose interactively pass the flag explicitly.
changelog branch (append to CHANGELOG.md):
CHANGELOG.md exists in the workspace root.# Changelog line).# Changelog header followed by the new entry.release_notes branch (write docs/releases/<version>.md):
docs/releases/ directory if it does not exist.docs/releases/<version>.md.both branch: execute both branches in order.
This sub-step is the LAST instruction in the skill and produces the LAST visible turn content. After emitting the report, end the turn. Do not ask follow-up questions.
Display the complete changelog (from Step 5) and release summary (from Step 6) to the user in a single output. Append the tag suggestion below as the final footer line of the report.
Tag suggestion footer (append at the end of the report):
Suggested next step:
git tag -a <version> -m "Release <version>"
(Run the tag command manually if desired. The skill does not run git tag
automatically.)
The skill MUST NOT execute git tag itself. The skill MUST NOT ask the
user whether to create the tag. The footer is informational only.
Never run git tag or git push. The skill MUST NOT execute either
command. The release report includes a tag suggestion as a footer line so the
user can run it manually. The skill MUST NOT prompt the user about tagging.
File writes are gated by the save_artifacts input flag. The skill MUST
NOT prompt the user before writing CHANGELOG.md or docs/releases/<version>.md.
The flag is the contract. Default none means no files are written. When the
flag selects a write branch, perform the write without asking.
Include traceability metrics for safety-critical audit trails. The release summary must always include the needs inventory and traceability coverage metrics. These are essential for compliance in regulated industries (automotive, aerospace, medical device).
Support both full release notes and incremental changelogs. The changelog (Step 5) captures incremental changes for this release. The release summary (Step 6) captures the full project state. Both are produced every time.
Adapt to project-specific types and statuses. Do not hardcode need types
(req, spec, impl, test) or status values (draft, approved). Read
the project configuration and use whatever types and statuses the project
defines. Generate changelog sections dynamically.
Handle missing git history gracefully. If the project is not a git repository, or if there are no tags, report the limitation:
This workspace is not a git repository (or has no tags).
Cannot determine changes since last release automatically.
Please provide the set of changed need IDs manually, or specify two
file snapshots to compare.
Then allow the user to provide change information manually and proceed with changelog generation from that input.
Handle empty releases. If no needs changed between the baseline and HEAD, report:
No requirement changes detected between <baseline> and HEAD.
If documentation files changed but no need directives were affected,
this is a documentation-only release with no requirements impact.
Still offer to generate the release summary (Step 6) since the project inventory and coverage metrics may be useful even without changes.
Respect the data access tier hierarchy. Always prefer ubc CLI (ubc diff)
for change detection when available. Fall back to git diff with raw parsing
only when ubc is not available. The structural diff from ubc is more precise
than text-based diff parsing.
Do not modify any need directives. This skill is read-only with respect to documentation source files. It generates release artifacts and writes them to dedicated output files (CHANGELOG.md, docs/releases/). It never modifies RST or MD files containing need directives.