feat(agents-cleanup): reverse an agents-init scaffold and opt a project out #183
No Reviewers
Labels
Clear labels
Area/CI
Area/Completions
Area/Components
Area/Config
Area/Docs
Area/Functions
Area/Integrations
Area/Prompt & Theme
Area/Scripts
Area/Tests
Compat/Breaking
Kind/Bug
Kind/Chore
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Performance
Kind/Refactor
Kind/Security
Kind/Testing
good first issue
help wanted
.github/workflows and repository automation
completions/ - tab-completion scripts
The opinionated-component system (C1-C6)
config.fish and conf.d/ - startup and environment
docs/manual/ and the generated manual, man page, and site
functions/ - user-facing functions and helpers
integrations/ - third-party tool wiring
themes/ and prompt appearance
scripts/ - standalone helper scripts
tests/ - the syntax lint and functional suite
Breaking change that won't be backward compatible
Something is not working
Tooling, dependencies, and housekeeping
Documentation changes
Improve existing functionality
New functionality
Makes existing behavior faster or lighter
Restructures code without changing behavior
This is security issue
Issue or pull request related to testing
Well-scoped and self-contained; a good place to start
Maintainer is looking for someone to pick this up
Priority
Critical
1
The priority is critical
Priority
High
2
The priority is high
Priority
Medium
3
The priority is medium
Priority
Low
4
The priority is low
Reviewed
Confirmed
1
Issue has been confirmed
Reviewed
Duplicate
2
This issue or pull request already exists
Reviewed
Invalid
3
Invalid issue
Reviewed
Won't Fix
3
This issue won't be fixed
Status
Blocked
1
Something is blocking this issue or pull request
Status
Need More Info
2
Feedback is required to reproduce issue or to continue work
Status
Abandoned
3
Somebody has started to work on this but abandoned work
Milestone
No items
No Milestone
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: rootiest/fish-config#183
Reference in New Issue
Block a user
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
Adds
agents-cleanup, which undoesagents-initin a project, and an opt-out marker thatagents-inithonors. Once a project is cleaned,claude/agylaunches no longer scaffold it again.agents-cleanupAGENTS/becomes the real file or directory it points to.docs/plansoverdocs/superpowers/plans..gitkeep-only targets, dangling links, and links toAGENTS/itself are removed.AGENTS.mdhandling:AGENTS.mdthat is exactly the agents-init stub is deleted.AGENTS.mdloses only the "SYSTEM DIRECTIVE" blockquote.AGENTS/changes are committed.${XDG_STATE_HOME:-~/.local/state}/agents-cleanup/.AGENTS/, thedocs/superpowers/anddocs/directories if left empty, and theAdded by agents-initblocks in.gitignoreremoved.AGENTS/holds unlinked files (--drop-extrasoverrides this).AGENTS/contains nested git repos (no override).AGENTS/is itself a symlink.--dry-run,--drop-extras,--marker-file,-v/-q/-s.Opt-out marker
agents-init.disabled, which cleanup always sets..agents-disabledfile in the project root. You commit it to opt every clone out.agents-init --enableclears the git key. It refuses while the file exists.Shared helper fix (own commit,
e7683d1)_agents_repo_synconly checked that.gitexisted. After an interruptedrm -rf AGENTS/, git fell through to the outer repository and committed its whole working tree, untracked secrets included. The helper now requiresgit rev-parse --git-dirto print.git. This also hardensagents-initandagents-vault.Refactors
_agents_init_find: the shared prune walk._agents_init_stub: the stubAGENTS.mdtext.agents-cleanupcompares against it byte for byte.Docs
docs/manual/16-agent-tooling.md.docs/fish-config.md.Testing
tests/test-agents-cleanup.fish(99 assertions). It uses realagents-initscaffolds in mktemp repos..gitignoretests/test-agents-init.fish: marker and--enablecases, plus the helper extractions.fish tests/run-tests.fish: exit 0, 1036/1036, lint clean.git clone <bundle> AGENTS, thenagents-init --enable. The files were relinked and the content restored.Known follow-ups (non-blocking, no data loss)
Recorded in the AGENTS task list:
agents-init.disabledkey is not cleared by--enable.AGENTS/.gitis deleted without a warning.