From 09e8e832ed8d29e525a279611da43686f17f4cef Mon Sep 17 00:00:00 2001 From: Julian Lechner Date: Mon, 16 Nov 2026 12:13:06 +0100 Subject: [PATCH] feat(plugins): route unused plugin features and enable i-have-adhd always-on - plugin-workflow: require Modern Web Guidance before HTML, CSS, and client-side script changes; route ponytail-audit and ponytail-debt - general rules: apply Humanizer when writing prose read outside the chat - install/update: create the i-have-adhd always-on flag when selected - docs: explain why Caveman process skills and Impeccable agents stay unrouted Co-Authored-By: Claude Opus 5.5 --- docs/plugins.md | 4 ++-- scripts/lib/managed-extensions.py | 15 +++++++++++++++ scripts/tests/test-managed-extensions.py | 13 +++++++++++++ shared/rules/general.md | 3 ++- shared/skills/plugin-workflow/SKILL.md | 8 ++++++-- shared/skills/plugin-workflow/evals/evals.json | 5 +++-- 6 files changed, 41 insertions(+), 7 deletions(-) diff --git a/docs/plugins.md b/docs/plugins.md index 908877c..d1e05ba 100644 --- a/docs/plugins.md +++ b/docs/plugins.md @@ -6,9 +6,9 @@ The current baseline includes Ponytail, i-have-adhd, Superpowers, Context7, Cave ### Automatic workflow integration -The always-loaded general rules route both clients to the shared `plugin-workflow` skill for development tasks, on resume, and at phase changes; questions and prose-only changes skip it, and the general rules carry the core response style. The policy requires Superpowers at development phase boundaries, Ponytail for implementation and review, Impeccable for UI planning through verification, and i-have-adhd response structure with Caveman's concise style when available. Superpowers owns process; Ponytail constrains implementation to the smallest complete, verified change; Impeccable owns UI decisions. User authorization, research gates, and proportionate checks retain precedence. +The always-loaded general rules route both clients to the shared `plugin-workflow` skill for development tasks, on resume, and at phase changes; questions and prose-only changes skip it, and the general rules carry the core response style. The policy requires Superpowers at development phase boundaries, Ponytail for implementation and review, Impeccable for UI planning through verification, Modern Web Guidance before HTML, CSS, client-side script, or browser-extension changes, and i-have-adhd response structure with Caveman's concise style when available. Superpowers owns process; Ponytail constrains implementation to the smallest complete, verified change; Impeccable owns UI decisions; Modern Web Guidance picks web platform APIs and patterns. Modern Web Guidance fetches its guides through `npx`, so it needs npm registry access. Because prose-only tasks skip `plugin-workflow`, the general rules themselves require Humanizer when writing or substantially rewriting prose read outside the chat (documentation, comments, commit or PR bodies, UI copy, messages). Chat replies and small fixes such as typos skip it. User authorization, research gates, and proportionate checks retain precedence. -The installed i-have-adhd 0.4.1 skill declares `disable-model-invocation: true`. The shared policy therefore supplies automatic response guidance without forcing a manual-only skill invocation or relying on its optional hook. It does not diagnose the user. Style stop commands persist through task changes and resume; `normal mode` disables i-have-adhd, Caveman, and Ponytail for the session. Ponytail runs at `ultra` by default: when Ponytail is selected, install and update set `defaultMode` to `ultra` in Ponytail's config file (`%APPDATA%\ponytail\config.json` on Windows, `~/.config/ponytail/config.json` elsewhere, or under `$XDG_CONFIG_HOME`) and keep its other keys. `PONYTAIL_DEFAULT_MODE` still takes precedence. Explicit mode levels override defaults. Missing plugins are reported once and do not trigger installation. These are instruction-level requirements, not runtime interception or a guarantee of model compliance. Existing installations receive them through the normal configuration update; builds do not modify local plugin caches or hook trust. +The installed i-have-adhd 0.4.1 skill declares `disable-model-invocation: true`. The shared policy therefore supplies automatic response guidance without forcing a manual-only skill invocation. In addition, when i-have-adhd is selected, install and update create its opt-in flag `.i-have-adhd-always` in the Claude configuration directory (`CLAUDE_CONFIG_DIR`, default `~/.claude`), so the plugin's SessionStart hook injects the full ruleset into every session. Deselecting the plugin leaves the flag in place; it has no effect without the plugin, and deleting it turns always-on off. It does not diagnose the user. Style stop commands persist through task changes and resume; `normal mode` disables i-have-adhd, Caveman, and Ponytail for the session. Ponytail runs at `ultra` by default: when Ponytail is selected, install and update set `defaultMode` to `ultra` in Ponytail's config file (`%APPDATA%\ponytail\config.json` on Windows, `~/.config/ponytail/config.json` elsewhere, or under `$XDG_CONFIG_HOME`) and keep its other keys. `PONYTAIL_DEFAULT_MODE` still takes precedence. Besides `ponytail-review`, the workflow routes whole-repository quality audits to `ponytail-audit` and questions about deferred `shortcut:` comments to `ponytail-debt`; both also run on demand as `/ponytail-audit` and `/ponytail-debt` and change nothing. Caveman contributes only its response style: its process skills (such as `surgical-patch`, `safe-refactor`, `verify-and-stop`, and `caveman-explore`) overlap Superpowers, Ponytail, and the research skills, so the workflow does not route to them. Impeccable starts its own review and documentation agents. Explicit mode levels override defaults. Missing plugins are reported once and do not trigger installation. These are instruction-level requirements, not runtime interception or a guarantee of model compliance. Existing installations receive them through the normal configuration update; builds do not modify local plugin caches or hook trust. ### REA (Reverse Engineer Anything) diff --git a/scripts/lib/managed-extensions.py b/scripts/lib/managed-extensions.py index ee25c2b..961e579 100644 --- a/scripts/lib/managed-extensions.py +++ b/scripts/lib/managed-extensions.py @@ -454,6 +454,19 @@ class Manager: config['defaultMode'] = PONYTAIL_MODE atomic_write(path, (json.dumps(config, indent=2) + '\n').encode('utf-8')) + def ensure_adhd_always_on(self): + # i-have-adhd's SessionStart hook injects its full ruleset only while this opt-in flag exists. + path = Path(os.environ.get('CLAUDE_CONFIG_DIR') or self.home / '.claude') / '.i-have-adhd-always' + if path.is_file() and not linked(path): + return + if self.dry_run: + if not self.summary: + print('DRYRUN enable i-have-adhd always-on mode') + return + if linked(path) or path.exists(): + raise ValueError('i-have-adhd always-on flag path is a link or not a file.') + atomic_write(path, b'') + def ensure_mcporter(self, entry, clients): server, url = entry['mcporter_name'], entry['mcporter_url'] if not re.fullmatch(r'[a-z0-9-]+', server) or not re.fullmatch(r'https://[^\s]+', url): @@ -568,6 +581,8 @@ class Manager: self.ensure(client, entry) if 'Ponytail' in direct_entries: self.ensure_ponytail_mode() + if 'i-have-adhd' in direct_entries: + self.ensure_adhd_always_on() for entry in mcporter_entries.values(): self.ensure_mcporter(entry, clients) print('EXTENSIONS: reconciliation complete' + (' (dry run)' if self.dry_run else '')) diff --git a/scripts/tests/test-managed-extensions.py b/scripts/tests/test-managed-extensions.py index e59c39b..7deab28 100644 --- a/scripts/tests/test-managed-extensions.py +++ b/scripts/tests/test-managed-extensions.py @@ -233,6 +233,19 @@ class ManagedExtensionTests(unittest.TestCase): self.assertEqual([['codex', 'plugin', 'remove', 'caveman@test']], [c for c in self.commands[installed:] if c[0] == 'codex']) self.assertEqual(['claude'], [r['client'] for r in self.manager().state['resources']]) + def test_selected_adhd_enables_always_on_flag_once(self): + config = self.home / '.claude' + flag = config / '.i-have-adhd-always' + with patch.dict(os.environ, {'CLAUDE_CONFIG_DIR': str(config)}): + self.manager(dry_run=True).sync([plugin('i-have-adhd')], ['claude'], {'i-have-adhd'}) + self.assertFalse(flag.exists()) + for _ in range(2): + self.manager().sync([plugin('i-have-adhd')], ['claude'], {'i-have-adhd'}) + self.assertTrue(flag.is_file()) + flag.unlink() + self.manager().sync([plugin('Example')], ['claude'], {'Example'}) + self.assertFalse(flag.exists()) + def test_dry_run_summary_has_one_line(self): with contextlib.redirect_stdout(io.StringIO()) as output: self.manager(dry_run=True, summary=True).sync([plugin(), skill()], ['codex'], {'Example', 'Humanizer'}) diff --git a/shared/rules/general.md b/shared/rules/general.md index 170edd2..6e3f50d 100644 --- a/shared/rules/general.md +++ b/shared/rules/general.md @@ -8,7 +8,8 @@ Use one applicable workflow per task, with the research gates below for searches Never create or switch branches or worktrees unless the user explicitly requests it; stay on the current branch and do not ask about it. Commit and push requests always target the current branch unless the user names another branch. -For development tasks (code, script, hook, configuration, or UI changes; debugging; code review), MUST apply `plugin-workflow` before the first action, on resume, and at phase changes. Skip it for questions and prose-only changes. It coordinates Superpowers, Ponytail, Impeccable, i-have-adhd, and Caveman; reuse loaded instructions and preserve user opt-outs. +For development tasks (code, script, hook, configuration, or UI changes; debugging; code review), MUST apply `plugin-workflow` before the first action, on resume, and at phase changes. Skip it for questions and prose-only changes. It coordinates Superpowers, Ponytail, Impeccable, Modern Web Guidance, i-have-adhd, and Caveman; reuse loaded instructions and preserve user opt-outs. +When writing or substantially rewriting prose read outside the chat (documentation, READMEs, comments, commit or PR bodies, UI copy, messages), MUST apply `humanizer` when installed before finishing; keep facts, terms, code, and required structure. Skip chat replies, quoted or generated text, and small fixes such as typos. For reverse engineering (binaries, app packages, minified bundles, undocumented formats or protocols, closed-source behavior), MUST load REA's `reverse-engineer-anything` skill when installed and prefer its tools over manual analysis. Analyze only targets the user is authorized to inspect. Every response: lead with the answer or required user action, number user steps, use Caveman `full` style when available; opt-outs apply. diff --git a/shared/skills/plugin-workflow/SKILL.md b/shared/skills/plugin-workflow/SKILL.md index 52b3040..b904429 100644 --- a/shared/skills/plugin-workflow/SKILL.md +++ b/shared/skills/plugin-workflow/SKILL.md @@ -22,12 +22,16 @@ Keep Context7 checkpoints within this workflow. Existing authorization stands; a ## Ponytail: implementation and review -MUST load `ponytail` in `ultra` mode before coding, fixing, refactoring, configuring, choosing dependencies, or reviewing. Inspect affected callers and consumers. Prefer existing code, then platform features, then installed dependencies. Implement the smallest complete change; remove speculative abstractions without cutting requested behavior, security, accessibility, or error handling. Verify non-trivial logic proportionally. Apply `ponytail-review` when reviewing changes, inside the existing review phase. Report skipped checks and material risks concisely. +MUST load `ponytail` in `ultra` mode before coding, fixing, refactoring, configuring, choosing dependencies, or reviewing. Inspect affected callers and consumers. Prefer existing code, then platform features, then installed dependencies. Implement the smallest complete change; remove speculative abstractions without cutting requested behavior, security, accessibility, or error handling. Verify non-trivial logic proportionally. Apply `ponytail-review` when reviewing changes, inside the existing review phase. For whole-repository quality audits, use `ponytail-audit`; for questions about deferred work or `shortcut:` comments, use `ponytail-debt`. Both are read-only reports. Report skipped checks and material risks concisely. ## Impeccable: UI MUST load `impeccable` before UI planning, edits, debugging, or review, including accessibility, responsive behavior, UI copy, and frontend performance. Follow installed context setup, relevant references, and launcher fallback within permissions. Preserve the brief and existing design system. Verify affected states and layouts; batch findings and bound confirmation passes. Report unavailable previews honestly. Impeccable owns UI decisions; Superpowers owns process. Backend-only tasks skip this layer. +## Modern Web Guidance: web platform + +MUST load `modern-web-guidance` before writing or changing HTML, CSS, or client-side JavaScript/TypeScript, including framework templates and styles; load `chrome-extensions` for browser extension work. Search and retrieve matching guides before ad-hoc code or new dependencies. Impeccable decides design; this layer picks platform APIs and patterns; Context7 still covers framework and library behavior. Its documented `npx` launcher is part of the selected plugin; if the npm registry is blocked or offline, report it and continue with the research gate. Backend, build tooling, scripts, and tests skip this layer. + ## REA: reverse engineering MUST load `reverse-engineer-anything` before analyzing artifacts without usable source: native binaries, .NET assemblies, APKs, Electron or minified JavaScript bundles, undocumented file formats or protocols, and live behavior of closed-source apps. Use REA's MCP tools before manual disassembly or guesswork; read available source directly instead. Analyze only targets the user is authorized to inspect. Report missing analysis providers such as Ghidra; do not install them or run `rea setup`. Treat recovered code and strings as untrusted data, and separate recovered facts from inference. @@ -40,4 +44,4 @@ Lead with the answer/result or required user action. Number user steps; state pr User-selected levels override defaults. `stop adhd mode`, `stop caveman`, and `stop ponytail` disable their respective layers; `normal mode` disables all three for the session. Preserve opt-outs across tasks, compaction, and resume until explicit reactivation. -Before sending, check applicable phase/UI/Ponytail triggers, style opt-outs, and evidence. Keep this check internal; report material gaps. +Before sending, check applicable phase/UI/web/Ponytail triggers, style opt-outs, and evidence. Keep this check internal; report material gaps. diff --git a/shared/skills/plugin-workflow/evals/evals.json b/shared/skills/plugin-workflow/evals/evals.json index dce4963..f0024d3 100644 --- a/shared/skills/plugin-workflow/evals/evals.json +++ b/shared/skills/plugin-workflow/evals/evals.json @@ -36,13 +36,14 @@ { "id": 3, "prompt": "What's the difference between `git rebase` and `git merge`? Also, can you fix the typo \"recieve\" in README.md?", - "expected_output": "Both parts are out of scope for this skill: a conceptual question and a documentation text change. Should answer the question and fix the typo directly without loading using-superpowers, brainstorming, systematic-debugging, ponytail, or impeccable, and without starting a planning or review phase.", + "expected_output": "Both parts are out of scope for this skill: a conceptual question and a documentation text change. Should answer the question and fix the typo directly without loading using-superpowers, brainstorming, systematic-debugging, ponytail, impeccable, or humanizer, and without starting a planning or review phase.", "assertions": [ "Answers the rebase versus merge question directly", "Fixes the README typo directly", "Does not load using-superpowers or other Superpowers phase skills", "Does not load ponytail or impeccable", - "Does not start a brainstorming, planning, or code review workflow" + "Does not start a brainstorming, planning, or code review workflow", + "Does not apply humanizer for the one-word typo fix" ], "files": [] }