configs-all 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/settings.local.json +3 -0
- package/CLAUDE.md +94 -0
- package/README.md +424 -0
- package/TERMINAL_SHORTCUTS.md +96 -0
- package/WINDOWS_COMPATIBILITY.md +85 -0
- package/WINDOWS_MCP_SETUP.md +133 -0
- package/apps/RectangleConfig.plist +0 -0
- package/apps/Synergy +84 -0
- package/apps/iStat Menus Settings.ismp7 +0 -0
- package/claude/CLAUDE.md +228 -0
- package/claude/commands/changelog.md +36 -0
- package/claude/commands/commit.md +29 -0
- package/claude/commands/context.md +112 -0
- package/claude/commands/dash.md +37 -0
- package/claude/commands/deploy-check.md +37 -0
- package/claude/commands/deps.md +26 -0
- package/claude/commands/duplo.md +56 -0
- package/claude/commands/explain.md +43 -0
- package/claude/commands/fix-and-test.md +46 -0
- package/claude/commands/game-debug.md +66 -0
- package/claude/commands/games.md +53 -0
- package/claude/commands/go.md +147 -0
- package/claude/commands/guard.md +102 -0
- package/claude/commands/handoff.md +66 -0
- package/claude/commands/incident.md +144 -0
- package/claude/commands/init.md +78 -0
- package/claude/commands/k8s-debug.md +31 -0
- package/claude/commands/lint.md +27 -0
- package/claude/commands/merge-all.md +115 -0
- package/claude/commands/merge.md +129 -0
- package/claude/commands/mikpc.md +54 -0
- package/claude/commands/morning.md +72 -0
- package/claude/commands/partymode.md +105 -0
- package/claude/commands/plans.md +88 -0
- package/claude/commands/pr.md +41 -0
- package/claude/commands/prep.md +132 -0
- package/claude/commands/push-sync.md +82 -0
- package/claude/commands/push.md +34 -0
- package/claude/commands/research.md +73 -0
- package/claude/commands/retro.md +95 -0
- package/claude/commands/review-pr.md +96 -0
- package/claude/commands/review.md +41 -0
- package/claude/commands/scaffold-agent.md +45 -0
- package/claude/commands/setup.md +92 -0
- package/claude/commands/ship-prod.md +97 -0
- package/claude/commands/ship.md +82 -0
- package/claude/commands/simplify.md +42 -0
- package/claude/commands/spike.md +110 -0
- package/claude/commands/status.md +37 -0
- package/claude/commands/sync.md +72 -0
- package/claude/commands/test.md +29 -0
- package/claude/commands/triage.md +72 -0
- package/claude/desktop/claude_desktop_config.json +9 -0
- package/claude/hooks.json +15 -0
- package/claude/mcp-servers.duplo.json +8 -0
- package/claude/mcp-servers.json +62 -0
- package/claude/scripts/psdebug.ps1 +7 -0
- package/claude/settings.json +38 -0
- package/claude/settings.local.json +4 -0
- package/claude/statusline-command.sh +94 -0
- package/claude/templates/CLAUDE-k8s-devops.md +58 -0
- package/claude/templates/CLAUDE-python-agent.md +47 -0
- package/claude/templates/CLAUDE-typescript-frontend.md +50 -0
- package/docker/ai-stack/docker-compose.yml +76 -0
- package/docker/ai-stack/searxng/limiter.toml +3 -0
- package/docker/ai-stack/searxng/settings.yml +39 -0
- package/docker/cli/config.json.template +15 -0
- package/docker/cli/daemon.json +9 -0
- package/docker/cli/features.json +3 -0
- package/docker/mcp/catalog.json +9 -0
- package/docker/mcp/catalogs/docker-mcp.yaml +15107 -0
- package/docker/mcp/config.yaml +0 -0
- package/docker/mcp/registry.yaml +37 -0
- package/docker/mcp/tools.yaml +0 -0
- package/docs/context/.gitkeep +0 -0
- package/docs/context/2026-03-02-configs.md +142 -0
- package/docs/handoff/.gitkeep +0 -0
- package/docs/incidents/.gitkeep +0 -0
- package/docs/plans/2026-02-28-autonomous-command-suite-design.md +250 -0
- package/docs/plans/2026-02-28-autonomous-command-suite.md +682 -0
- package/docs/plans/2026-03-01-ai-stack-split-architecture.md +72 -0
- package/docs/plans/2026-03-02-ai-stack-expansion.md +33 -0
- package/docs/plans/2026-03-02-merge-commands-design.md +58 -0
- package/docs/plans/2026-03-02-merge-commands.md +354 -0
- package/docs/research/.gitkeep +0 -0
- package/docs/research/2026-03-02-configs-repo-architecture.md +152 -0
- package/docs/retros/.gitkeep +0 -0
- package/docs/retros/2026-03-01-ai-stack-split-architecture.md +38 -0
- package/docs/spikes/.gitkeep +0 -0
- package/gh/config.yml +16 -0
- package/gh/hosts.yml +5 -0
- package/gh/main.json +103 -0
- package/ghostty/config +90 -0
- package/git/config/base.gitconfig +46 -0
- package/git/config/chiefmikey.gitconfig +11 -0
- package/git/config/personal.gitconfig +10 -0
- package/git/config/work.gitconfig +14 -0
- package/ide/cursor/extensions.txt +111 -0
- package/ide/cursor/keybindings.json +307 -0
- package/ide/cursor/mcp.json +92 -0
- package/ide/cursor/settings.json +544 -0
- package/ide/vscode/extensions.txt +120 -0
- package/ide/vscode/insiders/extensions.txt +119 -0
- package/ide/vscode/insiders/keybindings.json +294 -0
- package/ide/vscode/insiders/settings.json +518 -0
- package/ide/vscode/keybindings.json +294 -0
- package/ide/vscode/settings.json +526 -0
- package/ide/vscode/vscode/extensions.txt +43 -0
- package/iterm/Mikey Pro.json +951 -0
- package/iterm/com.googlecode.iterm2.plist +5549 -0
- package/iterm/font/MesloLGS NF Bold Italic.ttf +0 -0
- package/iterm/font/MesloLGS NF Bold.ttf +0 -0
- package/iterm/font/MesloLGS NF Italic.ttf +0 -0
- package/iterm/font/MesloLGS NF Regular.ttf +0 -0
- package/package.json +15 -0
- package/scripts/ai/deploy-ai-stack.sh +119 -0
- package/scripts/ai/fix-ai-proxy.service +12 -0
- package/scripts/ai/fix-ai-proxy.sh +25 -0
- package/scripts/brew/search/brew-search-results.sh +19 -0
- package/scripts/brew/search/brew-search.sh +34 -0
- package/scripts/brew/upgrade/brew-upgrade-autoupdate.sh +5 -0
- package/scripts/brew/upgrade/brew-upgrade-full-auto.sh +89 -0
- package/scripts/brew/upgrade/brew-upgrade-full.sh +159 -0
- package/scripts/docker/cleanup/docker-cleanup-manage.sh +163 -0
- package/scripts/docker/cleanup/docker-cleanup.cron +12 -0
- package/scripts/docker/cleanup/docker-cleanup.sh +280 -0
- package/scripts/docker/install/README.md +23 -0
- package/scripts/docker/install/docker-al2.sh +7 -0
- package/scripts/docker/install/docker-compose-al2.sh +15 -0
- package/scripts/gh/auth/auth.sh +12 -0
- package/scripts/gh/config/gh-config.sh +3 -0
- package/scripts/gh/gist/gh-gist-create.sh +29 -0
- package/scripts/gh/gist/gh-gist-delete.sh +1 -0
- package/scripts/gh/gist/gh-gist-edit.sh +8 -0
- package/scripts/gh/gpg-key/gh-gpg-key-add.sh +3 -0
- package/scripts/gh/install/install.sh +7 -0
- package/scripts/gh/label/gh-label-clone.sh +0 -0
- package/scripts/gh/label/gh-label-create.sh +0 -0
- package/scripts/gh/label/gh-label-delete.sh +0 -0
- package/scripts/gh/label/gh-label-edit.sh +0 -0
- package/scripts/gh/label/gh-label-list.sh +0 -0
- package/scripts/gh/secret/gh-secret-delete.sh +24 -0
- package/scripts/gh/secret/gh-secret-set.sh +70 -0
- package/scripts/gh/ssh-key/gh-ssh-key-add.sh +8 -0
- package/scripts/git/add/git-add.sh +3 -0
- package/scripts/git/auth/README.md +11 -0
- package/scripts/git/auth/https.sh +20 -0
- package/scripts/git/auth/ssh-mac.sh +41 -0
- package/scripts/git/branch-delete/git-branch-delete.sh +16 -0
- package/scripts/git/checkout/git-checkout-stash.sh +32 -0
- package/scripts/git/temp/git-temp-pull.sh +6 -0
- package/scripts/git/temp/git-temp-push.sh +5 -0
- package/scripts/install/fresh.zsh +34 -0
- package/scripts/install/full-install.zsh +193 -0
- package/scripts/linux/codedeploy/README.md +19 -0
- package/scripts/linux/codedeploy/linux-codedeploy-al2.sh +13 -0
- package/scripts/linux/codedeploy/linux-codedeploy-index.sh +16 -0
- package/scripts/linux/codedeploy/linux-codedeploy-ubuntu.sh +14 -0
- package/scripts/linux/coredns/README.md +17 -0
- package/scripts/linux/coredns/linux-coredns-al2.sh +29 -0
- package/scripts/linux/wifi/01-netconf.yaml +21 -0
- package/scripts/linux/wifi/wifi-ubuntu.sh +17 -0
- package/scripts/mac/dock-sort/mac-dock-sort.sh +87 -0
- package/scripts/mac/dropbox-ignore/mac-dropbox-ignore.sh +12 -0
- package/scripts/mac/sudo-askpass/mac-sudo-askpass.sh +50 -0
- package/scripts/mac/sudo-askpass/setup-sudo-password.sh +49 -0
- package/scripts/mac/upgrade/mac-upgrade.sh +21 -0
- package/scripts/mac/vpn/mac-vpn.sh +4 -0
- package/scripts/mcp/aws-mcp-wrapper.ps1 +97 -0
- package/scripts/mcp/aws-mcp-wrapper.sh +53 -0
- package/scripts/mcp/duplo-mcp-wrapper.sh +31 -0
- package/scripts/mcp/filesystem-mcp-wrapper.ps1 +43 -0
- package/scripts/mcp/filesystem-mcp-wrapper.sh +34 -0
- package/scripts/mcp/git-mcp-wrapper.ps1 +42 -0
- package/scripts/mcp/git-mcp-wrapper.sh +33 -0
- package/scripts/mcp/github-mcp-wrapper.ps1 +43 -0
- package/scripts/mcp/github-mcp-wrapper.sh +19 -0
- package/scripts/mcp/kubernetes-mcp-wrapper.ps1 +22 -0
- package/scripts/mcp/kubernetes-mcp-wrapper.sh +16 -0
- package/scripts/mcp/mcp-launcher.ps1 +56 -0
- package/scripts/mcp/mcp-launcher.sh +71 -0
- package/scripts/mcp/mongodb-mcp-wrapper.ps1 +26 -0
- package/scripts/mcp/mongodb-mcp-wrapper.sh +17 -0
- package/scripts/mcp/notion-mcp-wrapper.ps1 +23 -0
- package/scripts/mcp/notion-mcp-wrapper.sh +14 -0
- package/scripts/mcp/postgres-mcp-wrapper.ps1 +23 -0
- package/scripts/mcp/postgres-mcp-wrapper.sh +16 -0
- package/scripts/npm/ncu/npm-ncu.sh +24 -0
- package/scripts/npm/upgrade/npm-upgrade.sh +51 -0
- package/scripts/qmk/build_reviung41.sh +28 -0
- package/scripts/qmk/sync_unicorne.sh +44 -0
- package/scripts/sync/README.md +64 -0
- package/scripts/sync/config-common.zsh +882 -0
- package/scripts/sync/pull-configs.ps1 +33 -0
- package/scripts/sync/pull-configs.zsh +278 -0
- package/scripts/sync/push-configs.ps1 +91 -0
- package/scripts/sync/push-configs.zsh +384 -0
- package/shell/alias/alias-d.zsh +333 -0
- package/shell/alias/alias.zsh +36 -0
- package/shell/alias/categories/development.zsh +157 -0
- package/shell/alias/categories/environment.zsh +13 -0
- package/shell/alias/categories/git.zsh +40 -0
- package/shell/alias/categories/github-functions.zsh +459 -0
- package/shell/alias/categories/network.zsh +46 -0
- package/shell/alias/categories/path.zsh +46 -0
- package/shell/alias/categories/system.zsh +78 -0
- package/shell/alias/categories/wolfe-server.zsh +11 -0
- package/shell/powershell/Microsoft.PowerShell_profile.ps1 +208 -0
- package/shell/zsh/.p10k.zsh +1832 -0
- package/shell/zsh/.zshrc +87 -0
- package/shell/zsh/config/completion.zsh +31 -0
- package/shell/zsh/config/functions.zsh +31 -0
- package/shell/zsh/config/keybindings.zsh +13 -0
- package/shell/zsh/config/options.zsh +56 -0
- package/shell/zsh/config/plugins.zsh +83 -0
- package/shell/zsh/config/variables.zsh +191 -0
- package/shell/zsh/powerlevel10k.zsh-theme +83 -0
- package/shell/zsh/zsh-autosuggestions.zsh +871 -0
- package/ssh/config +46 -0
- package/ssh/config.duplo +21 -0
- package/ssh/config.mikpc +35 -0
- package/ssh/personal_signing.pub +1 -0
- package/templates/.envrc.example +34 -0
- package/templates/.envrc.quickstart +17 -0
- package/wezterm/wezterm.lua +249 -0
- package/wsl/.wslconfig +3 -0
- package/wsl/wsl.conf +18 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
## Commit, Push & Sync All Machines
|
|
2
|
+
|
|
3
|
+
Commit and push local changes, then deploy configs to all machines (or specific ones) via SSH. Combines `/push` and `/sync` into one command.
|
|
4
|
+
|
|
5
|
+
**IMPORTANT: Immediately delegate this entire task to a subagent using the Agent tool with `model: "haiku"` and `subagent_type: "general-purpose"`.** Do not perform operations yourself. Pass the full prompt below to the subagent and relay its result.
|
|
6
|
+
|
|
7
|
+
### Input
|
|
8
|
+
$ARGUMENTS - optional: space-separated machine names (e.g., "mikpc", "mikpc duplo"). If omitted, syncs to ALL configured machines.
|
|
9
|
+
|
|
10
|
+
### Subagent prompt
|
|
11
|
+
|
|
12
|
+
You are committing, pushing, and syncing the configs repo across machines. Target machines: $ARGUMENTS (if empty, sync to all).
|
|
13
|
+
|
|
14
|
+
#### Phase 1: Commit & Push
|
|
15
|
+
|
|
16
|
+
1. Run in parallel:
|
|
17
|
+
- `git status --short` to see all changes
|
|
18
|
+
- `git diff` and `git diff --staged` to see what changed
|
|
19
|
+
- `git log --oneline -5` to match commit message style
|
|
20
|
+
- `git branch --show-current` to get the current branch
|
|
21
|
+
|
|
22
|
+
2. If there are changes to commit:
|
|
23
|
+
- Stage appropriate files (specific paths, not `git add -A`). Never stage secrets.
|
|
24
|
+
- Write a conventional commit message (feat:/fix:/chore:/refactor:/docs:/test:). Use a HEREDOC.
|
|
25
|
+
- Push to remote with `git push -u origin <branch>`
|
|
26
|
+
|
|
27
|
+
3. If already clean and pushed, skip to Phase 2.
|
|
28
|
+
|
|
29
|
+
#### Phase 2: Sync Machines
|
|
30
|
+
|
|
31
|
+
**Machine registry** (verify with SSH before attempting):
|
|
32
|
+
|
|
33
|
+
| Machine | SSH Host | Dropbox Path | Notes |
|
|
34
|
+
|---------|----------|-------------|-------|
|
|
35
|
+
| mikpc | `mikpc` | `~/Dropbox/mikpc/dev/configs` | WSL, NTFS quirks with mcp.json |
|
|
36
|
+
| duplo | `duplo` | `~/Dropbox/duplo/dev/chiefmikey/configs` | Work Mac |
|
|
37
|
+
| mikbook | `mikbook` | `~/Dropbox/mikbook/dev/configs` | MacBook |
|
|
38
|
+
|
|
39
|
+
For each target machine (run sequentially — SSH sessions can't overlap safely):
|
|
40
|
+
|
|
41
|
+
a. **Verify connectivity:** `ssh -o ConnectTimeout=5 -o BatchMode=yes <host> echo ok`
|
|
42
|
+
- If unreachable, log a warning and skip this machine. Don't fail the whole run.
|
|
43
|
+
|
|
44
|
+
b. **Pull latest on the remote:**
|
|
45
|
+
```bash
|
|
46
|
+
ssh <host> "cd <dropbox-path> && git pull --ff-only"
|
|
47
|
+
```
|
|
48
|
+
- If pull fails, log the error and skip deploy. Don't force.
|
|
49
|
+
|
|
50
|
+
c. **Deploy configs on the remote:**
|
|
51
|
+
```bash
|
|
52
|
+
ssh <host> "cd <dropbox-path> && ./scripts/sync/push-configs.zsh"
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
d. **Record the deployed commit:**
|
|
56
|
+
```bash
|
|
57
|
+
ssh <host> "cd <dropbox-path> && git log --oneline -1"
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
e. **Verify critical paths:**
|
|
61
|
+
```bash
|
|
62
|
+
ssh <host> "git config user.email && echo 'git: ok'"
|
|
63
|
+
ssh <host> "command -v zsh && echo 'zsh: ok'"
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
#### Report
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
## Push & Sync Report
|
|
70
|
+
Local commit: abc1234 feat: latest change
|
|
71
|
+
Push: origin/main ✓
|
|
72
|
+
|
|
73
|
+
| Machine | Status | Commit | Details |
|
|
74
|
+
|---------|--------|--------|---------|
|
|
75
|
+
| mikpc | synced | abc1234 | push-configs: ok (3 warnings) |
|
|
76
|
+
| duplo | synced | abc1234 | push-configs: ok |
|
|
77
|
+
| mikbook | skipped | — | unreachable (connection timed out) |
|
|
78
|
+
|
|
79
|
+
**Successfully synced:** 2/3 machines
|
|
80
|
+
**Skipped:** mikbook (unreachable)
|
|
81
|
+
**Warnings:** [any warnings from push-configs on synced machines]
|
|
82
|
+
```
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
## Commit & Push Changes
|
|
2
|
+
|
|
3
|
+
**IMPORTANT: Immediately delegate this entire task to a subagent using the Agent tool with `model: "haiku"` and `subagent_type: "general-purpose"`.** Do not perform any git operations yourself. Pass the full prompt below to the subagent and relay its result.
|
|
4
|
+
|
|
5
|
+
### Subagent prompt
|
|
6
|
+
|
|
7
|
+
You are committing and pushing code changes. Follow these steps exactly:
|
|
8
|
+
|
|
9
|
+
1. Run in parallel:
|
|
10
|
+
- `git status --short` to see all changes
|
|
11
|
+
- `git diff` and `git diff --staged` to see what changed
|
|
12
|
+
- `git log --oneline -5` to match commit message style
|
|
13
|
+
- `git branch --show-current` to get the current branch
|
|
14
|
+
|
|
15
|
+
2. Review the changes:
|
|
16
|
+
- Never stage files that look like secrets (.env, credentials, tokens, keys)
|
|
17
|
+
- If there are no changes to commit, say so and stop
|
|
18
|
+
|
|
19
|
+
3. Stage the appropriate files:
|
|
20
|
+
- If all changes are related, stage them all with specific file paths (not `git add -A`)
|
|
21
|
+
- If changes span unrelated concerns, stage only the coherent set and note what was left out
|
|
22
|
+
|
|
23
|
+
4. Write a conventional commit message:
|
|
24
|
+
- Use the project's commit style from git log (feat:, fix:, chore:, refactor:, docs:, test:)
|
|
25
|
+
- Summarize the "why" not the "what" — 1-2 sentences max
|
|
26
|
+
- Use a HEREDOC: `git commit -m "$(cat <<'EOF' ... EOF)"`
|
|
27
|
+
|
|
28
|
+
5. Push to remote:
|
|
29
|
+
- Use `git push -u origin <branch>` to ensure tracking is set
|
|
30
|
+
- Never force push
|
|
31
|
+
|
|
32
|
+
6. Run `git status` after pushing to confirm success
|
|
33
|
+
|
|
34
|
+
7. Report: what was committed, the commit hash, the remote URL, and whether any changes remain unstaged
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
## Deep Codebase Research
|
|
2
|
+
|
|
3
|
+
Produce a persistent research artifact before planning or implementing. This is pure understanding — no proposals, no plans, no code changes.
|
|
4
|
+
|
|
5
|
+
**Do NOT delegate this command to a subagent.** This is an orchestration command — Opus runs it directly.
|
|
6
|
+
|
|
7
|
+
### Input
|
|
8
|
+
$ARGUMENTS - area to investigate (e.g., "authentication flow", "src/api/", "how billing integrates with Stripe")
|
|
9
|
+
|
|
10
|
+
### Instructions
|
|
11
|
+
|
|
12
|
+
1. **Identify scope** from the argument. If vague, infer the most useful investigation area from context. Don't ask — start reading.
|
|
13
|
+
|
|
14
|
+
2. **Read existing documentation first:**
|
|
15
|
+
- Check `docs/research/` for existing research on this area — read it before exploring
|
|
16
|
+
- Check `docs/context/` for repo context snapshots
|
|
17
|
+
- Read project CLAUDE.md if it exists
|
|
18
|
+
- This prevents redundant exploration and builds on prior understanding
|
|
19
|
+
|
|
20
|
+
3. **Read deeply, not broadly.** Follow the actual logic:
|
|
21
|
+
- Trace data flow end-to-end (entry point → transformations → storage/output)
|
|
22
|
+
- Read function bodies, not just signatures
|
|
23
|
+
- Follow imports to understand real dependencies
|
|
24
|
+
- Check tests to understand intended behavior and edge cases
|
|
25
|
+
- Look at recent git history on key files for context on why things are the way they are
|
|
26
|
+
|
|
27
|
+
Use parallel Explore subagents to cover independent areas of the codebase simultaneously.
|
|
28
|
+
|
|
29
|
+
4. **Verify ALL findings against actual code — this is non-negotiable.** The value of research docs depends on accuracy.
|
|
30
|
+
- Check git log since any existing research doc's date — have relevant files changed?
|
|
31
|
+
- Read actual source files to confirm architectural claims, don't copy from existing docs without verifying
|
|
32
|
+
- If an existing research doc covers this area and is still accurate, update it rather than creating a duplicate
|
|
33
|
+
- If an existing doc is stale, update it immediately with current findings
|
|
34
|
+
|
|
35
|
+
5. **Write findings** to `docs/research/YYYY-MM-DD-<topic>.md`:
|
|
36
|
+
|
|
37
|
+
```markdown
|
|
38
|
+
# Research: <Topic>
|
|
39
|
+
_Date: YYYY-MM-DD_
|
|
40
|
+
|
|
41
|
+
## Overview
|
|
42
|
+
What this area does in 2-3 sentences.
|
|
43
|
+
|
|
44
|
+
## Architecture
|
|
45
|
+
How the pieces fit together. Key files and their roles.
|
|
46
|
+
|
|
47
|
+
## Data Flow
|
|
48
|
+
How data moves through the system, step by step.
|
|
49
|
+
|
|
50
|
+
## Patterns & Conventions
|
|
51
|
+
What conventions this code follows. How it differs from the rest of the codebase (if it does).
|
|
52
|
+
|
|
53
|
+
## Dependencies
|
|
54
|
+
What it depends on (internal + external). What depends on it.
|
|
55
|
+
|
|
56
|
+
## Gotchas
|
|
57
|
+
Non-obvious behavior, tech debt, fragile areas, implicit assumptions.
|
|
58
|
+
|
|
59
|
+
## Open Questions
|
|
60
|
+
Things that weren't clear from reading alone.
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Omit sections that don't apply. Add sections if the area warrants it.
|
|
64
|
+
|
|
65
|
+
6. **Do NOT:**
|
|
66
|
+
- Propose changes or improvements
|
|
67
|
+
- Write a plan
|
|
68
|
+
- Suggest refactors
|
|
69
|
+
- Fix anything
|
|
70
|
+
|
|
71
|
+
The only output is understanding, written down.
|
|
72
|
+
|
|
73
|
+
7. Report the file path and a brief summary when done. If Open Questions exist, highlight them — the user may want to direct a deeper pass.
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
## Post-Task Retrospective
|
|
2
|
+
|
|
3
|
+
Capture learnings after completing a task — what worked, what didn't, what was surprising. Automatically updates CLAUDE.md, MEMORY.md, and relevant docs so the system gets smarter after every task.
|
|
4
|
+
|
|
5
|
+
**Do NOT delegate this command to a subagent.** This is an orchestration command — Opus runs it directly.
|
|
6
|
+
|
|
7
|
+
### Input
|
|
8
|
+
$ARGUMENTS - optional description of the task that was just completed. If omitted, infers from recent git history and docs/plans/.
|
|
9
|
+
|
|
10
|
+
### Instructions
|
|
11
|
+
|
|
12
|
+
1. **Identify what was just completed:**
|
|
13
|
+
- If `$ARGUMENTS` describes the task, use that
|
|
14
|
+
- Otherwise: check `docs/plans/` for recently completed plans (`_Status: COMPLETED_`)
|
|
15
|
+
- Check `docs/spikes/` for recently completed spikes
|
|
16
|
+
- Check `docs/incidents/` for recently resolved incidents
|
|
17
|
+
- Check `git log --oneline -20` for recent commit patterns
|
|
18
|
+
- Check `docs/handoff/` for recent session context
|
|
19
|
+
|
|
20
|
+
2. **Analyze the work:**
|
|
21
|
+
- Read the completed plan's Execution Journal (if it exists) for failure/retry history
|
|
22
|
+
- Read the git diff between the start and end of the work
|
|
23
|
+
- Check: did the plan's steps match reality? Were there deviations?
|
|
24
|
+
- Check: were there unexpected blockers or surprises?
|
|
25
|
+
- Check: did any tools/commands fail or need workarounds?
|
|
26
|
+
|
|
27
|
+
3. **Extract learnings in these categories:**
|
|
28
|
+
|
|
29
|
+
**What worked well:**
|
|
30
|
+
- Patterns, approaches, or tools that were effective
|
|
31
|
+
- Decisions that proved correct
|
|
32
|
+
|
|
33
|
+
**What didn't work:**
|
|
34
|
+
- Approaches that failed and why
|
|
35
|
+
- Time wasted on dead ends
|
|
36
|
+
- Commands or tools that didn't behave as expected
|
|
37
|
+
|
|
38
|
+
**What was surprising:**
|
|
39
|
+
- Non-obvious behavior discovered
|
|
40
|
+
- Gotchas encountered
|
|
41
|
+
- Assumptions that turned out wrong
|
|
42
|
+
|
|
43
|
+
**Process improvements:**
|
|
44
|
+
- Should a slash command be updated based on this experience?
|
|
45
|
+
- Should a CLAUDE.md convention be added or changed?
|
|
46
|
+
- Should a new gotcha be documented?
|
|
47
|
+
|
|
48
|
+
4. **Apply learnings automatically:**
|
|
49
|
+
|
|
50
|
+
a. **Update project CLAUDE.md** if learnings revealed:
|
|
51
|
+
- New conventions that should be followed
|
|
52
|
+
- New "Common Mistakes to Avoid" entries
|
|
53
|
+
- Incorrect or outdated instructions
|
|
54
|
+
|
|
55
|
+
b. **Update `docs/context/`** if learnings revealed:
|
|
56
|
+
- New architectural patterns introduced
|
|
57
|
+
- New gotchas or fragile areas
|
|
58
|
+
- Changed development workflow
|
|
59
|
+
|
|
60
|
+
c. **Update MEMORY.md** (if accessible) if learnings revealed:
|
|
61
|
+
- New cross-project patterns or preferences
|
|
62
|
+
- Tool-specific insights that apply everywhere
|
|
63
|
+
- Machine-specific quirks discovered
|
|
64
|
+
|
|
65
|
+
d. **Suggest command updates** if:
|
|
66
|
+
- A slash command didn't cover a gap encountered during work
|
|
67
|
+
- A slash command's instructions didn't match reality
|
|
68
|
+
- Format: "The `/command-name` command should be updated: [specific change]"
|
|
69
|
+
|
|
70
|
+
5. **Write the retro** to `docs/retros/YYYY-MM-DD-<task-slug>.md`:
|
|
71
|
+
|
|
72
|
+
```markdown
|
|
73
|
+
# Retro: <Task>
|
|
74
|
+
_Date: YYYY-MM-DD_
|
|
75
|
+
_Plan: docs/plans/<file>.md (if applicable)_
|
|
76
|
+
|
|
77
|
+
## Summary
|
|
78
|
+
What was done in 1-2 sentences.
|
|
79
|
+
|
|
80
|
+
## What Worked
|
|
81
|
+
- [Effective patterns, good decisions]
|
|
82
|
+
|
|
83
|
+
## What Didn't Work
|
|
84
|
+
- [Failed approaches, time sinks, dead ends]
|
|
85
|
+
|
|
86
|
+
## Surprises
|
|
87
|
+
- [Non-obvious findings, broken assumptions]
|
|
88
|
+
|
|
89
|
+
## Applied Updates
|
|
90
|
+
- [x] Updated CLAUDE.md: [what was changed]
|
|
91
|
+
- [x] Updated docs/context/: [what was changed]
|
|
92
|
+
- [ ] Suggested: update `/command-name` to [change]
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
6. Report the retro file path, what was updated, and any suggested command changes.
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
## Review External PR — Full Context-Aware PR Review
|
|
2
|
+
|
|
3
|
+
Review someone else's pull request with full project context. Loads architecture, conventions, and gotchas so the review is against this project's actual standards — not generic best practices. Posts review comments directly via `gh`.
|
|
4
|
+
|
|
5
|
+
Different from `/review` (which reviews your own uncommitted changes) — this reviews an existing PR from a teammate or contributor.
|
|
6
|
+
|
|
7
|
+
### Input
|
|
8
|
+
$ARGUMENTS - PR number, URL, or branch name (e.g., "123", "https://github.com/org/repo/pull/123", "feat/auth-refactor")
|
|
9
|
+
|
|
10
|
+
### Instructions
|
|
11
|
+
|
|
12
|
+
**Before delegating, gather project context:**
|
|
13
|
+
1. Read `docs/context/` for the most recent context snapshot — extract Architecture, Conventions, Testing, and Gotchas sections
|
|
14
|
+
2. Read the project CLAUDE.md if it exists — extract Conventions and Common Mistakes sections
|
|
15
|
+
3. Read `docs/incidents/` for recent incidents — are any related to the files being changed?
|
|
16
|
+
4. Read `docs/spikes/` for recent spikes — is this PR implementing a spiked approach?
|
|
17
|
+
|
|
18
|
+
**Then delegate this task to a subagent using the Agent tool with `model: "sonnet"` and `subagent_type: "general-purpose"`.** Pass the full prompt below (with context injected) to the subagent and relay its result.
|
|
19
|
+
|
|
20
|
+
### Subagent prompt
|
|
21
|
+
|
|
22
|
+
You are a thorough, context-aware code reviewer. Review PR `$ARGUMENTS` against this project's actual standards and patterns.
|
|
23
|
+
|
|
24
|
+
**Project Context:**
|
|
25
|
+
[Inject Architecture, Conventions, Testing, Gotchas from docs/context if available]
|
|
26
|
+
[Inject Conventions, Common Mistakes from project CLAUDE.md if available]
|
|
27
|
+
[Inject any related incidents or spikes if relevant]
|
|
28
|
+
If no project context is available, review against general best practices and note that project context was unavailable.
|
|
29
|
+
|
|
30
|
+
1. **Fetch PR details:**
|
|
31
|
+
```bash
|
|
32
|
+
gh pr view $ARGUMENTS --json title,body,author,baseRefName,headRefName,files,additions,deletions,commits
|
|
33
|
+
gh pr diff $ARGUMENTS
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
2. **Understand the PR:**
|
|
37
|
+
- What is the goal? (Read the PR description and commit messages)
|
|
38
|
+
- What files are changed? (Group by area: frontend, backend, infra, config, tests)
|
|
39
|
+
- What is the blast radius? (How many files, how central are they?)
|
|
40
|
+
- Does this PR implement a spiked approach? (Check spike context if provided)
|
|
41
|
+
|
|
42
|
+
3. **Read the changed files** in their full context — don't just look at the diff. Understand how the changes fit into the broader codebase:
|
|
43
|
+
- Read each modified file in full (not just the changed lines)
|
|
44
|
+
- Check how changed functions/classes are used elsewhere
|
|
45
|
+
- Check if tests exist for the changed code
|
|
46
|
+
|
|
47
|
+
4. **Review every change for:**
|
|
48
|
+
- **Correctness:** Logic errors, off-by-one, null/undefined handling, race conditions
|
|
49
|
+
- **Security:** Hardcoded secrets, injection vulnerabilities, XSS, exposed credentials, OWASP top 10
|
|
50
|
+
- **Types:** Missing types, incorrect types, unsafe `any` usage (TypeScript)
|
|
51
|
+
- **Error handling:** Unhandled promise rejections, missing try/catch, bare exceptions
|
|
52
|
+
- **Project conventions:** Does the code follow the patterns established in this codebase? (Use the project context above)
|
|
53
|
+
- **Testing:** Are new features tested? Are edge cases covered? Do existing tests still apply?
|
|
54
|
+
- **K8s specific:** Missing resource limits, hardcoded values, missing labels
|
|
55
|
+
- **Python specific:** Type hints, structured logging, idempotency
|
|
56
|
+
- **Performance:** N+1 queries, unnecessary re-renders, missing indexes, unbounded loops
|
|
57
|
+
- **Breaking changes:** API contract changes, migration needs, backwards compatibility
|
|
58
|
+
|
|
59
|
+
5. **Check for anti-patterns:**
|
|
60
|
+
- Files that shouldn't be committed (`.env`, `node_modules`, build artifacts, `.pyc`)
|
|
61
|
+
- Overly large PR that should be split
|
|
62
|
+
- Missing or inadequate PR description
|
|
63
|
+
- Tests that test implementation instead of behavior
|
|
64
|
+
- Copied code that should be abstracted (only if 3+ occurrences)
|
|
65
|
+
|
|
66
|
+
6. **Determine verdict:**
|
|
67
|
+
- **Approve** — changes are solid, no issues or only minor nits
|
|
68
|
+
- **Request Changes** — blocking issues that must be fixed before merge
|
|
69
|
+
- **Comment** — non-blocking feedback, questions, or suggestions
|
|
70
|
+
|
|
71
|
+
7. **Post the review:**
|
|
72
|
+
```bash
|
|
73
|
+
gh pr review $ARGUMENTS --approve --body "review body"
|
|
74
|
+
# or
|
|
75
|
+
gh pr review $ARGUMENTS --request-changes --body "review body"
|
|
76
|
+
# or
|
|
77
|
+
gh pr review $ARGUMENTS --comment --body "review body"
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Review body format:
|
|
81
|
+
```markdown
|
|
82
|
+
## Review Summary
|
|
83
|
+
[1-2 sentences: what this PR does and overall assessment]
|
|
84
|
+
|
|
85
|
+
## Issues (if any)
|
|
86
|
+
### Blocking
|
|
87
|
+
- **file:line** — description of issue and suggested fix
|
|
88
|
+
|
|
89
|
+
### Non-blocking
|
|
90
|
+
- **file:line** — suggestion or question
|
|
91
|
+
|
|
92
|
+
## What looks good
|
|
93
|
+
- [Specific callouts of good decisions or clean code]
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
8. **Report back** with: verdict, issue count (blocking/non-blocking), and key observations.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
## Self Code Review
|
|
2
|
+
|
|
3
|
+
### Input
|
|
4
|
+
$ARGUMENTS - optional: specific files or areas to focus the review on. If omitted, reviews all uncommitted changes.
|
|
5
|
+
|
|
6
|
+
**Before delegating, gather project context:**
|
|
7
|
+
1. Check if `docs/context/` has a context snapshot — if so, read the most recent one and extract the Architecture, Conventions, and Gotchas sections
|
|
8
|
+
2. Read the project CLAUDE.md if it exists — extract Conventions and Common Mistakes sections
|
|
9
|
+
3. Pass this context to the subagent below
|
|
10
|
+
|
|
11
|
+
**Then delegate this task to a subagent using the Agent tool with `model: "sonnet"` and `subagent_type: "general-purpose"`.** Pass the full prompt below (with context injected) to the subagent and relay its result.
|
|
12
|
+
|
|
13
|
+
### Subagent prompt
|
|
14
|
+
|
|
15
|
+
You are a strict senior code reviewer. Review all current changes before committing.
|
|
16
|
+
|
|
17
|
+
**Project Context:**
|
|
18
|
+
[Inject Architecture, Conventions, Gotchas from docs/context if available]
|
|
19
|
+
[Inject Conventions, Common Mistakes from project CLAUDE.md if available]
|
|
20
|
+
If no project context is available, review against general best practices.
|
|
21
|
+
|
|
22
|
+
1. Run in parallel:
|
|
23
|
+
- `git diff` to see all unstaged changes
|
|
24
|
+
- `git diff --cached` for staged changes
|
|
25
|
+
|
|
26
|
+
2. Review every change for:
|
|
27
|
+
- **Correctness:** Logic errors, off-by-one, null/undefined handling, race conditions
|
|
28
|
+
- **Security:** Hardcoded secrets, SQL/NoSQL injection, XSS, exposed credentials
|
|
29
|
+
- **Types:** Missing types, incorrect types, unsafe `any` usage (TypeScript)
|
|
30
|
+
- **Error handling:** Unhandled promise rejections, missing try/catch, bare exceptions
|
|
31
|
+
- **Project conventions:** Does the code follow the patterns established in this codebase? (Use the project context above)
|
|
32
|
+
- **K8s specific:** Missing resource limits, hardcoded values that should be configurable, missing labels
|
|
33
|
+
- **Python agents:** Idempotency, graceful error handling, structured logging
|
|
34
|
+
|
|
35
|
+
3. Check for accidental files: `.env`, `node_modules`, `__pycache__`, `.pyc`, build artifacts
|
|
36
|
+
|
|
37
|
+
4. Provide a clear verdict:
|
|
38
|
+
- **Ship it** — changes look good
|
|
39
|
+
- **Needs fixes** — list specific issues with file:line references
|
|
40
|
+
|
|
41
|
+
5. If "Needs fixes", describe each fix precisely so the caller can apply them.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
## Python Agent Scaffold
|
|
2
|
+
|
|
3
|
+
**IMPORTANT: Immediately delegate this entire task to a subagent using the Agent tool with `model: "sonnet"` and `subagent_type: "general-purpose"`.** Do not create any files yourself. Pass the full prompt below to the subagent and relay its result.
|
|
4
|
+
|
|
5
|
+
### Input
|
|
6
|
+
$ARGUMENTS - what the agent should do (e.g., "monitor API health and alert", "sync data between services")
|
|
7
|
+
|
|
8
|
+
### Subagent prompt
|
|
9
|
+
|
|
10
|
+
You are scaffolding a Python automation agent. Purpose: $ARGUMENTS
|
|
11
|
+
|
|
12
|
+
1. Determine if this is a new agent or modification to existing.
|
|
13
|
+
|
|
14
|
+
2. For new agents, create the following structure:
|
|
15
|
+
```
|
|
16
|
+
agent_name/
|
|
17
|
+
├── __init__.py
|
|
18
|
+
├── agent.py # Main agent logic
|
|
19
|
+
├── config.py # Pydantic settings/config
|
|
20
|
+
├── models.py # Data models
|
|
21
|
+
├── requirements.txt # Dependencies
|
|
22
|
+
├── Dockerfile # Multi-stage build
|
|
23
|
+
└── tests/
|
|
24
|
+
├── __init__.py
|
|
25
|
+
└── test_agent.py
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
3. Agent must follow these patterns:
|
|
29
|
+
- Pydantic BaseModel for all config and data structures
|
|
30
|
+
- `logging` module with structured JSON logging
|
|
31
|
+
- Idempotent operations (safe to run multiple times)
|
|
32
|
+
- Graceful error handling with retries for transient failures
|
|
33
|
+
- Health check endpoint if long-running
|
|
34
|
+
- Environment variables for all configuration (never hardcoded)
|
|
35
|
+
- Type hints on all function signatures
|
|
36
|
+
- `pathlib.Path` over `os.path`
|
|
37
|
+
|
|
38
|
+
4. If deploying to K8s, generate deployment manifest with:
|
|
39
|
+
- Resource requests/limits
|
|
40
|
+
- ConfigMap for non-sensitive config
|
|
41
|
+
- Secret references for sensitive data
|
|
42
|
+
- Proper labels: app, env, version, managed-by
|
|
43
|
+
- Liveness/readiness probes if applicable
|
|
44
|
+
|
|
45
|
+
5. Run `pytest` to verify tests pass.
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
## Initialize Project CLAUDE.md
|
|
2
|
+
|
|
3
|
+
Generate or validate a project-specific CLAUDE.md tailored to the current codebase.
|
|
4
|
+
|
|
5
|
+
When run in a repo that already has a CLAUDE.md, validates it against the current state of the codebase and fortifies it — fixing stale information, adding missing sections, and strengthening weak areas. Does NOT overwrite or start from scratch.
|
|
6
|
+
|
|
7
|
+
### Input
|
|
8
|
+
$ARGUMENTS - optional: brief description of the project's purpose
|
|
9
|
+
|
|
10
|
+
### Steps
|
|
11
|
+
|
|
12
|
+
1. **Check for existing CLAUDE.md.** If one exists, read it fully — this is a validation/fortification run, not a fresh generation.
|
|
13
|
+
|
|
14
|
+
2. **Detect the tech stack** by scanning for key files. Run these checks in parallel:
|
|
15
|
+
- `package.json` / `tsconfig.json` / `angular.json` / `next.config.*` / `vite.config.*` → JS/TS project
|
|
16
|
+
- `pyproject.toml` / `setup.py` / `requirements.txt` / `Pipfile` → Python project
|
|
17
|
+
- `Chart.yaml` / `helmfile.yaml` / `k8s/` / `manifests/` / `terraform/` → Infrastructure
|
|
18
|
+
- `Dockerfile` / `docker-compose.yml` → Containerized
|
|
19
|
+
- `.github/workflows/` / `.gitlab-ci.yml` → CI/CD
|
|
20
|
+
- `Makefile` / `Justfile` / `Taskfile.yml` → Task runner
|
|
21
|
+
- `.eslintrc*` / `prettier.config*` / `ruff.toml` / `pyproject.toml [tool.ruff]` → Linting/formatting
|
|
22
|
+
- `jest.config*` / `vitest.config*` / `cypress.config*` / `playwright.config*` / `pytest.ini` / `conftest.py` → Testing
|
|
23
|
+
- `go.mod` → Go project
|
|
24
|
+
- `Cargo.toml` → Rust project
|
|
25
|
+
|
|
26
|
+
3. **Analyze the project structure:**
|
|
27
|
+
- Read the top-level directory listing
|
|
28
|
+
- Read `package.json` scripts (if exists) to extract commands
|
|
29
|
+
- Read `pyproject.toml` scripts/tool config (if exists)
|
|
30
|
+
- Read `Makefile` / `Justfile` targets (if exists)
|
|
31
|
+
- Identify the main source directories (`src/`, `app/`, `lib/`, `cmd/`, etc.)
|
|
32
|
+
- Check for monorepo patterns (`packages/`, `apps/`, `workspace`)
|
|
33
|
+
|
|
34
|
+
4. **Check for existing conventions:**
|
|
35
|
+
- Read a few representative source files to detect coding patterns (imports, error handling, naming)
|
|
36
|
+
- Check git log for commit message conventions: `git log --oneline -20`
|
|
37
|
+
- Look for existing docs: `README.md`, `CONTRIBUTING.md`, `docs/`
|
|
38
|
+
- Check for existing `.env.example` to understand config patterns
|
|
39
|
+
|
|
40
|
+
5. **If CLAUDE.md already exists — validate and fortify:**
|
|
41
|
+
- Compare each section against current codebase reality
|
|
42
|
+
- Fix any stale information (outdated commands, wrong directory structure, missing tech stack entries)
|
|
43
|
+
- Add missing sections that should exist based on what you detected
|
|
44
|
+
- Strengthen weak sections (e.g., "Common Mistakes" that are too generic)
|
|
45
|
+
- Do NOT remove user-added content or customizations — preserve intent
|
|
46
|
+
- Do NOT rewrite sections that are already accurate
|
|
47
|
+
- Report what was changed and why
|
|
48
|
+
|
|
49
|
+
6. **If no CLAUDE.md exists — generate fresh** with these sections, filled in with real values from the codebase (never leave placeholders or HTML comments):
|
|
50
|
+
|
|
51
|
+
```markdown
|
|
52
|
+
# Project CLAUDE.md - [Project Name]
|
|
53
|
+
|
|
54
|
+
## Project Overview
|
|
55
|
+
[1-2 sentences: what this does, derived from README/package.json description or $ARGUMENTS]
|
|
56
|
+
|
|
57
|
+
## Tech Stack
|
|
58
|
+
[Actual frameworks, languages, and tools detected — not template defaults]
|
|
59
|
+
|
|
60
|
+
## Architecture
|
|
61
|
+
[Real directory tree from `ls`, showing only important directories with brief descriptions]
|
|
62
|
+
|
|
63
|
+
## Commands
|
|
64
|
+
[Actual commands from package.json scripts, Makefile targets, or pyproject.toml — not guessed defaults]
|
|
65
|
+
|
|
66
|
+
## Conventions
|
|
67
|
+
[Real patterns observed in the code, not generic best practices. Examples:
|
|
68
|
+
- Import ordering style actually used
|
|
69
|
+
- State management pattern actually used
|
|
70
|
+
- Error handling pattern actually used
|
|
71
|
+
- Naming conventions actually used (camelCase, snake_case, etc.)
|
|
72
|
+
- Any patterns from CONTRIBUTING.md or existing docs]
|
|
73
|
+
|
|
74
|
+
## Common Mistakes to Avoid
|
|
75
|
+
[Project-specific pitfalls based on the tech stack and patterns observed.
|
|
76
|
+
Start with 2-3 items. More will be added as Claude works in this project.]
|
|
77
|
+
|
|
78
|
+
## Testing
|
|
79
|
+
[How to run tests, what framework is used, any special setup needed]
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
7. **Write the file** to `./CLAUDE.md` in the project root.
|
|
83
|
+
|
|
84
|
+
8. **Verify** the file was created/updated and show a summary of what was detected or changed.
|
|
85
|
+
|
|
86
|
+
### Rules
|
|
87
|
+
- Fill in ALL sections with real data from the codebase. Never leave `<!-- comments -->` or placeholder text.
|
|
88
|
+
- If a section doesn't apply (e.g., no database), omit it entirely rather than leaving it empty.
|
|
89
|
+
- Keep it concise — under 80 lines. This is a reference card, not documentation.
|
|
90
|
+
- Don't duplicate instructions from the global `~/CLAUDE.md`. Only include project-specific details.
|
|
91
|
+
- For monorepos, note the workspace structure and key packages.
|
|
92
|
+
- On rerun: preserve user intent, fix facts, add missing context. Never destructively rewrite.
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
## Ship to Production
|
|
2
|
+
|
|
3
|
+
Full production deployment pipeline — self-review PR, merge to main, deploy to production, and monitor until healthy. This is the highest-stakes command. Every step is verified. Does not stop until production is confirmed healthy.
|
|
4
|
+
|
|
5
|
+
**WARNING:** This command merges to main and deploys to production. It will self-review the PR and only merge when 100% confident.
|
|
6
|
+
|
|
7
|
+
**Do NOT delegate this command to a subagent.** This is an orchestration command — Opus runs it directly.
|
|
8
|
+
|
|
9
|
+
### Input
|
|
10
|
+
$ARGUMENTS - optional PR number or URL. If omitted, finds the most recent open PR for the current branch.
|
|
11
|
+
|
|
12
|
+
### Instructions
|
|
13
|
+
|
|
14
|
+
1. **Gather deployment context:**
|
|
15
|
+
- Read project CLAUDE.md and `docs/context/` for production deployment workflow
|
|
16
|
+
- Detect deployment method (same detection as `/ship`)
|
|
17
|
+
- Identify the production environment and any production-specific configuration
|
|
18
|
+
- Check for required approvals, branch protection rules, or deployment gates
|
|
19
|
+
|
|
20
|
+
2. **Load the PR:**
|
|
21
|
+
- If `$ARGUMENTS` has a PR number/URL, use it
|
|
22
|
+
- Otherwise: `gh pr list --head $(git branch --show-current)` to find the PR
|
|
23
|
+
- If no PR exists, stop — "Run `/ship` first to create a PR and deploy to dev"
|
|
24
|
+
|
|
25
|
+
3. **Pre-merge verification** (run in parallel):
|
|
26
|
+
- `gh pr checks` — ALL CI checks must be passing
|
|
27
|
+
- `gh pr view --json reviews` — check for existing reviews
|
|
28
|
+
- Read the full diff: `gh pr diff`
|
|
29
|
+
- Run the full test suite locally — ALL must pass
|
|
30
|
+
- Run linter — zero errors
|
|
31
|
+
- Run build — must succeed
|
|
32
|
+
|
|
33
|
+
4. **Self-review the PR** with production mindset:
|
|
34
|
+
- Read every line of the diff
|
|
35
|
+
- Check for:
|
|
36
|
+
- **Security:** No secrets, no injection vectors, no exposed endpoints
|
|
37
|
+
- **Data safety:** No destructive migrations, no data loss risks
|
|
38
|
+
- **Backwards compatibility:** API contracts, database schemas, config changes
|
|
39
|
+
- **Error handling:** All failure modes covered, graceful degradation
|
|
40
|
+
- **Performance:** No N+1 queries, no unbounded operations, no memory leaks
|
|
41
|
+
- **Rollback plan:** Can this be reverted safely if something goes wrong?
|
|
42
|
+
- Check that the dev deployment (from `/ship`) has been running without issues
|
|
43
|
+
|
|
44
|
+
5. **Confidence gate:**
|
|
45
|
+
- If ANY concern exists: stop and report the concern. Do NOT merge.
|
|
46
|
+
- Only proceed if 100% confident this is production-ready.
|
|
47
|
+
- Document the confidence assessment: what was checked, what gives confidence.
|
|
48
|
+
|
|
49
|
+
6. **Merge the PR:**
|
|
50
|
+
- `gh pr merge --merge` (preserve full git history, never squash)
|
|
51
|
+
- Verify the merge succeeded: `gh pr view --json state`
|
|
52
|
+
|
|
53
|
+
7. **Deploy to production:**
|
|
54
|
+
- **If CI/CD auto-deploys on merge to main:** Monitor the deployment pipeline:
|
|
55
|
+
- Poll `gh run list --branch main` until the production deploy workflow completes
|
|
56
|
+
- If deploy fails, read logs with `gh run view --log-failed`
|
|
57
|
+
- **If manual dispatch:** `gh workflow run <prod-deploy-workflow> --ref main`
|
|
58
|
+
- **If K8s:** `kubectl apply` to production context, watch rollout status
|
|
59
|
+
- **If ECS:** Monitor service update, wait for healthy running count
|
|
60
|
+
- **If Docker Compose on remote:** SSH to prod, pull, `docker compose up -d`
|
|
61
|
+
|
|
62
|
+
8. **Post-deploy production monitoring:**
|
|
63
|
+
- **Tail production logs** for 60-120 seconds:
|
|
64
|
+
- K8s: `kubectl logs -f deployment/<name> --tail=100 --timeout=120s -n production`
|
|
65
|
+
- ECS: `aws logs tail <prod-log-group> --since 5m --follow`
|
|
66
|
+
- **Health checks:** Hit production health endpoints
|
|
67
|
+
- **Error scanning:** Look for ERROR, FATAL, panic, unhandled, exception
|
|
68
|
+
- **Metrics check:** If monitoring tools are available (CloudWatch, Datadog, etc.), check error rate and latency
|
|
69
|
+
- **Compare to baseline:** Are error rates higher than pre-deploy? Is latency increased?
|
|
70
|
+
|
|
71
|
+
9. **If production issues detected:**
|
|
72
|
+
- **Severity assessment:** Is this a rollback-worthy issue or a quick fix?
|
|
73
|
+
- If rollback needed: Report immediately — "Production issue detected. Recommend rollback: `git revert <commit> && git push`"
|
|
74
|
+
- If quick fix: Fix, push to new branch, go through `/ship` again (do NOT ship-prod again without dev verification)
|
|
75
|
+
|
|
76
|
+
10. **Report:**
|
|
77
|
+
```
|
|
78
|
+
## Production Ship Report
|
|
79
|
+
- **PR:** <URL>
|
|
80
|
+
- **Merged to:** main
|
|
81
|
+
- **Merge method:** merge (full history)
|
|
82
|
+
- **Deployed to:** production
|
|
83
|
+
- **Deployment method:** <method>
|
|
84
|
+
- **Self-review:** Passed (no concerns)
|
|
85
|
+
- **Health check:** passing
|
|
86
|
+
- **Logs:** clean (monitored for N seconds)
|
|
87
|
+
- **Error rate:** normal / elevated
|
|
88
|
+
- **Status:** Production healthy and verified
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Critical Rules
|
|
92
|
+
|
|
93
|
+
- **NEVER merge with failing CI checks.**
|
|
94
|
+
- **NEVER skip the self-review.** Read every line.
|
|
95
|
+
- **NEVER proceed past the confidence gate with concerns.**
|
|
96
|
+
- **NEVER ignore elevated error rates post-deploy.**
|
|
97
|
+
- **If in doubt, stop and report.** A delayed deploy is always better than a broken production.
|