Skip to content

Commit b0c39e2

Browse files
committed
feat(builtin-skills): add playwright skill with MCP config and disabled_skills option
- Add playwright as builtin skill with MCP server configuration - Add disabled_skills config option to disable specific builtin skills - Update BuiltinSkill type to include mcpConfig field - Update skill merger to handle mcpConfig from builtin to loaded skills - Merge disabled_skills config and filter unavailable builtin skills at plugin init - Update README with Built-in Skills documentation - Regenerate JSON schema 🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
1 parent bd05f5b commit b0c39e2

File tree

7 files changed

+61
-3
lines changed

7 files changed

+61
-3
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -846,6 +846,22 @@ Or disable via `disabled_agents` in `~/.config/opencode/oh-my-opencode.json` or
846846

847847
Available agents: `oracle`, `librarian`, `explore`, `frontend-ui-ux-engineer`, `document-writer`, `multimodal-looker`
848848

849+
### Built-in Skills
850+
851+
Oh My OpenCode includes built-in skills that provide additional capabilities:
852+
853+
- **playwright**: Browser automation with Playwright MCP. Use for web scraping, testing, screenshots, and browser interactions.
854+
855+
Disable built-in skills via `disabled_skills` in `~/.config/opencode/oh-my-opencode.json` or `.opencode/oh-my-opencode.json`:
856+
857+
```json
858+
{
859+
"disabled_skills": ["playwright"]
860+
}
861+
```
862+
863+
Available built-in skills: `playwright`
864+
849865
### Sisyphus Agent
850866

851867
When enabled (default), Sisyphus provides a powerful orchestrator with optional specialized agents:

assets/oh-my-opencode.schema.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,15 @@
3434
]
3535
}
3636
},
37+
"disabled_skills": {
38+
"type": "array",
39+
"items": {
40+
"type": "string",
41+
"enum": [
42+
"playwright"
43+
]
44+
}
45+
},
3746
"disabled_hooks": {
3847
"type": "array",
3948
"items": {

src/config/schema.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ export const BuiltinAgentNameSchema = z.enum([
2626
"multimodal-looker",
2727
])
2828

29+
export const BuiltinSkillNameSchema = z.enum([
30+
"playwright",
31+
])
32+
2933
export const OverridableAgentNameSchema = z.enum([
3034
"build",
3135
"plan",
@@ -231,6 +235,7 @@ export const OhMyOpenCodeConfigSchema = z.object({
231235
$schema: z.string().optional(),
232236
disabled_mcps: z.array(McpNameSchema).optional(),
233237
disabled_agents: z.array(BuiltinAgentNameSchema).optional(),
238+
disabled_skills: z.array(BuiltinSkillNameSchema).optional(),
234239
disabled_hooks: z.array(HookNameSchema).optional(),
235240
disabled_commands: z.array(BuiltinCommandNameSchema).optional(),
236241
agents: AgentOverridesSchema.optional(),
@@ -250,6 +255,7 @@ export type AgentOverrides = z.infer<typeof AgentOverridesSchema>
250255
export type AgentName = z.infer<typeof AgentNameSchema>
251256
export type HookName = z.infer<typeof HookNameSchema>
252257
export type BuiltinCommandName = z.infer<typeof BuiltinCommandNameSchema>
258+
export type BuiltinSkillName = z.infer<typeof BuiltinSkillNameSchema>
253259
export type SisyphusAgentConfig = z.infer<typeof SisyphusAgentConfigSchema>
254260
export type CommentCheckerConfig = z.infer<typeof CommentCheckerConfigSchema>
255261
export type ExperimentalConfig = z.infer<typeof ExperimentalConfigSchema>
Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
import type { BuiltinSkill } from "./types"
22

3+
const playwrightSkill: BuiltinSkill = {
4+
name: "playwright",
5+
description: "Browser automation with Playwright MCP. Use for web scraping, testing, screenshots, and browser interactions.",
6+
template: `# Playwright Browser Automation
7+
8+
This skill provides browser automation capabilities via the Playwright MCP server.`,
9+
mcpConfig: {
10+
playwright: {
11+
command: "npx",
12+
args: ["@playwright/mcp@latest"],
13+
},
14+
},
15+
}
16+
317
export function createBuiltinSkills(): BuiltinSkill[] {
4-
return []
18+
return [playwrightSkill]
519
}

src/features/builtin-skills/types.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import type { SkillMcpConfig } from "../skill-mcp-manager/types"
2+
13
export interface BuiltinSkill {
24
name: string
35
description: string
@@ -10,4 +12,5 @@ export interface BuiltinSkill {
1012
model?: string
1113
subtask?: boolean
1214
argumentHint?: string
15+
mcpConfig?: SkillMcpConfig
1316
}

src/features/opencode-skill-loader/merger.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const SCOPE_PRIORITY: Record<SkillScope, number> = {
2121
function builtinToLoaded(builtin: BuiltinSkill): LoadedSkill {
2222
const definition: CommandDefinition = {
2323
name: builtin.name,
24-
description: `(builtin - Skill) ${builtin.description}`,
24+
description: `(opencode - Skill) ${builtin.description}`,
2525
template: builtin.template,
2626
model: builtin.model,
2727
agent: builtin.agent,
@@ -37,6 +37,7 @@ function builtinToLoaded(builtin: BuiltinSkill): LoadedSkill {
3737
compatibility: builtin.compatibility,
3838
metadata: builtin.metadata as Record<string, string> | undefined,
3939
allowedTools: builtin.allowedTools,
40+
mcpConfig: builtin.mcpConfig,
4041
}
4142
}
4243

src/index.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,12 @@ function mergeConfigs(
128128
...(override.disabled_commands ?? []),
129129
]),
130130
],
131+
disabled_skills: [
132+
...new Set([
133+
...(base.disabled_skills ?? []),
134+
...(override.disabled_skills ?? []),
135+
]),
136+
],
131137
claude_code: deepMerge(base.claude_code, override.claude_code),
132138
};
133139
}
@@ -283,7 +289,10 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => {
283289

284290
const callOmoAgent = createCallOmoAgent(ctx, backgroundManager);
285291
const lookAt = createLookAt(ctx);
286-
const builtinSkills = createBuiltinSkills();
292+
const disabledSkills = new Set(pluginConfig.disabled_skills ?? []);
293+
const builtinSkills = createBuiltinSkills().filter(
294+
(skill) => !disabledSkills.has(skill.name as any)
295+
);
287296
const includeClaudeSkills = pluginConfig.claude_code?.skills !== false;
288297
const mergedSkills = mergeSkills(
289298
builtinSkills,

0 commit comments

Comments
 (0)