Add skills library and plugin configs for Claude, Cursor, Codex, and OpenCode
- Add frontend-dev, fullstack-dev, and android-native-dev skills - Add plugin configs for Claude Code, Cursor, Codex, and OpenCode - Add English and Chinese READMEs with installation instructions - Add .gitignore
This commit is contained in:
71
.opencode/INSTALL.md
Normal file
71
.opencode/INSTALL.md
Normal file
@@ -0,0 +1,71 @@
|
||||
# Installing MiniMax Skills for OpenCode
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- [OpenCode.ai](https://opencode.ai) installed
|
||||
|
||||
## Installation
|
||||
|
||||
Add minimax-skills to the `plugin` array in your `opencode.json` (global or project-level):
|
||||
|
||||
```json
|
||||
{
|
||||
"plugin": ["minimax-skills@git+https://github.com/MiniMax-AI/skills.git"]
|
||||
}
|
||||
```
|
||||
|
||||
Restart OpenCode. That's it — the plugin auto-installs and registers all skills.
|
||||
|
||||
Verify by asking: "List available skills"
|
||||
|
||||
## Available Skills
|
||||
|
||||
- **frontend-dev** — Frontend development with UI design, animations, AI-generated media assets
|
||||
- **fullstack-dev** — Full-stack backend architecture and frontend-backend integration
|
||||
- **android-native-dev** — Android native application development with Material Design 3
|
||||
|
||||
## Usage
|
||||
|
||||
Use OpenCode's native `skill` tool:
|
||||
|
||||
```
|
||||
use skill tool to list skills
|
||||
use skill tool to load minimax-skills/frontend-dev
|
||||
```
|
||||
|
||||
## Updating
|
||||
|
||||
MiniMax Skills updates automatically when you restart OpenCode.
|
||||
|
||||
To pin a specific version:
|
||||
|
||||
```json
|
||||
{
|
||||
"plugin": ["minimax-skills@git+https://github.com/MiniMax-AI/skills.git#v1.0.0"]
|
||||
}
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Plugin not loading
|
||||
|
||||
1. Check logs: `opencode run --print-logs "hello" 2>&1 | grep -i minimax`
|
||||
2. Verify the plugin line in your `opencode.json`
|
||||
3. Make sure you're running a recent version of OpenCode
|
||||
|
||||
### Skills not found
|
||||
|
||||
1. Use `skill` tool to list what's discovered
|
||||
2. Check that the plugin is loading (see above)
|
||||
|
||||
### Tool mapping
|
||||
|
||||
When skills reference Claude Code tools:
|
||||
- `TodoWrite` → `todowrite`
|
||||
- `Task` with subagents → `@mention` syntax
|
||||
- `Skill` tool → OpenCode's native `skill` tool
|
||||
- File operations → your native tools
|
||||
|
||||
## Getting Help
|
||||
|
||||
- Report issues: https://github.com/MiniMax-AI/skills/issues
|
||||
73
.opencode/plugins/minimax-skills.js
Normal file
73
.opencode/plugins/minimax-skills.js
Normal file
@@ -0,0 +1,73 @@
|
||||
/**
|
||||
* MiniMax Skills plugin for OpenCode.ai
|
||||
*
|
||||
* Registers the skills directory and injects bootstrap context via system prompt transform.
|
||||
*/
|
||||
|
||||
import path from 'path';
|
||||
import fs from 'fs';
|
||||
import os from 'os';
|
||||
import { fileURLToPath } from 'url';
|
||||
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||
|
||||
export const MiniMaxSkillsPlugin = async () => {
|
||||
const homeDir = os.homedir();
|
||||
const skillsDir = path.resolve(__dirname, '../../skills');
|
||||
const envConfigDir = process.env.OPENCODE_CONFIG_DIR
|
||||
? path.resolve(process.env.OPENCODE_CONFIG_DIR.replace(/^~/, homeDir))
|
||||
: null;
|
||||
const configDir = envConfigDir || path.join(homeDir, '.config/opencode');
|
||||
|
||||
// Discover available skills by scanning the skills directory
|
||||
const getAvailableSkills = () => {
|
||||
if (!fs.existsSync(skillsDir)) return [];
|
||||
return fs.readdirSync(skillsDir, { withFileTypes: true })
|
||||
.filter(d => d.isDirectory() && fs.existsSync(path.join(skillsDir, d.name, 'SKILL.md')))
|
||||
.map(d => d.name);
|
||||
};
|
||||
|
||||
const getBootstrapContent = () => {
|
||||
const skills = getAvailableSkills();
|
||||
if (skills.length === 0) return null;
|
||||
|
||||
const skillList = skills.map(s => `- \`${s}\``).join('\n');
|
||||
|
||||
return `<IMPORTANT>
|
||||
You have MiniMax Skills available.
|
||||
|
||||
**Available skills:**
|
||||
${skillList}
|
||||
|
||||
**Tool Mapping for OpenCode:**
|
||||
When skills reference tools you don't have, substitute OpenCode equivalents:
|
||||
- \`TodoWrite\` → \`todowrite\`
|
||||
- \`Task\` tool with subagents → Use OpenCode's subagent system (@mention)
|
||||
- \`Skill\` tool → OpenCode's native \`skill\` tool
|
||||
- \`Read\`, \`Write\`, \`Edit\`, \`Bash\` → Your native tools
|
||||
|
||||
**Skills location:**
|
||||
MiniMax skills are in \`${configDir}/skills/minimax-skills/\`
|
||||
Use OpenCode's native \`skill\` tool to list and load skills.
|
||||
</IMPORTANT>`;
|
||||
};
|
||||
|
||||
return {
|
||||
// Inject skills path into live config so OpenCode discovers skills
|
||||
config: async (config) => {
|
||||
config.skills = config.skills || {};
|
||||
config.skills.paths = config.skills.paths || [];
|
||||
if (!config.skills.paths.includes(skillsDir)) {
|
||||
config.skills.paths.push(skillsDir);
|
||||
}
|
||||
},
|
||||
|
||||
// Use system prompt transform to inject bootstrap
|
||||
'experimental.chat.system.transform': async (_input, output) => {
|
||||
const bootstrap = getBootstrapContent();
|
||||
if (bootstrap) {
|
||||
(output.system ||= []).push(bootstrap);
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user