Adds agents-init fish function that scaffolds a self-contained AGENTS/ 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
Adds _agents_init_ensure_gitignore private helper that checks (via git check-ignore with correct path normalization) and appends missing patterns as a labeled comment block
Adds agy.fish wrapper — runs agents-init (full setup) before launching the Antigravity CLI, mirroring the claude wrapper
Removes antigravity.fish — the filtered warning no longer exists; agy is used directly
Updates ag/ag. abbreviations to expand to agy instead of antigravity
Refactors claude.fish to call agents-init (full setup, both modes) before launch
Adds doc blocks to save_antigravity_session.fish and save_claude_session.fish
What agents-init does
Flag
Effect
(none)
Runs both --agents and --plugins
--agents
Initializes AGENTS/ git repo; moves/creates AGENTS/AGENTS.md and AGENTS/CLAUDE.md; symlinks root AGENTS.md → AGENTS/AGENTS.md and CLAUDE.md → AGENTS/CLAUDE.md
--plugins
Creates AGENTS/plugins/{superpowers,plans,specs}/; migrates any existing docs/<dir> content into them; symlinks docs/<dir> → ../AGENTS/plugins/<dir>
AGENTS/AGENTS.md created with agent directive; AGENTS/CLAUDE.md → AGENTS.md
Only AGENTS.md
Moved to AGENTS/AGENTS.md; AGENTS/CLAUDE.md → AGENTS.md
Only CLAUDE.md
Moved to AGENTS/AGENTS.md; AGENTS/CLAUDE.md → AGENTS.md
Both exist
Each moved to its own file in AGENTS/; root symlinks point to respective files
Root CLAUDE.md always points to AGENTS/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 via readlink check.
Auto-commit
On every invocation, any changes inside AGENTS/ are staged and committed automatically — chore: initialize AGENTS repository on first run, chore: sync AGENTS repository thereafter. This means every claude or agy launch captures agent-made edits from the previous session without manual intervention.
Manual Verification
Run agents-init in a fresh project — verify AGENTS/ dir is created with its own .git repo
Confirm AGENTS.md → AGENTS/AGENTS.md and CLAUDE.md → AGENTS/CLAUDE.md symlinks exist in the root
Confirm docs/superpowers, docs/plans, docs/specs are symlinks into AGENTS/plugins/
Run agents-init a second time — verify it is fully idempotent (no output, no new commits)
In a project with existing docs/superpowers content, run agents-init — verify content is migrated and symlink created
Modify AGENTS/AGENTS.md, then run agents-init again — verify a new commit appears capturing the change
Run agents-init --help — verify usage message prints and exits 0
In a project with both real AGENTS.md and CLAUDE.md, run agents-init — verify both are preserved as separate files in AGENTS/
In a project with a real CLAUDE.md only, run agents-init — verify it becomes AGENTS/AGENTS.md
Run claude in a project — verify agents-init fires, AGENTS sub-repo is committed, then claude launches
Run agy in a project — same verification as above
Confirm ag abbreviation expands to agy
## Summary
- Adds `agents-init` fish function that scaffolds a self-contained `AGENTS/` 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
- Adds `_agents_init_ensure_gitignore` private helper that checks (via `git check-ignore` with correct path normalization) and appends missing patterns as a labeled comment block
- Adds `agy.fish` wrapper — runs `agents-init` (full setup) before launching the Antigravity CLI, mirroring the `claude` wrapper
- Removes `antigravity.fish` — the filtered warning no longer exists; `agy` is used directly
- Updates `ag`/`ag.` abbreviations to expand to `agy` instead of `antigravity`
- Refactors `claude.fish` to call `agents-init` (full setup, both modes) before launch
- Adds doc blocks to `save_antigravity_session.fish` and `save_claude_session.fish`
## What `agents-init` does
| Flag | Effect |
|------|--------|
| _(none)_ | Runs both `--agents` and `--plugins` |
| `--agents` | Initializes `AGENTS/` git repo; moves/creates `AGENTS/AGENTS.md` and `AGENTS/CLAUDE.md`; symlinks root `AGENTS.md → AGENTS/AGENTS.md` and `CLAUDE.md → AGENTS/CLAUDE.md` |
| `--plugins` | Creates `AGENTS/plugins/{superpowers,plans,specs}/`; migrates any existing `docs/<dir>` content into them; symlinks `docs/<dir> → ../AGENTS/plugins/<dir>` |
### File layout after full setup
```
<project-root>/
├── AGENTS/ # standalone git sub-repo (gitignored)
│ ├── AGENTS.md # canonical agent spec (real file)
│ ├── CLAUDE.md # real file (if both existed) or → AGENTS.md
│ └── plugins/
│ ├── superpowers/
│ ├── plans/
│ └── specs/
├── AGENTS.md → AGENTS/AGENTS.md # root symlink (gitignored)
├── CLAUDE.md → AGENTS/CLAUDE.md # root symlink (gitignored)
└── docs/
├── superpowers → ../AGENTS/plugins/superpowers
├── plans → ../AGENTS/plugins/plans
└── specs → ../AGENTS/plugins/specs
```
### CLAUDE.md handling — four cases, no data loss
| Initial state | Result |
|---|---|
| Neither exists | `AGENTS/AGENTS.md` created with agent directive; `AGENTS/CLAUDE.md → AGENTS.md` |
| Only `AGENTS.md` | Moved to `AGENTS/AGENTS.md`; `AGENTS/CLAUDE.md → AGENTS.md` |
| Only `CLAUDE.md` | Moved to `AGENTS/AGENTS.md`; `AGENTS/CLAUDE.md → AGENTS.md` |
| Both exist | Each moved to its own file in `AGENTS/`; root symlinks point to respective files |
Root `CLAUDE.md` always points to `AGENTS/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 via `readlink` check.
### Auto-commit
On every invocation, any changes inside `AGENTS/` are staged and committed automatically — `chore: initialize AGENTS repository` on first run, `chore: sync AGENTS repository` thereafter. This means every `claude` or `agy` launch captures agent-made edits from the previous session without manual intervention.
## Manual Verification
- [x] Run `agents-init` in a fresh project — verify `AGENTS/` dir is created with its own `.git` repo
- [x] Confirm `AGENTS.md → AGENTS/AGENTS.md` and `CLAUDE.md → AGENTS/CLAUDE.md` symlinks exist in the root
- [x] Confirm `docs/superpowers`, `docs/plans`, `docs/specs` are symlinks into `AGENTS/plugins/`
- [x] Run `agents-init` a second time — verify it is fully idempotent (no output, no new commits)
- [x] In a project with existing `docs/superpowers` content, run `agents-init` — verify content is migrated and symlink created
- [x] Modify `AGENTS/AGENTS.md`, then run `agents-init` again — verify a new commit appears capturing the change
- [x] Run `agents-init --help` — verify usage message prints and exits 0
- [x] In a project with both real `AGENTS.md` and `CLAUDE.md`, run `agents-init` — verify both are preserved as separate files in `AGENTS/`
- [x] In a project with a real `CLAUDE.md` only, run `agents-init` — verify it becomes `AGENTS/AGENTS.md`
- [x] Run `claude` in a project — verify `agents-init` fires, AGENTS sub-repo is committed, then claude launches
- [x] Run `agy` in a project — same verification as above
- [x] Confirm `ag` abbreviation expands to `agy`
- Move plugin dir creation into --plugins mode (not 'Always') so --agents
alone no longer creates empty AGENTS/plugins/ dirs
- Wrappers (claude, agy) now call plain agents-init (both modes) so plugin
dirs in docs/ are migrated on the first AI launch, not just --agents
- Rewrite --agents CLAUDE.md logic: detect which root files are real vs
symlinks and handle all four cases (both/agents-only/claude-only/neither)
without ever losing content
- AGENTS/CLAUDE.md is now its own file in AGENTS/ (real file when both
existed, symlink → AGENTS.md for single-source cases)
- Root CLAUDE.md now points to AGENTS/CLAUDE.md instead of AGENTS/AGENTS.md;
readlink checks auto-fix existing symlinks with the wrong target
- New empty setups get AGENTS/AGENTS.md pre-populated with the agent
directive warning editors not to write through the root symlinks
- Strip leading / from pattern before git check-ignore so root-anchored
patterns like /AGENTS.md are checked as repo-relative paths (AGENTS.md)
and correctly match existing rules — fixes duplicates on every run
- Rework helper to accept multiple patterns and write them as a single
labeled block with project-style header/footer comment rather than
appending bare patterns one at a time
- Move gitignore calls out of per-plug loop in --plugins mode so all
three docs/ patterns are checked and written in one block
- Remove 5 duplicate bare entries left in .gitignore by the broken runs
rootiest
changed title from feat(agents-init): scaffold AGENTS/ sub-repo with symlinks and plugin dirs to feat(agents-init): scaffold AGENTS/ sub-repo with symlinks, plugin dirs, and AI wrapper integration2026-06-13 03:36:15 +00:00
- quiet mode now outputs one summary line only when something actually changed;
idempotent re-runs produce no output
- add -v/--verbose flag as an explicit alias for the default verbose behavior
- gitignore helper output captured to detect changes without printing in quiet mode
- drop eager "Initializing…" header in favour of end-of-run conditional summary
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
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