Skip to content

chore(opencode): harden Lucky plugins and workflows - #238

Merged
LucasSantana-Dev merged 1 commit into
mainfrom
chore/opencode-plugin-skill-hardening
Mar 14, 2026
Merged

LucasSantana-Dev merged 1 commit into
mainfrom
chore/opencode-plugin-skill-hardening

Conversation

@LucasSantana-Dev

@LucasSantana-Dev LucasSantana-Dev commented Mar 14, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • add repo-local OpenCode guardrail plugins, workflow commands, project skill bridge, and verification/install scripts
  • add Lucky OpenCode workflow skill and extend docs-search guidance for OpenCode config/plugin work
  • document the Lucky OpenCode config split, guardrails, remote attach flow, and optional/deferred plugin posture

Notes

  • opencode-shell-strategy is wired through the OpenCode community plugin resolver
  • dynamic context pruning uses the installable package @tarquinen/opencode-dcp@latest
  • host-local and server-do-luk operational setup was applied outside git: community plugin priming, remote serve helper hardening, and remote runtime verification

Verification

  • bash -n scripts/opencode-attach-server-do-luk.sh scripts/opencode-sync-global-skills.sh scripts/opencode-sync-project-skills.sh scripts/opencode-sync-server-do-luk-skills.sh scripts/opencode-install-community-plugins.sh scripts/opencode-verify.sh
  • node --check .opencode/plugins/lucky-policy-lib.mjs
  • node --check .opencode/plugins/lucky-policy.mjs
  • node --check .opencode/plugins/lucky-context.mjs
  • node --check .opencode/plugins/lucky-doc-reminders.mjs
  • node --test .opencode/tests/lucky-policy.test.mjs
  • ./scripts/opencode-install-community-plugins.sh
  • ./scripts/opencode-verify.sh
  • ./scripts/opencode-install-community-plugins.sh --remote server-do-luk
  • ./scripts/opencode-verify.sh --remote server-do-luk
  • attach smoke to server-do-luk confirmed the remote Lucky workspace and MCP core were reachable over SSH tunnel

Summary by CodeRabbit

  • New Features

    • Integrated OpenCode with local and remote server workflows.
    • Added policy and context plugins for workflow management.
    • Introduced helper scripts for verification, plugin installation, and skill synchronization.
  • Documentation

    • Added OpenCode configuration and operational guides in README and MCP setup docs.
    • Updated documentation with project setup, verification, and remote workflow procedures.
  • Configuration

    • Added OpenCode configuration file and .gitignore for local development.
    • Added multiple skill references for project integration.
  • Tests

    • Added test suite validating policy guardrails.

@netlify

netlify Bot commented Mar 14, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for regal-bunny-0c8efe ready!

Name Link
🔨 Latest commit 950968c
🔍 Latest deploy log https://app.netlify.com/projects/regal-bunny-0c8efe/deploys/69b59189a558b40008186035
😎 Deploy Preview https://deploy-preview-238--regal-bunny-0c8efe.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@vercel

vercel Bot commented Mar 14, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
lucky Ready Ready Preview, Comment Mar 14, 2026 4:49pm

Request Review

@coderabbitai

coderabbitai Bot commented Mar 14, 2026 •

Copy link
Copy Markdown

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

Adds OpenCode integration to Lucky including new policy and context plugins, helper scripts for remote attachment and skill synchronization, skill documentation, configuration file, and comprehensive documentation updates for OpenCode workflows and operations.

Changes

Cohort / File(s) Summary
OpenCode Skill Documentation
.cursor/skills/mcp-docs-search/SKILL.md, .cursor/skills/opencode-lucky-workflows/SKILL.md
Added OpenCode-specific guidance sections and comprehensive Lucky Workflows skill documentation covering scope, config splitting, plugin/command behavior, MCP expectations, and validation/attach/recovery workflows.
Plugin Modules - Core Policy
.opencode/plugins/lucky-policy-lib.mjs, .opencode/plugins/lucky-policy.mjs
Introduces policy library with helpers for sensitive path detection, command classification (destructive/mutating), and root mutation checks. Main policy plugin applies enforcement hooks for commands, tools, and shell execution with path validation and environment augmentation.
Plugin Modules - Context & Reminders
.opencode/plugins/lucky-context.mjs, .opencode/plugins/lucky-doc-reminders.mjs
Adds context plugin that injects repository state and priorities into chat; adds doc-reminders plugin to prompt documentation updates when non-doc files change and suggest recording failures.
Helper Scripts - Synchronization
scripts/opencode-sync-global-skills.sh, scripts/opencode-sync-project-skills.sh, scripts/opencode-sync-server-do-luk-skills.sh
Three complementary scripts that create and maintain symlinks for global and project skills locally and sync them to remote servers via rsync.
Helper Scripts - Installation & Verification
scripts/opencode-install-community-plugins.sh, scripts/opencode-verify.sh, scripts/opencode-attach-server-do-luk.sh
Scripts for remote plugin installation with bun, local and remote verification of OpenCode components, and remote server attachment with SSH tunneling.
Skill Reference Pointers
.opencode/skills/*
24 skill reference files created, each containing a path to either .cursor/skills/ or .agent-skills/ resources, enabling centralized skill discovery.
Configuration & Tests
opencode.jsonc, .opencode/.gitignore, .opencode/tests/lucky-policy.test.mjs
Adds OpenCode configuration with plugins, commands, MCP integrations, and watcher patterns; .gitignore entries for node artifacts; comprehensive test suite validating policy helpers.
Documentation Updates
README.md, AGENTS.md, CHANGELOG.md, docs/MCP_SETUP.md
Adds extensive documentation covering OpenCode/Codex integration, repo-local and host-local config split, operational workflows, helper scripts, optional add-ons, and database bootstrap guardrails.

Sequence Diagram(s)

sequenceDiagram
    actor User
    participant Local as Local Terminal
    participant SSH as SSH Tunnel
    participant Remote as Remote Server
    participant OpenCode as OpenCode Server

    User->>Local: Run attach script
    Local->>Remote: SSH exec verify serve exists
    alt Serve not running
        Remote->>Remote: Start serve in background
        Remote->>Remote: Wait for port ready
    end
    Remote-->>Local: Port ready
    Local->>SSH: Establish SSH tunnel<br/>(local:port -> remote:port)
    SSH-->>Local: Tunnel active
    Local->>OpenCode: opencode attach<br/>via localhost:port/dir
    OpenCode-->>Local: Connected
    User->>Local: Uses Lucky Codex
    Note over Local,Remote: Tunnel handles all traffic
    User->>Local: Exit/Ctrl+C
    Local->>SSH: Close tunnel
    Local-->>User: Cleanup complete
Loading
sequenceDiagram
    actor User
    participant Local as Local Script
    participant Sources as Source Dirs<br/>(.cursor/skills, .agent-skills)
    participant Dest as Destination<br/>(.opencode/skills)
    participant Remote as Remote Host<br/>(rsync)

    User->>Local: Run sync script
    Local->>Dest: Clear old links/files
    Local->>Sources: Scan for SKILL.md
    Local->>Dest: Create symlinks
    Local->>Local: Compute relative paths
    Dest-->>Local: Symlinks created
    Local->>Remote: rsync -aL --delete<br/>agents/ codex/
    Remote-->>Local: Sync complete
    Local-->>User: Skills synchronized
Loading
sequenceDiagram
    participant User
    participant Script as Verify Script
    participant Local as Local System
    participant Remote as Remote Host<br/>(SSH)

    User->>Script: Run verify [--remote HOST]<br/>[--attach-smoke]
    alt Local Verification
        Script->>Local: node version check
        Script->>Local: test suite execution
        Script->>Local: opencode config
        Script->>Local: opencode mcp list
        Script->>Local: opencode run verify
        Local-->>Script: Results
    else Remote Verification
        Script->>Remote: SSH exec opencode config
        Script->>Remote: SSH exec opencode mcp list
        Script->>Remote: SSH exec verify command
        Remote-->>Script: Results
    end
    alt Attach-Smoke Enabled
        Script->>Script: Launch smoke attach<br/>with timeout
        Script->>Script: Trap signals for cleanup
    end
    Script-->>User: Verification complete
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • LuckaySantana-Dev/Lucky#236: Adds/updates the lucky-ci-gate-recovery skill that is referenced alongside other skills in this PR's skill pointer additions.

Suggested labels

size/l

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'chore(opencode): harden Lucky plugins and workflows' is fully related to the main changes, which add OpenCode guardrail plugins, workflow scripts, and security hardening measures.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/opencode-plugin-skill-hardening
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@LucasSantana-Dev
LucasSantana-Dev force-pushed the chore/opencode-plugin-skill-hardening branch from ad2f595 to 950968c Compare March 14, 2026 16:49
@sonarqubecloud

Copy link
Copy Markdown

@sonarqubecloud

Copy link
Copy Markdown

@LucasSantana-Dev
LucasSantana-Dev merged commit e0d951b into main Mar 14, 2026
14 of 15 checks passed
@LucasSantana-Dev
LucasSantana-Dev deleted the chore/opencode-plugin-skill-hardening branch March 15, 2026 14:06

This branch was successfully deployed

1 active deployment
Preview — 950968ca Deployed Mar 14, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant