@patricio0312rev/skillset 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/LICENSE +21 -0
  3. package/README.md +176 -0
  4. package/bin/cli.js +37 -0
  5. package/package.json +55 -0
  6. package/src/commands/init.js +301 -0
  7. package/src/index.js +168 -0
  8. package/src/lib/config.js +200 -0
  9. package/src/lib/generator.js +166 -0
  10. package/src/utils/display.js +95 -0
  11. package/src/utils/readme.js +196 -0
  12. package/src/utils/tool-specific.js +233 -0
  13. package/templates/ai-engineering/agent-orchestration-planner/ SKILL.md +266 -0
  14. package/templates/ai-engineering/cost-latency-optimizer/ SKILL.md +270 -0
  15. package/templates/ai-engineering/doc-to-vector-dataset-generator/ SKILL.md +239 -0
  16. package/templates/ai-engineering/evaluation-harness/ SKILL.md +219 -0
  17. package/templates/ai-engineering/guardrails-safety-filter-builder/ SKILL.md +226 -0
  18. package/templates/ai-engineering/llm-debugger/ SKILL.md +283 -0
  19. package/templates/ai-engineering/prompt-regression-tester/ SKILL.md +216 -0
  20. package/templates/ai-engineering/prompt-template-builder/ SKILL.md +393 -0
  21. package/templates/ai-engineering/rag-pipeline-builder/ SKILL.md +244 -0
  22. package/templates/ai-engineering/tool-function-schema-designer/ SKILL.md +219 -0
  23. package/templates/architecture/adr-writer/ SKILL.md +250 -0
  24. package/templates/architecture/api-versioning-deprecation-planner/ SKILL.md +331 -0
  25. package/templates/architecture/domain-model-boundaries-mapper/ SKILL.md +300 -0
  26. package/templates/architecture/migration-planner/ SKILL.md +376 -0
  27. package/templates/architecture/performance-budget-setter/ SKILL.md +318 -0
  28. package/templates/architecture/reliability-strategy-builder/ SKILL.md +286 -0
  29. package/templates/architecture/rfc-generator/ SKILL.md +362 -0
  30. package/templates/architecture/scalability-playbook/ SKILL.md +279 -0
  31. package/templates/architecture/system-design-generator/ SKILL.md +339 -0
  32. package/templates/architecture/tech-debt-prioritizer/ SKILL.md +329 -0
  33. package/templates/backend/api-contract-normalizer/ SKILL.md +487 -0
  34. package/templates/backend/api-endpoint-generator/ SKILL.md +415 -0
  35. package/templates/backend/auth-module-builder/ SKILL.md +99 -0
  36. package/templates/backend/background-jobs-designer/ SKILL.md +166 -0
  37. package/templates/backend/caching-strategist/ SKILL.md +190 -0
  38. package/templates/backend/error-handling-standardizer/ SKILL.md +174 -0
  39. package/templates/backend/rate-limiting-abuse-protection/ SKILL.md +147 -0
  40. package/templates/backend/rbac-permissions-builder/ SKILL.md +158 -0
  41. package/templates/backend/service-layer-extractor/ SKILL.md +269 -0
  42. package/templates/backend/webhook-receiver-hardener/ SKILL.md +211 -0
  43. package/templates/ci-cd/artifact-sbom-publisher/ SKILL.md +236 -0
  44. package/templates/ci-cd/caching-strategy-optimizer/ SKILL.md +195 -0
  45. package/templates/ci-cd/deployment-checklist-generator/ SKILL.md +381 -0
  46. package/templates/ci-cd/github-actions-pipeline-creator/ SKILL.md +348 -0
  47. package/templates/ci-cd/monorepo-ci-optimizer/ SKILL.md +298 -0
  48. package/templates/ci-cd/preview-environments-builder/ SKILL.md +187 -0
  49. package/templates/ci-cd/quality-gates-enforcer/ SKILL.md +342 -0
  50. package/templates/ci-cd/release-automation-builder/ SKILL.md +281 -0
  51. package/templates/ci-cd/rollback-workflow-builder/ SKILL.md +372 -0
  52. package/templates/ci-cd/secrets-env-manager/ SKILL.md +242 -0
  53. package/templates/db-management/backup-restore-runbook-generator/ SKILL.md +505 -0
  54. package/templates/db-management/data-integrity-auditor/ SKILL.md +505 -0
  55. package/templates/db-management/data-retention-archiving-planner/ SKILL.md +430 -0
  56. package/templates/db-management/data-seeding-fixtures-builder/ SKILL.md +375 -0
  57. package/templates/db-management/db-performance-watchlist/ SKILL.md +425 -0
  58. package/templates/db-management/etl-sync-job-builder/ SKILL.md +457 -0
  59. package/templates/db-management/multi-tenant-safety-checker/ SKILL.md +398 -0
  60. package/templates/db-management/prisma-migration-assistant/ SKILL.md +379 -0
  61. package/templates/db-management/schema-consistency-checker/ SKILL.md +440 -0
  62. package/templates/db-management/sql-query-optimizer/ SKILL.md +324 -0
  63. package/templates/foundation/changelog-writer/ SKILL.md +431 -0
  64. package/templates/foundation/code-formatter-installer/ SKILL.md +320 -0
  65. package/templates/foundation/codebase-summarizer/ SKILL.md +360 -0
  66. package/templates/foundation/dependency-doctor/ SKILL.md +163 -0
  67. package/templates/foundation/dev-environment-bootstrapper/ SKILL.md +259 -0
  68. package/templates/foundation/dev-onboarding-builder/ SKILL.md +556 -0
  69. package/templates/foundation/docs-starter-kit/ SKILL.md +574 -0
  70. package/templates/foundation/explaining-code/SKILL.md +13 -0
  71. package/templates/foundation/git-hygiene-enforcer/ SKILL.md +455 -0
  72. package/templates/foundation/project-scaffolder/ SKILL.md +65 -0
  73. package/templates/foundation/project-scaffolder/references/templates.md +126 -0
  74. package/templates/foundation/repo-structure-linter/ SKILL.md +0 -0
  75. package/templates/foundation/repo-structure-linter/references/conventions.md +98 -0
  76. package/templates/frontend/animation-micro-interaction-pack/ SKILL.md +41 -0
  77. package/templates/frontend/component-scaffold-generator/ SKILL.md +562 -0
  78. package/templates/frontend/design-to-component-translator/ SKILL.md +547 -0
  79. package/templates/frontend/form-wizard-builder/ SKILL.md +553 -0
  80. package/templates/frontend/frontend-refactor-planner/ SKILL.md +37 -0
  81. package/templates/frontend/i18n-frontend-implementer/ SKILL.md +44 -0
  82. package/templates/frontend/modal-drawer-system/ SKILL.md +377 -0
  83. package/templates/frontend/page-layout-builder/ SKILL.md +630 -0
  84. package/templates/frontend/state-ux-flow-builder/ SKILL.md +23 -0
  85. package/templates/frontend/table-builder/ SKILL.md +350 -0
  86. package/templates/performance/alerting-dashboard-builder/ SKILL.md +162 -0
  87. package/templates/performance/backend-latency-profiler-helper/ SKILL.md +108 -0
  88. package/templates/performance/caching-cdn-strategy-planner/ SKILL.md +150 -0
  89. package/templates/performance/capacity-planning-helper/ SKILL.md +242 -0
  90. package/templates/performance/core-web-vitals-tuner/ SKILL.md +126 -0
  91. package/templates/performance/incident-runbook-generator/ SKILL.md +162 -0
  92. package/templates/performance/load-test-scenario-builder/ SKILL.md +256 -0
  93. package/templates/performance/observability-setup/ SKILL.md +232 -0
  94. package/templates/performance/postmortem-writer/ SKILL.md +203 -0
  95. package/templates/performance/structured-logging-standardizer/ SKILL.md +122 -0
  96. package/templates/security/auth-security-reviewer/ SKILL.md +428 -0
  97. package/templates/security/dependency-vulnerability-triage/ SKILL.md +495 -0
  98. package/templates/security/input-validation-sanitization-auditor/ SKILL.md +76 -0
  99. package/templates/security/pii-redaction-logging-policy-builder/ SKILL.md +65 -0
  100. package/templates/security/rbac-policy-tester/ SKILL.md +80 -0
  101. package/templates/security/secrets-scanner/ SKILL.md +462 -0
  102. package/templates/security/secure-headers-csp-builder/ SKILL.md +404 -0
  103. package/templates/security/security-incident-playbook-generator/ SKILL.md +76 -0
  104. package/templates/security/security-pr-checklist-skill/ SKILL.md +62 -0
  105. package/templates/security/threat-model-generator/ SKILL.md +394 -0
  106. package/templates/testing/contract-testing-builder/ SKILL.md +492 -0
  107. package/templates/testing/coverage-strategist/ SKILL.md +436 -0
  108. package/templates/testing/e2e-test-builder/ SKILL.md +382 -0
  109. package/templates/testing/flaky-test-detective/ SKILL.md +416 -0
  110. package/templates/testing/integration-test-builder/ SKILL.md +525 -0
  111. package/templates/testing/mocking-assistant/ SKILL.md +383 -0
  112. package/templates/testing/snapshot-test-refactorer/ SKILL.md +375 -0
  113. package/templates/testing/test-data-factory-builder/ SKILL.md +449 -0
  114. package/templates/testing/test-reporting-triage-skill/ SKILL.md +469 -0
  115. package/templates/testing/unit-test-generator/ SKILL.md +548 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,29 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [0.1.0] - 2025-01-01
9
+
10
+ ### Added
11
+ - Initial release of SkillSet CLI
12
+ - Support for 100+ production-ready development skills
13
+ - Interactive CLI for skill selection and import
14
+ - Support for Claude Code, Cursor, GitHub Copilot, and other AI tools
15
+ - 10 specialized domains: Foundation, Frontend, Backend, AI Engineering, Architecture, CI/CD, Database, Testing, Security, Performance
16
+ - Programmatic API for integration with other tools
17
+ - Tool-specific folder configurations
18
+ - Automatic skill file copying with references and templates
19
+ - README generation for imported skills
20
+ - Non-interactive mode with command-line flags
21
+ - Short alias `ss` for quick access
22
+
23
+ ### Features
24
+ - **Claude Code Support**: `.claude/skills/` with automatic loading
25
+ - **Cursor Support**: `.cursor/rules/` with @-mention integration
26
+ - **GitHub Copilot Support**: `.github/skills/` or `.claude/skills/` for Agent Skills
27
+ - **Universal Format**: Works with any AI coding assistant
28
+
29
+ [0.1.0]: https://github.com/patricio0312rev/skillset/releases/tag/v0.1.0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Patricio Marroquin
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,176 @@
1
+ # SkillSet 📚
2
+
3
+ **Import production-ready development skills for Claude Code, Cursor, GitHub Copilot, and other AI coding assistants**
4
+
5
+ SkillSet is a CLI tool that helps you quickly import and configure development skills from a comprehensive library of 100+ production-ready skills covering every aspect of modern software engineering.
6
+
7
+ ## Features
8
+
9
+ - **100+ Production-Ready Skills** - From project setup to deployment, security to AI engineering
10
+ - **Multi-Tool Support** - Works with Claude Code, Cursor, GitHub Copilot, and more
11
+ - **10 Specialized Domains** - Foundation, Frontend, Backend, AI Engineering, Architecture, CI/CD, Database, Testing, Security, Performance
12
+ - **Interactive CLI** - Easy-to-use interface for selecting and importing skills
13
+ - **Programmatic API** - Use SkillSet in your own tools and scripts
14
+
15
+ ## Installation
16
+
17
+ ### Global Installation (Recommended)
18
+
19
+ ```bash
20
+ npm install -g @patricio0312rev/skillset
21
+ ```
22
+
23
+ ### Use with npx (No Installation)
24
+
25
+ ```bash
26
+ npx @patricio0312rev/skillset init
27
+ ```
28
+
29
+ ## Quick Start
30
+
31
+ Initialize skills in your project:
32
+
33
+ ```bash
34
+ skillset init
35
+ ```
36
+
37
+ Or use the short alias:
38
+
39
+ ```bash
40
+ ss init
41
+ ```
42
+
43
+ The interactive CLI will guide you through:
44
+
45
+ 1. **Select your AI tool** - Claude Code, Cursor, GitHub Copilot, or Other
46
+ 2. **Choose your folder** - Default locations based on your tool
47
+ 3. **Pick domains** - Select from 10 specialized domains
48
+ 4. **Select skills** - Choose specific skills from each domain
49
+
50
+ ## Usage Examples
51
+
52
+ ### Interactive Mode (Default)
53
+
54
+ ```bash
55
+ skillset init
56
+ ```
57
+
58
+ ### Non-Interactive Mode
59
+
60
+ ```bash
61
+ skillset init \
62
+ --tool claude-code \
63
+ --folder .claude/skills \
64
+ --domains backend,frontend,testing \
65
+ --skills api-endpoint-generator,unit-test-generator
66
+ ```
67
+
68
+ ### Skip All Prompts
69
+
70
+ ```bash
71
+ skillset init \
72
+ --tool cursor \
73
+ --domains backend,testing \
74
+ --skip-prompts
75
+ ```
76
+
77
+ ## Available Domains
78
+
79
+ | Domain | Skills | Description |
80
+ |--------|--------|-------------|
81
+ | 🔧 Foundation | 11 | Project setup, development environment, and documentation |
82
+ | 🎨 Frontend | 10 | React, UI components, and user experience |
83
+ | ⚙️ Backend | 10 | APIs, authentication, and server-side logic |
84
+ | 🤖 AI Engineering | 10 | LLMs, RAG, agents, and AI systems |
85
+ | 🏗️ Architecture | 10 | System design, scalability, and technical decisions |
86
+ | 🔄 CI/CD | 10 | Automation, deployments, and release management |
87
+ | 💾 Database Management | 10 | Migrations, optimization, and data engineering |
88
+ | 🧪 Testing | 10 | Quality assurance and test coverage |
89
+ | 🔒 Security | 10 | Security hardening and privacy protection |
90
+ | 📊 Performance | 10 | Observability, monitoring, and optimization |
91
+
92
+ ## Tool-Specific Configurations
93
+
94
+ ### Claude Code
95
+ - **Folder**: `.claude/skills/`
96
+ - **Format**: `SKILL.md` with YAML frontmatter
97
+ - **Usage**: Skills are automatically loaded
98
+
99
+ ### Cursor
100
+ - **Folder**: `.cursor/rules/`
101
+ - **Format**: `RULE.md`
102
+ - **Usage**: Use @-mentions to reference skills
103
+
104
+ ### GitHub Copilot (Agent Skills)
105
+ - **Folder**: `.github/skills/` (also supports `.claude/skills/`)
106
+ - **Format**: `SKILL.md` with YAML frontmatter
107
+ - **Usage**: Automatically recognized by Copilot
108
+
109
+ ### Other Tools
110
+ - **Folder**: `.claude/skills/`
111
+ - **Format**: Universal `SKILL.md` format
112
+ - **Usage**: Upload or reference in your AI tool
113
+
114
+ ## Programmatic API
115
+
116
+ Use SkillSet in your own tools:
117
+
118
+ ```javascript
119
+ const skillset = require('@patricio0312rev/skillset');
120
+
121
+ // Generate skills configuration
122
+ const result = await skillset.generate({
123
+ tool: 'claude-code',
124
+ folder: '.claude/skills',
125
+ domains: ['backend', 'frontend'],
126
+ skills: ['api-endpoint-generator', 'unit-test-generator']
127
+ });
128
+
129
+ console.log(`Generated ${result.skillsGenerated} skills`);
130
+
131
+ // Get available domains
132
+ const domains = skillset.getDomains();
133
+ console.log(Object.keys(domains));
134
+
135
+ // Get skills for a specific domain
136
+ const backendSkills = skillset.getSkillsForDomain('backend');
137
+ console.log(backendSkills);
138
+ ```
139
+
140
+ ## CLI Options
141
+
142
+ ```bash
143
+ skillset init [options]
144
+
145
+ Options:
146
+ -t, --tool <tool> AI tool (claude-code, cursor, copilot, other)
147
+ -f, --folder <name> Custom folder name
148
+ -d, --domains <list> Comma-separated list of domains
149
+ --skills <list> Comma-separated list of specific skills
150
+ --skip-prompts Skip all interactive prompts (requires all flags)
151
+ -h, --help Display help for command
152
+ -V, --version Output the version number
153
+ ```
154
+
155
+ ## Contributing
156
+
157
+ Contributions are welcome! Please check out the [contribution guidelines](https://github.com/patricio0312rev/skillset/blob/main/CONTRIBUTING.md).
158
+
159
+ ## Related Projects
160
+
161
+ - [Skills Collection](https://github.com/patricio0312rev/skills) - The complete library of 100+ skills
162
+ - [AgentKit](https://github.com/patricio0312rev/agentkit) - Scaffold AI agent configurations
163
+
164
+ ## License
165
+
166
+ MIT License - See [LICENSE](LICENSE) for details
167
+
168
+ ## Author
169
+
170
+ **Patricio Marroquin**
171
+ - Website: [patriciomarroquin.dev](https://www.patriciomarroquin.dev)
172
+ - GitHub: [@patricio0312rev](https://github.com/patricio0312rev)
173
+
174
+ ---
175
+
176
+ Made with 💜 by [Patricio Marroquin](https://www.patriciomarroquin.dev)
package/bin/cli.js ADDED
@@ -0,0 +1,37 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { program } = require("commander");
4
+ const chalk = require("chalk");
5
+ const packageJson = require("../package.json");
6
+ const { displayBanner } = require("../src/utils/display");
7
+ const initCommand = require("../src/commands/init");
8
+
9
+ // Display banner
10
+ displayBanner();
11
+
12
+ program
13
+ .name("skillset")
14
+ .description(
15
+ "Import production-ready development skills for Claude Code, Cursor, Copilot, and more"
16
+ )
17
+ .version(packageJson.version);
18
+
19
+ program
20
+ .command("init")
21
+ .description("Initialize development skills in current directory")
22
+ .option(
23
+ "-t, --tool <tool>",
24
+ "AI tool (claude-code, cursor, copilot, other)"
25
+ )
26
+ .option("-f, --folder <name>", "Custom folder name")
27
+ .option("-d, --domains <list>", "Comma-separated list of domains")
28
+ .option("--skills <list>", "Comma-separated list of specific skills")
29
+ .option("--skip-prompts", "Skip all interactive prompts (requires all flags)")
30
+ .action(initCommand);
31
+
32
+ program.parse(process.argv);
33
+
34
+ // Show help if no command provided
35
+ if (!process.argv.slice(2).length) {
36
+ program.outputHelp();
37
+ }
package/package.json ADDED
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "@patricio0312rev/skillset",
3
+ "displayName": "Skillset",
4
+ "version": "0.1.0",
5
+ "description": "CLI tool to import production-ready development skills for Claude Code, Cursor, GitHub Copilot, and other AI coding assistants",
6
+ "main": "src/index.js",
7
+ "bin": {
8
+ "skillset": "./bin/cli.js",
9
+ "ss": "./bin/cli.js"
10
+ },
11
+ "scripts": {
12
+ "start": "node bin/cli.js",
13
+ "test": "echo \"Error: no test specified\" && exit 1",
14
+ "prepublishOnly": "echo 'Ready to publish skillset!'"
15
+ },
16
+ "keywords": [
17
+ "ai",
18
+ "skills",
19
+ "claude",
20
+ "cursor",
21
+ "copilot",
22
+ "claude-code",
23
+ "ai-skills",
24
+ "cli",
25
+ "scaffolding",
26
+ "development-skills",
27
+ "ai-tools",
28
+ "skillset",
29
+ "agent-skills"
30
+ ],
31
+ "author": "Patricio Marroquin <patricio0312rev@github>",
32
+ "license": "MIT",
33
+ "repository": {
34
+ "type": "git",
35
+ "url": "https://github.com/patricio0312rev/skillset.git"
36
+ },
37
+ "bugs": {
38
+ "url": "https://github.com/patricio0312rev/skillset/issues"
39
+ },
40
+ "homepage": "https://github.com/patricio0312rev/skillset#readme",
41
+ "devDependencies": {
42
+ "eslint": "^8.56.0",
43
+ "prettier": "^3.1.1"
44
+ },
45
+ "engines": {
46
+ "node": ">=14.0.0"
47
+ },
48
+ "dependencies": {
49
+ "chalk": "^4.1.2",
50
+ "commander": "^11.1.0",
51
+ "fs-extra": "^11.2.0",
52
+ "inquirer": "^8.2.6",
53
+ "ora": "^5.4.1"
54
+ }
55
+ }
@@ -0,0 +1,301 @@
1
+ const inquirer = require("inquirer");
2
+ const chalk = require("chalk");
3
+ const ora = require("ora");
4
+ const { generateSkills } = require("../lib/generator");
5
+ const { TOOLS, DOMAINS } = require("../lib/config");
6
+ const { displayError, displayBox } = require("../utils/display");
7
+
8
+ async function initCommand(options) {
9
+ console.log(chalk.cyan("\n📚 Let's import your development skills!\n"));
10
+
11
+ try {
12
+ let config = {};
13
+
14
+ // Check if all required options provided (non-interactive mode)
15
+ if (options.skipPrompts) {
16
+ if (!options.tool || !options.domains) {
17
+ displayError("--skip-prompts requires --tool and --domains flags");
18
+ process.exit(1);
19
+ }
20
+ config = buildConfigFromFlags(options);
21
+ } else {
22
+ // Interactive mode
23
+ config = await promptUser(options);
24
+ }
25
+
26
+ // Validate configuration
27
+ const validation = validateConfiguration(config);
28
+ if (!validation.isValid) {
29
+ displayError("Configuration validation failed:");
30
+ validation.errors.forEach((err) => console.log(chalk.red(` • ${err}`)));
31
+ process.exit(1);
32
+ }
33
+
34
+ // Generate the configuration
35
+ await generateConfiguration(config);
36
+ } catch (error) {
37
+ displayError(`Failed to initialize: ${error.message}`);
38
+ if (process.env.DEBUG) {
39
+ console.error(error);
40
+ }
41
+ process.exit(1);
42
+ }
43
+ }
44
+
45
+ function buildConfigFromFlags(options) {
46
+ return {
47
+ tool: options.tool,
48
+ folder: options.folder || TOOLS[options.tool]?.folder || ".claude/skills",
49
+ domains: options.domains.split(",").map((d) => d.trim()),
50
+ skills: options.skills
51
+ ? options.skills.split(",").map((s) => s.trim())
52
+ : [],
53
+ };
54
+ }
55
+
56
+ async function promptUser(options) {
57
+ const answers = {};
58
+
59
+ // Step 1: Select AI tool
60
+ if (!options.tool) {
61
+ const toolChoices = Object.entries(TOOLS).map(([key, value]) => ({
62
+ name: `${chalk.bold(value.name)} ${chalk.dim("→")} ${chalk.gray(value.description)}`,
63
+ value: key,
64
+ short: value.name,
65
+ }));
66
+
67
+ const toolAnswer = await inquirer.prompt([
68
+ {
69
+ type: "list",
70
+ name: "tool",
71
+ message: "Which AI tool are you using?",
72
+ choices: toolChoices,
73
+ default: "claude-code",
74
+ },
75
+ ]);
76
+ answers.tool = toolAnswer.tool;
77
+ } else {
78
+ answers.tool = options.tool;
79
+ }
80
+
81
+ // Step 2: Custom folder name
82
+ const defaultFolder = TOOLS[answers.tool].folder;
83
+ if (!options.folder) {
84
+ const folderAnswer = await inquirer.prompt([
85
+ {
86
+ type: "input",
87
+ name: "folder",
88
+ message: "Folder name for skills:",
89
+ default: defaultFolder,
90
+ validate: (input) => {
91
+ if (!input.trim()) return "Folder name cannot be empty";
92
+ if (input.includes(" ")) return "Folder name cannot contain spaces";
93
+ if (input.includes("\\"))
94
+ return "Folder name cannot contain backslashes";
95
+ return true;
96
+ },
97
+ },
98
+ ]);
99
+ answers.folder = folderAnswer.folder;
100
+ } else {
101
+ answers.folder = options.folder;
102
+ }
103
+
104
+ // Step 3: Select domains
105
+ if (!options.domains) {
106
+ const domainChoices = Object.entries(DOMAINS).map(([key, value]) => ({
107
+ name: `${chalk.bold(value.name)} ${chalk.dim(`(${value.skills.length} skills)`)} ${chalk.gray("→ " + value.description)}`,
108
+ value: key,
109
+ short: value.name,
110
+ checked: ["foundation"].includes(key), // Default selections
111
+ }));
112
+
113
+ const domainAnswer = await inquirer.prompt([
114
+ {
115
+ type: "checkbox",
116
+ name: "domains",
117
+ message: "Select domains to include:",
118
+ choices: domainChoices,
119
+ pageSize: 12,
120
+ validate: (input) => {
121
+ if (input.length === 0)
122
+ return "Please select at least one domain";
123
+ return true;
124
+ },
125
+ },
126
+ ]);
127
+ answers.domains = domainAnswer.domains;
128
+ } else {
129
+ answers.domains = options.domains.split(",").map((d) => d.trim());
130
+ }
131
+
132
+ // Step 4: Select specific skills per domain
133
+ answers.skills = [];
134
+
135
+ if (!options.skills) {
136
+ console.log(chalk.cyan("\n📋 Select skills for each domain:\n"));
137
+
138
+ for (const domain of answers.domains) {
139
+ const domainInfo = DOMAINS[domain];
140
+
141
+ const skillChoices = domainInfo.skills.map((skill) => ({
142
+ name: skill,
143
+ value: `${domain}/${skill}`,
144
+ checked: true, // All selected by default
145
+ }));
146
+
147
+ const skillAnswer = await inquirer.prompt([
148
+ {
149
+ type: "checkbox",
150
+ name: "selectedSkills",
151
+ message: `${chalk.bold(domainInfo.name)} skills:`,
152
+ choices: skillChoices,
153
+ pageSize: 15,
154
+ validate: (input) => {
155
+ if (input.length === 0) {
156
+ return `Please select at least one skill from ${domainInfo.name} (or deselect the domain)`;
157
+ }
158
+ return true;
159
+ },
160
+ },
161
+ ]);
162
+
163
+ answers.skills.push(...skillAnswer.selectedSkills);
164
+ }
165
+ } else {
166
+ answers.skills = options.skills.split(",").map((s) => s.trim());
167
+ }
168
+
169
+ // Count total skills selected
170
+ const totalSkills = answers.skills.length;
171
+ console.log(
172
+ chalk.dim(`\n → Total skills selected: ${chalk.bold(totalSkills)}\n`)
173
+ );
174
+
175
+ return answers;
176
+ }
177
+
178
+ function validateConfiguration(config) {
179
+ const errors = [];
180
+
181
+ // Validate tool
182
+ if (!config.tool || !TOOLS[config.tool]) {
183
+ errors.push(
184
+ `Invalid tool: ${config.tool}. Valid options: ${Object.keys(TOOLS).join(", ")}`
185
+ );
186
+ }
187
+
188
+ // Validate folder
189
+ if (!config.folder || typeof config.folder !== "string") {
190
+ errors.push("Folder name is required and must be a string");
191
+ }
192
+
193
+ // Validate domains
194
+ if (
195
+ !config.domains ||
196
+ !Array.isArray(config.domains) ||
197
+ config.domains.length === 0
198
+ ) {
199
+ errors.push("At least one domain is required");
200
+ }
201
+
202
+ config.domains?.forEach((domain) => {
203
+ if (!DOMAINS[domain]) {
204
+ errors.push(
205
+ `Invalid domain: ${domain}. Valid options: ${Object.keys(DOMAINS).join(", ")}`
206
+ );
207
+ }
208
+ });
209
+
210
+ return {
211
+ isValid: errors.length === 0,
212
+ errors,
213
+ };
214
+ }
215
+
216
+ async function generateConfiguration(config) {
217
+ const spinner = ora("Generating skills configuration...").start();
218
+
219
+ try {
220
+ const result = await generateSkills(config);
221
+
222
+ spinner.succeed(chalk.green("✓ Configuration generated successfully!"));
223
+
224
+ // Display results
225
+ displayResults(config, result);
226
+ } catch (error) {
227
+ spinner.fail(chalk.red("Failed to generate configuration"));
228
+ throw error;
229
+ }
230
+ }
231
+
232
+ function displayResults(config, result) {
233
+ const tool = TOOLS[config.tool];
234
+
235
+ // Format file location with proper coloring
236
+ const locationLine = `Location: ${chalk.yellow(config.folder + "/")}`;
237
+ const toolLine = `Tool: ${chalk.cyan(tool.name)}`;
238
+ const domainLine = `Domains: ${config.domains.length}`;
239
+ const skillsLine = `Skills: ${result.skillsGenerated || 0}`;
240
+
241
+ displayBox(
242
+ "📁 Generated Files",
243
+ `${locationLine}\n${toolLine}\n${domainLine}\n${skillsLine}`
244
+ );
245
+
246
+ displayBox("📚 Usage Instructions", getUsageInstructions(config.tool, config.folder));
247
+
248
+ const step1 = `1. Review files in ${chalk.yellow(config.folder + "/")}`;
249
+ const step2 = `2. Read ${chalk.yellow(config.folder + "/README.md")}`;
250
+ const step3 = `3. ${getToolSpecificNextStep(config.tool)}`;
251
+ const step4 = `4. Commit to version control to share with team`;
252
+
253
+ displayBox("🚀 Next Steps", `${step1}\n${step2}\n${step3}\n${step4}`);
254
+
255
+ console.log(
256
+ chalk.dim("💡 Tip: Run ") +
257
+ chalk.cyan("skillset init") +
258
+ chalk.dim(" again to regenerate\n")
259
+ );
260
+ }
261
+
262
+ function getUsageInstructions(tool, folder) {
263
+ const instructions = {
264
+ "claude-code":
265
+ `With Claude Code:\n` +
266
+ `Skills are automatically loaded from \`${folder}/\`\n` +
267
+ `Reference them naturally in your prompts:\n` +
268
+ chalk.gray(" \"Use the api-endpoint-generator skill...\""),
269
+
270
+ cursor:
271
+ `With Cursor:\n` +
272
+ `1. Use @-mentions in chat:\n` +
273
+ chalk.gray(` @${folder}/api-endpoint-generator/RULE.md\n`) +
274
+ `2. Or reference in prompts naturally`,
275
+
276
+ copilot:
277
+ `With GitHub Copilot:\n` +
278
+ `Skills in \`${folder}/\` are automatically recognized\n` +
279
+ `Copilot will use them for code suggestions`,
280
+
281
+ other:
282
+ `With any AI tool:\n` +
283
+ `Upload relevant skill files to your AI chat\n` +
284
+ `and reference them in your prompts.`,
285
+ };
286
+
287
+ return instructions[tool] || instructions.other;
288
+ }
289
+
290
+ function getToolSpecificNextStep(tool) {
291
+ const steps = {
292
+ "claude-code": "Start coding - Skills are automatically available",
293
+ cursor: "Open Cursor and use @-mentions to reference skills",
294
+ copilot: "Start coding - Copilot will use the skills automatically",
295
+ other: "Open your AI tool and upload the skill files",
296
+ };
297
+
298
+ return steps[tool] || steps.other;
299
+ }
300
+
301
+ module.exports = initCommand;