AGENT SKILL

multi-channel-release

Standardized playbook and operational invariants for end-to-end multi-channel releases of Context Crystal across GitHub Releases, Maven Central (Sonatype Central Portal), Homebrew, and Coursier.

License 许可
MIT
最近更新
2026-10-22
Stars
★ 0
Forks
0

01 前言 Front Matter

name
multi-channel-release
metadata
{ "version": "1.0", "schemaVersion": "1.0.0" }
description
Standardized playbook and operational invariants for end-to-end multi-channel releases of Context Crystal across GitHub Releases, Maven Central (Sonatype Central Portal), Homebrew, and Coursier.

03 SKILL.md 正文

Multi-Channel Release Skill

This skill codifies the complete operational lifecycle, architecture invariants, and automated verification procedures for releasing Context Crystal across all public distribution vectors:

  1. Maven Central (Sonatype Central Portal): JVM binaries and library dependencies (io.github.oswaldo:ccrystal-cli_3, ccrystal-core_3).
  2. GitHub Releases: Prebuilt standalone native binaries for 4 target architectures (linux-x86_64, linux-aarch64, macos-aarch64, macos-x86_64) and consolidated SHA256SUMS.
  3. Homebrew: Standalone tap formula (oswaldo/homebrew-context-crystal).
  4. Coursier Application Channels: In-repo descriptor (apps.json) and upstream catalog (coursier/apps).
  5. Universal OS Support: Windows, Linux, macOS, and BSD execution via the JVM runtime.

1. Architectural Invariants & Hard-Learned Lessons

A. Sonatype Central Portal & sbt Requirements

  • sbt 1.11+ / 1.13+ Requirement: Publishing to the modern Sonatype Central Portal relies on the built-in localStaging resolver. Older versions of sbt (<= 1.10.x) lack localStaging, causing sbt-ci-release to fail with Repository for publishing is not specified. Always use sbt 1.13.0+.
  • sbt-ci-release 1.12.x Decoupling: Modern sbt-ci-release relies directly on sbt's native localStaging and sbt-dynver. Do not add redundant sbt-sonatype or obsolete endpoint keys (sonatypeCredentialHost, sonatypeRepository) in build.sbt.
  • Mandatory versionScheme: Always declare ThisBuild / versionScheme := Some("early-semver") in build.sbt to satisfy eviction verification.
  • Explicit scmInfo (Forge Privacy Invariant): Do not rely on git remotes to infer scmInfo. In multi-forge setups where origin points to a private developer forge (Codeberg), explicitly set ThisBuild / scmInfo in build.sbt pointing to the public GitHub repository. This prevents leaking private forge URLs into published Maven POMs.
  • Asynchronous Validation Queues: Sonatype's automated verification queue extracts .asc signatures, verifies keys against public keyservers (keyserver.ubuntu.com, keys.openpgp.org), checks POM schemas, and lints javadocs. This process typically takes 3 to 15 minutes. The upload payload is small (~3.2 MB total across CLI and Core JARs); elapsed time is server-side verification queue latency.
  • Immutability Invariant: Maven Central releases are strictly immutable. Once a version (e.g. 1.0.1) is published, it can never be deleted or overwritten. Never burn a release version on an unverified build.

B. Upstream coursier/apps PR Invariants

  • Runnable Dependencies Required: 100% of apps in coursier/apps require runnable JVM coordinates under "dependencies". cs launch strictly constructs classpaths from "dependencies"; declaring placeholder libraries causes cs launch to crash. Always declare:

    "dependencies": [
      "io.github.oswaldo:ccrystal-cli_3:latest.release"
    ]
    
  • Launcher Type Idiom: Use "launcherType": "scala-native" for Scala Native executables.

  • Dynamic ${version} Interpolation: Use v${version} in prebuiltBinaries with the gz+ tarball extraction scheme so future releases automatically resolve without modifying the descriptor:

    "x86_64-pc-linux": "gz+https://github.com/oswaldo/context-crystal/releases/download/v${version}/ccrystal-v${version}-linux-x86_64.tar.gz!ccrystal"
    
  • Explicit Main Class Fallback: Include "mainClass": "ccrystal.cli.Main?" as standard defensive metadata.

  • Strict check-pr-scope Invariant: Upstream coursier/apps enforces a strict CI check (.github/workflows/check-pr-scope.yml) that forbids mixing hand-written descriptors with generated listing aggregations. NEVER commit listings/ in PRs. Only touch apps-contrib/resources/ccrystal.json.

  • GitHub Channel Branch Shorthand (gh:org/repo/branch): When referencing an in-repo apps.json channel on the main branch via Coursier's gh: shorthand, always use a slash (gh:oswaldo/context-crystal/main), never a colon (gh:oswaldo/context-crystal:main). Coursier interprets :main after the repository name as a file path on the default master branch (master/main), resulting in HTTP 404.

C. Collaborative Release Notes Protocol

  • User-Facing Deliverable Focus: Release notes are public product communications. They must focus strictly on tangible user- and AI-facing deliverables:
    • New features and CLI capabilities
    • Bug fixes and reliability hardening
    • Installation and upgrade methods
    • Public API and library additions
  • Strict Exclusion of Meta-Rules: Repo-internal process improvements, governance guidelines codified into AGENTS.md, agent prompt engineering, and developer-internal workflows are not external deliverables and must be strictly excluded from public release notes.

D. Zero-Telemetry Terminology Invariant

  • 100% Local & Sovereign: Context Crystal is strictly offline, deterministic, and local-first. Never use the word "telemetry" in user-facing CLI options, command descriptions, release communications, or public documentation to describe local workspace inspection, storage accounting, or token savings. Avoid surveillance and phone-home stigmas; prefer metrics, statistics, accounting, observability, or inspection.

2. Pre-Release Verification Checklist

Execute the complete verification sequence prior to cutting any release tag:

# 1. Code formatting and linter checks
sbt "scalafmtCheckAll; scalafixAll --check"

# 2. Markdown documentation linting
npx markdownlint-cli "README.md" "AGENTS.md" "docs/*.md" "skills/**/SKILL.md"

# 3. Shell script verification
npx shellcheck install.sh && find skills -name "*.sh" -exec npx shellcheck {} +

# 4. Full cross-platform test matrix (Native, JVM, JS)
sbt test

# 5. Local dry-run packaging and POM verification
sbt "coreJVM/publishLocal; cliJVM/publishLocal"

3. Release Execution Sequence

Step 1: Draft and Commit User-Facing Release Notes

  1. Draft release notes adhering strictly to the User-Facing Deliverable Focus rule, present them to the human operator, and obtain explicit sign-off before tagging.
  2. Save the approved notes to docs/releases/<version>.md (e.g. docs/releases/v1.0.2.md) and commit to main. The .github/workflows/release.yml workflow automatically detects this file and injects it as the official GitHub Release body, falling back to auto-generated commit logs only if no file exists.

Step 2: Create and Sign Git Tag

# Example: Cutting patch release v1.0.2
git tag -s v1.0.2 -m "Release v1.0.2: <User-facing summary>"

# Verify tag signature and version resolution
git tag -v v1.0.2
sbt "cliJVM/version"  # Must output exact tag version without -SNAPSHOT

Step 3: Push Gate (Human-in-the-Loop)

Instruct the operator to push the tag and branch using their locked transport key:

git push github main && git push origin main
git push github v1.1.0 && git push origin v1.1.0

[!TIP] Unified Push Helper Script Pattern: When a release touches multiple repositories or remotes (context-crystal, homebrew-context-crystal, context-crystal-gh-pages), the agent should generate a clean, temporary POSIX helper script (/tmp/push_release_bundle.sh) with set -euo pipefail and executable permissions. This allows the operator to execute the push sequence with their locked transport key in a single turn without repetitive cross-terminal copy-pasting. Remove the helper script immediately after the pushes succeed.

Step 4: Monitor Release Workflow

Track GitHub Actions run for .github/workflows/release.yml:

  1. build-release-matrix: Compiles native binaries for linux-x86_64, linux-aarch64, macos-aarch64, and macos-x86_64.
  2. publish-release: Publishes GitHub Release with native .tar.gz bundles and SHA256SUMS.
  3. publish-maven-central: Runs sbt ci-release, uploading signed JVM artifacts to Sonatype Central Portal.
  4. verify-release-smoke: Automatically runs post-release clean-room smoke verification (install.sh checksum verification and atomic ccrystal batch DAG lifecycle) across both ubuntu-latest and macos-14 runners so release integrity does not depend on which machine triggered the release.

4. Post-Release Synchronization

Once the GitHub Release and Maven Central publishing succeed:

1. Synchronize Homebrew Formula (Formula/ccrystal.rb)

  1. Fetch fresh checksums from https://github.com/oswaldo/context-crystal/releases/download/v<version>/SHA256SUMS.
  2. Update version and platform SHA256 checksums in Formula/ccrystal.rb.
  3. Copy updated formula to downstream tap repository oswaldo/homebrew-context-crystal and push.

2. Synchronize Coursier Application Channel (apps.json)

Verify that root apps.json and upstream apps-contrib/resources/ccrystal.json maintain dynamic ${version} and "io.github.oswaldo:ccrystal-cli_3:latest.release".

3. Update Web Showcase Portal & llms.txt (../context-crystal-gh-pages)

Always execute the complete portal release synchronization checklist:

  1. Brand Badge: Update the version string in site/Header.scala (span(className := "brand-badge", "v<version> • ...")).
  2. MCP Tool Catalog: Update tool counts and table entries in site/TabMcp.scala to reflect new or modified tools.
  3. Platform Matrix: Verify platform compiler and linker optimizations in site/TabQuickstart.scala.
  4. Cache Busting Invariant: Update the script tag in index.html with a version query string (<script type="module" src="main.js?v=<version>"></script>) to immediately bust browser caches for returning visitors.
  5. AI Discovery: Update /llms.txt and /llms-full.txt with the new version number, commands, and MCP tools.
  6. Bundle Recompilation: Recompile the static bundle with scala-cli --power package site --js-mode release -o main.js --force.
  7. Commit & Push: Commit changes to gh-pages and push via the operator push gate.

5. Clean-Room Smoke Verification

Verify that official installation pathways succeed on target environments. Always use isolated temporary directories (--to and --install-dir) when smoke testing on an operator or developer machine so you do not shadow the active PATH binary (e.g., Homebrew) or leave dangling symlinks in ~/.local/bin or Coursier's bin directory:

SMOKE_DIR="$(mktemp -d)"

# 1. Universal POSIX bootstrap (Linux / macOS Native, isolated --to)
curl -fsSL https://raw.githubusercontent.com/oswaldo/context-crystal/main/install.sh | sh -s -- --to "$SMOKE_DIR/posix"
"$SMOKE_DIR/posix/ccrystal" --store "$SMOKE_DIR/store" batch "init smoke -g 'Smoke test'; conclude smoke -s 'Verified'"

# 2. Homebrew
brew upgrade oswaldo/context-crystal/ccrystal || brew install oswaldo/context-crystal/ccrystal
ccrystal --help

# 3. Coursier Zero-Install (Universal: Windows, Linux, macOS, BSD)
cs launch io.github.oswaldo:ccrystal-cli_3:latest.release -- --help

# 4. Coursier Local Install (isolated --install-dir, using /main branch syntax)
cs install --channel gh:oswaldo/context-crystal/main --install-dir "$SMOKE_DIR/cs" ccrystal
"$SMOKE_DIR/cs/ccrystal" --help

rm -rf "$SMOKE_DIR"

04 同仓库更多 Skills