restart-service
Skill0 starsChanged 5 months agoMITView on GitHub
Fully restart the AgentForge backend (Fastify) and UI (Vite) dev services. Use when the user says "restart the services", "restart dev", "/restart-service", or when the stack is stuck and needs a clean bounce.
- Reads credentials
- Deletes or force-pushes
- Installs packages
In this repository3 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- adapt-linear-issueSkill
- create-linear-issueSkill
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 4 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 13
Use Node 22 via nvm: run nvm use (the repo ships a .nvmrc pinning Node 22.
- Distinctive: line 22
Run these in parallel where possible:
- Distinctive: line 34
Verify no dev processes remain:
- Very specific: line 40
Must print 0. If not, repeat pkill -9 with the specific PIDs.
- Very specific: line 48
If empty or shows Exited:
- Very specific: line 55
If the container doesn't exist at all, create it (matches the quickstart in foundry/README.md):
- Distinctive: line 70
Only run these if they would otherwise fail -- check first, don't blindly reinstall.
- Very specific: line 76
If the Prisma schema is ahead of the DB (e.g.
- Distinctive: line 84
Run from the repo root, in the background (it's long-running):
- Very specific: line 90
Use block_until_ms: 0 so the shell tool backgrounds it immediately and writes to the terminal log file.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Restart AgentForge Dev Services
Perform a clean bounce of the backend and UI. Follow the steps in order and stop if any mandatory step fails.
Environment
- Use Node 22 via nvm: run
nvm use(the repo ships a.nvmrcpinning Node 22; the script enforces >=22.12 / arm64 on Apple Silicon). - Backend port:
3100 - UI port:
5173 - Postgres: Docker container named
agentforge-postgresonlocalhost:5433(matches the defaultDATABASE_URLinfoundry/.env.example).
Steps
1. Kill all existing dev processes
Run these in parallel where possible:
pkill -9 -f "tsx watch" 2>/dev/null
pkill -9 -f "node.*vite" 2>/dev/null
pkill -9 -f "scripts/dev.mjs" 2>/dev/null
sleep 2
# also free the ports if anything stale is still holding them
lsof -tiTCP:3100 -sTCP:LISTEN | xargs -r kill -9 2>/dev/null
lsof -tiTCP:5173 -sTCP:LISTEN | xargs -r kill -9 2>/dev/nullVerify no dev processes remain:
ps aux | grep -E "tsx watch|node.*vite|dev\.mjs" | grep -v grep | wc -lMust print 0. If not, repeat pkill -9 with the specific PIDs.
2. Ensure Postgres is running
docker ps --filter "name=agentforge-postgres" --format "{{.Status}}"If empty or shows Exited:
docker start agentforge-postgres
sleep 3If the container doesn't exist at all, create it (matches the quickstart in foundry/README.md):
docker volume create agentforge_pg_data
docker run -d --name agentforge-postgres --restart unless-stopped \
-e POSTGRES_USER=postgres \
-e POSTGRES_PASSWORD=postgres \
-e POSTGRES_DB=ai_orchestrator \
-p 5433:5432 \
-v agentforge_pg_data:/var/lib/postgresql/data \
postgres:163. Verify backend prerequisites
Only run these if they would otherwise fail -- check first, don't blindly reinstall.
foundry/.envexists. If missing:cp foundry/.env.example foundry/.envfoundry/node_modules/exists. If missing:cd foundry && pnpm install --ignore-scriptsfoundry/src/generated/prisma/client.jsexists (Prisma client is generated). If missing OR if the schema changed recently:cd foundry && npx prisma generate
If the Prisma schema is ahead of the DB (e.g. new columns causing PrismaClientValidationError: Unknown argument), sync the DB:
cd foundry && npx prisma db push && npx prisma generate4. Start the dev server
Run from the repo root, in the background (it's long-running):
nvm use && npm run devUse block_until_ms: 0 so the shell tool backgrounds it immediately and writes to the terminal log file.
5. Verify both services respond
Wait ~10 seconds, then:
curl -s -o /dev/null -w "backend: %{http_code}\n" http://localhost:3100/health
curl -s -o /dev/null -w "ui: %{http_code}\n" http://localhost:5173/Both must return 200. If either returns 000, read the terminal log file, strip ANSI (sed 's/\x1b\[[0-9;]*m//g'), and diagnose.
6. (Optional) Verify LAN / VPN exposure
The UI is configured in ui/vite.config.ts with server.host: true. The backend binds to 0.0.0.0:3100 in foundry/src/server.ts. If the user has set up a LAN/VPN hostname (Tailscale, ngrok, etc.) and asks for it to be verified, they should provide the hostname; then:
# replace $HOSTNAME with the user-provided value
curl -s -o /dev/null -w "remote backend: %{http_code}\n" http://$HOSTNAME:3100/health
curl -s -o /dev/null -w "remote ui: %{http_code}\n" http://$HOSTNAME:5173/Both must return 200. If the UI returns 403, add the hostname to ui/vite.config.ts server.allowedHosts.
Common failure modes and fixes
| Symptom | Fix |
EADDRINUSE :3100 on startup | A zombie tsx process is holding the port. Kill via lsof -tiTCP:3100 -sTCP:LISTEN | xargs kill -9, then retry from step 4. |
Backend proxy errors ECONNREFUSED in UI log | Transient during startup -- backend not ready yet. Ignore unless they persist >10s after backend logs "Server listening". |
PrismaClientValidationError: Unknown argument | Schema/DB drift. Run npx prisma db push && npx prisma generate, then restart. |
P1001: Can't reach database server at localhost:5433 | Postgres container is down. See step 2. |
Cannot find module '.../tsx/dist/preflight.cjs' | node_modules is corrupted (usually from an aborted pnpm install). Run rm -rf foundry/node_modules && cd foundry && pnpm install --ignore-scripts. |
error: 'Mock: Issue <id> not found' at startup backfill | Benign. Only occurs in mock mode when DB has runs referencing Linear issue IDs the mock client doesn't know. Server continues normally. |
Final report
When complete, report:
- Local URLs:
http://localhost:3100(backend/health) andhttp://localhost:5173/(UI) - Any optional remote URLs verified in step 6
- Any non-fatal warnings from the log
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

