Skip to content

fnandop/opencode-sdlc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

OpenCode SDLC PoC on GitHub Actions

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:

Motivation

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

What This PoC Demonstrates

  • 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

Architecture

Workflow entrypoint

  • Workflow: .github/workflows/opencode.yml
  • Triggered by:
    • issue_comment created
    • pull_request_review_comment created
  • Runs anomalyco/opencode/github@latest with agent: triage

Agent routing

Commands

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.

Behavior by Command

1) Plan

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

2) Implement

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

3) Review

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

Required Secrets

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)

Creating OPENCODE_GITHUB_TOKEN

  1. Go to GitHub Settings → Developer settings → Personal access tokens → Fine-grained tokens
  2. Create a token from a dedicated bot or service account
  3. Set repository access to this repository (or your org's repositories as needed)
  4. Grant the following permissions:
Permission Access
Contents Read and write
Pull requests Read and write
Issues Read and write
Metadata Read (mandatory, auto-selected)
  1. Save the generated token as the OPENCODE_GITHUB_TOKEN repository secret

Minimal Setup Checklist

  1. Add workflow file .github/workflows/opencode.yml.
  2. Add agent definitions under .opencode/agents.
  3. Add required secrets in repository settings.
  4. Open an issue and comment with /oc plan.
  5. After plan is ready, comment /oc implement.
  6. On a PR, comment /oc review.

Example Usage Script

  1. Create issue: "Add login endpoint"
  2. Comment: /oc plan
  3. Show generated plan comment
  4. Comment: /oc implement
  5. Show generated code changes and PR
  6. Comment on PR: /oc review
  7. Show AI review feedback
  8. Add an inline PR suggestion and comment /oc implement to show iterative fix flow

Notes

Protecting Your Tokens on a Public Repo

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

Testing Notes

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/

About

Smart SDLC with OpenCode on GitHub Actions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors