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
8 changes: 7 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,16 @@ open-workflows/
│ ├── doc-sync/ # AI-powered
│ │ ├── action.yml
│ │ └── skill.md
│ ├── changeset/ # AI-powered
│ │ ├── action.yml
│ │ └── skill.md
│ └── release/ # No AI - pure script
│ ├── action.yml
│ └── src/publish.ts
├── scripts/ # OpenCode custom tools (copied to ~/.config/opencode/tool/)
│ ├── submit-review.ts # PR review tool
│ └── apply-labels.ts # Issue labeling tool
│ ├── apply-labels.ts # Issue labeling tool
│ └── write-changeset.ts # Changeset file writer
├── src/
│ └── cli/ # Workflow installer CLI
│ ├── index.ts
Expand All @@ -43,6 +47,7 @@ open-workflows/
| `pr-review` | Yes | AI code review, posts sticky comment |
| `issue-label` | Yes | Auto-labels based on content |
| `doc-sync` | Yes | Syncs docs with code changes |
| `changeset` | Yes | AI-generated changesets for monorepo releases |
| `release` | No | Semantic versioning + npm publish with provenance |

## WHERE TO LOOK
Expand All @@ -64,6 +69,7 @@ Tools in `scripts/` are copied to `~/.config/opencode/tool/` at runtime.
|--------|---------|
| `submit-review.ts` | Post/update sticky PR comment |
| `apply-labels.ts` | Create + apply labels |
| `write-changeset.ts` | Write changeset files to `.changeset/` |

## RELEASE SCRIPT

Expand Down
41 changes: 40 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ The CLI will prompt you to select workflows and install them to `.github/workflo
| `pr-review` | Yes | AI-powered code reviews |
| `issue-label` | Yes | Auto-label issues based on content |
| `doc-sync` | Yes | Keep docs in sync with code changes |
| `changeset` | Yes | AI-generated changesets for monorepo releases |
| `release` | No | Semantic versioning with npm provenance |

## Manual Usage
Expand Down Expand Up @@ -72,6 +73,38 @@ jobs:

No NPM_TOKEN needed - uses OIDC trusted publishing with provenance.

### Changeset Action (AI-Powered)

```yaml
name: AI Changeset
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
changeset:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.head_ref }}
token: ${{ secrets.GITHUB_TOKEN }}
- uses: activadee/open-workflows/actions/changeset@main
with:
mode: commit # or 'comment' to suggest via PR comment
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
```

The changeset action analyzes PR changes and generates [Changesets](https://github.com/changesets/changesets) files automatically:
- Detects which packages are affected in monorepos
- Infers version bump type from conventional commits
- Writes user-facing changelog entries

## Authentication

### For AI Actions
Expand Down Expand Up @@ -107,12 +140,18 @@ OPTIONS

## How It Works

**AI Actions (pr-review, issue-label, doc-sync):**
**AI Actions (pr-review, issue-label, doc-sync, changeset):**
1. Workflow triggers on GitHub event
2. Composite action sets up Bun and OpenCode
3. OpenCode runs with the bundled skill
4. AI analyzes content and takes action

**Changeset Action:**
1. Triggers on PR open/update
2. AI analyzes diff, commits, and PR description
3. Generates `.changeset/<random>.md` with package bumps and changelog
4. Either commits to PR branch or suggests via comment

**Release Action:**
1. Manually triggered with version bump type
2. Generates changelog from git commits
Expand Down
46 changes: 46 additions & 0 deletions actions/changeset/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: 'AI Changeset'
description: 'AI-powered changeset generation for monorepo releases'
author: 'activadee'

inputs:
model:
description: 'Model to use for changeset generation'
required: false
default: 'anthropic/claude-sonnet-4-5'
mode:
description: 'Operation mode: commit (auto-commit changeset) or comment (suggest via PR comment)'
required: false
default: 'commit'

runs:
using: 'composite'
steps:
- name: Setup Bun
uses: oven-sh/setup-bun@v2

- name: Setup OpenCode auth
if: env.OPENCODE_AUTH != ''
shell: bash
run: |
mkdir -p ~/.local/share/opencode
echo "$OPENCODE_AUTH" > ~/.local/share/opencode/auth.json
- name: Install opencode-ai
shell: bash
run: |
curl -fsSL https://opencode.ai/install | bash
- name: Install skill and tools
shell: bash
run: |
mkdir -p .opencode/skill/changeset
cp "${{ github.action_path }}/skill.md" .opencode/skill/changeset/SKILL.md
mkdir -p ~/.config/opencode/tool
cp "${{ github.action_path }}/../../scripts/"*.ts ~/.config/opencode/tool/
cd ~/.config/opencode && bun add @opencode-ai/plugin

- name: Generate Changeset
shell: bash
run: |
opencode run --model "${{ inputs.model }}" \
"Load the changeset skill. Generate changeset for PR ${{ github.event.pull_request.number }} in mode: ${{ inputs.mode }}"
env:
GITHUB_TOKEN: ${{ github.token }}
Loading