awesome-slash 2.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +54 -0
- package/.claude-plugin/plugin.json +11 -0
- package/.mcp.json +8 -0
- package/CHANGELOG.md +261 -0
- package/LICENSE +21 -0
- package/README.md +363 -0
- package/SECURITY.md +101 -0
- package/adapters/README.md +256 -0
- package/adapters/codex/README.md +272 -0
- package/adapters/codex/install.sh +179 -0
- package/adapters/opencode/README.md +301 -0
- package/adapters/opencode/install.sh +223 -0
- package/lib/patterns/review-patterns.js +511 -0
- package/lib/patterns/slop-patterns.js +647 -0
- package/lib/platform/detect-platform.js +535 -0
- package/lib/platform/verify-tools.js +235 -0
- package/lib/state/workflow-state.js +635 -0
- package/lib/state/workflow-state.schema.json +282 -0
- package/lib/utils/context-optimizer.js +227 -0
- package/mcp-server/index.js +303 -0
- package/mcp-server/package.json +23 -0
- package/package.json +63 -0
- package/plugins/deslop-around/.claude-plugin/plugin.json +20 -0
- package/plugins/deslop-around/commands/deslop-around.md +220 -0
- package/plugins/deslop-around/lib/patterns/review-patterns.js +511 -0
- package/plugins/deslop-around/lib/patterns/slop-patterns.js +641 -0
- package/plugins/deslop-around/lib/platform/detect-platform.js +514 -0
- package/plugins/deslop-around/lib/platform/verify-tools.js +235 -0
- package/plugins/deslop-around/lib/state/workflow-state.js +635 -0
- package/plugins/deslop-around/lib/state/workflow-state.schema.json +282 -0
- package/plugins/deslop-around/lib/utils/context-optimizer.js +222 -0
- package/plugins/next-task/.claude-plugin/plugin.json +24 -0
- package/plugins/next-task/agents/ci-fixer.md +236 -0
- package/plugins/next-task/agents/ci-monitor.md +291 -0
- package/plugins/next-task/agents/delivery-validator.md +451 -0
- package/plugins/next-task/agents/deslop-work.md +272 -0
- package/plugins/next-task/agents/docs-updater.md +506 -0
- package/plugins/next-task/agents/exploration-agent.md +277 -0
- package/plugins/next-task/agents/implementation-agent.md +427 -0
- package/plugins/next-task/agents/planning-agent.md +236 -0
- package/plugins/next-task/agents/policy-selector.md +248 -0
- package/plugins/next-task/agents/review-orchestrator.md +521 -0
- package/plugins/next-task/agents/simple-fixer.md +136 -0
- package/plugins/next-task/agents/task-discoverer.md +357 -0
- package/plugins/next-task/agents/test-coverage-checker.md +447 -0
- package/plugins/next-task/agents/worktree-manager.md +419 -0
- package/plugins/next-task/commands/delivery-approval.md +331 -0
- package/plugins/next-task/commands/next-task.md +627 -0
- package/plugins/next-task/commands/update-docs-around.md +418 -0
- package/plugins/next-task/hooks/hooks.json +14 -0
- package/plugins/next-task/lib/patterns/review-patterns.js +511 -0
- package/plugins/next-task/lib/patterns/slop-patterns.js +641 -0
- package/plugins/next-task/lib/platform/detect-platform.js +514 -0
- package/plugins/next-task/lib/platform/verify-tools.js +235 -0
- package/plugins/next-task/lib/state/tasks-registry.schema.json +85 -0
- package/plugins/next-task/lib/state/workflow-state.js +635 -0
- package/plugins/next-task/lib/state/workflow-state.schema.json +282 -0
- package/plugins/next-task/lib/state/worktree-status.schema.json +219 -0
- package/plugins/next-task/lib/utils/context-optimizer.js +222 -0
- package/plugins/project-review/.claude-plugin/plugin.json +20 -0
- package/plugins/project-review/commands/project-review-agents.md +286 -0
- package/plugins/project-review/commands/project-review-github.md +142 -0
- package/plugins/project-review/commands/project-review.md +273 -0
- package/plugins/project-review/lib/patterns/review-patterns.js +511 -0
- package/plugins/project-review/lib/patterns/slop-patterns.js +641 -0
- package/plugins/project-review/lib/platform/detect-platform.js +514 -0
- package/plugins/project-review/lib/platform/verify-tools.js +235 -0
- package/plugins/project-review/lib/state/workflow-state.js +635 -0
- package/plugins/project-review/lib/state/workflow-state.schema.json +282 -0
- package/plugins/project-review/lib/utils/context-optimizer.js +222 -0
- package/plugins/reality-check/.claude-plugin/plugin.json +23 -0
- package/plugins/reality-check/README.md +156 -0
- package/plugins/reality-check/agents/code-explorer.md +353 -0
- package/plugins/reality-check/agents/doc-analyzer.md +337 -0
- package/plugins/reality-check/agents/issue-scanner.md +231 -0
- package/plugins/reality-check/agents/plan-synthesizer.md +479 -0
- package/plugins/reality-check/commands/scan.md +242 -0
- package/plugins/reality-check/commands/set.md +203 -0
- package/plugins/reality-check/lib/state/reality-check-state.js +509 -0
- package/plugins/reality-check/skills/reality-analysis/SKILL.md +317 -0
- package/plugins/ship/.claude-plugin/plugin.json +21 -0
- package/plugins/ship/commands/ship-ci-review-loop.md +443 -0
- package/plugins/ship/commands/ship-deployment.md +330 -0
- package/plugins/ship/commands/ship-error-handling.md +254 -0
- package/plugins/ship/commands/ship.md +370 -0
- package/plugins/ship/lib/patterns/review-patterns.js +511 -0
- package/plugins/ship/lib/patterns/slop-patterns.js +641 -0
- package/plugins/ship/lib/platform/detect-platform.js +514 -0
- package/plugins/ship/lib/platform/verify-tools.js +235 -0
- package/plugins/ship/lib/state/workflow-state.js +635 -0
- package/plugins/ship/lib/state/workflow-state.schema.json +282 -0
- package/plugins/ship/lib/utils/context-optimizer.js +222 -0
- package/scripts/install/claude.sh +50 -0
- package/scripts/install/codex.sh +181 -0
- package/scripts/install/opencode.sh +211 -0
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
# awesome-slash for OpenCode
|
|
2
|
+
|
|
3
|
+
Professional-grade slash commands adapted for OpenCode.
|
|
4
|
+
|
|
5
|
+
## Quick Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
git clone https://github.com/avifenesh/awesome-slash.git
|
|
9
|
+
cd awesome-slash
|
|
10
|
+
./adapters/opencode/install.sh
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Prerequisites
|
|
14
|
+
|
|
15
|
+
- **OpenCode** - Install from [opencode.ai](https://opencode.ai)
|
|
16
|
+
- **Node.js 18+** - Download from [nodejs.org](https://nodejs.org)
|
|
17
|
+
- **Git** - Download from [git-scm.com](https://git-scm.com)
|
|
18
|
+
- **GitHub CLI (`gh`)** - For PR commands (install: `brew install gh` or see [cli.github.com](https://cli.github.com))
|
|
19
|
+
|
|
20
|
+
## Available Commands
|
|
21
|
+
|
|
22
|
+
### 🧹 `/deslop-around` - AI Slop Cleanup
|
|
23
|
+
|
|
24
|
+
Remove debugging code, old TODOs, and other AI slop.
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
opencode
|
|
28
|
+
> /deslop-around
|
|
29
|
+
> /deslop-around apply
|
|
30
|
+
> /deslop-around apply src/ 10
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
**What it does:**
|
|
34
|
+
- Scans for console.logs, print statements, old TODOs
|
|
35
|
+
- Generates report or auto-applies fixes
|
|
36
|
+
- Runs verification tests
|
|
37
|
+
- Preserves functionality with minimal diffs
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
### 📋 `/next-task` - Intelligent Task Prioritization
|
|
42
|
+
|
|
43
|
+
Discover what to work on next with AI analysis.
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
opencode
|
|
47
|
+
> /next-task
|
|
48
|
+
> /next-task bug
|
|
49
|
+
> /next-task --include-blocked
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
**What it does:**
|
|
53
|
+
- Analyzes GitHub Issues (required)
|
|
54
|
+
- Validates tasks aren't already implemented
|
|
55
|
+
- Scores by impact, urgency, effort
|
|
56
|
+
- Provides top 5 recommendations with evidence
|
|
57
|
+
|
|
58
|
+
**Requires:** GitHub CLI (`gh`)
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
### 🔍 `/project-review` - Multi-Agent Code Review
|
|
63
|
+
|
|
64
|
+
Comprehensive review with specialized AI agents.
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
opencode
|
|
68
|
+
> /project-review
|
|
69
|
+
> /project-review --recent
|
|
70
|
+
> /project-review --domain security
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
**What it does:**
|
|
74
|
+
- Deploys 8 specialized agents
|
|
75
|
+
- Adapts to your tech stack
|
|
76
|
+
- Finds bugs, security issues, performance problems
|
|
77
|
+
- Iterates until zero critical issues
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
### 🚀 `/ship` - Complete PR Workflow
|
|
82
|
+
|
|
83
|
+
Ship from commit to production with validation.
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
opencode
|
|
87
|
+
> /ship
|
|
88
|
+
> /ship --strategy rebase
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
**What it does:**
|
|
92
|
+
1. Commits changes with AI message
|
|
93
|
+
2. Creates PR with description
|
|
94
|
+
3. Waits for CI to pass
|
|
95
|
+
4. Runs quality reviews
|
|
96
|
+
5. Merges to main
|
|
97
|
+
6. Deploys to dev/prod
|
|
98
|
+
7. Validates deployments
|
|
99
|
+
8. Auto-rollback on failure
|
|
100
|
+
|
|
101
|
+
**Requires:** Git, GitHub CLI (`gh`)
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
## OpenCode-Specific Features
|
|
107
|
+
|
|
108
|
+
OpenCode provides additional features you can combine with awesome-slash commands:
|
|
109
|
+
|
|
110
|
+
### File Includes with `@`
|
|
111
|
+
|
|
112
|
+
Include file contents in your prompt:
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
opencode
|
|
116
|
+
> /project-review @src/main.py @tests/test_main.py
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
This adds the file contents to the context before running the review.
|
|
120
|
+
|
|
121
|
+
### Bash Output with `!`
|
|
122
|
+
|
|
123
|
+
Include bash command output:
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
opencode
|
|
127
|
+
> /deslop-around apply !git diff --name-only
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
This runs `git diff --name-only` and includes the output in the prompt.
|
|
131
|
+
|
|
132
|
+
### Combined Usage
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
opencode
|
|
136
|
+
> /next-task @PLAN.md !gh issue list
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Analyzes tasks with PLAN.md content and current GitHub issues.
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## Installation Details
|
|
144
|
+
|
|
145
|
+
The installer:
|
|
146
|
+
1. Creates `~/.opencode/commands/awesome-slash/`
|
|
147
|
+
2. Copies command files with path adjustments
|
|
148
|
+
3. Installs shared libraries (platform detection, patterns)
|
|
149
|
+
4. Creates environment setup scripts
|
|
150
|
+
|
|
151
|
+
### File Structure
|
|
152
|
+
|
|
153
|
+
```
|
|
154
|
+
~/.opencode/commands/awesome-slash/
|
|
155
|
+
├── deslop-around.md
|
|
156
|
+
├── next-task.md
|
|
157
|
+
├── project-review.md
|
|
158
|
+
├── ship.md
|
|
159
|
+
├── lib/
|
|
160
|
+
│ ├── platform/
|
|
161
|
+
│ │ ├── detect-platform.js
|
|
162
|
+
│ │ └── verify-tools.js
|
|
163
|
+
│ ├── patterns/
|
|
164
|
+
│ │ ├── review-patterns.js
|
|
165
|
+
│ │ └── slop-patterns.js
|
|
166
|
+
│ └── utils/
|
|
167
|
+
│ └── context-optimizer.js
|
|
168
|
+
├── env.sh
|
|
169
|
+
└── README.md
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
## Usage Examples
|
|
175
|
+
|
|
176
|
+
### Clean up with file filter
|
|
177
|
+
```bash
|
|
178
|
+
opencode
|
|
179
|
+
> /deslop-around apply @src/app.js
|
|
180
|
+
|
|
181
|
+
# Changeset 1/3: Remove console.log statements
|
|
182
|
+
# - src/app.js: Removed 3 console.log calls
|
|
183
|
+
# ✓ Tests passed
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
### Review specific files
|
|
187
|
+
```bash
|
|
188
|
+
opencode
|
|
189
|
+
> /project-review @src/auth.py @src/api.py
|
|
190
|
+
|
|
191
|
+
# Iteration 1: Found 4 issues (2 critical, 2 high)
|
|
192
|
+
# ✓ Fixed SQL injection in auth.py:45
|
|
193
|
+
# ✓ Fixed race condition in api.py:123
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
### Next task with context
|
|
197
|
+
```bash
|
|
198
|
+
opencode
|
|
199
|
+
> /next-task @PLAN.md !gh issue list
|
|
200
|
+
|
|
201
|
+
# Top 5 Priority Tasks:
|
|
202
|
+
# (includes analysis from PLAN.md and GitHub issues)
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
### Ship with diff review
|
|
206
|
+
```bash
|
|
207
|
+
opencode
|
|
208
|
+
> !git diff
|
|
209
|
+
> /ship --strategy rebase
|
|
210
|
+
|
|
211
|
+
# (reviews the diff you just displayed, then ships)
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
## Platform Support
|
|
217
|
+
|
|
218
|
+
### Auto-Detected CI Platforms
|
|
219
|
+
GitHub Actions · GitLab CI · CircleCI · Jenkins · Travis CI
|
|
220
|
+
|
|
221
|
+
### Auto-Detected Deployment Platforms
|
|
222
|
+
Railway · Vercel · Netlify · Fly.io · Platform.sh · Render
|
|
223
|
+
|
|
224
|
+
### Auto-Detected Project Types
|
|
225
|
+
Node.js · Python · Rust · Go · Java
|
|
226
|
+
|
|
227
|
+
---
|
|
228
|
+
|
|
229
|
+
## Updating
|
|
230
|
+
|
|
231
|
+
To update commands:
|
|
232
|
+
|
|
233
|
+
```bash
|
|
234
|
+
cd /path/to/awesome-slash
|
|
235
|
+
git pull origin main
|
|
236
|
+
./adapters/opencode/install.sh
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
---
|
|
240
|
+
|
|
241
|
+
## Troubleshooting
|
|
242
|
+
|
|
243
|
+
### Commands not showing up
|
|
244
|
+
1. Restart OpenCode TUI
|
|
245
|
+
2. Check installation: `ls ~/.opencode/commands/awesome-slash/`
|
|
246
|
+
3. Re-run installer
|
|
247
|
+
|
|
248
|
+
### Commands only work in TUI
|
|
249
|
+
|
|
250
|
+
Currently, OpenCode slash commands are only available in the TUI (Terminal User Interface), not from the CLI directly. Feature request exists to add CLI support.
|
|
251
|
+
|
|
252
|
+
### Path errors
|
|
253
|
+
Re-run installer to fix path substitutions:
|
|
254
|
+
```bash
|
|
255
|
+
./adapters/opencode/install.sh
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
### Node.js not found
|
|
259
|
+
Ensure Node.js 18+ is installed:
|
|
260
|
+
```bash
|
|
261
|
+
node --version # Should be v18.0.0 or higher
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
### GitHub CLI authentication
|
|
265
|
+
```bash
|
|
266
|
+
gh auth login
|
|
267
|
+
gh auth status
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
---
|
|
271
|
+
|
|
272
|
+
## Differences from Claude Code
|
|
273
|
+
|
|
274
|
+
| Feature | Claude Code | OpenCode |
|
|
275
|
+
|---------|-------------|----------|
|
|
276
|
+
| Installation | Marketplace | Manual script |
|
|
277
|
+
| Updates | Automatic | Re-run installer |
|
|
278
|
+
| File Includes | Built-in | `@filename` syntax |
|
|
279
|
+
| Bash Output | Built-in | `!command` syntax |
|
|
280
|
+
| Multi-agent | Full support | May vary |
|
|
281
|
+
|
|
282
|
+
---
|
|
283
|
+
|
|
284
|
+
## Support
|
|
285
|
+
|
|
286
|
+
- **Repository**: https://github.com/avifenesh/awesome-slash
|
|
287
|
+
- **Issues**: https://github.com/avifenesh/awesome-slash/issues
|
|
288
|
+
- **OpenCode Docs**: https://opencode.ai/docs
|
|
289
|
+
|
|
290
|
+
---
|
|
291
|
+
|
|
292
|
+
## Resources
|
|
293
|
+
|
|
294
|
+
- [OpenCode Commands](https://opencode.ai/docs/commands/)
|
|
295
|
+
- [OpenCode CLI](https://opencode.ai/docs/cli/)
|
|
296
|
+
- [awesome-slash Main README](../../README.md)
|
|
297
|
+
- [Multi-Tool Adapters](../README.md)
|
|
298
|
+
|
|
299
|
+
---
|
|
300
|
+
|
|
301
|
+
Made with ❤️ for the OpenCode community
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -e
|
|
3
|
+
|
|
4
|
+
# OpenCode Installer for awesome-slash commands
|
|
5
|
+
# This script installs all 5 slash commands for use with OpenCode
|
|
6
|
+
|
|
7
|
+
echo "🚀 Installing awesome-slash commands for OpenCode..."
|
|
8
|
+
echo
|
|
9
|
+
|
|
10
|
+
# Configuration
|
|
11
|
+
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
|
12
|
+
OPENCODE_CONFIG_DIR="${HOME}/.opencode"
|
|
13
|
+
OPENCODE_COMMANDS_DIR="${OPENCODE_CONFIG_DIR}/commands/awesome-slash"
|
|
14
|
+
LIB_DIR="${OPENCODE_COMMANDS_DIR}/lib"
|
|
15
|
+
|
|
16
|
+
# Detect OS and normalize paths
|
|
17
|
+
if [[ "$OSTYPE" == "msys" || "$OSTYPE" == "win32" ]]; then
|
|
18
|
+
IS_WINDOWS=true
|
|
19
|
+
# Convert Windows path to Unix-style for bash compatibility
|
|
20
|
+
OPENCODE_CONFIG_DIR="${USERPROFILE}/.opencode"
|
|
21
|
+
# Replace backslashes with forward slashes
|
|
22
|
+
OPENCODE_CONFIG_DIR="${OPENCODE_CONFIG_DIR//\\//}"
|
|
23
|
+
OPENCODE_COMMANDS_DIR="${OPENCODE_CONFIG_DIR}/commands/awesome-slash"
|
|
24
|
+
LIB_DIR="${OPENCODE_COMMANDS_DIR}/lib"
|
|
25
|
+
else
|
|
26
|
+
IS_WINDOWS=false
|
|
27
|
+
fi
|
|
28
|
+
|
|
29
|
+
echo "📂 Configuration:"
|
|
30
|
+
echo " Repository: $REPO_ROOT"
|
|
31
|
+
echo " Install to: $OPENCODE_COMMANDS_DIR"
|
|
32
|
+
echo
|
|
33
|
+
|
|
34
|
+
# Check prerequisites
|
|
35
|
+
echo "🔍 Checking prerequisites..."
|
|
36
|
+
|
|
37
|
+
# Check Node.js
|
|
38
|
+
if ! command -v node &> /dev/null; then
|
|
39
|
+
echo "❌ Node.js not found. Install from: https://nodejs.org"
|
|
40
|
+
exit 1
|
|
41
|
+
fi
|
|
42
|
+
NODE_VERSION=$(node --version)
|
|
43
|
+
echo " ✓ Node.js $NODE_VERSION"
|
|
44
|
+
|
|
45
|
+
# Check Git
|
|
46
|
+
if ! command -v git &> /dev/null; then
|
|
47
|
+
echo "❌ Git not found. Install from: https://git-scm.com"
|
|
48
|
+
exit 1
|
|
49
|
+
fi
|
|
50
|
+
GIT_VERSION=$(git --version | cut -d' ' -f3)
|
|
51
|
+
echo " ✓ Git $GIT_VERSION"
|
|
52
|
+
|
|
53
|
+
# Check OpenCode (optional - user may not have it installed yet)
|
|
54
|
+
if command -v opencode &> /dev/null; then
|
|
55
|
+
OPENCODE_VERSION=$(opencode --version 2>&1 | head -n1 || echo "unknown")
|
|
56
|
+
echo " ✓ OpenCode $OPENCODE_VERSION"
|
|
57
|
+
else
|
|
58
|
+
echo " ⚠️ OpenCode not found (install from: https://opencode.ai)"
|
|
59
|
+
echo " You can still install commands and use OpenCode later"
|
|
60
|
+
fi
|
|
61
|
+
|
|
62
|
+
echo
|
|
63
|
+
|
|
64
|
+
# Create directories
|
|
65
|
+
echo "📁 Creating directories..."
|
|
66
|
+
mkdir -p "$OPENCODE_COMMANDS_DIR"
|
|
67
|
+
mkdir -p "$LIB_DIR"/{platform,patterns,utils}
|
|
68
|
+
echo " ✓ Created $OPENCODE_COMMANDS_DIR"
|
|
69
|
+
echo " ✓ Created $LIB_DIR"
|
|
70
|
+
echo
|
|
71
|
+
|
|
72
|
+
# Copy library files from shared root lib directory
|
|
73
|
+
echo "📚 Installing shared libraries..."
|
|
74
|
+
# Use explicit iteration to handle paths with spaces safely
|
|
75
|
+
for item in "${REPO_ROOT}/lib"/*; do
|
|
76
|
+
cp -r "$item" "${LIB_DIR}/"
|
|
77
|
+
done
|
|
78
|
+
echo " ✓ Copied platform detection"
|
|
79
|
+
echo " ✓ Copied pattern libraries"
|
|
80
|
+
echo " ✓ Copied utility functions"
|
|
81
|
+
echo
|
|
82
|
+
|
|
83
|
+
# Install commands with path adjustments
|
|
84
|
+
echo "⚙️ Installing commands..."
|
|
85
|
+
|
|
86
|
+
COMMANDS=(
|
|
87
|
+
"deslop-around"
|
|
88
|
+
"next-task"
|
|
89
|
+
"project-review"
|
|
90
|
+
"ship"
|
|
91
|
+
"pr-merge"
|
|
92
|
+
)
|
|
93
|
+
|
|
94
|
+
for cmd in "${COMMANDS[@]}"; do
|
|
95
|
+
SOURCE_FILE="$REPO_ROOT/plugins/$cmd/commands/$cmd.md"
|
|
96
|
+
TARGET_FILE="$OPENCODE_COMMANDS_DIR/$cmd.md"
|
|
97
|
+
|
|
98
|
+
if [ -f "$SOURCE_FILE" ]; then
|
|
99
|
+
# Replace Claude-specific path variables with OpenCode paths
|
|
100
|
+
# Escape sed special characters in path to prevent injection
|
|
101
|
+
SAFE_COMMANDS_DIR=$(echo "${OPENCODE_COMMANDS_DIR}" | sed 's/[&/\]/\\&/g')
|
|
102
|
+
sed "s|\${CLAUDE_PLUGIN_ROOT}|${SAFE_COMMANDS_DIR}|g" "$SOURCE_FILE" > "$TARGET_FILE"
|
|
103
|
+
echo " ✓ Installed /$cmd"
|
|
104
|
+
else
|
|
105
|
+
echo " ⚠️ Skipped /$cmd (source not found)"
|
|
106
|
+
fi
|
|
107
|
+
done
|
|
108
|
+
|
|
109
|
+
echo
|
|
110
|
+
|
|
111
|
+
# Create environment setup script
|
|
112
|
+
echo "📝 Creating environment setup..."
|
|
113
|
+
cat > "$OPENCODE_COMMANDS_DIR/env.sh" << 'EOF'
|
|
114
|
+
#!/usr/bin/env bash
|
|
115
|
+
# Environment variables for awesome-slash commands in OpenCode
|
|
116
|
+
|
|
117
|
+
# Set the root directory for commands to find libraries
|
|
118
|
+
export OPENCODE_COMMANDS_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
119
|
+
|
|
120
|
+
# Add lib directory to NODE_PATH if needed
|
|
121
|
+
export NODE_PATH="${OPENCODE_COMMANDS_ROOT}/lib:${NODE_PATH}"
|
|
122
|
+
|
|
123
|
+
# Platform detection helpers
|
|
124
|
+
export AWESOME_SLASH_PLATFORM_SCRIPT="${OPENCODE_COMMANDS_ROOT}/lib/platform/detect-platform.js"
|
|
125
|
+
export AWESOME_SLASH_TOOLS_SCRIPT="${OPENCODE_COMMANDS_ROOT}/lib/platform/verify-tools.js"
|
|
126
|
+
EOF
|
|
127
|
+
|
|
128
|
+
chmod +x "$OPENCODE_COMMANDS_DIR/env.sh"
|
|
129
|
+
echo " ✓ Created environment setup script"
|
|
130
|
+
echo
|
|
131
|
+
|
|
132
|
+
# Create README
|
|
133
|
+
cat > "$OPENCODE_COMMANDS_DIR/README.md" << 'EOF'
|
|
134
|
+
# awesome-slash for OpenCode
|
|
135
|
+
|
|
136
|
+
This directory contains the awesome-slash commands adapted for OpenCode.
|
|
137
|
+
|
|
138
|
+
## Available Commands
|
|
139
|
+
|
|
140
|
+
- `/deslop-around` - AI slop cleanup with minimal diffs
|
|
141
|
+
- `/next-task` - Intelligent task prioritization
|
|
142
|
+
- `/project-review` - Multi-agent code review
|
|
143
|
+
- `/ship` - Complete PR workflow
|
|
144
|
+
- `/pr-merge` - Intelligent PR merge
|
|
145
|
+
|
|
146
|
+
## Usage
|
|
147
|
+
|
|
148
|
+
In OpenCode TUI, invoke commands directly:
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
/deslop-around
|
|
152
|
+
/next-task
|
|
153
|
+
/project-review
|
|
154
|
+
/ship
|
|
155
|
+
/pr-merge
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
You can also pass arguments:
|
|
159
|
+
```bash
|
|
160
|
+
/deslop-around apply
|
|
161
|
+
/next-task bug
|
|
162
|
+
/ship --strategy rebase
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
## OpenCode-Specific Features
|
|
166
|
+
|
|
167
|
+
OpenCode supports additional features you can use with these commands:
|
|
168
|
+
|
|
169
|
+
- **@filename** - Include file contents in prompt
|
|
170
|
+
- **!command** - Include bash command output in prompt
|
|
171
|
+
|
|
172
|
+
Example:
|
|
173
|
+
```bash
|
|
174
|
+
/project-review @src/main.py
|
|
175
|
+
/deslop-around apply !git diff --name-only
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
## Environment
|
|
179
|
+
|
|
180
|
+
Commands use the shared library at:
|
|
181
|
+
```
|
|
182
|
+
~/.opencode/commands/awesome-slash/lib/
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
## Updates
|
|
186
|
+
|
|
187
|
+
To update commands, re-run the installer:
|
|
188
|
+
```bash
|
|
189
|
+
cd /path/to/awesome-slash
|
|
190
|
+
./adapters/opencode/install.sh
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
## Support
|
|
194
|
+
|
|
195
|
+
- Repository: https://github.com/avifenesh/awesome-slash
|
|
196
|
+
- Issues: https://github.com/avifenesh/awesome-slash/issues
|
|
197
|
+
EOF
|
|
198
|
+
|
|
199
|
+
echo " ✓ Created README"
|
|
200
|
+
echo
|
|
201
|
+
|
|
202
|
+
# Success message
|
|
203
|
+
echo "✅ Installation complete!"
|
|
204
|
+
echo
|
|
205
|
+
echo "📋 Installed Commands:"
|
|
206
|
+
for cmd in "${COMMANDS[@]}"; do
|
|
207
|
+
echo " • /$cmd"
|
|
208
|
+
done
|
|
209
|
+
echo
|
|
210
|
+
echo "📖 Next Steps:"
|
|
211
|
+
echo " 1. Start OpenCode TUI: opencode"
|
|
212
|
+
echo " 2. Use commands: /$cmd"
|
|
213
|
+
echo " 3. See help: cat $OPENCODE_COMMANDS_DIR/README.md"
|
|
214
|
+
echo
|
|
215
|
+
echo "💡 OpenCode Pro Tips:"
|
|
216
|
+
echo " • Use @filename to include file contents"
|
|
217
|
+
echo " • Use !command to include bash output"
|
|
218
|
+
echo " • Example: /project-review @src/main.py"
|
|
219
|
+
echo
|
|
220
|
+
echo "🔄 To update commands, re-run this installer:"
|
|
221
|
+
echo " ./adapters/opencode/install.sh"
|
|
222
|
+
echo
|
|
223
|
+
echo "Happy coding! 🎉"
|