Skip to content

feat: complete caveman OpenCode plugin implementation (#13) - #63

Merged
Guisardo merged 1 commit into
mainfrom
feat/issue-13-complete-plugin
Sep 28, 2026
Merged

Guisardo merged 1 commit into
mainfrom
feat/issue-13-complete-plugin

Conversation

@Guisardo

@Guisardo Guisardo commented Sep 28, 2026 •

Copy link
Copy Markdown
Owner

Summary

Complete the Caveman OpenCode Plugin implementation by adding missing files:

Added Files

  • \package.json\ - Plugin metadata, dependencies (@opencode/plugin, zod), peerDependencies (@opencode-ai/plugin), and npm scripts (typecheck, build, dev, test)
  • \options-validator.ts\ - Validates plugin config (defaultLevel, enabled) with fallbacks to hardcoded defaults
  • \ sconfig.json\ - Extends @tsconfig/node22, strict mode, nodenext modules, declaration output
  • \ est/command-loader.test.ts\ - Tests for command metadata loading from frontmatter
  • \ est/index.test.ts\ - Comprehensive tests for plugin setup, skill/command registration, context hook, storage integration, and v1 server()
  • \ est/options-validator.test.ts\ - Tests for config validation (defaults, valid levels, invalid levels, enabled flag)
  • \ est/skill-loader.test.ts\ - Tests for skill markdown parsing and loading

Existing Files (from origin/main)

  • \index.ts\ - Dual v1/v2 plugin entrypoint with setup() and server()
  • \skill-loader.ts\ - Loads 5 skills from .opencode/skills/ at runtime
  • \command-loader.ts\ - Loads 5 commands from .opencode/commands/ at runtime
  • \ rontmatter.ts\ - Shared frontmatter parser (eliminates duplication)
  • \storage-keys.ts\ - Single source of truth for VALID_LEVELS enum
  • \ est/enum-sync.test.ts\ - Ensures skill/command docs stay in sync with VALID_LEVELS

Verification

  • All 34 tests pass (5 test files)
  • TypeScript strict mode compiles clean
  • Build emits declarations to dist/

Follow-up Work (out of scope for this PR)

Per the spec's recommended follow-up:

  1. Add \�utoinvoke: true\ to caveman skill frontmatter
  2. Align level names (wenyan vs wenyan-full) across 4 locations
  3. Guard prompt.text in command execute
  4. Strengthen storage narrowing
  5. Remove async from server()
  6. Centralize level enum handling further

Implements issue #13 (SPEC: Caveman OpenCode Plugin Implementation and Follow-up)

Add missing plugin files:
- package.json with dependencies and scripts
- options-validator.ts for config validation
- tsconfig.json extending @tsconfig/node22
- Unit tests for command-loader, index, options-validator, skill-loader

Implements issue #13: Caveman OpenCode Plugin Implementation
@Guisardo
Guisardo merged commit a1af4ab into main Sep 28, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant