xtrm-tools 2.1.7 → 2.1.8

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.
@@ -41134,35 +41134,55 @@ Installing ${skills.length} project skills:
41134
41134
  }
41135
41135
  function buildProjectInitGuide() {
41136
41136
  const lines = [
41137
- kleur_default.bold("\nProject Init \u2014 Recommended baseline\n"),
41138
- `${kleur_default.cyan("1) Install quality gates (unified TDD + lint + typecheck workflow):")}`,
41137
+ kleur_default.bold("\nProject Init \u2014 Production baseline\n"),
41138
+ kleur_default.dim("This command prints a complete setup checklist and then bootstraps beads + GitNexus for this repo.\n"),
41139
+ `${kleur_default.cyan("1) Install core project enforcement (quality-gates):")}`,
41139
41140
  kleur_default.dim(" xtrm install project quality-gates"),
41141
+ kleur_default.dim(" - Installs TypeScript + Python PostToolUse quality hooks"),
41142
+ kleur_default.dim(" - Includes Serena matcher coverage for edit-equivalent tools"),
41143
+ kleur_default.dim(" - Enforces linting/type-checking based on your repo config"),
41140
41144
  "",
41141
- `${kleur_default.cyan("2) Ensure your checks are actually configured in this repo:")}`,
41142
- kleur_default.dim(" - Testing: commands should run and fail when behavior regresses"),
41143
- kleur_default.dim(" - Linting/formatting: ESLint+Prettier (TS) or ruff (Python)"),
41144
- kleur_default.dim(" - Type checks: tsc (TS) or mypy/pyright (Python)"),
41145
- kleur_default.dim(" - Hooks only enforce what your project config defines"),
41146
- "",
41147
- `${kleur_default.cyan("3) Optional: TDD Guard (standalone, for test-first enforcement)")}`,
41145
+ `${kleur_default.cyan("2) Optional installs depending on workflow:")}`,
41148
41146
  kleur_default.dim(" xtrm install project tdd-guard"),
41149
- kleur_default.dim(" - Requires language-specific test reporter (tdd-guard-vitest, tdd-guard-pytest, etc.)"),
41147
+ kleur_default.dim(" - Strong test-first enforcement (PreToolUse + prompt/session checks)"),
41148
+ kleur_default.dim(" xtrm install project service-skills-set"),
41149
+ kleur_default.dim(" - Service-aware skill routing + drift checks + git hook reminders"),
41150
+ "",
41151
+ `${kleur_default.cyan("3) Configure repo checks (hooks only enforce what your repo defines):")}`,
41152
+ kleur_default.dim(" - Tests: should fail on regressions (required for TDD workflows)"),
41153
+ kleur_default.dim(" - TS: eslint + prettier + tsc"),
41154
+ kleur_default.dim(" - PY: ruff + mypy/pyright"),
41155
+ "",
41156
+ `${kleur_default.cyan("4) Beads workflow (required for gated edit/commit flow):")}`,
41157
+ kleur_default.dim(" - Claim work: bd ready --json -> bd update <id> --claim --json"),
41158
+ kleur_default.dim(" - During work: keep issue status current; create discovered follow-ups"),
41159
+ kleur_default.dim(' - Finish work: bd close <id> --reason "Done" --json'),
41150
41160
  "",
41151
- `${kleur_default.cyan("4) Optional: Service Skills Set (service-skills-set)")}`,
41152
- kleur_default.dim(" - For multi-service/Docker repos with repeated operational workflows"),
41153
- kleur_default.dim(" - Adds project hooks + skills that route Claude to service-specific context"),
41154
- kleur_default.dim(" - Helps keep architecture knowledge persistent across sessions"),
41161
+ `${kleur_default.cyan("5) Git workflow (main-guard expected path):")}`,
41162
+ kleur_default.dim(" - git checkout -b feature/<name>"),
41163
+ kleur_default.dim(" - commit on feature branch only"),
41164
+ kleur_default.dim(" - git push -u origin feature/<name>"),
41165
+ kleur_default.dim(" - gh pr create --fill && gh pr merge --squash"),
41166
+ kleur_default.dim(" - git checkout main && git pull --ff-only"),
41167
+ "",
41168
+ `${kleur_default.cyan("6) Hooks and startup automation:")}`,
41169
+ kleur_default.dim(" - PreToolUse: safety gates (main/beads/TDD/type-safety/etc.)"),
41170
+ kleur_default.dim(" - PostToolUse: quality checks + reminders"),
41171
+ kleur_default.dim(" - Stop: beads stop-gate prevents unresolved session claims"),
41172
+ kleur_default.dim(" - SessionStart: workflow context reminders"),
41155
41173
  "",
41156
41174
  kleur_default.bold("Quick start commands:"),
41157
41175
  kleur_default.dim(" xtrm install project list"),
41158
41176
  kleur_default.dim(" xtrm install project quality-gates"),
41177
+ kleur_default.dim(" xtrm install project tdd-guard"),
41178
+ kleur_default.dim(" xtrm install project service-skills-set"),
41159
41179
  ""
41160
41180
  ];
41161
41181
  return lines.join("\n");
41162
41182
  }
41163
41183
  async function printProjectInitGuide() {
41164
41184
  console.log(buildProjectInitGuide());
41165
- await runBdInitForProject();
41185
+ await bootstrapProjectInit();
41166
41186
  }
41167
41187
  async function installProjectByName(toolName) {
41168
41188
  if (toolName === "all" || toolName === "*") {
@@ -41171,16 +41191,20 @@ async function installProjectByName(toolName) {
41171
41191
  }
41172
41192
  await installProjectSkill(toolName);
41173
41193
  }
41174
- async function runBdInitForProject() {
41194
+ async function bootstrapProjectInit() {
41175
41195
  let projectRoot;
41176
41196
  try {
41177
41197
  projectRoot = getProjectRoot();
41178
41198
  } catch (err) {
41179
41199
  console.log(kleur_default.yellow(`
41180
- \u26A0 Skipping bd init: ${err.message}
41200
+ \u26A0 Skipping project bootstrap: ${err.message}
41181
41201
  `));
41182
41202
  return;
41183
41203
  }
41204
+ await runBdInitForProject(projectRoot);
41205
+ await runGitNexusInitForProject(projectRoot);
41206
+ }
41207
+ async function runBdInitForProject(projectRoot) {
41184
41208
  console.log(kleur_default.bold("Running beads initialization (bd init)..."));
41185
41209
  const result = (0, import_child_process3.spawnSync)("bd", ["init"], {
41186
41210
  cwd: projectRoot,
@@ -41206,6 +41230,44 @@ ${result.stderr || ""}`.toLowerCase();
41206
41230
  if (result.stdout) process.stdout.write(result.stdout);
41207
41231
  if (result.stderr) process.stderr.write(result.stderr);
41208
41232
  }
41233
+ async function runGitNexusInitForProject(projectRoot) {
41234
+ const gitnexusCheck = (0, import_child_process3.spawnSync)("gitnexus", ["--version"], {
41235
+ cwd: projectRoot,
41236
+ encoding: "utf8",
41237
+ timeout: 5e3
41238
+ });
41239
+ if (gitnexusCheck.status !== 0) {
41240
+ console.log(kleur_default.yellow(" \u26A0 gitnexus not found; skipping index bootstrap"));
41241
+ console.log(kleur_default.dim(" Install with: npm install -g gitnexus"));
41242
+ return;
41243
+ }
41244
+ console.log(kleur_default.bold("Checking GitNexus index status..."));
41245
+ const status = (0, import_child_process3.spawnSync)("gitnexus", ["status"], {
41246
+ cwd: projectRoot,
41247
+ encoding: "utf8",
41248
+ timeout: 1e4
41249
+ });
41250
+ const statusText = `${status.stdout || ""}
41251
+ ${status.stderr || ""}`.toLowerCase();
41252
+ const needsAnalyze = status.status !== 0 || statusText.includes("stale") || statusText.includes("not indexed") || statusText.includes("missing");
41253
+ if (!needsAnalyze) {
41254
+ console.log(kleur_default.dim(" \u2713 GitNexus index is ready"));
41255
+ return;
41256
+ }
41257
+ console.log(kleur_default.bold("Running GitNexus indexing (gitnexus analyze)..."));
41258
+ const analyze = (0, import_child_process3.spawnSync)("gitnexus", ["analyze"], {
41259
+ cwd: projectRoot,
41260
+ encoding: "utf8",
41261
+ timeout: 12e4
41262
+ });
41263
+ if (analyze.status === 0) {
41264
+ console.log(kleur_default.green(" \u2713 GitNexus index updated"));
41265
+ return;
41266
+ }
41267
+ if (analyze.stdout) process.stdout.write(analyze.stdout);
41268
+ if (analyze.stderr) process.stderr.write(analyze.stderr);
41269
+ console.log(kleur_default.yellow(` \u26A0 gitnexus analyze exited with code ${analyze.status}`));
41270
+ }
41209
41271
  async function listProjectSkills() {
41210
41272
  const entries = await getAvailableProjectSkills();
41211
41273
  if (entries.length === 0) {
@@ -41269,7 +41331,7 @@ function createInstallProjectCommand() {
41269
41331
  const listCmd = new Command("list").description("List available project skills").action(async () => {
41270
41332
  await listProjectSkills();
41271
41333
  });
41272
- const initCmd = new Command("init").description("Show project onboarding guidance (quality gates + service skills)").action(async () => {
41334
+ const initCmd = new Command("init").description("Show full onboarding guidance and bootstrap beads + GitNexus").action(async () => {
41273
41335
  await printProjectInitGuide();
41274
41336
  });
41275
41337
  installProjectCmd.addCommand(listCmd);
@@ -41278,7 +41340,7 @@ function createInstallProjectCommand() {
41278
41340
  }
41279
41341
  function createProjectCommand() {
41280
41342
  const projectCmd = new Command("project").description("Project skill onboarding and installation helpers");
41281
- projectCmd.command("init").description("Show project onboarding guidance (quality gates + service skills)").action(async () => {
41343
+ projectCmd.command("init").description("Show full onboarding guidance and bootstrap beads + GitNexus").action(async () => {
41282
41344
  await printProjectInitGuide();
41283
41345
  });
41284
41346
  projectCmd.command("list").description("List available project skills").action(async () => {