Skip to content

Commit 594a944

Browse files
committed
Add /autopilot slash command for quick tasks in any session
New slash command at ~/.claude/commands/autopilot.md lets users run autopilot tasks without starting a dedicated agent session: /autopilot deploy this to Vercel /autopilot set up Supabase with auth The command injects autopilot instructions for that single task — plan, execute, log, report — then the user continues coding normally. Agent mode (claude --agent autopilot) remains for full multi-service orchestrations. Both share the same guardian, keychain, and logging. Updated installer to install the slash command automatically. Updated uninstaller to remove it on cleanup.
1 parent a4fbda2 commit 594a944

File tree

4 files changed

+84
-22
lines changed

4 files changed

+84
-22
lines changed

README.md

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -173,33 +173,37 @@ cd autopilot
173173

174174
## Usage
175175

176-
```bash
177-
# Start Autopilot (recommended — Guardian provides the safety rails)
178-
claude --agent autopilot --dangerously-skip-permissions
179-
180-
# Deploy and host
181-
> Deploy this to Vercel with environment variables from Supabase
176+
### Two ways to use Autopilot
182177

183-
# Databases
184-
> Set up Supabase with user auth tables, API keys, and usage tracking
178+
**Slash command** — use from any Claude Code session (recommended for most tasks):
185179

186-
# Payments
187-
> Configure Stripe payments with webhooks for subscription billing
180+
```bash
181+
# Inside any Claude Code session, type:
182+
/autopilot deploy this to Vercel with environment variables from Supabase
183+
/autopilot set up Supabase with user auth tables and API keys
184+
/autopilot configure Stripe payments with webhooks
185+
/autopilot create a Cloudflare R2 bucket for image storage
186+
```
188187

189-
# Infrastructure
190-
> Create a Cloudflare R2 bucket for image storage and set up a Worker for resizing
188+
**Agent mode** — dedicated session for big multi-service orchestrations:
191189

192-
# CI/CD
193-
> Set up GitHub Actions to run tests on PR and deploy to Vercel on merge to main
190+
```bash
191+
# Start a full Autopilot session
192+
claude --agent autopilot --dangerously-skip-permissions
194193

195-
# Multiple services at once
196194
> I need this running in production with a Postgres database, Stripe payments, and Sentry monitoring
197-
198-
# Services it's never seen before
199-
> Set up Resend for transactional emails and Upstash for Redis caching
200195
```
201196

202-
Autopilot figures out the rest. If it's a service it hasn't seen before, it researches the docs, creates a registry file, installs the CLI, and keeps going. First time with a service, it asks for your login credentials once. Every subsequent interaction is fully autonomous (except 2FA codes — those need your phone).
197+
### When to use which
198+
199+
| Situation | Use |
200+
|-----------|-----|
201+
| Quick deploy, get an API key, install a service | `/autopilot` slash command |
202+
| Full project setup from scratch | Agent mode |
203+
| Mid-coding infrastructure task | `/autopilot` slash command |
204+
| Multi-service orchestration (5+ services) | Agent mode |
205+
206+
Autopilot figures out the rest. If it's a service it hasn't seen before, it researches the docs, creates a registry file, installs the CLI, and keeps going. Your primary credentials handle signups automatically. Every subsequent interaction is fully autonomous (except 2FA codes — those need your phone).
203207

204208
### Execution Log
205209

@@ -250,8 +254,10 @@ If something breaks midway, open the log to see exactly what happened and where.
250254
github.md # GitHub: repos, PRs, issues, Actions
251255
cloudflare.md # Cloudflare: Workers, R2, KV, DNS
252256
razorpay.md # Razorpay: payments, subscriptions, webhooks
257+
commands/
258+
autopilot.md # /autopilot slash command (installed to ~/.claude/commands/)
253259
agent/
254-
autopilot.md # The agent definition (installed to ~/.claude/agents/)
260+
autopilot.md # Full agent definition (installed to ~/.claude/agents/)
255261
256262
# Per-project (created automatically when Autopilot runs):
257263
your-project/.autopilot/

commands/autopilot.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
You are now operating in **Autopilot mode** for this task only. Execute the user's request autonomously using the full Autopilot system.
2+
3+
## How to operate
4+
5+
1. **Analyze** the task — what services, CLIs, credentials, and steps are needed
6+
2. **If simple** (single service, 1-3 steps): execute immediately with `[1/N]` status updates
7+
3. **If complex** (multi-service, 4+ steps): present a numbered plan, wait for "proceed", then execute all steps without pausing
8+
4. **Log everything** to `{project}/.autopilot/log.md` (create if needed, add `.autopilot/` to `.gitignore`)
9+
5. **Report** the result when done
10+
11+
## Rules
12+
13+
- **Never pause between steps** to ask "what next?" — execute to completion or until genuinely blocked
14+
- **Credentials**: check `~/MCPs/autopilot/bin/keychain.sh has {service} {key}` first. If missing, use primary credentials (`keychain.sh get primary email/password`) to sign up or log in via Playwright browser automation
15+
- **Never expose credentials** in output, logs, or files. Use subshell expansion: `"$(keychain.sh get ...)"`
16+
- **CLI over browser**: use CLI tools with stored tokens whenever possible
17+
- **Service registries**: read from `~/MCPs/autopilot/services/{service}.md` for how to interact with each service. If none exists, research the docs (WebSearch), create one, and continue
18+
- **Safety**: the Guardian hook blocks dangerous commands automatically. Don't try to work around it
19+
- **Log account activity**: mark ACCOUNT CREATED, LOGGED IN, TOKEN STORED in the execution log
20+
21+
## Execution Log Format
22+
23+
Append to `{project}/.autopilot/log.md`:
24+
25+
```markdown
26+
## Session: {YYYY-MM-DD HH:MM} — {task description}
27+
28+
| # | Time | Action | Level | Service | Result |
29+
|---|------|--------|-------|---------|--------|
30+
```
31+
32+
## Decision Levels
33+
34+
| Level | Action |
35+
|-------|--------|
36+
| L1 | Just do it, brief note |
37+
| L2 | Do it, notify |
38+
| L3 | Ask first |
39+
| L4 | Must ask (money, messages, publishing) |
40+
| L5 | Escalate (2FA, CAPTCHA) |
41+
42+
Now execute the following task: $ARGUMENTS

install.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,10 @@ else
213213
fi
214214

215215
# Create directories
216-
mkdir -p "$INSTALL_DIR"/{bin,config,services}
216+
COMMANDS_DIR="$HOME/.claude/commands"
217+
mkdir -p "$INSTALL_DIR"/{bin,config,services,commands}
217218
mkdir -p "$AGENT_DIR"
219+
mkdir -p "$COMMANDS_DIR"
218220

219221
# Copy core files
220222
cp -f "$SOURCE_DIR/bin/keychain.sh" "$INSTALL_DIR/bin/"
@@ -247,6 +249,10 @@ ok "Service registry installed"
247249
cp -f "$SOURCE_DIR/agent/autopilot.md" "$AGENT_DIR/autopilot.md"
248250
ok "Agent definition installed at $AGENT_DIR/autopilot.md"
249251

252+
# Copy slash command
253+
cp -f "$SOURCE_DIR/commands/autopilot.md" "$COMMANDS_DIR/autopilot.md"
254+
ok "Slash command installed (/autopilot)"
255+
250256
# Make scripts executable
251257
chmod +x "$INSTALL_DIR/bin/"*.sh
252258
ok "Scripts made executable"
@@ -391,7 +397,8 @@ echo ""
391397
echo -e "${GREEN}${BOLD}Autopilot installed successfully!${NC}"
392398
echo ""
393399
echo " Platform: $PLATFORM"
394-
echo " Start it: claude --agent autopilot --dangerously-skip-permissions"
400+
echo " Quick use: /autopilot <task> (from any Claude Code session)"
401+
echo " Full mode: claude --agent autopilot --dangerously-skip-permissions"
395402
echo ""
396403
echo " What's installed:"
397404
echo " Agent: $AGENT_DIR/autopilot.md"

uninstall.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ NC='\033[0m'
1010

1111
INSTALL_DIR="$HOME/MCPs/autopilot"
1212
AGENT_FILE="$HOME/.claude/agents/autopilot.md"
13+
COMMAND_FILE="$HOME/.claude/commands/autopilot.md"
1314
SETTINGS_FILE="$HOME/.claude/settings.json"
1415
SETTINGS_LOCAL="$HOME/.claude/settings.local.json"
1516

@@ -23,6 +24,12 @@ if [ -f "$AGENT_FILE" ]; then
2324
echo -e "${GREEN}[OK]${NC} Removed agent definition"
2425
fi
2526

27+
# Remove slash command
28+
if [ -f "$COMMAND_FILE" ]; then
29+
rm "$COMMAND_FILE"
30+
echo -e "${GREEN}[OK]${NC} Removed /autopilot slash command"
31+
fi
32+
2633
# Remove guardian hook from settings.json
2734
if [ -f "$SETTINGS_FILE" ]; then
2835
if jq -e '.hooks.PreToolUse' "$SETTINGS_FILE" &>/dev/null; then

0 commit comments

Comments
 (0)