import json, sys
from pathlib import Path
root = Path(sys.argv[1])
org='11111111-2222-4333-8444-555555555555'
account='66666666-7777-4888-9999-aaaaaaaaaaaa'
root.mkdir(exist_ok=True)
(root/'.claude.json').write_text(json.dumps({'oauthAccount':{'organizationUuid':org,'accountUuid':account}}))
(root/'settings.json').write_text(json.dumps({'enabledPlugins':{'hidden@synced':False}}))
for acct, entries in [(account,[('demo','review'),('hidden','secret')]),('77777777-8888-4999-aaaa-bbbbbbbbbbbb',[('foreign','private')])]:
    synced=root/'plugins'/'synced'
    bucket=synced/f'{org}_{acct}'
    for name,skill in entries:
        dest=bucket/name
        (dest/'skills'/skill).mkdir(parents=True,exist_ok=True)
        (dest/'skills'/skill/'SKILL.md').write_text(f'---\nname: {skill}\ndescription: Synthetic {name} skill for discovery evidence\n---\nReview the synthetic demo.\n')
        (dest/'.claude-plugin').mkdir(exist_ok=True)
        (dest/'.claude-plugin'/'plugin.json').write_text(json.dumps({'name':name}))
    (bucket/'manifest.json').write_text(json.dumps({'plugins':[{'pluginId':f'plugin_01{name}','name':name} for name,skill in entries]}))
    (synced/f'.bucket-{org}_{acct}').write_text('')
control = root / 'skills' / 'control'
control.mkdir(parents=True, exist_ok=True)
(control / 'SKILL.md').write_text('---\nname: control\ndescription: Synthetic local control skill\n---\nLocal fixture.\n')
