Files
opencode-power-pack/.opencode/plugins/opencode-power-pack.js
T
Wayner Barrios b98c1f54e2 Initial release v0.1.0
opencode-power-pack bundles eleven Claude Code skills as an OpenCode plugin
under one config line, with each skill also exposed as a slash command.

Skills (by category):

  Review
    code-review        multi-agent PR review with cross-check pass and
                       concrete reproduction scenarios
    security-review    OWASP-bucketed three-stage filtering with mandatory
                       PoC per finding

  Feature dev
    feature-dev        seven-phase guided workflow
    code-explorer      deep codebase analysis sub-task
    code-architect     decisive architecture blueprint sub-task
    code-reviewer      two-pass adversarial review sub-task

  Design
    frontend-design    distinctive, production-grade UI generation

  Authoring
    mcp-builder        build high-quality MCP servers (Python or TypeScript)
    skill-creator      author new SKILL.md files

  Project memory
    agents-md-improver audit and update AGENTS.md / CLAUDE.md
    agents-md-revise   capture session learnings into the rules file

Architecture:
  - .opencode/plugins/opencode-power-pack.js auto-registers skills/ via
    config.skills.paths.push() (live config singleton modification, pattern
    adapted from obra/superpowers).
  - skills/<name>/SKILL.md hold the workflows the model executes.
  - commands/<name>.md ship physical slash command files that inline the
    full SKILL.md content, so the model receives the actual workflow as
    its prompt rather than a meta-instruction. Symlinked into
    ~/.config/opencode/commands/ during install.

Almost all skill content is ported or translated from upstream Anthropic
projects (claude-code/plugins, skills, claude-code-security-review,
claude-plugins-official). The plugin loader pattern is adapted from
obra/superpowers. See README.md -> Acknowledgments for per-skill
attribution; each SKILL.md frontmatter also carries a license field
naming its specific upstream.
2026-04-26 21:16:17 -04:00

47 lines
2.1 KiB
JavaScript

/**
* opencode-power-pack
*
* Auto-registers the bundled skills directory so OpenCode discovers all
* skills shipped by this plugin (code-review, feature-dev, code-explorer,
* code-architect, code-reviewer, security-review, frontend-design,
* mcp-builder, skill-creator, agents-md-improver, agents-md-revise) without
* requiring symlinks or manual config.
*
* Slash commands are NOT registered here on purpose — they are provided by
* physical markdown files under `commands/` in this repo, intended to be
* symlinked into `~/.config/opencode/commands/`. Each command file inlines
* the full SKILL.md content, so the model receives the actual workflow as
* its prompt rather than a meta-instruction telling it to load the skill.
*
* ──── Attribution ────────────────────────────────────────────────────────
*
* The plugin loader pattern (importing fs/path via fileURLToPath, exporting
* an async ctx → hooks function, pushing into config.skills.paths via the
* `config` hook) is adapted directly from Jesse Vincent's superpowers
* plugin: https://github.com/obra/superpowers
*
* The skills under skills/ are ports/translations of artifacts originally
* written by Anthropic for Claude Code. See README.md → Acknowledgments
* and each SKILL.md's `license` frontmatter for the specific upstream of
* each skill.
* ─────────────────────────────────────────────────────────────────────────
*/
import path from 'path';
import { fileURLToPath } from 'url';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const skillsDir = path.resolve(__dirname, '../../skills');
export const OpencodePowerPack = async () => {
return {
config: async (config) => {
config.skills = config.skills || {};
config.skills.paths = config.skills.paths || [];
if (!config.skills.paths.includes(skillsDir)) {
config.skills.paths.push(skillsDir);
}
},
};
};