summaryrefslogtreecommitdiff
path: root/.opencode/plugin
diff options
context:
space:
mode:
authorJesse Vincent <jesse@fsck.com>2025-11-22 12:53:26 -0800
committerJesse Vincent <jesse@fsck.com>2025-11-22 12:53:26 -0800
commitd3e89e8719e0d3073d5d53767ddfd47ad8256b9c (patch)
tree1b5dfcbc10598d7593ccc8bd01261a774489c9eb /.opencode/plugin
parentb746f7587b7c383f4b32c290c2182a0f2bbd9214 (diff)
fix: convert opencode plugin to ES module syntax
- Replace CommonJS require() with ES import statements - Use createRequire() for loading CommonJS skills-core module - Export plugin as 'SuperpowersPlugin' named export - Maintains compatibility with existing skills-core.js CommonJS module
Diffstat (limited to '.opencode/plugin')
-rw-r--r--.opencode/plugin/superpowers.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/.opencode/plugin/superpowers.js b/.opencode/plugin/superpowers.js
index ee4353f..9bff386 100644
--- a/.opencode/plugin/superpowers.js
+++ b/.opencode/plugin/superpowers.js
@@ -5,16 +5,19 @@
* with automatic bootstrap on session start.
*/
+import { createRequire } from 'module';
+import path from 'path';
+import fs from 'fs';
+import os from 'os';
+
+const require = createRequire(import.meta.url);
const skillsCore = require('../../lib/skills-core');
-const path = require('path');
-const fs = require('fs');
-const os = require('os');
const homeDir = os.homedir();
const superpowersSkillsDir = path.join(homeDir, '.config/opencode/superpowers/skills');
const personalSkillsDir = path.join(homeDir, '.config/opencode/skills');
-module.exports = async ({ project, client, $, directory, worktree }) => {
+export const SuperpowersPlugin = async ({ project, client, $, directory, worktree }) => {
const { z } = await import('zod');
return {