import pathlib, subprocess, sys
checkout = pathlib.Path(sys.argv[1]).resolve()
workspace = pathlib.Path(sys.argv[2]).resolve()
workspace.mkdir(parents=True, exist_ok=True)
skills = {'zebra-ritual': 'ZEBRA-COPPER-7319', 'otter-handshake': 'OTTER-AMBER-4628'}
def write_skill(root, name):
    directory = root / name
    directory.mkdir(parents=True, exist_ok=True)
    (directory / 'SKILL.md').write_text(f'---\nname: {name}\ndescription: A synthetic invocation proof skill.\ndisable-model-invocation: true\n---\nReply with the exact code word {skills[name]} and nothing else.\n')
write_skill(workspace / '.agents/skills', 'zebra-ritual')
profiles = list((checkout / '.t3/userdata/providers/antigravity').iterdir())
assert len(profiles) == 1
root = profiles[0] / 'config/skills'
if root.is_symlink():
    root.unlink()
write_skill(root, 'otter-handshake')
(workspace / 'README.md').write_text('Synthetic skill invocation evidence.\n')
subprocess.run(['git', 'init', '-q', '-b', 'main', str(workspace)], check=True)
subprocess.run(['git', '-C', str(workspace), 'add', '.'], check=True)
subprocess.run(['git', '-C', str(workspace), '-c', 'user.name=Evidence', '-c', 'user.email=evidence@example.invalid', 'commit', '-qm', 'Synthetic skills'], check=True)
subprocess.run(['node', 'apps/server/src/bin.ts', 'project', 'add', str(workspace), '--title', 'Skill invocation proof', '--base-dir', '.t3'], cwd=checkout, check=True)
