@arthai/agents 1.0.4 → 1.0.6
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/README.md +55 -3
- package/VERSION +1 -1
- package/agents/troubleshooter.md +132 -0
- package/bin/cli.js +366 -0
- package/bundles/canvas.json +1 -1
- package/bundles/compass.json +1 -1
- package/bundles/counsel.json +1 -0
- package/bundles/cruise.json +1 -1
- package/bundles/forge.json +12 -1
- package/bundles/prism.json +1 -0
- package/bundles/scalpel.json +5 -2
- package/bundles/sentinel.json +8 -2
- package/bundles/shield.json +1 -0
- package/bundles/spark.json +1 -0
- package/compiler.sh +14 -0
- package/dist/plugins/canvas/.claude-plugin/plugin.json +1 -1
- package/dist/plugins/canvas/VERSION +1 -0
- package/dist/plugins/canvas/commands/planning.md +100 -11
- package/dist/plugins/canvas/hooks/hooks.json +16 -0
- package/dist/plugins/canvas/hooks/project-setup.sh +109 -0
- package/dist/plugins/canvas/templates/CLAUDE.md.managed-block +123 -0
- package/dist/plugins/canvas/templates/CLAUDE.md.template +111 -0
- package/dist/plugins/compass/.claude-plugin/plugin.json +1 -1
- package/dist/plugins/compass/VERSION +1 -0
- package/dist/plugins/compass/commands/planning.md +100 -11
- package/dist/plugins/compass/hooks/hooks.json +16 -0
- package/dist/plugins/compass/hooks/project-setup.sh +109 -0
- package/dist/plugins/compass/templates/CLAUDE.md.managed-block +123 -0
- package/dist/plugins/compass/templates/CLAUDE.md.template +111 -0
- package/dist/plugins/counsel/.claude-plugin/plugin.json +1 -1
- package/dist/plugins/counsel/VERSION +1 -0
- package/dist/plugins/counsel/hooks/hooks.json +10 -0
- package/dist/plugins/counsel/hooks/project-setup.sh +109 -0
- package/dist/plugins/counsel/templates/CLAUDE.md.managed-block +123 -0
- package/dist/plugins/counsel/templates/CLAUDE.md.template +111 -0
- package/dist/plugins/cruise/.claude-plugin/plugin.json +1 -1
- package/dist/plugins/cruise/VERSION +1 -0
- package/dist/plugins/cruise/hooks/hooks.json +16 -0
- package/dist/plugins/cruise/hooks/project-setup.sh +109 -0
- package/dist/plugins/cruise/templates/CLAUDE.md.managed-block +123 -0
- package/dist/plugins/cruise/templates/CLAUDE.md.template +111 -0
- package/dist/plugins/forge/.claude-plugin/plugin.json +1 -1
- package/dist/plugins/forge/VERSION +1 -0
- package/dist/plugins/forge/agents/troubleshooter.md +132 -0
- package/dist/plugins/forge/commands/implement.md +99 -1
- package/dist/plugins/forge/commands/planning.md +100 -11
- package/dist/plugins/forge/hooks/escalation-guard.sh +177 -0
- package/dist/plugins/forge/hooks/hooks.json +22 -0
- package/dist/plugins/forge/hooks/project-setup.sh +109 -0
- package/dist/plugins/forge/templates/CLAUDE.md.managed-block +123 -0
- package/dist/plugins/forge/templates/CLAUDE.md.template +111 -0
- package/dist/plugins/prime/.claude-plugin/plugin.json +1 -1
- package/dist/plugins/prime/VERSION +1 -0
- package/dist/plugins/prime/agents/troubleshooter.md +132 -0
- package/dist/plugins/prime/commands/calibrate.md +20 -0
- package/dist/plugins/prime/commands/ci-fix.md +36 -0
- package/dist/plugins/prime/commands/fix.md +23 -0
- package/dist/plugins/prime/commands/implement.md +99 -1
- package/dist/plugins/prime/commands/planning.md +100 -11
- package/dist/plugins/prime/commands/qa-incident.md +54 -0
- package/dist/plugins/prime/commands/restart.md +186 -30
- package/dist/plugins/prime/hooks/escalation-guard.sh +177 -0
- package/dist/plugins/prime/hooks/hooks.json +60 -0
- package/dist/plugins/prime/hooks/post-config-change-restart-reminder.sh +86 -0
- package/dist/plugins/prime/hooks/post-server-crash-watch.sh +120 -0
- package/dist/plugins/prime/hooks/pre-server-port-guard.sh +110 -0
- package/dist/plugins/prime/hooks/project-setup.sh +109 -0
- package/dist/plugins/prime/hooks/sync-agents.sh +99 -12
- package/dist/plugins/prime/templates/CLAUDE.md.managed-block +123 -0
- package/dist/plugins/prime/templates/CLAUDE.md.template +111 -0
- package/dist/plugins/prism/.claude-plugin/plugin.json +1 -1
- package/dist/plugins/prism/VERSION +1 -0
- package/dist/plugins/prism/commands/qa-incident.md +54 -0
- package/dist/plugins/prism/hooks/hooks.json +12 -0
- package/dist/plugins/prism/hooks/project-setup.sh +109 -0
- package/dist/plugins/prism/templates/CLAUDE.md.managed-block +123 -0
- package/dist/plugins/prism/templates/CLAUDE.md.template +111 -0
- package/dist/plugins/scalpel/.claude-plugin/plugin.json +1 -1
- package/dist/plugins/scalpel/VERSION +1 -0
- package/dist/plugins/scalpel/agents/troubleshooter.md +132 -0
- package/dist/plugins/scalpel/commands/ci-fix.md +36 -0
- package/dist/plugins/scalpel/commands/fix.md +23 -0
- package/dist/plugins/scalpel/hooks/escalation-guard.sh +177 -0
- package/dist/plugins/scalpel/hooks/hooks.json +24 -0
- package/dist/plugins/scalpel/hooks/project-setup.sh +109 -0
- package/dist/plugins/scalpel/templates/CLAUDE.md.managed-block +123 -0
- package/dist/plugins/scalpel/templates/CLAUDE.md.template +111 -0
- package/dist/plugins/sentinel/.claude-plugin/plugin.json +1 -1
- package/dist/plugins/sentinel/VERSION +1 -0
- package/dist/plugins/sentinel/agents/troubleshooter.md +132 -0
- package/dist/plugins/sentinel/commands/restart.md +186 -30
- package/dist/plugins/sentinel/hooks/escalation-guard.sh +177 -0
- package/dist/plugins/sentinel/hooks/hooks.json +64 -0
- package/dist/plugins/sentinel/hooks/post-config-change-restart-reminder.sh +86 -0
- package/dist/plugins/sentinel/hooks/post-server-crash-watch.sh +120 -0
- package/dist/plugins/sentinel/hooks/pre-server-port-guard.sh +110 -0
- package/dist/plugins/sentinel/hooks/project-setup.sh +109 -0
- package/dist/plugins/sentinel/templates/CLAUDE.md.managed-block +123 -0
- package/dist/plugins/sentinel/templates/CLAUDE.md.template +111 -0
- package/dist/plugins/shield/.claude-plugin/plugin.json +1 -1
- package/dist/plugins/shield/VERSION +1 -0
- package/dist/plugins/shield/hooks/hooks.json +22 -12
- package/dist/plugins/shield/hooks/project-setup.sh +109 -0
- package/dist/plugins/shield/templates/CLAUDE.md.managed-block +123 -0
- package/dist/plugins/shield/templates/CLAUDE.md.template +111 -0
- package/dist/plugins/spark/.claude-plugin/plugin.json +1 -1
- package/dist/plugins/spark/VERSION +1 -0
- package/dist/plugins/spark/commands/calibrate.md +20 -0
- package/dist/plugins/spark/hooks/hooks.json +10 -0
- package/dist/plugins/spark/hooks/project-setup.sh +109 -0
- package/dist/plugins/spark/templates/CLAUDE.md.managed-block +123 -0
- package/dist/plugins/spark/templates/CLAUDE.md.template +111 -0
- package/hook-defs.json +31 -0
- package/hooks/escalation-guard.sh +177 -0
- package/hooks/post-config-change-restart-reminder.sh +86 -0
- package/hooks/post-server-crash-watch.sh +120 -0
- package/hooks/pre-server-port-guard.sh +110 -0
- package/hooks/project-setup.sh +109 -0
- package/hooks/sync-agents.sh +99 -12
- package/install.sh +2 -2
- package/package.json +1 -1
- package/portable.manifest +7 -1
- package/skills/calibrate/SKILL.md +20 -0
- package/skills/ci-fix/SKILL.md +36 -0
- package/skills/fix/SKILL.md +23 -0
- package/skills/implement/SKILL.md +99 -1
- package/skills/license/SKILL.md +159 -0
- package/skills/planning/SKILL.md +100 -11
- package/skills/publish/SKILL.md +3 -0
- package/skills/qa-incident/SKILL.md +54 -0
- package/skills/restart/SKILL.md +187 -31
package/skills/restart/SKILL.md
CHANGED
|
@@ -1,70 +1,226 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: restart
|
|
3
|
-
description: "
|
|
3
|
+
description: "Discover, restart, and validate local dev servers. Auto-detects Docker vs native, checks health, catches crash loops. Usage: /restart <service> <--preflight>"
|
|
4
4
|
user-invocable: true
|
|
5
|
-
arguments: "<service>"
|
|
5
|
+
arguments: "<service> <--preflight>"
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Restart Servers Skill
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
Discover how services run, restart them safely, and verify they stay healthy.
|
|
11
11
|
|
|
12
|
-
##
|
|
12
|
+
## Phase 1: Discover Services
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
**First, check CLAUDE.md** for a `Local Dev Services` table:
|
|
15
15
|
|
|
16
16
|
```markdown
|
|
17
17
|
## Local Dev Services
|
|
18
18
|
|
|
19
|
-
| Service | Port | Directory | Start Command |
|
|
20
|
-
|
|
21
|
-
|
|
|
22
|
-
| Backend | 8000 | backend/ | uvicorn app.main:app --reload
|
|
19
|
+
| Service | Type | Port | Directory | Start Command | Health Check | Depends On |
|
|
20
|
+
|----------|--------|------|-----------|---------------------------------------|-----------------|------------|
|
|
21
|
+
| Postgres | docker | 5432 | — | docker compose up -d postgres | pg_isready | Docker |
|
|
22
|
+
| Backend | native | 8000 | backend/ | uvicorn app.main:app --reload | /api/health | Postgres |
|
|
23
|
+
| Frontend | native | 3000 | frontend/ | npm run dev | /health | Backend |
|
|
23
24
|
```
|
|
24
25
|
|
|
25
|
-
If
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
-
|
|
26
|
+
**If the table is missing or incomplete, auto-discover** by scanning the repo. Check these files in order:
|
|
27
|
+
|
|
28
|
+
| File | What to extract |
|
|
29
|
+
|------|-----------------|
|
|
30
|
+
| `docker-compose.yml` / `docker-compose.*.yml` | Service names, ports, images, healthcheck configs, volume mounts. These are **docker** type services. |
|
|
31
|
+
| `Dockerfile` / `Dockerfile.*` | What gets containerized — cross-reference with compose to understand which services are Docker-managed. |
|
|
32
|
+
| `package.json` (root + subdirs) | `scripts.dev`, `scripts.start`, `scripts.serve` → these are **native** Node services. Check `proxy` field for backend port. |
|
|
33
|
+
| `Makefile` / `Procfile` / `Justfile` | Process definitions, often with ports and dependency ordering. |
|
|
34
|
+
| `pyproject.toml` / `requirements.txt` | Python services — look for uvicorn/gunicorn/flask/django in deps. |
|
|
35
|
+
| `.env` / `.env.local` / `.env.example` | Port assignments (`PORT=`, `DATABASE_URL=`, `REDIS_URL=`), required env vars. |
|
|
36
|
+
| `turbo.json` / `nx.json` / `pnpm-workspace.yaml` | Monorepo structure — maps workspace packages to services. |
|
|
37
|
+
|
|
38
|
+
For each discovered service, determine:
|
|
39
|
+
- **Name**: human-readable (e.g., "Backend API", "Postgres")
|
|
40
|
+
- **Type**: `docker` (managed by docker compose) or `native` (runs directly on host)
|
|
41
|
+
- **Port**: what port it listens on
|
|
42
|
+
- **Directory**: where to `cd` before running the start command
|
|
43
|
+
- **Start command**: exact command to launch it
|
|
44
|
+
- **Health check**: endpoint or command to verify it's running (look for `/health`, `/api/health`, `pg_isready`, `redis-cli ping`, etc.)
|
|
45
|
+
- **Depends on**: other services that must be running first (DB before backend, backend before frontend)
|
|
46
|
+
|
|
47
|
+
**If discovery is ambiguous, ASK the user.** Specifically ask when:
|
|
48
|
+
- Multiple compose files exist and it's unclear which to use (dev vs prod vs test)
|
|
49
|
+
- A service could be Docker OR native (e.g., Postgres has both a compose entry and a local install)
|
|
50
|
+
- No health check endpoint is obvious — ask what URL or command confirms the service is healthy
|
|
51
|
+
- Port conflicts or unusual port assignments are detected
|
|
52
|
+
- You find services but can't determine the dependency order
|
|
53
|
+
|
|
54
|
+
Present what you found and ask for confirmation:
|
|
55
|
+
```
|
|
56
|
+
Found 3 services:
|
|
57
|
+
1. Postgres (docker, port 5432) — via docker-compose.yml
|
|
58
|
+
2. Backend (native, port 8000) — via backend/pyproject.toml
|
|
59
|
+
3. Frontend (native, port 3000) — via frontend/package.json
|
|
60
|
+
|
|
61
|
+
Dependencies: Frontend → Backend → Postgres
|
|
62
|
+
|
|
63
|
+
Health checks:
|
|
64
|
+
- Postgres: pg_isready -h localhost -p 5432
|
|
65
|
+
- Backend: curl localhost:8000/api/health
|
|
66
|
+
- Frontend: curl localhost:3000
|
|
67
|
+
|
|
68
|
+
Does this look right? Any corrections?
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
After confirmation (or if CLAUDE.md table already exists), proceed to Phase 2.
|
|
72
|
+
|
|
73
|
+
**Update CLAUDE.md**: If services were auto-discovered and the user confirmed, write/update the `Local Dev Services` table in CLAUDE.md so future runs skip discovery.
|
|
30
74
|
|
|
31
|
-
|
|
75
|
+
## Phase 2: Pre-flight Validation
|
|
32
76
|
|
|
77
|
+
Before touching any running processes, validate the environment is ready:
|
|
78
|
+
|
|
79
|
+
### 2a. Docker check (if any service type is `docker`)
|
|
80
|
+
```bash
|
|
81
|
+
# Is Docker daemon running?
|
|
82
|
+
docker info > /dev/null 2>&1 && echo "Docker: OK" || echo "Docker: NOT RUNNING"
|
|
83
|
+
```
|
|
84
|
+
If Docker is not running, **stop and tell the user**. Don't proceed.
|
|
85
|
+
|
|
86
|
+
### 2b. Dependency check (for native services)
|
|
33
87
|
```bash
|
|
34
|
-
#
|
|
88
|
+
# Node services — are node_modules installed?
|
|
89
|
+
[ -d "<directory>/node_modules" ] && echo "node_modules: OK" || echo "node_modules: MISSING — run npm install"
|
|
90
|
+
|
|
91
|
+
# Python services — is the venv active / deps installed?
|
|
92
|
+
[ -f "<directory>/.venv/bin/python" ] && echo "venv: OK" || echo "venv: MISSING"
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### 2c. Environment variables
|
|
96
|
+
```bash
|
|
97
|
+
# Check critical env vars exist (read from .env.example or known requirements)
|
|
98
|
+
[ -f "<directory>/.env" ] || [ -f "<directory>/.env.local" ] && echo "env file: OK" || echo "env file: MISSING"
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### 2d. Port availability
|
|
102
|
+
```bash
|
|
103
|
+
# Check if port is already in use by a DIFFERENT process than expected
|
|
104
|
+
lsof -ti:<port> 2>/dev/null
|
|
105
|
+
```
|
|
106
|
+
If a port is occupied by an unexpected process, warn the user before killing it.
|
|
107
|
+
|
|
108
|
+
### 2e. Pre-flight only mode
|
|
109
|
+
If the user ran `/restart --preflight`, **stop here** and report results. Don't restart anything.
|
|
110
|
+
|
|
111
|
+
## Phase 3: Restart Services (dependency order)
|
|
112
|
+
|
|
113
|
+
Restart in dependency order — infrastructure first, then backends, then frontends.
|
|
114
|
+
|
|
115
|
+
### 3a. Stop services (reverse dependency order)
|
|
116
|
+
```bash
|
|
117
|
+
# For native services — kill by port
|
|
35
118
|
lsof -ti:<port> | xargs kill -9 2>/dev/null
|
|
36
119
|
|
|
120
|
+
# For docker services — stop the specific service
|
|
121
|
+
docker compose stop <service_name>
|
|
122
|
+
|
|
37
123
|
# Wait for ports to free
|
|
38
124
|
sleep 2
|
|
39
|
-
```
|
|
40
125
|
|
|
41
|
-
|
|
126
|
+
# Verify port is actually free
|
|
127
|
+
lsof -ti:<port> 2>/dev/null && echo "WARNING: port <port> still occupied" || echo "Port <port>: free"
|
|
128
|
+
```
|
|
42
129
|
|
|
130
|
+
### 3b. Start services (dependency order)
|
|
43
131
|
```bash
|
|
44
|
-
#
|
|
45
|
-
<
|
|
132
|
+
# Docker services first
|
|
133
|
+
docker compose up -d <service_name>
|
|
134
|
+
|
|
135
|
+
# Then native services — run in background
|
|
136
|
+
cd <directory> && <start_command>
|
|
46
137
|
```
|
|
47
138
|
|
|
48
|
-
Use `run_in_background: true` on the Bash tool.
|
|
139
|
+
Use `run_in_background: true` on the Bash tool for native services.
|
|
140
|
+
|
|
141
|
+
**Wait between dependency layers** — don't start the backend until the DB health check passes. Don't start the frontend until the backend health check passes.
|
|
142
|
+
|
|
143
|
+
## Phase 4: Post-restart Health Validation
|
|
144
|
+
|
|
145
|
+
This is the critical phase. A single health check is not enough — services can start and then crash seconds later.
|
|
49
146
|
|
|
50
|
-
|
|
147
|
+
### 4a. Initial health check (per service, in dependency order)
|
|
51
148
|
|
|
52
149
|
```bash
|
|
53
|
-
#
|
|
54
|
-
curl -sf http://localhost:<port
|
|
150
|
+
# HTTP services
|
|
151
|
+
curl -sf http://localhost:<port><health_path> > /dev/null 2>&1 && echo "<service>: UP" || echo "<service>: DOWN"
|
|
152
|
+
|
|
153
|
+
# Postgres
|
|
154
|
+
pg_isready -h localhost -p <port> 2>/dev/null && echo "Postgres: UP" || echo "Postgres: DOWN"
|
|
155
|
+
|
|
156
|
+
# Redis
|
|
157
|
+
redis-cli -p <port> ping 2>/dev/null | grep -q PONG && echo "Redis: UP" || echo "Redis: DOWN"
|
|
158
|
+
|
|
159
|
+
# Docker services
|
|
160
|
+
docker compose ps <service_name> --format '{{.Status}}' | grep -q "Up" && echo "<service>: UP" || echo "<service>: DOWN"
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### 4b. Crash loop detection (wait 8 seconds, check again)
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
sleep 8
|
|
167
|
+
|
|
168
|
+
# Re-check each service
|
|
169
|
+
curl -sf http://localhost:<port><health_path> > /dev/null 2>&1 && echo "<service>: STABLE" || echo "<service>: CRASHED"
|
|
170
|
+
|
|
171
|
+
# For native services — is the process still running?
|
|
172
|
+
lsof -ti:<port> > /dev/null 2>&1 && echo "<service> process: alive" || echo "<service> process: GONE"
|
|
55
173
|
```
|
|
56
174
|
|
|
57
|
-
|
|
175
|
+
If a service is down on the second check:
|
|
176
|
+
1. **Check logs** — read the last 30 lines of output for error messages
|
|
177
|
+
2. **Report the failure clearly** with the error
|
|
178
|
+
3. **Do NOT retry automatically** — tell the user what went wrong
|
|
179
|
+
|
|
180
|
+
### 4c. Final status report
|
|
181
|
+
|
|
182
|
+
```
|
|
183
|
+
✅ Restart complete
|
|
184
|
+
|
|
185
|
+
| Service | Type | Port | Status |
|
|
186
|
+
|----------|--------|------|---------|
|
|
187
|
+
| Postgres | docker | 5432 | STABLE |
|
|
188
|
+
| Backend | native | 8000 | STABLE |
|
|
189
|
+
| Frontend | native | 3000 | STABLE |
|
|
190
|
+
|
|
191
|
+
All services healthy after 10s stability check.
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
Or if something failed:
|
|
195
|
+
|
|
196
|
+
```
|
|
197
|
+
⚠️ Restart partial — 1 service unhealthy
|
|
198
|
+
|
|
199
|
+
| Service | Type | Port | Status |
|
|
200
|
+
|----------|--------|------|---------|
|
|
201
|
+
| Postgres | docker | 5432 | STABLE |
|
|
202
|
+
| Backend | native | 8000 | CRASHED |
|
|
203
|
+
| Frontend | native | 3000 | SKIPPED |
|
|
204
|
+
|
|
205
|
+
Backend crashed after startup. Last error:
|
|
206
|
+
ModuleNotFoundError: No module named 'sqlalchemy'
|
|
207
|
+
|
|
208
|
+
Fix: Run `pip install -r requirements.txt` in backend/ and retry.
|
|
209
|
+
Frontend was skipped because it depends on Backend.
|
|
210
|
+
```
|
|
58
211
|
|
|
59
212
|
## Argument Patterns
|
|
60
213
|
|
|
61
214
|
| User Input | Action |
|
|
62
215
|
|-----------|--------|
|
|
63
|
-
| `/restart` (no args) |
|
|
64
|
-
| `/restart backend` |
|
|
65
|
-
| `/restart
|
|
66
|
-
| `/restart <service>` | Kill and restart the named service |
|
|
216
|
+
| `/restart` (no args) | Discover → validate → restart all services |
|
|
217
|
+
| `/restart backend` | Restart only the named service (and its dependencies if they're down) |
|
|
218
|
+
| `/restart --preflight` | Discover and validate only — don't restart anything |
|
|
67
219
|
|
|
68
|
-
##
|
|
220
|
+
## Key Principles
|
|
69
221
|
|
|
70
|
-
|
|
222
|
+
1. **Never guess** — if you can't determine how a service runs, ask
|
|
223
|
+
2. **Dependency order matters** — always start infra → backend → frontend
|
|
224
|
+
3. **One health check isn't enough** — check twice with a gap to catch crash loops
|
|
225
|
+
4. **Report errors with context** — show the actual log output, not just "DOWN"
|
|
226
|
+
5. **Don't retry blindly** — if a service crashes, diagnose and report, don't loop
|