feat(agents-init): scaffold AGENTS/ sub-repo with symlinks, plugin dirs, and AI wrapper integration #52
Reference in New Issue
Block a user
Delete Branch "feat/agents-init"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
agents-initfish function that scaffolds a self-containedAGENTS/git sub-repo inside any project, moves existing agent files into it, and replaces them with symlinks so the outer project never tracks agent files directly_agents_init_ensure_gitignoreprivate helper that checks (viagit check-ignorewith correct path normalization) and appends missing patterns as a labeled comment blockagy.fishwrapper — runsagents-init(full setup) before launching the Antigravity CLI, mirroring theclaudewrapperantigravity.fish— the filtered warning no longer exists;agyis used directlyag/ag.abbreviations to expand toagyinstead ofantigravityclaude.fishto callagents-init(full setup, both modes) before launchsave_antigravity_session.fishandsave_claude_session.fishWhat
agents-initdoes--agentsand--plugins--agentsAGENTS/git repo; moves/createsAGENTS/AGENTS.mdandAGENTS/CLAUDE.md; symlinks rootAGENTS.md → AGENTS/AGENTS.mdandCLAUDE.md → AGENTS/CLAUDE.md--pluginsAGENTS/plugins/{superpowers,plans,specs}/; migrates any existingdocs/<dir>content into them; symlinksdocs/<dir> → ../AGENTS/plugins/<dir>File layout after full setup
CLAUDE.md handling — four cases, no data loss
AGENTS/AGENTS.mdcreated with agent directive;AGENTS/CLAUDE.md → AGENTS.mdAGENTS.mdAGENTS/AGENTS.md;AGENTS/CLAUDE.md → AGENTS.mdCLAUDE.mdAGENTS/AGENTS.md;AGENTS/CLAUDE.md → AGENTS.mdAGENTS/; root symlinks point to respective filesRoot
CLAUDE.mdalways points toAGENTS/CLAUDE.md, giving a consistent two-level chain:CLAUDE.md → AGENTS/CLAUDE.md → AGENTS/AGENTS.md. Existing symlinks with wrong targets are auto-corrected on the next run viareadlinkcheck.Auto-commit
On every invocation, any changes inside
AGENTS/are staged and committed automatically —chore: initialize AGENTS repositoryon first run,chore: sync AGENTS repositorythereafter. This means everyclaudeoragylaunch captures agent-made edits from the previous session without manual intervention.Manual Verification
agents-initin a fresh project — verifyAGENTS/dir is created with its own.gitrepoAGENTS.md → AGENTS/AGENTS.mdandCLAUDE.md → AGENTS/CLAUDE.mdsymlinks exist in the rootdocs/superpowers,docs/plans,docs/specsare symlinks intoAGENTS/plugins/agents-inita second time — verify it is fully idempotent (no output, no new commits)docs/superpowerscontent, runagents-init— verify content is migrated and symlink createdAGENTS/AGENTS.md, then runagents-initagain — verify a new commit appears capturing the changeagents-init --help— verify usage message prints and exits 0AGENTS.mdandCLAUDE.md, runagents-init— verify both are preserved as separate files inAGENTS/CLAUDE.mdonly, runagents-init— verify it becomesAGENTS/AGENTS.mdclaudein a project — verifyagents-initfires, AGENTS sub-repo is committed, then claude launchesagyin a project — same verification as aboveagabbreviation expands toagyfeat(agents-init): scaffold AGENTS/ sub-repo with symlinks and plugin dirsto feat(agents-init): scaffold AGENTS/ sub-repo with symlinks, plugin dirs, and AI wrapper integration