bmm-opencode 1.0.0 → 1.0.1

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/README.md CHANGED
@@ -9,9 +9,9 @@ BMAD-METHOD agents and skills converted for [OpenCode](https://opencode.ai) - re
9
9
 
10
10
  ## Installation
11
11
 
12
- ### One-Line Install (Recommended)
12
+ ### Plugin Install (Recommended)
13
13
 
14
- Simply add `bmm-opencode` to your `opencode.json`:
14
+ Add `bmm-opencode` to your `opencode.json`:
15
15
 
16
16
  ```json
17
17
  {
@@ -20,7 +20,24 @@ Simply add `bmm-opencode` to your `opencode.json`:
20
20
  }
21
21
  ```
22
22
 
23
- **Done!** Restart OpenCode and all 17 agents + 61 skills are ready to use.
23
+ Restart OpenCode. The plugin provides these tools:
24
+
25
+ | Tool | Description |
26
+ |------|-------------|
27
+ | `bmm_list` | List all available agents and skills |
28
+ | `bmm_agent` | Get agent definition by name |
29
+ | `bmm_skill` | Get skill instructions by name |
30
+ | `bmm_install` | Copy agents/skills to your project's `.opencode` folder |
31
+
32
+ ### Installing Agents & Skills to Your Project
33
+
34
+ After adding the plugin, run:
35
+
36
+ ```
37
+ Use the bmm_install tool to install agents and skills
38
+ ```
39
+
40
+ This copies all 17 agents and 61 skills to your project's `.opencode/` directory. Restart OpenCode to use them with Tab switching and slash commands.
24
41
 
25
42
  ---
26
43
 
@@ -49,10 +66,11 @@ rm -rf package bmm-opencode-*.tgz
49
66
 
50
67
  ## Quick Start
51
68
 
52
- After installation, restart OpenCode and you'll have access to:
69
+ After installation, you have access to:
53
70
 
54
- 1. **17 Specialized Agents** - Switch agents using `Tab` key
55
- 2. **61 Workflow Skills** - Load skills via slash commands like `/bmad-bmm-create-prd`
71
+ 1. **Plugin Tools** - Use `bmm_list`, `bmm_agent`, `bmm_skill` directly
72
+ 2. **17 Specialized Agents** - After `bmm_install`, switch agents using `Tab` key
73
+ 3. **61 Workflow Skills** - After `bmm_install`, load skills via slash commands like `/bmad-bmm-create-prd`
56
74
 
57
75
  ---
58
76
 
@@ -125,7 +143,15 @@ After installation, restart OpenCode and you'll have access to:
125
143
 
126
144
  ## Usage
127
145
 
128
- ### Switch to an agent
146
+ ### Using Plugin Tools
147
+
148
+ ```
149
+ Use bmm_list to see all available agents and skills
150
+ Use bmm_skill with name bmad-bmm-create-prd to get the PRD creation workflow
151
+ Use bmm_install to copy everything to my project
152
+ ```
153
+
154
+ ### Switch to an agent (after bmm_install)
129
155
 
130
156
  Press `Tab` or use the agent switch keybind, then select an agent.
131
157
 
@@ -0,0 +1,4 @@
1
+ import type { Plugin } from "@opencode-ai/plugin";
2
+ export declare const BMMPlugin: Plugin;
3
+ export default BMMPlugin;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AA+ClD,eAAO,MAAM,SAAS,EAAE,MA8FvB,CAAC;AAEF,eAAe,SAAS,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,127 @@
1
+ import { tool } from "@opencode-ai/plugin/tool";
2
+ import { readFileSync, readdirSync, existsSync, cpSync, mkdirSync } from "fs";
3
+ import { join, dirname } from "path";
4
+ import { fileURLToPath } from "url";
5
+ const __dirname = dirname(fileURLToPath(import.meta.url));
6
+ const packageRoot = join(__dirname, "..");
7
+ const agentsDir = join(packageRoot, ".opencode", "agents");
8
+ const skillsDir = join(packageRoot, ".opencode", "skills");
9
+ function listAgents() {
10
+ try {
11
+ return readdirSync(agentsDir)
12
+ .filter((f) => f.endsWith(".md"))
13
+ .map((f) => f.replace(".md", ""));
14
+ }
15
+ catch {
16
+ return [];
17
+ }
18
+ }
19
+ function listSkills() {
20
+ try {
21
+ return readdirSync(skillsDir).filter((d) => existsSync(join(skillsDir, d, "SKILL.md")));
22
+ }
23
+ catch {
24
+ return [];
25
+ }
26
+ }
27
+ function loadAgent(name) {
28
+ try {
29
+ return readFileSync(join(agentsDir, `${name}.md`), "utf-8");
30
+ }
31
+ catch {
32
+ return `Agent "${name}" not found`;
33
+ }
34
+ }
35
+ function loadSkill(name) {
36
+ try {
37
+ return readFileSync(join(skillsDir, name, "SKILL.md"), "utf-8");
38
+ }
39
+ catch {
40
+ return `Skill "${name}" not found`;
41
+ }
42
+ }
43
+ export const BMMPlugin = async () => {
44
+ const agents = listAgents();
45
+ const skills = listSkills();
46
+ return {
47
+ tool: {
48
+ bmm_list: tool({
49
+ description: "List all available BMAD-METHOD agents and skills from bmm-opencode",
50
+ args: {},
51
+ async execute() {
52
+ return `# BMM-OpenCode Resources
53
+
54
+ ## Agents (${agents.length})
55
+ ${agents.map((a) => `- ${a}`).join("\n")}
56
+
57
+ ## Skills (${skills.length})
58
+ ${skills.map((s) => `- ${s}`).join("\n")}
59
+
60
+ ## Usage
61
+ - Use \`bmm_agent\` tool to get agent definition
62
+ - Use \`bmm_skill\` tool to get skill instructions
63
+ - Use \`bmm_install\` tool to copy agents/skills to your project`;
64
+ },
65
+ }),
66
+ bmm_agent: tool({
67
+ description: "Get a BMAD-METHOD agent definition by name",
68
+ args: {
69
+ name: tool.schema.string().describe(`Agent name`),
70
+ },
71
+ async execute(args) {
72
+ return loadAgent(args.name);
73
+ },
74
+ }),
75
+ bmm_skill: tool({
76
+ description: "Get a BMAD-METHOD skill instructions by name",
77
+ args: {
78
+ name: tool.schema.string().describe(`Skill name`),
79
+ },
80
+ async execute(args) {
81
+ return loadSkill(args.name);
82
+ },
83
+ }),
84
+ bmm_install: tool({
85
+ description: "Install BMM agents and skills to your project's .opencode directory",
86
+ args: {
87
+ target: tool.schema
88
+ .string()
89
+ .optional()
90
+ .describe("Target directory (defaults to current project)"),
91
+ },
92
+ async execute(args, context) {
93
+ const targetBase = args.target || join(context.directory, ".opencode");
94
+ try {
95
+ const targetAgents = join(targetBase, "agents");
96
+ const targetSkills = join(targetBase, "skills");
97
+ mkdirSync(targetAgents, { recursive: true });
98
+ mkdirSync(targetSkills, { recursive: true });
99
+ let agentsCopied = 0;
100
+ for (const agent of agents) {
101
+ const src = join(agentsDir, `${agent}.md`);
102
+ const dest = join(targetAgents, `${agent}.md`);
103
+ cpSync(src, dest);
104
+ agentsCopied++;
105
+ }
106
+ let skillsCopied = 0;
107
+ for (const skill of skills) {
108
+ const src = join(skillsDir, skill);
109
+ const dest = join(targetSkills, skill);
110
+ cpSync(src, dest, { recursive: true });
111
+ skillsCopied++;
112
+ }
113
+ return `Successfully installed BMM-OpenCode to ${targetBase}:
114
+ - ${agentsCopied} agents copied to ${targetAgents}
115
+ - ${skillsCopied} skills copied to ${targetSkills}
116
+
117
+ Restart OpenCode to use the new agents and skills.`;
118
+ }
119
+ catch (error) {
120
+ return `Installation failed: ${error instanceof Error ? error.message : String(error)}`;
121
+ }
122
+ },
123
+ }),
124
+ },
125
+ };
126
+ };
127
+ export default BMMPlugin;
package/package.json CHANGED
@@ -1,9 +1,13 @@
1
1
  {
2
2
  "name": "bmm-opencode",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "BMAD-METHOD agents and skills for OpenCode - AI agent framework with 17 specialized agents and 61 workflow skills",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "type": "module",
5
8
  "keywords": [
6
9
  "opencode",
10
+ "plugin",
7
11
  "bmad",
8
12
  "bmad-method",
9
13
  "ai-agents",
@@ -25,9 +29,23 @@
25
29
  },
26
30
  "license": "MIT",
27
31
  "author": "Jack-R-Hong",
28
- "type": "module",
32
+ "scripts": {
33
+ "build": "tsc",
34
+ "dev": "tsc --watch",
35
+ "prepublishOnly": "npm run build"
36
+ },
37
+ "dependencies": {
38
+ "@opencode-ai/plugin": "^1.1.51"
39
+ },
40
+ "devDependencies": {
41
+ "@types/node": "^22.0.0",
42
+ "typescript": "^5.0.0"
43
+ },
29
44
  "files": [
30
- ".opencode/**/*"
45
+ "dist",
46
+ ".opencode/**/*",
47
+ "README.md",
48
+ "LICENSE"
31
49
  ],
32
50
  "publishConfig": {
33
51
  "access": "public"