Skip to content

feat(opencode): shadow preflight (opencode-skills) #154

Description

@slowdini

Part of the OpenCode enhancement-parity track (see #113 for the baseline + progressive-enhancement model).

OpenCode declares no [shadow] preflight today, so a logical eval skill present in a live discovery source contaminates the with/without comparison with no build-time warning.

Verified discovery surface (opencode skills doc, v1.18.3)

OpenCode discovers skills from six roots — more than any other built-in harness:

  • Project (walked up from cwd to the git worktree): .opencode/skills/<name>/SKILL.md, .claude/skills/<name>/SKILL.md, .agents/skills/<name>/SKILL.md
  • Global: ~/.config/opencode/skills/<name>/SKILL.md (honor OPENCODE_CONFIG_DIR), ~/.claude/skills/<name>/SKILL.md, ~/.agents/skills/<name>/SKILL.md

The .claude / .agents roots are a genuine cross-harness contamination vector: a skill staged or installed for Claude Code or Codex is visible to OpenCode sessions by default (and vice versa). Note: OPENCODE_DISABLE_CLAUDE_CODE_SKILLS exists, but dispatch should not set it — parity with a real user session matters, and the shadow report is the mechanism for surfacing the risk.

Work

  • New ShadowPreflight::OpencodeSkills variant in src/adapters/capabilities.rs + src/adapters/opencode/skill_shadow.rs, modeled on src/adapters/codex/skill_shadow.rs (frontmatter name: parsing, best-effort scan, no hard failure on unreadable sources).
  • Reuse the harness-neutral PluginShadowReport from src/adapters/skill_shadow.rs and the shared banner/validity-warning rendering (the claude path shows the shared renderers).
  • Add opencode-skills to the shadow-preflight enum in schema/harness-descriptor.schema.json; declare [shadow] preflight = "opencode-skills" in harnesses/opencode.toml.

Acceptance

  • Running run --harness opencode with a colliding skill in any of the six roots emits the shadow banner + plugin-shadow.json, folded into benchmark.json validity warnings by aggregate
  • Unit tests per root (project/global × opencode/claude/agents dirs), ancestor walk capped at the git worktree, OPENCODE_CONFIG_DIR honored
  • docs/opencode-notes.md updated (code map + what's wired); README support table flips Shadow preflight to ✅; capability added to docs/byoh.md and the harness-descriptor PR template lists
  • cargo test, cargo clippy --all-targets -- -D warnings, cargo fmt --check green

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions