Files
fish-config/functions/superpowers.fish
T
rootiest 859f14a6e9 feat(functions): tag CLASSIFICATION across functions/ and conf.d/
Audits every function's interaction with the C1-shadowed commands
(uses-shadow/bypasses-shadow) and general hazards (destructive,
network, blocking-prompt) per the CLASSIFICATION schema.

Delegated the initial mechanical sweep to agy, then reviewed every
file by hand: fixed a systemic double-blank-comment-line formatting
bug from the delegate pass, and corrected several judgment errors
found on review -- three false blocking-prompt tags where a fish
'read' was consuming piped input rather than waiting on a terminal
(open-url.fish, sbver.fish, play-media.fish, now untagged entirely),
a blocking-prompt tag on mkrep.fish despite its documented --yes
escape hatch, an untagged read in jobrunner.fish's own baseless
blocking-prompt claim (removed, along with a destructive tag on
cleanup of its own mktemp output -- the schema explicitly excludes
that), the same own-output-cleanup false positive on
_zellij_dump_log.fish's destructive tag, an interactive fzf-gated
confirmation on logs.fish and replay.fish's piped read misread the
same way as the first three, and a uses-shadow(mkdir) on mkcd.fish
that actually belongs to the _fish_mkdir_p helper it delegates to,
not to mkcd itself.
2026-09-21 21:26:44 -04:00

77 lines
2.0 KiB
Fish

# Copyright (C) 2026 Rootiest
# SPDX-License-Identifier: AGPL-3.0-or-later
# CATEGORY
# 12-ai-and-developer-tools
#
# CLASSIFICATION
# uses-shadow(claude)
#
# SYNOPSIS
# superpowers [on|off] [-g]
#
# DESCRIPTION
# Enables or disables the superpowers plugin for both antigravity-cli
# (workspace scope) and Claude (project scope). Use -g/--global to apply
# at the user scope instead of workspace/project.
#
# ARGUMENTS
# on Enable superpowers for both tools
# off Disable superpowers for both tools
# -g, --global Apply at user/global scope instead of workspace/project
# -h, --help Show usage help
#
# EXIT STATUS
# 0 Mode applied successfully
# 1 No on/off mode specified
#
# EXAMPLE
# superpowers on
# superpowers off -g
function superpowers --description 'Toggle superpowers extension for antigravity-cli and Claude'
set -l scope_agy workspace
set -l scope_claude project
set -l mode ""
set -l help_text "
Usage: superpowers [on|off] [options]
Commands:
on Enable superpowers for antigravity-cli and Claude
off Disable superpowers for antigravity-cli and Claude
Options:
-g, --global Apply settings to the user/global scope
-h, --help Show this help message
"
# Parse arguments
for arg in $argv
switch $arg
case on
set mode enable
case off
set mode disable
case -g --global
set scope_agy user
set scope_claude user
case -h --help
echo $help_text
return 0
end
end
# Handle no arguments or invalid mode
if test -z "$mode"
echo $help_text
return 1
end
echo "Setting superpowers to: $mode (Scope: antigravity-cli=$scope_agy, Claude=$scope_claude)..."
# Execute antigravity-cli command
agy extensions $mode superpowers --scope $scope_agy
# Execute Claude command
claude plugins $mode superpowers --scope $scope_claude
end