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:
@@ -11,6 +11,9 @@ import { createRequire } from 'module';
|
|||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import os from 'os';
|
import os from 'os';
|
||||||
import path from 'path';
|
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.
|
// The shared instruction builder is CommonJS; bridge to it from this ES module.
|
||||||
const require = createRequire(import.meta.url);
|
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) {}
|
try { client && client.app && client.app.log({ body: { service: 'ponytail', level, message } }); } catch (e) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const ponytailSkillsDir = path.resolve(__dirname, '../../skills');
|
||||||
|
|
||||||
return {
|
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.
|
// Append the ruleset to the system prompt every turn.
|
||||||
'experimental.chat.system.transform': async (_input, output) => {
|
'experimental.chat.system.transform': async (_input, output) => {
|
||||||
const mode = readMode();
|
const mode = readMode();
|
||||||
|
|||||||
Reference in New Issue
Block a user