diff --git a/.github/workflows/opencode-smoke.yml b/.github/workflows/opencode-smoke.yml new file mode 100644 index 0000000..5b48fa1 --- /dev/null +++ b/.github/workflows/opencode-smoke.yml @@ -0,0 +1,22 @@ +name: OpenCode smoke + +on: + pull_request: + paths: + - ".opencode/**" + - "skills/**" + - "scripts/opencode-smoke.mjs" + - "package.json" + - ".github/workflows/opencode-smoke.yml" + workflow_dispatch: + +jobs: + opencode-1-18-7: + runs-on: ubuntu-latest + timeout-minutes: 5 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: "24" + - run: node scripts/opencode-smoke.mjs 1.18.7 diff --git a/.gitignore b/.gitignore index 498fd50..864d962 100644 --- a/.gitignore +++ b/.gitignore @@ -44,6 +44,13 @@ NOTES.md .opencode/local.json .opencode/cache/ +# Local behavioral evaluation reports +.artifacts/behavioral-evals/ + +# Planning docs for behavioral evaluations (not delivered to main) +docs/superpowers/plans/2026-07-30-behavioral-evaluations*.md +docs/superpowers/specs/2026-07-30-behavioral-evaluations*.md + # Node / Bun node_modules/ *.log diff --git a/.opencode/plugins/agent-config.js b/.opencode/plugins/agent-config.js new file mode 100644 index 0000000..65d1e79 --- /dev/null +++ b/.opencode/plugins/agent-config.js @@ -0,0 +1,65 @@ +import { readFileSync } from "fs"; +import path from "path"; + +const AGENT_NAMES = ["code-explorer", "code-architect", "code-reviewer"]; +const READ_ONLY_PERMISSION = { + "*": "deny", + read: { + "*": "allow", + "*.env": "deny", + "*.env.*": "deny", + "*.env.example": "allow", + }, + glob: "allow", + grep: "allow", + list: "allow", + edit: "deny", + task: "deny", + webfetch: "deny", + websearch: "deny", + external_directory: "deny", +}; +const REVIEW_BASH_PERMISSION = { + "*": "deny", + "git status*": "allow", + "git diff*": "allow", + "git show*": "allow", + "git log*": "allow", + "git blame*": "allow", + "git rev-parse*": "allow", + "git merge-base*": "allow", + "git ls-files*": "allow", + "git *--output*": "deny", + "git *--ext-diff*": "deny", + "git *>*": "deny", +}; + +function readSkill(skillsDir, name) { + const source = readFileSync(path.join(skillsDir, name, "SKILL.md"), "utf8"); + const match = source.match(/^---\r?\n([\s\S]*?)\r?\n---\r?\n([\s\S]*)$/); + if (!match) throw new Error(`Invalid frontmatter in ${name}/SKILL.md`); + + const description = match[1] + .split(/\r?\n/) + .find((line) => line.startsWith("description:")) + ?.slice("description:".length) + .trim(); + if (!description) throw new Error(`Missing description in ${name}/SKILL.md`); + + return { description, prompt: match[2].trim() }; +} + +export function loadAgentConfigs(skillsDir) { + return Object.fromEntries(AGENT_NAMES.map((name) => { + const skill = readSkill(skillsDir, name); + const permission = name === "code-reviewer" + ? { ...READ_ONLY_PERMISSION, bash: REVIEW_BASH_PERMISSION } + : { ...READ_ONLY_PERMISSION, bash: "deny" }; + + return [name, { + ...skill, + mode: "subagent", + permission, + }]; + })); +} diff --git a/.opencode/plugins/opencode-power-pack.js b/.opencode/plugins/opencode-power-pack.js index fd4c4fa..6531ee7 100644 --- a/.opencode/plugins/opencode-power-pack.js +++ b/.opencode/plugins/opencode-power-pack.js @@ -7,11 +7,9 @@ * 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. + * OpenCode 1.18.7+ exposes discovered skills as same-named slash commands. + * The plugin also registers the feature workflow's specialist roles as + * read-only subagents derived from their SKILL.md bodies. * * ──── Attribution ──────────────────────────────────────────────────────── * @@ -28,9 +26,11 @@ import path from 'path'; import { fileURLToPath } from 'url'; +import { loadAgentConfigs } from './agent-config.js'; const __dirname = path.dirname(fileURLToPath(import.meta.url)); const skillsDir = path.resolve(__dirname, '../../skills'); +const bundledAgents = loadAgentConfigs(skillsDir); export const OpencodePowerPack = async () => { return { @@ -40,6 +40,10 @@ export const OpencodePowerPack = async () => { if (!config.skills.paths.includes(skillsDir)) { config.skills.paths.push(skillsDir); } + config.agent = config.agent || {}; + for (const [name, agent] of Object.entries(bundledAgents)) { + if (!config.agent[name]) config.agent[name] = agent; + } }, }; }; diff --git a/README.md b/README.md index 2447d4b..de11a2c 100644 --- a/README.md +++ b/README.md @@ -3,46 +3,67 @@
- Eleven Claude Code skills, ported to OpenCode.
- Code review, security audit, feature dev, frontend design, and the rest of the kit — installable in one line.
+ Eleven Claude Code workflows, adapted for modern OpenCode.
+ Code review, security audit, feature development, frontend design, project memory, and authoring tools.
+<<<<<<< HEAD
+
+=======
+>>>>>>> origin/main
-
-
-
-
+
+
+
Install · Skills · Commands · - How it works · - Credits · - License + Architecture · + Credits
+<<<<<<< HEAD +## Why This Exists +=======Built on top of anthropics/claude-plugins-official, anthropics/skills, anthropics/claude-code-security-review, and obra/superpowers. See Acknowledgments.
+>>>>>>> origin/main ---- +OpenCode reads `SKILL.md` natively, but many valuable Claude Code workflows originated as Claude-specific commands and agents. Copying those artifacts directly does not preserve their orchestration, permissions, or subagent behavior. -## Why this exists +This package adapts the portable methodology into OpenCode skills, registers the feature-development specialist roles as real read-only subagents, and ships immutable provenance for every upstream work. -OpenCode reads Claude Code's `SKILL.md` format natively, but **most of Anthropic's official Claude Code plugins put their value in `commands/` and `agents/`** — and those are Claude-Code-only. So if you want `/code-review`, `/security-review`, or `/feature-dev` in OpenCode, copy-paste won't get you there. +It complements [obra/superpowers](https://github.com/obra/superpowers), which provides process skills such as brainstorming, TDD, debugging, and plan execution. -This pack does the **translation**: the multi-agent workflows from those plugins are rewritten as OpenCode-compatible skills, so the methodology survives the platform jump. Plus a few direct ports of skills that already lived in Anthropic's `skills/` repo. +## What's Inside -It pairs nicely with **[obra/superpowers](https://github.com/obra/superpowers)**, which provides the meta-workflow skills (brainstorming, TDD, executing-plans). This pack adds the domain-specific muscle. +| Category | Skill | Purpose | +|---|---|---| +| Review | `code-review` | Multi-agent PR review with confidence filtering and reproduction scenarios | +| Review | `security-review` | Security-focused review with category coverage and exploit-path validation | +| Feature development | `feature-dev` | Seven-phase workflow from discovery through implementation and review | +| Feature development | `code-explorer` | Trace a feature across entry points, layers, state, and dependencies | +| Feature development | `code-architect` | Produce a file-level architecture and implementation blueprint | +| Feature development | `code-reviewer` | Adversarial review of a focused local change set | +| Design | `frontend-design` | Create distinctive interfaces with an accessibility and craft rubric | +| Authoring | `mcp-builder` | Design and build MCP servers in TypeScript or Python | +| Authoring | `skill-creator` | Create, test, and improve reusable `SKILL.md` workflows | +| Project memory | `agents-md-improver` | Audit project rules and propose targeted improvements | +| Project memory | `agents-md-revise` | Capture durable session learnings in project rules | +<<<<<<< HEAD +`code-explorer`, `code-architect`, and `code-reviewer` are available both as standalone skills and as least-privilege subagents used by `feature-dev`. +======= --- ## What's inside @@ -101,54 +122,32 @@ It pairs nicely with **[obra/superpowers](https://github.com/obra/superpowers)** --- +>>>>>>> origin/main ## Installation ### Prerequisites -- **OpenCode** installed and on your PATH. If you do not have it: