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
42 changes: 42 additions & 0 deletions .github/workflows/skills-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: skills-ci

on:
push:
paths:
- 'skills/**'
- 'scripts/**'
- 'tests/**'
- 'evals/**'
- '.release-policy.yml'
- '.github/workflows/skills-*.yml'
pull_request:
paths:
- 'skills/**'
- 'scripts/**'
- 'tests/**'
- 'evals/**'
- '.release-policy.yml'
- '.github/workflows/skills-*.yml'

permissions:
contents: read

jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- uses: actions/setup-node@v4
with:
node-version: '20'
- name: Validate skills
run: python scripts/validate_skills.py
- name: Run repository tests
run: python -m unittest discover -s tests -v
- name: Smoke discovery
run: npx --yes skills@1.5.19 add . --list
191 changes: 191 additions & 0 deletions .github/workflows/skills-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
name: skills-release

on:
push:
branches: [main]
paths:
- 'skills/**'
- 'scripts/**'
- '.release-policy.yml'
- '.github/workflows/skills-release.yml'
workflow_dispatch:
inputs:
version_override:
description: 'Optional explicit version tag (vX.Y.Z)'
required: false
type: string
bump_type:
description: 'Semver bump type when no version_override is set'
required: false
default: 'patch'
type: choice
options:
- patch
- minor
- major
- auto

permissions:
contents: read

concurrency:
group: skills-release
cancel-in-progress: false

jobs:
verify:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- uses: actions/setup-node@v4
with:
node-version: '20'

- name: Validate skills
run: python scripts/validate_skills.py

- name: Run repository tests
run: python -m unittest discover -s tests -v

- name: Smoke discovery
run: npx --yes skills@1.5.19 add . --list

release:
needs: verify
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: read
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Read release policy
id: policy
run: |
python - << 'PY'
import re
from pathlib import Path

txt = Path('.release-policy.yml').read_text(encoding='utf-8')
m = re.search(r"(?im)^\s*auto_release\s*:\s*(true|false)\s*(?:#.*)?$", txt)
auto = bool(m and m.group(1).lower() == 'true')
with open(Path.cwd() / '.policy_out', 'w', encoding='utf-8') as f:
f.write(f"auto_release={'true' if auto else 'false'}\n")
PY
cat .policy_out >> "$GITHUB_OUTPUT"

- name: Decide whether release is allowed
id: gate
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "should_release=true" >> "$GITHUB_OUTPUT"
elif [ "${{ steps.policy.outputs.auto_release }}" = "true" ]; then
echo "should_release=true" >> "$GITHUB_OUTPUT"
else
echo "should_release=false" >> "$GITHUB_OUTPUT"
fi

- name: Stop (policy gate)
if: steps.gate.outputs.should_release != 'true'
run: echo "Release policy disabled for push events; exiting successfully."

- name: Determine bump from PR labels
if: steps.gate.outputs.should_release == 'true' && github.event_name == 'push'
id: prlabels
uses: actions/github-script@v7
with:
script: |
const {owner, repo} = context.repo;
let bump = 'patch';
try {
const prs = await github.rest.repos.listPullRequestsAssociatedWithCommit({
owner,
repo,
commit_sha: context.sha,
});
if (prs.data && prs.data.length > 0) {
const labels = (prs.data[0].labels || []).map(l => l.name);
if (labels.includes('release:major')) bump = 'major';
else if (labels.includes('release:minor')) bump = 'minor';
}
} catch (e) {
core.warning(`Could not infer PR labels: ${e.message}`);
}
core.setOutput('bump', bump);

- name: Compute version
if: steps.gate.outputs.should_release == 'true'
id: version
env:
INPUT_BUMP: ${{ github.event.inputs.bump_type }}
INPUT_VERSION: ${{ github.event.inputs.version_override }}
PUSH_BUMP: ${{ steps.prlabels.outputs.bump }}
run: |
if [ -n "${INPUT_VERSION:-}" ]; then
VERSION=$(python scripts/compute_next_version.py --validate "$INPUT_VERSION")
else
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
BUMP="${INPUT_BUMP:-patch}"
else
BUMP="${PUSH_BUMP:-patch}"
fi
VERSION=$(python scripts/compute_next_version.py --bump "$BUMP")
fi
echo "version=$VERSION" >> "$GITHUB_OUTPUT"

- name: Check tag does not already exist
if: steps.gate.outputs.should_release == 'true'
run: |
if git show-ref --verify --quiet "refs/tags/${{ steps.version.outputs.version }}"; then
echo "Tag ${{ steps.version.outputs.version }} already exists" >&2
exit 1
fi

- name: Determine release range
if: steps.gate.outputs.should_release == 'true'
id: range
run: |
PREV=$(git tag --list 'v*' --sort=-v:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | head -n 1 || true)
if [ -n "$PREV" ]; then
FROM="$PREV"
else
FROM=$(git hash-object -t tree /dev/null)
fi
echo "from_ref=$FROM" >> "$GITHUB_OUTPUT"
echo "to_ref=${GITHUB_SHA}" >> "$GITHUB_OUTPUT"

- name: Build release notes
if: steps.gate.outputs.should_release == 'true'
run: |
python scripts/build_release_notes.py \
--from-ref "${{ steps.range.outputs.from_ref }}" \
--to-ref "${{ steps.range.outputs.to_ref }}" \
--version "${{ steps.version.outputs.version }}" \
--repo "${{ github.repository }}" \
--output RELEASE_NOTES.md

- name: Create and push tag
if: steps.gate.outputs.should_release == 'true'
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git tag "${{ steps.version.outputs.version }}" "${GITHUB_SHA}"
git push origin "${{ steps.version.outputs.version }}"

- name: Create GitHub release
if: steps.gate.outputs.should_release == 'true'
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.version.outputs.version }}
name: ${{ steps.version.outputs.version }}
body_path: RELEASE_NOTES.md
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Local skill-installer outputs
.agents/
.claude/
.junie/
.kiro/
.windsurf/
skills-lock.json

# Python test/cache outputs
__pycache__/
*.py[cod]
.pytest_cache/
1 change: 1 addition & 0 deletions .release-policy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
auto_release: false
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 Gecode

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
104 changes: 104 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,105 @@
# Gecode Skills

Canonical skill repository for the umbrella Gecode AI agent skill.

[Gecode](https://www.gecode.org/) 6.4.0 is the current knowledge and compatibility baseline. Repository releases use an independent semantic version because the skill can evolve between Gecode releases.

Install with:

```bash
npx skills add Gecode/gecode-skills
```

List available skills:

```bash
npx skills add Gecode/gecode-skills --list
```

Install a single skill:

```bash
npx skills add Gecode/gecode-skills --skill gecode
```

## Available Skill

- `gecode`

The skill routes internally to focused reference documents for:
- Gecode architecture and runtime semantics
- modeling and search setup
- custom propagators
- custom branchers
- memory management
- built-in search engines
- custom search engine implementation
- downstream CMake consumption

## Versioning and distribution

- GitHub releases are immutable snapshots of this repository, starting with `v1.0.0`.
- The standard `npx skills add Gecode/gecode-skills` command installs from the public repository's default branch.
- A new Gecode release normally causes a minor skill release when it adds or changes substantial guidance; corrections and refinements are patch releases.
- Major releases are reserved for incompatible skill structure or behavior changes.
- skills.sh discovers the public skill automatically after an installation through the `skills` CLI; there is no separate package upload.

## Contributing

### Verification

Run the structural validator and repository regression tests locally:

```bash
python scripts/validate_skills.py
python -m unittest discover -s tests -v
```

The CI smoke test also checks that the skill is discoverable by the skills CLI:

```bash
npx --yes skills add . --list
```

### Skill structure

The skill must be under:

- `skills/<skill-name>/SKILL.md`

Optional metadata for UIs can be added at:

- `skills/<skill-name>/agents/openai.yaml`

### Required frontmatter

`SKILL.md` must include YAML frontmatter with:

- `name`
- `description`

The `name` must match the directory name (`<skill-name>`).

### Release bump labels

Auto-release determines semver bump from PR labels:

- `release:major` -> major bump
- `release:minor` -> minor bump
- no label -> patch bump

## Release policy

Releases are controlled by `.release-policy.yml`.

- Initially: `auto_release: false`
- This means pushes to `main` do **not** auto-release.
- Manual release via workflow dispatch is enabled.

To enable auto-release later, set:

```yaml
auto_release: true
```

and merge that change with maintainer review.
Loading
Loading