workflow-agent-cli 2.22.11 → 2.23.0

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/dist/cli/index.js CHANGED
@@ -40,11 +40,11 @@ import {
40
40
  import "../chunk-3ADL5QDN.js";
41
41
  import {
42
42
  syncCommand
43
- } from "../chunk-MMPXQG3O.js";
43
+ } from "../chunk-M6RHIUSM.js";
44
44
 
45
45
  // src/cli/index.ts
46
46
  import { Command as Command7 } from "commander";
47
- import chalk23 from "chalk";
47
+ import chalk24 from "chalk";
48
48
  import { readFileSync as readFileSync3 } from "fs";
49
49
  import { fileURLToPath as fileURLToPath4 } from "url";
50
50
  import { dirname as dirname5, join as join12 } from "path";
@@ -6485,16 +6485,18 @@ async function learnRecordCommand(options) {
6485
6485
  const catChoice = await p12.select({
6486
6486
  message: "Category:",
6487
6487
  options: [
6488
- { value: "migration", label: "\u{1F504} Migration" },
6488
+ { value: "lint", label: "\u{1F527} Lint Error" },
6489
+ { value: "type-error", label: "\u{1F537} Type Error" },
6490
+ { value: "dependency", label: "\u{1F4E6} Dependency" },
6491
+ { value: "config", label: "\u2699\uFE0F Configuration" },
6492
+ { value: "runtime", label: "\u{1F3C3} Runtime" },
6493
+ { value: "build", label: "\u{1F3D7}\uFE0F Build" },
6494
+ { value: "test", label: "\u{1F9EA} Test" },
6489
6495
  { value: "security", label: "\u{1F512} Security" },
6490
- { value: "performance", label: "\u26A1 Performance" },
6491
- { value: "compatibility", label: "\u{1F517} Compatibility" },
6496
+ { value: "migration", label: "\u{1F504} Migration" },
6492
6497
  { value: "deprecation", label: "\u26A0\uFE0F Deprecation" },
6493
- { value: "configuration", label: "\u2699\uFE0F Configuration" },
6494
- { value: "best-practice", label: "\u2728 Best Practice" },
6495
- { value: "error-handling", label: "\u{1F6A8} Error Handling" },
6496
- { value: "testing", label: "\u{1F9EA} Testing" },
6497
- { value: "other", label: "\u{1F4E6} Other" }
6498
+ { value: "performance", label: "\u26A1 Performance" },
6499
+ { value: "compatibility", label: "\u{1F517} Compatibility" }
6498
6500
  ]
6499
6501
  });
6500
6502
  if (p12.isCancel(catChoice)) {
@@ -7461,82 +7463,82 @@ var LIBRARY_TAG_MAP = {
7461
7463
  "@nestjs/core": [{ category: "framework", name: "nestjs" }],
7462
7464
  "hapi": [{ category: "framework", name: "hapi" }],
7463
7465
  // Testing
7464
- "vitest": [{ category: "tooling", name: "vitest" }, { category: "category", name: "testing" }],
7465
- "jest": [{ category: "tooling", name: "jest" }, { category: "category", name: "testing" }],
7466
- "@testing-library/react": [{ category: "tooling", name: "testing-library" }],
7467
- "playwright": [{ category: "tooling", name: "playwright" }, { category: "category", name: "e2e" }],
7468
- "cypress": [{ category: "tooling", name: "cypress" }, { category: "category", name: "e2e" }],
7466
+ "vitest": [{ category: "tool", name: "vitest" }, { category: "testing", name: "testing" }],
7467
+ "jest": [{ category: "tool", name: "jest" }, { category: "testing", name: "testing" }],
7468
+ "@testing-library/react": [{ category: "tool", name: "testing-library" }],
7469
+ "playwright": [{ category: "tool", name: "playwright" }, { category: "testing", name: "e2e" }],
7470
+ "cypress": [{ category: "tool", name: "cypress" }, { category: "testing", name: "e2e" }],
7469
7471
  // State Management
7470
- "zustand": [{ category: "tooling", name: "zustand" }, { category: "category", name: "state" }],
7471
- "redux": [{ category: "tooling", name: "redux" }, { category: "category", name: "state" }],
7472
- "@reduxjs/toolkit": [{ category: "tooling", name: "redux-toolkit" }, { category: "category", name: "state" }],
7473
- "jotai": [{ category: "tooling", name: "jotai" }, { category: "category", name: "state" }],
7474
- "recoil": [{ category: "tooling", name: "recoil" }, { category: "category", name: "state" }],
7475
- "mobx": [{ category: "tooling", name: "mobx" }, { category: "category", name: "state" }],
7476
- "pinia": [{ category: "tooling", name: "pinia" }, { category: "category", name: "state" }],
7477
- "xstate": [{ category: "tooling", name: "xstate" }, { category: "category", name: "state-machine" }],
7472
+ "zustand": [{ category: "tool", name: "zustand" }, { category: "state", name: "state" }],
7473
+ "redux": [{ category: "tool", name: "redux" }, { category: "state", name: "state" }],
7474
+ "@reduxjs/toolkit": [{ category: "tool", name: "redux-toolkit" }, { category: "state", name: "state" }],
7475
+ "jotai": [{ category: "tool", name: "jotai" }, { category: "state", name: "state" }],
7476
+ "recoil": [{ category: "tool", name: "recoil" }, { category: "state", name: "state" }],
7477
+ "mobx": [{ category: "tool", name: "mobx" }, { category: "state", name: "state" }],
7478
+ "pinia": [{ category: "tool", name: "pinia" }, { category: "state", name: "state" }],
7479
+ "xstate": [{ category: "tool", name: "xstate" }, { category: "state", name: "state-machine" }],
7478
7480
  // Database & ORM
7479
- "prisma": [{ category: "tooling", name: "prisma" }, { category: "category", name: "database" }],
7480
- "@prisma/client": [{ category: "tooling", name: "prisma" }, { category: "category", name: "database" }],
7481
- "drizzle-orm": [{ category: "tooling", name: "drizzle" }, { category: "category", name: "database" }],
7482
- "typeorm": [{ category: "tooling", name: "typeorm" }, { category: "category", name: "database" }],
7483
- "mongoose": [{ category: "tooling", name: "mongoose" }, { category: "category", name: "mongodb" }],
7484
- "knex": [{ category: "tooling", name: "knex" }, { category: "category", name: "database" }],
7485
- "sequelize": [{ category: "tooling", name: "sequelize" }, { category: "category", name: "database" }],
7481
+ "prisma": [{ category: "tool", name: "prisma" }, { category: "database", name: "database" }],
7482
+ "@prisma/client": [{ category: "tool", name: "prisma" }, { category: "database", name: "database" }],
7483
+ "drizzle-orm": [{ category: "tool", name: "drizzle" }, { category: "database", name: "database" }],
7484
+ "typeorm": [{ category: "tool", name: "typeorm" }, { category: "database", name: "database" }],
7485
+ "mongoose": [{ category: "tool", name: "mongoose" }, { category: "database", name: "mongodb" }],
7486
+ "knex": [{ category: "tool", name: "knex" }, { category: "database", name: "database" }],
7487
+ "sequelize": [{ category: "tool", name: "sequelize" }, { category: "database", name: "database" }],
7486
7488
  // Authentication
7487
- "next-auth": [{ category: "tooling", name: "next-auth" }, { category: "category", name: "auth" }],
7488
- "@auth/core": [{ category: "tooling", name: "authjs" }, { category: "category", name: "auth" }],
7489
- "passport": [{ category: "tooling", name: "passport" }, { category: "category", name: "auth" }],
7490
- "lucia": [{ category: "tooling", name: "lucia" }, { category: "category", name: "auth" }],
7491
- "@clerk/nextjs": [{ category: "tooling", name: "clerk" }, { category: "category", name: "auth" }],
7489
+ "next-auth": [{ category: "tool", name: "next-auth" }, { category: "auth", name: "auth" }],
7490
+ "@auth/core": [{ category: "tool", name: "authjs" }, { category: "auth", name: "auth" }],
7491
+ "passport": [{ category: "tool", name: "passport" }, { category: "auth", name: "auth" }],
7492
+ "lucia": [{ category: "tool", name: "lucia" }, { category: "auth", name: "auth" }],
7493
+ "@clerk/nextjs": [{ category: "tool", name: "clerk" }, { category: "auth", name: "auth" }],
7492
7494
  // UI Libraries
7493
- "@radix-ui/react-dialog": [{ category: "tooling", name: "radix-ui" }],
7494
- "@radix-ui/react-dropdown-menu": [{ category: "tooling", name: "radix-ui" }],
7495
- "@shadcn/ui": [{ category: "tooling", name: "shadcn" }],
7496
- "@chakra-ui/react": [{ category: "tooling", name: "chakra-ui" }],
7497
- "@mantine/core": [{ category: "tooling", name: "mantine" }],
7498
- "@headlessui/react": [{ category: "tooling", name: "headlessui" }],
7499
- "antd": [{ category: "tooling", name: "antd" }],
7500
- "@mui/material": [{ category: "tooling", name: "material-ui" }],
7495
+ "@radix-ui/react-dialog": [{ category: "tool", name: "radix-ui" }],
7496
+ "@radix-ui/react-dropdown-menu": [{ category: "tool", name: "radix-ui" }],
7497
+ "@shadcn/ui": [{ category: "tool", name: "shadcn" }],
7498
+ "@chakra-ui/react": [{ category: "tool", name: "chakra-ui" }],
7499
+ "@mantine/core": [{ category: "tool", name: "mantine" }],
7500
+ "@headlessui/react": [{ category: "tool", name: "headlessui" }],
7501
+ "antd": [{ category: "tool", name: "antd" }],
7502
+ "@mui/material": [{ category: "tool", name: "material-ui" }],
7501
7503
  // Styling
7502
- "tailwindcss": [{ category: "tooling", name: "tailwind" }],
7503
- "styled-components": [{ category: "tooling", name: "styled-components" }],
7504
- "@emotion/react": [{ category: "tooling", name: "emotion" }],
7505
- "sass": [{ category: "tooling", name: "sass" }],
7504
+ "tailwindcss": [{ category: "tool", name: "tailwind" }],
7505
+ "styled-components": [{ category: "tool", name: "styled-components" }],
7506
+ "@emotion/react": [{ category: "tool", name: "emotion" }],
7507
+ "sass": [{ category: "tool", name: "sass" }],
7506
7508
  // API & Data Fetching
7507
- "@tanstack/react-query": [{ category: "tooling", name: "tanstack-query" }, { category: "category", name: "data-fetching" }],
7508
- "swr": [{ category: "tooling", name: "swr" }, { category: "category", name: "data-fetching" }],
7509
- "@trpc/server": [{ category: "tooling", name: "trpc" }, { category: "category", name: "api" }],
7510
- "@trpc/client": [{ category: "tooling", name: "trpc" }, { category: "category", name: "api" }],
7511
- "graphql": [{ category: "tooling", name: "graphql" }, { category: "category", name: "api" }],
7512
- "@apollo/client": [{ category: "tooling", name: "apollo" }, { category: "category", name: "graphql" }],
7513
- "axios": [{ category: "tooling", name: "axios" }],
7509
+ "@tanstack/react-query": [{ category: "tool", name: "tanstack-query" }, { category: "api", name: "data-fetching" }],
7510
+ "swr": [{ category: "tool", name: "swr" }, { category: "api", name: "data-fetching" }],
7511
+ "@trpc/server": [{ category: "tool", name: "trpc" }, { category: "api", name: "api" }],
7512
+ "@trpc/client": [{ category: "tool", name: "trpc" }, { category: "api", name: "api" }],
7513
+ "graphql": [{ category: "tool", name: "graphql" }, { category: "api", name: "api" }],
7514
+ "@apollo/client": [{ category: "tool", name: "apollo" }, { category: "api", name: "graphql" }],
7515
+ "axios": [{ category: "tool", name: "axios" }],
7514
7516
  // Form Libraries
7515
- "react-hook-form": [{ category: "tooling", name: "react-hook-form" }, { category: "category", name: "forms" }],
7516
- "formik": [{ category: "tooling", name: "formik" }, { category: "category", name: "forms" }],
7517
- "@tanstack/react-form": [{ category: "tooling", name: "tanstack-form" }, { category: "category", name: "forms" }],
7517
+ "react-hook-form": [{ category: "tool", name: "react-hook-form" }, { category: "feature", name: "forms" }],
7518
+ "formik": [{ category: "tool", name: "formik" }, { category: "feature", name: "forms" }],
7519
+ "@tanstack/react-form": [{ category: "tool", name: "tanstack-form" }, { category: "feature", name: "forms" }],
7518
7520
  // Validation
7519
- "zod": [{ category: "tooling", name: "zod" }, { category: "category", name: "validation" }],
7520
- "yup": [{ category: "tooling", name: "yup" }, { category: "category", name: "validation" }],
7521
- "valibot": [{ category: "tooling", name: "valibot" }, { category: "category", name: "validation" }],
7521
+ "zod": [{ category: "tool", name: "zod" }, { category: "feature", name: "validation" }],
7522
+ "yup": [{ category: "tool", name: "yup" }, { category: "feature", name: "validation" }],
7523
+ "valibot": [{ category: "tool", name: "valibot" }, { category: "feature", name: "validation" }],
7522
7524
  // Build Tools
7523
- "vite": [{ category: "tooling", name: "vite" }],
7524
- "esbuild": [{ category: "tooling", name: "esbuild" }],
7525
- "tsup": [{ category: "tooling", name: "tsup" }],
7526
- "webpack": [{ category: "tooling", name: "webpack" }],
7527
- "turbo": [{ category: "tooling", name: "turborepo" }],
7525
+ "vite": [{ category: "tool", name: "vite" }],
7526
+ "esbuild": [{ category: "tool", name: "esbuild" }],
7527
+ "tsup": [{ category: "tool", name: "tsup" }],
7528
+ "webpack": [{ category: "tool", name: "webpack" }],
7529
+ "turbo": [{ category: "tool", name: "turborepo" }],
7528
7530
  // Utilities
7529
- "lodash": [{ category: "tooling", name: "lodash" }],
7530
- "date-fns": [{ category: "tooling", name: "date-fns" }],
7531
- "dayjs": [{ category: "tooling", name: "dayjs" }],
7532
- "uuid": [{ category: "tooling", name: "uuid" }],
7533
- "nanoid": [{ category: "tooling", name: "nanoid" }],
7531
+ "lodash": [{ category: "tool", name: "lodash" }],
7532
+ "date-fns": [{ category: "tool", name: "date-fns" }],
7533
+ "dayjs": [{ category: "tool", name: "dayjs" }],
7534
+ "uuid": [{ category: "tool", name: "uuid" }],
7535
+ "nanoid": [{ category: "tool", name: "nanoid" }],
7534
7536
  // CLI & Developer Tools
7535
- "commander": [{ category: "tooling", name: "commander" }, { category: "category", name: "cli" }],
7536
- "yargs": [{ category: "tooling", name: "yargs" }, { category: "category", name: "cli" }],
7537
- "@clack/prompts": [{ category: "tooling", name: "clack" }, { category: "category", name: "cli" }],
7538
- "inquirer": [{ category: "tooling", name: "inquirer" }, { category: "category", name: "cli" }],
7539
- "chalk": [{ category: "tooling", name: "chalk" }],
7537
+ "commander": [{ category: "tool", name: "commander" }, { category: "feature", name: "cli" }],
7538
+ "yargs": [{ category: "tool", name: "yargs" }, { category: "feature", name: "cli" }],
7539
+ "@clack/prompts": [{ category: "tool", name: "clack" }, { category: "feature", name: "cli" }],
7540
+ "inquirer": [{ category: "tool", name: "inquirer" }, { category: "feature", name: "cli" }],
7541
+ "chalk": [{ category: "tool", name: "chalk" }],
7540
7542
  // Runtime & Languages
7541
7543
  "typescript": [{ category: "language", name: "typescript" }]
7542
7544
  };
@@ -7619,28 +7621,28 @@ function inferTagsFromContent(filePaths) {
7619
7621
  } else if (ext === ".rs") {
7620
7622
  addTag("language", "rust");
7621
7623
  } else if (ext === ".css" || ext === ".scss" || ext === ".sass") {
7622
- addTag("tooling", "css");
7624
+ addTag("file-type", "css");
7623
7625
  }
7624
7626
  if (ext === ".tsx" || ext === ".jsx") {
7625
7627
  addTag("framework", "react");
7626
7628
  }
7627
7629
  if (fileName.includes(".test.") || fileName.includes(".spec.") || fileName.startsWith("test_")) {
7628
- addTag("category", "testing");
7630
+ addTag("testing", "testing");
7629
7631
  }
7630
7632
  if (fileName.includes("config") || fileName.startsWith(".")) {
7631
- addTag("category", "configuration");
7633
+ addTag("file-type", "configuration");
7632
7634
  }
7633
7635
  if (filePath.includes("/components/") || filePath.includes("\\components\\")) {
7634
- addTag("category", "component");
7636
+ addTag("ui", "component");
7635
7637
  }
7636
7638
  if (filePath.includes("/hooks/") || filePath.includes("\\hooks\\") || fileName.startsWith("use")) {
7637
- addTag("category", "hooks");
7639
+ addTag("pattern", "hooks");
7638
7640
  }
7639
7641
  if (filePath.includes("/api/") || filePath.includes("\\api\\") || filePath.includes("/routes/")) {
7640
- addTag("category", "api");
7642
+ addTag("api", "api");
7641
7643
  }
7642
7644
  if (filePath.includes("/utils/") || filePath.includes("\\utils\\") || filePath.includes("/lib/")) {
7643
- addTag("category", "utilities");
7645
+ addTag("library", "utilities");
7644
7646
  }
7645
7647
  }
7646
7648
  return tags;
@@ -8300,7 +8302,7 @@ ${chalk21.bold("Pro Tip:")}
8300
8302
  $ workflow sync --all ${chalk21.dim("# Sync everything")}
8301
8303
  `
8302
8304
  ).action(async (options) => {
8303
- const { syncCommand: syncCommand2 } = await import("../sync-ON7M53OC.js");
8305
+ const { syncCommand: syncCommand2 } = await import("../sync-6T5TD4QS.js");
8304
8306
  return syncCommand2({ ...options, learn: true });
8305
8307
  });
8306
8308
  learnCmd.command("config").description("Configure learning settings").option("--enable-sync", "Enable pattern sync").option("--disable-sync", "Disable pattern sync").option("--enable-telemetry", "Enable anonymous telemetry").option("--disable-telemetry", "Disable telemetry").option("--reset-id", "Reset contributor ID").option("--show", "Show current configuration").addHelpText(
@@ -8497,7 +8499,7 @@ async function scopeRemoveCommand(name) {
8497
8499
  }
8498
8500
  async function scopeSyncCommand(options) {
8499
8501
  console.log(chalk22.bold.cyan("\n\u{1F504} Syncing Scopes\n"));
8500
- const { syncCommand: syncCommand2 } = await import("../sync-ON7M53OC.js");
8502
+ const { syncCommand: syncCommand2 } = await import("../sync-6T5TD4QS.js");
8501
8503
  await syncCommand2({
8502
8504
  ...options,
8503
8505
  scopes: true,
@@ -8641,6 +8643,207 @@ ${chalk22.bold("Details:")}
8641
8643
  return scopeCmd;
8642
8644
  }
8643
8645
 
8646
+ // src/cli/commands/migrate.ts
8647
+ import chalk23 from "chalk";
8648
+ import { PatternStore as PatternStore3 } from "@hawkinside_out/workflow-improvement-tracker";
8649
+ async function migrateCommand(subcommand, options) {
8650
+ if (subcommand === "filenames") {
8651
+ await migrateFilenames(options);
8652
+ } else {
8653
+ console.error(chalk23.red(`Unknown migrate subcommand: ${subcommand}`));
8654
+ console.log(chalk23.dim("\nAvailable subcommands:"));
8655
+ console.log(chalk23.dim(" filenames Migrate pattern files to slugified names"));
8656
+ process.exit(1);
8657
+ }
8658
+ }
8659
+ async function migrateFilenames(options) {
8660
+ const isDryRun = options.dryRun || false;
8661
+ const targetType = options.type || "all";
8662
+ console.log(chalk23.bold.cyan("\n\u{1F4E6} Migrate Pattern Filenames\n"));
8663
+ if (isDryRun) {
8664
+ console.log(chalk23.yellow("\u{1F50D} DRY RUN MODE - No files will be modified\n"));
8665
+ }
8666
+ const store = new PatternStore3();
8667
+ const cwd = process.cwd();
8668
+ let totalProcessed = 0;
8669
+ let totalMigrated = 0;
8670
+ let totalFailed = 0;
8671
+ let totalSkipped = 0;
8672
+ const results = [];
8673
+ if (targetType === "fix" || targetType === "all") {
8674
+ console.log(chalk23.bold("Fixes:"));
8675
+ const fixesResult = await store.getAllFixes();
8676
+ if (fixesResult.success && fixesResult.data) {
8677
+ for (const fix of fixesResult.data) {
8678
+ totalProcessed++;
8679
+ try {
8680
+ const oldPath = store.getFixFilePath(fix.id);
8681
+ const newPath = store.getFixFilePath(fix.id, fix.name);
8682
+ if (oldPath === newPath) {
8683
+ console.log(chalk23.dim(` \u2298 ${fix.name} - already migrated`));
8684
+ results.push({
8685
+ type: "fix",
8686
+ name: fix.name,
8687
+ oldPath,
8688
+ newPath,
8689
+ status: "skipped"
8690
+ });
8691
+ totalSkipped++;
8692
+ continue;
8693
+ }
8694
+ if (!isDryRun) {
8695
+ await store.saveFixPattern(fix);
8696
+ }
8697
+ console.log(chalk23.green(` \u2713 ${fix.name}`));
8698
+ console.log(chalk23.dim(` ${oldPath} \u2192 ${newPath}`));
8699
+ results.push({
8700
+ type: "fix",
8701
+ name: fix.name,
8702
+ oldPath,
8703
+ newPath,
8704
+ status: "success"
8705
+ });
8706
+ totalMigrated++;
8707
+ } catch (error) {
8708
+ console.log(chalk23.red(` \u2717 ${fix.name} - ${error}`));
8709
+ results.push({
8710
+ type: "fix",
8711
+ name: fix.name,
8712
+ oldPath: "",
8713
+ newPath: "",
8714
+ status: "failed",
8715
+ error: String(error)
8716
+ });
8717
+ totalFailed++;
8718
+ }
8719
+ }
8720
+ }
8721
+ console.log();
8722
+ }
8723
+ if (targetType === "blueprint" || targetType === "all") {
8724
+ console.log(chalk23.bold("Blueprints:"));
8725
+ const blueprintsResult = await store.getAllBlueprints();
8726
+ if (blueprintsResult.success && blueprintsResult.data) {
8727
+ for (const blueprint of blueprintsResult.data) {
8728
+ totalProcessed++;
8729
+ try {
8730
+ const oldPath = store.getBlueprintFilePath(blueprint.id);
8731
+ const newPath = store.getBlueprintFilePath(blueprint.id, blueprint.name);
8732
+ if (oldPath === newPath) {
8733
+ console.log(chalk23.dim(` \u2298 ${blueprint.name} - already migrated`));
8734
+ results.push({
8735
+ type: "blueprint",
8736
+ name: blueprint.name,
8737
+ oldPath,
8738
+ newPath,
8739
+ status: "skipped"
8740
+ });
8741
+ totalSkipped++;
8742
+ continue;
8743
+ }
8744
+ if (!isDryRun) {
8745
+ await store.saveBlueprint(blueprint);
8746
+ }
8747
+ console.log(chalk23.green(` \u2713 ${blueprint.name}`));
8748
+ console.log(chalk23.dim(` ${oldPath} \u2192 ${newPath}`));
8749
+ results.push({
8750
+ type: "blueprint",
8751
+ name: blueprint.name,
8752
+ oldPath,
8753
+ newPath,
8754
+ status: "success"
8755
+ });
8756
+ totalMigrated++;
8757
+ } catch (error) {
8758
+ console.log(chalk23.red(` \u2717 ${blueprint.name} - ${error}`));
8759
+ results.push({
8760
+ type: "blueprint",
8761
+ name: blueprint.name,
8762
+ oldPath: "",
8763
+ newPath: "",
8764
+ status: "failed",
8765
+ error: String(error)
8766
+ });
8767
+ totalFailed++;
8768
+ }
8769
+ }
8770
+ }
8771
+ console.log();
8772
+ }
8773
+ if (targetType === "solution" || targetType === "all") {
8774
+ console.log(chalk23.bold("Solutions:"));
8775
+ const solutionsResult = await store.getAllSolutions();
8776
+ if (solutionsResult.success && solutionsResult.data) {
8777
+ for (const solution of solutionsResult.data) {
8778
+ totalProcessed++;
8779
+ try {
8780
+ const oldPath = store.getSolutionFilePath(solution.id);
8781
+ const newPath = store.getSolutionFilePath(solution.id, solution.name);
8782
+ if (oldPath === newPath) {
8783
+ console.log(chalk23.dim(` \u2298 ${solution.name} - already migrated`));
8784
+ results.push({
8785
+ type: "solution",
8786
+ name: solution.name,
8787
+ oldPath,
8788
+ newPath,
8789
+ status: "skipped"
8790
+ });
8791
+ totalSkipped++;
8792
+ continue;
8793
+ }
8794
+ if (!isDryRun) {
8795
+ await store.saveSolution(solution);
8796
+ }
8797
+ console.log(chalk23.green(` \u2713 ${solution.name}`));
8798
+ console.log(chalk23.dim(` ${oldPath} \u2192 ${newPath}`));
8799
+ results.push({
8800
+ type: "solution",
8801
+ name: solution.name,
8802
+ oldPath,
8803
+ newPath,
8804
+ status: "success"
8805
+ });
8806
+ totalMigrated++;
8807
+ } catch (error) {
8808
+ console.log(chalk23.red(` \u2717 ${solution.name} - ${error}`));
8809
+ results.push({
8810
+ type: "solution",
8811
+ name: solution.name,
8812
+ oldPath: "",
8813
+ newPath: "",
8814
+ status: "failed",
8815
+ error: String(error)
8816
+ });
8817
+ totalFailed++;
8818
+ }
8819
+ }
8820
+ }
8821
+ console.log();
8822
+ }
8823
+ console.log(chalk23.bold("Summary:"));
8824
+ console.log(chalk23.dim(` Total patterns: ${totalProcessed}`));
8825
+ if (totalMigrated > 0) {
8826
+ console.log(chalk23.green(` \u2713 Migrated: ${totalMigrated}`));
8827
+ }
8828
+ if (totalSkipped > 0) {
8829
+ console.log(chalk23.dim(` \u2298 Already migrated: ${totalSkipped}`));
8830
+ }
8831
+ if (totalFailed > 0) {
8832
+ console.log(chalk23.red(` \u2717 Failed: ${totalFailed}`));
8833
+ }
8834
+ if (isDryRun && totalMigrated > 0) {
8835
+ console.log(chalk23.yellow("\n\u26A0\uFE0F This was a dry run. Run without --dry-run to apply changes."));
8836
+ } else if (!isDryRun && totalMigrated > 0) {
8837
+ console.log(chalk23.green("\n\u2713 Migration complete!"));
8838
+ } else if (totalSkipped === totalProcessed) {
8839
+ console.log(chalk23.dim("\n\u2713 All patterns already use slugified filenames."));
8840
+ }
8841
+ if (totalFailed > 0) {
8842
+ console.log(chalk23.red("\n\u26A0\uFE0F Some patterns failed to migrate. Check the errors above."));
8843
+ process.exit(1);
8844
+ }
8845
+ }
8846
+
8644
8847
  // src/cli/index.ts
8645
8848
  var __filename4 = fileURLToPath4(import.meta.url);
8646
8849
  var __dirname4 = dirname5(__filename4);
@@ -8648,8 +8851,8 @@ var packageJson = JSON.parse(
8648
8851
  readFileSync3(join12(__dirname4, "../../package.json"), "utf-8")
8649
8852
  );
8650
8853
  function deprecationWarning(oldCmd, newCmd) {
8651
- console.warn(chalk23.yellow(`\u26A0\uFE0F "${oldCmd}" is deprecated and will be removed in v2.0.`));
8652
- console.warn(chalk23.yellow(` Use: ${newCmd}
8854
+ console.warn(chalk24.yellow(`\u26A0\uFE0F "${oldCmd}" is deprecated and will be removed in v2.0.`));
8855
+ console.warn(chalk24.yellow(` Use: ${newCmd}
8653
8856
  `));
8654
8857
  }
8655
8858
  var program = new Command7();
@@ -8660,33 +8863,45 @@ program.addCommand(createDocsCommand());
8660
8863
  program.addCommand(createSolutionCommand());
8661
8864
  program.addCommand(createLearnCommand());
8662
8865
  program.addCommand(createScopeCommand());
8866
+ program.command("migrate <subcommand>").description("Migrate patterns and configurations").option("--dry-run", "Preview without making changes").option("--type <type>", "Pattern type to migrate (fix, blueprint, solution, or all)", "all").addHelpText(
8867
+ "after",
8868
+ `
8869
+ ${chalk24.bold("Subcommands:")}
8870
+ filenames ${chalk24.dim("# Migrate to slugified filenames")}
8871
+
8872
+ ${chalk24.bold("Examples:")}
8873
+ $ workflow migrate filenames --dry-run ${chalk24.dim("# Preview migration")}
8874
+ $ workflow migrate filenames ${chalk24.dim("# Migrate all patterns")}
8875
+ $ workflow migrate filenames --type fix ${chalk24.dim("# Migrate only fixes")}
8876
+ `
8877
+ ).action(migrateCommand);
8663
8878
  program.addCommand(createHooksCommand());
8664
8879
  program.command("sync").description("Sync patterns and solutions with the community registry").option("--push", "Push local patterns to registry").option("--pull", "Pull patterns from registry").option("--solutions", "Include solution patterns").option("--learn", "Include learning patterns (default)").option("--scopes", "Sync custom scope packages").option("--all", "Sync everything").option("--dry-run", "Preview without syncing").option("--enable-sync", "Enable pattern sync").option("--disable-sync", "Disable pattern sync").option("--include-private", "Include private patterns in push").addHelpText(
8665
8880
  "after",
8666
8881
  `
8667
- ${chalk23.bold("Examples:")}
8668
- ${chalk23.dim("# Enable sync")}
8882
+ ${chalk24.bold("Examples:")}
8883
+ ${chalk24.dim("# Enable sync")}
8669
8884
  $ workflow sync --enable-sync
8670
8885
 
8671
- ${chalk23.dim("# Disable sync")}
8886
+ ${chalk24.dim("# Disable sync")}
8672
8887
  $ workflow sync --disable-sync
8673
8888
 
8674
- ${chalk23.dim("# Interactive sync (prompts for direction)")}
8889
+ ${chalk24.dim("# Interactive sync (prompts for direction)")}
8675
8890
  $ workflow sync
8676
8891
 
8677
- ${chalk23.dim("# Push local patterns to registry")}
8892
+ ${chalk24.dim("# Push local patterns to registry")}
8678
8893
  $ workflow sync --push
8679
8894
 
8680
- ${chalk23.dim("# Pull patterns from registry")}
8895
+ ${chalk24.dim("# Pull patterns from registry")}
8681
8896
  $ workflow sync --pull
8682
8897
 
8683
- ${chalk23.dim("# Sync solutions only")}
8898
+ ${chalk24.dim("# Sync solutions only")}
8684
8899
  $ workflow sync --solutions --push
8685
8900
 
8686
- ${chalk23.dim("# Include private patterns in push")}
8901
+ ${chalk24.dim("# Include private patterns in push")}
8687
8902
  $ workflow sync --solutions --push --include-private
8688
8903
 
8689
- ${chalk23.dim("# Preview what would be synced")}
8904
+ ${chalk24.dim("# Preview what would be synced")}
8690
8905
  $ workflow sync --all --dry-run
8691
8906
  `
8692
8907
  ).action(syncCommand);
@@ -8700,28 +8915,28 @@ program.command("validate <type> [value]").description("Validate branch name, co
8700
8915
  ).action(validateCommand);
8701
8916
  program.command("config <action> [key] [value]").description("Manage workflow configuration").action(configCommand);
8702
8917
  program.command("config:fix").description("Automatically fix common configuration validation issues").action(async () => {
8703
- const chalk24 = (await import("chalk")).default;
8918
+ const chalk25 = (await import("chalk")).default;
8704
8919
  const { autoFixConfigFile: autoFixConfigFile2 } = await import("../config/index.js");
8705
- console.log(chalk24.bold.cyan("\n\u{1F527} Workflow Configuration Auto-Fix\n"));
8920
+ console.log(chalk25.bold.cyan("\n\u{1F527} Workflow Configuration Auto-Fix\n"));
8706
8921
  const result = await autoFixConfigFile2();
8707
8922
  if (result.success) {
8708
8923
  if (result.changes.length === 0) {
8709
- console.log(chalk24.green("\u2713 Configuration is already valid!"));
8924
+ console.log(chalk25.green("\u2713 Configuration is already valid!"));
8710
8925
  } else {
8711
- console.log(chalk24.green("\u2713 Configuration fixed successfully!\n"));
8712
- console.log(chalk24.dim("Changes made:"));
8926
+ console.log(chalk25.green("\u2713 Configuration fixed successfully!\n"));
8927
+ console.log(chalk25.dim("Changes made:"));
8713
8928
  for (const change of result.changes) {
8714
- console.log(chalk24.dim(` \u2022 ${change}`));
8929
+ console.log(chalk25.dim(` \u2022 ${change}`));
8715
8930
  }
8716
8931
  console.log();
8717
8932
  }
8718
8933
  process.exit(0);
8719
8934
  } else {
8720
8935
  if (result.configPath) {
8721
- console.log(chalk24.red(`\u2717 Failed to fix configuration: ${result.error}`));
8936
+ console.log(chalk25.red(`\u2717 Failed to fix configuration: ${result.error}`));
8722
8937
  } else {
8723
- console.log(chalk24.red("\u2717 No workflow configuration file found"));
8724
- console.log(chalk24.yellow(" Run: workflow init"));
8938
+ console.log(chalk25.red("\u2717 No workflow configuration file found"));
8939
+ console.log(chalk25.yellow(" Run: workflow init"));
8725
8940
  }
8726
8941
  process.exit(1);
8727
8942
  }