trackops 2.0.1 → 2.0.2

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 CHANGED
@@ -15,62 +15,59 @@
15
15
  </p>
16
16
 
17
17
  <p align="center">
18
- <a href="#español">Español</a>&nbsp;&nbsp;·&nbsp;&nbsp;<a href="#english">English</a>&nbsp;&nbsp;·&nbsp;&nbsp;<a href="https://baxahaun.github.io/trackops/">Web</a>
18
+ <a href="#espanol">Espanol</a>&nbsp;&nbsp;·&nbsp;&nbsp;<a href="#english">English</a>&nbsp;&nbsp;·&nbsp;&nbsp;<a href="https://baxahaun.github.io/trackops/">Web</a>
19
19
  </p>
20
20
 
21
21
  ---
22
22
 
23
- ## Español
23
+ ## Espanol
24
24
 
25
- TrackOps es un sistema local de orquestación y automatización operativa para proyectos y desarrollo asistido por agentes IA.
25
+ TrackOps es un sistema local de orquestacion y automatizacion operativa para proyectos y desarrollo asistido por agentes IA.
26
26
 
27
27
  Hace tres cosas:
28
28
 
29
- 1. prepara a tu agente con una skill global
29
+ 1. prepara al agente con una skill global
30
30
  2. activa control operativo dentro de cada repo
31
- 3. media entre el usuario y el agente cuando el proyecto todavía está poco definido
31
+ 3. media entre el usuario y el agente cuando el proyecto aun esta poco definido
32
32
 
33
33
  ### Modelo actual
34
34
 
35
35
  TrackOps trabaja en dos capas:
36
36
 
37
37
  1. `skill global`
38
- se instala una vez en tu agente o CLI
39
- 2. `activación local por proyecto`
40
- se ejecuta cuando decides gestionar un repo concreto
38
+ se instala una vez en el agente
39
+ 2. `runtime + activacion local`
40
+ se instalan y ejecutan cuando decides gestionar una maquina y un repo concretos
41
41
 
42
- La activación local tiene dos caminos:
42
+ La activacion local tiene dos caminos:
43
43
 
44
44
  - `arranque asistido por agente`
45
- para ideas tempranas, usuarios poco técnicos o documentación insuficiente
45
+ para ideas tempranas, usuarios poco tecnicos o documentacion insuficiente
46
46
  - `bootstrap directo`
47
- para proyectos ya definidos y usuarios técnicos
47
+ para proyectos ya definidos y usuarios tecnicos
48
48
 
49
- ### Instalación global
49
+ ### Instalacion global
50
50
 
51
- TrackOps se distribuye como skill global:
51
+ Instala la skill global:
52
52
 
53
53
  ```bash
54
54
  npx skills add Baxahaun/trackops
55
55
  ```
56
56
 
57
- La skill:
58
-
59
- - prepara el agente
60
- - asegura el runtime en el primer uso real
61
- - no modifica repos por sí sola
62
-
63
- ### Primer uso
64
-
65
- En el primer uso, la skill ejecuta:
57
+ Instala el runtime de forma explicita:
66
58
 
67
59
  ```bash
68
- node scripts/bootstrap-trackops.js
60
+ npm install -g trackops
61
+ trackops --version
69
62
  ```
70
63
 
71
- Ese bootstrap valida `Node.js >= 18`, valida `npm`, instala o actualiza `trackops` y registra el estado en `~/.trackops/runtime.json`.
64
+ Esta separacion es intencional:
65
+
66
+ - la skill se audita como capa de instrucciones
67
+ - el runtime se instala con un paso visible y verificable
68
+ - no hay instalacion transitiva oculta desde la propia skill
72
69
 
73
- ### Activación local
70
+ ### Activacion local
74
71
 
75
72
  Dentro de un repo:
76
73
 
@@ -79,12 +76,12 @@ trackops init
79
76
  trackops opera install
80
77
  ```
81
78
 
82
- Semántica:
79
+ Semantica:
83
80
 
84
81
  - `trackops init`
85
82
  activa TrackOps en el repo
86
83
  - `trackops opera install`
87
- añade OPERA cuando quieres el framework operativo completo
84
+ anade OPERA cuando quieres el framework operativo completo
88
85
  - `trackops init --with-opera`
89
86
  existe como atajo
90
87
  - `trackops init --legacy-layout`
@@ -92,30 +89,30 @@ Semántica:
92
89
 
93
90
  ### Workspace split
94
91
 
95
- Por defecto, TrackOps separa producto y operación:
92
+ Por defecto, TrackOps separa producto y operacion:
96
93
 
97
94
  ```text
98
95
  mi-proyecto/
99
- ├── .trackops-workspace.json
100
- ├── .env
101
- ├── .env.example
102
- ├── app/
103
- │ └── ...producto real...
104
- └── ops/
105
- ├── project_control.json
106
- ├── contract/
107
- └── operating-contract.json
108
- ├── policy/
109
- └── autonomy.json
110
- ├── task_plan.md
111
- ├── progress.md
112
- ├── findings.md
113
- ├── genesis.md
114
- ├── bootstrap/
115
- ├── .agent/
116
- ├── .agents/
117
- ├── .githooks/
118
- └── .tmp/
96
+ |- .trackops-workspace.json
97
+ |- .env
98
+ |- .env.example
99
+ |- app/
100
+ | \- ...producto real...
101
+ \- ops/
102
+ |- project_control.json
103
+ |- contract/
104
+ | \- operating-contract.json
105
+ |- policy/
106
+ | \- autonomy.json
107
+ |- task_plan.md
108
+ |- progress.md
109
+ |- findings.md
110
+ |- genesis.md
111
+ |- bootstrap/
112
+ |- .agent/
113
+ |- .agents/
114
+ |- .githooks/
115
+ \- .tmp/
119
116
  ```
120
117
 
121
118
  Fuente de verdad operativa:
@@ -127,9 +124,9 @@ Fuente de verdad operativa:
127
124
 
128
125
  #### Tengo una idea
129
126
 
130
- Si el usuario no es técnico, el proyecto está en fase idea, o no hay documentación suficiente, OPERA no sigue con preguntas de arquitectura en terminal. En su lugar:
127
+ Si el usuario no es tecnico, el proyecto esta en fase idea, o no hay documentacion suficiente, OPERA no sigue con preguntas de arquitectura en terminal. En su lugar:
131
128
 
132
- 1. pregunta nivel técnico, estado del proyecto y documentación disponible
129
+ 1. pregunta nivel tecnico, estado del proyecto y documentacion disponible
133
130
  2. genera un handoff en `ops/bootstrap/agent-handoff.md`
134
131
  3. espera a que el agente produzca:
135
132
  - `ops/bootstrap/intake.json`
@@ -143,9 +140,9 @@ trackops opera bootstrap --resume
143
140
 
144
141
  #### Ya tengo un repo
145
142
 
146
- Si el usuario es técnico y el proyecto ya tiene suficiente contexto, OPERA sigue por bootstrap directo, compila `ops/contract/operating-contract.json` y recompila `ops/genesis.md`.
143
+ Si el usuario es tecnico y el proyecto ya tiene suficiente contexto, OPERA sigue por bootstrap directo, compila `ops/contract/operating-contract.json` y recompila `ops/genesis.md`.
147
144
 
148
- También puedes forzar el modo:
145
+ Tambien puedes forzar el modo:
149
146
 
150
147
  ```bash
151
148
  trackops opera install --bootstrap-mode handoff
@@ -161,12 +158,12 @@ Flags disponibles:
161
158
 
162
159
  ### Entorno y secretos
163
160
 
164
- TrackOps gestiona un contrato explícito de entorno:
161
+ TrackOps gestiona un contrato explicito de entorno:
165
162
 
166
163
  - `/.env`
167
164
  secretos reales del workspace
168
165
  - `/.env.example`
169
- contrato público de variables
166
+ contrato publico de variables
170
167
  - `app/.env`
171
168
  puente de compatibilidad
172
169
 
@@ -194,28 +191,9 @@ trackops locale set es
194
191
  trackops doctor locale
195
192
  ```
196
193
 
197
- ### Trabajo diario
198
-
199
- ```bash
200
- trackops status
201
- trackops next
202
- trackops sync
203
- trackops env status
204
- trackops dashboard
205
- ```
206
-
207
- Reglas:
208
-
209
- - usa `trackops status` para leer foco, fase y bloqueadores
210
- - usa `trackops next` para ver la siguiente tarea lista
211
- - usa `trackops sync` para regenerar docs operativos
212
- - no edites a mano `task_plan.md`, `progress.md` ni `findings.md`
213
-
214
194
  ### CLI principal
215
195
 
216
- #### Core
217
-
218
- | Comando | Descripción |
196
+ | Comando | Descripcion |
219
197
  |---|---|
220
198
  | `trackops init [--with-opera] [--locale es\|en] [--name "..."] [--no-bootstrap] [--legacy-layout]` | Inicializa TrackOps |
221
199
  | `trackops status` | Muestra estado operativo |
@@ -229,28 +207,23 @@ Reglas:
229
207
  | `trackops doctor locale` | Explica el origen del idioma efectivo |
230
208
  | `trackops release [--push]` | Publica la rama configurada desde `app/` |
231
209
  | `trackops dashboard` | Lanza el dashboard local |
232
-
233
- #### OPERA
234
-
235
- | Comando | Descripción |
236
- |---|---|
237
210
  | `trackops opera install [--bootstrap-mode ...] [--technical-level ...] [--project-state ...] [--docs-state ...] [--decision-ownership ...]` | Instala OPERA y decide la ruta de bootstrap |
238
- | `trackops opera bootstrap [--resume]` | Continúa el bootstrap o ingiere el resultado del agente |
211
+ | `trackops opera bootstrap [--resume]` | Continua el bootstrap o ingiere el resultado del agente |
239
212
  | `trackops opera handoff [--print\|--json]` | Muestra el handoff listo para copiar al agente |
240
- | `trackops opera status` | Muestra estado de instalación y bootstrap |
213
+ | `trackops opera status` | Muestra estado de instalacion y bootstrap |
241
214
  | `trackops opera configure` | Reconfigura idioma o fases |
242
- | `trackops opera upgrade --stable [--reset]` | Reescribe artefactos gestionados a la versión estable actual |
215
+ | `trackops opera upgrade --stable [--reset]` | Reescribe artefactos gestionados a la version estable actual |
243
216
 
244
217
  ### Skills del proyecto
245
218
 
246
219
  Hay dos conceptos distintos:
247
220
 
248
221
  - la skill global `trackops`
249
- prepara el sistema
222
+ prepara al agente y guia el flujo
250
223
  - `trackops skill ...`
251
224
  gestiona skills nativas del proyecto en `ops/.agents/skills/`
252
225
 
253
- ### Publicación
226
+ ### Publicacion
254
227
 
255
228
  Antes de publicar:
256
229
 
@@ -264,7 +237,7 @@ npm run release:check
264
237
 
265
238
  `trackops release` publica solo `app/`, incluye `.env.example` y no publica `/.env`, `ops/` ni `.trackops-workspace.json`.
266
239
 
267
- Guía ampliada: [UserGUIDE.md](./UserGUIDE.md)
240
+ Guia ampliada: [UserGUIDE.md](./UserGUIDE.md)
268
241
 
269
242
  ---
270
243
 
@@ -274,7 +247,7 @@ TrackOps is a local orchestration and operational automation system for projects
274
247
 
275
248
  It does three things:
276
249
 
277
- 1. prepares your agent with a global skill
250
+ 1. prepares the agent with a global skill
278
251
  2. activates operational control inside each repository
279
252
  3. mediates between the user and the agent when the project is still loosely defined
280
253
 
@@ -283,9 +256,9 @@ It does three things:
283
256
  TrackOps works in two layers:
284
257
 
285
258
  1. `global skill`
286
- installed once in the agent or CLI
287
- 2. `local per-project activation`
288
- run when you decide to manage a specific repository
259
+ installed once in the agent
260
+ 2. `runtime + local activation`
261
+ installed and used when you decide to manage a specific machine and repository
289
262
 
290
263
  Local activation has two paths:
291
264
 
@@ -296,23 +269,24 @@ Local activation has two paths:
296
269
 
297
270
  ### Global install
298
271
 
299
- Install the global skill with:
272
+ Install the global skill:
300
273
 
301
274
  ```bash
302
275
  npx skills add Baxahaun/trackops
303
276
  ```
304
277
 
305
- The skill prepares the agent, ensures the runtime on first use, and does not mutate repositories by itself.
306
-
307
- ### First use
308
-
309
- On first use the skill runs:
278
+ Install the runtime explicitly:
310
279
 
311
280
  ```bash
312
- node scripts/bootstrap-trackops.js
281
+ npm install -g trackops
282
+ trackops --version
313
283
  ```
314
284
 
315
- It validates `Node.js >= 18`, validates `npm`, installs or updates `trackops`, and records state in `~/.trackops/runtime.json`.
285
+ This split is intentional:
286
+
287
+ - the skill is audited as an instruction layer
288
+ - the runtime is installed through a visible and verifiable step
289
+ - there is no hidden transitive install from the skill itself
316
290
 
317
291
  ### Local activation
318
292
 
@@ -329,25 +303,25 @@ TrackOps separates product and operations by default:
329
303
 
330
304
  ```text
331
305
  my-project/
332
- ├── .trackops-workspace.json
333
- ├── .env
334
- ├── .env.example
335
- ├── app/
336
- └── ops/
337
- ├── project_control.json
338
- ├── contract/
339
- └── operating-contract.json
340
- ├── policy/
341
- └── autonomy.json
342
- ├── task_plan.md
343
- ├── progress.md
344
- ├── findings.md
345
- ├── genesis.md
346
- ├── bootstrap/
347
- ├── .agent/
348
- ├── .agents/
349
- ├── .githooks/
350
- └── .tmp/
306
+ |- .trackops-workspace.json
307
+ |- .env
308
+ |- .env.example
309
+ |- app/
310
+ \- ops/
311
+ |- project_control.json
312
+ |- contract/
313
+ | \- operating-contract.json
314
+ |- policy/
315
+ | \- autonomy.json
316
+ |- task_plan.md
317
+ |- progress.md
318
+ |- findings.md
319
+ |- genesis.md
320
+ |- bootstrap/
321
+ |- .agent/
322
+ |- .agents/
323
+ |- .githooks/
324
+ \- .tmp/
351
325
  ```
352
326
 
353
327
  Operational source of truth:
@@ -395,6 +369,13 @@ TrackOps manages:
395
369
  - `app/.env`
396
370
  compatibility bridge
397
371
 
372
+ Use:
373
+
374
+ ```bash
375
+ trackops env status
376
+ trackops env sync
377
+ ```
378
+
398
379
  ### Language
399
380
 
400
381
  TrackOps can work with:
@@ -410,19 +391,9 @@ trackops locale set en
410
391
  trackops doctor locale
411
392
  ```
412
393
 
413
- ### Daily workflow
414
-
415
- ```bash
416
- trackops status
417
- trackops next
418
- trackops sync
419
- trackops env status
420
- trackops dashboard
421
- ```
422
-
423
394
  ### Main CLI
424
395
 
425
- Core and OPERA commands follow the same contract as the Spanish section above, including `trackops opera handoff` and `trackops opera bootstrap --resume`.
396
+ Core and OPERA commands follow the same contract as the Spanish section above, including `trackops opera handoff`, `trackops opera bootstrap --resume`, and the explicit `npm install -g trackops` runtime step.
426
397
 
427
398
  ### Publishing
428
399
 
package/locales/en.json CHANGED
@@ -125,8 +125,8 @@
125
125
  "cli.help.skill.desc": "Manage skills.",
126
126
  "cli.help.help.desc": "Show this help.",
127
127
  "cli.help.globalWorkflow": "Global agent workflow:",
128
- "cli.help.globalWorkflow.line1": "Install with 'npx skills add Baxahaun/trackops'",
129
- "cli.help.globalWorkflow.line2": "and the global/agent flags you need; then use 'trackops init' and 'trackops opera install' explicitly inside each project.",
128
+ "cli.help.globalWorkflow.line1": "Install the skill with 'npx skills add Baxahaun/trackops' and then the runtime with 'npm install -g trackops'.",
129
+ "cli.help.globalWorkflow.line2": "Then verify with 'trackops --version' and use 'trackops init' and 'trackops opera install' explicitly inside each project.",
130
130
  "cli.usage.workspace": "Usage: trackops workspace <status|migrate>",
131
131
  "cli.usage.env": "Usage: trackops env <status|sync>",
132
132
  "cli.usage.opera": "Usage: trackops opera <install|bootstrap|handoff|status|configure|upgrade>",
package/locales/es.json CHANGED
@@ -125,8 +125,8 @@
125
125
  "cli.help.skill.desc": "Gestiona skills.",
126
126
  "cli.help.help.desc": "Muestra esta ayuda.",
127
127
  "cli.help.globalWorkflow": "Flujo global del agente:",
128
- "cli.help.globalWorkflow.line1": "Instala con 'npx skills add Baxahaun/trackops'",
129
- "cli.help.globalWorkflow.line2": "y los flags globales/de agente que necesites; despues usa 'trackops init' y 'trackops opera install' de forma explicita dentro de cada proyecto.",
128
+ "cli.help.globalWorkflow.line1": "Instala la skill con 'npx skills add Baxahaun/trackops' y luego el runtime con 'npm install -g trackops'.",
129
+ "cli.help.globalWorkflow.line2": "Despues verifica con 'trackops --version' y usa 'trackops init' y 'trackops opera install' de forma explicita dentro de cada proyecto.",
130
130
  "cli.usage.workspace": "Uso: trackops workspace <status|migrate>",
131
131
  "cli.usage.env": "Uso: trackops env <status|sync>",
132
132
  "cli.usage.opera": "Uso: trackops opera <install|bootstrap|handoff|status|configure|upgrade>",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trackops",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "Operational project control with task management, document generation, multi-project dashboard, and optional OPERA methodology",
5
5
  "main": "lib/control.js",
6
6
  "bin": {
@@ -108,9 +108,9 @@ function main() {
108
108
  assert.ok(installed.length >= 1, `trackops skill was not installed under ${homeRoot}`);
109
109
 
110
110
  const installedSkillDir = installed[0];
111
- assert.ok(fs.existsSync(path.join(installedSkillDir, "scripts", "bootstrap-trackops.js")));
112
111
  assert.ok(fs.existsSync(path.join(installedSkillDir, "references", "activation.md")));
113
112
  assert.ok(fs.existsSync(path.join(installedSkillDir, "skill.json")));
113
+ assert.ok(!fs.existsSync(path.join(installedSkillDir, "scripts", "bootstrap-trackops.js")));
114
114
 
115
115
  fs.rmSync(tempRoot, { recursive: true, force: true });
116
116
  console.log("skills marketplace smoke OK");
@@ -11,7 +11,6 @@ const { spawn, spawnSync } = require("child_process");
11
11
  const ROOT = path.resolve(__dirname, "..");
12
12
  const BIN = path.join(ROOT, "bin", "trackops.js");
13
13
  const SKILL_VALIDATE = path.join(ROOT, "scripts", "validate-skill.js");
14
- const SKILL_BOOTSTRAP = path.join(ROOT, "skills", "trackops", "scripts", "bootstrap-trackops.js");
15
14
 
16
15
  function getNpmCommand() {
17
16
  return process.platform === "win32" ? "npm.cmd" : "npm";
@@ -220,17 +219,12 @@ async function main() {
220
219
  const bootstrapEnv = {
221
220
  TRACKOPS_BOOTSTRAP_HOME: bootstrapHome,
222
221
  TRACKOPS_BOOTSTRAP_PREFIX: bootstrapPrefix,
223
- TRACKOPS_BOOTSTRAP_INSTALL_SOURCE: tarballPath,
224
222
  };
225
223
 
226
- const firstBootstrap = runCommand(process.execPath, [SKILL_BOOTSTRAP], tempRoot, bootstrapEnv);
227
- assert.strictEqual(firstBootstrap.status, 0, firstBootstrap.stderr || firstBootstrap.stdout || "bootstrap skill fallo");
228
- assert.match(firstBootstrap.stdout, /TrackOps runtime .* is ready/i);
224
+ const explicitInstall = runNpm(["install", "-g", "--prefix", bootstrapPrefix, tarballPath], tempRoot, bootstrapEnv);
225
+ assert.strictEqual(explicitInstall.status, 0, explicitInstall.stderr || explicitInstall.stdout || "instalacion global explicita fallo");
229
226
 
230
227
  const runtimeStamp = readJson(path.join(bootstrapHome, ".trackops", "runtime.json"));
231
- assert.strictEqual(runtimeStamp.runtimeVersion, packageVersion);
232
- assert.strictEqual(runtimeStamp.skill, "trackops");
233
- assert.strictEqual(runtimeStamp.bootstrapPolicy, "first_use");
234
228
  assert.ok(["es", "en"].includes(runtimeStamp.locale), "el bootstrap global debe fijar un idioma");
235
229
 
236
230
  const installedCli = path.join(bootstrapPrefix, "node_modules", "trackops", "bin", "trackops.js");
@@ -238,16 +232,6 @@ async function main() {
238
232
  const installedVersion = runNode([installedCli, "--version"], tempRoot);
239
233
  assert.strictEqual(installedVersion.trim(), packageVersion);
240
234
 
241
- const secondBootstrap = runCommand(process.execPath, [SKILL_BOOTSTRAP], tempRoot, bootstrapEnv);
242
- assert.strictEqual(secondBootstrap.status, 0, secondBootstrap.stderr || secondBootstrap.stdout || "bootstrap idempotente fallo");
243
- assert.match(secondBootstrap.stdout, /already ready/i);
244
-
245
- const untouchedRepo = path.join(tempRoot, "untouched-repo");
246
- fs.mkdirSync(untouchedRepo, { recursive: true });
247
- const bootstrapNoRepoMutation = runCommand(process.execPath, [SKILL_BOOTSTRAP], untouchedRepo, bootstrapEnv);
248
- assert.strictEqual(bootstrapNoRepoMutation.status, 0, bootstrapNoRepoMutation.stderr || bootstrapNoRepoMutation.stdout || "bootstrap repetido fallo");
249
- assert.ok(!fs.existsSync(path.join(untouchedRepo, "project_control.json")), "la skill global no debe crear artefactos de proyecto por si sola");
250
-
251
235
  const helpOutput = runNode([BIN, "help"], ROOT);
252
236
  assert.doesNotMatch(helpOutput, /\btrackops agent\b/i);
253
237
  assert.match(helpOutput, /workspace status\|migrate/i);
@@ -10,7 +10,6 @@ const SKILL_FILE = path.join(SKILL_DIR, "skill.json");
10
10
  const REQUIRED_FILES = [
11
11
  path.join(SKILL_DIR, "SKILL.md"),
12
12
  path.join(SKILL_DIR, "skill.json"),
13
- path.join(SKILL_DIR, "scripts", "bootstrap-trackops.js"),
14
13
  path.join(SKILL_DIR, "references", "activation.md"),
15
14
  path.join(SKILL_DIR, "references", "workflow.md"),
16
15
  path.join(SKILL_DIR, "references", "troubleshooting.md"),
@@ -48,8 +47,8 @@ function main() {
48
47
  fail(`skills/trackops/skill.json must target npm package '${pkg.name}'.`);
49
48
  }
50
49
 
51
- if (skill.bootstrapPolicy !== "first_use") {
52
- fail("skills/trackops/skill.json must use bootstrapPolicy 'first_use'.");
50
+ if (skill.bootstrapPolicy !== "explicit_install") {
51
+ fail("skills/trackops/skill.json must use bootstrapPolicy 'explicit_install'.");
53
52
  }
54
53
 
55
54
  const supportedAgents = Array.isArray(skill.supportedAgentsV1) ? skill.supportedAgentsV1 : [];
@@ -73,7 +72,8 @@ function main() {
73
72
 
74
73
  for (const requiredPhrase of [
75
74
  "npx skills add Baxahaun/trackops",
76
- "node scripts/bootstrap-trackops.js",
75
+ "npm install -g trackops",
76
+ "trackops --version",
77
77
  "trackops init",
78
78
  "trackops opera install",
79
79
  "trackops opera bootstrap --resume",
@@ -83,6 +83,20 @@ function main() {
83
83
  }
84
84
  }
85
85
 
86
+ for (const forbiddenPhrase of [
87
+ "node scripts/bootstrap-trackops.js",
88
+ "ensures the runtime on first use",
89
+ "asegura el runtime en el primer uso",
90
+ ]) {
91
+ if (skillMd.includes(forbiddenPhrase)) {
92
+ fail(`skills/trackops/SKILL.md must not mention '${forbiddenPhrase}'.`);
93
+ }
94
+ }
95
+
96
+ if (fs.existsSync(path.join(SKILL_DIR, "scripts", "bootstrap-trackops.js"))) {
97
+ fail("skills/trackops must not publish scripts/bootstrap-trackops.js.");
98
+ }
99
+
86
100
  console.log("skills/trackops validated successfully.");
87
101
  }
88
102
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: "trackops"
3
- description: "Skill global de TrackOps para instalar y activar la orquestacion local de proyectos con OPERA, entorno y handoff a agentes. Usala cuando el usuario quiera instalar TrackOps desde skills.sh, bootstrapear el runtime con `node scripts/bootstrap-trackops.js`, ejecutar `trackops init`, ejecutar `trackops opera install`, revisar `trackops opera handoff`, o trabajar sobre el flujo operativo de un repositorio."
3
+ description: "Skill global de TrackOps para preparar al agente, exigir la instalacion explicita del runtime con npm y guiar la activacion local de TrackOps y OPERA dentro de cada repositorio."
4
4
  ---
5
5
 
6
6
  # TrackOps
@@ -15,19 +15,19 @@ Instala la skill del marketplace con:
15
15
  npx skills add Baxahaun/trackops
16
16
  ```
17
17
 
18
- Antes de depender del CLI, ejecuta el script empaquetado de la skill:
18
+ Despues, confirma que el runtime `trackops` existe. Si no esta disponible, pide al usuario que lo instale de forma explicita:
19
19
 
20
20
  ```bash
21
- node scripts/bootstrap-trackops.js
21
+ npm install -g trackops
22
+ trackops --version
22
23
  ```
23
24
 
24
- Ese bootstrap:
25
+ Reglas:
25
26
 
26
- - asegura el runtime npm de `trackops`
27
- - valida que el binario global sea ejecutable
28
- - registra estado en `~/.trackops/runtime.json`
29
-
30
- No debe crear archivos dentro de un repositorio por si solo.
27
+ - la skill no debe instalar paquetes ni ejecutar codigo remoto por si sola
28
+ - el runtime se instala con un paso visible y auditable
29
+ - la skill puede verificar `trackops --version`, pero no debe encadenar instalaciones silenciosas
30
+ - la skill no debe crear archivos dentro de un repositorio por si sola
31
31
 
32
32
  ## Capa local del proyecto
33
33
 
@@ -40,7 +40,8 @@ trackops opera install
40
40
 
41
41
  Reglas base:
42
42
 
43
- - trata la instalacion global como no invasiva
43
+ - trata la skill global como capa de instrucciones
44
+ - trata la instalacion del runtime como explicita y separada
44
45
  - usa `ops/contract/operating-contract.json` como contrato de maquina cuando exista
45
46
  - usa `ops/project_control.json` como fuente de verdad operativa
46
47
  - usa `ops/policy/autonomy.json` antes de acciones sensibles
@@ -81,6 +82,6 @@ trackops opera bootstrap --resume
81
82
 
82
83
  ## Que referencia leer y cuando
83
84
 
84
- - lee `references/activation.md` solo para instalacion, primer uso, locale bootstrap y activacion de un repo
85
+ - lee `references/activation.md` solo para instalacion, verificacion del runtime, locale bootstrap y activacion de un repo
85
86
  - lee `references/workflow.md` solo cuando TrackOps ya esta activo y haga falta operar el dia a dia del repositorio
86
- - lee `references/troubleshooting.md` solo cuando fallen la instalacion, el bootstrap, el resume o el contrato de entorno
87
+ - lee `references/troubleshooting.md` solo cuando fallen la instalacion explicita, la deteccion de `trackops`, el resume o el contrato de entorno
@@ -1,7 +1,7 @@
1
1
  interface:
2
2
  display_name: "TrackOps"
3
- short_description: "Bootstrap TrackOps and activate OPERA"
4
- default_prompt: "Use $trackops to bootstrap the TrackOps runtime and activate OPERA in this repository."
3
+ short_description: "Guide explicit TrackOps install and activate OPERA"
4
+ default_prompt: "Use $trackops to install the global skill, require explicit npm installation of the TrackOps runtime, and then activate TrackOps and OPERA in this repository."
5
5
 
6
6
  policy:
7
7
  allow_implicit_invocation: true
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: "trackops"
3
- description: "Global TrackOps skill for installing and activating local project orchestration with OPERA, environment management, and agent handoff. Use it when the user wants to install TrackOps from skills.sh, bootstrap the runtime with `node scripts/bootstrap-trackops.js`, run `trackops init`, run `trackops opera install`, inspect `trackops opera handoff`, or work through the operational flow of a repository."
3
+ description: "Global TrackOps skill for preparing the agent, requiring explicit npm runtime installation, and guiding local TrackOps and OPERA activation inside each repository."
4
4
  ---
5
5
 
6
6
  # TrackOps
@@ -15,19 +15,19 @@ Install the marketplace skill with:
15
15
  npx skills add Baxahaun/trackops
16
16
  ```
17
17
 
18
- Before relying on the CLI, run the bundled skill script:
18
+ Then confirm that the `trackops` runtime exists. If it is missing, ask the user to install it explicitly:
19
19
 
20
20
  ```bash
21
- node scripts/bootstrap-trackops.js
21
+ npm install -g trackops
22
+ trackops --version
22
23
  ```
23
24
 
24
- That bootstrap:
25
+ Rules:
25
26
 
26
- - ensures the npm `trackops` runtime
27
- - verifies that the global binary can be executed
28
- - records state in `~/.trackops/runtime.json`
29
-
30
- It must not create repository files on its own.
27
+ - the skill must not install packages or execute remote code by itself
28
+ - the runtime is installed through a visible and auditable npm step
29
+ - the skill may verify `trackops --version`, but it must not chain silent installs
30
+ - the skill must not create repository files by itself
31
31
 
32
32
  ## Local project layer
33
33
 
@@ -40,7 +40,8 @@ trackops opera install
40
40
 
41
41
  Core rules:
42
42
 
43
- - treat the global install as non-invasive
43
+ - treat the global skill as an instruction layer
44
+ - treat runtime installation as explicit and separate
44
45
  - use `ops/contract/operating-contract.json` as the machine contract when it exists
45
46
  - use `ops/project_control.json` as the operational source of truth
46
47
  - use `ops/policy/autonomy.json` before approval-sensitive actions
@@ -81,6 +82,6 @@ trackops opera bootstrap --resume
81
82
 
82
83
  ## Which reference to read and when
83
84
 
84
- - read `locales/en/references/activation.md` only for installation, first use, locale bootstrap, and repository activation
85
+ - read `locales/en/references/activation.md` only for installation, runtime verification, locale bootstrap, and repository activation
85
86
  - read `locales/en/references/workflow.md` only when TrackOps is already active and you need day-to-day repository operations
86
- - read `locales/en/references/troubleshooting.md` only when installation, bootstrap, resume, or environment contract handling fails
87
+ - read `locales/en/references/troubleshooting.md` only when explicit installation, `trackops` detection, resume, or environment contract handling fails
@@ -2,19 +2,21 @@
2
2
 
3
3
  ## Global install
4
4
 
5
- Install the marketplace skill:
6
-
7
5
  ```bash
8
6
  npx skills add Baxahaun/trackops
7
+ npm install -g trackops
8
+ trackops --version
9
9
  ```
10
10
 
11
- On first use, ensure the runtime with the bundled skill script:
11
+ The global skill installs instructions for the agent.
12
12
 
13
- ```bash
14
- node scripts/bootstrap-trackops.js
15
- ```
13
+ The `trackops` runtime is installed separately through npm so the step stays visible, auditable, and easy to verify.
14
+
15
+ Before continuing:
16
16
 
17
- The global skill must not create repository files on its own.
17
+ - confirm that `trackops --version` returns a valid version
18
+ - if it does not, fix PATH or reinstall `trackops`
19
+ - the skill must not try to install the runtime by itself
18
20
 
19
21
  ## Local activation
20
22
 
@@ -5,18 +5,24 @@
5
5
  - Install Node 18+ if Node is missing or too old.
6
6
  - Install a Node distribution that includes npm if npm is missing.
7
7
 
8
- ## Global install command failed
8
+ ## The skill is installed, but `trackops` does not start
9
9
 
10
- - Install from committed GitHub state:
10
+ - Confirm that the global skill exists:
11
11
  `npx skills add Baxahaun/trackops`
12
- - Then ensure the local runtime with:
13
- `node scripts/bootstrap-trackops.js`
14
- - If the install succeeded but the CLI still looks unavailable, confirm that `~/.trackops/runtime.json` exists.
15
-
16
- ## Runtime bootstrap failed
17
-
18
- - Re-run `node scripts/bootstrap-trackops.js`.
19
- - If npm global permissions fail, configure a user-writable npm prefix instead of using `sudo`.
12
+ - Install or reinstall the runtime explicitly:
13
+ `npm install -g trackops`
14
+ - Verify:
15
+ `trackops --version`
16
+ - If the binary still does not respond:
17
+ - check Node.js (`>= 18`)
18
+ - check that `npm` exists and works
19
+ - check PATH and reopen the terminal
20
+
21
+ ## Explicit runtime installation fails
22
+
23
+ - Re-run `npm install -g trackops`.
24
+ - If `npm` errors, fix that first; the skill cannot continue without the CLI.
25
+ - If the issue is global permissions, use the recommended method for your system or a user-controlled npm prefix.
20
26
 
21
27
  ## OPERA routed bootstrap to the agent
22
28
 
@@ -1,6 +1,12 @@
1
1
  # Workflow
2
2
 
3
- Once TrackOps is active in a repository:
3
+ Precondition:
4
+
5
+ - the global skill is already installed
6
+ - `trackops --version` responds correctly
7
+ - the repository was already activated with `trackops init`
8
+
9
+ Use TrackOps when the repository is already managed and you need day-to-day operations.
4
10
 
5
11
  1. Run `trackops status`.
6
12
  2. Run `trackops next`.
@@ -10,17 +16,17 @@ Once TrackOps is active in a repository:
10
16
 
11
17
  Operational rules:
12
18
 
13
- - In split workspaces, use `ops/project_control.json` as the source of truth.
14
- - Generated operational docs live in `ops/`.
15
- - Product code lives in `app/`.
16
- - Real secrets live in `/.env`.
17
- - Public environment contract lives in `/.env.example`.
18
- - `app/.env` is only a compatibility bridge.
19
+ - in split workspaces, use `ops/project_control.json` as the source of truth
20
+ - generated operational docs live in `ops/`
21
+ - product code lives in `app/`
22
+ - real secrets live in `/.env`
23
+ - public environment contract lives in `/.env.example`
24
+ - `app/.env` is only a compatibility bridge
19
25
 
20
26
  If OPERA is installed:
21
27
 
22
- - `ops/contract/operating-contract.json` holds the machine contract.
23
- - `ops/genesis.md` holds the compiled human view.
24
- - `ops/policy/autonomy.json` holds the executable autonomy policy.
25
- - `ops/bootstrap/` holds onboarding artifacts.
26
- - `ops/.agent/hub/` and `ops/.agents/skills/` hold managed agent artifacts.
28
+ - `ops/contract/operating-contract.json` holds the machine contract
29
+ - `ops/genesis.md` holds the compiled human view
30
+ - `ops/policy/autonomy.json` holds the executable autonomy policy
31
+ - `ops/bootstrap/` holds onboarding artifacts
32
+ - `ops/.agent/hub/` and `ops/.agents/skills/` hold managed agent artifacts
@@ -2,23 +2,25 @@
2
2
 
3
3
  ## Instalacion global
4
4
 
5
- Instala la skill del marketplace:
6
-
7
5
  ```bash
8
6
  npx skills add Baxahaun/trackops
7
+ npm install -g trackops
8
+ trackops --version
9
9
  ```
10
10
 
11
- En primer uso, asegura el runtime con el script empaquetado de la skill:
11
+ La skill global instala instrucciones para el agente.
12
12
 
13
- ```bash
14
- node scripts/bootstrap-trackops.js
15
- ```
13
+ El runtime `trackops` se instala aparte con npm para que el paso sea visible, auditable y facil de verificar.
14
+
15
+ Antes de seguir:
16
16
 
17
- La skill global no debe crear archivos dentro de repositorios por si sola.
17
+ - confirma que `trackops --version` devuelve una version valida
18
+ - si no aparece, resuelve PATH o reinstala `trackops`
19
+ - la skill no debe intentar instalar el runtime por su cuenta
18
20
 
19
21
  ## Activacion local
20
22
 
21
- Dentro de un repositorio:
23
+ Dentro del repo:
22
24
 
23
25
  ```bash
24
26
  trackops init
@@ -39,9 +41,9 @@ OPERA siempre empieza clasificando:
39
41
 
40
42
  - nivel tecnico
41
43
  - estado del proyecto
42
- - estado de la documentacion
44
+ - estado de documentacion
43
45
 
44
- Si el proyecto aun esta verde o el usuario no es tecnico, TrackOps escribe:
46
+ Si el proyecto esta en fase temprana o el usuario es no tecnico, TrackOps escribe:
45
47
 
46
48
  - `ops/bootstrap/agent-handoff.md`
47
49
  - `ops/bootstrap/agent-handoff.json`
@@ -52,7 +54,7 @@ El agente debe producir:
52
54
  - `ops/bootstrap/spec-dossier.md`
53
55
  - `ops/bootstrap/open-questions.md` cuando haga falta
54
56
 
55
- Cuando el quality gate pasa, OPERA compila:
57
+ Cuando pasa el quality gate, OPERA compila:
56
58
 
57
59
  - `ops/contract/operating-contract.json`
58
60
  - `ops/genesis.md`
@@ -68,6 +70,6 @@ Controles de idioma:
68
70
 
69
71
  ```bash
70
72
  trackops locale get
71
- trackops locale set en
73
+ trackops locale set es
72
74
  trackops doctor locale
73
75
  ```
@@ -2,28 +2,34 @@
2
2
 
3
3
  ## Faltan prerequisitos
4
4
 
5
- - Instala Node 18+ si Node falta o es demasiado antiguo.
6
- - Instala una distribucion de Node que incluya npm si falta npm.
5
+ - Instala Node 18+ si Node no existe o es demasiado antiguo.
6
+ - Instala una distribucion de Node que incluya npm si npm no existe.
7
7
 
8
- ## Fallo al instalar la skill global
8
+ ## La skill se instalo, pero `trackops` no arranca
9
9
 
10
- - Instala desde el estado committeado de GitHub:
10
+ - Confirma que la skill global existe:
11
11
  `npx skills add Baxahaun/trackops`
12
- - Luego asegura el runtime local con:
13
- `node scripts/bootstrap-trackops.js`
14
- - Si la instalacion salio bien pero el CLI sigue sin aparecer, confirma que `~/.trackops/runtime.json` exista.
12
+ - Instala o reinstala el runtime de forma explicita:
13
+ `npm install -g trackops`
14
+ - Verifica:
15
+ `trackops --version`
16
+ - Si el binario sigue sin responder:
17
+ - revisa Node.js (`>= 18`)
18
+ - revisa que `npm` exista y funcione
19
+ - revisa PATH y reabre la terminal
15
20
 
16
- ## Fallo en el bootstrap del runtime
21
+ ## La instalacion explicita del runtime falla
17
22
 
18
- - Reejecuta `node scripts/bootstrap-trackops.js`.
19
- - Si fallan los permisos globales de npm, configura un prefix de usuario en lugar de usar `sudo`.
23
+ - Reejecuta `npm install -g trackops`.
24
+ - Si `npm` devuelve error, resuelvelo primero; la skill no puede continuar sin el CLI.
25
+ - Si el problema es de permisos globales, usa el metodo recomendado para tu sistema o un prefijo npm controlado por el usuario.
20
26
 
21
- ## OPERA ha derivado el bootstrap al agente
27
+ ## OPERA derivo el bootstrap al agente
22
28
 
23
- Es el comportamiento esperado cuando:
29
+ Esto es esperado cuando:
24
30
 
25
31
  - el usuario no es tecnico
26
- - el proyecto sigue en fase idea
32
+ - el proyecto esta en fase idea
27
33
  - la documentacion es debil
28
34
 
29
35
  Usa:
@@ -33,11 +39,11 @@ trackops opera handoff --print
33
39
  trackops opera bootstrap --resume
34
40
  ```
35
41
 
36
- ## El resume no completa
42
+ ## `trackops opera bootstrap --resume` no avanza
37
43
 
38
44
  TrackOps no inventa contexto faltante.
39
45
 
40
- Comprueba que ambos archivos existan y contengan datos utilizables:
46
+ Comprueba que existan ambos archivos y contengan datos utiles:
41
47
 
42
48
  - `ops/bootstrap/intake.json`
43
49
  - `ops/bootstrap/spec-dossier.md`
@@ -46,4 +52,4 @@ Comprueba que ambos archivos existan y contengan datos utilizables:
46
52
 
47
53
  - Ejecuta `trackops env status`.
48
54
  - Ejecuta `trackops env sync`.
49
- - Si el bridge mode es `copy`, no edites `app/.env` directamente.
55
+ - Si el modo bridge es `copy`, no edites `app/.env` directamente.
@@ -1,26 +1,32 @@
1
- # Workflow
1
+ # Flujo diario
2
2
 
3
- Una vez que TrackOps esta activo en un repositorio:
3
+ Precondicion:
4
+
5
+ - la skill global ya esta instalada
6
+ - `trackops --version` responde correctamente
7
+ - el repo ya fue activado con `trackops init`
8
+
9
+ Usa TrackOps cuando el repositorio ya esta gestionado y necesites operar el dia a dia.
4
10
 
5
11
  1. Ejecuta `trackops status`.
6
12
  2. Ejecuta `trackops next`.
7
13
  3. Mueve el estado de tareas con `trackops task ...`.
8
- 4. Ejecuta `trackops sync` tras cambios relevantes.
9
- 5. Ejecuta `trackops env status` cuando importen las credenciales.
14
+ 4. Ejecuta `trackops sync` despues de cambios relevantes.
15
+ 5. Ejecuta `trackops env status` cuando las credenciales importen.
10
16
 
11
17
  Reglas operativas:
12
18
 
13
- - En workspaces split, usa `ops/project_control.json` como fuente de verdad.
14
- - La documentacion operativa generada vive en `ops/`.
15
- - El codigo de producto vive en `app/`.
16
- - Los secretos reales viven en `/.env`.
17
- - El contrato publico de entorno vive en `/.env.example`.
18
- - `app/.env` es solo un puente de compatibilidad.
19
+ - en workspaces split, usa `ops/project_control.json` como fuente de verdad
20
+ - la documentacion operativa generada vive en `ops/`
21
+ - el codigo de producto vive en `app/`
22
+ - los secretos reales viven en `/.env`
23
+ - el contrato publico de entorno vive en `/.env.example`
24
+ - `app/.env` solo es un puente de compatibilidad
19
25
 
20
26
  Si OPERA esta instalado:
21
27
 
22
- - `ops/contract/operating-contract.json` contiene el contrato de maquina.
23
- - `ops/genesis.md` contiene la vista humana compilada.
24
- - `ops/policy/autonomy.json` contiene la politica ejecutable.
25
- - `ops/bootstrap/` contiene los artefactos de onboarding.
26
- - `ops/.agent/hub/` y `ops/.agents/skills/` contienen artefactos gestionados de agentes.
28
+ - `ops/contract/operating-contract.json` guarda el contrato de maquina
29
+ - `ops/genesis.md` guarda la vista humana compilada
30
+ - `ops/policy/autonomy.json` guarda la politica ejecutable
31
+ - `ops/bootstrap/` guarda artefactos de onboarding
32
+ - `ops/.agent/hub/` y `ops/.agents/skills/` guardan artefactos gestionados de agente
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "trackops",
3
- "shortDescription": "Global TrackOps skill for local project orchestration, agent coordination, bilingual onboarding, and operational automation.",
4
- "description": "Installs TrackOps as a global skill, ensures the runtime on first use, lets users choose Spanish or English, activates local project orchestration, and routes OPERA onboarding into either direct bootstrap or agent-led discovery.",
5
- "skillVersion": "2.0.1",
6
- "trackopsVersion": "2.0.1",
3
+ "shortDescription": "Global TrackOps skill for secure agent guidance, explicit runtime install, bilingual onboarding, and local project orchestration.",
4
+ "description": "Installs TrackOps as a global skill, requires explicit runtime installation with npm, lets users choose Spanish or English, activates local project orchestration, and routes OPERA onboarding into either direct bootstrap or agent-led discovery.",
5
+ "skillVersion": "2.0.2",
6
+ "trackopsVersion": "2.0.2",
7
7
  "npmPackage": "trackops",
8
- "bootstrapPolicy": "first_use",
8
+ "bootstrapPolicy": "explicit_install",
9
9
  "supportedAgentsV1": [
10
10
  "antigravity",
11
11
  "claude-code",
@@ -2,7 +2,7 @@
2
2
 
3
3
  ```mermaid
4
4
  flowchart TD
5
- A[Global runtime bootstrap] --> B[trackops init]
5
+ A[Explicit global runtime install] --> B[trackops init]
6
6
  B --> C[trackops opera install]
7
7
  C --> D{Routing}
8
8
  D -->|direct_cli| E[Direct intake]
@@ -2,7 +2,7 @@
2
2
 
3
3
  ```mermaid
4
4
  flowchart TD
5
- A[Global runtime bootstrap] --> B[trackops init]
5
+ A[Explicit global runtime install] --> B[trackops init]
6
6
  B --> C[trackops opera install]
7
7
  C --> D{Routing}
8
8
  D -->|direct_cli| E[Direct intake]
@@ -104,6 +104,7 @@ Explica el flujo correcto:
104
104
 
105
105
  ```bash
106
106
  npx skills add Baxahaun/trackops
107
+ npm install -g trackops
107
108
  trackops init
108
109
  trackops opera install
109
110
  ```
@@ -122,6 +123,7 @@ Explica el flujo correcto:
122
123
 
123
124
  ```bash
124
125
  npx skills add Baxahaun/trackops
126
+ npm install -g trackops
125
127
  trackops init
126
128
  trackops opera install
127
129
  ```
@@ -97,6 +97,7 @@ Explain the correct flow:
97
97
 
98
98
  ```bash
99
99
  npx skills add Baxahaun/trackops
100
+ npm install -g trackops
100
101
  trackops init
101
102
  trackops opera install
102
103
  ```
@@ -1,203 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const fs = require("fs");
4
- const os = require("os");
5
- const path = require("path");
6
- const { spawnSync } = require("child_process");
7
- const runtimeState = require("../../../lib/runtime-state");
8
-
9
- const EXIT_CODES = {
10
- READY: 0,
11
- PREREQ: 1,
12
- INSTALL: 2,
13
- UNVERIFIABLE: 3,
14
- };
15
-
16
- function getNpmCommand() {
17
- return process.platform === "win32" ? "npm.cmd" : "npm";
18
- }
19
-
20
- function readSkillConfig() {
21
- const skillFile = path.join(__dirname, "..", "skill.json");
22
- return JSON.parse(fs.readFileSync(skillFile, "utf8"));
23
- }
24
-
25
- function getHomeDir() {
26
- return process.env.TRACKOPS_BOOTSTRAP_HOME || os.homedir();
27
- }
28
-
29
- function getPrefixOverride() {
30
- return process.env.TRACKOPS_BOOTSTRAP_PREFIX || null;
31
- }
32
-
33
- function getInstallSource(config) {
34
- return process.env.TRACKOPS_BOOTSTRAP_INSTALL_SOURCE || `${config.npmPackage}@${config.trackopsVersion}`;
35
- }
36
-
37
- function parseMajor(version) {
38
- const major = Number(String(version || "").split(".")[0]);
39
- return Number.isFinite(major) ? major : null;
40
- }
41
-
42
- function hasSupportedNode() {
43
- const major = parseMajor(process.versions.node);
44
- return major != null && major >= 18;
45
- }
46
-
47
- function spawnChecked(command, args, extra = {}) {
48
- const shell = process.platform === "win32" && /\.(cmd|bat)$/i.test(command);
49
- return spawnSync(command, args, {
50
- encoding: "utf8",
51
- stdio: ["ignore", "pipe", "pipe"],
52
- shell,
53
- ...extra,
54
- });
55
- }
56
-
57
- function spawnNpm(args, extra = {}) {
58
- return spawnSync(getNpmCommand(), args, {
59
- encoding: "utf8",
60
- stdio: ["ignore", "pipe", "pipe"],
61
- shell: process.platform === "win32",
62
- ...extra,
63
- });
64
- }
65
-
66
- function resolvePrefixExecutables(prefix) {
67
- if (!prefix) return [];
68
- if (process.platform === "win32") {
69
- return [
70
- path.join(prefix, "trackops.cmd"),
71
- path.join(prefix, "trackops.exe"),
72
- path.join(prefix, "trackops"),
73
- ];
74
- }
75
- return [path.join(prefix, "bin", "trackops")];
76
- }
77
-
78
- function buildVerificationTargets(prefix) {
79
- const targets = [{ command: "trackops", via: "path" }];
80
- for (const candidate of resolvePrefixExecutables(prefix)) {
81
- targets.push({ command: candidate, via: "prefix" });
82
- }
83
- return targets;
84
- }
85
-
86
- function readInstalledVersion(prefix) {
87
- for (const target of buildVerificationTargets(prefix)) {
88
- const result = spawnChecked(target.command, ["--version"]);
89
- if (result.error || result.status !== 0) continue;
90
- const version = String(result.stdout || "").trim();
91
- if (version) {
92
- return { version, command: target.command, via: target.via };
93
- }
94
- }
95
- return null;
96
- }
97
-
98
- function verifyRuntime(expectedVersion, prefix) {
99
- const installed = readInstalledVersion(prefix);
100
- if (!installed) {
101
- return { ok: false, reason: "missing-command" };
102
- }
103
- if (installed.version !== expectedVersion) {
104
- return { ok: false, reason: "version-drift", installed };
105
- }
106
-
107
- const help = spawnChecked(installed.command, ["help"]);
108
- if (help.error || help.status !== 0) {
109
- return { ok: false, reason: "help-failed", installed };
110
- }
111
-
112
- return { ok: true, installed };
113
- }
114
-
115
- function ensureNpmAvailable() {
116
- const result = spawnNpm(["--version"]);
117
- return !result.error && result.status === 0;
118
- }
119
-
120
- function runInstall(config, prefix) {
121
- const installSource = getInstallSource(config);
122
- const args = ["install", "-g"];
123
- if (prefix) {
124
- args.push("--prefix", prefix);
125
- }
126
- args.push(installSource);
127
-
128
- const result = spawnNpm(args);
129
- return { ...result, installSource };
130
- }
131
-
132
- function writeRuntimeStamp(config, verification) {
133
- const previous = runtimeState.readRuntimeState();
134
- const payload = runtimeState.writeRuntimeState({
135
- ...previous,
136
- skill: config.name,
137
- skillVersion: config.skillVersion,
138
- runtimePackage: config.npmPackage,
139
- runtimeVersion: config.trackopsVersion,
140
- bootstrapPolicy: config.bootstrapPolicy,
141
- supportedAgentsV1: config.supportedAgentsV1,
142
- verifiedAt: new Date().toISOString(),
143
- verifiedWith: verification.installed.via,
144
- executable: verification.installed.command,
145
- });
146
- return payload;
147
- }
148
-
149
- function printInstallGuidance(prefix) {
150
- if (prefix) {
151
- console.error(`TrackOps was installed under the custom prefix '${prefix}'.`);
152
- console.error("Use that prefix's executable or add it to PATH before trying again.");
153
- return;
154
- }
155
-
156
- console.error("TrackOps was installed but could not be executed from PATH.");
157
- console.error("Add your npm global bin directory to PATH, reopen the terminal, and retry.");
158
- }
159
-
160
- async function main() {
161
- const config = readSkillConfig();
162
- const prefix = getPrefixOverride();
163
-
164
- if (!hasSupportedNode()) {
165
- console.error("TrackOps requires Node.js 18 or newer.");
166
- process.exit(EXIT_CODES.PREREQ);
167
- }
168
-
169
- if (!ensureNpmAvailable()) {
170
- console.error("npm is required to bootstrap the TrackOps runtime.");
171
- process.exit(EXIT_CODES.PREREQ);
172
- }
173
-
174
- const current = verifyRuntime(config.trackopsVersion, prefix);
175
- if (current.ok) {
176
- await runtimeState.ensureGlobalLocale({ interactive: false });
177
- writeRuntimeStamp(config, current);
178
- console.log(`TrackOps runtime ${config.trackopsVersion} is already ready.`);
179
- process.exit(EXIT_CODES.READY);
180
- }
181
-
182
- const install = runInstall(config, prefix);
183
- if (install.error || install.status !== 0) {
184
- console.error(`Failed to install ${install.installSource}.`);
185
- if (install.stderr) {
186
- console.error(install.stderr.trim());
187
- }
188
- process.exit(EXIT_CODES.INSTALL);
189
- }
190
-
191
- const verification = verifyRuntime(config.trackopsVersion, prefix);
192
- if (!verification.ok) {
193
- printInstallGuidance(prefix);
194
- process.exit(EXIT_CODES.UNVERIFIABLE);
195
- }
196
-
197
- await runtimeState.ensureGlobalLocale({ interactive: false });
198
- writeRuntimeStamp(config, verification);
199
- console.log(`TrackOps runtime ${config.trackopsVersion} is ready.`);
200
- process.exit(EXIT_CODES.READY);
201
- }
202
-
203
- main();