0
Fork 0
mirror of https://github.com/blader/humanizer.git synced 2026-09-27 18:19:51 +00:00

plugin for opencode #279

Open
opened 2026-09-14 12:12:19 +00:00 by tan-wei-xin-alez · 0 comments
tan-wei-xin-alez commented 2026-09-14 12:12:19 +00:00 (Migrated from github.com)

I like using plugins that are automatically loaded every session in opencode so I created the following one based on https://github.com/ayghri/i-have-adhd/blob/main/.opencode/plugins/i-have-adhd.mjs, might be useful to some people who don't want to have to manually keep calling this skill

➜  ~ cat opencode/humanizer/.opencode/plugins/humanizer.mjs
// Humanizer OpenCode plugin.
// Injects the shared Humanizer rules into every chat system prompt.

import fs from 'fs';
import path from 'path';
import { fileURLToPath } from 'url';

const __dirname = path.dirname(fileURLToPath(import.meta.url));
const skillPath = path.resolve(__dirname, '../../SKILL.md');

function rulesetBody() {
  return fs
    .readFileSync(skillPath, 'utf8')
    .replace(/^---[^\S\r\n]*\r?\n[\s\S]*?\r?\n---[^\S\r\n]*(?:\r?\n|$)/, '')
    .replace(/(?:\r?\n)+$/, '');
}

export default async () => ({
  'experimental.chat.system.transform': async (_input, output) => {
    let body;
    try {
      body = rulesetBody();
    } catch (_error) {
      return;
    }

    output.system.push(
      'HUMANIZER MODE ACTIVE. Apply these rules to assistant prose while preserving code, commands, paths, structured data, URLs, quoted text, and exact-output requests.\n\n' +
        body,
    );
  },
});

Testing

  ┃
  ┃  are ponytail, i-have-adhd and humanizer plugins called automatically every opencode session?
  ┃

     Thought · 5ms

     Yes, in this session:

     - ponytail: active automatically at full level.
     - i-have-adhd: active automatically and marked always-on.
     - humanizer: active automatically.

     They are not being invoked as tool calls each session. Their instructions were injected into the session
     context by the OpenCode configuration or session setup.

     The separate skill tool is only needed when loading a skill listed under available_skills; these three are
     already active before any tool call.

     ▣  Plan · GPT-5.6 Luna · 7.7s
I like using plugins that are automatically loaded every session in opencode so I created the following one based on https://github.com/ayghri/i-have-adhd/blob/main/.opencode/plugins/i-have-adhd.mjs, might be useful to some people who don't want to have to manually keep calling this skill ``` ➜ ~ cat opencode/humanizer/.opencode/plugins/humanizer.mjs // Humanizer OpenCode plugin. // Injects the shared Humanizer rules into every chat system prompt. import fs from 'fs'; import path from 'path'; import { fileURLToPath } from 'url'; const __dirname = path.dirname(fileURLToPath(import.meta.url)); const skillPath = path.resolve(__dirname, '../../SKILL.md'); function rulesetBody() { return fs .readFileSync(skillPath, 'utf8') .replace(/^---[^\S\r\n]*\r?\n[\s\S]*?\r?\n---[^\S\r\n]*(?:\r?\n|$)/, '') .replace(/(?:\r?\n)+$/, ''); } export default async () => ({ 'experimental.chat.system.transform': async (_input, output) => { let body; try { body = rulesetBody(); } catch (_error) { return; } output.system.push( 'HUMANIZER MODE ACTIVE. Apply these rules to assistant prose while preserving code, commands, paths, structured data, URLs, quoted text, and exact-output requests.\n\n' + body, ); }, }); ``` Testing ``` ┃ ┃ are ponytail, i-have-adhd and humanizer plugins called automatically every opencode session? ┃ Thought · 5ms Yes, in this session: - ponytail: active automatically at full level. - i-have-adhd: active automatically and marked always-on. - humanizer: active automatically. They are not being invoked as tool calls each session. Their instructions were injected into the session context by the OpenCode configuration or session setup. The separate skill tool is only needed when loading a skill listed under available_skills; these three are already active before any tool call. ▣ Plan · GPT-5.6 Luna · 7.7s ```
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
skills/blader-humanizer#279
No description provided.