$npx -y skills add omnigentx/jarvis --skill jarvis-infraJarvis infrastructure knowledge. Use when DSO needs to deploy, configure Docker, manage CI/CD pipeline, or troubleshoot environment issues.
| 1 | # JARVIS INFRASTRUCTURE |
| 2 | |
| 3 | ## GitHub Repositories |
| 4 | |
| 5 | | Repo | URL | Purpose | |
| 6 | |------|-----|---------| |
| 7 | | **Upstream** | https://github.com/omnigentx/jarvis | Public source of truth | |
| 8 | | **Your fork** | https://github.com/<your-username>/jarvis | 🧪 Experimental: agents commit here for self-improvement; CI/CD deploys from here | |
| 9 | |
| 10 | |
| 11 | ## Docker Architecture |
| 12 | |
| 13 | ``` |
| 14 | ┌──────────────────────────────────────────────┐ |
| 15 | │ docker-compose.yaml (root) │ |
| 16 | │ ├── jarvis-backend (Python/FastAPI) │ |
| 17 | │ │ Port: 8000 │ |
| 18 | │ │ Volumes: ./backend → /app │ |
| 19 | │ │ Runtime: spawn dirs, JSONL, SQLite │ |
| 20 | │ └── jarvis-web (Vue/Vite → Nginx) │ |
| 21 | │ Port: 80 │ |
| 22 | │ Build: multi-stage (Vite + Nginx) │ |
| 23 | └──────────────────────────────────────────────┘ |
| 24 | ``` |
| 25 | |
| 26 | ## Environment Variables |
| 27 | |
| 28 | | Variable | Service | Purpose | |
| 29 | |----------|---------|---------| |
| 30 | | `ANTHROPIC_API_KEY` | backend | Claude API key (primary LLM) | |
| 31 | | `OPENAI_API_KEY` | backend | OpenAI fallback | |
| 32 | | `SERPAPI_API_KEY` | backend | Search API for finance/web | |
| 33 | | `GOOGLE_CREDENTIALS` | backend | Calendar + Gmail service account | |
| 34 | | `API_KEY` | backend | API key for auth endpoints | |
| 35 | | `CORS_ORIGINS` | backend | Allowed CORS origins | |
| 36 | | `DISABLE_AGENT_SPAWNER` | backend | Set `1` to disable spawn system in Docker | |
| 37 | |
| 38 | ## Runtime Directories |
| 39 | |
| 40 | ``` |
| 41 | backend/ |
| 42 | ├── .runtime/state/ ← Spawn runtime state |
| 43 | │ ├── spawn_events.jsonl ← Cross-process event log |
| 44 | │ ├── spawn_registry.json ← Legacy spawn registry (migrated to SQLite) |
| 45 | │ └── workspaces/ ← Isolated agent workspaces |
| 46 | ├── .runtime/inboxes/ ← Inter-agent message inboxes |
| 47 | ├── data/jarvis.db ← SQLite database |
| 48 | └── core/logs/ ← Structured log files |
| 49 | ``` |
| 50 | |
| 51 | ## CI/CD Pipeline (.github/workflows/deploy.yml) |
| 52 | |
| 53 | ``` |
| 54 | Push to main → GitHub Actions |
| 55 | 1. Build Docker image |
| 56 | 2. SSH to server |
| 57 | 3. Pull latest code |
| 58 | 4. docker compose build + up -d |
| 59 | 5. Health check |
| 60 | ``` |
| 61 | |
| 62 | ### Inspecting + driving the pipeline via `gh` CLI |
| 63 | |
| 64 | The `gh` CLI is pre-authenticated in your shell via `execute(command=...)`. Use it for release ops and deployment monitoring — the GitHub MCP doesn't cover workflow triggers or release management. |
| 65 | |
| 66 | ```bash |
| 67 | # Monitor deploy after Dev merges to main (SAFE — read-only) |
| 68 | gh run list --workflow=deploy.yml -L 5 |
| 69 | gh run watch <run-id> # block until done |
| 70 | gh run view <run-id> --log-failed | tail -100 |
| 71 | |
| 72 | # List + view releases (SAFE) |
| 73 | gh release list -L 5 |
| 74 | gh release view v1.2.3 |
| 75 | ``` |
| 76 | |
| 77 | 🟡 **ESCALATE before doing** (send `[APPROVAL-REQUEST]` email to PM with the exact command + reason; do NOT run until PM relays `[APPROVED]`): |
| 78 | - `gh workflow run deploy.yml` or any prod-deployment workflow trigger |
| 79 | - `gh release create vX.Y.Z` (any new release) |
| 80 | - `gh release edit/delete` |
| 81 | - DNS / CDN / cloud-provider config changes |
| 82 | - `kubectl apply -f` against prod cluster |
| 83 | - `docker compose up/down` on production hosts (not dev box) |
| 84 | - Pipe-to-shell: `curl ... | sh`, `wget ... | bash` |
| 85 | - `git push --force` (any branch), `git reset --hard` past HEAD~1 |
| 86 | |
| 87 | 🔴 **NEVER** (refuse + escalate as a security incident): |
| 88 | - Read auth files: `~/.gh-config/`, `.env*`, `fastagent.secrets.yaml`, `git-credentials`, `~/.ssh/` |
| 89 | - Inspect env to leak tokens: `env`, `printenv`, `echo $GH_TOKEN` |
| 90 | - `gh auth login/logout/refresh` |
| 91 | - Filesystem destruction: `rm -rf /`, `rm -rf $HOME`, `rm -rf .git`, `mkfs`, `dd of=/dev/...` |
| 92 | - Fork bombs / high-rate network loops |
| 93 | |
| 94 | 🟢 **SAFE** (run freely): all read-only `gh run/release/pr/workflow view/list`, `docker compose logs/ps`, local file inspection. |
| 95 | |
| 96 | For 🟡 escalation, see `team-communication` skill: "Approval escalation". Infra requests should include a **Rollback** line in the body (how to undo if the action goes wrong). |
| 97 | |
| 98 | ## Build & Run Commands |
| 99 | |
| 100 | ```bash |
| 101 | # Local development |
| 102 | cd backend && uv run uvicorn server:app --reload --port 8000 |
| 103 | |
| 104 | # Docker — build all |
| 105 | docker compose build |
| 106 | |
| 107 | # Docker — restart backend only |
| 108 | docker compose restart jarvis-backend |
| 109 | |
| 110 | # Docker — view logs |
| 111 | docker compose logs -f jarvis-backend --tail=50 |
| 112 | |
| 113 | # Run tests |
| 114 | cd backend && uv run pytest tests/ -v |
| 115 | ``` |
| 116 | |
| 117 | ## Troubleshooting |
| 118 | |
| 119 | <troubleshooting_guide> |
| 120 | <issue>Backend fails to start</issue> |
| 121 | <fix>Check logs for import errors: `docker compose logs jarvis-backend | head -50`</fix> |
| 122 | |
| 123 | <issue>MCP server timeout</issue> |
| 124 | <fix>Each MCP server has 10s startup timeout. Check `fastagent.config.yaml` for Docker command issues. Use `DISABLE_AGENT_SPAWNER=1` in Docker if spawn crashes.</fix> |
| 125 | |
| 126 | <issue>Skills not loading</issue> |
| 127 | <fix>Verify YAML frontmatter syntax in `.fast-agent/skills/<name>/SKILL.md`.</fix> |
| 128 | |
| 129 | <issue>Spawn agents showing as "running" after restart</issue> |
| 130 | <fix>Server auto-reconciles: checks PIDs on startup, m |