Skip to content

C8: One-shot consumer upgrade capability — skill + command #31

Closed

Description

@diegohb

Parent

Part of #23 (Spec: opencode-architect 1.0.0)

What to build

A consumer says "upgrade my plugin/extensions package to opencode v2" (or invokes the slash command) and the suite performs the upgrade in one pass: inventory of the project's extensions (extension auditor), port of v1 plugin code to the Effect-first v2 API (plugin engineer), port of v1 tool files to plugin-registered tools (tool builder), config rewrite to v2-native keys per the verified mapping, and a report recommending v2 capabilities to adopt (richer session hooks, plugin RPC, TUI plugins, MCP Code Mode, saved approvals). Safe no-op on already-v2 projects; respects consumer-modified files per the manifest/hash rules; never touches the opencode app installation.

Acceptance criteria

  • Demo on a fixture v1 extension package produces upgraded code, rewritten configs, and a recommendations report
  • Already-v2 projects get a clean no-op
  • Consumer-modified files are skipped with a warning, never clobbered
  • The opencode app installation is never touched
  • Skill and command follow the suite's authoring conventions

Blocked by

  • #C5
  • #C6
  • #C7

Activity

  1. diegohb commented on Oct 7, 2026

    @diegohb
    MemberAuthor

    Implementation landed on v2/issue-31-oneshot-upgrade (3 commits, typecheck + 217 tests green).

    Deliverable (scope: skill + command + load-time registration, agreed with the maintainer — no deterministic upgrade engine):

    • skills/opencode-v2-upgrade/SKILL.md — the one-shot v1→v2 upgrade skill: inventory, project classification, config rewrite mapping (facts §5/§6), plugin port (facts §1/§2/§9), v1 tool-file port (facts §8), recommendations report (facts §4/§9/§10/§11), and a safety contract (no-op on v2, skip consumer-modified files by manifest hash, never touch the app installation, preserve unparseable configs).
    • commands/upgrade-opencode-v2.md — the /upgrade-opencode-v2 slash command.
    • src/skill-loader.ts + src/command-loader.ts + shared src/frontmatter.ts; the plugin registers both at load via ctx.skill.transform and ctx.command.transform (command execute re-submits its template through ctx.session.prompt with the skill attached).
    • Harness + load-hook now audit skill/command registration; package.json ships skills/commands; README/AGENTS/CONTEXT/architect/oneshots updated.

    Acceptance evidence:

    • tests/fixtures/v1-extension-package (agent-inspired v1 config + plugin + tool + agent/skill/command) and tests/fixtures/v2-extension-package (its upgraded output + report). Tests prove the rewritten config validates against the pinned @opencode/schema Config.Info and carries no v1 key — i.e. the clean no-op precondition.
    • Ran the flow on the v1 fixture out-of-tree: produced upgraded plugin code, a rewritten config (schema-valid, zero remaining v1 keys), and a recommendations report. Consumer-modified skip and app-untouched guarantees are in the skill's safety contract, backed by the existing manifest/hash machinery.
    • Skill/command pass the frontmatter-hygiene and docs-fact gates, ship in the npm tarball, and follow the suite's authoring conventions (third-person description, facts citations, D6-quoted frontmatter).

    Not closing yet — confirm and I'll close, and I can open the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agentFully specified, ready for an AFK agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions