feat(plugins): enable Impeccable hooks for Codex and trim extensions

- Register Impeccable's design-detector PostToolUse and Stop hooks in the
  Codex config through new no-op-safe wrappers; Claude already gets them
  from the Impeccable plugin.
- Make Caveman Claude-only: a '-' codex_method marks Claude-only entries,
  which the Codex selector omits and sync removes from owned Codex
  installs. Drop the thinkhome Caveman Windows hook repair.
- Remove Anthropic Frontend Design from the manifest, plugin workflow,
  and docs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Julian LechnerandClaude Opus 5.5 committed 2026-11-16 10:57:56 +01:00
1 parent eb7cecaaa2
commit f7222a90c2
20 files changed
+109 -95

No files matched your search

+2 -2
View File
@@ -96,8 +96,8 @@ Install and update also rebuild internally; the explicit build above lets you ch
- Separate install, update, and uninstall scripts: install refuses to run against an already-installed destination,
update refuses to run against one that is not installed yet, and uninstall refuses to run against one that was
never installed.
- User-level extension installation for Ponytail, i-have-adhd, Superpowers, Context7, Caveman, MCPorter,
Humanizer, Impeccable, Anthropic Frontend Design, and REA, with an interactive extension toggle during both install and update. Only extensions
- User-level extension installation for Ponytail, i-have-adhd, Superpowers, Context7, Caveman (Claude only), MCPorter,
Humanizer, Impeccable, and REA, with an interactive extension toggle during both install and update. Only extensions
installed and recorded by this setup can be removed through deselection.
- Optional local search for both clients through QMD with Qwen3-Embedding-4B, Qwen3-Reranker-4B, and QMD Query Expansion 1.7B (Yes/No/Auto; Auto benchmarks GPU, then CPU).
+16
View File
@@ -48,3 +48,19 @@ type = "command"
command = '__HOOK_COMMAND__ "__AI_CONFIG_ROOT__/hooks/scripts/__COMMAND_SAFETY_SCRIPT__"'
command_windows = '__POWERSHELL_HOOK_COMMAND__ "__AI_CONFIG_ROOT__/hooks/scripts/__COMMAND_SAFETY_SCRIPT__"'
timeout = 6
# Impeccable's design detector; the wrapper is a no-op unless the Impeccable Codex skill is installed.
[[hooks.PostToolUse]]
matcher = "Edit|Write|apply_patch"
[[hooks.PostToolUse.hooks]]
type = "command"
command = '__HOOK_COMMAND__ "__AI_CONFIG_ROOT__/hooks/scripts/__IMPECCABLE_HOOK_SCRIPT__"'
command_windows = '__POWERSHELL_HOOK_COMMAND__ "__AI_CONFIG_ROOT__/hooks/scripts/__IMPECCABLE_HOOK_SCRIPT__"'
timeout = 10
[[hooks.Stop]]
[[hooks.Stop.hooks]]
type = "command"
command = '__HOOK_COMMAND__ "__AI_CONFIG_ROOT__/hooks/scripts/__IMPECCABLE_HOOK_SCRIPT__"'
command_windows = '__POWERSHELL_HOOK_COMMAND__ "__AI_CONFIG_ROOT__/hooks/scripts/__IMPECCABLE_HOOK_SCRIPT__"'
timeout = 30
+1
View File
@@ -11,5 +11,6 @@ __QMD_WARM_SCRIPT__ Start-QmdWarm.ps1 start-qmd-warm.sh
__CORRECTION_PROMPT_SCRIPT__ Show-CorrectionPrompt.ps1 show-correction-prompt.sh
__COMPLETION_EVIDENCE_SCRIPT__ Check-CompletionEvidence.ps1 check-completion-evidence.sh
__COMMAND_SAFETY_SCRIPT__ Validate-CommandSafety.ps1 validate-command-safety.sh
__IMPECCABLE_HOOK_SCRIPT__ Invoke-ImpeccableHook.ps1 invoke-impeccable-hook.sh
__SHELL_TOOL__ PowerShell Bash
__SCRIPT_EXTENSION__ ps1 sh
1 placeholder powershell bash
11 __CORRECTION_PROMPT_SCRIPT__ Show-CorrectionPrompt.ps1 show-correction-prompt.sh
12 __COMPLETION_EVIDENCE_SCRIPT__ Check-CompletionEvidence.ps1 check-completion-evidence.sh
13 __COMMAND_SAFETY_SCRIPT__ Validate-CommandSafety.ps1 validate-command-safety.sh
14 __IMPECCABLE_HOOK_SCRIPT__ Invoke-ImpeccableHook.ps1 invoke-impeccable-hook.sh
15 __SHELL_TOOL__ PowerShell Bash
16 __SCRIPT_EXTENSION__ ps1 sh
+1 -2
View File
@@ -3,9 +3,8 @@ Ponytail DietrichGebert/ponytail ponytail@ponytail DietrichGebert/ponytail ponyt
i-have-adhd ayghri/i-have-adhd i-have-adhd@i-have-adhd ayghri/i-have-adhd i-have-adhd@i-have-adhd plugin - -
Superpowers anthropics/claude-plugins-official superpowers@claude-plugins-official openai-curated-remote superpowers@openai-curated-remote plugin - -
Context7 upstash/context7 context7@context7-marketplace upstash/context7 context7@context7-marketplace plugin - - context7 https://mcp.context7.com/mcp
Caveman JuliusBrussee/caveman caveman@caveman thinkhome-org/caveman-codex caveman@thinkhome-caveman plugin - -
Caveman JuliusBrussee/caveman caveman@caveman - - - - -
MCPorter - mcporter - mcporter cli mcporter -
Humanizer blader/humanizer humanizer@humanizer - - skill blader/humanizer humanizer
Impeccable pbakaus/impeccable impeccable@impeccable pbakaus/impeccable impeccable skill pbakaus/impeccable impeccable
Anthropic Frontend Design anthropics/claude-plugins-official frontend-design@claude-plugins-official - - skill anthropics/skills frontend-design
REA morluto/rea rea@rea morluto/rea rea@rea plugin - -
1 name claude_marketplace claude_plugin codex_marketplace codex_plugin codex_method codex_source codex_skill mcporter_name mcporter_url
3 i-have-adhd ayghri/i-have-adhd i-have-adhd@i-have-adhd ayghri/i-have-adhd i-have-adhd@i-have-adhd plugin - -
4 Superpowers anthropics/claude-plugins-official superpowers@claude-plugins-official openai-curated-remote superpowers@openai-curated-remote plugin - -
5 Context7 upstash/context7 context7@context7-marketplace upstash/context7 context7@context7-marketplace plugin - - context7 https://mcp.context7.com/mcp
6 Caveman JuliusBrussee/caveman caveman@caveman thinkhome-org/caveman-codex - caveman@thinkhome-caveman - plugin - - -
7 MCPorter - mcporter - mcporter cli mcporter -
8 Humanizer blader/humanizer humanizer@humanizer - - skill blader/humanizer humanizer
9 Impeccable pbakaus/impeccable impeccable@impeccable pbakaus/impeccable impeccable skill pbakaus/impeccable impeccable
Anthropic Frontend Design anthropics/claude-plugins-official frontend-design@claude-plugins-official - - skill anthropics/skills frontend-design
10 REA morluto/rea rea@rea morluto/rea rea@rea plugin - -
+3 -5
View File
@@ -2,11 +2,11 @@
The user-level plugin manifest is `adapters/plugins.tsv`. It maps each logical extension to the client-specific plugin, skill, or MCP installation method.
The current baseline includes Ponytail, i-have-adhd, Superpowers, Context7, Caveman, MCPorter, Humanizer, Impeccable, Anthropic Frontend Design, and REA. Install and update operate at user scope and show an extension selector unless running a dry run or Quickupdate. Selections are collected before configuration changes. Both rebuild generated packages before synchronizing client files and extensions. Choosing Auto for local search can prepare and benchmark QMD earlier, during option selection.
The current baseline includes Ponytail, i-have-adhd, Superpowers, Context7, Caveman (Claude only), MCPorter, Humanizer, Impeccable, and REA. Install and update operate at user scope and show an extension selector unless running a dry run or Quickupdate. Selections are collected before configuration changes. Both rebuild generated packages before synchronizing client files and extensions. Choosing Auto for local search can prepare and benchmark QMD earlier, during option selection.
### 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; Frontend Design supplements uncovered needs without starting another workflow. 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, 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 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. 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.
@@ -47,9 +47,7 @@ The check passes only if documentation retrieval returns relevant content with a
Codex's local `plugins` and `marketplaces` tables survive configuration synchronization, along with other root keys, extra fields in managed tables, other unmanaged tables, and unowned array tables; changed files are backed up. Cached plugin files alone are not treated as proof of installation: selection uses the client CLI's installed list. If an older update removed the registrations, inspect the backed-up `config.toml` under `~/.codex/backups/` and reselect the affected plugins on the next update.
Codex receives Caveman through its native plugin adapter. Humanizer, Impeccable, and Anthropic Frontend Design are downloaded as skill payloads from the GitHub sources in the manifest, without running upstream installers. All three appear in the extension selector for Codex. Ownership is recorded in `~/.my-ai-configuration/extensions.json`. Skill files are tracked by hash; modified or foreign files are retained with a warning. Existing installations from before ownership tracking are not automatically adopted.
On Windows, installation and update repair the known Caveman 1.0.0 hook launcher in setup-owned Codex installations so it resolves the plugin path under PowerShell as well as Command Prompt. Custom commands and foreign installations are preserved. Review the changed hook definitions in Codex `/hooks`; setup does not grant hook trust automatically.
Caveman is installed for Claude only: a `-` in the `codex_method` column marks a Claude-only extension, which the Codex selector omits and which install and update remove from Codex when this setup installed it there. Humanizer and Impeccable are downloaded to Codex as skill payloads from the GitHub sources in the manifest, without running upstream installers. Both appear in the extension selector for Codex. Impeccable's design-detector hooks run in every project for both clients: Claude through the plugin's own hooks, Codex through the registered `Invoke-ImpeccableHook`/`invoke-impeccable-hook.sh` wrapper (see `shared/hooks/README.md`). No per-project `impeccable hooks on` is needed; `impeccable hooks off` still disables a project. Ownership is recorded in `~/.my-ai-configuration/extensions.json`. Skill files are tracked by hash; modified or foreign files are retained with a warning. Existing installations from before ownership tracking are not automatically adopted.
### Setup options outside the extension selector
+1 -1
View File
@@ -9,7 +9,7 @@ from personal_instructions import CLIENT_FILES, render
# Hook scripts this configuration installs; merges replace these and keep any foreign hooks.
OWNED_HOOK_PATTERN = r'(?:flashbang|statusline|record-compact|session-state-pointer|qmd-warm|Start-QmdWarm|completion-?evidence|correction-?prompt|command-?safety)\.(?:ps1|sh)'
OWNED_HOOK_PATTERN = r'(?:flashbang|statusline|record-compact|session-state-pointer|qmd-warm|Start-QmdWarm|completion-?evidence|correction-?prompt|command-?safety|impeccable-?hook)\.(?:ps1|sh)'
def is_flashbang(hook):
+6 -28
View File
@@ -424,30 +424,6 @@ class Manager:
self.state['resources'].append(dict(client='shared', name=entry['name'], kind='cli', package=package, clients=[client]))
self.save()
def repair_caveman_windows_hooks(self):
if self.dry_run or os.name != 'nt':
return
if not any(r['client'] == 'codex' and r['kind'] == 'plugin'
and r['selector'] == 'caveman@thinkhome-caveman' for r in self.state['resources']):
return
# ponytail: only the known 1.0.0 command; remove when upstream ships a portable launcher.
path = safe_path(self.home, '.codex/plugins/cache/thinkhome-caveman/caveman/1.0.0/hooks/hooks.json')
if not path.is_file():
return
content = json.loads(path.read_text(encoding='utf-8'))
changed = False
for groups in content.get('hooks', {}).values():
for group in groups:
for hook in group.get('hooks', []):
if hook.get('commandWindows') == 'node "%PLUGIN_ROOT%\\hooks\\caveman-hook.mjs"':
hook['commandWindows'] = ('node -e "import(require(\'node:url\').pathToFileURL('
'require(\'node:path\').join(process.env.PLUGIN_ROOT,'
'\'hooks\',\'caveman-hook.mjs\')).href)"')
changed = True
if changed:
atomic_write(path, (json.dumps(content, indent=2) + '\n').encode('utf-8'))
print('Repaired Caveman Windows hook commands; review the changed hooks in Codex /hooks.')
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):
@@ -540,11 +516,14 @@ class Manager:
use_mcporter = 'MCPorter' in desired
mcporter_entries = {name: entry for name, entry in desired.items() if use_mcporter and entry.get('mcporter_name') and entry.get('mcporter_url') not in ('', '-')}
direct_entries = {name: entry for name, entry in desired.items() if name not in mcporter_entries}
# codex_method '-' marks a Claude-only extension; owned Codex installs of it are removed.
claude_only = {name for name, entry in direct_entries.items() if entry['codex_method'] == '-'}
for record in sorted(self.state['resources'], key=lambda record: record['kind'] != 'mcp'):
if record['client'] != 'shared' and record['client'] not in clients:
continue
selected_entries = mcporter_entries if record['kind'] == 'mcp' else direct_entries
if (action == 'sync' and record['name'] not in selected_entries) or (action == 'remove' and record['name'] in selected):
if ((action == 'sync' and record['name'] not in selected_entries) or (action == 'remove' and record['name'] in selected)
or (action != 'remove' and record['client'] == 'codex' and record['name'] in claude_only)):
if record['client'] == 'shared':
remaining = [client for client in record.get('clients', ['claude', 'codex']) if client not in clients]
if remaining:
@@ -555,9 +534,8 @@ class Manager:
if action != 'remove':
for client in clients:
for entry in direct_entries.values():
self.ensure(client, entry)
if client == 'codex' and entry.get('codex_plugin') == 'caveman@thinkhome-caveman':
self.repair_caveman_windows_hooks()
if client != 'codex' or entry['name'] not in claude_only:
self.ensure(client, entry)
for entry in mcporter_entries.values():
self.ensure_mcporter(entry, clients)
print('EXTENSIONS: reconciliation complete' + (' (dry run)' if self.dry_run else ''))
+3
View File
@@ -121,6 +121,8 @@ function Select-ConfiguredPlugins {
[switch]$DryRun
)
$entries = @(Get-ConfiguredPluginEntries -RepositoryRoot $RepositoryRoot)
# codex_method '-' marks a Claude-only extension.
if ($Client -eq 'Codex') { $entries = @($entries | Where-Object { $_.codex_method -ne '-' }) }
$toggleable = @($entries)
$fixed = @($entries | Where-Object { $toggleable -notcontains $_ })
if ($toggleable.Count -eq 0 -or ($DryRun -and $Mode -eq 'Install')) { return @{ Selected = $entries; Deselected = @() } }
@@ -136,6 +138,7 @@ function Select-ConfiguredPlugins {
Test-InstalledMCPServer -HomePath $HomePath -Name $entry.mcporter_name -Url $entry.mcporter_url
} else { $false }
foreach ($referenceClient in $referenceClients) {
if ($referenceClient -eq 'Codex' -and $entry.codex_method -eq '-') { continue }
$selector = if ($referenceClient -eq 'Claude') { $entry.claude_plugin } else { $entry.codex_plugin }
if ($referenceClient -eq 'Codex' -and $entry.codex_method -ne 'plugin') {
$found = $found -or (Test-Path -LiteralPath (Join-Path $HomePath ('.agents/skills/' + $entry.codex_skill))) -or (Test-Path -LiteralPath (Join-Path $HomePath ('.codex/skills/' + $entry.codex_skill)))
+3
View File
@@ -146,6 +146,8 @@ select_configured_plugins() {
local name all_names=() toggle_names=() fixed_names=()
while IFS= read -r name; do
# codex_method '-' marks a Claude-only extension.
if [ "$client" = codex ] && [ "$(plugin_field "$root" "$name" codex_method)" = - ]; then continue; fi
all_names+=("$name")
if plugin_toggleable "$root" "$name" "$client"; then toggle_names+=("$name"); else fixed_names+=("$name"); fi
done < <(get_plugin_names "$root")
@@ -178,6 +180,7 @@ select_configured_plugins() {
else status=$?; [ "$status" -eq 1 ] || return "$status"; fi
fi
for reference_client in "${reference_clients[@]}"; do
if [ "$reference_client" = codex ] && [ "$(plugin_field "$root" "$name" codex_method)" = - ]; then continue; fi
if [ "$reference_client" = claude ]; then selector=$(plugin_field "$root" "$name" claude_plugin); else selector=$(plugin_field "$root" "$name" codex_plugin); fi
if [ "$reference_client" = codex ] && [ "$(plugin_field "$root" "$name" codex_method)" != plugin ]; then
local skill_name
+33
View File
@@ -109,6 +109,39 @@ class InstallOptionsTests(unittest.TestCase):
self.assertNotIn('qmd-warm', result)
self.assertNotIn('hooks.SessionStart', result)
def test_codex_merge_registers_impeccable_hooks_once(self):
managed = (ROOT / 'adapters/codex/config/config.toml').read_text(encoding='utf-8')
managed = managed.replace('__IMPECCABLE_HOOK_SCRIPT__', 'invoke-impeccable-hook.sh')
merged = OPTIONS.merge_toml(OPTIONS.merge_toml('', managed), managed)
hooks = tomllib.loads(merged)['hooks']
impeccable = lambda groups: [group for group in groups if 'impeccable-hook' in group['hooks'][0]['command']]
self.assertEqual(1, len(impeccable(hooks['PostToolUse'])))
self.assertEqual('Edit|Write|apply_patch', impeccable(hooks['PostToolUse'])[0]['matcher'])
self.assertEqual(1, len(impeccable(hooks['Stop'])))
def test_impeccable_hook_wrappers_forward_event_or_are_noops(self):
scripts = ROOT / 'shared/hooks/scripts'
shells = [(shutil.which('bash'), [], 'invoke-impeccable-hook.sh', 'impeccable', 'printf "%s:" "$1"; cat\n')]
if os.name == 'nt':
shells.append((shutil.which('powershell'), ['-NoProfile', '-ExecutionPolicy', 'Bypass', '-File'],
'Invoke-ImpeccableHook.ps1', 'impeccable.cmd', '@echo off\r\n<nul set /p=%1:\r\nmore\r\n'))
for executable, arguments, name, launcher_name, launcher_body in shells:
if not executable:
continue
with self.subTest(shell=name), tempfile.TemporaryDirectory() as directory:
home = Path(directory)
env = dict(os.environ, HOME=str(home), USERPROFILE=str(home), CODEX_HOME=str(home / '.codex'))
run = lambda: subprocess.run([executable, *arguments, str(scripts / name)], input='{"event":1}',
env=env, capture_output=True, text=True, timeout=60)
result = run()
self.assertEqual((0, ''), (result.returncode, result.stdout), result.stderr)
launcher = home / '.agents/skills/impeccable/scripts' / launcher_name
launcher.parent.mkdir(parents=True)
launcher.write_text(launcher_body, newline='')
result = run()
self.assertEqual(0, result.returncode, result.stderr)
self.assertEqual('hook:{"event":1}', result.stdout.strip())
def test_instruction_line_only_with_semantic_search(self):
text = 'Line one.\nWhen `semantic-search` is installed, run it first.\nLine three.\n'
self.assertEqual(OPTIONS.filter_instructions(text, False), 'Line one.\nLine three.\n')
+8 -49
View File
@@ -224,55 +224,14 @@ class ManagedExtensionTests(unittest.TestCase):
self.manager().sync([plugin()], ['claude'], {'Example'})
self.assertEqual(3, command.call_count)
@unittest.skipUnless(os.name == 'nt', 'Windows hook compatibility')
def test_owned_caveman_hook_repair_runs_in_powershell_and_is_idempotent(self):
entry = dict(plugin('Caveman'), codex_plugin='caveman@thinkhome-caveman')
root = self.home / '.codex/plugins/cache/thinkhome-caveman/caveman/1.0.0'
path = root / 'hooks/hooks.json'
path.parent.mkdir(parents=True)
hook = {'type': 'command', 'command': 'unchanged',
'commandWindows': 'node "%PLUGIN_ROOT%\\hooks\\caveman-hook.mjs"'}
path.write_text(json.dumps({'hooks': {event: [{'hooks': [dict(hook)]}]
for event in ['SessionStart', 'UserPromptSubmit', 'SubagentStart']}}))
upstream = path.read_bytes()
self.manager().sync([entry], ['codex'], {'Caveman'})
repaired = path.read_bytes()
for groups in json.loads(repaired)['hooks'].values():
self.assertNotIn('%PLUGIN_ROOT%', groups[0]['hooks'][0]['commandWindows'])
self.assertEqual('unchanged', groups[0]['hooks'][0]['command'])
self.manager().sync([entry], ['codex'], {'Caveman'})
self.assertEqual(repaired, path.read_bytes())
path.write_bytes(upstream)
self.manager(update=True).sync([entry], ['codex'], {'Caveman'})
self.assertEqual(repaired, path.read_bytes())
if not shutil.which('node'):
self.skipTest('Node is unavailable for launcher execution')
(root / 'hooks/caveman-hook.mjs').write_text("process.stdout.write('hook-ok');")
command = json.loads(repaired)['hooks']['SessionStart'][0]['hooks'][0]['commandWindows']
result = subprocess.run(['powershell', '-NoProfile', '-Command', command],
env=dict(os.environ, PLUGIN_ROOT=str(root)), capture_output=True, text=True, timeout=10)
self.assertEqual(0, result.returncode, result.stderr)
self.assertEqual('hook-ok', result.stdout)
@unittest.skipUnless(os.name == 'nt', 'Windows hook compatibility')
def test_caveman_repair_preserves_foreign_and_custom_hooks_and_dry_runs(self):
entry = dict(plugin('Caveman'), codex_plugin='caveman@thinkhome-caveman')
path = self.home / '.codex/plugins/cache/thinkhome-caveman/caveman/1.0.0/hooks/hooks.json'
path.parent.mkdir(parents=True)
original = json.dumps({'hooks': {'SessionStart': [{'hooks': [{'commandWindows':
'node "%PLUGIN_ROOT%\\hooks\\caveman-hook.mjs"'}]}]}}).encode()
path.write_bytes(original)
self.installed['codex'][entry['codex_plugin']] = {}
self.manager().sync([entry], ['codex'], {'Caveman'})
self.assertEqual([], self.manager().state['resources'])
self.assertEqual(original, path.read_bytes())
self.installed['codex'].clear()
self.manager(dry_run=True).sync([entry], ['codex'], {'Caveman'})
self.assertEqual(original, path.read_bytes())
original = b'{"hooks":{"SessionStart":[{"hooks":[{"commandWindows":"custom"}]}]}}'
path.write_bytes(original)
self.manager().sync([entry], ['codex'], {'Caveman'})
self.assertEqual(original, path.read_bytes())
def test_claude_only_entry_removes_owned_codex_install_and_keeps_claude(self):
self.manager().sync([plugin('Caveman')], ['claude', 'codex'], {'Caveman'})
installed = len(self.commands)
claude_only = dict(plugin('Caveman'), codex_method='-', codex_plugin='-')
for action in ('install', 'sync'):
self.manager().sync([claude_only], ['claude', 'codex'], {'Caveman'}, action)
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_dry_run_summary_has_one_line(self):
with contextlib.redirect_stdout(io.StringIO()) as output:
+3 -2
View File
@@ -37,7 +37,7 @@ catch { $failed = $true }
$env:AI_CONFIG_VERBOSE = $null
if (-not $failed -or $diagnostics -notcontains 'download progress' -or $diagnostics -notcontains 'WARN test warning') { throw 'Plugin failure must retain full diagnostics and fail.' }
$global:LASTEXITCODE = 0
$script:codexInventory = '{"installed":[{"pluginId":"ponytail@ponytail"},{"pluginId":"i-have-adhd@i-have-adhd"},{"pluginId":"superpowers@openai-curated-remote"},{"pluginId":"context7@context7-marketplace"},{"pluginId":"caveman@thinkhome-caveman"}],"available":[]}'
$script:codexInventory = '{"installed":[{"pluginId":"ponytail@ponytail"},{"pluginId":"i-have-adhd@i-have-adhd"},{"pluginId":"superpowers@openai-curated-remote"},{"pluginId":"context7@context7-marketplace"}],"available":[]}'
function codex { $script:observedCodexHome = $env:CODEX_HOME; $script:observedProfile = $env:USERPROFILE; $script:codexInventory }
$testHome = Join-Path ([System.IO.Path]::GetTempPath()) 'ai-config-plugin-test-home'
$previousCodexHome = [Environment]::GetEnvironmentVariable('CODEX_HOME', 'Process')
@@ -47,7 +47,8 @@ if ($observedCodexHome -ne (Join-Path $testHome '.codex') -or $observedProfile -
if ([Environment]::GetEnvironmentVariable('CODEX_HOME', 'Process') -ne $previousCodexHome -or [Environment]::GetEnvironmentVariable('USERPROFILE', 'Process') -ne $previousProfile) { throw 'Plugin inspection must restore the process environment.' }
$script:answers.Enqueue('done')
$selection = Select-ConfiguredPlugins -RepositoryRoot (Split-Path (Split-Path $PSScriptRoot -Parent) -Parent) -Client Codex -Mode Update
if (@($selection.Selected | Where-Object { $_.codex_method -eq 'plugin' }).Count -ne 5) { throw 'All installed Codex plugins must start checked when updating.' }
if (@($selection.Selected | Where-Object { $_.codex_method -eq 'plugin' }).Count -ne 4) { throw 'All installed Codex plugins must start checked when updating.' }
if (@($selection.Selected + $selection.Deselected | Where-Object { $_.name -eq 'Caveman' }).Count) { throw 'Claude-only extensions must not be offered for Codex.' }
$script:answers.Enqueue('4')
$script:answers.Enqueue('done')
$selection = Select-ConfiguredPlugins -RepositoryRoot (Split-Path (Split-Path $PSScriptRoot -Parent) -Parent) -Client Codex -Mode Update
+1
View File
@@ -48,6 +48,7 @@ select_configured_plugins "$root" codex Update true selected deselected
printf '%s\n' '{"mcpServers":{"context7":{"baseUrl":"https://example.invalid/mcp"}}}' > "$test_home/.mcporter/mcporter.json"
select_configured_plugins "$root" codex Update true selected deselected
[[ " ${deselected[*]} " == *' Context7 '* ]] || { printf 'A different MCPorter server must not select Context7.\n' >&2; exit 1; }
[[ " ${selected[*]} ${deselected[*]} " != *' Caveman '* ]] || { printf 'Claude-only extensions must not be offered for Codex.\n' >&2; exit 1; }
npm_prefix=$(mktemp -d "$root/.npm-test.XXXXXX")
cli_name="ai-config-test-cli-${npm_prefix##*.}"
npm() { printf '%s\n' "$npm_prefix"; }
+3 -3
View File
@@ -35,15 +35,15 @@ class SelectionTests(unittest.TestCase):
self.assertFalse(self.path.exists())
def test_selection_round_trip_and_last_successful_write(self):
self.save('--selected', 'Superpowers', 'Anthropic Frontend Design', '--deselected', 'Context7')
self.save('--selected', 'Superpowers', 'Humanizer', '--deselected', 'Context7')
original = self.path.read_bytes()
state = json.loads(self.run_state('read').stdout)
self.assertEqual(state['shell'], 'powershell')
self.assertEqual(state['client'], 'both')
self.assertEqual(state['selected'], ['Superpowers', 'Anthropic Frontend Design'])
self.assertEqual(state['selected'], ['Superpowers', 'Humanizer'])
self.assertEqual(state['deselected'], ['Context7'])
self.assertEqual(self.path.read_bytes(), original)
self.assertIn('selected\tAnthropic Frontend Design', self.run_state('read', '--format', 'tsv').stdout)
self.assertIn('selected\tHumanizer', self.run_state('read', '--format', 'tsv').stdout)
self.save('--selected', 'Context7')
self.assertEqual(json.loads(self.run_state('read').stdout)['selected'], ['Context7'])
+1 -1
View File
@@ -61,7 +61,7 @@ foreach ($shell in @('powershell','bash')) {
if ($shell -eq 'powershell' -and $content -match 'WindowStyle\s+Hidden') { throw "PowerShell hook hides the terminal in $package" }
if ($client -eq 'codex') {
$events = @([regex]::Matches($content, '(?m)^\[\[hooks\.([^.\]]+)\]\]\s*$') | ForEach-Object { $_.Groups[1].Value })
if ((($events | Sort-Object) -join ',') -ne 'PreToolUse,SessionStart,Stop,Stop,UserPromptSubmit' -or $content -match 'flashbang-if-input' -or $content -match '(?m)^async\s*=\s*true\s*$') { throw "Codex finish hook is incorrect in $package" }
if ((($events | Sort-Object) -join ',') -ne 'PostToolUse,PreToolUse,SessionStart,Stop,Stop,Stop,UserPromptSubmit' -or $content -match 'flashbang-if-input' -or $content -match '(?m)^async\s*=\s*true\s*$') { throw "Codex finish hook is incorrect in $package" }
if ($content -notmatch 'approvals_reviewer\s*=\s*"auto_review"') { throw "Codex auto review is missing in $package" }
if ($content -notmatch '(?m)^sandbox_mode\s*=\s*"danger-full-access"\s*$') { throw "Codex full access is missing in $package" }
if ($content -notmatch '(?m)^max_depth\s*=\s*1\s*$') { throw "Codex agent depth limit is missing in $package" }
+1 -1
View File
@@ -80,7 +80,7 @@ for shell in powershell bash; do
grep -q 'bash .*flashbang.sh' "$package/$file"
fi
if [ "$client" = codex ]; then
[ "$(sed -n 's/^\[\[hooks\.\([^].]*\)\]\][[:space:]]*$/\1/p' "$package/$file" | sort)" = $'PreToolUse\nSessionStart\nStop\nStop\nUserPromptSubmit' ]
[ "$(sed -n 's/^\[\[hooks\.\([^].]*\)\]\][[:space:]]*$/\1/p' "$package/$file" | sort)" = $'PostToolUse\nPreToolUse\nSessionStart\nStop\nStop\nStop\nUserPromptSubmit' ]
! grep -q 'flashbang-if-input' "$package/$file"
! grep -Eq '^async[[:space:]]*=[[:space:]]*true[[:space:]]*$' "$package/$file"
grep -q 'approvals_reviewer[[:space:]]*=[[:space:]]*"auto_review"' "$package/$file"
+2
View File
@@ -9,3 +9,5 @@ Both clients register `PreToolUse` (`Validate-CommandSafety`/`validate-command-s
`Invoke-PostChangeVerification`/`invoke-post-change-verification.sh` is not registered or invoked automatically; it runs the repository build only when explicitly invoked. Python-based hooks resolve their interpreter through `Resolve-Python.ps1`/`resolve-python.sh` and are silently skipped without Python 3.11+. `Test-SessionConfig`/`test-session-config.sh` checks repository inputs during a build.
When local QMD search is enabled, both clients also register a `SessionStart` warm-up hook (`Start-QmdWarm.ps1`/`start-qmd-warm.sh`). It starts the installed Node wrapper in the background from the process working directory, only inside a Git repository. Warm-up errors are recorded in `~/.my-ai-configuration/qmd/warm.log`; they do not fail the session. Disabling local search removes the hook registration.
Codex also registers `PostToolUse` (matcher `Edit|Write|apply_patch`) and `Stop` hooks for Impeccable's design detector (`Invoke-ImpeccableHook.ps1`/`invoke-impeccable-hook.sh`). The wrapper runs the installed Impeccable Codex skill's `impeccable hook` and is a no-op when that skill is missing. Claude receives the same hooks from the Impeccable plugin. The detector is on by default in every project; a project opts out with `impeccable hooks off`.
@@ -0,0 +1,13 @@
# Codex PostToolUse/Stop: run the Impeccable design detector when its Codex skill is installed; otherwise a no-op.
# Claude receives the same hooks from the Impeccable plugin. Projects can still opt out with `impeccable hooks off`.
$codexHome = if ($env:CODEX_HOME) { $env:CODEX_HOME } else { Join-Path $HOME '.codex' }
$windows = $env:OS -eq 'Windows_NT'
foreach ($skill in @((Join-Path $HOME '.agents/skills/impeccable'), (Join-Path $codexHome 'skills/impeccable'))) {
$launcher = Join-Path $skill $(if ($windows) { 'scripts/impeccable.cmd' } else { 'scripts/impeccable' })
if (-not (Test-Path -LiteralPath $launcher -PathType Leaf)) { continue }
# The hook reply carries non-ASCII text; Windows PowerShell would otherwise decode it with the OEM code page.
[Console]::OutputEncoding = [System.Text.UTF8Encoding]::new($false)
if ($windows) { & $launcher hook } else { & sh $launcher hook }
exit $LASTEXITCODE
}
exit 0
@@ -0,0 +1,7 @@
#!/usr/bin/env bash
# Codex PostToolUse/Stop: run the Impeccable design detector when its Codex skill is installed; otherwise a no-op.
# Claude receives the same hooks from the Impeccable plugin. Projects can still opt out with `impeccable hooks off`.
for skill in "$HOME/.agents/skills/impeccable" "${CODEX_HOME:-$HOME/.codex}/skills/impeccable"; do
if [ -f "$skill/scripts/impeccable" ]; then exec sh "$skill/scripts/impeccable" hook; fi
done
exit 0
+1 -1
View File
@@ -26,7 +26,7 @@ MUST load `ponytail` in `full` mode before coding, fixing, refactoring, configur
## 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; Frontend Design supplements gaps without starting a competing workflow. Backend-only tasks skip this layer.
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.
## REA: reverse engineering