Add skill support for other coding agents and add new release skill

This commit is contained in:
Eric Kilmer
2026-05-15 15:58:46 -04:00
parent 7b4f1bce5e
commit d6d9b4c483
8 changed files with 150 additions and 0 deletions
@@ -0,0 +1,67 @@
---
name: sleigh-ghidra-release
description: Update the lifting-bits/sleigh repository for a new upstream Ghidra stable release. Use when bumping Ghidra stable tags or versions, porting or regenerating src/patches/stable from HEAD patches, updating Ghidra source or spec file lists, moving HEAD-only source/header entries into stable, validating local Ghidra builds, or preparing release-update commits and PRs.
---
# Sleigh Ghidra Release
## Overview
Update this repository after NSA publishes a new Ghidra release. Prefer the repo's existing release-update shape: verify the upstream tag, reuse `src/ghidra-stable`, regenerate stable patches mechanically from HEAD patches where possible, update CMake lists, and validate with a local build.
Read [references/release-checklist.md](references/release-checklist.md) when doing the update; it contains the detailed checklist and decision points.
## Workflow
1. Inspect state before changing anything:
- Run `git status --short`.
- Treat existing edits and untracked files as user-owned unless the task clearly says otherwise.
- Keep unrelated files out of release-update commits.
2. Verify the target release:
- Use official upstream sources for release and tag facts.
- Prefer Exa MCP tools for web lookup when available.
- Confirm the tag format, usually `Ghidra_<version>_build`.
3. Prepare `src/ghidra-stable`:
- Use the existing checkout when present.
- If a clone is needed, clone under `src/`.
- Normalize `origin` to HTTPS if the remote uses a local SSH alias:
```bash
git -C src/ghidra-stable remote set-url origin https://github.com/NationalSecurityAgency/ghidra.git
```
- Fetch and check out the release tag:
```bash
git -C src/ghidra-stable fetch origin tag Ghidra_<version>_build --depth=1
git -C src/ghidra-stable checkout --detach Ghidra_<version>_build
git -C src/ghidra-stable config user.name "github-actions[bot]"
git -C src/ghidra-stable config user.email "41898282+github-actions[bot]@users.noreply.github.com"
```
4. Regenerate stable patches mechanically:
- Start from a clean `Ghidra_<version>_build` checkout.
- Try applying HEAD patches in order.
- If a HEAD patch fails, inspect whether it is already upstreamed, still needed with adjusted context, or only applies to HEAD-only code. Abort and retry with the applicable subset when needed.
- Use `format-patch` from `Ghidra_<version>_build..HEAD` to create the new stable patch files.
- Update `src/setup-ghidra-source.cmake` patch ordering to match the regenerated files.
5. Update release metadata and lists:
- Set `ghidra_version` in `src/setup-ghidra-source.cmake`.
- Search for `sleigh_RELEASE_IS_HEAD`; move entries into stable when the release now contains those sources or headers.
- Update `src/spec_files_stable.cmake` from the release checkout's `.slaspec` inventory.
- Check `cmake/packaging.cmake` and reset `PACKAGE_VERSION` to `1` when the release cycle requires it.
6. Validate the exact files CMake will use:
- Re-checkout the release tag in `src/ghidra-stable`.
- Apply `src/patches/stable/*.patch`.
- Configure with `FETCHCONTENT_SOURCE_DIR_GHIDRASOURCE` pointing at the local checkout.
- Build with `cmake --build ... --parallel`.
- Run `ctest`; if no developer-mode configure was used, `No tests were found` may be expected.
7. Review and commit only when asked:
- Use `git diff --cached --stat`, `git diff --cached --name-status`, and `git diff --cached --check`.
- `git diff --check` may flag generated `git format-patch` signature lines; inspect before changing generated patch files.
- Commit messages must follow the repo's 50/72 rule.
@@ -0,0 +1,4 @@
interface:
display_name: "Sleigh Ghidra Release"
short_description: "Update Sleigh for new Ghidra releases"
default_prompt: "Use $sleigh-ghidra-release to update this repo for a new upstream Ghidra release."
@@ -0,0 +1,78 @@
# Release Update Checklist
This checklist is based on the repository wiki page:
https://github.com/lifting-bits/sleigh/wiki/New-Ghidra-Release-Update-Checklist
## Files To Check
- `src/setup-ghidra-source.cmake`: stable version, stable patch list, HEAD pin, source lists.
- `src/patches/stable/`: regenerated patches for the stable Ghidra tag.
- `src/patches/HEAD/`: source patches to port to the new stable release.
- `src/spec_files_stable.cmake`: stable `.slaspec` inventory.
- `src/spec_files_HEAD.cmake`: comparison point for new spec files.
- `CMakeLists.txt`: public Ghidra headers copied into the build include directory.
- `cmake/packaging.cmake`: package version reset when relevant.
## Patch Regeneration
Preferred pattern:
```bash
git -C src/ghidra-stable checkout --detach Ghidra_<version>_build
git -C src/ghidra-stable am --ignore-space-change --ignore-whitespace --no-gpg-sign \
/absolute/path/to/src/patches/HEAD/*.patch
git -C src/ghidra-stable format-patch -o /private/tmp/sleigh-ghidra-stable-patches \
Ghidra_<version>_build..HEAD
```
If a patch fails:
- Run `git -C src/ghidra-stable am --abort`.
- Inspect the failed patch and the target source.
- Decide whether the patch is already upstreamed, still needed with refreshed context, or only applicable to HEAD-only code.
- Reapply the exact applicable patch sequence or subset.
- Regenerate stable patches from the resulting commits; avoid hand-editing patch bodies unless conflict resolution requires it.
## Source And Header Lists
Find HEAD-only gates:
```bash
rg -n "sleigh_RELEASE_IS_HEAD|sleigh_RELEASE_TYPE.*HEAD" \
CMakeLists.txt src cmake support tests
```
When a previously HEAD-only file exists in the new stable release, move it to the normal stable list and leave no dead conditional branch unless the branch still has a purpose.
## Spec Files
Build the stable inventory from the release checkout:
```bash
fd -e slaspec . src/ghidra-stable/Ghidra/Processors
```
Update `src/spec_files_stable.cmake` with sorted
`${ghidrasource_SOURCE_DIR}/...` entries. Compare against both the old stable
list and `src/spec_files_HEAD.cmake`.
## Validation
Verify the generated stable patch files directly:
```bash
git -C src/ghidra-stable checkout --detach Ghidra_<version>_build
git -C src/ghidra-stable am --ignore-space-change --ignore-whitespace --no-gpg-sign \
/absolute/path/to/src/patches/stable/*.patch
```
Then configure and build Sleigh against the local checkout:
```bash
cmake -B build/ghidra-<version>-local -S . \
-DFETCHCONTENT_SOURCE_DIR_GHIDRASOURCE=/absolute/path/to/src/ghidra-stable
cmake --build build/ghidra-<version>-local --parallel
ctest --test-dir build/ghidra-<version>-local --output-on-failure
```
If tests matter for the update, use a developer-mode preset or option. A plain configure may not register tests.
+1
View File
@@ -0,0 +1 @@
../.agents/skills