Skip to content

[Maintenance] Auto-load OC skills before agent action to enforce conventions #241

Description

@RussellSB

Problem

When the OpenCode (OC) agent runs in GitHub Actions, it does not automatically load the .opencode/skills/ files before executing tasks. This means critical conventions — git commit format, PR title rules, pipeline architecture — are ignored unless the agent happens to trigger the skill tool during its session.

Observed in PR #224: the agent made commits with non-conventional messages (missing feat:/fix: prefixes, wrong casing) despite the maintenance skill containing explicit rules for Conventional Commits and PR title formatting.

Root Cause

Skills are loaded on-demand via the skill tool, not automatically at session start. The agent must explicitly call skill({ name: "maintenance" }) to load conventions, but:

  1. The skill description doesn't always match the task request closely enough to trigger loading
  2. No configuration forces specific skills to load before work begins
  3. AGENTS.md references conventions but the agent doesn't always parse it thoroughly before acting

Impact

  • Commits violate Conventional Commits format (lint-pr-title.yml rejects PR titles)
  • PR descriptions miss required structure
  • Agent re-litigates design decisions already settled in skills (e.g., deprecation policy, API surface)
  • Each PR requires manual review for convention compliance

Proposed Solutions

Option 1: opencode.json instructions (Recommended — immediate)

Add a project-level config that forces skill content into every session:

{
  "$schema": "https://opencode.ai/config.json",
  "instructions": [
    ".opencode/skills/maintenance/SKILL.md",
    ".opencode/skills/pytrendy/SKILL.md"
  ]
}

Pros: Zero agent changes needed, conventions always in context.
Cons: Increases context size for simple tasks.

Option 2: Enhance AGENTS.md with explicit skill-loading instructions

Add a mandatory section:

## Critical: Skill Loading Requirements
Before making ANY code changes, commits, or PRs:
1. Load the `maintenance` skill — Contains Conventional Commits and PR title rules
2. Load the `pytrendy` skill — Contains pipeline architecture
3. Follow all conventions from loaded skills

Pros: Works within existing framework, no new config files.
Cons: Relies on agent compliance; may still be skipped.

Option 3: Custom agent with forced skill loading

Create .opencode/agents/conventional-commit.md that mandates loading maintenance and pytrendy skills before any code changes.

Option 4: Upstream feature request

Request OpenCode support for preloadSkills or loadSkills configuration in opencode.json.

Recommended Plan

  1. Immediate: Implement Option 1 (opencode.json) + Option 2 (AGENTS.md)
  2. Track: Option 4 as a follow-up feature request on OpenCode GitHub

Commit type note

This is a CI/tooling improvement. Commits for this issue must use chore: or ci: prefix — not fix: or feat: — to avoid triggering an auto-release via semantic-release on main. The conventionalcommits preset maps fix: → patch bump and feat: → minor bump; only chore:/ci:/docs:/refactor: produce no version bump.

Acceptance Criteria

  • OC agent in GitHub Actions loads maintenance skill before making commits
  • Commits follow Conventional Commits format on first attempt
  • PR titles pass lint-pr-title.yml validation

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions