xtrm-tools 0.7.11 → 0.7.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.
@@ -0,0 +1,256 @@
1
+ ---
2
+ name: update-specialists
3
+ description: >
4
+ Reconcile a project with current canonical specialists install state.
5
+ Use this skill when a user says "update specialists", "specialists is broken",
6
+ "sp is out of date", "hooks not firing", "skills not loading after update",
7
+ or when drift is detected in installed specialists config, hooks, jobs, DB,
8
+ extensions, or worktree cleanup.
9
+ version: 1.0
10
+ synced_at: 00000000
11
+ ---
12
+
13
+ # update-specialists
14
+
15
+ Bring specialists install back to canonical state. Detect drift, apply targeted
16
+ fixes, then verify with `sp doctor`.
17
+
18
+ ## Canonical State
19
+
20
+ Check each item explicitly. This is what a healthy specialists-initialized project
21
+ looks like.
22
+
23
+ ### Specialists configs
24
+
25
+ | Check | Expected value |
26
+ |-------|----------------|
27
+ | `.specialists/default/*.specialist.json` | JSON-first specialist configs present |
28
+ | `metadata.name` | Matches filename stem |
29
+ | `metadata.version` | Valid semver string |
30
+ | `metadata.description` | Present |
31
+ | `metadata.category` | Present |
32
+ | `execution.model` | Present and pingable |
33
+ | `execution.fallback_model` | Present, different provider from primary |
34
+ | `execution.permission_required` | Valid enum |
35
+ | `execution.extensions.serena` | Present when skill needs opt-out or default true |
36
+ | `execution.extensions.gitnexus` | Present when skill needs opt-out or default true |
37
+ | `execution.interactive` | Matches intended keep-alive behavior |
38
+
39
+ ### Hooks wiring
40
+
41
+ | Check | Expected value |
42
+ |-------|----------------|
43
+ | `.claude/settings.json` | Has hook entries for active events |
44
+ | Hook events | At minimum: `SessionStart`, `PreToolUse`, `PostToolUse`, `Stop` |
45
+ | Hook paths | Point at specialists runtime hook scripts, not stale xtrm-only paths |
46
+ | Hook format | Matches project's installed settings format and loads cleanly |
47
+
48
+ ### CLI reachability
49
+
50
+ | Check | Expected value |
51
+ |-------|----------------|
52
+ | `sp` command | On PATH and runs |
53
+ | `specialists` command | On PATH and runs |
54
+ | Version compatibility | `sp doctor` reports matching runtime / install state |
55
+ | Command surface | `sp doctor`, `sp init`, `sp clean`, `sp status` available |
56
+
57
+ ### Jobs and runtime dirs
58
+
59
+ | Check | Expected value |
60
+ |-------|----------------|
61
+ | `.specialists/jobs/` | Exists |
62
+ | `.specialists/ready/` | Exists if used by runtime |
63
+ | `.specialists/default/` | Canonical install copy present |
64
+ | Orphaned worktrees | None under `.worktrees/` |
65
+ | Worktree ownership | No stale entries for deleted jobs |
66
+
67
+ ### SQLite / observability
68
+
69
+ | Check | Expected value |
70
+ |-------|----------------|
71
+ | specialists DB | Opens cleanly |
72
+ | Schema version | Matches runtime expectation |
73
+ | WAL / busy timeout settings | Present when runtime uses SQLite |
74
+ | Corruption / lock errors | None in `sp doctor` |
75
+
76
+ ### Pi extensions
77
+
78
+ | Check | Expected value |
79
+ |-------|----------------|
80
+ | `quality-gates` | Registered if project uses quality gates |
81
+ | `pi-gitnexus` | Registered when GitNexus integration is expected |
82
+ | `pi-serena-tools` | Registered when Serena integration is expected |
83
+ | Extension paths | Resolve from installed project, not stale workspace copies |
84
+
85
+ ## Detection
86
+
87
+ Run these in order. Report which checks pass and which drift.
88
+
89
+ ```bash
90
+ # 1. Primary health check
91
+ sp doctor
92
+
93
+ # 2. Runtime status
94
+ sp status
95
+
96
+ # 3. Config shape
97
+ find .specialists/default -maxdepth 1 -name '*.specialist.json' -print
98
+
99
+ # 4. Validate specialist JSON files
100
+ node -e "const fs=require('fs'); const path=require('path'); const dir='.specialists/default'; for (const file of fs.readdirSync(dir)) { if (!file.endsWith('.specialist.json')) continue; const data=JSON.parse(fs.readFileSync(path.join(dir,file),'utf8')); const s=data.specialist||data; const m=s.metadata||{}; const e=s.execution||{}; const missing=[]; for (const key of ['name','version','description','category']) if (!m[key]) missing.push('metadata.'+key); for (const key of ['model','fallback_model','permission_required']) if (!e[key]) missing.push('execution.'+key); if (missing.length) console.log(file+': MISSING '+missing.join(', ')); if (m.name && m.name !== file.replace(/\.specialist\.json$/, '')) console.log(file+': NAME MISMATCH '+m.name); }"
101
+
102
+ # 5. Hooks wiring
103
+ node -e "const fs=require('fs'); const p='.claude/settings.json'; if (fs.existsSync(p)) { const s=JSON.parse(fs.readFileSync(p,'utf8')); console.log(JSON.stringify(s.hooks ?? s, null, 2)); } else { console.log('MISSING .claude/settings.json'); }"
104
+
105
+ # 6. Command availability
106
+ command -v sp
107
+ command -v specialists
108
+ sp doctor --json 2>/dev/null || true
109
+
110
+ # 7. Jobs and worktrees
111
+ ls -1 .specialists/jobs 2>/dev/null || true
112
+ find .worktrees -maxdepth 2 -mindepth 1 -type d 2>/dev/null || true
113
+
114
+ # 8. Extension registration
115
+ node -e "const fs=require('fs'); const p='.pi/settings.json'; if (fs.existsSync(p)) console.log(JSON.stringify(JSON.parse(fs.readFileSync(p,'utf8')).skills ?? JSON.parse(fs.readFileSync(p,'utf8')).extensions ?? {}, null, 2)); else console.log('MISSING .pi/settings.json')"
116
+ ```
117
+
118
+ ## Drift -> Fix Mapping
119
+
120
+ Use targeted fixes first. Escalate to full sync only if needed.
121
+
122
+ | Drift | Fix |
123
+ |-------|-----|
124
+ | Specialist JSON missing required fields | `sp edit <name> ...` or regenerate via `sp init --sync-skills` |
125
+ | Specialist JSON schema mismatch | `sp init --sync-skills` |
126
+ | Hooks missing or stale | `sp init --sync-hooks` if available, otherwise `sp init --sync-skills` or `sp init -y` |
127
+ | `sp` / `specialists` missing from PATH | Reinstall / re-bootstrap specialists runtime |
128
+ | Job dir missing | `sp init -y` |
129
+ | Orphaned `.worktrees/` entries | `specialists clean` |
130
+ | SQLite schema/version mismatch | `sp doctor` first, then `sp init --sync-skills` or runtime migration command |
131
+ | Pi extensions missing | `sp init --sync-skills` or reinstall extension registration |
132
+ | Hook config format stale | `sp init -y` |
133
+ | Unknown manual drift | Stop, inspect, then apply user-approved fix |
134
+
135
+ ## Remediation
136
+
137
+ ### Fix: Specialist configs drifted
138
+
139
+ If `sp doctor` or JSON validation shows missing fields, wrong names, or schema
140
+ mismatch:
141
+
142
+ ```bash
143
+ sp init --sync-skills
144
+ ```
145
+
146
+ If one specialist needs a small repair and `sp edit` supports it, prefer that over
147
+ full sync.
148
+
149
+ ### Fix: Hooks not firing
150
+
151
+ If hooks are missing, wrong events, or stale script paths:
152
+
153
+ ```bash
154
+ sp init -y
155
+ ```
156
+
157
+ If runtime exposes a narrower hook sync command, prefer it. Use full init only
158
+ when hook-only sync is not enough.
159
+
160
+ ### Fix: CLI not reachable
161
+
162
+ If `sp` or `specialists` is missing or incompatible:
163
+
164
+ ```bash
165
+ sp doctor
166
+ ```
167
+
168
+ If doctor confirms install drift, reinstall or re-bootstrap specialists runtime.
169
+ Do not guess at file edits when command surface itself is broken.
170
+
171
+ ### Fix: Job dirs or worktree GC drift
172
+
173
+ If jobs exist without owners, worktrees are orphaned, or cleanup state is stale:
174
+
175
+ ```bash
176
+ specialists clean
177
+ ```
178
+
179
+ Then re-run `sp doctor`.
180
+
181
+ ### Fix: SQLite schema drift
182
+
183
+ If doctor reports DB version mismatch or recovery issue:
184
+
185
+ 1. Run `sp doctor` and capture exact schema error.
186
+ 2. Apply runtime migration command if available.
187
+ 3. If no automated migration exists, flag manual intervention.
188
+
189
+ ### Fix: Pi extensions not registered
190
+
191
+ If `quality-gates`, `pi-gitnexus`, or `pi-serena-tools` are missing:
192
+
193
+ ```bash
194
+ sp init --sync-skills
195
+ ```
196
+
197
+ If project uses different extension packaging, re-run install step that writes
198
+ `.pi/settings.json`.
199
+
200
+ ## Verification
201
+
202
+ After fixes, confirm canonical state restored.
203
+
204
+ ```bash
205
+ sp doctor
206
+ sp status
207
+
208
+ command -v sp
209
+ command -v specialists
210
+
211
+ node -e "const fs=require('fs'); const p='.claude/settings.json'; const s=JSON.parse(fs.readFileSync(p,'utf8')); console.log(Boolean(s.hooks || Object.keys(s).length))"
212
+ ```
213
+
214
+ Expected outcome:
215
+ - `sp doctor` clean
216
+ - `sp status` no drift / no repair hints
217
+ - `sp` and `specialists` reachable
218
+ - specialist JSON files valid
219
+ - hooks present on required events
220
+ - no orphaned worktrees
221
+ - SQLite state healthy
222
+
223
+ ## Manual Intervention
224
+
225
+ Flag these when automatic fix is unsafe or impossible:
226
+
227
+ - `sp doctor` reports corrupt DB / unreadable SQLite file
228
+ - command surface missing because install itself is broken
229
+ - hook scripts absent from repo and cannot be regenerated
230
+ - schema mismatch with no available migration path
231
+ - worktree cleanup would remove user changes
232
+ - extensions required by project are not installed at package level
233
+
234
+ When manual intervention needed, report:
235
+ 1. exact drift
236
+ 2. exact command tried
237
+ 3. why auto-fix stopped
238
+ 4. next safe operator action
239
+
240
+ ## User Summary Format
241
+
242
+ After detection + remediation, answer with compact status:
243
+
244
+ ```text
245
+ ## specialists update complete
246
+
247
+ ✓ sp doctor clean
248
+ ✓ specialist configs valid
249
+ ✓ hooks wired
250
+ ✓ CLI reachable
251
+ ✓ jobs/worktrees clean
252
+ ✓ SQLite healthy
253
+ ✓ extensions registered
254
+
255
+ [manual items, if any]
256
+ ```
package/cli/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xtrm-cli",
3
- "version": "0.7.11",
3
+ "version": "0.7.12",
4
4
  "description": "Claude Code tools installer (skills, hooks, MCP servers)",
5
5
  "main": "./dist/index.js",
6
6
  "type": "module",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xtrm-tools",
3
- "version": "0.7.11",
3
+ "version": "0.7.12",
4
4
  "description": "Claude Code tools installer (skills, hooks, MCP servers)",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jaggerxtrm/pi-extensions",
3
- "version": "0.7.11",
3
+ "version": "0.7.12",
4
4
  "description": "Unified Pi extension entrypoint for xtrm-managed extensions",
5
5
  "type": "module",
6
6
  "publishConfig": {