thevoidforge 21.0.11 → 21.0.12

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.
Files changed (107) hide show
  1. package/dist/.claude/commands/ai.md +69 -0
  2. package/dist/.claude/commands/architect.md +121 -0
  3. package/dist/.claude/commands/assemble.md +201 -0
  4. package/dist/.claude/commands/assess.md +75 -0
  5. package/dist/.claude/commands/blueprint.md +135 -0
  6. package/dist/.claude/commands/build.md +116 -0
  7. package/dist/.claude/commands/campaign.md +201 -0
  8. package/dist/.claude/commands/cultivation.md +166 -0
  9. package/dist/.claude/commands/current.md +128 -0
  10. package/dist/.claude/commands/dangerroom.md +74 -0
  11. package/dist/.claude/commands/debrief.md +178 -0
  12. package/dist/.claude/commands/deploy.md +99 -0
  13. package/dist/.claude/commands/devops.md +143 -0
  14. package/dist/.claude/commands/gauntlet.md +140 -0
  15. package/dist/.claude/commands/git.md +104 -0
  16. package/dist/.claude/commands/grow.md +146 -0
  17. package/dist/.claude/commands/imagine.md +126 -0
  18. package/dist/.claude/commands/portfolio.md +50 -0
  19. package/dist/.claude/commands/prd.md +113 -0
  20. package/dist/.claude/commands/qa.md +107 -0
  21. package/dist/.claude/commands/review.md +151 -0
  22. package/dist/.claude/commands/security.md +100 -0
  23. package/dist/.claude/commands/test.md +96 -0
  24. package/dist/.claude/commands/thumper.md +116 -0
  25. package/dist/.claude/commands/treasury.md +100 -0
  26. package/dist/.claude/commands/ux.md +118 -0
  27. package/dist/.claude/commands/vault.md +189 -0
  28. package/dist/.claude/commands/void.md +108 -0
  29. package/dist/CHANGELOG.md +1918 -0
  30. package/dist/CLAUDE.md +250 -0
  31. package/dist/HOLOCRON.md +856 -0
  32. package/dist/VERSION.md +123 -0
  33. package/dist/docs/NAMING_REGISTRY.md +478 -0
  34. package/dist/docs/methods/AI_INTELLIGENCE.md +276 -0
  35. package/dist/docs/methods/ASSEMBLER.md +142 -0
  36. package/dist/docs/methods/BACKEND_ENGINEER.md +165 -0
  37. package/dist/docs/methods/BUILD_JOURNAL.md +185 -0
  38. package/dist/docs/methods/BUILD_PROTOCOL.md +426 -0
  39. package/dist/docs/methods/CAMPAIGN.md +568 -0
  40. package/dist/docs/methods/CONTEXT_MANAGEMENT.md +189 -0
  41. package/dist/docs/methods/DEEP_CURRENT.md +184 -0
  42. package/dist/docs/methods/DEVOPS_ENGINEER.md +295 -0
  43. package/dist/docs/methods/FIELD_MEDIC.md +261 -0
  44. package/dist/docs/methods/FORGE_ARTIST.md +108 -0
  45. package/dist/docs/methods/FORGE_KEEPER.md +268 -0
  46. package/dist/docs/methods/GAUNTLET.md +344 -0
  47. package/dist/docs/methods/GROWTH_STRATEGIST.md +466 -0
  48. package/dist/docs/methods/HEARTBEAT.md +168 -0
  49. package/dist/docs/methods/MCP_INTEGRATION.md +139 -0
  50. package/dist/docs/methods/MUSTER.md +148 -0
  51. package/dist/docs/methods/PRD_GENERATOR.md +186 -0
  52. package/dist/docs/methods/PRODUCT_DESIGN_FRONTEND.md +250 -0
  53. package/dist/docs/methods/QA_ENGINEER.md +337 -0
  54. package/dist/docs/methods/RELEASE_MANAGER.md +145 -0
  55. package/dist/docs/methods/SECURITY_AUDITOR.md +320 -0
  56. package/dist/docs/methods/SUB_AGENTS.md +335 -0
  57. package/dist/docs/methods/SYSTEMS_ARCHITECT.md +171 -0
  58. package/dist/docs/methods/TESTING.md +359 -0
  59. package/dist/docs/methods/THUMPER.md +175 -0
  60. package/dist/docs/methods/TIME_VAULT.md +120 -0
  61. package/dist/docs/methods/TREASURY.md +184 -0
  62. package/dist/docs/methods/TROUBLESHOOTING.md +265 -0
  63. package/dist/docs/patterns/README.md +52 -0
  64. package/dist/docs/patterns/ad-billing-adapter.ts +537 -0
  65. package/dist/docs/patterns/ad-platform-adapter.ts +421 -0
  66. package/dist/docs/patterns/ai-classifier.ts +195 -0
  67. package/dist/docs/patterns/ai-eval.ts +272 -0
  68. package/dist/docs/patterns/ai-orchestrator.ts +341 -0
  69. package/dist/docs/patterns/ai-router.ts +194 -0
  70. package/dist/docs/patterns/ai-tool-schema.ts +237 -0
  71. package/dist/docs/patterns/api-route.ts +241 -0
  72. package/dist/docs/patterns/backtest-engine.ts +499 -0
  73. package/dist/docs/patterns/browser-review.ts +292 -0
  74. package/dist/docs/patterns/combobox.tsx +300 -0
  75. package/dist/docs/patterns/component.tsx +262 -0
  76. package/dist/docs/patterns/daemon-process.ts +338 -0
  77. package/dist/docs/patterns/data-pipeline.ts +297 -0
  78. package/dist/docs/patterns/database-migration.ts +466 -0
  79. package/dist/docs/patterns/e2e-test.ts +629 -0
  80. package/dist/docs/patterns/error-handling.ts +312 -0
  81. package/dist/docs/patterns/execution-safety.ts +601 -0
  82. package/dist/docs/patterns/financial-transaction.ts +342 -0
  83. package/dist/docs/patterns/funding-plan.ts +462 -0
  84. package/dist/docs/patterns/game-entity.ts +137 -0
  85. package/dist/docs/patterns/game-loop.ts +113 -0
  86. package/dist/docs/patterns/game-state.ts +143 -0
  87. package/dist/docs/patterns/job-queue.ts +225 -0
  88. package/dist/docs/patterns/kongo-integration.ts +164 -0
  89. package/dist/docs/patterns/middleware.ts +363 -0
  90. package/dist/docs/patterns/mobile-screen.tsx +139 -0
  91. package/dist/docs/patterns/mobile-service.ts +167 -0
  92. package/dist/docs/patterns/multi-tenant.ts +382 -0
  93. package/dist/docs/patterns/oauth-token-lifecycle.ts +223 -0
  94. package/dist/docs/patterns/outbound-rate-limiter.ts +260 -0
  95. package/dist/docs/patterns/prompt-template.ts +195 -0
  96. package/dist/docs/patterns/revenue-source-adapter.ts +311 -0
  97. package/dist/docs/patterns/service.ts +224 -0
  98. package/dist/docs/patterns/sse-endpoint.ts +118 -0
  99. package/dist/docs/patterns/stablecoin-adapter.ts +511 -0
  100. package/dist/docs/patterns/third-party-script.ts +68 -0
  101. package/dist/scripts/thumper/gom-jabbar.sh +241 -0
  102. package/dist/scripts/thumper/relay.sh +610 -0
  103. package/dist/scripts/thumper/scan.sh +359 -0
  104. package/dist/scripts/thumper/thumper.sh +190 -0
  105. package/dist/scripts/thumper/water-rings.sh +76 -0
  106. package/package.json +1 -1
  107. package/dist/tsconfig.tsbuildinfo +0 -1
@@ -0,0 +1,74 @@
1
+ # /dangerroom — The Danger Room (Mission Control Dashboard)
2
+
3
+ > *"The Danger Room is where X-Men train. It's where your project gets forged."*
4
+
5
+ ## What It Does
6
+
7
+ Starts the VoidForge wizard server and opens the Danger Room dashboard in your browser. The Danger Room shows real-time build ops, growth metrics, campaign status, treasury data, and heartbeat monitoring — all in one place.
8
+
9
+ ## Usage
10
+
11
+ ```
12
+ /dangerroom [install|start|status|stop]
13
+ ```
14
+
15
+ ## Modes
16
+
17
+ ### `/dangerroom` or `/dangerroom start`
18
+
19
+ Start the wizard server and open the Danger Room:
20
+
21
+ 1. Check if the wizard server is already running (check port 3141)
22
+ 2. If not running: start with `node wizard/server.js` or `npx voidforge start`
23
+ 3. Open `http://localhost:3141/danger-room` in the default browser
24
+ 4. If Cultivation is installed: opens to `#growth` tab by default
25
+ 5. **Remote server:** If running on EC2/VPS where port 3141 is not publicly exposed, guide the user to use an SSH tunnel: `ssh -i your-key.pem -L 3141:localhost:3141 user@host` — then open `http://localhost:3141/danger-room` in their local browser. (Field report #122)
26
+
27
+ ### `/dangerroom install`
28
+
29
+ Alias for starting the wizard server. Ensures the server is running and the Danger Room is accessible. If the project uses the scaffold branch (no packages/voidforge/wizard/server.ts), report: "The Danger Room requires the main branch. Run `git checkout main` or install VoidForge with `npx voidforge init`."
30
+
31
+ ### `/dangerroom status`
32
+
33
+ Also available as `--status` flag for consistency.
34
+
35
+ Check the current state:
36
+ - Is the wizard server running? (check port 3141)
37
+ - Which tabs are available? (Ops always; Growth/Campaigns/Treasury/Heartbeat/Deep Current if Cultivation installed)
38
+ - Is the heartbeat daemon running?
39
+ - Last known URL
40
+
41
+ ### `/dangerroom stop`
42
+
43
+ Stop the wizard server if running.
44
+
45
+ ## Tabs
46
+
47
+ | Tab | What It Shows | Available When |
48
+ |-----|--------------|----------------|
49
+ | **Ops** | Campaign timeline, phase pipeline, findings, experiments, PRD coverage, prophecy graph | Always |
50
+ | **Growth** | Revenue/spend/net KPIs, ROAS by platform, traffic sources, conversion funnel | Cultivation installed |
51
+ | **Campaigns** | Ad campaign table, A/B test groups, agent recommendations | Cultivation installed |
52
+ | **Treasury** | Financial summary, budget utilization, platform connections, reconciliation | Cultivation installed |
53
+ | **Heartbeat** | Daemon status, token health, scheduled jobs, anomaly alerts | Cultivation installed |
54
+ | **Deep Current** | Situation model, campaign proposals, prediction accuracy, autonomy status | Deep Current initialized |
55
+
56
+ ## Global Elements
57
+
58
+ - **Freeze button** — visible across all tabs when Cultivation is installed. Emergency pause on all automated spending.
59
+ - **Agent ticker** — real-time feed of agent activity at the bottom of every tab.
60
+ - **Sidebar** — context gauge, version, deploy status, tests, cost (visible across all tabs).
61
+
62
+ ## Prerequisites
63
+
64
+ - Node.js installed
65
+ - Port 3141 available (or set `VOIDFORGE_PORT` env var)
66
+ - The `packages/voidforge/wizard/server.ts` file must exist. If it does not (scaffold/core users):
67
+ 1. Offer: "The Danger Room requires the wizard server. Pull it from upstream? [Y/n]"
68
+ 2. On yes: `git fetch voidforge main 2>/dev/null || git remote add voidforge https://github.com/tmcleod3/voidforge.git && git fetch voidforge main` then `git checkout voidforge/main -- packages/voidforge/`
69
+ 3. Run `npm install` to install wizard dependencies
70
+ 4. Proceed with `/dangerroom start`
71
+ 5. On no: stop with "Run manually: `git checkout voidforge/main -- packages/voidforge/`"
72
+
73
+ ## Arguments
74
+ $ARGUMENTS
@@ -0,0 +1,178 @@
1
+ Bashir examines the patient. Time to diagnose.
2
+
3
+ ## Context Setup
4
+ 1. Read `/docs/methods/FIELD_MEDIC.md` for operating rules
5
+ 2. Read `/logs/build-state.md`, `/logs/assemble-state.md`, `/logs/campaign-state.md`
6
+ 3. Read recent git history: `git log --oneline -20`
7
+
8
+ ## Step 0 — Reconstruct the Timeline (Ezri)
9
+
10
+ Ezri reads the session's history and reconstructs what happened:
11
+
12
+ 1. Read all `/logs/` files — build state, assemble state, campaign state, phase logs
13
+ 2. Read `git log` — all commits from this session/campaign
14
+ 3. Read any error patterns — repeated fixes, reverted changes, multiple attempts
15
+ 4. Produce a timeline: what was attempted, what succeeded, what failed, what required multiple attempts
16
+
17
+ If `$ARGUMENTS` contains `--campaign`, analyze the full campaign history.
18
+ If `$ARGUMENTS` contains `--session`, analyze just this session.
19
+ Default: auto-detect scope from available logs.
20
+
21
+ ## Step 1 — Investigate Root Causes (O'Brien)
22
+
23
+ For each failure, difficulty, or retry identified by Ezri:
24
+
25
+ Classify the root cause:
26
+ - **Methodology gap** — missing step, wrong order, blind spot in the protocol
27
+ - **Tooling limitation** — can't run the app, can't generate assets, missing capability
28
+ - **Communication failure** — agent missed context, wrong file read, lost state
29
+ - **Scope issue** — too much in one mission, wrong grouping, mixed requirement types
30
+ - **Framework-specific** — React render loop, route collision, state management bug
31
+ - **External dependency** — needs credentials, needs user input, needs design assets
32
+
33
+ Map each root cause to the VoidForge component responsible (which command, which agent, which method doc).
34
+
35
+ ## Step 2 — Propose Solutions (Nog)
36
+
37
+ For each root cause, Nog proposes a fix that works within VoidForge's existing framework:
38
+
39
+ - New agent? → name it from the correct universe, define the role
40
+ - New step in existing command? → specify where it goes in the sequence
41
+ - New checklist item? → specify which agent gets it
42
+ - New pattern? → write it with code examples
43
+ - Method doc update? → specify the file and section
44
+
45
+ **Constraint:** All proposals must reference existing VoidForge concepts (agents, phases, commands, patterns). No solutions that require reimagining the system.
46
+
47
+ ## Step 2.5 — Operational Learning Extraction (O'Brien + Nog)
48
+
49
+ After root cause analysis (Step 1) and before writing the report (Step 3), check if any findings are project-scoped operational learnings — facts that matter in future sessions but don't belong in cross-project methodology. See FIELD_MEDIC.md Step 2.5 for full extraction criteria and entry format.
50
+
51
+ For each candidate, draft a structured entry (title, category, verified date, scope, evidence, context). Present to user: *"Bashir found [N] operational learnings worth preserving. Review and approve for LEARNINGS.md?"*
52
+
53
+ Approved entries written to `docs/LEARNINGS.md` (created on first use). Hard cap: 50 active entries.
54
+
55
+ ## Step 2.5b — Promotion Analysis (Wong)
56
+
57
+ After extraction, Wong checks `docs/LESSONS.md` for lesson clusters AND checks `docs/LEARNINGS.md` for promotable entries (appeared in 2+ projects):
58
+ - If 3+ lessons share the same category AND target the same method doc → Wong drafts a specific method doc update
59
+ - Present for user approval: "Wong recommends promoting these lessons into [method doc] [section]: [proposed text]. Approve?"
60
+ - If approved: apply the change, mark lessons as "Promoted to: [doc]" in LESSONS.md
61
+ - If submitting upstream (`--submit`): include the proposed change in the GitHub issue body
62
+
63
+ ## Step 3 — Write the Report (Jake)
64
+
65
+ Produce a structured post-mortem:
66
+
67
+ ```markdown
68
+ # Field Report — [Project Name]
69
+ ## Filed by: Bashir (Post-Mission Analysis)
70
+ ## Date: YYYY-MM-DD
71
+ ## Scope: [campaign / session / specific mission]
72
+
73
+ ### What Happened
74
+ [Timeline from Ezri]
75
+
76
+ ### What Went Wrong
77
+ [Root causes from O'Brien — categorized by type]
78
+
79
+ ### Proposed Fixes
80
+ [Solutions from Nog — with specific file/agent/command references]
81
+
82
+ ### Severity Assessment
83
+ - Methodology flaw (affects all users) vs. edge case (specific project)
84
+ - Frequency: will this happen often or was it unusual?
85
+ - Impact: minutes, hours, or days of rework?
86
+
87
+ ### Files That Should Change in VoidForge
88
+ | File | Proposed Change | Priority |
89
+ |------|----------------|----------|
90
+ ```
91
+
92
+ ## Step 4 — User Review
93
+
94
+ Present the full report. The user can:
95
+ - `[submit]` → create GitHub issue on tmcleod3/voidforge (Step 5)
96
+ - `[save]` → save to `/logs/debrief-YYYY-MM-DD.md`
97
+ - `[edit]` → user modifies before submitting
98
+ - `[skip]` → discard
99
+
100
+ **When `--submit` is specified:** Present the full report, then proceed directly to Step 5 without re-asking "shall I submit?" The flag already signals intent — showing the report fulfills the review obligation, and the user can interrupt with `[edit]` if they spot an issue. Do NOT skip the report presentation step — the user must always see the full report before it goes out. The `--submit` flag enables auto-proceed, not auto-skip.
101
+
102
+ ## Step 5 — Submit to Starfleet (GitHub Issue)
103
+
104
+ If user approves submission:
105
+ 1. Check for `gh` CLI authentication or `github-token` in vault
106
+ 2. **Always submit to `tmcleod3/voidforge`.** Field reports are methodology feedback — they belong upstream regardless of which project found the issue. Use `--repo tmcleod3/voidforge` explicitly.
107
+ 3. Create issue on `tmcleod3/voidforge` with:
108
+ - Title: `Field Report: [one-line summary]`
109
+ - Label: `field-report`
110
+ - Body: the full post-mortem markdown
111
+ 4. Confirm: "Report filed — Starfleet will review. Issue #XX"
112
+
113
+ If `$ARGUMENTS` contains `--dry-run`, generate report but skip submission.
114
+
115
+ ## Privacy
116
+
117
+ The submitted report contains:
118
+ - Session timeline (what commands ran, what findings emerged)
119
+ - Root cause analysis (methodology gaps identified)
120
+ - Proposed solutions (specific VoidForge changes)
121
+
122
+ It does NOT contain:
123
+ - Source code from the user's project
124
+ - Credentials, API keys, or secrets
125
+ - File contents (only file names if relevant to the methodology issue)
126
+ - Personal information
127
+
128
+ The user reviews and approves every word before submission.
129
+
130
+ ## Step 6 — Inbox Mode (--inbox)
131
+
132
+ If `$ARGUMENTS` contains `--inbox`, skip Steps 0-5 and triage incoming field reports instead:
133
+
134
+ 1. **Detect the current repository** via `gh repo view --json nameWithOwner`. Inbox mode reads from the current repo — when triaging, you work on whatever project you're in.
135
+ 2. Fetch open field reports: `gh issue list --repo [current-repo] --label field-report --state open --json number,title,body,createdAt`
136
+ 3. If no open reports → "Bashir's inbox is empty. No field reports pending."
137
+ 4. For each report:
138
+ - Read the full body
139
+ - Extract: severity, root causes, proposed fixes
140
+ - Check which fixes are already shipped (grep the codebase for the proposed changes)
141
+ - Summarize in one line
142
+ 5. Present the inbox:
143
+ ```
144
+ ═══════════════════════════════════════════
145
+ BASHIR'S INBOX — Field Reports
146
+ ═══════════════════════════════════════════
147
+
148
+ [count] open field reports.
149
+
150
+ #N [Title] — [severity]
151
+ Key finding: [one-line summary]
152
+ Status: [N already fixed / N remaining]
153
+
154
+ [triage #N / triage all]
155
+ ═══════════════════════════════════════════
156
+ ```
157
+ 6. When user selects an issue to triage:
158
+ - Read the full issue body
159
+ - For each proposed fix, classify as:
160
+ - `accept` — valid finding, should be implemented
161
+ - `already-fixed` — check the codebase, this was already addressed
162
+ - `wontfix` — edge case, not worth the complexity
163
+ - `needs-info` — can't evaluate without more context
164
+ - For accepted fixes: list the specific file changes with line-level detail
165
+ - Present triage results to user
166
+ - On user approval:
167
+ - Apply accepted fixes (modify method docs, commands, patterns)
168
+ - Comment on the GitHub issue with triage results
169
+ - Close the issue if fully addressed: `gh issue close <number> --comment "Triaged and resolved."`
170
+ 7. After all issues processed, summarize: "Inbox cleared. [N] issues triaged, [N] fixes applied."
171
+
172
+ ## Arguments
173
+ - No arguments → full debrief of current session
174
+ - `--submit` → generate, present for review, then submit as GitHub issue after user approval
175
+ - `--inbox` → read incoming field reports from GitHub, triage and apply fixes (upstream repo only)
176
+ - `--campaign` → analyze the full campaign (all missions)
177
+ - `--session` → analyze just this session
178
+ - `--dry-run` → generate report but don't submit
@@ -0,0 +1,99 @@
1
+ # /deploy — Kusanagi's Deploy Agent
2
+
3
+ > *"The net is vast and infinite. But your code isn't on it until you deploy."*
4
+
5
+ Read `/docs/methods/DEVOPS_ENGINEER.md` for operating rules (see "Deploy Automation" section).
6
+
7
+ ## Context Setup
8
+ 1. Read PRD frontmatter for `deploy:` target (vps, vercel, railway, docker, static, cloudflare)
9
+ 2. Read `/logs/deploy-state.md` — if exists, check last deploy status
10
+ 3. Read `.env` or vault for deploy credentials (SSH_HOST, SSH_KEY_PATH, VERCEL_TOKEN, etc.)
11
+ 4. Check `git status` — refuse to deploy with uncommitted changes
12
+
13
+ ## Step 1 — Target Detection (Kusanagi)
14
+
15
+ Read deploy target from PRD frontmatter. If not specified, scan for evidence:
16
+ - `vercel.json` or `.vercel/` → Vercel
17
+ - `railway.json` or `railway.toml` → Railway
18
+ - `Dockerfile` or `docker-compose.yml` → Docker
19
+ - `SSH_HOST` in .env or vault → VPS/EC2
20
+ - `wrangler.toml` → Cloudflare Workers/Pages
21
+ - None found → ask: "Where should this deploy? [vps/vercel/railway/docker/static]"
22
+
23
+ ## Step 2 — Pre-Deploy Checks (Levi)
24
+
25
+ Levi verifies the deploy is safe:
26
+ 1. **Build passes:** `npm run build` (or equivalent) must succeed
27
+ 2. **Tests pass:** `npm test` must pass (if test suite exists)
28
+ 3. **No uncommitted changes:** `git status` clean
29
+ 4. **Credentials available:** SSH key, API token, or platform credentials accessible
30
+ 5. **Version tagged:** Current version from VERSION.md matches the commit being deployed
31
+ 6. If any check fails → ABORT with clear error message
32
+
33
+ ## Step 3 — Deploy Execution (Levi)
34
+
35
+ Execute the deploy strategy for the detected target:
36
+
37
+ **VPS/EC2:**
38
+ ```
39
+ 1. ssh -i $KEY $USER@$HOST "cd /opt/app && git pull origin main"
40
+ 2. ssh ... "npm ci --production"
41
+ 3. ssh ... "npx prisma migrate deploy" (if Prisma detected)
42
+ 4. ssh ... "npm run build"
43
+ 5. ssh ... "pm2 restart ecosystem.config.js" (or systemd restart)
44
+ ```
45
+
46
+ **Vercel:** `vercel --prod --token $VERCEL_TOKEN`
47
+ **Railway:** `railway up` or git push to Railway remote
48
+ **Docker:** `docker build -t app . && docker push && ssh ... "docker pull && docker restart"`
49
+ **Static/Cloudflare:** `wrangler deploy` or S3 sync
50
+
51
+ ## Step 4 — Health Check (L)
52
+
53
+ After deploy completes:
54
+ 1. Wait 10 seconds for service startup
55
+ 2. Curl the health endpoint: `curl -sf https://$DEPLOY_URL/api/health` or the root URL
56
+ 3. Verify HTTP 200 response within 30 seconds
57
+ 4. If health check fails → Step 5 (rollback)
58
+ 5. If healthy → log success to deploy-state.md
59
+
60
+ ## Step 5 — Rollback (Valkyrie)
61
+
62
+ If health check fails:
63
+ 1. **VPS:** `ssh ... "git checkout HEAD~1 && npm ci && npm run build && pm2 restart"`
64
+ 2. **Vercel:** `vercel rollback --token $VERCEL_TOKEN`
65
+ 3. **Docker:** `ssh ... "docker restart [previous-image]"`
66
+ 4. Re-run health check on rolled-back version
67
+ 5. Log rollback to deploy-state.md with timestamp and reason
68
+
69
+ ## Step 6 — Report
70
+
71
+ ```
72
+ ═══════════════════════════════════════════
73
+ DEPLOY COMPLETE
74
+ ═══════════════════════════════════════════
75
+ Target: [vps | vercel | railway | docker]
76
+ URL: https://your-app.com
77
+ Version: v2.9.0
78
+ Commit: abc123
79
+ Health: ✓ 200 OK (142ms)
80
+ Timestamp: 2026-03-22T12:00:00Z
81
+ ═══════════════════════════════════════════
82
+ ```
83
+
84
+ Update `/logs/deploy-state.md` with deploy results.
85
+
86
+ ## Arguments
87
+ - No arguments → detect target and deploy
88
+ - `--staging` → deploy to staging/preview (if target supports it)
89
+ - `--rollback` → rollback to previous deploy
90
+ - `--status` → show current deploy state without deploying
91
+ - `--dry-run` → show what would be deployed without executing
92
+
93
+ ## Safety Rails
94
+ - Never deploy with uncommitted changes
95
+ - Never deploy without a passing build
96
+ - Always health check after deploy
97
+ - Always rollback on health check failure
98
+ - Deploy log with timestamps for audit trail
99
+ - In blitz mode at campaign end: auto-deploy after Victory Gauntlet passes
@@ -0,0 +1,143 @@
1
+ # /devops — Kusanagi's Infrastructure & Deploy
2
+
3
+ ## Context Setup
4
+ 1. Read `/logs/build-state.md` — understand current project state
5
+ 2. Read `/docs/PRD.md` frontmatter — check `deploy` value to determine target
6
+ 3. Read `/docs/methods/DEVOPS_ENGINEER.md`
7
+
8
+ ## Agent Deployment Manifest
9
+
10
+ **Lead:** Kusanagi (Anime — Ghost in the Shell)
11
+
12
+ **Core team (always deployed):**
13
+ - **Senku** (Dr. Stone) — provisioning: server setup, dependencies, runtime, idempotent scripts
14
+ - **Levi** (Attack on Titan) — deployment: process management, zero-downtime, rollback scripts
15
+ - **Spike** (Cowboy Bebop) — networking: reverse proxy, DNS, TLS, firewall, CORS headers
16
+ - **L** (Death Note) — monitoring: health checks, uptime, alerting, log aggregation
17
+ - **Bulma** (Dragon Ball) — backup: database dumps, file backup, retention, restore testing
18
+ - **Holo** (Spice & Wolf) — cost: resource sizing, instance selection, cost estimation, optimization
19
+
20
+ **Extended team (deployed on full infra reviews):**
21
+ - **Valkyrie** (Marvel/Anime crossover) — disaster recovery: failover, data center redundancy, RTO/RPO
22
+ - **Vegeta** (Dragon Ball) — scaling: horizontal scaling, load balancing, auto-scaling policies
23
+ - **Trunks** (Dragon Ball) — migration: database migration strategy, zero-downtime schema changes
24
+ - **Mikasa** (Attack on Titan) — security hardening: SSH config, fail2ban, unattended upgrades
25
+ - **Erwin** (Attack on Titan) — strategy: multi-environment management, staging/production parity
26
+ - **Mustang** (FMA) — orchestration: Docker Compose, container networking, service discovery
27
+ - **Olivier** (FMA) — cold region: CDN configuration, edge caching, geographic distribution
28
+ - **Hughes** (FMA) — documentation: runbook writing, infrastructure diagrams, onboarding docs
29
+ - **Calcifer** (Ghibli) — energy: resource efficiency, idle scaling, sleep/wake optimization
30
+ - **Duo** (Gundam) — CI/CD: GitHub Actions, pipeline design, automated testing in deploy
31
+
32
+ ## Deploy Target Branching
33
+
34
+ The infrastructure sequence adapts based on `deploy` in PRD frontmatter:
35
+
36
+ | Target | Senku | Levi | Spike | L | Bulma |
37
+ |--------|-------|------|-------|---|-------|
38
+ | `vps` | Full provision.sh | PM2 + deploy.sh | Caddy/Nginx + DNS | Health + uptime | DB backup + cron |
39
+ | `vercel` | Skip | `vercel.json` config | DNS only | Vercel analytics | Vercel Postgres backup |
40
+ | `railway` | Skip | railway.toml config | DNS only | Railway metrics | Railway backup |
41
+ | `docker` | Dockerfile + compose | docker-compose deploy | Traefik/Caddy | Container health | Volume backup |
42
+ | `static` | Skip | Static hosting config | DNS + CDN | Uptime monitor only | Skip |
43
+
44
+ ## Sequence — VPS (full)
45
+
46
+ ### Senku — Provisioning
47
+ Create `/scripts/provision.sh`:
48
+ - System updates, tools, runtime (Node/Python/Ruby per stack)
49
+ - Database (Postgres/MySQL), Redis if needed
50
+ - Reverse proxy (Caddy preferred), process manager (PM2)
51
+ - App user (non-root), firewall (22/80/443 only), fail2ban
52
+ - Log rotation, swap, unattended security upgrades
53
+ - Script must be idempotent — safe to run twice
54
+
55
+ ### Levi — Deployment
56
+ Create `/scripts/deploy.sh`:
57
+ - Pull latest code → `npm ci` → generate ORM → migrate → build → reload PM2 → health check
58
+ - Auto-rollback on health check failure
59
+ - Create `/scripts/rollback.sh` for manual rollback
60
+
61
+ ### Spike — Networking
62
+ - Caddyfile or nginx config with HTTPS, gzip, security headers
63
+ - SSL auto-renewal
64
+ - DNS records documented
65
+ - SPF/DKIM/DMARC for email sending
66
+
67
+ ### PM2 Config
68
+ Create `ecosystem.config.js`:
69
+ - Web: cluster mode (>= 2 instances), memory limit
70
+ - Workers: fork mode, memory limit
71
+ - Auto-start on reboot (`pm2 startup` + `pm2 save`)
72
+
73
+ ### L — Monitoring
74
+ - Health endpoint: `/api/health` checking DB, Redis (if used), disk space
75
+ - External uptime monitor (document which service)
76
+ - Structured request logging (method, path, status, duration)
77
+ - Error tracking integration
78
+ - Slow query logging (>1s)
79
+ - Alerts: CPU >80%, Memory >85%, Disk >80%
80
+
81
+ ### Bulma — Backup
82
+ Create `/scripts/backup-db.sh`:
83
+ - Compressed database dump
84
+ - Upload to off-site storage (R2/S3)
85
+ - 30-day retention, auto-cleanup
86
+ - Daily cron job
87
+ - **Test restore at least once** — document the procedure
88
+
89
+ ### Holo — Cost
90
+ Document in `/docs/INFRASTRUCTURE.md`:
91
+ - Monthly hosting cost
92
+ - Per-user cost at current and projected scale
93
+ - Most expensive service
94
+ - Right-sizing recommendations
95
+
96
+ ## First-Deploy Pre-flight Checklist
97
+
98
+ Before the first production deployment:
99
+
100
+ - [ ] All environment variables set on server (compare against .env.example)
101
+ - [ ] Secrets are production values (not dev/test keys)
102
+ - [ ] Database created and accessible from server
103
+ - [ ] Database seeded with required initial data (admin user, default config)
104
+ - [ ] DNS records pointed to server IP
105
+ - [ ] SSL certificate provisioned (or auto-provision configured)
106
+ - [ ] Firewall rules active (22/80/443 only)
107
+ - [ ] Health check endpoint responds correctly
108
+ - [ ] Deploy script tested on a staging environment first (if available)
109
+ - [ ] Rollback script tested
110
+ - [ ] Backup script runs successfully
111
+ - [ ] Monitoring alerts configured and tested
112
+ - [ ] Error tracking receives test errors
113
+ - [ ] Kenobi has reviewed server security configuration
114
+
115
+ Log all results to `/logs/phase-12-deploy.md`.
116
+
117
+ ## Post-Deploy Smoke Tests
118
+
119
+ After the first production deployment (and after each subsequent deploy), verify the application works at runtime — not just the infrastructure:
120
+
121
+ - **Health check:** `/api/health` returns 200 (already in checklist above)
122
+ - **Primary user flow:** Execute the core journey against the production URL via curl/fetch — verify end-to-end
123
+ - **File serving:** If the app serves uploaded files (via proxy, CDN, or storage), upload a test file and fetch its URL — verify HTTP 200 + correct content-type
124
+ - **Error handling:** Submit intentionally invalid data to a form endpoint — verify the error response is specific (not a generic 500)
125
+ - **Auth flow:** If auth exists, verify login → authenticated request → logout works against production
126
+ - **Cross-module paths:** Verify any URL/key/path patterns generated by the app are accepted by their serving endpoints in production
127
+
128
+ If any smoke test fails, halt the deploy and run `/scripts/rollback.sh` before investigating.
129
+
130
+ ## Deliverables
131
+ 1. /scripts/ (provision.sh, deploy.sh, rollback.sh, backup-db.sh)
132
+ 2. /docs/RUNBOOK.md — operational procedures for 3am debugging
133
+ 3. /docs/INFRASTRUCTURE.md — server inventory, DNS, costs
134
+ 4. ecosystem.config.js (or equivalent)
135
+ 5. Reverse proxy config
136
+ 6. Cron jobs documented
137
+ 7. Monitoring configured
138
+
139
+ ## Handoffs
140
+ - Code bugs found during deploy → Batman, log to `/logs/handoffs.md`
141
+ - Security config review → Kenobi, log to `/logs/handoffs.md`
142
+ - Scaling architecture → Picard, log to `/logs/handoffs.md`
143
+ - App performance issues → Stark, log to `/logs/handoffs.md`
@@ -0,0 +1,140 @@
1
+ # /gauntlet — Thanos's Comprehensive Review
2
+
3
+ *"I am inevitable."*
4
+
5
+ The Gauntlet tests everything. Every domain. Multiple rounds. Escalating intensity. The project either survives or it doesn't. This is NOT a build command — it assumes code is already written. Run it after `/build` or `/campaign` to put the finished product through absolute hell.
6
+
7
+ ## Context Setup
8
+ 1. Read `/docs/methods/GAUNTLET.md` for operating rules
9
+ 2. Read `/logs/build-state.md` — what was built, what phases completed
10
+ 3. Read `/docs/PRD.md` — the source of truth for what the project should be
11
+
12
+ ## Round 1 — Discovery (parallel)
13
+
14
+ **Thanos:** "Before I test, I must understand."
15
+
16
+ Use the Agent tool to run all five in parallel — these are read-only analysis:
17
+
18
+ - **Agent 1 (Picard — Architecture):** Schema review, service boundaries, dependency graph, scaling assessment. Read the full `/architect` protocol but produce findings only (no ADRs — this is review, not design).
19
+ - **Agent 2 (Stark — Code Review):** Pattern compliance, logic errors, type safety, cross-module data flow tracing. Read `/review` protocol. One pass across all source files.
20
+ - **Agent 3 (Galadriel — UX Surface Map):** Product surface map, usability walkthrough (Step 1.5), Éowyn's enchantment scan (Step 1.75). No fixes yet — discovery only.
21
+ - **Agent 4 (Kenobi — Attack Surface Inventory):** List all endpoints, WebSocket handlers, file I/O, credential access points, user input parsing. Classify each by risk tier. No deep audit yet — just the map.
22
+ - **Agent 5 (Kusanagi — Infrastructure Discovery):** Scan deploy scripts, generated configs, provisioning scripts, CI/CD templates. Classify each by risk: hardcoded credentials, open ports, missing auth on generated services. No deep audit yet — just the map.
23
+
24
+ Synthesize all five into a unified findings list. Log to `/logs/gauntlet-round-1.md`.
25
+
26
+ ## Round 2 — First Strike (parallel)
27
+
28
+ **Thanos:** "Now I test every stone."
29
+
30
+ Use the Agent tool to run all four in parallel — full domain audits:
31
+
32
+ - **Agent 1 (Batman — Full QA):** Run the complete `/qa` protocol. Oracle + Red Hood + Alfred + Deathstroke + Constantine + Nightwing + Lucius. Every edge case, every error state, every boundary.
33
+ - **Agent 2 (Galadriel — Full UX):** Run the complete `/ux` protocol. Elrond + Arwen + Samwise + Bilbo + Legolas + Gimli + Radagast + Éowyn. Usability, visual, a11y, copy, performance, edge cases, enchantment.
34
+ - **Agent 3 (Kenobi — Full Security):** Run the complete `/security` protocol. Leia + Chewie + Rex + Maul parallel scans, then Yoda → Windu → Ahsoka → Padmé sequential audits.
35
+ - **Agent 4 (Stark — Integration Tracing):** For every API endpoint, trace the full data path: client request → validation → service → database → response. For every file upload, trace: upload → storage → retrieval → display. For every credential, trace: entry → vault → usage → cleanup.
36
+
37
+ Merge all findings. Deduplicate across domains.
38
+
39
+ **→ FIX BATCH 1:** Fix all Critical and High findings. Update finding status. **Build-output gate:** If the project has a build step, run the build after fixes and verify output — framework-generated inline scripts, hydration markers, and SSR output are invisible to source-level analysis but can be broken by security hardening (especially CSP changes). Check: `npm run build && grep -c '<script>' dist/**/*.html`.
40
+
41
+ ## Round 2.5 — Runtime Smoke Test (Hawkeye)
42
+
43
+ If the project has a runnable server, start it and verify the full lifecycle:
44
+ 1. Start the server (`npm run dev`, `python manage.py runserver`, etc.)
45
+ 2. Hit every new/modified API endpoint with curl — verify HTTP status codes
46
+ 3. If WebSocket endpoints exist, open a connection and verify handshake + data flow
47
+ 4. If terminal/PTY features exist, create a session and verify it stays alive for 5 seconds
48
+ 5. If the server cannot start (scaffold/methodology-only), skip with a note
49
+
50
+ This catches runtime bugs invisible to static analysis: IPv6 binding, native module ABI, WebSocket framing, browser caching.
51
+
52
+ ## Round 3 — Second Strike (parallel)
53
+
54
+ **Thanos:** "The first wave reveals. The second wave breaks."
55
+
56
+ Use the Agent tool to run all four in parallel — targeted re-verification:
57
+
58
+ - **Agent 1 (Batman — Re-probe):** Nightwing re-runs the test suite. Red Hood re-probes fixed areas. Deathstroke tests new boundaries created by the fixes. Focus on regressions.
59
+ - **Agent 2 (Galadriel — Error States + Re-verify):** Samwise re-audits a11y on all modified components. Radagast re-checks edge cases on fixed flows. Bilbo re-checks microcopy on any changed UI.
60
+ - **Agent 3 (Kenobi — Re-probe + Access Control):** Maul re-probes all remediated vulnerabilities. Ahsoka verifies access control across every role boundary. Padmé verifies the primary user flow still works (critical path smoke test).
61
+ - **Agent 4 (Kusanagi — DevOps):** Run the complete `/devops` protocol with full team: Senku (provisioning), Levi (deploy), Spike (networking), L (monitoring), Bulma (backup), Holo (cost), Valkyrie (disaster recovery). Deploy scripts, monitoring, backups, health checks, page weight gate, security headers.
62
+
63
+ **→ FIX BATCH 2:** Fix remaining findings.
64
+
65
+ ## Round 4 — The Crossfire (parallel — adversarial)
66
+
67
+ **Thanos:** "Now the real test. Everyone attacks everyone else's work."
68
+
69
+ Use the Agent tool to run all five in parallel — pure adversarial:
70
+
71
+ - **Maul** (Star Wars) — Attacks code that passed /review. Looks for exploits in "clean" code.
72
+ - **Deathstroke** (DC) — Probes endpoints that /security hardened. Tests if remediations can be bypassed.
73
+ - **Loki** (Marvel) — Chaos-tests features that /qa cleared. What breaks under unexpected conditions?
74
+ - **Constantine** (DC) — Hunts cursed code in FIXED areas specifically. Code that only works by accident.
75
+ - **Éowyn** (Tolkien) — Final enchantment pass on the polished, hardened product. Where can delight still be added without compromising security or stability?
76
+
77
+ **→ FIX BATCH 3:** Fix all adversarial findings. If any fix is applied, re-run the affected adversarial agent on the fixed area only.
78
+
79
+ ## Round 5 — The Council (parallel — convergence)
80
+
81
+ **Thanos:** "One last look. Every domain. One voice."
82
+
83
+ Use the Agent tool to run all six in parallel:
84
+
85
+ - **Spock** (Star Trek) — Did any QA/security/UX fix break code patterns or quality?
86
+ - **Ahsoka** (Star Wars) — Did any fix introduce access control gaps?
87
+ - **Nightwing** (DC) — Full regression: run the entire test suite. Any failures?
88
+ - **Samwise** (Tolkien) — Final accessibility audit on all modified components.
89
+ - **Padmé** (Star Wars) — Critical path functional verification. Open the app, complete the main task, verify output.
90
+ - **Troi** (Star Trek) — PRD compliance: read the PRD prose section-by-section, verify every claim against the implementation. Numeric claims, visual treatments, copy accuracy.
91
+
92
+ If the Council finds issues:
93
+ 1. Fix code discrepancies. Flag asset requirements as BLOCKED.
94
+ 2. Re-run the Council (max 2 iterations).
95
+ 3. If not converged after 2 rounds, present remaining findings to the user.
96
+
97
+ ## The Snap — Thanos's Verdict
98
+
99
+ **If all domains sign off:**
100
+ > *"I am inevitable. The project survives the Gauntlet."*
101
+
102
+ Present the final summary:
103
+ - Total findings across all 5 rounds
104
+ - Total fixes applied
105
+ - Findings by domain (QA, UX, Security, Architecture, DevOps)
106
+ - Test suite status
107
+ - Outstanding items (if any)
108
+
109
+ **Wong extracts lessons:** Append notable patterns to `/docs/LESSONS.md`.
110
+
111
+ **If findings remain:**
112
+ Present them with severity and recommendation. The user decides whether to ship or iterate.
113
+
114
+ ## Arguments
115
+ - No arguments → full 5-round gauntlet
116
+ - `--fast` → 3 rounds only (skip Round 4 Crossfire + Round 5 Council). (formerly `--quick` — renamed v17.3 for cross-command consistency)
117
+ - `--security-only` → 4 rounds of security only (Kenobi marathon)
118
+ - `--ux-only` → 4 rounds of UX only (Galadriel marathon)
119
+ - `--qa-only` → 4 rounds of QA only (Batman marathon)
120
+ - `--resume` → resume from last completed round (reads gauntlet state from logs)
121
+ - `--ux-extra` → Extra Éowyn enchantment emphasis across all rounds. Galadriel's team proposes micro-animations, copy improvements, and delight moments beyond standard usability/a11y.
122
+ - `--assess` → **Pre-build assessment.** Rounds 1-2 only (Discovery + First Strike), no fix batches. Produces assessment report grouped by root cause. For evaluating existing codebases before a rebuild or migration — not for post-build hardening. See also `/assess` command which chains this with architecture review and PRD gap analysis.
123
+ - `--infinity` → **The Infinity Gauntlet.** 10 rounds (2x full pass). Every active agent deployed as its own dedicated sub-process — not combined, not summarized. ~60-80 agent launches across all 9 universes. The full ~110 active roster called off the bench. See GAUNTLET.md "The Infinity Gauntlet" section for the complete wave structure. Use after completing a major version or before first production ship.
124
+ - `--muster` → Synonym for `--infinity`. The Gauntlet already deploys the full roster at maximum intensity — `--muster` is the universal flag name for the same concept. **ENFORCEMENT: Must launch Agent tool sub-processes. Inline analysis is not a Muster.**
125
+
126
+ ## Operating Rules
127
+ - Update `/logs/gauntlet-state.md` after EVERY round
128
+ - The Gauntlet does NOT build code — it reviews and hardens existing code
129
+ - Fixes happen BETWEEN rounds, not batched at the end
130
+ - **Confidence scoring is mandatory.** Every finding must include: ID, severity, confidence score (0-100), file, description, fix recommendation. Format: `[ID] [SEVERITY] [CONFIDENCE: XX] [FILE] [DESCRIPTION]`. See GAUNTLET.md "Agent Confidence Scoring" for ranges.
131
+ - **Low-confidence escalation:** Findings below 60 confidence MUST be escalated to a second agent from a different universe before inclusion. If the second agent disagrees, drop the finding. If the second agent agrees, upgrade to medium confidence.
132
+ - **High-confidence fast-track:** Findings at 90+ confidence skip re-verification in Pass 2.
133
+ - If context pressure symptoms appear, ask user to run `/context`. Only checkpoint at >70%. NEVER reduce Gauntlet rounds, skip agents, or "run efficiently" based on self-assessed context pressure. See CAMPAIGN.md "Quality Reduction Anti-Pattern" — this is a hard rule.
134
+ - The Gauntlet is the final test before shipping. Treat it with appropriate gravity.
135
+
136
+ ## Handoffs
137
+ - If architecture changes are needed → log for Picard
138
+ - If new tests are needed → log for Batman (`/test`)
139
+ - If deploy config changes are needed → log for Kusanagi (`/devops`)
140
+ - At completion, offer Bashir (`/debrief`) to capture session learnings