xtrm-tools 2.1.3 → 2.1.4

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.
@@ -40942,6 +40942,78 @@ Installing ${skills.length} project skills:
40942
40942
  await installProjectSkill(skill, projectRoot);
40943
40943
  }
40944
40944
  }
40945
+ function buildProjectInitGuide() {
40946
+ const lines = [
40947
+ kleur_default.bold("\nProject Init \u2014 Recommended baseline\n"),
40948
+ `${kleur_default.cyan("1) Install a quality gate skill (or equivalent checks):")}`,
40949
+ kleur_default.dim(" - TypeScript projects: xtrm install project ts-quality-gate"),
40950
+ kleur_default.dim(" - Python projects: xtrm install project py-quality-gate"),
40951
+ kleur_default.dim(" - TDD workflow: xtrm install project tdd-guard"),
40952
+ "",
40953
+ `${kleur_default.cyan("2) Ensure your checks are actually configured in this repo:")}`,
40954
+ kleur_default.dim(" - Testing: commands should run and fail when behavior regresses"),
40955
+ kleur_default.dim(" - Linting/formatting: ESLint+Prettier (TS) or ruff (Python)"),
40956
+ kleur_default.dim(" - Type checks: tsc (TS) or mypy/pyright (Python)"),
40957
+ kleur_default.dim(" - Hooks only enforce what your project config defines"),
40958
+ "",
40959
+ `${kleur_default.cyan("3) Optional: Service Skills Set (service-skills-set)")}`,
40960
+ kleur_default.dim(" - For multi-service/Docker repos with repeated operational workflows"),
40961
+ kleur_default.dim(" - Adds project hooks + skills that route Claude to service-specific context"),
40962
+ kleur_default.dim(" - Helps keep architecture knowledge persistent across sessions"),
40963
+ "",
40964
+ kleur_default.bold("Quick start commands:"),
40965
+ kleur_default.dim(" xtrm install project list"),
40966
+ kleur_default.dim(" xtrm install project ts-quality-gate # or py-quality-gate / tdd-guard"),
40967
+ ""
40968
+ ];
40969
+ return lines.join("\n");
40970
+ }
40971
+ async function printProjectInitGuide() {
40972
+ console.log(buildProjectInitGuide());
40973
+ await runBdInitForProject();
40974
+ }
40975
+ async function installProjectByName(toolName) {
40976
+ if (toolName === "all" || toolName === "*") {
40977
+ await installAllProjectSkills();
40978
+ return;
40979
+ }
40980
+ await installProjectSkill(toolName);
40981
+ }
40982
+ async function runBdInitForProject() {
40983
+ let projectRoot;
40984
+ try {
40985
+ projectRoot = getProjectRoot();
40986
+ } catch (err) {
40987
+ console.log(kleur_default.yellow(`
40988
+ \u26A0 Skipping bd init: ${err.message}
40989
+ `));
40990
+ return;
40991
+ }
40992
+ console.log(kleur_default.bold("Running beads initialization (bd init)..."));
40993
+ const result = (0, import_child_process2.spawnSync)("bd", ["init"], {
40994
+ cwd: projectRoot,
40995
+ encoding: "utf8",
40996
+ timeout: 15e3
40997
+ });
40998
+ if (result.error) {
40999
+ console.log(kleur_default.yellow(` \u26A0 Could not run bd init (${result.error.message})`));
41000
+ return;
41001
+ }
41002
+ if (result.status !== 0) {
41003
+ const text = `${result.stdout || ""}
41004
+ ${result.stderr || ""}`.toLowerCase();
41005
+ if (text.includes("already initialized")) {
41006
+ console.log(kleur_default.dim(" \u2713 beads workspace already initialized"));
41007
+ return;
41008
+ }
41009
+ if (result.stdout) process.stdout.write(result.stdout);
41010
+ if (result.stderr) process.stderr.write(result.stderr);
41011
+ console.log(kleur_default.yellow(` \u26A0 bd init exited with code ${result.status}`));
41012
+ return;
41013
+ }
41014
+ if (result.stdout) process.stdout.write(result.stdout);
41015
+ if (result.stderr) process.stderr.write(result.stderr);
41016
+ }
40945
41017
  async function listProjectSkills() {
40946
41018
  const entries = await getAvailableProjectSkills();
40947
41019
  if (entries.length === 0) {
@@ -40994,11 +41066,7 @@ function createInstallProjectCommand() {
40994
41066
  const installProjectCmd = new Command("project").description("Install a project-specific skill package");
40995
41067
  installProjectCmd.argument("<tool-name>", "Name of the project skill to install").action(async (toolName) => {
40996
41068
  try {
40997
- if (toolName === "all" || toolName === "*") {
40998
- await installAllProjectSkills();
40999
- return;
41000
- }
41001
- await installProjectSkill(toolName);
41069
+ await installProjectByName(toolName);
41002
41070
  } catch (err) {
41003
41071
  console.error(kleur_default.red(`
41004
41072
  \u2717 ${err.message}
@@ -41009,9 +41077,33 @@ function createInstallProjectCommand() {
41009
41077
  const listCmd = new Command("list").description("List available project skills").action(async () => {
41010
41078
  await listProjectSkills();
41011
41079
  });
41080
+ const initCmd = new Command("init").description("Show project onboarding guidance (quality gates + service skills)").action(async () => {
41081
+ await printProjectInitGuide();
41082
+ });
41012
41083
  installProjectCmd.addCommand(listCmd);
41084
+ installProjectCmd.addCommand(initCmd);
41013
41085
  return installProjectCmd;
41014
41086
  }
41087
+ function createProjectCommand() {
41088
+ const projectCmd = new Command("project").description("Project skill onboarding and installation helpers");
41089
+ projectCmd.command("init").description("Show project onboarding guidance (quality gates + service skills)").action(async () => {
41090
+ await printProjectInitGuide();
41091
+ });
41092
+ projectCmd.command("list").description("List available project skills").action(async () => {
41093
+ await listProjectSkills();
41094
+ });
41095
+ projectCmd.command("install").argument("<tool-name>", "Name of the project skill to install").description("Alias for xtrm install project <tool-name>").action(async (toolName) => {
41096
+ try {
41097
+ await installProjectByName(toolName);
41098
+ } catch (err) {
41099
+ console.error(kleur_default.red(`
41100
+ \u2717 ${err.message}
41101
+ `));
41102
+ process.exit(1);
41103
+ }
41104
+ });
41105
+ return projectCmd;
41106
+ }
41015
41107
 
41016
41108
  // src/commands/install.ts
41017
41109
  var import_child_process3 = require("child_process");
@@ -55703,6 +55795,7 @@ program2.exitOverride((err) => {
55703
55795
  process.exit(1);
55704
55796
  });
55705
55797
  program2.addCommand(createInstallCommand());
55798
+ program2.addCommand(createProjectCommand());
55706
55799
  program2.addCommand(createStatusCommand());
55707
55800
  program2.addCommand(createResetCommand());
55708
55801
  program2.addCommand(createHelpCommand());