AgentSkillsCN

release-core

执行 sum-core 发布流程。同步至公共 sum-core 仓库,并创建版本标签。适用于“发布 vX.Y.Z”请求时使用。

SKILL.md
--- frontmatter
name: release-core
description: Execute sum-core release workflow. Syncs to public sum-core repo and creates version tag. Use for "Release vX.Y.Z" requests.
disable-model-invocation: true
allowed-tools: Bash, Read, Write, Edit, Grep
argument-hint: <version>

Release Core Skill

Execute a full sum-core release following the established workflow.

Key constraint: Tags are created on sum-core (public repo) because that's what pip install references.


Input

Required: Version number (e.g., v0.7.0 or 0.7.0)

If $ARGUMENTS doesn't include a version, ASK the user before proceeding.


Pre-Flight Checks

Before starting, verify:

  1. Version Declaration exists for this version
  2. All Work Orders are Done
  3. Release branch exists: release/X.Y.0
bash
# Check release branch exists
git branch -a | grep "release/$VERSION"

# Check Version Declaration (search GitHub issues)
gh issue list --label "type:version-declaration" --search "v$VERSION"

If any are missing: STOP and report what's needed.


Phase 1: Verify Release Branch

bash
git checkout release/X.Y.0
git pull origin release/X.Y.0
git status  # Must be clean

make release-check

If make release-check fails: STOP and report failures.


Phase 2: Update Versions

bash
# Update boilerplate pinning
make release-set-core-ref REF=vX.Y.0

Manually edit these files:

FileChange
core/pyproject.tomlversion = "X.Y.0"
core/sum_core/__init__.py__version__ = "X.Y.0"
pyproject.tomlversion = "X.Y.0"
CHANGELOG.mdAdd release entry

Phase 3: Commit and PR to Develop

bash
git add -A
git commit -m "chore(release): prepare vX.Y.0"
git push origin release/X.Y.0

Create PR:

bash
cat > /tmp/pr-body.md <<'EOF'
## Release vX.Y.0

### Features
- [Feature 1] (#WO-NNN)
- [Feature 2] (#WO-NNN)

### Verification
- `make release-check` passed
- All Work Orders complete

Refs #NNN (Version Declaration)
EOF

gh pr create \
  --base develop \
  --head release/X.Y.0 \
  --title "Release vX.Y.0" \
  --body-file /tmp/pr-body.md

Report to user:

code
Release PR created: [link]

Please:
1. Run release audit
2. Review and squash-merge when ready
3. Reply "merged to develop" to continue

WAIT for user confirmation before proceeding.


Phase 4: PR Develop to Main

After user confirms merge to develop:

bash
git checkout develop
git pull origin develop

Create PR to main:

bash
cat > /tmp/pr-body.md <<'EOF'
## Release vX.Y.0

Production release of vX.Y.0.

### Changes
- [Summary of changes]

### Pre-merge Verification
- `make release-check` passed
- Release audit passed
EOF

gh pr create \
  --base main \
  --head develop \
  --title "Release vX.Y.0" \
  --body-file /tmp/pr-body.md

Report to user:

code
PR to main created: [link]

Please review and squash-merge.
Reply "merged to main" to continue with sync and tag.

WAIT for user confirmation before proceeding.


Phase 5: Sync and Tag

After user confirms merge to main:

bash
git checkout main
git pull origin main

python scripts/sync_to_public.py \
  --public-repo-url git@github.com:markashton480/sum-core.git \
  --version vX.Y.0

This script:

  1. Clones/updates sum-core to /tmp/sum-core-sync
  2. Copies allowed paths
  3. Commits and pushes
  4. Creates annotated tag
  5. Pushes tag

Phase 6: Verification

bash
# Verify tag exists
git ls-remote --tags git@github.com:markashton480/sum-core.git | grep vX.Y.0

# Test scaffolding
cd /tmp
sum init test-release-vX.Y.0
cd test-release-vX.Y.0
sum check

# Test pip install
python -m venv /tmp/test-venv
source /tmp/test-venv/bin/activate
pip install "sum_core @ git+https://github.com/markashton480/sum-core.git@vX.Y.0"
python -c "import sum_core; print(f'Version: {sum_core.__version__}')"
deactivate

# Cleanup
rm -rf /tmp/test-release-vX.Y.0 /tmp/test-venv /tmp/sum-core-sync

Phase 7: Report Success

code
Release vX.Y.0 complete!

Tag: https://github.com/markashton480/sum-core/releases/tag/vX.Y.0
- Scaffolding verified
- pip install verified

Next steps:
- Close Version Declaration issue
- Clean up feature branches (optional)
- Announce release (if applicable)

Error Handling

Pre-flight fails

code
Release blocked

Missing:
- [ ] Version Declaration #NNN
- [ ] Work Order #NNN not Done
- [ ] release/X.Y.0 branch doesn't exist

Please resolve before releasing.

Release check fails

code
make release-check failed

Failures:
- [specific failures]

Fix issues on release/X.Y.0 and try again.

Sync fails

code
Sync to sum-core failed

Error: [details]

Please resolve and reply "retry sync".

Tag exists

code
Tag vX.Y.0 already exists

Options:
1. Use next patch: vX.Y.1
2. Investigate why tag exists

Reply with choice.

Safety Rules

  1. Never force-push tags - Create new patch version instead
  2. Never skip checks - make release-check must pass
  3. Always wait for human - Do NOT merge PRs automatically
  4. Verify before reporting success - Run scaffolding test