@raftlabs/raftstack 1.9.1 → 1.9.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.
@@ -0,0 +1,3 @@
1
+ {
2
+ "model": "opusplan"
3
+ }
@@ -0,0 +1,21 @@
1
+ ---
2
+ name: quick-fix
3
+ description: Handle simple bug fixes, typos, small refactors, and one-liner changes
4
+ model: haiku
5
+ tools: Read, Edit, Glob, Grep, Bash
6
+ ---
7
+
8
+ # Quick Fix Agent
9
+
10
+ Use this agent for:
11
+ - Typo fixes
12
+ - Simple bug fixes (1-5 lines)
13
+ - Small refactors
14
+ - Config changes
15
+ - Import fixes
16
+
17
+ Do NOT use for:
18
+ - Multi-file changes
19
+ - Architecture decisions
20
+ - Complex debugging
21
+ - New features
package/dist/cli.js CHANGED
@@ -1701,14 +1701,79 @@ async function generateClaudeCommands(targetDir) {
1701
1701
  return result;
1702
1702
  }
1703
1703
 
1704
- // src/generators/eslint.ts
1704
+ // src/generators/claude-config.ts
1705
1705
  import { existsSync as existsSync7 } from "fs";
1706
+ import { readdir as readdir3, copyFile as copyFile4 } from "fs/promises";
1707
+ import { join as join17, dirname as dirname4 } from "path";
1708
+ import { fileURLToPath as fileURLToPath3 } from "url";
1709
+ function getPackageConfigDir() {
1710
+ const currentFilePath = fileURLToPath3(import.meta.url);
1711
+ const packageRoot = join17(dirname4(currentFilePath), "..");
1712
+ return join17(packageRoot, ".claude");
1713
+ }
1714
+ async function copyDirectory3(srcDir, destDir, result, baseDir) {
1715
+ await ensureDir(destDir);
1716
+ const entries = await readdir3(srcDir, { withFileTypes: true });
1717
+ for (const entry of entries) {
1718
+ const srcPath = join17(srcDir, entry.name);
1719
+ const destPath = join17(destDir, entry.name);
1720
+ const relativePath = destPath.replace(baseDir + "/", "");
1721
+ if (entry.isDirectory()) {
1722
+ await copyDirectory3(srcPath, destPath, result, baseDir);
1723
+ } else {
1724
+ if (existsSync7(destPath)) {
1725
+ const backupPath = await backupFile(destPath);
1726
+ if (backupPath) {
1727
+ result.backedUp.push(relativePath);
1728
+ }
1729
+ }
1730
+ await copyFile4(srcPath, destPath);
1731
+ result.created.push(relativePath);
1732
+ }
1733
+ }
1734
+ }
1735
+ async function generateClaudeConfig(targetDir) {
1736
+ const result = {
1737
+ created: [],
1738
+ modified: [],
1739
+ skipped: [],
1740
+ backedUp: []
1741
+ };
1742
+ const packageConfigDir = getPackageConfigDir();
1743
+ const targetClaudeDir = join17(targetDir, ".claude");
1744
+ await ensureDir(targetClaudeDir);
1745
+ const settingsContent = JSON.stringify({ model: "opusplan" }, null, 2) + "\n";
1746
+ const settingsResult = await writeFileSafe(
1747
+ join17(targetClaudeDir, "settings.json"),
1748
+ settingsContent,
1749
+ { backup: true }
1750
+ );
1751
+ if (settingsResult.created) {
1752
+ result.created.push(".claude/settings.json");
1753
+ if (settingsResult.backedUp) {
1754
+ result.backedUp.push(settingsResult.backedUp);
1755
+ }
1756
+ }
1757
+ const packageSubagentsDir = join17(packageConfigDir, "subagents");
1758
+ const targetSubagentsDir = join17(targetClaudeDir, "subagents");
1759
+ if (existsSync7(packageSubagentsDir)) {
1760
+ await copyDirectory3(packageSubagentsDir, targetSubagentsDir, result, targetDir);
1761
+ } else {
1762
+ console.warn(
1763
+ "Warning: Subagents directory not found in package. Skipping subagents generation."
1764
+ );
1765
+ }
1766
+ return result;
1767
+ }
1768
+
1769
+ // src/generators/eslint.ts
1770
+ import { existsSync as existsSync8 } from "fs";
1706
1771
  import { readFile as readFile4 } from "fs/promises";
1707
- import { join as join17 } from "path";
1772
+ import { join as join18 } from "path";
1708
1773
  async function hasReact(targetDir) {
1709
1774
  try {
1710
- const pkgPath = join17(targetDir, "package.json");
1711
- if (existsSync7(pkgPath)) {
1775
+ const pkgPath = join18(targetDir, "package.json");
1776
+ if (existsSync8(pkgPath)) {
1712
1777
  const content = await readFile4(pkgPath, "utf-8");
1713
1778
  const pkg = JSON.parse(content);
1714
1779
  const deps = { ...pkg.dependencies, ...pkg.devDependencies };
@@ -1720,8 +1785,8 @@ async function hasReact(targetDir) {
1720
1785
  }
1721
1786
  async function hasNextJs(targetDir) {
1722
1787
  try {
1723
- const pkgPath = join17(targetDir, "package.json");
1724
- if (existsSync7(pkgPath)) {
1788
+ const pkgPath = join18(targetDir, "package.json");
1789
+ if (existsSync8(pkgPath)) {
1725
1790
  const content = await readFile4(pkgPath, "utf-8");
1726
1791
  const pkg = JSON.parse(content);
1727
1792
  const deps = { ...pkg.dependencies, ...pkg.devDependencies };
@@ -2000,7 +2065,7 @@ async function generateEslint(targetDir, usesTypeScript, force = false) {
2000
2065
  } else {
2001
2066
  config = generateJsConfig();
2002
2067
  }
2003
- const configPath = join17(targetDir, "eslint.config.mjs");
2068
+ const configPath = join18(targetDir, "eslint.config.mjs");
2004
2069
  const writeResult = await writeFileSafe(configPath, config);
2005
2070
  if (writeResult.backedUp) {
2006
2071
  result.backedUp.push("eslint.config.mjs");
@@ -2010,7 +2075,7 @@ async function generateEslint(targetDir, usesTypeScript, force = false) {
2010
2075
  }
2011
2076
 
2012
2077
  // src/generators/quick-reference.ts
2013
- import { join as join18 } from "path";
2078
+ import { join as join19 } from "path";
2014
2079
  async function generateQuickReference(targetDir, pm) {
2015
2080
  const result = {
2016
2081
  created: [],
@@ -2018,7 +2083,7 @@ async function generateQuickReference(targetDir, pm) {
2018
2083
  skipped: [],
2019
2084
  backedUp: []
2020
2085
  };
2021
- const quickRefPath = join18(targetDir, ".github", "QUICK_REFERENCE.md");
2086
+ const quickRefPath = join19(targetDir, ".github", "QUICK_REFERENCE.md");
2022
2087
  const content = `# RaftStack Quick Reference
2023
2088
 
2024
2089
  > One-page guide for the RaftStack Git workflow
@@ -2152,7 +2217,7 @@ ${pm.run} test
2152
2217
  }
2153
2218
 
2154
2219
  // src/generators/shared-configs.ts
2155
- import { join as join19 } from "path";
2220
+ import { join as join20 } from "path";
2156
2221
  function getEslintConfigPackageJson() {
2157
2222
  return JSON.stringify(
2158
2223
  {
@@ -2418,15 +2483,15 @@ async function generateSharedConfigs(targetDir, projectType) {
2418
2483
  if (!isMonorepo(projectType)) {
2419
2484
  return result;
2420
2485
  }
2421
- const packagesDir = join19(targetDir, "packages");
2422
- const eslintConfigDir = join19(packagesDir, "eslint-config");
2486
+ const packagesDir = join20(targetDir, "packages");
2487
+ const eslintConfigDir = join20(packagesDir, "eslint-config");
2423
2488
  await ensureDir(eslintConfigDir);
2424
2489
  const eslintFiles = [
2425
- { path: join19(eslintConfigDir, "package.json"), content: getEslintConfigPackageJson(), name: "packages/eslint-config/package.json" },
2426
- { path: join19(eslintConfigDir, "base.js"), content: getBaseEslintConfig(), name: "packages/eslint-config/base.js" },
2427
- { path: join19(eslintConfigDir, "next.js"), content: getNextJsEslintConfig(), name: "packages/eslint-config/next.js" },
2428
- { path: join19(eslintConfigDir, "react-internal.js"), content: getReactInternalEslintConfig(), name: "packages/eslint-config/react-internal.js" },
2429
- { path: join19(eslintConfigDir, "vite.js"), content: getViteEslintConfig(), name: "packages/eslint-config/vite.js" }
2490
+ { path: join20(eslintConfigDir, "package.json"), content: getEslintConfigPackageJson(), name: "packages/eslint-config/package.json" },
2491
+ { path: join20(eslintConfigDir, "base.js"), content: getBaseEslintConfig(), name: "packages/eslint-config/base.js" },
2492
+ { path: join20(eslintConfigDir, "next.js"), content: getNextJsEslintConfig(), name: "packages/eslint-config/next.js" },
2493
+ { path: join20(eslintConfigDir, "react-internal.js"), content: getReactInternalEslintConfig(), name: "packages/eslint-config/react-internal.js" },
2494
+ { path: join20(eslintConfigDir, "vite.js"), content: getViteEslintConfig(), name: "packages/eslint-config/vite.js" }
2430
2495
  ];
2431
2496
  for (const file of eslintFiles) {
2432
2497
  const writeResult = await writeFileSafe(file.path, file.content, { backup: true });
@@ -2437,14 +2502,14 @@ async function generateSharedConfigs(targetDir, projectType) {
2437
2502
  }
2438
2503
  }
2439
2504
  }
2440
- const tsConfigDir = join19(packagesDir, "typescript-config");
2505
+ const tsConfigDir = join20(packagesDir, "typescript-config");
2441
2506
  await ensureDir(tsConfigDir);
2442
2507
  const tsFiles = [
2443
- { path: join19(tsConfigDir, "package.json"), content: getTsConfigPackageJson(), name: "packages/typescript-config/package.json" },
2444
- { path: join19(tsConfigDir, "base.json"), content: getBaseTsConfig(), name: "packages/typescript-config/base.json" },
2445
- { path: join19(tsConfigDir, "nextjs.json"), content: getNextJsTsConfig(), name: "packages/typescript-config/nextjs.json" },
2446
- { path: join19(tsConfigDir, "react-library.json"), content: getReactLibraryTsConfig(), name: "packages/typescript-config/react-library.json" },
2447
- { path: join19(tsConfigDir, "node-library.json"), content: getNodeLibraryTsConfig(), name: "packages/typescript-config/node-library.json" }
2508
+ { path: join20(tsConfigDir, "package.json"), content: getTsConfigPackageJson(), name: "packages/typescript-config/package.json" },
2509
+ { path: join20(tsConfigDir, "base.json"), content: getBaseTsConfig(), name: "packages/typescript-config/base.json" },
2510
+ { path: join20(tsConfigDir, "nextjs.json"), content: getNextJsTsConfig(), name: "packages/typescript-config/nextjs.json" },
2511
+ { path: join20(tsConfigDir, "react-library.json"), content: getReactLibraryTsConfig(), name: "packages/typescript-config/react-library.json" },
2512
+ { path: join20(tsConfigDir, "node-library.json"), content: getNodeLibraryTsConfig(), name: "packages/typescript-config/node-library.json" }
2448
2513
  ];
2449
2514
  for (const file of tsFiles) {
2450
2515
  const writeResult = await writeFileSafe(file.path, file.content, { backup: true });
@@ -2460,10 +2525,10 @@ async function generateSharedConfigs(targetDir, projectType) {
2460
2525
 
2461
2526
  // src/utils/git.ts
2462
2527
  import { execa } from "execa";
2463
- import { existsSync as existsSync8 } from "fs";
2464
- import { join as join20 } from "path";
2528
+ import { existsSync as existsSync9 } from "fs";
2529
+ import { join as join21 } from "path";
2465
2530
  async function isGitRepo(targetDir = process.cwd()) {
2466
- if (existsSync8(join20(targetDir, ".git"))) {
2531
+ if (existsSync9(join21(targetDir, ".git"))) {
2467
2532
  return true;
2468
2533
  }
2469
2534
  try {
@@ -2636,6 +2701,7 @@ async function runInit(targetDir = process.cwd()) {
2636
2701
  includeAsana: !!config.asanaBaseUrl
2637
2702
  }));
2638
2703
  results.push(await generateClaudeCommands(targetDir));
2704
+ results.push(await generateClaudeConfig(targetDir));
2639
2705
  results.push(await updateProjectPackageJson(targetDir, config));
2640
2706
  spinner5.stop("Configuration files generated!");
2641
2707
  } catch (error) {
@@ -3633,7 +3699,7 @@ async function runInstallCommands(targetDir = process.cwd()) {
3633
3699
  // package.json
3634
3700
  var package_default = {
3635
3701
  name: "@raftlabs/raftstack",
3636
- version: "1.9.1",
3702
+ version: "1.9.2",
3637
3703
  description: "CLI tool for setting up Git hooks, commit conventions, and GitHub integration",
3638
3704
  type: "module",
3639
3705
  main: "./dist/index.js",
@@ -3651,7 +3717,9 @@ var package_default = {
3651
3717
  "dist",
3652
3718
  "templates",
3653
3719
  ".claude/skills",
3654
- ".claude/commands"
3720
+ ".claude/commands",
3721
+ ".claude/subagents",
3722
+ ".claude/settings.json"
3655
3723
  ],
3656
3724
  scripts: {
3657
3725
  build: "tsup",