This repository is a proof of concept that shows how to run AI-assisted SDLC workflows on GitHub using OpenCode GitHub Action, instead of relying on Copilot-specific workflows.
Reference documentation:
Try to use an alternative to Github Copilot agents with some alternative and cheaper models like MiniMax or Qwen.
OpenCode caught my attention: it's an open-source AI coding tool that supports multiple model providers, meaning you can plug in whatever model fits your budget — including cheap or free-tier options — without being locked into a single vendor.
This repository tests whether the core Copilot-for-PRs/issues developer loop can be replicated using OpenCode running inside GitHub Actions:
- No Copilot subscription required
- Full control over agent behavior via config files in the repo
- Works with any model provider supported by OpenCode
- Comment-driven commands in GitHub (
/oc ...or/opencode ...) - A triage agent that delegates work to specialist subagents
- Separate agent behaviors for planning, implementation, and review
- Full automation loop for implementation: code changes, branch update, and PR creation via the OpenCode GitHub Action
- Workflow: .github/workflows/opencode.yml
- Triggered by:
issue_commentcreatedpull_request_review_commentcreated
- Runs
anomalyco/opencode/github@latestwithagent: triage
- Triage agent: .opencode/agents/triage.md
- Delegates by command to subagents:
issue-planner-> .opencode/agents/issue-planner.mdissue-implementer-> .opencode/agents/issue-implementer.mdpr-review-> .opencode/agents/pr-review.md
Use these in issue or PR comments:
/oc plan
/oc implement
/oc review
Aliases:
/opencode plan
/opencode implement
/opencode review
Common typo supported in triage mapping:
/oc implment
/opencode implment
Natural language is also supported after the prefix:
/oc can you plan this issue from scratch?
/oc please implement this
/oc can you review this PR for bugs?
The prefix is still required so the workflow can detect intent safely.
Comment on an issue:
/oc plan
Expected behavior:
- Triage delegates to
issue-planner - Planner reads issue and repository context
- Planner posts a structured implementation plan back to the issue
Comment on an issue:
/oc implement
Expected behavior:
- Triage delegates to
issue-implementer - Implementer reads the latest plan block in issue comments
- Implements the smallest correct change
- Runs relevant checks/tests
- Leaves intended changes for action-managed branch/PR flow
Comment on a PR thread (for review fixups):
/oc implement please address review comments
Expected behavior:
- Triage delegates to
issue-implementer - Implementer reads PR comments/suggestions
- Applies targeted fixes and runs checks
Comment on a PR:
/oc review
Expected behavior:
- Triage delegates to
pr-review - Reviewer analyzes correctness, security, reliability, maintainability, and tests
- Reviewer posts review output
Configure these repository secrets:
| Secret | Description |
|---|---|
OPENCODE_API_KEY |
API key for the OpenCode model provider |
OPENCODE_GITHUB_TOKEN |
Fine-grained PAT from a bot/service account (see below) |
- Go to GitHub Settings → Developer settings → Personal access tokens → Fine-grained tokens
- Create a token from a dedicated bot or service account
- Set repository access to this repository (or your org's repositories as needed)
- Grant the following permissions:
| Permission | Access |
|---|---|
| Contents | Read and write |
| Pull requests | Read and write |
| Issues | Read and write |
| Metadata | Read (mandatory, auto-selected) |
- Save the generated token as the
OPENCODE_GITHUB_TOKENrepository secret
- Add workflow file .github/workflows/opencode.yml.
- Add agent definitions under .opencode/agents.
- Add required secrets in repository settings.
- Open an issue and comment with
/oc plan. - After plan is ready, comment
/oc implement. - On a PR, comment
/oc review.
- Create issue: "Add login endpoint"
- Comment:
/oc plan - Show generated plan comment
- Comment:
/oc implement - Show generated code changes and PR
- Comment on PR:
/oc review - Show AI review feedback
- Add an inline PR suggestion and comment
/oc implementto show iterative fix flow
- This repository still contains dedicated workflows:
- For a cleaner PoC narrative, you can keep only the triage-driven workflow and disable the others.
Since this repo is public, anyone could post /oc comments and trigger your workflow, consuming your API tokens.
The workflow guards against this by checking that the commenter is the repository owner before the runner even starts:
if: github.event.comment.user.login == github.repository_owner && ...This check happens entirely within GitHub — no runner is provisioned and no tokens are spent if the condition is false. Anyone else posting /oc commands will simply have their comment ignored.
If you later want to extend access to specific collaborators, you can use:
github.event.comment.author_association == 'COLLABORATOR' ||
github.event.comment.author_association == 'MEMBER' ||
github.event.comment.author_association == 'OWNER'author_association values GitHub provides:
| Value | Meaning |
|---|---|
OWNER |
Repository owner |
MEMBER |
Org member with write access |
COLLABORATOR |
Explicitly added collaborator |
CONTRIBUTOR |
Has merged a PR before |
FIRST_TIME_CONTRIBUTOR |
First merged PR |
FIRST_TIMER |
First ever PR on GitHub |
NONE |
No relationship |
For these tests, Big Pickle (the default model of OpenCode) was used to test the flow. Testing was done with small tasks since the goal was to validate the flow itself rather than the model's capabilities.
For more complex tasks, alternatives like Qwen 3.6 27B or MiniMax M2.7 are planned to be evaluated as more cost-effective options compared to Claude models — untested in this PoC so far.
For more details on available models and pricing, see: https://opencode.ai/docs/zen/