@abranjith/spec-lite 0.0.1 ā 0.0.3
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/README.md +27 -25
- package/dist/index.js +181 -42
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/prompts/architect.md +495 -0
- package/prompts/brainstorm.md +8 -8
- package/prompts/code_review.md +11 -11
- package/prompts/devops.md +9 -9
- package/prompts/feature.md +23 -23
- package/prompts/fix.md +12 -12
- package/prompts/implement.md +20 -20
- package/prompts/integration_tests.md +8 -8
- package/prompts/memorize.md +41 -20
- package/prompts/orchestrator.md +48 -41
- package/prompts/performance_review.md +7 -7
- package/prompts/planner.md +24 -24
- package/prompts/readme.md +8 -8
- package/prompts/security_audit.md +9 -9
- package/prompts/spec_help.md +22 -19
- package/prompts/technical_docs.md +11 -11
- package/prompts/unit_tests.md +12 -12
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/commands/init.ts","../src/providers/copilot.ts","../src/providers/claude-code.ts","../src/providers/generic.ts","../src/providers/index.ts","../src/utils/prompts.ts","../src/utils/stacks.ts","../src/commands/update.ts","../src/commands/list.ts"],"sourcesContent":["import { Command } from \"commander\";\r\nimport { initCommand } from \"./commands/init.js\";\r\nimport { updateCommand } from \"./commands/update.js\";\r\nimport { listCommand } from \"./commands/list.js\";\r\nimport { createRequire } from \"module\";\r\n\r\nconst require = createRequire(import.meta.url);\r\nconst pkg = require(\"../package.json\");\r\n\r\nconst program = new Command();\r\n\r\nprogram\r\n .name(\"spec-lite\")\r\n .description(\r\n \"Install structured AI sub-agent prompts into your workspace for any AI coding assistant\"\r\n )\r\n .version(pkg.version);\r\n\r\nprogram\r\n .command(\"init\")\r\n .description(\"Initialize spec-lite sub-agent prompts in your workspace\")\r\n .option(\r\n \"--ai <provider>\",\r\n \"AI provider to configure for (copilot, claude-code, generic)\"\r\n )\r\n .option(\r\n \"--exclude <prompts>\",\r\n \"Comma-separated list of prompts to exclude (e.g., brainstorm,readme)\"\r\n )\r\n .option(\"--force\", \"Overwrite existing files without prompting\", false)\r\n .option(\r\n \"--skip-profile\",\r\n \"Skip the project profile questionnaire (for CI/scripting)\"\r\n )\r\n .action(initCommand);\r\n\r\nprogram\r\n .command(\"update\")\r\n .description(\r\n \"Update spec-lite prompts to the latest version, preserving your Project Context edits\"\r\n )\r\n .option(\"--force\", \"Overwrite all files including user-modified ones\", false)\r\n .action(updateCommand);\r\n\r\nprogram\r\n .command(\"list\")\r\n .description(\"List all available spec-lite sub-agents and their purpose\")\r\n .action(listCommand);\r\n\r\nprogram.parse();\r\n","import path from \"path\";\r\nimport fs from \"fs-extra\";\r\nimport chalk from \"chalk\";\r\nimport inquirer from \"inquirer\";\r\nimport { getProvider, getAllProviders } from \"../providers/index.js\";\r\nimport type { SpecLiteConfig, ProjectProfile } from \"../providers/base.js\";\r\nimport { loadPrompts, replaceProjectContext } from \"../utils/prompts.js\";\r\nimport { generateClaudeRootMd } from \"../providers/claude-code.js\";\r\nimport { getStackSnippet } from \"../utils/stacks.js\";\r\n\r\ninterface InitOptions {\r\n ai?: string;\r\n exclude?: string;\r\n force?: boolean;\r\n skipProfile?: boolean;\r\n}\r\n\r\nconst LANGUAGE_CHOICES = [\r\n { name: \"TypeScript\", value: \"TypeScript\" },\r\n { name: \"Python\", value: \"Python\" },\r\n { name: \"Java\", value: \"Java\" },\r\n { name: \"C# / .NET\", value: \"C#\" },\r\n { name: \"Go\", value: \"Go\" },\r\n { name: \"Rust\", value: \"Rust\" },\r\n { name: \"Other (specify below)\", value: \"__other__\" },\r\n];\r\n\r\nconst ARCHITECTURE_CHOICES = [\r\n { name: \"Monolith\", value: \"Monolith\" },\r\n { name: \"Microservices\", value: \"Microservices\" },\r\n { name: \"Serverless\", value: \"Serverless\" },\r\n { name: \"Monorepo\", value: \"Monorepo\" },\r\n { name: \"Other (specify below)\", value: \"__other__\" },\r\n];\r\n\r\n/**\r\n * Collect project profile via interactive questionnaire.\r\n * Returns a ProjectProfile with the user's answers.\r\n */\r\nasync function collectProjectProfile(): Promise<ProjectProfile> {\r\n console.log(\r\n chalk.cyan(\r\n \"\\n š Project Profile ā a few questions to personalize your setup:\\n\"\r\n )\r\n );\r\n\r\n const answers = await inquirer.prompt([\r\n {\r\n type: \"list\",\r\n name: \"language\",\r\n message: \"Primary programming language?\",\r\n choices: LANGUAGE_CHOICES,\r\n },\r\n {\r\n type: \"input\",\r\n name: \"languageOther\",\r\n message: \"Specify your primary language:\",\r\n when: (prev: Record<string, string>) => prev.language === \"__other__\",\r\n validate: (input: string) =>\r\n input.trim() ? true : \"Please enter a language.\",\r\n },\r\n {\r\n type: \"input\",\r\n name: \"frameworks\",\r\n message:\r\n 'Framework(s) in use? (e.g., \"Express + React\", \"FastAPI\", \"ASP.NET Core\")',\r\n default: \"None / not sure yet\",\r\n },\r\n {\r\n type: \"input\",\r\n name: \"testFramework\",\r\n message:\r\n 'Testing framework? (e.g., \"Jest\", \"Vitest\", \"pytest\", \"xUnit\")',\r\n default: \"Not decided yet\",\r\n },\r\n {\r\n type: \"list\",\r\n name: \"architecture\",\r\n message: \"Architectural pattern?\",\r\n choices: ARCHITECTURE_CHOICES,\r\n },\r\n {\r\n type: \"input\",\r\n name: \"architectureOther\",\r\n message: \"Specify your architectural pattern:\",\r\n when: (prev: Record<string, string>) => prev.architecture === \"__other__\",\r\n validate: (input: string) =>\r\n input.trim() ? true : \"Please enter a pattern.\",\r\n },\r\n {\r\n type: \"input\",\r\n name: \"conventions\",\r\n message:\r\n 'Any specific coding conventions? (e.g., \"Airbnb style guide\", \"PEP 8\") ā leave blank if none',\r\n default: \"\",\r\n },\r\n ]);\r\n\r\n return {\r\n language:\r\n answers.language === \"__other__\"\r\n ? answers.languageOther.trim()\r\n : answers.language,\r\n frameworks: answers.frameworks.trim(),\r\n testFramework: answers.testFramework.trim(),\r\n architecture:\r\n answers.architecture === \"__other__\"\r\n ? answers.architectureOther.trim()\r\n : answers.architecture,\r\n conventions: answers.conventions.trim(),\r\n };\r\n}\r\n\r\n/**\r\n * Build a Project Context block string from a ProjectProfile.\r\n * This replaces the placeholder content inside <!-- project-context-start/end --> markers.\r\n */\r\nfunction buildProjectContextBlock(profile: ProjectProfile): string {\r\n const lines = [\r\n \"\",\r\n \"## Project Context (Customize per project)\",\r\n \"\",\r\n \"> Auto-populated by spec-lite init. Edit these values as your project evolves.\",\r\n \"\",\r\n `- **Language(s)**: ${profile.language}`,\r\n `- **Framework(s)**: ${profile.frameworks}`,\r\n `- **Test Framework**: ${profile.testFramework}`,\r\n `- **Architecture**: ${profile.architecture}`,\r\n ];\r\n if (profile.conventions) {\r\n lines.push(`- **Conventions**: ${profile.conventions}`);\r\n }\r\n lines.push(\"\");\r\n return lines.join(\"\\n\");\r\n}\r\n\r\nexport async function initCommand(options: InitOptions): Promise<void> {\r\n const cwd = process.cwd();\r\n\r\n console.log(chalk.bold(\"\\nā” spec-lite init\\n\"));\r\n\r\n // 1. Resolve provider\r\n let providerAlias = options.ai;\r\n\r\n if (!providerAlias) {\r\n const providers = getAllProviders();\r\n const answer = await inquirer.prompt([\r\n {\r\n type: \"list\",\r\n name: \"provider\",\r\n message: \"Which AI coding assistant are you using?\",\r\n choices: providers.map((p) => ({\r\n name: `${p.name} ā ${p.description}`,\r\n value: p.alias,\r\n })),\r\n },\r\n ]);\r\n providerAlias = answer.provider as string;\r\n }\r\n\r\n const provider = getProvider(providerAlias!);\r\n if (!provider) {\r\n console.error(\r\n chalk.red(\r\n `Unknown provider: \"${providerAlias}\". Available: ${getAllProviders()\r\n .map((p) => p.alias)\r\n .join(\", \")}`\r\n )\r\n );\r\n process.exit(1);\r\n }\r\n\r\n console.log(chalk.cyan(` Provider: ${provider.name}`));\r\n\r\n // 2. Collect project profile (unless --skip-profile)\r\n let projectProfile: ProjectProfile | undefined;\r\n if (!options.skipProfile) {\r\n projectProfile = await collectProjectProfile();\r\n console.log(chalk.green(\" ā Project profile collected\"));\r\n } else {\r\n console.log(chalk.dim(\" Skipping project profile questionnaire.\"));\r\n }\r\n\r\n // 3. Parse exclusions (split on commas or spaces to handle both bash and PowerShell)\r\n const exclude = options.exclude\r\n ? options.exclude.split(/[,\\s]+/).map((s) => s.trim()).filter(Boolean)\r\n : [];\r\n\r\n if (exclude.length > 0) {\r\n console.log(chalk.dim(` Excluding: ${exclude.join(\", \")}`));\r\n }\r\n\r\n // 4. Check for existing files\r\n const existingFiles = await provider.detectExisting(cwd);\r\n if (existingFiles.length > 0 && !options.force) {\r\n console.log(\r\n chalk.yellow(\r\n `\\n Found existing instruction files:\\n${existingFiles\r\n .map((f) => ` - ${f}`)\r\n .join(\"\\n\")}`\r\n )\r\n );\r\n\r\n const answer = await inquirer.prompt([\r\n {\r\n type: \"list\",\r\n name: \"action\",\r\n message: \"How should we handle existing files?\",\r\n choices: [\r\n {\r\n name: \"Overwrite ā replace all existing files\",\r\n value: \"overwrite\",\r\n },\r\n {\r\n name: \"Skip ā only write files that don't exist yet\",\r\n value: \"skip\",\r\n },\r\n { name: \"Abort ā cancel initialization\", value: \"abort\" },\r\n ],\r\n },\r\n ]);\r\n\r\n if (answer.action === \"abort\") {\r\n console.log(chalk.dim(\" Aborted.\"));\r\n return;\r\n }\r\n\r\n if (answer.action === \"skip\") {\r\n // We'll skip existing files during write\r\n console.log(chalk.dim(\" Skipping existing files.\"));\r\n }\r\n\r\n // For \"overwrite\", we just proceed normally\r\n }\r\n\r\n // 5. Build project context block (if profile was collected)\r\n const contextBlock = projectProfile\r\n ? buildProjectContextBlock(projectProfile)\r\n : null;\r\n\r\n // 6. Load and write prompts\r\n const prompts = await loadPrompts(exclude);\r\n let written = 0;\r\n let skipped = 0;\r\n const installedPrompts: string[] = [];\r\n\r\n for (const prompt of prompts) {\r\n const targetRelPath = provider.getTargetPath(prompt.name);\r\n const targetAbsPath = path.join(cwd, targetRelPath);\r\n\r\n // Skip if file exists and user chose \"skip\"\r\n if (\r\n !options.force &&\r\n existingFiles.includes(targetRelPath) &&\r\n existingFiles.length > 0\r\n ) {\r\n const answer = await inquirer.prompt([\r\n {\r\n type: \"list\",\r\n name: \"action\",\r\n message: `How should we handle existing files?`,\r\n choices: [\r\n { name: \"Overwrite\", value: \"overwrite\" },\r\n { name: \"Skip\", value: \"skip\" },\r\n ],\r\n },\r\n ]);\r\n if (answer.action === \"skip\") {\r\n skipped++;\r\n installedPrompts.push(prompt.name);\r\n continue;\r\n }\r\n }\r\n\r\n // Inject project context into prompt if profile was collected\r\n let content = prompt.content;\r\n if (contextBlock) {\r\n content = replaceProjectContext(content, contextBlock);\r\n }\r\n\r\n const transformed = provider.transformPrompt(content, {\r\n name: prompt.name,\r\n title: prompt.title,\r\n description: prompt.description,\r\n });\r\n\r\n await fs.ensureDir(path.dirname(targetAbsPath));\r\n await fs.writeFile(targetAbsPath, transformed, \"utf-8\");\r\n written++;\r\n installedPrompts.push(prompt.name);\r\n\r\n console.log(chalk.green(` ā ${targetRelPath}`));\r\n }\r\n\r\n // 7. Provider-specific extras\r\n if (provider.alias === \"claude-code\") {\r\n const claudeMdPath = path.join(cwd, \"CLAUDE.md\");\r\n const claudeMdContent = generateClaudeRootMd(installedPrompts);\r\n await fs.writeFile(claudeMdPath, claudeMdContent, \"utf-8\");\r\n console.log(chalk.green(` ā CLAUDE.md`));\r\n written++;\r\n }\r\n\r\n // 8. Create .spec/ directory structure\r\n const specDirs = [\r\n \".spec\",\r\n path.join(\".spec\", \"features\"),\r\n path.join(\".spec\", \"reviews\"),\r\n ];\r\n for (const dir of specDirs) {\r\n const absDir = path.join(cwd, dir);\r\n if (!(await fs.pathExists(absDir))) {\r\n await fs.ensureDir(absDir);\r\n console.log(chalk.green(` ā ${dir}/`));\r\n }\r\n }\r\n\r\n // 8b. Create .spec/TODO.md skeleton\r\n const todoPath = path.join(cwd, \".spec\", \"TODO.md\");\r\n if (!(await fs.pathExists(todoPath))) {\r\n const todoContent = [\r\n \"# TODO ā Enhancements & Ideas\",\r\n \"\",\r\n \"> Discovered by sub-agents during planning and development.\",\r\n \"> Items here are out-of-scope for their current task but worth tracking.\",\r\n \"\",\r\n \"## General\",\r\n \"\",\r\n \"## General / Caching\",\r\n \"\",\r\n \"## UI\",\r\n \"\",\r\n \"## Performance\",\r\n \"\",\r\n \"## Security\",\r\n \"\",\r\n \"## DX (Developer Experience)\",\r\n \"\",\r\n ].join(\"\\n\");\r\n await fs.writeFile(todoPath, todoContent, \"utf-8\");\r\n console.log(chalk.green(` ā .spec/TODO.md`));\r\n }\r\n\r\n // 9. Copy bundled stack snippet to .spec-lite/stacks/ (if profile was collected)\r\n if (projectProfile) {\r\n const snippet = getStackSnippet(projectProfile.language);\r\n if (snippet) {\r\n const stacksTargetDir = path.join(cwd, \".spec-lite\", \"stacks\");\r\n await fs.ensureDir(stacksTargetDir);\r\n const snippetFileName = `${projectProfile.language.toLowerCase().replace(/[^a-z0-9]/g, \"-\")}.md`;\r\n const snippetPath = path.join(stacksTargetDir, snippetFileName);\r\n\r\n if (await fs.pathExists(snippetPath) && !options.force) {\r\n console.log(\r\n chalk.dim(` ā .spec-lite/stacks/${snippetFileName} already exists (kept your edits)`)\r\n );\r\n } else {\r\n await fs.writeFile(snippetPath, snippet, \"utf-8\");\r\n console.log(\r\n chalk.green(` ā .spec-lite/stacks/${snippetFileName}`)\r\n );\r\n console.log(\r\n chalk.dim(\" ā³ Edit this file to customize defaults before running /memorize bootstrap\")\r\n );\r\n written++;\r\n }\r\n }\r\n }\r\n\r\n // 10. Write .spec-lite.json config\r\n const pkg = await loadPackageVersion();\r\n const config: SpecLiteConfig = {\r\n version: pkg,\r\n provider: provider.alias,\r\n installedPrompts,\r\n installedAt: new Date().toISOString(),\r\n updatedAt: new Date().toISOString(),\r\n ...(projectProfile ? { projectProfile } : {}),\r\n };\r\n const configPath = path.join(cwd, \".spec-lite.json\");\r\n await fs.writeJson(configPath, config, { spaces: 2 });\r\n console.log(chalk.green(` ā .spec-lite.json`));\r\n\r\n // 11. Summary\r\n console.log(\r\n chalk.bold(\r\n `\\n Done! ${written} files written, ${skipped} skipped.`\r\n )\r\n );\r\n console.log(provider.getPostInitMessage());\r\n\r\n // 12. Bootstrap next-step guidance\r\n if (projectProfile) {\r\n console.log(\r\n chalk.cyan(\r\n \"\\n š Next step: Run \") +\r\n chalk.bold(\"/memorize bootstrap\") +\r\n chalk.cyan(\r\n \" in your AI assistant to auto-generate\\n coding standards, architecture guidelines, and best practices\\n for your project based on the profile you just provided.\"\r\n )\r\n );\r\n }\r\n}\r\n\r\nasync function loadPackageVersion(): Promise<string> {\r\n try {\r\n const { createRequire } = await import(\"module\");\r\n const require = createRequire(import.meta.url);\r\n const pkg = require(\"../../package.json\");\r\n return pkg.version;\r\n } catch {\r\n return \"1.0.0\";\r\n }\r\n}\r\n","import path from \"path\";\r\nimport fs from \"fs-extra\";\r\nimport type { Provider, PromptMeta } from \"./base.js\";\r\n\r\n/**\r\n * GitHub Copilot provider.\r\n *\r\n * Writes individual agent files to `.github/copilot-instructions/` as markdown,\r\n * plus a main `.github/copilot-instructions.md` that references the spec-lite agents.\r\n *\r\n * GitHub Copilot supports:\r\n * - `.github/copilot-instructions.md` ā global instructions loaded into every Copilot Chat session\r\n * - Individual prompt files that can be referenced via @workspace or loaded as custom instructions\r\n */\r\nexport class CopilotProvider implements Provider {\r\n name = \"GitHub Copilot\";\r\n alias = \"copilot\";\r\n description = \"GitHub Copilot (VS Code, JetBrains, Neovim)\";\r\n\r\n getTargetPath(promptName: string): string {\r\n return path.join(\".github\", \"copilot\", `${promptName}.prompt.md`);\r\n }\r\n\r\n transformPrompt(content: string, meta: PromptMeta): string {\r\n // Copilot expects standard markdown. We add a brief header comment\r\n // identifying this as a spec-lite managed file.\r\n const header = [\r\n `<!-- spec-lite | ${meta.name} | DO NOT EDIT below the project-context block ā managed by spec-lite -->`,\r\n `<!-- To update: run \"spec-lite update\" ā your Project Context edits will be preserved -->`,\r\n \"\",\r\n ].join(\"\\n\");\r\n\r\n return header + content;\r\n }\r\n\r\n async detectExisting(workspaceRoot: string): Promise<string[]> {\r\n const existing: string[] = [];\r\n\r\n // Check for copilot instructions directory\r\n const copilotDir = path.join(workspaceRoot, \".github\", \"copilot\");\r\n if (await fs.pathExists(copilotDir)) {\r\n const files = await fs.readdir(copilotDir);\r\n for (const f of files) {\r\n if (f.endsWith(\".prompt.md\") || f.endsWith(\".md\")) {\r\n existing.push(path.join(\".github\", \"copilot\", f));\r\n }\r\n }\r\n }\r\n\r\n // Check for main instructions file\r\n const mainFile = path.join(\r\n workspaceRoot,\r\n \".github\",\r\n \"copilot-instructions.md\"\r\n );\r\n if (await fs.pathExists(mainFile)) {\r\n existing.push(\".github/copilot-instructions.md\");\r\n }\r\n\r\n return existing;\r\n }\r\n\r\n getPostInitMessage(): string {\r\n return [\r\n \"\",\r\n \"š GitHub Copilot setup complete!\",\r\n \"\",\r\n \" Your sub-agent prompts are in .github/copilot/\",\r\n \"\",\r\n \" How to use:\",\r\n \" 1. Open GitHub Copilot Chat in VS Code\",\r\n \" 2. Sub-agents are available as slash commands ā type /prompt_name\",\r\n \" (e.g., /brainstorm, /planner, /feature)\",\r\n \" 3. Files ending in .prompt.md are natively recognized by Copilot\",\r\n \" 4. Customize the Project Context block in each file for your project\",\r\n \"\",\r\n ].join(\"\\n\");\r\n }\r\n}\r\n","import path from \"path\";\r\nimport fs from \"fs-extra\";\r\nimport type { Provider, PromptMeta } from \"./base.js\";\r\n\r\n/**\r\n * Claude Code (Anthropic) provider.\r\n *\r\n * Claude Code supports:\r\n * - `CLAUDE.md` at the project root ā loaded automatically as project instructions\r\n * - `.claude/` directory for additional configuration\r\n * - Nested `CLAUDE.md` files in subdirectories for scoped instructions\r\n *\r\n * Strategy:\r\n * - Write individual agent files to `.claude/prompts/<name>.md`\r\n * - Create/update a root `CLAUDE.md` that references the spec-lite agent collection\r\n * and provides a high-level overview\r\n */\r\nexport class ClaudeCodeProvider implements Provider {\r\n name = \"Claude Code\";\r\n alias = \"claude-code\";\r\n description = \"Claude Code (Anthropic's coding agent)\";\r\n\r\n getTargetPath(promptName: string): string {\r\n return path.join(\".claude\", \"prompts\", `${promptName}.md`);\r\n }\r\n\r\n transformPrompt(content: string, meta: PromptMeta): string {\r\n // Claude Code reads markdown natively. We add a header comment.\r\n const header = [\r\n `<!-- spec-lite | ${meta.name} | DO NOT EDIT below the project-context block ā managed by spec-lite -->`,\r\n `<!-- To update: run \"spec-lite update\" ā your Project Context edits will be preserved -->`,\r\n \"\",\r\n ].join(\"\\n\");\r\n\r\n return header + content;\r\n }\r\n\r\n async detectExisting(workspaceRoot: string): Promise<string[]> {\r\n const existing: string[] = [];\r\n\r\n // Check for claude prompts directory\r\n const claudePromptsDir = path.join(\r\n workspaceRoot,\r\n \".claude\",\r\n \"prompts\"\r\n );\r\n if (await fs.pathExists(claudePromptsDir)) {\r\n const files = await fs.readdir(claudePromptsDir);\r\n for (const f of files) {\r\n if (f.endsWith(\".md\")) {\r\n existing.push(path.join(\".claude\", \"prompts\", f));\r\n }\r\n }\r\n }\r\n\r\n // Check for root CLAUDE.md\r\n const rootFile = path.join(workspaceRoot, \"CLAUDE.md\");\r\n if (await fs.pathExists(rootFile)) {\r\n existing.push(\"CLAUDE.md\");\r\n }\r\n\r\n return existing;\r\n }\r\n\r\n getPostInitMessage(): string {\r\n return [\r\n \"\",\r\n \"š Claude Code setup complete!\",\r\n \"\",\r\n \" Your sub-agent prompts are in .claude/prompts/\",\r\n \" A root CLAUDE.md has been created with references to the sub-agents.\",\r\n \"\",\r\n \" How to use:\",\r\n \" 1. Claude Code automatically reads CLAUDE.md for project context\",\r\n ' 2. Reference specific sub-agents: \"Use the planner from .claude/prompts/planner.md\"',\r\n \" 3. Customize the Project Context block in each file for your project\",\r\n \"\",\r\n ].join(\"\\n\");\r\n }\r\n}\r\n\r\n/**\r\n * Generate the root CLAUDE.md content that references spec-lite sub-agents.\r\n */\r\nexport function generateClaudeRootMd(\r\n installedPrompts: string[]\r\n): string {\r\n const lines = [\r\n \"<!-- spec-lite managed ā regenerated on spec-lite init/update -->\",\r\n \"\",\r\n \"# Project Instructions\",\r\n \"\",\r\n \"This project uses [spec-lite](https://github.com/ranjithab/spec-lite) sub-agent prompts\",\r\n \"for structured software engineering workflows.\",\r\n \"\",\r\n \"## Available Sub-Agents\",\r\n \"\",\r\n \"The following specialist sub-agents are available in `.claude/prompts/`:\",\r\n \"\",\r\n ];\r\n\r\n for (const name of installedPrompts) {\r\n lines.push(`- [${name}](.claude/prompts/${name}.md)`);\r\n }\r\n\r\n lines.push(\r\n \"\",\r\n \"## Usage\",\r\n \"\",\r\n \"To use a sub-agent, reference its prompt file in your conversation:\",\r\n \"\",\r\n '```text',\r\n \"Use the planner from .claude/prompts/planner.md to create a technical plan for this project.\",\r\n '```',\r\n \"\",\r\n \"## Output Directory\",\r\n \"\",\r\n \"Sub-agent outputs are written to the `.spec/` directory:\",\r\n \"\",\r\n \"```text\",\r\n \".spec/\",\r\n \"āāā brainstorm.md\",\r\n \"āāā plan.md # Default plan (simple projects)\",\r\n \"āāā plan_<name>.md # Named plans (complex projects)\",\r\n \"āāā TODO.md\",\r\n \"āāā features/\",\r\n \"āāā reviews/\",\r\n \"```\",\r\n \"\"\r\n );\r\n\r\n return lines.join(\"\\n\");\r\n}\r\n","import path from \"path\";\r\nimport fs from \"fs-extra\";\r\nimport type { Provider, PromptMeta } from \"./base.js\";\r\n\r\n/**\r\n * Generic provider ā for manual usage or unsupported AI tools.\r\n *\r\n * Writes prompts to `.spec-lite/prompts/` as raw markdown.\r\n * Users can copy-paste these into any LLM chat.\r\n */\r\nexport class GenericProvider implements Provider {\r\n name = \"Generic\";\r\n alias = \"generic\";\r\n description = \"Raw prompts in .spec-lite/prompts/ (copy-paste into any LLM)\";\r\n\r\n getTargetPath(promptName: string): string {\r\n return path.join(\".spec-lite\", \"prompts\", `${promptName}.md`);\r\n }\r\n\r\n transformPrompt(content: string, meta: PromptMeta): string {\r\n // No transformation ā copy as-is with a light header\r\n const header = [\r\n `<!-- spec-lite | ${meta.name} | managed by spec-lite -->`,\r\n `<!-- To update: run \"spec-lite update\" -->`,\r\n \"\",\r\n ].join(\"\\n\");\r\n\r\n return header + content;\r\n }\r\n\r\n async detectExisting(workspaceRoot: string): Promise<string[]> {\r\n const existing: string[] = [];\r\n const dir = path.join(workspaceRoot, \".spec-lite\", \"prompts\");\r\n\r\n if (await fs.pathExists(dir)) {\r\n const files = await fs.readdir(dir);\r\n for (const f of files) {\r\n if (f.endsWith(\".md\")) {\r\n existing.push(path.join(\".spec-lite\", \"prompts\", f));\r\n }\r\n }\r\n }\r\n\r\n return existing;\r\n }\r\n\r\n getPostInitMessage(): string {\r\n return [\r\n \"\",\r\n \"š Generic setup complete!\",\r\n \"\",\r\n \" Your sub-agent prompts are in .spec-lite/prompts/\",\r\n \"\",\r\n \" How to use:\",\r\n \" 1. Open any prompt file and copy its content\",\r\n \" 2. Paste into your LLM of choice (ChatGPT, Claude, Gemini, etc.)\",\r\n \" 3. Fill in the Project Context section for your project\",\r\n \" 4. Start the conversation with your requirements\",\r\n \"\",\r\n ].join(\"\\n\");\r\n }\r\n}\r\n","import type { Provider } from \"./base.js\";\r\nimport { CopilotProvider } from \"./copilot.js\";\r\nimport { ClaudeCodeProvider } from \"./claude-code.js\";\r\nimport { GenericProvider } from \"./generic.js\";\r\n\r\n/**\r\n * Registry of all supported AI provider adapters.\r\n */\r\nconst providers: Provider[] = [\r\n new CopilotProvider(),\r\n new ClaudeCodeProvider(),\r\n new GenericProvider(),\r\n];\r\n\r\n/**\r\n * Get a provider by its CLI alias (e.g., \"copilot\", \"claude-code\", \"generic\").\r\n */\r\nexport function getProvider(alias: string): Provider | undefined {\r\n return providers.find((p) => p.alias === alias);\r\n}\r\n\r\n/**\r\n * Get all registered providers.\r\n */\r\nexport function getAllProviders(): Provider[] {\r\n return [...providers];\r\n}\r\n\r\n/**\r\n * Get a formatted list of provider aliases for display.\r\n */\r\nexport function getProviderAliases(): string[] {\r\n return providers.map((p) => p.alias);\r\n}\r\n\r\n// Re-export types\r\nexport type { Provider, PromptMeta, SpecLiteConfig } from \"./base.js\";\r\n","import path from \"path\";\r\nimport fs from \"fs-extra\";\r\nimport { fileURLToPath } from \"url\";\r\n\r\nconst __filename = fileURLToPath(import.meta.url);\r\nconst __dirname = path.dirname(__filename);\r\n\r\n/** Path to the bundled prompts directory (shipped with the npm package) */\r\nexport function getPromptsDir(): string {\r\n // In the built output (tsup bundles to dist/index.js),\r\n // __dirname resolves to dist/ ā prompts/ is one level up at the package root\r\n return path.resolve(__dirname, \"..\", \"prompts\");\r\n}\r\n\r\n/** Metadata extracted from prompt files */\r\nexport interface PromptFile {\r\n /** File name without extension */\r\n name: string;\r\n /** Full file path */\r\n filePath: string;\r\n /** Raw markdown content */\r\n content: string;\r\n /** Extracted title */\r\n title: string;\r\n /** Extracted description */\r\n description: string;\r\n}\r\n\r\n/** Map of prompt names to their human titles and descriptions */\r\nexport const PROMPT_CATALOG: Record<string, { title: string; description: string; output?: string }> = {\r\n spec_help: {\r\n title: \"Spec Help\",\r\n description: \"Lists available sub-agents, their purpose, inputs, and outputs\",\r\n output: \"(interactive guide)\",\r\n },\r\n brainstorm: {\r\n title: \"Brainstorm\",\r\n description: \"Refines a vague idea into a clear, actionable vision\",\r\n output: \".spec/brainstorm.md\",\r\n },\r\n planner: {\r\n title: \"Planner\",\r\n description: \"Creates a detailed technical blueprint from requirements\",\r\n output: \".spec/plan.md or .spec/plan_<name>.md\",\r\n },\r\n feature: {\r\n title: \"Feature\",\r\n description: \"Breaks one feature into granular, verifiable vertical slices\",\r\n output: \".spec/features/feature_<name>.md\",\r\n },\r\n implement: {\r\n title: \"Implement\",\r\n description: \"Picks up a feature spec and executes its tasks with code\",\r\n output: \"Working code + updated feature spec\",\r\n },\r\n code_review: {\r\n title: \"Code Review\",\r\n description: \"Reviews code for correctness, architecture, and readability\",\r\n output: \".spec/reviews/code_review_<name>.md\",\r\n },\r\n security_audit: {\r\n title: \"Security Audit\",\r\n description: \"Scans for vulnerabilities, misconfigurations, and security risks\",\r\n output: \".spec/reviews/security_audit_<scope>.md\",\r\n },\r\n performance_review: {\r\n title: \"Performance Review\",\r\n description: \"Identifies bottlenecks and optimization opportunities\",\r\n output: \".spec/reviews/performance_review_<scope>.md\",\r\n },\r\n integration_tests: {\r\n title: \"Integration Tests\",\r\n description: \"Writes traceable integration test scenarios from feature specs\",\r\n output: \"tests/\",\r\n },\r\n unit_tests: {\r\n title: \"Unit Tests\",\r\n description: \"Generates comprehensive unit tests with edge-case coverage and smart coverage exclusions\",\r\n output: \".spec/features/unit_tests_<name>.md\",\r\n },\r\n devops: {\r\n title: \"DevOps\",\r\n description: \"Sets up Docker, CI/CD, environments, and deployment\",\r\n output: \"Project infrastructure files\",\r\n },\r\n fix: {\r\n title: \"Fix & Refactor\",\r\n description: \"Debugs issues or restructures code safely\",\r\n output: \"Targeted fixes with verification\",\r\n },\r\n memorize: {\r\n title: \"Memorize\",\r\n description:\r\n \"Stores standing instructions that all sub-agents enforce. Use `/memorize bootstrap` to auto-generate from project analysis.\",\r\n output: \".spec/memory.md\",\r\n },\r\n technical_docs: {\r\n title: \"Technical Docs\",\r\n description: \"Creates deep architecture documentation for developers\",\r\n output: \"docs/technical_architecture.md\",\r\n },\r\n readme: {\r\n title: \"README\",\r\n description: \"Writes the project README and optional user guide\",\r\n output: \"README.md + docs/user_guide.md\",\r\n },\r\n};\r\n\r\n/** Non-agent files to skip */\r\nconst SKIP_FILES = new Set([\"orchestrator\"]);\r\n\r\n/**\r\n * Load all available prompt files from the bundled prompts directory.\r\n * Excludes non-agent files (orchestrator).\r\n */\r\nexport async function loadPrompts(\r\n exclude: string[] = []\r\n): Promise<PromptFile[]> {\r\n const promptsDir = getPromptsDir();\r\n const excludeSet = new Set([...exclude, ...SKIP_FILES]);\r\n\r\n const files = await fs.readdir(promptsDir);\r\n const prompts: PromptFile[] = [];\r\n\r\n for (const file of files) {\r\n if (!file.endsWith(\".md\")) continue;\r\n\r\n const name = file.replace(\".md\", \"\");\r\n if (excludeSet.has(name)) continue;\r\n\r\n const filePath = path.join(promptsDir, file);\r\n const content = await fs.readFile(filePath, \"utf-8\");\r\n const catalog = PROMPT_CATALOG[name];\r\n\r\n prompts.push({\r\n name,\r\n filePath,\r\n content,\r\n title: catalog?.title ?? name,\r\n description: catalog?.description ?? \"\",\r\n });\r\n }\r\n\r\n return prompts;\r\n}\r\n\r\n/**\r\n * Get the list of all available prompt names.\r\n */\r\nexport function getAvailablePromptNames(): string[] {\r\n return Object.keys(PROMPT_CATALOG);\r\n}\r\n\r\n/**\r\n * Get the full prompt catalog (for display in CLI list command).\r\n */\r\nexport function getPromptCatalog(): Record<string, { title: string; description: string; output?: string }> {\r\n return PROMPT_CATALOG;\r\n}\r\n\r\n/**\r\n * Project Context markers used to preserve user edits during updates.\r\n */\r\nexport const CONTEXT_START_MARKER = \"<!-- project-context-start -->\";\r\nexport const CONTEXT_END_MARKER = \"<!-- project-context-end -->\";\r\n\r\n/**\r\n * Extract the Project Context block from a prompt.\r\n * Returns the content between markers, or null if not found.\r\n */\r\nexport function extractProjectContext(content: string): string | null {\r\n const startIdx = content.indexOf(CONTEXT_START_MARKER);\r\n const endIdx = content.indexOf(CONTEXT_END_MARKER);\r\n\r\n if (startIdx === -1 || endIdx === -1 || endIdx <= startIdx) return null;\r\n\r\n return content.substring(\r\n startIdx + CONTEXT_START_MARKER.length,\r\n endIdx\r\n );\r\n}\r\n\r\n/**\r\n * Replace the Project Context block in a prompt with new content.\r\n */\r\nexport function replaceProjectContext(\r\n content: string,\r\n newContext: string\r\n): string {\r\n const startIdx = content.indexOf(CONTEXT_START_MARKER);\r\n const endIdx = content.indexOf(CONTEXT_END_MARKER);\r\n\r\n if (startIdx === -1 || endIdx === -1 || endIdx <= startIdx) return content;\r\n\r\n return (\r\n content.substring(0, startIdx + CONTEXT_START_MARKER.length) +\r\n newContext +\r\n content.substring(endIdx)\r\n );\r\n}\r\n","import path from \"path\";\r\nimport fs from \"fs-extra\";\r\nimport { fileURLToPath } from \"url\";\r\n\r\nconst __filename = fileURLToPath(import.meta.url);\r\nconst __dirname = path.dirname(__filename);\r\n\r\n/**\r\n * Path to the bundled stacks directory (shipped with the npm package).\r\n * In the built output (tsup bundles to dist/index.js),\r\n * __dirname resolves to dist/ ā stacks/ is copied to dist/stacks/ during build.\r\n */\r\nexport function getStacksDir(): string {\r\n return path.resolve(__dirname, \"stacks\");\r\n}\r\n\r\n/**\r\n * Map of language names (lowercased) to their stack snippet filenames.\r\n * Supports common aliases so the questionnaire answer maps correctly.\r\n */\r\nconst LANGUAGE_MAP: Record<string, string> = {\r\n typescript: \"typescript.md\",\r\n ts: \"typescript.md\",\r\n javascript: \"typescript.md\",\r\n js: \"typescript.md\",\r\n \"node.js\": \"typescript.md\",\r\n node: \"typescript.md\",\r\n react: \"react.md\",\r\n \"react.js\": \"react.md\",\r\n \"next.js\": \"react.md\",\r\n nextjs: \"react.md\",\r\n python: \"python.md\",\r\n py: \"python.md\",\r\n \"c#\": \"dotnet.md\",\r\n csharp: \"dotnet.md\",\r\n \".net\": \"dotnet.md\",\r\n dotnet: \"dotnet.md\",\r\n java: \"java.md\",\r\n \"spring\": \"java.md\",\r\n \"spring boot\": \"java.md\",\r\n \"spring-boot\": \"java.md\",\r\n};\r\n\r\n/**\r\n * Get the bundled best-practice snippet for a given language.\r\n * Returns the markdown content if a matching snippet exists, or null if not.\r\n */\r\nexport function getStackSnippet(language: string): string | null {\r\n const key = language.toLowerCase().trim();\r\n const filename = LANGUAGE_MAP[key];\r\n\r\n if (!filename) return null;\r\n\r\n const filePath = path.join(getStacksDir(), filename);\r\n if (!fs.pathExistsSync(filePath)) return null;\r\n\r\n return fs.readFileSync(filePath, \"utf-8\");\r\n}\r\n\r\n/**\r\n * List all available stack snippet names (for display purposes).\r\n */\r\nexport function listAvailableStacks(): string[] {\r\n const stacksDir = getStacksDir();\r\n if (!fs.pathExistsSync(stacksDir)) return [];\r\n\r\n return fs\r\n .readdirSync(stacksDir)\r\n .filter((f) => f.endsWith(\".md\"))\r\n .map((f) => f.replace(\".md\", \"\"));\r\n}\r\n","import path from \"path\";\r\nimport fs from \"fs-extra\";\r\nimport chalk from \"chalk\";\r\nimport { getProvider } from \"../providers/index.js\";\r\nimport type { SpecLiteConfig } from \"../providers/base.js\";\r\nimport {\r\n loadPrompts,\r\n extractProjectContext,\r\n replaceProjectContext,\r\n} from \"../utils/prompts.js\";\r\nimport { generateClaudeRootMd } from \"../providers/claude-code.js\";\r\n\r\ninterface UpdateOptions {\r\n force?: boolean;\r\n}\r\n\r\nexport async function updateCommand(options: UpdateOptions): Promise<void> {\r\n const cwd = process.cwd();\r\n\r\n console.log(chalk.bold(\"\\nā” spec-lite update\\n\"));\r\n\r\n // 1. Read existing config\r\n const configPath = path.join(cwd, \".spec-lite.json\");\r\n if (!(await fs.pathExists(configPath))) {\r\n console.error(\r\n chalk.red(\r\n ' No .spec-lite.json found. Run \"spec-lite init\" first.'\r\n )\r\n );\r\n process.exit(1);\r\n }\r\n\r\n const config: SpecLiteConfig = await fs.readJson(configPath);\r\n const provider = getProvider(config.provider);\r\n\r\n if (!provider) {\r\n console.error(\r\n chalk.red(\r\n ` Unknown provider \"${config.provider}\" in .spec-lite.json. Re-run \"spec-lite init\".`\r\n )\r\n );\r\n process.exit(1);\r\n }\r\n\r\n console.log(chalk.cyan(` Provider: ${provider.name}`));\r\n console.log(\r\n chalk.dim(` Installed: ${config.installedPrompts.length} prompts`)\r\n );\r\n\r\n // 2. Load latest prompts (only the ones that were previously installed)\r\n const allPrompts = await loadPrompts();\r\n const installedSet = new Set(config.installedPrompts);\r\n const prompts = allPrompts.filter((p) => installedSet.has(p.name));\r\n\r\n let updated = 0;\r\n let preserved = 0;\r\n let unchanged = 0;\r\n let migrated = 0;\r\n\r\n for (const prompt of prompts) {\r\n const targetRelPath = provider.getTargetPath(prompt.name);\r\n const targetAbsPath = path.join(cwd, targetRelPath);\r\n\r\n // Migration: if copilot provider, check for old-format .md files and rename to .prompt.md\r\n if (provider.alias === \"copilot\") {\r\n const oldRelPath = path.join(\".github\", \"copilot\", `${prompt.name}.md`);\r\n const oldAbsPath = path.join(cwd, oldRelPath);\r\n if (\r\n targetRelPath !== oldRelPath &&\r\n (await fs.pathExists(oldAbsPath)) &&\r\n !(await fs.pathExists(targetAbsPath))\r\n ) {\r\n await fs.ensureDir(path.dirname(targetAbsPath));\r\n await fs.rename(oldAbsPath, targetAbsPath);\r\n console.log(\r\n chalk.cyan(\r\n ` ā ${oldRelPath} ā ${targetRelPath} (migrated to .prompt.md)`\r\n )\r\n );\r\n migrated++;\r\n }\r\n }\r\n\r\n // Transform the new prompt content\r\n const newContent = provider.transformPrompt(prompt.content, {\r\n name: prompt.name,\r\n title: prompt.title,\r\n description: prompt.description,\r\n });\r\n\r\n if (!(await fs.pathExists(targetAbsPath))) {\r\n // File was deleted by user ā re-create it\r\n await fs.ensureDir(path.dirname(targetAbsPath));\r\n await fs.writeFile(targetAbsPath, newContent, \"utf-8\");\r\n console.log(chalk.green(` ā ${targetRelPath} (restored)`));\r\n updated++;\r\n continue;\r\n }\r\n\r\n // Read current installed version\r\n const currentContent = await fs.readFile(targetAbsPath, \"utf-8\");\r\n\r\n // Check if content is identical (no update needed)\r\n if (currentContent === newContent) {\r\n unchanged++;\r\n continue;\r\n }\r\n\r\n // Try to preserve user's Project Context edits\r\n if (!options.force) {\r\n const userContext = extractProjectContext(currentContent);\r\n if (userContext) {\r\n const mergedContent = replaceProjectContext(newContent, userContext);\r\n await fs.writeFile(targetAbsPath, mergedContent, \"utf-8\");\r\n console.log(\r\n chalk.green(\r\n ` ā ${targetRelPath} (updated, Project Context preserved)`\r\n )\r\n );\r\n preserved++;\r\n updated++;\r\n continue;\r\n }\r\n }\r\n\r\n // No context block found or --force ā full overwrite\r\n await fs.writeFile(targetAbsPath, newContent, \"utf-8\");\r\n console.log(chalk.green(` ā ${targetRelPath} (updated)`));\r\n updated++;\r\n }\r\n\r\n // 3. Update provider-specific extras\r\n if (provider.alias === \"claude-code\") {\r\n const claudeMdPath = path.join(cwd, \"CLAUDE.md\");\r\n const claudeMdContent = generateClaudeRootMd(config.installedPrompts);\r\n await fs.writeFile(claudeMdPath, claudeMdContent, \"utf-8\");\r\n console.log(chalk.green(` ā CLAUDE.md (regenerated)`));\r\n }\r\n\r\n // 4. Update config timestamp\r\n config.updatedAt = new Date().toISOString();\r\n try {\r\n const { createRequire } = await import(\"module\");\r\n const require = createRequire(import.meta.url);\r\n const pkg = require(\"../../package.json\");\r\n config.version = pkg.version;\r\n } catch {\r\n // Keep existing version\r\n }\r\n await fs.writeJson(configPath, config, { spaces: 2 });\r\n\r\n // 5. Summary\r\n console.log(\r\n chalk.bold(\r\n `\\n Done! ${updated} updated, ${unchanged} unchanged, ${preserved} with preserved edits${migrated > 0 ? `, ${migrated} migrated` : \"\"}.`\r\n )\r\n );\r\n}\r\n","import chalk from \"chalk\";\r\nimport { getPromptCatalog } from \"../utils/prompts.js\";\r\n\r\nexport async function listCommand(): Promise<void> {\r\n const catalog = getPromptCatalog();\r\n\r\n console.log(chalk.bold(\"\\nā” spec-lite ā Available Sub-Agents\\n\"));\r\n\r\n console.log(\r\n chalk.dim(\r\n \" Each sub-agent is a specialist prompt for one phase of the development lifecycle.\\n\"\r\n )\r\n );\r\n\r\n // Calculate column widths\r\n const entries = Object.entries(catalog);\r\n const maxName = Math.max(...entries.map(([name]) => name.length), 4);\r\n const maxTitle = Math.max(\r\n ...entries.map(([, v]) => v.title.length),\r\n 5\r\n );\r\n\r\n // Header\r\n const header = ` ${\"Name\".padEnd(maxName + 2)}${\"Title\".padEnd(maxTitle + 2)}${\"Description\"}`;\r\n console.log(chalk.cyan(header));\r\n console.log(chalk.dim(` ${\"ā\".repeat(header.trim().length + 10)}`));\r\n\r\n // Rows\r\n for (const [name, meta] of entries) {\r\n const nameCol = chalk.green(name.padEnd(maxName + 2));\r\n const titleCol = chalk.white(meta.title.padEnd(maxTitle + 2));\r\n const descCol = chalk.dim(meta.description);\r\n console.log(` ${nameCol}${titleCol}${descCol}`);\r\n if (meta.output) {\r\n console.log(\r\n ` ${\"\".padEnd(maxName + 2)}${\"\".padEnd(maxTitle + 2)}${chalk.dim(`ā ${meta.output}`)}`\r\n );\r\n }\r\n }\r\n\r\n console.log(\r\n chalk.dim(\r\n `\\n ${entries.length} sub-agents available. Run \"spec-lite init\" to install them.\\n`\r\n )\r\n );\r\n\r\n // Pipeline\r\n console.log(chalk.bold(\" Recommended Pipeline:\\n\"));\r\n console.log(\r\n chalk.dim(\r\n \" Brainstorm ā Planner ā Feature (ĆN) ā Reviews ā Tests ā DevOps ā Docs\"\r\n )\r\n );\r\n console.log(\r\n chalk.dim(\r\n \" (Not every project needs every sub-agent. Start with Planner if you have clear requirements.)\\n\"\r\n )\r\n );\r\n}\r\n"],"mappings":";;;AAAA,SAAS,eAAe;;;ACAxB,OAAOA,WAAU;AACjB,OAAOC,SAAQ;AACf,OAAO,WAAW;AAClB,OAAO,cAAc;;;ACHrB,OAAO,UAAU;AACjB,OAAO,QAAQ;AAaR,IAAM,kBAAN,MAA0C;AAAA,EAC/C,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,cAAc;AAAA,EAEd,cAAc,YAA4B;AACxC,WAAO,KAAK,KAAK,WAAW,WAAW,GAAG,UAAU,YAAY;AAAA,EAClE;AAAA,EAEA,gBAAgB,SAAiB,MAA0B;AAGzD,UAAM,SAAS;AAAA,MACb,oBAAoB,KAAK,IAAI;AAAA,MAC7B;AAAA,MACA;AAAA,IACF,EAAE,KAAK,IAAI;AAEX,WAAO,SAAS;AAAA,EAClB;AAAA,EAEA,MAAM,eAAe,eAA0C;AAC7D,UAAM,WAAqB,CAAC;AAG5B,UAAM,aAAa,KAAK,KAAK,eAAe,WAAW,SAAS;AAChE,QAAI,MAAM,GAAG,WAAW,UAAU,GAAG;AACnC,YAAM,QAAQ,MAAM,GAAG,QAAQ,UAAU;AACzC,iBAAW,KAAK,OAAO;AACrB,YAAI,EAAE,SAAS,YAAY,KAAK,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AQ,QAAQ,EAChB;AAAA,EACC;AACF,EACC,OAAO,WAAW,oDAAoD,KAAK,EAC3E,OAAO,aAAa;AAEvB,QACG,QAAQ,MAAM,EACd,YAAY,2DAA2D,EACvE,OAAO,WAAW;AAErB,QAAQ,MAAM;","names":["path","fs","path","fs","path","fs","path","fs","path","fs","fileURLToPath","__filename","__dirname","providers","path","fs","pkg","createRequire","require","path","fs","chalk","chalk","path","fs","createRequire","require","pkg","chalk","chalk","require"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/commands/init.ts","../src/providers/copilot.ts","../src/providers/claude-code.ts","../src/providers/generic.ts","../src/providers/index.ts","../src/utils/prompts.ts","../src/utils/stacks.ts","../src/commands/update.ts","../src/commands/list.ts"],"sourcesContent":["import { Command } from \"commander\";\r\nimport { initCommand } from \"./commands/init.js\";\r\nimport { updateCommand } from \"./commands/update.js\";\r\nimport { listCommand } from \"./commands/list.js\";\r\nimport { createRequire } from \"module\";\r\n\r\nconst require = createRequire(import.meta.url);\r\nconst pkg = require(\"../package.json\");\r\n\r\nconst program = new Command();\r\n\r\nprogram\r\n .name(\"spec-lite\")\r\n .description(\r\n \"Install structured AI sub-agent prompts into your workspace for any AI coding assistant\"\r\n )\r\n .version(pkg.version);\r\n\r\nprogram\r\n .command(\"init\")\r\n .description(\"Initialize spec-lite sub-agent prompts in your workspace\")\r\n .option(\r\n \"--ai <provider>\",\r\n \"AI provider to configure for (copilot, claude-code, generic)\"\r\n )\r\n .option(\r\n \"--exclude <prompts>\",\r\n \"Comma-separated list of prompts to exclude (e.g., brainstorm,readme)\"\r\n )\r\n .option(\"--force\", \"Overwrite existing files without prompting\", false)\r\n .option(\r\n \"--skip-profile\",\r\n \"Skip the project profile questionnaire (for CI/scripting)\"\r\n )\r\n .action(initCommand);\r\n\r\nprogram\r\n .command(\"update\")\r\n .description(\r\n \"Update spec-lite prompts to the latest version, preserving your Project Context edits\"\r\n )\r\n .option(\"--force\", \"Overwrite all files including user-modified ones\", false)\r\n .action(updateCommand);\r\n\r\nprogram\r\n .command(\"list\")\r\n .description(\"List all available spec-lite sub-agents and their purpose\")\r\n .action(listCommand);\r\n\r\nprogram.parse();\r\n","import path from \"path\";\r\nimport fs from \"fs-extra\";\r\nimport chalk from \"chalk\";\r\nimport inquirer from \"inquirer\";\r\nimport { getProvider, getAllProviders } from \"../providers/index.js\";\r\nimport type { SpecLiteConfig, ProjectProfile } from \"../providers/base.js\";\r\nimport { loadPrompts, replaceProjectContext } from \"../utils/prompts.js\";\r\nimport { generateClaudeRootMd } from \"../providers/claude-code.js\";\r\nimport { mergeCopilotInstructions } from \"../providers/copilot.js\";\r\nimport { getStackSnippet } from \"../utils/stacks.js\";\r\n\r\ninterface InitOptions {\r\n ai?: string;\r\n exclude?: string;\r\n force?: boolean;\r\n skipProfile?: boolean;\r\n}\r\n\r\nconst LANGUAGE_CHOICES = [\r\n { name: \"TypeScript\", value: \"TypeScript\" },\r\n { name: \"Python\", value: \"Python\" },\r\n { name: \"Java\", value: \"Java\" },\r\n { name: \"C# / .NET\", value: \"C#\" },\r\n { name: \"Go\", value: \"Go\" },\r\n { name: \"Rust\", value: \"Rust\" },\r\n { name: \"Other (specify below)\", value: \"__other__\" },\r\n];\r\n\r\nconst ARCHITECTURE_CHOICES = [\r\n { name: \"Monolith\", value: \"Monolith\" },\r\n { name: \"Microservices\", value: \"Microservices\" },\r\n { name: \"Serverless\", value: \"Serverless\" },\r\n { name: \"Monorepo\", value: \"Monorepo\" },\r\n { name: \"Other (specify below)\", value: \"__other__\" },\r\n];\r\n\r\n/**\r\n * Collect project profile via interactive questionnaire.\r\n * Returns a ProjectProfile with the user's answers.\r\n */\r\nasync function collectProjectProfile(): Promise<ProjectProfile> {\r\n console.log(\r\n chalk.cyan(\r\n \"\\n š Project Profile ā a few questions to personalize your setup:\\n\"\r\n )\r\n );\r\n\r\n const answers = await inquirer.prompt([\r\n {\r\n type: \"list\",\r\n name: \"language\",\r\n message: \"Primary programming language?\",\r\n choices: LANGUAGE_CHOICES,\r\n },\r\n {\r\n type: \"input\",\r\n name: \"languageOther\",\r\n message: \"Specify your primary language:\",\r\n when: (prev: Record<string, string>) => prev.language === \"__other__\",\r\n validate: (input: string) =>\r\n input.trim() ? true : \"Please enter a language.\",\r\n },\r\n {\r\n type: \"input\",\r\n name: \"frameworks\",\r\n message:\r\n 'Framework(s) in use? (e.g., \"Express + React\", \"FastAPI\", \"ASP.NET Core\")',\r\n default: \"None / not sure yet\",\r\n },\r\n {\r\n type: \"input\",\r\n name: \"testFramework\",\r\n message:\r\n 'Testing framework? (e.g., \"Jest\", \"Vitest\", \"pytest\", \"xUnit\")',\r\n default: \"Not decided yet\",\r\n },\r\n {\r\n type: \"list\",\r\n name: \"architecture\",\r\n message: \"Architectural pattern?\",\r\n choices: ARCHITECTURE_CHOICES,\r\n },\r\n {\r\n type: \"input\",\r\n name: \"architectureOther\",\r\n message: \"Specify your architectural pattern:\",\r\n when: (prev: Record<string, string>) => prev.architecture === \"__other__\",\r\n validate: (input: string) =>\r\n input.trim() ? true : \"Please enter a pattern.\",\r\n },\r\n {\r\n type: \"input\",\r\n name: \"conventions\",\r\n message:\r\n 'Any specific coding conventions? (e.g., \"Airbnb style guide\", \"PEP 8\") ā leave blank if none',\r\n default: \"\",\r\n },\r\n ]);\r\n\r\n return {\r\n language:\r\n answers.language === \"__other__\"\r\n ? answers.languageOther.trim()\r\n : answers.language,\r\n frameworks: answers.frameworks.trim(),\r\n testFramework: answers.testFramework.trim(),\r\n architecture:\r\n answers.architecture === \"__other__\"\r\n ? answers.architectureOther.trim()\r\n : answers.architecture,\r\n conventions: answers.conventions.trim(),\r\n };\r\n}\r\n\r\n/**\r\n * Build a Project Context block string from a ProjectProfile.\r\n * This replaces the placeholder content inside <!-- project-context-start/end --> markers.\r\n */\r\nfunction buildProjectContextBlock(profile: ProjectProfile): string {\r\n const lines = [\r\n \"\",\r\n \"## Project Context (Customize per project)\",\r\n \"\",\r\n \"> Auto-populated by spec-lite init. Edit these values as your project evolves.\",\r\n \"\",\r\n `- **Language(s)**: ${profile.language}`,\r\n `- **Framework(s)**: ${profile.frameworks}`,\r\n `- **Test Framework**: ${profile.testFramework}`,\r\n `- **Architecture**: ${profile.architecture}`,\r\n ];\r\n if (profile.conventions) {\r\n lines.push(`- **Conventions**: ${profile.conventions}`);\r\n }\r\n lines.push(\"\");\r\n return lines.join(\"\\n\");\r\n}\r\n\r\n/**\r\n * Build a seeded .spec-lite/memory.md from raw content scraped from a provider's\r\n * existing instructions file (e.g. copilot-instructions.md, CLAUDE.md).\r\n * The file is intentionally unstructured ā /memorize bootstrap will organize it.\r\n */\r\nfunction buildSeededMemory(\r\n sourceContent: string,\r\n sourcePath: string,\r\n version: string\r\n): string {\r\n const date = new Date().toISOString().split(\"T\")[0];\r\n return [\r\n `<!-- Generated by spec-lite v${version} | sub-agent: memorize | seeded-from: ${sourcePath} | updated: ${date} -->`,\r\n \"\",\r\n \"# Memory ā Standing Instructions\",\r\n \"\",\r\n `> These instructions were **auto-seeded** from \\`${sourcePath}\\` during \\`spec-lite init\\`.`,\r\n \"> They have not yet been organized into sections.\",\r\n \"> Run \\`/memorize bootstrap\\` in your AI assistant to review, reorganize, and refine them.\",\r\n \">\",\r\n \"> Memory is the **authoritative source** for coding standards, architecture, testing, logging, and security.\",\r\n \"> Plans may contain plan-specific overrides but should not duplicate these rules.\",\r\n \"> Managed by the Memorize sub-agent. Do not edit section headers manually.\",\r\n \"> To add or change instructions, invoke: `/memorize <your instructions>`\",\r\n \"> To override: `/memorize override <your instructions>`\",\r\n \"> To generate from project analysis: `/memorize bootstrap`\",\r\n \"\",\r\n `<!-- seed-start: raw content imported from ${sourcePath} -->`,\r\n \"\",\r\n `## Imported from \\`${sourcePath}\\``,\r\n \"\",\r\n sourceContent.trim(),\r\n \"\",\r\n \"<!-- seed-end -->\",\r\n \"\",\r\n ].join(\"\\n\");\r\n}\r\n\r\nexport async function initCommand(options: InitOptions): Promise<void> {\r\n const cwd = process.cwd();\r\n\r\n console.log(chalk.bold(\"\\nā” spec-lite init\\n\"));\r\n\r\n // 1. Resolve provider\r\n let providerAlias = options.ai;\r\n\r\n if (!providerAlias) {\r\n const providers = getAllProviders();\r\n const answer = await inquirer.prompt([\r\n {\r\n type: \"list\",\r\n name: \"provider\",\r\n message: \"Which AI coding assistant are you using?\",\r\n choices: providers.map((p) => ({\r\n name: `${p.name} ā ${p.description}`,\r\n value: p.alias,\r\n })),\r\n },\r\n ]);\r\n providerAlias = answer.provider as string;\r\n }\r\n\r\n const provider = getProvider(providerAlias!);\r\n if (!provider) {\r\n console.error(\r\n chalk.red(\r\n `Unknown provider: \"${providerAlias}\". Available: ${getAllProviders()\r\n .map((p) => p.alias)\r\n .join(\", \")}`\r\n )\r\n );\r\n process.exit(1);\r\n }\r\n\r\n console.log(chalk.cyan(` Provider: ${provider.name}`));\r\n\r\n // 2. Collect project profile (unless --skip-profile)\r\n let projectProfile: ProjectProfile | undefined;\r\n if (!options.skipProfile) {\r\n projectProfile = await collectProjectProfile();\r\n console.log(chalk.green(\" ā Project profile collected\"));\r\n } else {\r\n console.log(chalk.dim(\" Skipping project profile questionnaire.\"));\r\n }\r\n\r\n // 3. Parse exclusions (split on commas or spaces to handle both bash and PowerShell)\r\n const exclude = options.exclude\r\n ? options.exclude.split(/[,\\s]+/).map((s) => s.trim()).filter(Boolean)\r\n : [];\r\n\r\n if (exclude.length > 0) {\r\n console.log(chalk.dim(` Excluding: ${exclude.join(\", \")}`));\r\n }\r\n\r\n // 3b. Capture pre-existing seed content (before we write anything to the provider's instructions file)\r\n const memorySeedSource = await provider.getMemorySeedSource(cwd);\r\n let preSeedContent: string | null = null;\r\n if (memorySeedSource) {\r\n const seedAbsPath = path.join(cwd, memorySeedSource.path);\r\n if (await fs.pathExists(seedAbsPath)) {\r\n preSeedContent = await fs.readFile(seedAbsPath, \"utf-8\");\r\n }\r\n }\r\n\r\n // 4. Check for existing files\r\n const existingFiles = await provider.detectExisting(cwd);\r\n let globalAction: \"overwrite\" | \"skip\" | null = null;\r\n\r\n if (existingFiles.length > 0 && !options.force) {\r\n console.log(\r\n chalk.yellow(\r\n `\\n Found existing instruction files:\\n${existingFiles\r\n .map((f) => ` - ${f}`)\r\n .join(\"\\n\")}`\r\n )\r\n );\r\n\r\n const answer = await inquirer.prompt([\r\n {\r\n type: \"list\",\r\n name: \"action\",\r\n message: \"How should we handle existing files?\",\r\n choices: [\r\n {\r\n name: \"Overwrite ā replace all existing files\",\r\n value: \"overwrite\",\r\n },\r\n {\r\n name: \"Skip ā only write files that don't exist yet\",\r\n value: \"skip\",\r\n },\r\n { name: \"Abort ā cancel initialization\", value: \"abort\" },\r\n ],\r\n },\r\n ]);\r\n\r\n if (answer.action === \"abort\") {\r\n console.log(chalk.dim(\" Aborted.\"));\r\n return;\r\n }\r\n\r\n globalAction = answer.action as \"overwrite\" | \"skip\";\r\n\r\n if (globalAction === \"skip\") {\r\n console.log(chalk.dim(\" Skipping existing files.\"));\r\n }\r\n }\r\n\r\n // 5. Build project context block (if profile was collected)\r\n const contextBlock = projectProfile\r\n ? buildProjectContextBlock(projectProfile)\r\n : null;\r\n\r\n // 6. Load and write prompts\r\n const prompts = await loadPrompts(exclude);\r\n let written = 0;\r\n let skipped = 0;\r\n const installedPrompts: string[] = [];\r\n\r\n for (const prompt of prompts) {\r\n const targetRelPath = provider.getTargetPath(prompt.name);\r\n const targetAbsPath = path.join(cwd, targetRelPath);\r\n\r\n // Skip if file exists and user chose \"skip\" globally\r\n if (\r\n !options.force &&\r\n existingFiles.includes(targetRelPath) &&\r\n globalAction === \"skip\"\r\n ) {\r\n skipped++;\r\n installedPrompts.push(prompt.name);\r\n continue;\r\n }\r\n\r\n // Inject project context into prompt if profile was collected\r\n let content = prompt.content;\r\n if (contextBlock) {\r\n content = replaceProjectContext(content, contextBlock);\r\n }\r\n\r\n const transformed = provider.transformPrompt(content, {\r\n name: prompt.name,\r\n title: prompt.title,\r\n description: prompt.description,\r\n });\r\n\r\n await fs.ensureDir(path.dirname(targetAbsPath));\r\n await fs.writeFile(targetAbsPath, transformed, \"utf-8\");\r\n written++;\r\n installedPrompts.push(prompt.name);\r\n\r\n console.log(chalk.green(` ā ${targetRelPath}`));\r\n }\r\n\r\n // 7. Provider-specific extras\r\n if (provider.alias === \"claude-code\") {\r\n const claudeMdPath = path.join(cwd, \"CLAUDE.md\");\r\n const claudeMdContent = generateClaudeRootMd(installedPrompts);\r\n await fs.writeFile(claudeMdPath, claudeMdContent, \"utf-8\");\r\n console.log(chalk.green(` ā CLAUDE.md`));\r\n written++;\r\n }\r\n\r\n if (provider.alias === \"copilot\") {\r\n const copilotInstructionsPath = path.join(cwd, \".github\", \"copilot-instructions.md\");\r\n await fs.ensureDir(path.join(cwd, \".github\"));\r\n const existingContent = (await fs.pathExists(copilotInstructionsPath))\r\n ? await fs.readFile(copilotInstructionsPath, \"utf-8\")\r\n : null;\r\n const merged = mergeCopilotInstructions(existingContent, installedPrompts);\r\n await fs.writeFile(copilotInstructionsPath, merged, \"utf-8\");\r\n if (existingContent) {\r\n console.log(chalk.green(` ā .github/copilot-instructions.md (updated with spec-lite block)`));\r\n } else {\r\n console.log(chalk.green(` ā .github/copilot-instructions.md`));\r\n }\r\n written++;\r\n }\r\n\r\n // 8. Create .spec-lite/ directory structure for agent outputs\r\n const specDirs = [\r\n path.join(\".spec-lite\", \"features\"),\r\n path.join(\".spec-lite\", \"reviews\"),\r\n ];\r\n for (const dir of specDirs) {\r\n const absDir = path.join(cwd, dir);\r\n if (!(await fs.pathExists(absDir))) {\r\n await fs.ensureDir(absDir);\r\n console.log(chalk.green(` ā ${dir}/`));\r\n }\r\n }\r\n\r\n // 8b. Create .spec-lite/TODO.md skeleton\r\n const todoPath = path.join(cwd, \".spec-lite\", \"TODO.md\");\r\n if (!(await fs.pathExists(todoPath))) {\r\n const todoContent = [\r\n \"# TODO ā Enhancements & Ideas\",\r\n \"\",\r\n \"> Discovered by sub-agents during planning and development.\",\r\n \"> Items here are out-of-scope for their current task but worth tracking.\",\r\n \"\",\r\n \"## General\",\r\n \"\",\r\n \"## General / Caching\",\r\n \"\",\r\n \"## UI\",\r\n \"\",\r\n \"## Performance\",\r\n \"\",\r\n \"## Security\",\r\n \"\",\r\n \"## DX (Developer Experience)\",\r\n \"\",\r\n ].join(\"\\n\");\r\n await fs.writeFile(todoPath, todoContent, \"utf-8\");\r\n console.log(chalk.green(` ā .spec-lite/TODO.md`));\r\n }\r\n\r\n // 9. Copy bundled stack snippet to .spec-lite/stacks/ (if profile was collected)\r\n if (projectProfile) {\r\n const snippet = getStackSnippet(projectProfile.language);\r\n if (snippet) {\r\n const stacksTargetDir = path.join(cwd, \".spec-lite\", \"stacks\");\r\n await fs.ensureDir(stacksTargetDir);\r\n const snippetFileName = `${projectProfile.language.toLowerCase().replace(/[^a-z0-9]/g, \"-\")}.md`;\r\n const snippetPath = path.join(stacksTargetDir, snippetFileName);\r\n\r\n if (await fs.pathExists(snippetPath) && !options.force) {\r\n console.log(\r\n chalk.dim(` ā .spec-lite/stacks/${snippetFileName} already exists (kept your edits)`)\r\n );\r\n } else {\r\n await fs.writeFile(snippetPath, snippet, \"utf-8\");\r\n console.log(\r\n chalk.green(` ā .spec-lite/stacks/${snippetFileName}`)\r\n );\r\n console.log(\r\n chalk.dim(\" ā³ Edit this file to customize defaults before running /memorize bootstrap\")\r\n );\r\n written++;\r\n }\r\n }\r\n }\r\n\r\n // 9b. Offer to seed .spec-lite/memory.md from pre-existing provider instructions\r\n let memorySeedWritten = false;\r\n const memoryPath = path.join(cwd, \".spec-lite\", \"memory.md\");\r\n if (preSeedContent && memorySeedSource && !(await fs.pathExists(memoryPath))) {\r\n console.log(\r\n chalk.cyan(`\\n š” Found existing ${memorySeedSource.label} (${memorySeedSource.path}).`)\r\n );\r\n const seedAnswer = await inquirer.prompt([\r\n {\r\n type: \"confirm\",\r\n name: \"seedMemory\",\r\n message: `Seed .spec-lite/memory.md from it so /memorize bootstrap can refine your existing conventions?`,\r\n default: true,\r\n },\r\n ]);\r\n if (seedAnswer.seedMemory) {\r\n const seedPkg = await loadPackageVersion();\r\n const seededContent = buildSeededMemory(preSeedContent, memorySeedSource.path, seedPkg);\r\n await fs.ensureDir(path.join(cwd, \".spec-lite\"));\r\n await fs.writeFile(memoryPath, seededContent, \"utf-8\");\r\n memorySeedWritten = true;\r\n written++;\r\n console.log(chalk.green(` ā .spec-lite/memory.md (seeded from ${memorySeedSource.path})`));\r\n console.log(chalk.dim(\" ā³ Run /memorize bootstrap to organize and refine into standing instructions\"));\r\n }\r\n }\r\n\r\n // 10. Write .spec-lite.json config\r\n const pkg = await loadPackageVersion();\r\n const config: SpecLiteConfig = {\r\n version: pkg,\r\n provider: provider.alias,\r\n installedPrompts,\r\n installedAt: new Date().toISOString(),\r\n updatedAt: new Date().toISOString(),\r\n ...(projectProfile ? { projectProfile } : {}),\r\n };\r\n const configPath = path.join(cwd, \".spec-lite.json\");\r\n await fs.writeJson(configPath, config, { spaces: 2 });\r\n console.log(chalk.green(` ā .spec-lite.json`));\r\n\r\n // 11. Summary\r\n console.log(\r\n chalk.bold(\r\n `\\n Done! ${written} files written, ${skipped} skipped.`\r\n )\r\n );\r\n console.log(provider.getPostInitMessage());\r\n\r\n // 12. Bootstrap next-step guidance\r\n if (projectProfile || memorySeedWritten) {\r\n if (memorySeedWritten) {\r\n console.log(\r\n chalk.cyan(\r\n \"\\n š Next step: Run \") +\r\n chalk.bold(\"/memorize bootstrap\") +\r\n chalk.cyan(\r\n \" in your AI assistant.\\n It will see your seeded memory and offer to merge or refine it\\n into properly organized standing instructions.\"\r\n )\r\n );\r\n } else {\r\n console.log(\r\n chalk.cyan(\r\n \"\\n š Next step: Run \") +\r\n chalk.bold(\"/memorize bootstrap\") +\r\n chalk.cyan(\r\n \" in your AI assistant to auto-generate\\n coding standards, architecture guidelines, and best practices\\n for your project based on the profile you just provided.\"\r\n )\r\n );\r\n }\r\n }\r\n}\r\n\r\nasync function loadPackageVersion(): Promise<string> {\r\n try {\r\n const { createRequire } = await import(\"module\");\r\n const require = createRequire(import.meta.url);\r\n const pkg = require(\"../../package.json\");\r\n return pkg.version;\r\n } catch {\r\n return \"0.0.3\";\r\n }\r\n}\r\n","import path from \"path\";\r\nimport fs from \"fs-extra\";\r\nimport type { Provider, PromptMeta } from \"./base.js\";\r\n\r\n/**\r\n * GitHub Copilot provider.\r\n *\r\n * Writes individual agent files to `.github/copilot-instructions/` as markdown,\r\n * plus a main `.github/copilot-instructions.md` that references the spec-lite agents.\r\n *\r\n * GitHub Copilot supports:\r\n * - `.github/copilot-instructions.md` ā global instructions loaded into every Copilot Chat session\r\n * - Individual prompt files that can be referenced via @workspace or loaded as custom instructions\r\n */\r\nexport class CopilotProvider implements Provider {\r\n name = \"GitHub Copilot\";\r\n alias = \"copilot\";\r\n description = \"GitHub Copilot (VS Code, JetBrains, Neovim)\";\r\n\r\n getTargetPath(promptName: string): string {\r\n return path.join(\".github\", \"copilot\", `${promptName}.prompt.md`);\r\n }\r\n\r\n transformPrompt(content: string, meta: PromptMeta): string {\r\n // Copilot expects standard markdown. We add a brief header comment\r\n // identifying this as a spec-lite managed file.\r\n const header = [\r\n `<!-- spec-lite | ${meta.name} | DO NOT EDIT below the project-context block ā managed by spec-lite -->`,\r\n `<!-- To update: run \"spec-lite update\" ā your Project Context edits will be preserved -->`,\r\n \"\",\r\n ].join(\"\\n\");\r\n\r\n return header + content;\r\n }\r\n\r\n async detectExisting(workspaceRoot: string): Promise<string[]> {\r\n const existing: string[] = [];\r\n\r\n // Check for copilot instructions directory\r\n const copilotDir = path.join(workspaceRoot, \".github\", \"copilot\");\r\n if (await fs.pathExists(copilotDir)) {\r\n const files = await fs.readdir(copilotDir);\r\n for (const f of files) {\r\n if (f.endsWith(\".prompt.md\") || f.endsWith(\".md\")) {\r\n existing.push(path.join(\".github\", \"copilot\", f));\r\n }\r\n }\r\n }\r\n\r\n // Check for main instructions file\r\n const mainFile = path.join(\r\n workspaceRoot,\r\n \".github\",\r\n \"copilot-instructions.md\"\r\n );\r\n if (await fs.pathExists(mainFile)) {\r\n existing.push(\".github/copilot-instructions.md\");\r\n }\r\n\r\n return existing;\r\n }\r\n\r\n async getMemorySeedSource(\r\n workspaceRoot: string\r\n ): Promise<{ path: string; label: string } | null> {\r\n const p = path.join(workspaceRoot, \".github\", \"copilot-instructions.md\");\r\n if (await fs.pathExists(p)) {\r\n return { path: \".github/copilot-instructions.md\", label: \"GitHub Copilot global instructions\" };\r\n }\r\n return null;\r\n }\r\n\r\n getPostInitMessage(): string {\r\n return [\r\n \"\",\r\n \"š GitHub Copilot setup complete!\",\r\n \"\",\r\n \" Your sub-agent prompts are in .github/copilot/\",\r\n \"\",\r\n \" How to use:\",\r\n \" 1. Open GitHub Copilot Chat in VS Code\",\r\n \" 2. Sub-agents are available as slash commands ā type /prompt_name\",\r\n \" (e.g., /brainstorm, /planner, /feature)\",\r\n \" 3. Files ending in .prompt.md are natively recognized by Copilot\",\r\n \" 4. Customize the Project Context block in each file for your project\",\r\n \"\",\r\n ].join(\"\\n\");\r\n }\r\n}\r\n\r\nconst SPEC_LITE_MARKER_START = \"<!-- spec-lite:start -->\";\r\nconst SPEC_LITE_MARKER_END = \"<!-- spec-lite:end -->\";\r\n\r\n/**\r\n * Generate the spec-lite block to inject into (or create as) copilot-instructions.md.\r\n */\r\nexport function generateSpecLiteBlock(installedPrompts: string[]): string {\r\n const lines = [\r\n SPEC_LITE_MARKER_START,\r\n \"## spec-lite Sub-Agents\",\r\n \"\",\r\n \"This project uses [spec-lite](https://github.com/ranjithab/spec-lite) sub-agent prompts\",\r\n \"for structured software engineering workflows.\",\r\n \"\",\r\n \"The following specialist sub-agents are available in `.github/copilot/`:\",\r\n \"\",\r\n ];\r\n\r\n for (const name of installedPrompts) {\r\n lines.push(`- [${name}](.github/copilot/${name}.prompt.md)`);\r\n }\r\n\r\n lines.push(\r\n \"\",\r\n \"To invoke a sub-agent in Copilot Chat, use the `#` file reference or type `/` to browse prompt files.\",\r\n SPEC_LITE_MARKER_END\r\n );\r\n\r\n return lines.join(\"\\n\");\r\n}\r\n\r\n/**\r\n * Merge the spec-lite block into an existing copilot-instructions.md, or create fresh content.\r\n * If the file already has spec-lite markers, the block between them is replaced.\r\n * Otherwise the block is appended.\r\n */\r\nexport function mergeCopilotInstructions(\r\n existingContent: string | null,\r\n installedPrompts: string[]\r\n): string {\r\n const block = generateSpecLiteBlock(installedPrompts);\r\n\r\n if (!existingContent) {\r\n return block + \"\\n\";\r\n }\r\n\r\n // Replace existing spec-lite block if markers are present\r\n const startIdx = existingContent.indexOf(SPEC_LITE_MARKER_START);\r\n const endIdx = existingContent.indexOf(SPEC_LITE_MARKER_END);\r\n\r\n if (startIdx !== -1 && endIdx !== -1 && endIdx > startIdx) {\r\n return (\r\n existingContent.slice(0, startIdx) +\r\n block +\r\n existingContent.slice(endIdx + SPEC_LITE_MARKER_END.length)\r\n );\r\n }\r\n\r\n // Append the block to existing content (preserving user content)\r\n const separator = existingContent.endsWith(\"\\n\") ? \"\\n\" : \"\\n\\n\";\r\n return existingContent + separator + block + \"\\n\";\r\n}\r\n","import path from \"path\";\r\nimport fs from \"fs-extra\";\r\nimport type { Provider, PromptMeta } from \"./base.js\";\r\n\r\n/**\r\n * Claude Code (Anthropic) provider.\r\n *\r\n * Claude Code supports:\r\n * - `CLAUDE.md` at the project root ā loaded automatically as project instructions\r\n * - `.claude/` directory for additional configuration\r\n * - Nested `CLAUDE.md` files in subdirectories for scoped instructions\r\n *\r\n * Strategy:\r\n * - Write individual agent files to `.claude/prompts/<name>.md`\r\n * - Create/update a root `CLAUDE.md` that references the spec-lite agent collection\r\n * and provides a high-level overview\r\n */\r\nexport class ClaudeCodeProvider implements Provider {\r\n name = \"Claude Code\";\r\n alias = \"claude-code\";\r\n description = \"Claude Code (Anthropic's coding agent)\";\r\n\r\n getTargetPath(promptName: string): string {\r\n return path.join(\".claude\", \"prompts\", `${promptName}.md`);\r\n }\r\n\r\n transformPrompt(content: string, meta: PromptMeta): string {\r\n // Claude Code reads markdown natively. We add a header comment.\r\n const header = [\r\n `<!-- spec-lite | ${meta.name} | DO NOT EDIT below the project-context block ā managed by spec-lite -->`,\r\n `<!-- To update: run \"spec-lite update\" ā your Project Context edits will be preserved -->`,\r\n \"\",\r\n ].join(\"\\n\");\r\n\r\n return header + content;\r\n }\r\n\r\n async detectExisting(workspaceRoot: string): Promise<string[]> {\r\n const existing: string[] = [];\r\n\r\n // Check for claude prompts directory\r\n const claudePromptsDir = path.join(\r\n workspaceRoot,\r\n \".claude\",\r\n \"prompts\"\r\n );\r\n if (await fs.pathExists(claudePromptsDir)) {\r\n const files = await fs.readdir(claudePromptsDir);\r\n for (const f of files) {\r\n if (f.endsWith(\".md\")) {\r\n existing.push(path.join(\".claude\", \"prompts\", f));\r\n }\r\n }\r\n }\r\n\r\n // Check for root CLAUDE.md\r\n const rootFile = path.join(workspaceRoot, \"CLAUDE.md\");\r\n if (await fs.pathExists(rootFile)) {\r\n existing.push(\"CLAUDE.md\");\r\n }\r\n\r\n return existing;\r\n }\r\n\r\n async getMemorySeedSource(\r\n workspaceRoot: string\r\n ): Promise<{ path: string; label: string } | null> {\r\n const p = path.join(workspaceRoot, \"CLAUDE.md\");\r\n if (await fs.pathExists(p)) {\r\n return { path: \"CLAUDE.md\", label: \"Claude root instructions (CLAUDE.md)\" };\r\n }\r\n return null;\r\n }\r\n\r\n getPostInitMessage(): string {\r\n return [\r\n \"\",\r\n \"š Claude Code setup complete!\",\r\n \"\",\r\n \" Your sub-agent prompts are in .claude/prompts/\",\r\n \" A root CLAUDE.md has been created with references to the sub-agents.\",\r\n \"\",\r\n \" How to use:\",\r\n \" 1. Claude Code automatically reads CLAUDE.md for project context\",\r\n ' 2. Reference specific sub-agents: \"Use the planner from .claude/prompts/planner.md\"',\r\n \" 3. Customize the Project Context block in each file for your project\",\r\n \"\",\r\n ].join(\"\\n\");\r\n }\r\n}\r\n\r\n/**\r\n * Generate the root CLAUDE.md content that references spec-lite sub-agents.\r\n */\r\nexport function generateClaudeRootMd(\r\n installedPrompts: string[]\r\n): string {\r\n const lines = [\r\n \"<!-- spec-lite managed ā regenerated on spec-lite init/update -->\",\r\n \"\",\r\n \"# Project Instructions\",\r\n \"\",\r\n \"This project uses [spec-lite](https://github.com/ranjithab/spec-lite) sub-agent prompts\",\r\n \"for structured software engineering workflows.\",\r\n \"\",\r\n \"## Available Sub-Agents\",\r\n \"\",\r\n \"The following specialist sub-agents are available in `.claude/prompts/`:\",\r\n \"\",\r\n ];\r\n\r\n for (const name of installedPrompts) {\r\n lines.push(`- [${name}](.claude/prompts/${name}.md)`);\r\n }\r\n\r\n lines.push(\r\n \"\",\r\n \"## Usage\",\r\n \"\",\r\n \"To use a sub-agent, reference its prompt file in your conversation:\",\r\n \"\",\r\n '```text',\r\n \"Use the planner from .claude/prompts/planner.md to create a technical plan for this project.\",\r\n '```',\r\n \"\",\r\n \"## Output Directory\",\r\n \"\",\r\n \"Sub-agent outputs are written to the `.spec-lite/` directory:\",\r\n \"\",\r\n \"```text\",\r\n \".spec-lite/\",\r\n \"āāā brainstorm.md\",\r\n \"āāā plan.md # Default plan (simple projects)\",\r\n \"āāā plan_<name>.md # Named plans (complex projects)\",\r\n \"āāā TODO.md\",\r\n \"āāā features/\",\r\n \"āāā reviews/\",\r\n \"```\",\r\n \"\"\r\n );\r\n\r\n return lines.join(\"\\n\");\r\n}\r\n","import path from \"path\";\r\nimport fs from \"fs-extra\";\r\nimport type { Provider, PromptMeta } from \"./base.js\";\r\n\r\n/**\r\n * Generic provider ā for manual usage or unsupported AI tools.\r\n *\r\n * Writes prompts to `.spec-lite/prompts/` as raw markdown.\r\n * Users can copy-paste these into any LLM chat.\r\n */\r\nexport class GenericProvider implements Provider {\r\n name = \"Generic\";\r\n alias = \"generic\";\r\n description = \"Raw prompts in .spec-lite/prompts/ (copy-paste into any LLM)\";\r\n\r\n getTargetPath(promptName: string): string {\r\n return path.join(\".spec-lite\", \"prompts\", `${promptName}.md`);\r\n }\r\n\r\n transformPrompt(content: string, meta: PromptMeta): string {\r\n // No transformation ā copy as-is with a light header\r\n const header = [\r\n `<!-- spec-lite | ${meta.name} | managed by spec-lite -->`,\r\n `<!-- To update: run \"spec-lite update\" -->`,\r\n \"\",\r\n ].join(\"\\n\");\r\n\r\n return header + content;\r\n }\r\n\r\n async detectExisting(workspaceRoot: string): Promise<string[]> {\r\n const existing: string[] = [];\r\n const dir = path.join(workspaceRoot, \".spec-lite\", \"prompts\");\r\n\r\n if (await fs.pathExists(dir)) {\r\n const files = await fs.readdir(dir);\r\n for (const f of files) {\r\n if (f.endsWith(\".md\")) {\r\n existing.push(path.join(\".spec-lite\", \"prompts\", f));\r\n }\r\n }\r\n }\r\n\r\n return existing;\r\n }\r\n\r\n async getMemorySeedSource(\r\n _workspaceRoot: string\r\n ): Promise<{ path: string; label: string } | null> {\r\n // Generic provider has no canonical instruction file to seed from\r\n return null;\r\n }\r\n\r\n getPostInitMessage(): string {\r\n return [\r\n \"\",\r\n \"š Generic setup complete!\",\r\n \"\",\r\n \" Your sub-agent prompts are in .spec-lite/prompts/\",\r\n \"\",\r\n \" How to use:\",\r\n \" 1. Open any prompt file and copy its content\",\r\n \" 2. Paste into your LLM of choice (ChatGPT, Claude, Gemini, etc.)\",\r\n \" 3. Fill in the Project Context section for your project\",\r\n \" 4. Start the conversation with your requirements\",\r\n \"\",\r\n ].join(\"\\n\");\r\n }\r\n}\r\n","import type { Provider } from \"./base.js\";\r\nimport { CopilotProvider } from \"./copilot.js\";\r\nimport { ClaudeCodeProvider } from \"./claude-code.js\";\r\nimport { GenericProvider } from \"./generic.js\";\r\n\r\n/**\r\n * Registry of all supported AI provider adapters.\r\n */\r\nconst providers: Provider[] = [\r\n new CopilotProvider(),\r\n new ClaudeCodeProvider(),\r\n new GenericProvider(),\r\n];\r\n\r\n/**\r\n * Get a provider by its CLI alias (e.g., \"copilot\", \"claude-code\", \"generic\").\r\n */\r\nexport function getProvider(alias: string): Provider | undefined {\r\n return providers.find((p) => p.alias === alias);\r\n}\r\n\r\n/**\r\n * Get all registered providers.\r\n */\r\nexport function getAllProviders(): Provider[] {\r\n return [...providers];\r\n}\r\n\r\n/**\r\n * Get a formatted list of provider aliases for display.\r\n */\r\nexport function getProviderAliases(): string[] {\r\n return providers.map((p) => p.alias);\r\n}\r\n\r\n// Re-export types\r\nexport type { Provider, PromptMeta, SpecLiteConfig } from \"./base.js\";\r\n","import path from \"path\";\r\nimport fs from \"fs-extra\";\r\nimport { fileURLToPath } from \"url\";\r\n\r\nconst __filename = fileURLToPath(import.meta.url);\r\nconst __dirname = path.dirname(__filename);\r\n\r\n/** Path to the bundled prompts directory (shipped with the npm package) */\r\nexport function getPromptsDir(): string {\r\n // In the built output (tsup bundles to dist/index.js),\r\n // __dirname resolves to dist/ ā prompts/ is one level up at the package root\r\n return path.resolve(__dirname, \"..\", \"prompts\");\r\n}\r\n\r\n/** Metadata extracted from prompt files */\r\nexport interface PromptFile {\r\n /** File name without extension */\r\n name: string;\r\n /** Full file path */\r\n filePath: string;\r\n /** Raw markdown content */\r\n content: string;\r\n /** Extracted title */\r\n title: string;\r\n /** Extracted description */\r\n description: string;\r\n}\r\n\r\n/** Map of prompt names to their human titles and descriptions */\r\nexport const PROMPT_CATALOG: Record<string, { title: string; description: string; output?: string }> = {\r\n spec_help: {\r\n title: \"Spec Help\",\r\n description: \"Lists available sub-agents, their purpose, inputs, and outputs\",\r\n output: \"(interactive guide)\",\r\n },\r\n brainstorm: {\r\n title: \"Brainstorm\",\r\n description: \"Refines a vague idea into a clear, actionable vision\",\r\n output: \".spec-lite/brainstorm.md\",\r\n },\r\n planner: {\r\n title: \"Planner\",\r\n description: \"Creates a detailed technical blueprint from requirements\",\r\n output: \".spec-lite/plan.md or .spec-lite/plan_<name>.md\",\r\n },\r\n feature: {\r\n title: \"Feature\",\r\n description: \"Breaks one feature into granular, verifiable vertical slices\",\r\n output: \".spec-lite/features/feature_<name>.md\",\r\n },\r\n implement: {\r\n title: \"Implement\",\r\n description: \"Picks up a feature spec and executes its tasks with code\",\r\n output: \"Working code + updated feature spec\",\r\n },\r\n code_review: {\r\n title: \"Code Review\",\r\n description: \"Reviews code for correctness, architecture, and readability\",\r\n output: \".spec-lite/reviews/code_review_<name>.md\",\r\n },\r\n security_audit: {\r\n title: \"Security Audit\",\r\n description: \"Scans for vulnerabilities, misconfigurations, and security risks\",\r\n output: \".spec-lite/reviews/security_audit_<scope>.md\",\r\n },\r\n performance_review: {\r\n title: \"Performance Review\",\r\n description: \"Identifies bottlenecks and optimization opportunities\",\r\n output: \".spec-lite/reviews/performance_review_<scope>.md\",\r\n },\r\n integration_tests: {\r\n title: \"Integration Tests\",\r\n description: \"Writes traceable integration test scenarios from feature specs\",\r\n output: \"tests/\",\r\n },\r\n unit_tests: {\r\n title: \"Unit Tests\",\r\n description: \"Generates comprehensive unit tests with edge-case coverage and smart coverage exclusions\",\r\n output: \".spec-lite/features/unit_tests_<name>.md\",\r\n },\r\n devops: {\r\n title: \"DevOps\",\r\n description: \"Sets up Docker, CI/CD, environments, and deployment\",\r\n output: \"Project infrastructure files\",\r\n },\r\n fix: {\r\n title: \"Fix & Refactor\",\r\n description: \"Debugs issues or restructures code safely\",\r\n output: \"Targeted fixes with verification\",\r\n },\r\n memorize: {\r\n title: \"Memorize\",\r\n description:\r\n \"Stores standing instructions that all sub-agents enforce. Use `/memorize bootstrap` to auto-generate from project analysis.\",\r\n output: \".spec-lite/memory.md\",\r\n },\r\n technical_docs: {\r\n title: \"Technical Docs\",\r\n description: \"Creates deep architecture documentation for developers\",\r\n output: \"docs/technical_architecture.md\",\r\n },\r\n readme: {\r\n title: \"README\",\r\n description: \"Writes the project README and optional user guide\",\r\n output: \"README.md + docs/user_guide.md\",\r\n },\r\n architect: {\r\n title: \"Architect\",\r\n description:\r\n \"Designs cloud infrastructure, database strategy, and scaling architecture with Mermaid diagrams\",\r\n output: \".spec-lite/architect_<name>.md\",\r\n },\r\n};\r\n\r\n/** Non-agent files to skip */\r\nconst SKIP_FILES = new Set([\"orchestrator\"]);\r\n\r\n/**\r\n * Load all available prompt files from the bundled prompts directory.\r\n * Excludes non-agent files (orchestrator).\r\n */\r\nexport async function loadPrompts(\r\n exclude: string[] = []\r\n): Promise<PromptFile[]> {\r\n const promptsDir = getPromptsDir();\r\n const excludeSet = new Set([...exclude, ...SKIP_FILES]);\r\n\r\n const files = await fs.readdir(promptsDir);\r\n const prompts: PromptFile[] = [];\r\n\r\n for (const file of files) {\r\n if (!file.endsWith(\".md\")) continue;\r\n\r\n const name = file.replace(\".md\", \"\");\r\n if (excludeSet.has(name)) continue;\r\n\r\n const filePath = path.join(promptsDir, file);\r\n const content = await fs.readFile(filePath, \"utf-8\");\r\n const catalog = PROMPT_CATALOG[name];\r\n\r\n prompts.push({\r\n name,\r\n filePath,\r\n content,\r\n title: catalog?.title ?? name,\r\n description: catalog?.description ?? \"\",\r\n });\r\n }\r\n\r\n return prompts;\r\n}\r\n\r\n/**\r\n * Get the list of all available prompt names.\r\n */\r\nexport function getAvailablePromptNames(): string[] {\r\n return Object.keys(PROMPT_CATALOG);\r\n}\r\n\r\n/**\r\n * Get the full prompt catalog (for display in CLI list command).\r\n */\r\nexport function getPromptCatalog(): Record<string, { title: string; description: string; output?: string }> {\r\n return PROMPT_CATALOG;\r\n}\r\n\r\n/**\r\n * Project Context markers used to preserve user edits during updates.\r\n */\r\nexport const CONTEXT_START_MARKER = \"<!-- project-context-start -->\";\r\nexport const CONTEXT_END_MARKER = \"<!-- project-context-end -->\";\r\n\r\n/**\r\n * Extract the Project Context block from a prompt.\r\n * Returns the content between markers, or null if not found.\r\n */\r\nexport function extractProjectContext(content: string): string | null {\r\n const startIdx = content.indexOf(CONTEXT_START_MARKER);\r\n const endIdx = content.indexOf(CONTEXT_END_MARKER);\r\n\r\n if (startIdx === -1 || endIdx === -1 || endIdx <= startIdx) return null;\r\n\r\n return content.substring(\r\n startIdx + CONTEXT_START_MARKER.length,\r\n endIdx\r\n );\r\n}\r\n\r\n/**\r\n * Replace the Project Context block in a prompt with new content.\r\n */\r\nexport function replaceProjectContext(\r\n content: string,\r\n newContext: string\r\n): string {\r\n const startIdx = content.indexOf(CONTEXT_START_MARKER);\r\n const endIdx = content.indexOf(CONTEXT_END_MARKER);\r\n\r\n if (startIdx === -1 || endIdx === -1 || endIdx <= startIdx) return content;\r\n\r\n return (\r\n content.substring(0, startIdx + CONTEXT_START_MARKER.length) +\r\n newContext +\r\n content.substring(endIdx)\r\n );\r\n}\r\n","import path from \"path\";\r\nimport fs from \"fs-extra\";\r\nimport { fileURLToPath } from \"url\";\r\n\r\nconst __filename = fileURLToPath(import.meta.url);\r\nconst __dirname = path.dirname(__filename);\r\n\r\n/**\r\n * Path to the bundled stacks directory (shipped with the npm package).\r\n * In the built output (tsup bundles to dist/index.js),\r\n * __dirname resolves to dist/ ā stacks/ is copied to dist/stacks/ during build.\r\n */\r\nexport function getStacksDir(): string {\r\n return path.resolve(__dirname, \"stacks\");\r\n}\r\n\r\n/**\r\n * Map of language names (lowercased) to their stack snippet filenames.\r\n * Supports common aliases so the questionnaire answer maps correctly.\r\n */\r\nconst LANGUAGE_MAP: Record<string, string> = {\r\n typescript: \"typescript.md\",\r\n ts: \"typescript.md\",\r\n javascript: \"typescript.md\",\r\n js: \"typescript.md\",\r\n \"node.js\": \"typescript.md\",\r\n node: \"typescript.md\",\r\n react: \"react.md\",\r\n \"react.js\": \"react.md\",\r\n \"next.js\": \"react.md\",\r\n nextjs: \"react.md\",\r\n python: \"python.md\",\r\n py: \"python.md\",\r\n \"c#\": \"dotnet.md\",\r\n csharp: \"dotnet.md\",\r\n \".net\": \"dotnet.md\",\r\n dotnet: \"dotnet.md\",\r\n java: \"java.md\",\r\n \"spring\": \"java.md\",\r\n \"spring boot\": \"java.md\",\r\n \"spring-boot\": \"java.md\",\r\n};\r\n\r\n/**\r\n * Get the bundled best-practice snippet for a given language.\r\n * Returns the markdown content if a matching snippet exists, or null if not.\r\n */\r\nexport function getStackSnippet(language: string): string | null {\r\n const key = language.toLowerCase().trim();\r\n const filename = LANGUAGE_MAP[key];\r\n\r\n if (!filename) return null;\r\n\r\n const filePath = path.join(getStacksDir(), filename);\r\n if (!fs.pathExistsSync(filePath)) return null;\r\n\r\n return fs.readFileSync(filePath, \"utf-8\");\r\n}\r\n\r\n/**\r\n * List all available stack snippet names (for display purposes).\r\n */\r\nexport function listAvailableStacks(): string[] {\r\n const stacksDir = getStacksDir();\r\n if (!fs.pathExistsSync(stacksDir)) return [];\r\n\r\n return fs\r\n .readdirSync(stacksDir)\r\n .filter((f) => f.endsWith(\".md\"))\r\n .map((f) => f.replace(\".md\", \"\"));\r\n}\r\n","import path from \"path\";\r\nimport fs from \"fs-extra\";\r\nimport chalk from \"chalk\";\r\nimport { getProvider } from \"../providers/index.js\";\r\nimport type { SpecLiteConfig } from \"../providers/base.js\";\r\nimport {\r\n loadPrompts,\r\n extractProjectContext,\r\n replaceProjectContext,\r\n} from \"../utils/prompts.js\";\r\nimport { generateClaudeRootMd } from \"../providers/claude-code.js\";\r\nimport { mergeCopilotInstructions } from \"../providers/copilot.js\";\r\n\r\ninterface UpdateOptions {\r\n force?: boolean;\r\n}\r\n\r\nexport async function updateCommand(options: UpdateOptions): Promise<void> {\r\n const cwd = process.cwd();\r\n\r\n console.log(chalk.bold(\"\\nā” spec-lite update\\n\"));\r\n\r\n // 1. Read existing config\r\n const configPath = path.join(cwd, \".spec-lite.json\");\r\n if (!(await fs.pathExists(configPath))) {\r\n console.error(\r\n chalk.red(\r\n ' No .spec-lite.json found. Run \"spec-lite init\" first.'\r\n )\r\n );\r\n process.exit(1);\r\n }\r\n\r\n const config: SpecLiteConfig = await fs.readJson(configPath);\r\n const provider = getProvider(config.provider);\r\n\r\n if (!provider) {\r\n console.error(\r\n chalk.red(\r\n ` Unknown provider \"${config.provider}\" in .spec-lite.json. Re-run \"spec-lite init\".`\r\n )\r\n );\r\n process.exit(1);\r\n }\r\n\r\n console.log(chalk.cyan(` Provider: ${provider.name}`));\r\n console.log(\r\n chalk.dim(` Installed: ${config.installedPrompts.length} prompts`)\r\n );\r\n\r\n // 2. Load latest prompts (only the ones that were previously installed)\r\n const allPrompts = await loadPrompts();\r\n const installedSet = new Set(config.installedPrompts);\r\n const prompts = allPrompts.filter((p) => installedSet.has(p.name));\r\n\r\n let updated = 0;\r\n let preserved = 0;\r\n let unchanged = 0;\r\n let migrated = 0;\r\n\r\n for (const prompt of prompts) {\r\n const targetRelPath = provider.getTargetPath(prompt.name);\r\n const targetAbsPath = path.join(cwd, targetRelPath);\r\n\r\n // Migration: if copilot provider, check for old-format .md files and rename to .prompt.md\r\n if (provider.alias === \"copilot\") {\r\n const oldRelPath = path.join(\".github\", \"copilot\", `${prompt.name}.md`);\r\n const oldAbsPath = path.join(cwd, oldRelPath);\r\n if (\r\n targetRelPath !== oldRelPath &&\r\n (await fs.pathExists(oldAbsPath)) &&\r\n !(await fs.pathExists(targetAbsPath))\r\n ) {\r\n await fs.ensureDir(path.dirname(targetAbsPath));\r\n await fs.rename(oldAbsPath, targetAbsPath);\r\n console.log(\r\n chalk.cyan(\r\n ` ā ${oldRelPath} ā ${targetRelPath} (migrated to .prompt.md)`\r\n )\r\n );\r\n migrated++;\r\n }\r\n }\r\n\r\n // Transform the new prompt content\r\n const newContent = provider.transformPrompt(prompt.content, {\r\n name: prompt.name,\r\n title: prompt.title,\r\n description: prompt.description,\r\n });\r\n\r\n if (!(await fs.pathExists(targetAbsPath))) {\r\n // File was deleted by user ā re-create it\r\n await fs.ensureDir(path.dirname(targetAbsPath));\r\n await fs.writeFile(targetAbsPath, newContent, \"utf-8\");\r\n console.log(chalk.green(` ā ${targetRelPath} (restored)`));\r\n updated++;\r\n continue;\r\n }\r\n\r\n // Read current installed version\r\n const currentContent = await fs.readFile(targetAbsPath, \"utf-8\");\r\n\r\n // Check if content is identical (no update needed)\r\n if (currentContent === newContent) {\r\n unchanged++;\r\n continue;\r\n }\r\n\r\n // Try to preserve user's Project Context edits\r\n if (!options.force) {\r\n const userContext = extractProjectContext(currentContent);\r\n if (userContext) {\r\n const mergedContent = replaceProjectContext(newContent, userContext);\r\n await fs.writeFile(targetAbsPath, mergedContent, \"utf-8\");\r\n console.log(\r\n chalk.green(\r\n ` ā ${targetRelPath} (updated, Project Context preserved)`\r\n )\r\n );\r\n preserved++;\r\n updated++;\r\n continue;\r\n }\r\n }\r\n\r\n // No context block found or --force ā full overwrite\r\n await fs.writeFile(targetAbsPath, newContent, \"utf-8\");\r\n console.log(chalk.green(` ā ${targetRelPath} (updated)`));\r\n updated++;\r\n }\r\n\r\n // 3. Update provider-specific extras\r\n if (provider.alias === \"claude-code\") {\r\n const claudeMdPath = path.join(cwd, \"CLAUDE.md\");\r\n const claudeMdContent = generateClaudeRootMd(config.installedPrompts);\r\n await fs.writeFile(claudeMdPath, claudeMdContent, \"utf-8\");\r\n console.log(chalk.green(` ā CLAUDE.md (regenerated)`));\r\n }\r\n\r\n if (provider.alias === \"copilot\") {\r\n const copilotInstructionsPath = path.join(cwd, \".github\", \"copilot-instructions.md\");\r\n await fs.ensureDir(path.join(cwd, \".github\"));\r\n const existingContent = (await fs.pathExists(copilotInstructionsPath))\r\n ? await fs.readFile(copilotInstructionsPath, \"utf-8\")\r\n : null;\r\n const merged = mergeCopilotInstructions(existingContent, config.installedPrompts);\r\n await fs.writeFile(copilotInstructionsPath, merged, \"utf-8\");\r\n console.log(chalk.green(` ā .github/copilot-instructions.md (updated)`));\r\n }\r\n\r\n // 4. Update config timestamp\r\n config.updatedAt = new Date().toISOString();\r\n try {\r\n const { createRequire } = await import(\"module\");\r\n const require = createRequire(import.meta.url);\r\n const pkg = require(\"../../package.json\");\r\n config.version = pkg.version;\r\n } catch {\r\n // Keep existing version\r\n }\r\n await fs.writeJson(configPath, config, { spaces: 2 });\r\n\r\n // 5. Summary\r\n console.log(\r\n chalk.bold(\r\n `\\n Done! ${updated} updated, ${unchanged} unchanged, ${preserved} with preserved edits${migrated > 0 ? `, ${migrated} migrated` : \"\"}.`\r\n )\r\n );\r\n}\r\n","import chalk from \"chalk\";\r\nimport { getPromptCatalog } from \"../utils/prompts.js\";\r\n\r\nexport async function listCommand(): Promise<void> {\r\n const catalog = getPromptCatalog();\r\n\r\n console.log(chalk.bold(\"\\nā” spec-lite ā Available Sub-Agents\\n\"));\r\n\r\n console.log(\r\n chalk.dim(\r\n \" Each sub-agent is a specialist prompt for one phase of the development lifecycle.\\n\"\r\n )\r\n );\r\n\r\n // Calculate column widths\r\n const entries = Object.entries(catalog);\r\n const maxName = Math.max(...entries.map(([name]) => name.length), 4);\r\n const maxTitle = Math.max(\r\n ...entries.map(([, v]) => v.title.length),\r\n 5\r\n );\r\n\r\n // Header\r\n const header = ` ${\"Name\".padEnd(maxName + 2)}${\"Title\".padEnd(maxTitle + 2)}${\"Description\"}`;\r\n console.log(chalk.cyan(header));\r\n console.log(chalk.dim(` ${\"ā\".repeat(header.trim().length + 10)}`));\r\n\r\n // Rows\r\n for (const [name, meta] of entries) {\r\n const nameCol = chalk.green(name.padEnd(maxName + 2));\r\n const titleCol = chalk.white(meta.title.padEnd(maxTitle + 2));\r\n const descCol = chalk.dim(meta.description);\r\n console.log(` ${nameCol}${titleCol}${descCol}`);\r\n if (meta.output) {\r\n console.log(\r\n ` ${\"\".padEnd(maxName + 2)}${\"\".padEnd(maxTitle + 2)}${chalk.dim(`ā ${meta.output}`)}`\r\n );\r\n }\r\n }\r\n\r\n console.log(\r\n chalk.dim(\r\n `\\n ${entries.length} sub-agents available. Run \"spec-lite init\" to install them.\\n`\r\n )\r\n );\r\n\r\n // Pipeline\r\n console.log(chalk.bold(\" Recommended Pipeline:\\n\"));\r\n console.log(\r\n chalk.dim(\r\n \" Brainstorm ā Planner ā Feature (ĆN) ā Reviews ā Tests ā DevOps ā Docs\"\r\n )\r\n );\r\n console.log(\r\n chalk.dim(\r\n \" (Not every project needs every sub-agent. Start with Planner if you have clear requirements.)\\n\"\r\n )\r\n );\r\n}\r\n"],"mappings":";;;AAAA,SAAS,eAAe;;;ACAxB,OAAOA,WAAU;AACj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AAAA,IACNA,OAAM;AAAA,MACJ;AAAA,IAAO,QAAQ,MAAM;AAAA;AAAA,IACvB;AAAA,EACF;AAGA,UAAQ,IAAIA,OAAM,KAAK,2BAA2B,CAAC;AACnD,UAAQ;AAAA,IACNA,OAAM;AAAA,MACJ;AAAA,IACF;AAAA,EACF;AACA,UAAQ;AAAA,IACNA,OAAM;AAAA,MACJ;AAAA,IACF;AAAA,EACF;AACF;;;ATtDA,SAAS,qBAAqB;AAE9B,IAAMC,WAAU,cAAc,YAAY,GAAG;AAC7C,IAAM,MAAMA,SAAQ,iBAAiB;AAErC,IAAM,UAAU,IAAI,QAAQ;AAE5B,QACG,KAAK,WAAW,EAChB;AAAA,EACC;AACF,EACC,QAAQ,IAAI,OAAO;AAEtB,QACG,QAAQ,MAAM,EACd,YAAY,0DAA0D,EACtE;AAAA,EACC;AAAA,EACA;AACF,EACC;AAAA,EACC;AAAA,EACA;AACF,EACC,OAAO,WAAW,8CAA8C,KAAK,EACrE;AAAA,EACC;AAAA,EACA;AACF,EACC,OAAO,WAAW;AAErB,QACG,QAAQ,QAAQ,EAChB;AAAA,EACC;AACF,EACC,OAAO,WAAW,oDAAoD,KAAK,EAC3E,OAAO,aAAa;AAEvB,QACG,QAAQ,MAAM,EACd,YAAY,2DAA2D,EACvE,OAAO,WAAW;AAErB,QAAQ,MAAM;","names":["path","fs","path","fs","path","fs","path","fs","path","fs","fileURLToPath","__filename","__dirname","providers","path","fs","pkg","createRequire","require","path","fs","chalk","chalk","path","fs","createRequire","require","pkg","chalk","chalk","require"]}
|
package/package.json
CHANGED