fix: register skills directory via config hook so opencode discovers ponytail skills (#138)

The ponytail plugin was missing a config hook to register its skills/
directory with opencode's skill discovery system. Without this, the 5
ponytail skills (ponytail, ponytail-audit, ponytail-debt, ponytail-help,
ponytail-review) never appear in the skill tool's available list.

The superpowers plugin already follows this exact pattern — this brings
ponytail in line with the upstream convention.
This commit is contained in:
Tianen Cheng
2026-06-19 00:24:46 +02:00
committed by GitHub
parent 4dad14fac5
commit a28e5ec123
+14
View File
@@ -11,6 +11,9 @@ import { createRequire } from 'module';
import fs from 'fs';
import os from 'os';
import path from 'path';
import { fileURLToPath } from 'url';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
// The shared instruction builder is CommonJS; bridge to it from this ES module.
const require = createRequire(import.meta.url);
@@ -42,7 +45,18 @@ export default async ({ client } = {}) => {
try { client && client.app && client.app.log({ body: { service: 'ponytail', level, message } }); } catch (e) {}
};
const ponytailSkillsDir = path.resolve(__dirname, '../../skills');
return {
// Register skills directory so opencode discovers ponytail skills.
config: async (config) => {
config.skills = config.skills || {};
config.skills.paths = config.skills.paths || [];
if (!config.skills.paths.includes(ponytailSkillsDir)) {
config.skills.paths.push(ponytailSkillsDir);
}
},
// Append the ruleset to the system prompt every turn.
'experimental.chat.system.transform': async (_input, output) => {
const mode = readMode();