@maggit/claude-workspace 0.1.1

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.
Files changed (52) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +228 -0
  3. package/assets/claude-md/default.md +34 -0
  4. package/assets/claude-md/engineering-exec.md +34 -0
  5. package/assets/claude-md/indie-maker.md +33 -0
  6. package/assets/claude-md/marketing.md +33 -0
  7. package/assets/profiles/default.json +46 -0
  8. package/assets/profiles/engineering-exec.json +42 -0
  9. package/assets/profiles/indie-maker.json +32 -0
  10. package/assets/profiles/marketing.json +27 -0
  11. package/assets/skills/adr/SKILL.md +66 -0
  12. package/assets/skills/apidoc/SKILL.md +78 -0
  13. package/assets/skills/changelog/SKILL.md +54 -0
  14. package/assets/skills/commit/SKILL.md +18 -0
  15. package/assets/skills/completetodo/SKILL.md +75 -0
  16. package/assets/skills/createtodo/SKILL.md +79 -0
  17. package/assets/skills/deadcode/SKILL.md +56 -0
  18. package/assets/skills/debug/SKILL.md +62 -0
  19. package/assets/skills/deps/SKILL.md +66 -0
  20. package/assets/skills/e2e/SKILL.md +68 -0
  21. package/assets/skills/eng-spec/SKILL.md +93 -0
  22. package/assets/skills/envcheck/SKILL.md +65 -0
  23. package/assets/skills/explain/SKILL.md +52 -0
  24. package/assets/skills/landing-page-copy/SKILL.md +95 -0
  25. package/assets/skills/meeting-notes/SKILL.md +90 -0
  26. package/assets/skills/migration/SKILL.md +61 -0
  27. package/assets/skills/openpr/SKILL.md +143 -0
  28. package/assets/skills/opentodos/SKILL.md +79 -0
  29. package/assets/skills/perf/SKILL.md +58 -0
  30. package/assets/skills/prd/SKILL.md +71 -0
  31. package/assets/skills/readme/SKILL.md +55 -0
  32. package/assets/skills/rebase/SKILL.md +59 -0
  33. package/assets/skills/release/SKILL.md +64 -0
  34. package/assets/skills/release-plan/SKILL.md +107 -0
  35. package/assets/skills/requirements/SKILL.md +77 -0
  36. package/assets/skills/seo-brief/SKILL.md +88 -0
  37. package/assets/skills/standup/SKILL.md +48 -0
  38. package/assets/skills/storecontext/SKILL.md +76 -0
  39. package/assets/skills/summary/SKILL.md +72 -0
  40. package/assets/skills/test/SKILL.md +55 -0
  41. package/assets/skills/testcoverage/SKILL.md +57 -0
  42. package/assets/skills/todo/SKILL.md +84 -0
  43. package/assets/templates/DECISION_RECORD_TEMPLATE.md +59 -0
  44. package/assets/templates/ENG_SPEC_TEMPLATE.md +84 -0
  45. package/assets/templates/PRD_TEMPLATE.md +72 -0
  46. package/assets/templates/PROJECT_INDEX_TEMPLATE.md +65 -0
  47. package/assets/templates/WEEKLY_REVIEW_TEMPLATE.md +57 -0
  48. package/assets/vault/README.md +34 -0
  49. package/assets/vault/_index.md +27 -0
  50. package/dist/bin.js +888 -0
  51. package/dist/bin.js.map +1 -0
  52. package/package.json +60 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/cli.ts","../src/constants.ts","../src/commands/init.ts","../src/actions/init.ts","../src/utils/logger.ts","../src/utils/fs.ts","../src/services/prompts.ts","../src/services/profiles.ts","../src/utils/paths.ts","../src/services/scaffold-claude-dir.ts","../src/services/scaffold-vault.ts","../src/services/claude-md.ts","../src/services/config.ts","../src/services/active-profile.ts","../src/commands/doctor.ts","../src/actions/doctor.ts","../src/commands/print-claude-md.ts","../src/actions/print-claude-md.ts","../src/commands/add-skill.ts","../src/actions/add-skill.ts","../src/services/skills.ts","../src/bin.ts"],"sourcesContent":["import { Command } from \"commander\";\nimport { VERSION } from \"./constants.js\";\nimport { createInitCommand } from \"./commands/init.js\";\nimport { createDoctorCommand } from \"./commands/doctor.js\";\nimport { createPrintClaudeMdCommand } from \"./commands/print-claude-md.js\";\nimport { createAddSkillCommand } from \"./commands/add-skill.js\";\n\nexport function createProgram(): Command {\n const program = new Command();\n\n program\n .name(\"cws\")\n .description(\"Dotfiles for Claude — scaffold Claude workspaces into any project\")\n .version(VERSION);\n\n program.addCommand(createInitCommand());\n program.addCommand(createDoctorCommand());\n program.addCommand(createPrintClaudeMdCommand());\n program.addCommand(createAddSkillCommand());\n\n return program;\n}\n","export const VERSION = \"0.1.0\";\n\nexport const CLAUDE_DIR = \".claude\";\nexport const CLAUDE_EXAMPLE_FILE = \"CLAUDE.example.md\";\nexport const CLAUDE_MD_FILE = \"CLAUDE.md\";\nexport const CONFIG_FILE = \"config.json\";\nexport const ACTIVE_PROFILE_FILE = \"active.json\";\n\nexport const CLAUDE_SUBDIRS = [\n \"skills\",\n \"templates\",\n \"snippets\",\n \"logs\",\n \"profiles\",\n] as const;\n\nexport const VAULT_FOLDERS = [\n \"00_inbox\",\n \"01_specs\",\n \"02_architecture\",\n \"03_decisions\",\n \"04_knowledge\",\n \"05_prompts\",\n \"06_agents\",\n \"07_diagrams\",\n \"08_todos\",\n] as const;\n\nexport const DEFAULT_VAULT_NAME = \"ContextDB\";\n\nexport const DEFAULT_PROFILE = \"default\";\n\nexport const PROFILES = [\n \"default\",\n \"engineering-exec\",\n \"indie-maker\",\n \"marketing\",\n] as const;\n","import { Command } from \"commander\";\nimport { DEFAULT_PROFILE, DEFAULT_VAULT_NAME, PROFILES } from \"../constants.js\";\nimport { initAction } from \"../actions/init.js\";\n\nexport function createInitCommand(): Command {\n return new Command(\"init\")\n .description(\"Scaffold a Claude workspace into a project directory\")\n .option(\"-d, --dir <path>\", \"Target directory\", process.cwd())\n .option(\n `-p, --profile <name>`,\n `Profile to use (${PROFILES.join(\", \")})`,\n DEFAULT_PROFILE,\n )\n .option(\"--vault <name>\", \"Vault folder name\", DEFAULT_VAULT_NAME)\n .option(\n \"--force\",\n \"Overwrite user-modified managed files (with backup)\",\n false,\n )\n .option(\"--dry-run\", \"Show what would be done without making changes\", false)\n .option(\"-y, --yes\", \"Skip interactive prompts, use defaults\", false)\n .action(async (opts) => {\n await initAction({\n dir: opts.dir,\n profile: opts.profile,\n vault: opts.vault,\n force: opts.force,\n dryRun: opts.dryRun,\n yes: opts.yes,\n });\n });\n}\n","import path from \"node:path\";\nimport ora from \"ora\";\nimport { log } from \"../utils/logger.js\";\nimport { fileExists } from \"../utils/fs.js\";\nimport { CLAUDE_MD_FILE, CLAUDE_EXAMPLE_FILE } from \"../constants.js\";\nimport { runInitPrompts } from \"../services/prompts.js\";\nimport { loadProfile } from \"../services/profiles.js\";\nimport { scaffoldClaudeDir } from \"../services/scaffold-claude-dir.js\";\nimport { scaffoldVault } from \"../services/scaffold-vault.js\";\nimport { generateClaudeMdContent, writeClaudeExampleMd } from \"../services/claude-md.js\";\nimport { createConfig, writeConfig } from \"../services/config.js\";\nimport { readActiveProfile, writeActiveProfile } from \"../services/active-profile.js\";\nimport type { InitOptions } from \"../types.js\";\n\nexport async function initAction(opts: InitOptions): Promise<void> {\n const targetDir = path.resolve(opts.dir);\n\n if (opts.dryRun) {\n log.info(\"Dry run mode — no changes will be made.\\n\");\n }\n\n // 1. Interactive prompts (skipped with --yes)\n const answers = await runInitPrompts(opts);\n const profileName = answers.profile;\n const vaultName = answers.vault;\n\n // 2. Load profile\n const spinner = ora(\"Loading profile...\").start();\n let profile;\n try {\n profile = await loadProfile(profileName);\n spinner.succeed(`Profile: ${profile.name} — ${profile.description}`);\n } catch (err) {\n spinner.fail(\"Failed to load profile\");\n log.error((err as Error).message);\n process.exit(1);\n }\n\n // 3. Read existing active profile for idempotency\n const existingActive = await readActiveProfile(targetDir);\n\n // 4. Scaffold .claude/ directories and copy files\n log.step(\"Scaffolding .claude/ directory...\");\n const { managedFiles } = await scaffoldClaudeDir(targetDir, profile, {\n force: opts.force,\n dryRun: opts.dryRun,\n }, existingActive);\n\n // 5. Scaffold vault\n log.step(`Scaffolding vault: ${vaultName}/...`);\n await scaffoldVault(targetDir, vaultName, { dryRun: opts.dryRun });\n\n // 6. Generate and write CLAUDE.example.md (never touches CLAUDE.md)\n log.step(`Generating ${CLAUDE_EXAMPLE_FILE}...`);\n const claudeMdContent = await generateClaudeMdContent(profile, vaultName);\n await writeClaudeExampleMd(targetDir, claudeMdContent, {\n dryRun: opts.dryRun,\n });\n\n // 7. Write config\n const config = createConfig(profileName, vaultName);\n await writeConfig(targetDir, config, { dryRun: opts.dryRun });\n\n // 8. Write active profile\n await writeActiveProfile(targetDir, profileName, managedFiles, {\n dryRun: opts.dryRun,\n });\n\n // Done\n console.log(\"\");\n log.success(`Workspace initialized with profile \"${profileName}\"!`);\n log.info(` Vault: ${vaultName}/`);\n log.info(` Skills: ${profile.skills.length} installed`);\n log.info(` Templates: ${profile.templates.length} installed`);\n\n // Guide user on CLAUDE.md setup\n const hasClaudeMd = await fileExists(path.join(targetDir, CLAUDE_MD_FILE));\n console.log(\"\");\n if (hasClaudeMd) {\n log.info(` ${CLAUDE_EXAMPLE_FILE} has been written.`);\n log.info(` You already have a ${CLAUDE_MD_FILE} — merge the example content into it as needed.`);\n } else {\n log.info(` ${CLAUDE_EXAMPLE_FILE} has been written.`);\n log.info(` Rename it to ${CLAUDE_MD_FILE} to activate: mv ${CLAUDE_EXAMPLE_FILE} ${CLAUDE_MD_FILE}`);\n }\n\n console.log(\"\");\n log.info(\"Run 'cws doctor' to verify your workspace.\");\n}\n","import chalk from \"chalk\";\n\nexport const log = {\n info(msg: string): void {\n console.log(chalk.blue(\"ℹ\"), msg);\n },\n\n success(msg: string): void {\n console.log(chalk.green(\"✔\"), msg);\n },\n\n warn(msg: string): void {\n console.log(chalk.yellow(\"⚠\"), msg);\n },\n\n error(msg: string): void {\n console.error(chalk.red(\"✖\"), msg);\n },\n\n step(msg: string): void {\n console.log(chalk.cyan(\"→\"), msg);\n },\n\n dryRun(msg: string): void {\n console.log(chalk.magenta(\"[dry-run]\"), msg);\n },\n\n pass(msg: string): void {\n console.log(chalk.green(\"PASS\"), msg);\n },\n\n fail(msg: string): void {\n console.log(chalk.red(\"FAIL\"), msg);\n },\n\n plain(msg: string): void {\n console.log(msg);\n },\n};\n","import fs from \"fs-extra\";\nimport crypto from \"node:crypto\";\nimport path from \"node:path\";\n\nexport async function fileExists(filePath: string): Promise<boolean> {\n try {\n await fs.access(filePath);\n return true;\n } catch {\n return false;\n }\n}\n\nexport async function hashFile(filePath: string): Promise<string> {\n const content = await fs.readFile(filePath, \"utf-8\");\n return hashString(content);\n}\n\nexport function hashString(content: string): string {\n return crypto.createHash(\"sha256\").update(content).digest(\"hex\");\n}\n\nexport async function backupFile(filePath: string): Promise<string> {\n const timestamp = Date.now();\n const ext = path.extname(filePath);\n const base = ext ? filePath.slice(0, -ext.length) : filePath;\n const backupPath = `${base}.bak.${timestamp}${ext}`;\n await fs.copy(filePath, backupPath);\n return backupPath;\n}\n\nexport async function safeWriteFile(\n filePath: string,\n content: string,\n): Promise<void> {\n await fs.ensureDir(path.dirname(filePath));\n await fs.writeFile(filePath, content, \"utf-8\");\n}\n\nexport async function safeReadFile(filePath: string): Promise<string | null> {\n try {\n return await fs.readFile(filePath, \"utf-8\");\n } catch {\n return null;\n }\n}\n","import prompts from \"prompts\";\nimport { DEFAULT_PROFILE, DEFAULT_VAULT_NAME, PROFILES } from \"../constants.js\";\nimport type { InitOptions } from \"../types.js\";\n\nexport interface PromptResult {\n profile: string;\n vault: string;\n}\n\nexport async function runInitPrompts(\n opts: InitOptions,\n): Promise<PromptResult> {\n if (opts.yes) {\n return {\n profile: opts.profile,\n vault: opts.vault,\n };\n }\n\n const response = await prompts(\n [\n {\n type: \"select\",\n name: \"profile\",\n message: \"Which profile would you like to use?\",\n choices: PROFILES.map((p) => ({ title: p, value: p })),\n initial: PROFILES.indexOf(\n opts.profile as (typeof PROFILES)[number],\n ),\n },\n {\n type: \"text\",\n name: \"vault\",\n message: \"Vault folder name?\",\n initial: opts.vault || DEFAULT_VAULT_NAME,\n },\n ],\n {\n onCancel: () => {\n process.exit(1);\n },\n },\n );\n\n return {\n profile: response.profile || DEFAULT_PROFILE,\n vault: response.vault || DEFAULT_VAULT_NAME,\n };\n}\n","import path from \"node:path\";\nimport fs from \"fs-extra\";\nimport { getProfilesDir } from \"../utils/paths.js\";\nimport type { Profile } from \"../types.js\";\nimport { PROFILES } from \"../constants.js\";\n\nexport async function loadProfile(name: string): Promise<Profile> {\n if (!PROFILES.includes(name as (typeof PROFILES)[number])) {\n throw new Error(\n `Unknown profile \"${name}\". Available profiles: ${PROFILES.join(\", \")}`,\n );\n }\n\n const profilePath = path.join(getProfilesDir(), `${name}.json`);\n const content = await fs.readFile(profilePath, \"utf-8\");\n return JSON.parse(content) as Profile;\n}\n\nexport async function listProfiles(): Promise<Profile[]> {\n const profiles: Profile[] = [];\n for (const name of PROFILES) {\n profiles.push(await loadProfile(name));\n }\n return profiles;\n}\n","import path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = path.dirname(__filename);\n\n/**\n * Returns the assets directory path.\n * In development (src/utils/), goes up two levels to packages/cli/assets.\n * In built (dist/), goes up one level to packages/cli/assets.\n */\nexport function getAssetsDir(): string {\n // From dist/bin.js → __dirname = .../packages/cli/dist → ../assets\n // From src/utils/paths.ts → __dirname = .../packages/cli/src/utils → ../../assets\n // Detect by checking if we're inside a \"src\" directory\n const inSrc = __dirname.includes(path.sep + \"src\");\n const cliRoot = inSrc\n ? path.resolve(__dirname, \"..\", \"..\")\n : path.resolve(__dirname, \"..\");\n const assetsDir = path.join(cliRoot, \"assets\");\n return assetsDir;\n}\n\nexport function getSkillsDir(): string {\n return path.join(getAssetsDir(), \"skills\");\n}\n\nexport function getTemplatesDir(): string {\n return path.join(getAssetsDir(), \"templates\");\n}\n\nexport function getProfilesDir(): string {\n return path.join(getAssetsDir(), \"profiles\");\n}\n\nexport function getClaudeMdTemplatesDir(): string {\n return path.join(getAssetsDir(), \"claude-md\");\n}\n\nexport function getVaultTemplatesDir(): string {\n return path.join(getAssetsDir(), \"vault\");\n}\n","import path from \"node:path\";\nimport fs from \"fs-extra\";\nimport { CLAUDE_DIR, CLAUDE_SUBDIRS } from \"../constants.js\";\nimport { getSkillsDir, getTemplatesDir } from \"../utils/paths.js\";\nimport { fileExists, hashFile, hashString, backupFile, safeWriteFile } from \"../utils/fs.js\";\nimport { log } from \"../utils/logger.js\";\nimport type { ManagedFile, ActiveProfile, Profile } from \"../types.js\";\n\nexport interface ScaffoldResult {\n managedFiles: ManagedFile[];\n}\n\nexport async function scaffoldClaudeDir(\n targetDir: string,\n profile: Profile,\n options: { force: boolean; dryRun: boolean },\n existingActive: ActiveProfile | null,\n): Promise<ScaffoldResult> {\n const claudeDir = path.join(targetDir, CLAUDE_DIR);\n const managedFiles: ManagedFile[] = [];\n\n // Create .claude/ subdirectories\n for (const subdir of CLAUDE_SUBDIRS) {\n const dir = path.join(claudeDir, subdir);\n if (options.dryRun) {\n if (!(await fileExists(dir))) {\n log.dryRun(`Would create directory: ${CLAUDE_DIR}/${subdir}/`);\n }\n } else {\n await fs.ensureDir(dir);\n }\n }\n\n // Build a map of existing managed file hashes for idempotency\n const existingHashes = buildExistingHashes(existingActive);\n\n // Copy skill directories (each skill is a <name>/SKILL.md)\n for (const skillName of profile.skills) {\n const result = await installSingleSkill(\n targetDir,\n skillName,\n existingHashes,\n options,\n );\n if (result) {\n managedFiles.push(result);\n }\n }\n\n // Copy template files\n const templatesSrcDir = getTemplatesDir();\n for (const templateFile of profile.templates) {\n const srcPath = path.join(templatesSrcDir, templateFile);\n const destPath = path.join(claudeDir, \"templates\", templateFile);\n const relativePath = path.join(CLAUDE_DIR, \"templates\", templateFile);\n\n const result = await copyManagedFile(\n srcPath,\n destPath,\n relativePath,\n existingHashes,\n options,\n );\n if (result) {\n managedFiles.push(result);\n }\n }\n\n return { managedFiles };\n}\n\n/**\n * Installs a single skill to .claude/skills/<name>/SKILL.md.\n * Reused by both `init` (via scaffoldClaudeDir) and `add-skill`.\n */\nexport async function installSingleSkill(\n targetDir: string,\n skillName: string,\n existingHashes: Map<string, string>,\n options: { force: boolean; dryRun: boolean },\n): Promise<ManagedFile | null> {\n const claudeDir = path.join(targetDir, CLAUDE_DIR);\n const skillsSrcDir = getSkillsDir();\n const srcPath = path.join(skillsSrcDir, skillName, \"SKILL.md\");\n const destDir = path.join(claudeDir, \"skills\", skillName);\n const destPath = path.join(destDir, \"SKILL.md\");\n const relativePath = path.join(CLAUDE_DIR, \"skills\", skillName, \"SKILL.md\");\n\n if (options.dryRun) {\n if (!(await fileExists(destDir))) {\n log.dryRun(`Would create directory: ${CLAUDE_DIR}/skills/${skillName}/`);\n }\n } else {\n await fs.ensureDir(destDir);\n }\n\n return copyManagedFile(srcPath, destPath, relativePath, existingHashes, options);\n}\n\n/**\n * Build a hash map from an existing ActiveProfile for idempotency checks.\n */\nexport function buildExistingHashes(\n existingActive: ActiveProfile | null,\n): Map<string, string> {\n const hashes = new Map<string, string>();\n if (existingActive) {\n for (const mf of existingActive.managedFiles) {\n hashes.set(mf.path, mf.hash);\n }\n }\n return hashes;\n}\n\nexport async function copyManagedFile(\n srcPath: string,\n destPath: string,\n relativePath: string,\n existingHashes: Map<string, string>,\n options: { force: boolean; dryRun: boolean },\n): Promise<ManagedFile | null> {\n const srcContent = await fs.readFile(srcPath, \"utf-8\");\n const srcHash = hashString(srcContent);\n\n if (await fileExists(destPath)) {\n const destHash = await hashFile(destPath);\n const previousHash = existingHashes.get(relativePath);\n\n // File unchanged from what we installed — skip\n if (destHash === srcHash) {\n return { path: relativePath, hash: srcHash };\n }\n\n // File exists but is NOT tracked in active.json — it's unmanaged\n if (!previousHash && !options.force) {\n log.warn(\n `Skipping ${relativePath} (already exists, not managed). ` +\n `Delete it and re-run to reinstall, or use --force to overwrite.`,\n );\n return null;\n }\n\n // File was modified by user (hash doesn't match what we installed)\n if (previousHash && destHash !== previousHash && !options.force) {\n log.warn(`Skipping ${relativePath} (modified by user). Use --force to overwrite.`);\n return { path: relativePath, hash: destHash };\n }\n\n // Overwrite with backup\n if (options.dryRun) {\n log.dryRun(`Would update: ${relativePath}`);\n } else {\n const backupPath = await backupFile(destPath);\n log.step(`Backed up ${relativePath} → ${path.basename(backupPath)}`);\n await safeWriteFile(destPath, srcContent);\n log.success(`Updated ${relativePath}`);\n }\n } else {\n if (options.dryRun) {\n log.dryRun(`Would create: ${relativePath}`);\n } else {\n await safeWriteFile(destPath, srcContent);\n log.success(`Created ${relativePath}`);\n }\n }\n\n return { path: relativePath, hash: srcHash };\n}\n","import path from \"node:path\";\nimport fs from \"fs-extra\";\nimport { VAULT_FOLDERS } from \"../constants.js\";\nimport { getVaultTemplatesDir } from \"../utils/paths.js\";\nimport { fileExists, safeWriteFile } from \"../utils/fs.js\";\nimport { log } from \"../utils/logger.js\";\n\nexport async function scaffoldVault(\n targetDir: string,\n vaultName: string,\n options: { dryRun: boolean },\n): Promise<void> {\n const vaultDir = path.join(targetDir, vaultName);\n\n // Create vault root\n if (options.dryRun) {\n if (!(await fileExists(vaultDir))) {\n log.dryRun(`Would create vault: ${vaultName}/`);\n }\n } else {\n await fs.ensureDir(vaultDir);\n }\n\n // Create numbered subdirectories with .gitkeep\n for (const folder of VAULT_FOLDERS) {\n const folderPath = path.join(vaultDir, folder);\n const gitkeepPath = path.join(folderPath, \".gitkeep\");\n\n if (options.dryRun) {\n if (!(await fileExists(folderPath))) {\n log.dryRun(`Would create: ${vaultName}/${folder}/`);\n }\n } else {\n await fs.ensureDir(folderPath);\n if (!(await fileExists(gitkeepPath))) {\n await safeWriteFile(gitkeepPath, \"\");\n }\n }\n }\n\n // Copy vault README\n const vaultTemplatesDir = getVaultTemplatesDir();\n const readmeSrc = path.join(vaultTemplatesDir, \"README.md\");\n const readmeDest = path.join(vaultDir, \"README.md\");\n\n if (!(await fileExists(readmeDest))) {\n if (options.dryRun) {\n log.dryRun(`Would create: ${vaultName}/README.md`);\n } else {\n const content = await fs.readFile(readmeSrc, \"utf-8\");\n await safeWriteFile(readmeDest, content);\n log.success(`Created ${vaultName}/README.md`);\n }\n }\n\n // Copy vault _index.md\n const indexSrc = path.join(vaultTemplatesDir, \"_index.md\");\n const indexDest = path.join(vaultDir, \"_index.md\");\n\n if (!(await fileExists(indexDest))) {\n if (options.dryRun) {\n log.dryRun(`Would create: ${vaultName}/_index.md`);\n } else {\n const content = await fs.readFile(indexSrc, \"utf-8\");\n await safeWriteFile(indexDest, content);\n log.success(`Created ${vaultName}/_index.md`);\n }\n }\n}\n","import path from \"node:path\";\nimport fs from \"fs-extra\";\nimport {\n CLAUDE_EXAMPLE_FILE,\n VAULT_FOLDERS,\n} from \"../constants.js\";\nimport { getClaudeMdTemplatesDir } from \"../utils/paths.js\";\nimport { safeWriteFile } from \"../utils/fs.js\";\nimport { log } from \"../utils/logger.js\";\nimport type { Profile } from \"../types.js\";\n\n/**\n * Generate CLAUDE.md content from a profile template.\n */\nexport async function generateClaudeMdContent(\n profile: Profile,\n vaultName: string,\n): Promise<string> {\n const templateDir = getClaudeMdTemplatesDir();\n const templatePath = path.join(templateDir, profile.claudeMdTemplate);\n const template = await fs.readFile(templatePath, \"utf-8\");\n\n const folderList = VAULT_FOLDERS.map(\n (f) => `- \\`${vaultName}/${f}/\\``,\n ).join(\"\\n\");\n\n const skillInstructions = profile.skills.length > 0\n ? `Available skills:\\n${profile.skills.map((s) => `- \\`${s}\\` — see \\`.claude/skills/${s}\\` for usage`).join(\"\\n\")}`\n : \"No skills installed for this profile.\";\n\n const namingConvention = [\n \"- Use lowercase with hyphens: `my-feature-spec.md`\",\n \"- Prefix with date when chronology matters: `2026-02-07-auth-decision.md`\",\n \"- Keep filenames descriptive and specific\",\n \"- One topic per file\",\n ].join(\"\\n\");\n\n const content = template\n .replace(/\\{\\{vaultPath\\}\\}/g, vaultName)\n .replace(/\\{\\{folderList\\}\\}/g, folderList)\n .replace(/\\{\\{skillInstructions\\}\\}/g, skillInstructions)\n .replace(/\\{\\{namingConvention\\}\\}/g, namingConvention);\n\n return content;\n}\n\n/**\n * Write CLAUDE.example.md into the target directory.\n *\n * Always writes to CLAUDE.example.md so we never overwrite an existing\n * user CLAUDE.md. The user can rename or merge it themselves.\n */\nexport async function writeClaudeExampleMd(\n targetDir: string,\n content: string,\n options: { dryRun: boolean },\n): Promise<void> {\n const examplePath = path.join(targetDir, CLAUDE_EXAMPLE_FILE);\n\n if (options.dryRun) {\n log.dryRun(`Would write ${CLAUDE_EXAMPLE_FILE}`);\n return;\n }\n\n await safeWriteFile(examplePath, content);\n log.success(`Wrote ${CLAUDE_EXAMPLE_FILE}`);\n}\n","import path from \"node:path\";\nimport { CLAUDE_DIR, CONFIG_FILE, VERSION } from \"../constants.js\";\nimport { safeWriteFile, safeReadFile } from \"../utils/fs.js\";\nimport { log } from \"../utils/logger.js\";\nimport type { ClaudeConfig } from \"../types.js\";\n\nexport function createConfig(profile: string, vaultPath: string): ClaudeConfig {\n const now = new Date().toISOString();\n return {\n version: VERSION,\n profile,\n vaultPath,\n createdAt: now,\n updatedAt: now,\n };\n}\n\nexport async function writeConfig(\n targetDir: string,\n config: ClaudeConfig,\n options: { dryRun: boolean },\n): Promise<void> {\n const configPath = path.join(targetDir, CLAUDE_DIR, CONFIG_FILE);\n\n if (options.dryRun) {\n log.dryRun(`Would write ${CLAUDE_DIR}/${CONFIG_FILE}`);\n return;\n }\n\n // Preserve createdAt if config already exists\n const existing = await readConfig(targetDir);\n if (existing) {\n config.createdAt = existing.createdAt;\n }\n\n await safeWriteFile(configPath, JSON.stringify(config, null, 2) + \"\\n\");\n log.success(`Wrote ${CLAUDE_DIR}/${CONFIG_FILE}`);\n}\n\nexport async function readConfig(\n targetDir: string,\n): Promise<ClaudeConfig | null> {\n const configPath = path.join(targetDir, CLAUDE_DIR, CONFIG_FILE);\n const content = await safeReadFile(configPath);\n if (!content) return null;\n\n try {\n return JSON.parse(content) as ClaudeConfig;\n } catch {\n return null;\n }\n}\n","import path from \"node:path\";\nimport { CLAUDE_DIR, ACTIVE_PROFILE_FILE } from \"../constants.js\";\nimport { safeWriteFile, safeReadFile } from \"../utils/fs.js\";\nimport { log } from \"../utils/logger.js\";\nimport type { ActiveProfile, ManagedFile } from \"../types.js\";\n\nexport async function writeActiveProfile(\n targetDir: string,\n profile: string,\n managedFiles: ManagedFile[],\n options: { dryRun: boolean },\n): Promise<void> {\n const activePath = path.join(\n targetDir,\n CLAUDE_DIR,\n \"profiles\",\n ACTIVE_PROFILE_FILE,\n );\n\n const activeProfile: ActiveProfile = {\n profile,\n installedAt: new Date().toISOString(),\n managedFiles,\n };\n\n if (options.dryRun) {\n log.dryRun(\n `Would write ${CLAUDE_DIR}/profiles/${ACTIVE_PROFILE_FILE}`,\n );\n return;\n }\n\n await safeWriteFile(\n activePath,\n JSON.stringify(activeProfile, null, 2) + \"\\n\",\n );\n log.success(`Wrote ${CLAUDE_DIR}/profiles/${ACTIVE_PROFILE_FILE}`);\n}\n\nexport async function readActiveProfile(\n targetDir: string,\n): Promise<ActiveProfile | null> {\n const activePath = path.join(\n targetDir,\n CLAUDE_DIR,\n \"profiles\",\n ACTIVE_PROFILE_FILE,\n );\n const content = await safeReadFile(activePath);\n if (!content) return null;\n\n try {\n return JSON.parse(content) as ActiveProfile;\n } catch {\n return null;\n }\n}\n","import { Command } from \"commander\";\nimport { doctorAction } from \"../actions/doctor.js\";\n\nexport function createDoctorCommand(): Command {\n return new Command(\"doctor\")\n .description(\"Validate Claude workspace configuration and files\")\n .option(\"-d, --dir <path>\", \"Target directory\", process.cwd())\n .action(async (opts) => {\n await doctorAction({ dir: opts.dir });\n });\n}\n","import path from \"node:path\";\nimport { fileExists } from \"../utils/fs.js\";\nimport { log } from \"../utils/logger.js\";\nimport { readConfig } from \"../services/config.js\";\nimport { readActiveProfile } from \"../services/active-profile.js\";\nimport { loadProfile } from \"../services/profiles.js\";\nimport {\n CLAUDE_DIR,\n CLAUDE_EXAMPLE_FILE,\n CLAUDE_MD_FILE,\n VAULT_FOLDERS,\n} from \"../constants.js\";\nimport type { DoctorCheck } from \"../types.js\";\n\nexport async function doctorAction(opts: { dir: string }): Promise<void> {\n const targetDir = path.resolve(opts.dir);\n const checks: DoctorCheck[] = [];\n\n log.info(`Checking workspace: ${targetDir}\\n`);\n\n // 1. .claude/ directory exists\n const claudeDir = path.join(targetDir, CLAUDE_DIR);\n const claudeDirExists = await fileExists(claudeDir);\n checks.push({\n name: \".claude/ directory\",\n passed: claudeDirExists,\n message: claudeDirExists\n ? \".claude/ directory exists\"\n : \".claude/ directory not found\",\n fix: \"Run 'cws init' to create the workspace\",\n });\n\n // 2. config.json valid\n const config = await readConfig(targetDir);\n checks.push({\n name: \"config.json\",\n passed: config !== null,\n message: config\n ? `config.json valid (profile: ${config.profile})`\n : \"config.json missing or invalid\",\n fix: \"Run 'cws init' to regenerate config\",\n });\n\n // 3. active.json exists\n const active = await readActiveProfile(targetDir);\n checks.push({\n name: \"active.json\",\n passed: active !== null,\n message: active\n ? `active.json present (profile: ${active.profile})`\n : \"active.json missing\",\n fix: \"Run 'cws init' to regenerate active profile\",\n });\n\n // 4. Check skill and template files\n if (config && active) {\n try {\n const profile = await loadProfile(config.profile);\n\n // Check skills (each skill is a <name>/SKILL.md directory)\n let allSkillsPresent = true;\n for (const skill of profile.skills) {\n const skillPath = path.join(claudeDir, \"skills\", skill, \"SKILL.md\");\n if (!(await fileExists(skillPath))) {\n allSkillsPresent = false;\n checks.push({\n name: `skill: ${skill}`,\n passed: false,\n message: `Missing skill: .claude/skills/${skill}/SKILL.md`,\n fix: `Run 'cws init --force' to restore missing files`,\n });\n }\n }\n if (allSkillsPresent) {\n checks.push({\n name: \"skill files\",\n passed: true,\n message: `All ${profile.skills.length} skills present`,\n });\n }\n\n // Check templates\n let allTemplatesPresent = true;\n for (const tmpl of profile.templates) {\n const tmplPath = path.join(claudeDir, \"templates\", tmpl);\n if (!(await fileExists(tmplPath))) {\n allTemplatesPresent = false;\n checks.push({\n name: `template: ${tmpl}`,\n passed: false,\n message: `Missing template file: .claude/templates/${tmpl}`,\n fix: `Run 'cws init --force' to restore missing files`,\n });\n }\n }\n if (allTemplatesPresent) {\n checks.push({\n name: \"template files\",\n passed: true,\n message: `All ${profile.templates.length} template files present`,\n });\n }\n } catch {\n checks.push({\n name: \"profile validation\",\n passed: false,\n message: `Could not load profile \"${config.profile}\"`,\n fix: \"Check config.json profile name is valid\",\n });\n }\n }\n\n // 5. Vault directory and subfolders\n if (config) {\n const vaultDir = path.join(targetDir, config.vaultPath);\n const vaultExists = await fileExists(vaultDir);\n checks.push({\n name: \"vault directory\",\n passed: vaultExists,\n message: vaultExists\n ? `Vault directory exists: ${config.vaultPath}/`\n : `Vault directory missing: ${config.vaultPath}/`,\n fix: \"Run 'cws init' to create vault\",\n });\n\n if (vaultExists) {\n let allFoldersPresent = true;\n for (const folder of VAULT_FOLDERS) {\n const folderPath = path.join(vaultDir, folder);\n if (!(await fileExists(folderPath))) {\n allFoldersPresent = false;\n checks.push({\n name: `vault: ${folder}`,\n passed: false,\n message: `Missing vault folder: ${config.vaultPath}/${folder}/`,\n fix: \"Run 'cws init' to restore vault structure\",\n });\n }\n }\n if (allFoldersPresent) {\n checks.push({\n name: \"vault subfolders\",\n passed: true,\n message: `All ${VAULT_FOLDERS.length} vault subfolders present`,\n });\n }\n }\n }\n\n // 6. CLAUDE.md setup check\n // Pass if CLAUDE.md exists (user has activated it).\n // Also pass if CLAUDE.example.md exists (workspace was initialized, user hasn't renamed yet).\n // Only fail if neither file exists.\n const examplePath = path.join(targetDir, CLAUDE_EXAMPLE_FILE);\n const claudeMdPath = path.join(targetDir, CLAUDE_MD_FILE);\n const exampleExists = await fileExists(examplePath);\n const claudeMdExists = await fileExists(claudeMdPath);\n\n if (claudeMdExists) {\n checks.push({\n name: CLAUDE_MD_FILE,\n passed: true,\n message: `${CLAUDE_MD_FILE} present`,\n });\n } else if (exampleExists) {\n checks.push({\n name: CLAUDE_MD_FILE,\n passed: true,\n message: `${CLAUDE_EXAMPLE_FILE} present — rename to ${CLAUDE_MD_FILE} to activate`,\n fix: `mv ${CLAUDE_EXAMPLE_FILE} ${CLAUDE_MD_FILE}`,\n });\n } else {\n checks.push({\n name: CLAUDE_MD_FILE,\n passed: false,\n message: `Neither ${CLAUDE_MD_FILE} nor ${CLAUDE_EXAMPLE_FILE} found`,\n fix: \"Run 'cws init' to generate CLAUDE.example.md\",\n });\n }\n\n // Print results\n console.log(\"\");\n let failCount = 0;\n for (const check of checks) {\n if (check.passed) {\n log.pass(check.message);\n } else {\n log.fail(check.message);\n if (check.fix) {\n log.plain(` ${check.fix}`);\n }\n failCount++;\n }\n }\n\n console.log(\"\");\n if (failCount === 0) {\n log.success(\"All checks passed!\");\n } else {\n log.warn(`${failCount} check(s) failed.`);\n process.exitCode = 1;\n }\n}\n","import { Command } from \"commander\";\nimport { printClaudeMdAction } from \"../actions/print-claude-md.js\";\nimport { DEFAULT_PROFILE, DEFAULT_VAULT_NAME, PROFILES } from \"../constants.js\";\n\nexport function createPrintClaudeMdCommand(): Command {\n return new Command(\"print-claude-md\")\n .description(\"Print the generated CLAUDE.md content to stdout\")\n .option(\n `-p, --profile <name>`,\n `Profile to use (${PROFILES.join(\", \")})`,\n DEFAULT_PROFILE,\n )\n .option(\"--vault <name>\", \"Vault folder name\", DEFAULT_VAULT_NAME)\n .action(async (opts) => {\n await printClaudeMdAction({\n profile: opts.profile,\n vault: opts.vault,\n });\n });\n}\n","import { loadProfile } from \"../services/profiles.js\";\nimport { generateClaudeMdContent } from \"../services/claude-md.js\";\nimport { log } from \"../utils/logger.js\";\n\nexport async function printClaudeMdAction(opts: {\n profile: string;\n vault: string;\n}): Promise<void> {\n try {\n const profile = await loadProfile(opts.profile);\n const content = await generateClaudeMdContent(profile, opts.vault);\n process.stdout.write(content);\n } catch (err) {\n log.error((err as Error).message);\n process.exit(1);\n }\n}\n","import { Command } from \"commander\";\nimport { addSkillAction } from \"../actions/add-skill.js\";\n\nexport function createAddSkillCommand(): Command {\n return new Command(\"add-skill\")\n .description(\"Install a single skill into the workspace\")\n .argument(\"[skill-name]\", \"Name of the skill to install\")\n .option(\"-d, --dir <path>\", \"Target directory\", process.cwd())\n .option(\n \"--force\",\n \"Overwrite existing skill (with backup)\",\n false,\n )\n .option(\"--dry-run\", \"Show what would be done without making changes\", false)\n .option(\"-l, --list\", \"List all available skills\", false)\n .action(async (skillName: string | undefined, opts) => {\n await addSkillAction(skillName, {\n dir: opts.dir,\n force: opts.force,\n dryRun: opts.dryRun,\n list: opts.list,\n });\n });\n}\n","import path from \"node:path\";\nimport fs from \"fs-extra\";\nimport { log } from \"../utils/logger.js\";\nimport { CLAUDE_DIR } from \"../constants.js\";\nimport { listAvailableSkills, validateSkillName } from \"../services/skills.js\";\nimport { installSingleSkill, buildExistingHashes } from \"../services/scaffold-claude-dir.js\";\nimport { readActiveProfile, writeActiveProfile } from \"../services/active-profile.js\";\nimport type { AddSkillOptions } from \"../types.js\";\n\nexport async function addSkillAction(\n skillName: string | undefined,\n opts: AddSkillOptions,\n): Promise<void> {\n // --list: show available skills and exit\n if (opts.list) {\n const skills = await listAvailableSkills();\n log.info(`Available skills (${skills.length}):\\n`);\n const maxName = Math.max(...skills.map((s) => s.name.length));\n for (const skill of skills) {\n log.plain(` ${skill.name.padEnd(maxName + 2)}${skill.description}`);\n }\n return;\n }\n\n if (!skillName) {\n log.error(\"Please specify a skill name. Use --list to see available skills.\");\n process.exit(1);\n }\n\n const targetDir = path.resolve(opts.dir);\n\n if (opts.dryRun) {\n log.info(\"Dry run mode — no changes will be made.\\n\");\n }\n\n // Validate skill exists\n const isValid = await validateSkillName(skillName);\n if (!isValid) {\n log.error(\n `Unknown skill \"${skillName}\". Use --list to see available skills.`,\n );\n process.exit(1);\n }\n\n // Ensure .claude/skills/ and .claude/profiles/ exist\n const claudeDir = path.join(targetDir, CLAUDE_DIR);\n if (!opts.dryRun) {\n await fs.ensureDir(path.join(claudeDir, \"skills\"));\n await fs.ensureDir(path.join(claudeDir, \"profiles\"));\n }\n\n // Read existing active profile for idempotency\n const existingActive = await readActiveProfile(targetDir);\n const existingHashes = buildExistingHashes(existingActive);\n\n // Install the skill\n const result = await installSingleSkill(\n targetDir,\n skillName,\n existingHashes,\n { force: opts.force, dryRun: opts.dryRun },\n );\n\n if (!result) {\n // Skill was skipped (unmanaged or other reason)\n return;\n }\n\n // Merge into active.json\n if (!opts.dryRun) {\n const existingFiles = existingActive?.managedFiles ?? [];\n // Remove any previous entry for this path, then add the new one\n const merged = existingFiles.filter((mf) => mf.path !== result.path);\n merged.push(result);\n\n await writeActiveProfile(\n targetDir,\n existingActive?.profile ?? \"custom\",\n merged,\n { dryRun: false },\n );\n }\n\n console.log(\"\");\n log.success(`Skill \"${skillName}\" installed!`);\n}\n","import path from \"node:path\";\nimport fs from \"fs-extra\";\nimport { getSkillsDir } from \"../utils/paths.js\";\n\nexport interface SkillInfo {\n name: string;\n description: string;\n}\n\n/**\n * Parse YAML frontmatter from a SKILL.md file.\n * Extracts `name` and `description` fields.\n */\nexport function parseFrontmatter(content: string): { name: string; description: string } {\n const match = content.match(/^---\\n([\\s\\S]*?)\\n---/);\n if (!match) {\n return { name: \"\", description: \"\" };\n }\n\n const frontmatter = match[1];\n const nameMatch = frontmatter.match(/^name:\\s*(.+)$/m);\n const descMatch = frontmatter.match(/^description:\\s*\"?(.+?)\"?\\s*$/m);\n\n return {\n name: nameMatch ? nameMatch[1].trim() : \"\",\n description: descMatch ? descMatch[1].trim() : \"\",\n };\n}\n\n/**\n * Returns the list of available skill directory names from assets/skills/.\n */\nexport async function getAvailableSkillNames(): Promise<string[]> {\n const skillsDir = getSkillsDir();\n const entries = await fs.readdir(skillsDir, { withFileTypes: true });\n return entries\n .filter((e) => e.isDirectory())\n .map((e) => e.name)\n .sort();\n}\n\n/**\n * Returns true if the given skill name exists in assets/skills/.\n */\nexport async function validateSkillName(name: string): Promise<boolean> {\n const skillPath = path.join(getSkillsDir(), name, \"SKILL.md\");\n try {\n await fs.access(skillPath);\n return true;\n } catch {\n return false;\n }\n}\n\n/**\n * Lists all available skills with their names and descriptions.\n */\nexport async function listAvailableSkills(): Promise<SkillInfo[]> {\n const skillsDir = getSkillsDir();\n const names = await getAvailableSkillNames();\n const skills: SkillInfo[] = [];\n\n for (const name of names) {\n const content = await fs.readFile(\n path.join(skillsDir, name, \"SKILL.md\"),\n \"utf-8\",\n );\n const fm = parseFrontmatter(content);\n skills.push({\n name,\n description: fm.description || \"(no description)\",\n });\n }\n\n return skills;\n}\n","import { createProgram } from \"./cli.js\";\n\nconst program = createProgram();\nprogram.parse();\n"],"mappings":";;;AAAA,SAAS,WAAAA,gBAAe;;;ACAjB,IAAM,UAAU;AAEhB,IAAM,aAAa;AACnB,IAAM,sBAAsB;AAC5B,IAAM,iBAAiB;AACvB,IAAM,cAAc;AACpB,IAAM,sBAAsB;AAE5B,IAAM,iBAAiB;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEO,IAAM,gBAAgB;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEO,IAAM,qBAAqB;AAE3B,IAAM,kBAAkB;AAExB,IAAM,WAAW;AAAA,EACtB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;;;ACrCA,SAAS,eAAe;;;ACAxB,OAAOC,WAAU;AACjB,OAAO,SAAS;;;ACDhB,OAAO,WAAW;AAEX,IAAM,MAAM;AAAA,EACjB,KAAK,KAAmB;AACtB,YAAQ,IAAI,MAAM,KAAK,QAAG,GAAG,GAAG;AAAA,EAClC;AAAA,EAEA,QAAQ,KAAmB;AACzB,YAAQ,IAAI,MAAM,MAAM,QAAG,GAAG,GAAG;AAAA,EACnC;AAAA,EAEA,KAAK,KAAmB;AACtB,YAAQ,IAAI,MAAM,OAAO,QAAG,GAAG,GAAG;AAAA,EACpC;AAAA,EAEA,MAAM,KAAmB;AACvB,YAAQ,MAAM,MAAM,IAAI,QAAG,GAAG,GAAG;AAAA,EACnC;AAAA,EAEA,KAAK,KAAmB;AACtB,YAAQ,IAAI,MAAM,KAAK,QAAG,GAAG,GAAG;AAAA,EAClC;AAAA,EAEA,OAAO,KAAmB;AACxB,YAAQ,IAAI,MAAM,QAAQ,WAAW,GAAG,GAAG;AAAA,EAC7C;AAAA,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Ac,6BAA6B,KAAK,EACvD,OAAO,OAAO,WAA+B,SAAS;AACrD,UAAM,eAAe,WAAW;AAAA,MAC9B,KAAK,KAAK;AAAA,MACV,OAAO,KAAK;AAAA,MACZ,QAAQ,KAAK;AAAA,MACb,MAAM,KAAK;AAAA,IACb,CAAC;AAAA,EACH,CAAC;AACL;;;AlBhBO,SAAS,gBAAyB;AACvC,QAAMC,WAAU,IAAIC,SAAQ;AAE5B,EAAAD,SACG,KAAK,KAAK,EACV,YAAY,wEAAmE,EAC/E,QAAQ,OAAO;AAElB,EAAAA,SAAQ,WAAW,kBAAkB,CAAC;AACtC,EAAAA,SAAQ,WAAW,oBAAoB,CAAC;AACxC,EAAAA,SAAQ,WAAW,2BAA2B,CAAC;AAC/C,EAAAA,SAAQ,WAAW,sBAAsB,CAAC;AAE1C,SAAOA;AACT;;;AqBnBA,IAAM,UAAU,cAAc;AAC9B,QAAQ,MAAM;","names":["Command","path","path","fs","path","path","fs","path","fs","path","fs","path","fs","path","fs","path","fs","path","fs","path","path","path","path","path","Command","path","path","Command","Command","Command","Command","path","fs","path","fs","fs","path","path","fs","Command","program","Command"]}
package/package.json ADDED
@@ -0,0 +1,60 @@
1
+ {
2
+ "name": "@maggit/claude-workspace",
3
+ "version": "0.1.1",
4
+ "description": "CLI tool to scaffold Claude workspaces into any project",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "author": "Raquel Hernandez",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "https://github.com/raquelhernandez/claude-workstation.git",
11
+ "directory": "packages/cli"
12
+ },
13
+ "homepage": "https://github.com/raquelhernandez/claude-workstation",
14
+ "keywords": [
15
+ "claude",
16
+ "ai",
17
+ "workspace",
18
+ "scaffold",
19
+ "markdown",
20
+ "llm",
21
+ "cli",
22
+ "dotfiles",
23
+ "context",
24
+ "templates"
25
+ ],
26
+ "bin": {
27
+ "cws": "./dist/bin.js"
28
+ },
29
+ "files": [
30
+ "dist",
31
+ "assets"
32
+ ],
33
+ "scripts": {
34
+ "build": "tsup",
35
+ "prepublishOnly": "node ../../scripts/copy-assets.js && tsup",
36
+ "test": "vitest run",
37
+ "test:watch": "vitest"
38
+ },
39
+ "dependencies": {
40
+ "chalk": "^5.3.0",
41
+ "commander": "^12.1.0",
42
+ "fs-extra": "^11.2.0",
43
+ "ora": "^8.1.0",
44
+ "prompts": "^2.4.2"
45
+ },
46
+ "devDependencies": {
47
+ "@types/fs-extra": "^11.0.4",
48
+ "@types/node": "^20.14.0",
49
+ "@types/prompts": "^2.4.9",
50
+ "tsup": "^8.1.0",
51
+ "typescript": "^5.5.0",
52
+ "vitest": "^2.0.0"
53
+ },
54
+ "publishConfig": {
55
+ "access": "public"
56
+ },
57
+ "engines": {
58
+ "node": ">=18"
59
+ }
60
+ }