Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .claude/skills/bump-bundled-tools/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
name: bump-bundled-tools
description: Update a versioned tool bundled in the native CLI. Use when bumping socket-patch, uv, cdxgen, or synp.
user-invocable: true
---

# Bump a bundled native tool

Take a tool name and its exact upstream version as `$ARGUMENTS`; ask if either
is missing. Read [the bundled tool inventory](references/bundled-tools.md),
then follow that tool's matching `bump-*` skill. Update one tool per change.

Check the target-specific payload and manifest after building. Keep any tool
unavailable while its provenance, license, or notice checks remain unresolved.
Do not add a new tool here unless the builder stages it into the VFS.
13 changes: 13 additions & 0 deletions .claude/skills/bump-bundled-tools/references/bundled-tools.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Tools bundled in the native CLI

| Tool and type | Pin | Staging path | Target and status | Skill |
| --- | --- | --- | --- | --- |
| `socket-patch` executable | `dependencies.@socketsecurity/socket-patch` in `package.json` | `src/sea/build-sea.mts` → `resources/socket-patch` | Built for targets with a matching locked platform package; the manifest records its digest. | [bump-socket-patch](../../bump-socket-patch/SKILL.md) |
| `uv` executable | `src/sea/stage/uv-pins.json` | `src/sea/stage/uv.mts` → `tools/uv` | Target archives are checksum-verified; the manifest records each binary digest. | [bump-uv](../../bump-uv/SKILL.md) |
| `cdxgen` JavaScript API | `devDependencies.@cyclonedx/cdxgen` in `package.json` | `.config/rollup.cdxgen-sea.config.mjs` and `src/sea/build-sea.mts` → `tools/cdxgen` | `darwin-arm64` only; capability stays disabled until provenance and notices are resolved. | [bump-cdxgen](../../bump-cdxgen/SKILL.md) |
| `synp` JavaScript package | `devDependencies.synp` in `package.json` | `src/sea/stage/synp.mts` → `tools/synp` | `darwin-arm64` only; Yarn Classic stays disabled until provenance and notices are resolved. | [bump-synp](../../bump-synp/SKILL.md) |

Node is the SEA runtime; use [bump-node-sea](../../bump-node-sea/SKILL.md).
Coana runs from a Socket API download; use [bump-coana](../../bump-coana/SKILL.md).
The .NET facts helper is built from source and requires a compatible .NET SDK.
Socket Python CLI has no version pin or VFS staging step in this repo.
27 changes: 27 additions & 0 deletions .claude/skills/bump-cdxgen/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
name: bump-cdxgen
description: Update the pinned cdxgen package staged into the native CLI VFS. Use when changing @cyclonedx/cdxgen.
user-invocable: true
---

# Bump cdxgen

Take the exact released version as `$ARGUMENTS`; ask if missing. Read
[the VFS and provenance reference](references/vfs-provenance.md), update the
exact dev dependency and lockfile with
`pnpm add -D --save-exact "@cyclonedx/cdxgen@$ARGUMENTS"`, then rebuild the
macOS arm64 SEA prototype with `pnpm build:sea -- --prototype`.

Check the new dependency graph and update package-version-specific provenance,
license text, and notices where required. Keep the cdxgen capability unavailable
while any source or notice obligation remains unresolved. Run the SEA builder
and runtime tests, then inspect the manifest and confirm the capability remains
unavailable:

```sh
pnpm run test:unit \
test/unit/sea/build-sea.test.mts test/unit/sea/runtime.test.mts
pnpm build:sea -- --prototype
```

Create one signed conventional commit and a PR against `v1.x`.
13 changes: 13 additions & 0 deletions .claude/skills/bump-cdxgen/references/vfs-provenance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# cdxgen VFS and provenance

- The pin is the `@cyclonedx/cdxgen` dev dependency in `package.json`; pnpm
records its graph in `pnpm-lock.yaml`.
- `src/sea/build-sea.mts` bundles it through the Rollup config
`.config/rollup.cdxgen-sea.config.mjs` for darwin-arm64.
- Exact-version license and source provenance entries live in
`.config/rollup.cdxgen-sea.config.mjs` and `src/sea/rollup-provenance.mjs`.
- `src/sea/README.md` records that cdxgen remains unavailable until source
provenance and notice obligations are resolved. A package bump alone does
not qualify it for use.
- Validate with `test/unit/sea/build-sea.test.mts`,
`test/unit/sea/runtime.test.mts`, and a darwin-arm64 prototype build.
161 changes: 24 additions & 137 deletions .claude/skills/bump-coana/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,149 +1,36 @@
---
name: bump-coana
description: Bump the pinned Coana CLI to a new version, update changelog, and create a PR. Use when user wants to upgrade Coana CLI, bump Coana version, or says "bump coana" with a version number.
description: Update the pinned Coana CLI, native help snapshots, and changelog. Use when bumping Coana CLI.
allowed-tools: Read, Edit, Write, Bash, Glob
user-invocable: true
---

# Bump Coana CLI Version
# Bump the Coana CLI

Automates the process of upgrading the pinned Coana CLI to a new version, including the pin, changelog entry, and PR creation.
Take the exact Coana version as `$ARGUMENTS` in `X.Y.Z` form; ask if it is
missing. Read [the pin and snapshot notes](references/pin-and-snapshots.md).

## Input
1. Read the current `COANA_CLI_VERSION` as `$CURRENT_VERSION`, then update it
in `src/constants.mts`. Leave `src/vendor/coana-cache.mjs` and the root
`package.json` version unchanged.
2. Refresh the native help snapshots:

- **Version**: The Coana version to upgrade to (e.g., `14.12.173`)
- Passed via `$ARGUMENTS` (e.g., `/bump-coana 14.12.173`)
```sh
node scripts/test/swap-snapshot-version.mts \
--dep coana --from "$CURRENT_VERSION"
```

If no version is provided, ask the user for the Coana version to upgrade to.
If the helper cannot update them, run `pnpm snapshots:update:dep coana` with
a built native CLI.
3. Add or replace the Unreleased changelog entry:

## Workflow
```sh
node scripts/release/add-unreleased.mts \
--replace '^Updated the Coana CLI to v ' \
"Updated the Coana CLI to v \`$ARGUMENTS\`."
```

### Step 1: Parse and Validate Input

Extract the version number from `$ARGUMENTS`:

```bash
COANA_VERSION="$ARGUMENTS"

# Validate version format (should be semver-like: X.Y.Z)
if [[ ! "$COANA_VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "ERROR: Invalid version format. Expected X.Y.Z (e.g., 14.12.173)"
exit 1
fi
```

### Step 2: Update the pin

1. Read `src/constants.mts`.
2. Find the line `const COANA_CLI_VERSION = '<version>'` and note the version as `CURRENT_VERSION`.
3. Replace the version on that line with the new one.

Socket CLI downloads that version through the Socket API, so it has to be a
release Coana published to its GCS bucket, not one that only exists on npm.

Don't edit `src/vendor/coana-cache.mjs`. It is generated in
coana-package-manager, and Coana's release workflow refreshes it in its own bump
PRs.

🚨 **Do NOT touch `package.json`'s top-level `version` field.** The release workflow owns it:
between releases the manifest holds the last released version, and
`scripts/release/prepare.mts` derives and writes the next one in-run. Hand-writing
it invents a version that never releases and breaks the next release — a manifest
already sitting on the version being released has no line for the bump to
advance.

**Values to extract**:
- `CURRENT_VERSION`: The old Coana CLI version (for PR body)

### Step 3: Update CHANGELOG.md

Do not hand-edit the file. Run the helper, which owns the shape:

```bash
node scripts/release/add-unreleased.mts \
--replace '^Updated the Coana CLI to v ' \
"Updated the Coana CLI to v \`$COANA_VERSION\`."
```

It puts the entry under `## [Unreleased]` in the `### Changed` section,
recreating either when the previous release consumed it, and `--replace`
rewrites a Coana line left by an earlier unreleased bump instead of stacking a
second one. Rerunning it for the same version changes nothing.

🚨 **Never write a `## [<version>]` heading.** Release headings belong to the
release workflow, which promotes the whole `## [Unreleased]` block under the
version it derives. Writing one here both names a version that may never exist
and consumes the block, leaving the real release with empty notes.

🚨 **Never put a date on the `## [Unreleased]` heading.** `unreleasedRange()` in
`scripts/release/changelog.mts` finds the block by matching that heading for
equality (case-insensitively, but otherwise exactly), so a heading like
`## [Unreleased] - 2026-08-27` is invisible to it. The release then promotes
nothing, falls back to a section derived from the commits in range, and inserts
its own heading *above* the block it could not see — stranding the entry below a
released version, where no release will ever pick it up. Dates belong only on
release headings, which the workflow writes. (The helper repairs such a heading
if it finds one; hand-editing is what puts one there.)

**Resulting shape**:
```markdown
## [Unreleased]

### Changed
- Updated the Coana CLI to v `COANA_VERSION`.
```

### Step 4: Create Branch and Commit

```bash
# Create branch
git checkout -b "coana-$COANA_VERSION"

# Stage changes
git add src/constants.mts CHANGELOG.md

# Commit (skip pre-commit hooks with -n)
git commit -n -m "upgrading coana to version $COANA_VERSION"
```

### Step 5: Push and Create PR

```bash
# Push branch
git push -u origin "coana-$COANA_VERSION"

# Create PR targeting v1.x branch
gh pr create --base v1.x --title "upgrading coana to version $COANA_VERSION" --body "$(cat <<'EOF'
## Summary
- Upgrades the Coana CLI from CURRENT_VERSION to COANA_VERSION

## Coana Changelog
For details on what's included in this Coana release, see the [Coana Changelogs](https://docs.coana.tech/changelogs).
EOF
)"
```

Replace `CURRENT_VERSION` and `COANA_VERSION` with actual values.

## Output

- Branch: `coana-<VERSION>` pushed to origin
- PR: Created targeting `v1.x` branch
- Files modified: `src/constants.mts` (the `COANA_CLI_VERSION` line only),
`CHANGELOG.md` (under `## [Unreleased]`)

Report the PR URL to the user when complete.

## Error Handling

- **No version provided**: Ask user for the version number
- **Invalid version format**: Report error with expected format
- **PR creation fails**: Verify `gh` CLI is authenticated

## Important Notes

- Do NOT add any AI/Claude co-authorship or attribution to the commit message or PR.
- Do NOT include "Generated with Claude Code" or similar text anywhere.
- Do NOT bump `package.json`'s `version` or write a `## [<version>]` changelog
heading. Both belong to the release workflow. Hand-writing them has produced
versions that never released and cost a real release its notes entirely.
Leave release headings and the top-level package version to the release
workflow.
4. Run `pnpm run test:unit:snapshot-dependencies`. Create one signed
conventional commit and open a PR against `v1.x`.
11 changes: 11 additions & 0 deletions .claude/skills/bump-coana/references/pin-and-snapshots.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Coana pin and snapshot paths

- The pinned version is `COANA_CLI_VERSION` in `src/constants.mts`.
- The native CLI snapshots that print this version are listed under `coana` in
`scripts/test/snapshot-dependencies.mts`. The checked-in files are the fix,
scan-create, and scan-reach help snapshots.
- Use `node scripts/test/swap-snapshot-version.mts --dep coana --from <old>` to
preserve the terminal row width without a native build. If it refuses the
change, regenerate with `pnpm snapshots:update:dep coana` on a built native
CLI.
- Coana runs from its Socket API download. SEA does not bundle it.
31 changes: 31 additions & 0 deletions .claude/skills/bump-node-sea/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
name: bump-node-sea
description: Update the Node runtime bundled in the native CLI. Use when changing src/sea/.node-version.
user-invocable: true
---

# Bump the SEA Node runtime

Take the exact official Node release version as `$ARGUMENTS`; ask if missing.
Read [the Node pin reference](references/pin-and-qualification.md), then update
`src/sea/.node-version`.

Confirm the official Node release publishes the required archive for each
supported SEA target and exposes the SEA/VFS APIs the builder uses. Build the
native prototype first. It updates the README marker from the new pin:

```sh
pnpm build:sea -- --prototype
```

Then run the Node pin and SEA builder tests:

```sh
pnpm run test:unit \
test/unit/sea/version.test.mts test/unit/sea/build-sea.test.mts
```

Check that `src/sea/README.md`'s marked version follows the pin. Do not claim
qualification for a target that was not built and tested. Add a changelog
entry when the runtime change affects released binaries. Create one signed
conventional commit and a PR against `v1.x`.
11 changes: 11 additions & 0 deletions .claude/skills/bump-node-sea/references/pin-and-qualification.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Node SEA pin and qualification

- `src/sea/.node-version` is the source pin. `src/sea/node-version.mts` reads
it, and the README version markers are updated from that value during the SEA
build.
- `src/sea/build-sea.mts` downloads the official Node archive and verifies it
against that release's `SHASUMS256.txt` before building.
- The builder relies on the Node SEA VFS API. Check the release notes and build
on the intended OS/architecture before describing it as qualified.
- Read [the SEA build notes](../../../../src/sea/README.md) for target support
and experimental status.
48 changes: 48 additions & 0 deletions .claude/skills/bump-socket-patch/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
name: bump-socket-patch
description: Bump the pinned Socket Patch package and refresh its native CLI version snapshot. Use when updating @socketsecurity/socket-patch.
user-invocable: true
---

# Bump Socket Patch

Take the exact released version as `$ARGUMENTS`. Ask for it if missing. Read
[the pin and SEA notes](references/pin-and-sea.md), then:

1. Read the current exact `@socketsecurity/socket-patch` pin from
`package.json`.
2. Update it with `pnpm add --save-exact "@socketsecurity/socket-patch@$ARGUMENTS"`.
3. Refresh the native version screenshot without rebuilding:

```sh
node scripts/test/swap-snapshot-version.mts --dep socket-patch --from <old-version>
```

If the helper reports no matching version or insufficient row space, use
`pnpm snapshots:update:dep socket-patch` with a native build.
4. Add or replace the Unreleased entry:

```sh
node scripts/release/add-unreleased.mts \
--replace '^Updated @socketsecurity/socket-patch to v' \
"Updated @socketsecurity/socket-patch to v $ARGUMENTS."
```

Never write a release heading or change the top-level CLI version.
5. Run the snapshot checks and refresh the native snapshots:

```sh
pnpm run test:unit:snapshot-dependencies
pnpm run test:unit test/unit/sea/build-sea.test.mts
pnpm snapshots:update:dep socket-patch
```

Review any changed help snapshots. Inspect the generated
`build/sea/*.manifest.json` to confirm the target records the new patch
version and its executable/license payloads.
6. Create one signed conventional commit and a PR against `v1.x` titled
`build(deps): update Socket Patch to v<version>`.

Keep the change scoped to the package pin, lockfile, affected snapshots,
changelog entry, and any verified redistribution metadata needed by that
release.
14 changes: 14 additions & 0 deletions .claude/skills/bump-socket-patch/references/pin-and-sea.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Socket Patch pin and SEA notes

- The source pin is `dependencies.@socketsecurity/socket-patch` in
`package.json`; pnpm records the resolved package and platform variants in
`pnpm-lock.yaml`.
- `scripts/test/snapshot-dependencies.mts` lists the native help snapshots and
the version snapshot. The version snapshot is the one that changes with a
package version bump.
- `src/sea/build-sea.mts` reads the exact package version, verifies installed
metadata and lockfile integrity, and stages the target executable plus its
license into the SEA VFS.
- Read [the SEA build notes](../../../../src/sea/README.md) before changing
bundled-tool or notice behavior. Verify platform packages and license files
against their upstream sources.
27 changes: 27 additions & 0 deletions .claude/skills/bump-socket/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
name: bump-socket
description: Prepare the next Socket CLI npm release on stable v1.x or the native 2.1 prerelease track.
user-invocable: true
---

# Prepare a Socket CLI release

Take `v1` or `native` as `$ARGUMENTS`; ask if the lane is missing or unclear.
Use the release workflow; do not edit package versions or changelog headings
by hand. Read [the release lanes](references/release-lanes.md), then dispatch a
dry run for the requested lane:

```sh
# Stable v1.x: socket, @socketsecurity/cli, and @socketsecurity/cli-with-sentry
gh workflow run publish-npm.yml --ref v1.x \
-f mode=release-pr -f dry-run=true -f release-major=1

# Native 2.1 prerelease: socket only
gh workflow run publish-npm.yml --ref v1.x \
-f mode=release-pr -f dry-run=true -f release-major=2
```

Review the proposed version and changelog output. If the requested task is to
prepare the release PR, rerun with `dry-run=false`; do not ask again for that
authorization. Do not dispatch `mode=publish` as part of bump preparation.
Report the workflow run and resulting PR.
Loading
Loading