@dzhechkov/skills-idea2prd 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 (34) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +71 -0
  3. package/bin/cli.js +5 -0
  4. package/package.json +49 -0
  5. package/sources.json +25 -0
  6. package/src/cli.js +108 -0
  7. package/src/commands/doctor.js +340 -0
  8. package/src/commands/init.js +168 -0
  9. package/src/commands/list.js +146 -0
  10. package/src/commands/remove.js +182 -0
  11. package/src/commands/update.js +170 -0
  12. package/src/utils.js +154 -0
  13. package/templates/.claude/commands/idea2prd-manual.md +35 -0
  14. package/templates/.claude/skills/explore/SKILL.md +218 -0
  15. package/templates/.claude/skills/explore/references/questioning-techniques.md +151 -0
  16. package/templates/.claude/skills/explore/references/task-brief-templates.md +355 -0
  17. package/templates/.claude/skills/goap-research-ed25519/SKILL.md +418 -0
  18. package/templates/.claude/skills/goap-research-ed25519/references/ed25519-verification.md +658 -0
  19. package/templates/.claude/skills/goap-research-ed25519/references/research-actions.md +544 -0
  20. package/templates/.claude/skills/goap-research-ed25519/references/source-evaluation.md +560 -0
  21. package/templates/.claude/skills/goap-research-ed25519/scripts/ed25519_verifier.py +662 -0
  22. package/templates/.claude/skills/goap-research-ed25519/scripts/goap_planner.py +720 -0
  23. package/templates/.claude/skills/idea2prd-manual/SKILL.md +695 -0
  24. package/templates/.claude/skills/idea2prd-manual/references/adr-catalog.md +288 -0
  25. package/templates/.claude/skills/idea2prd-manual/references/c4-model.md +277 -0
  26. package/templates/.claude/skills/idea2prd-manual/references/completion-checklist-template.md +446 -0
  27. package/templates/.claude/skills/idea2prd-manual/references/ddd-patterns.md +261 -0
  28. package/templates/.claude/skills/idea2prd-manual/references/fitness-functions-catalog.md +414 -0
  29. package/templates/.claude/skills/idea2prd-manual/references/pseudocode-style.md +404 -0
  30. package/templates/.claude/skills/idea2prd-manual/scripts/ai_context_builder.py +491 -0
  31. package/templates/.claude/skills/idea2prd-manual/scripts/c4_generator.py +311 -0
  32. package/templates/.claude/skills/idea2prd-manual/scripts/fitness_validator.py +451 -0
  33. package/templates/.claude/skills/idea2prd-manual/scripts/pseudocode_generator.py +430 -0
  34. package/templates/.claude/skills/problem-solver-enhanced/SKILL.md +565 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 dzhechko
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,71 @@
1
+ # @dzhechkov/skills-idea2prd
2
+
3
+ Idea2PRD Manual — composite skill for [Claude Code](https://claude.com/claude-code) that takes a **problem or an idea** all the way to **Vibe-Coding-ready documentation**, with a user checkpoint between every phase.
4
+
5
+ ## What It Does
6
+
7
+ Auto-detects the input (problem vs idea) and runs up to two pipelines with **9 checkpoints**:
8
+
9
+ 1. **Analyst pipeline** (only if the input is a *problem*) — `explore` → `goap-research-ed25519` → `problem-solver-enhanced` (all 9 modules), producing a validated Product Idea.
10
+ 2. **PRD pipeline** (always) — Requirements → ADR → DDD → C4 → **Pseudocode** → Test Scenarios (Gherkin) → **Completion Checklist**.
11
+
12
+ Output: a complete doc set ready to hand to a coding agent — PRD, ADRs, DDD model, C4 diagrams, pseudocode, test scenarios, and a CI/CD/deploy completion checklist.
13
+
14
+ ## Why
15
+
16
+ Going from a raw idea straight to code skips the design that makes the code correct. Idea2PRD front-loads that design as *reviewable artifacts* and forces a human gate at each phase (MANUAL mode), so you catch a wrong assumption at the PRD stage instead of after implementation.
17
+
18
+ ## How to Use
19
+
20
+ ```bash
21
+ npx @dzhechkov/skills-idea2prd init
22
+ ```
23
+
24
+ Then in Claude Code the skill auto-activates on phrases like:
25
+
26
+ ```
27
+ /idea2prd-manual оформи PRD для сервиса подбора подрядчиков
28
+ "сделай PRD пошагово для ..."
29
+ "idea to prd manual: ..."
30
+ ```
31
+
32
+ It will pause at each checkpoint and wait for your confirmation before the next phase.
33
+
34
+ ## Self-Contained Package
35
+
36
+ Bundles everything needed — no other `@dzhechkov` package required:
37
+
38
+ | Component | Description |
39
+ |-----------|-------------|
40
+ | `idea2prd-manual` | Orchestrator skill (problem/idea → PRD docs, 9 checkpoints) |
41
+ | `explore` | Task clarification and brief generation *(tracked vendor)* |
42
+ | `goap-research-ed25519` | GOAP research with Ed25519 verification *(tracked vendor)* |
43
+ | `problem-solver-enhanced` | 9-module solver (TRIZ + Game Theory) *(tracked vendor)* |
44
+ | `/idea2prd-manual` | Slash command |
45
+
46
+ Bundled scripts (local, no network): `c4_generator.py`, `fitness_validator.py`, `pseudocode_generator.py`, `ai_context_builder.py`.
47
+
48
+ > **Canonicalization (ADR-0001):** `idea2prd-manual` is the canonical artifact of this pack. The `explore`/`goap`/`problem-solver` trio is a **tracked vendored copy** whose canonical home is [`@dzhechkov/skills-analyst-manual`](https://www.npmjs.com/package/@dzhechkov/skills-analyst-manual); see `sources.json`. Re-sync drift with `dz sync-upstream`.
49
+
50
+ ## CLI Commands
51
+
52
+ | Command | Description |
53
+ |---------|-------------|
54
+ | `init` | Install the skill pack into the current project *(default)* |
55
+ | `update` | Update to the latest version |
56
+ | `remove` | Remove the skill pack |
57
+ | `list` | List installed components |
58
+ | `doctor` | Check installation health |
59
+
60
+ Options: `--force`, `--dry-run`, `--help`, `--version`.
61
+
62
+ ## Also Available Via dz
63
+
64
+ ```bash
65
+ dz init --select idea2prd-manual # via the unified harness CLI
66
+ dz info idea2prd-manual
67
+ ```
68
+
69
+ ## License
70
+
71
+ MIT
package/bin/cli.js ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env node
2
+
3
+ 'use strict';
4
+
5
+ require('../src/cli.js');
package/package.json ADDED
@@ -0,0 +1,49 @@
1
+ {
2
+ "name": "@dzhechkov/skills-idea2prd",
3
+ "version": "0.1.0",
4
+ "description": "Idea2PRD Manual — composite skill for Claude Code: from problem/idea to Vibe-Coding-ready docs (PRD + ADR + DDD + C4 + Pseudocode + Test Scenarios + Completion) with 9 checkpoints",
5
+ "main": "src/cli.js",
6
+ "bin": {
7
+ "skills-idea2prd": "./bin/cli.js"
8
+ },
9
+ "files": [
10
+ "bin/",
11
+ "src/",
12
+ "templates/",
13
+ "sources.json",
14
+ "LICENSE"
15
+ ],
16
+ "keywords": [
17
+ "claude",
18
+ "claude-code",
19
+ "ai",
20
+ "prd",
21
+ "product-requirements",
22
+ "idea-to-prd",
23
+ "ddd",
24
+ "c4-model",
25
+ "adr",
26
+ "pseudocode",
27
+ "vibe-coding",
28
+ "checkpoints",
29
+ "skills",
30
+ "skill-pack"
31
+ ],
32
+ "author": "dzhechko",
33
+ "license": "MIT",
34
+ "engines": {
35
+ "node": ">=16.0.0"
36
+ },
37
+ "repository": {
38
+ "type": "git",
39
+ "url": "https://github.com/djd1m/dz-harness-hub.git",
40
+ "directory": "packages/@dzhechkov/skills-idea2prd"
41
+ },
42
+ "homepage": "https://github.com/djd1m/dz-harness-hub/tree/main/packages/@dzhechkov/skills-idea2prd#readme",
43
+ "bugs": {
44
+ "url": "https://github.com/djd1m/dz-harness-hub/issues"
45
+ },
46
+ "publishConfig": {
47
+ "access": "public"
48
+ }
49
+ }
package/sources.json ADDED
@@ -0,0 +1,25 @@
1
+ {
2
+ "_note": "Per ADR-0001: idea2prd-manual is the canonical artifact of THIS pack; the explore/goap/problem-solver trio is a TRACKED vendored copy whose canonical home is @dzhechkov/skills-analyst-manual. Re-sync with `dz sync-upstream`.",
3
+ "skills": {
4
+ "idea2prd-manual": {
5
+ "origin": "dz-original",
6
+ "canonical_pack": "@dzhechkov/skills-idea2prd",
7
+ "inspired_by": "Cloud.ru GenAI GTM idea2prd-manual (clean-room canonicalization)"
8
+ },
9
+ "explore": {
10
+ "origin": "vendored",
11
+ "canonical_pack": "@dzhechkov/skills-analyst-manual",
12
+ "upstream_path": "templates/.claude/skills/explore"
13
+ },
14
+ "goap-research-ed25519": {
15
+ "origin": "vendored",
16
+ "canonical_pack": "@dzhechkov/skills-analyst-manual",
17
+ "upstream_path": "templates/.claude/skills/goap-research-ed25519"
18
+ },
19
+ "problem-solver-enhanced": {
20
+ "origin": "vendored",
21
+ "canonical_pack": "@dzhechkov/skills-analyst-manual",
22
+ "upstream_path": "templates/.claude/skills/problem-solver-enhanced"
23
+ }
24
+ }
25
+ }
package/src/cli.js ADDED
@@ -0,0 +1,108 @@
1
+ 'use strict';
2
+
3
+ const path = require('path');
4
+ const { bold, cyan, dim, green, yellow, red, info, error } = require('./utils');
5
+
6
+ function showBanner() {
7
+ console.log('');
8
+ console.log(cyan('╔══════════════════════════════════════════════════════════╗'));
9
+ console.log(cyan('║') + bold(' IDEA2PRD MANUAL — Idea → PRD docs with Checkpoints ') + cyan('║'));
10
+ console.log(cyan('║') + ' analyst → PRD → DDD → C4 → pseudocode (9 checkpoints) ' + cyan('║'));
11
+ console.log(cyan('╚══════════════════════════════════════════════════════════╝'));
12
+ console.log('');
13
+ }
14
+
15
+ function getVersion() {
16
+ const pkg = require('../package.json');
17
+ return pkg.version;
18
+ }
19
+
20
+ function showHelp() {
21
+ console.log(bold('Usage:') + ' npx @dzhechkov/skills-idea2prd ' + cyan('<command>') + dim(' [options]'));
22
+ console.log('');
23
+ console.log(bold('Commands:'));
24
+ console.log(' ' + green('init') + ' Install Idea2PRD Manual skill pack into current project ' + dim('(default)'));
25
+ console.log(' ' + green('update') + ' Update Idea2PRD Manual skill pack to latest version');
26
+ console.log(' ' + green('remove') + ' Remove Idea2PRD Manual skill pack from project');
27
+ console.log(' ' + green('list') + ' List installed Idea2PRD Manual components');
28
+ console.log(' ' + green('doctor') + ' Check Idea2PRD Manual installation health');
29
+ console.log('');
30
+ console.log(bold('Options:'));
31
+ console.log(' ' + yellow('--force') + ' Overwrite existing files without prompting');
32
+ console.log(' ' + yellow('--dry-run') + ' Show what would be done without making changes');
33
+ console.log(' ' + yellow('--help, -h') + ' Show this help message');
34
+ console.log(' ' + yellow('--version, -v') + ' Show version number');
35
+ console.log('');
36
+ console.log(bold('Examples:'));
37
+ console.log(dim(' $ ') + 'npx @dzhechkov/skills-idea2prd init');
38
+ console.log(dim(' $ ') + 'npx @dzhechkov/skills-idea2prd init --force');
39
+ console.log(dim(' $ ') + 'npx @dzhechkov/skills-idea2prd doctor');
40
+ console.log('');
41
+ console.log(bold('What gets installed:'));
42
+ console.log(' Composite skill: idea2prd-manual (orchestrator)');
43
+ console.log(' Dependent skills: explore, goap-research-ed25519, problem-solver-enhanced');
44
+ console.log(' Command: /idea2prd-manual');
45
+ console.log('');
46
+ console.log(bold('Self-contained:'));
47
+ console.log(' This package bundles its dependent skills (tracked via sources.json).');
48
+ console.log(' No need to install @dzhechkov/keysarium or skills-analyst-manual.');
49
+ console.log('');
50
+ }
51
+
52
+ function parseArgs(argv) {
53
+ const args = argv.slice(2);
54
+ const flags = { force: false, dryRun: false, targetDir: process.cwd() };
55
+ let command = null;
56
+
57
+ for (const arg of args) {
58
+ switch (arg) {
59
+ case '--force': flags.force = true; break;
60
+ case '--dry-run': flags.dryRun = true; break;
61
+ case '--help':
62
+ case '-h': command = 'help'; break;
63
+ case '--version':
64
+ case '-v': command = 'version'; break;
65
+ default:
66
+ if (arg.startsWith('-')) {
67
+ error(`Unknown option: ${arg}`);
68
+ process.exit(1);
69
+ } else if (command === null) {
70
+ command = arg;
71
+ } else {
72
+ error(`Unexpected argument: ${arg}`);
73
+ process.exit(1);
74
+ }
75
+ break;
76
+ }
77
+ }
78
+
79
+ return { command, flags };
80
+ }
81
+
82
+ function main() {
83
+ const { command, flags } = parseArgs(process.argv);
84
+
85
+ if (command === 'version') { console.log(getVersion()); return; }
86
+
87
+ showBanner();
88
+
89
+ if (command === 'help') { showHelp(); return; }
90
+
91
+ const resolvedCommand = command || 'init';
92
+
93
+ switch (resolvedCommand) {
94
+ case 'init': require('./commands/init')(flags); break;
95
+ case 'update': require('./commands/update')(flags); break;
96
+ case 'remove': require('./commands/remove')(flags); break;
97
+ case 'list': require('./commands/list')(flags); break;
98
+ case 'doctor': require('./commands/doctor')(flags); break;
99
+ default:
100
+ error(`Unknown command: "${resolvedCommand}"`);
101
+ console.log('');
102
+ showHelp();
103
+ process.exitCode = 1;
104
+ break;
105
+ }
106
+ }
107
+
108
+ main();
@@ -0,0 +1,340 @@
1
+ 'use strict';
2
+
3
+ const fs = require('fs');
4
+ const path = require('path');
5
+ const {
6
+ green, red, yellow, cyan, bold, dim,
7
+ info, success, warn, error: logError,
8
+ fileExists, readJSON, readManifest,
9
+ MANIFEST_FILE, COMPONENTS,
10
+ } = require('../utils');
11
+
12
+ // ---------------------------------------------------------------------------
13
+ // Check definitions
14
+ // ---------------------------------------------------------------------------
15
+
16
+ function check(name, fn) {
17
+ try {
18
+ const result = fn();
19
+ return {
20
+ name,
21
+ passed: result.passed,
22
+ detail: result.detail || '',
23
+ fix: result.fix || '',
24
+ };
25
+ } catch (err) {
26
+ return {
27
+ name,
28
+ passed: false,
29
+ detail: `Exception: ${err.message}`,
30
+ fix: 'Investigate the error above.',
31
+ };
32
+ }
33
+ }
34
+
35
+ function checkFilesExist(manifest, targetDir) {
36
+ return check('Files exist', () => {
37
+ const files = manifest.files || [];
38
+ const missing = [];
39
+
40
+ for (const relPath of files) {
41
+ const absPath = path.join(targetDir, relPath);
42
+ if (!fileExists(absPath)) {
43
+ missing.push(relPath);
44
+ }
45
+ }
46
+
47
+ if (missing.length === 0) {
48
+ return {
49
+ passed: true,
50
+ detail: `All ${files.length} manifest files present`,
51
+ };
52
+ }
53
+
54
+ return {
55
+ passed: false,
56
+ detail: `${missing.length} file(s) missing: ${missing.slice(0, 5).join(', ')}${missing.length > 5 ? '...' : ''}`,
57
+ fix: `Run ${cyan('@dzhechkov/skills-idea2prd update')} to restore missing files.`,
58
+ };
59
+ });
60
+ }
61
+
62
+ function checkSkillAnalyst(targetDir) {
63
+ return check('Idea2PRD Manual Full skill', () => {
64
+ const skillDir = path.join(targetDir, '.claude', 'skills', 'idea2prd-manual');
65
+
66
+ if (!fileExists(skillDir)) {
67
+ return {
68
+ passed: false,
69
+ detail: '.claude/skills/idea2prd-manual/ directory not found',
70
+ fix: `Run ${cyan('@dzhechkov/skills-idea2prd update')} to restore skill.`,
71
+ };
72
+ }
73
+
74
+ const skillMdPath = path.join(skillDir, 'SKILL.md');
75
+ if (!fileExists(skillMdPath)) {
76
+ return {
77
+ passed: false,
78
+ detail: '.claude/skills/idea2prd-manual/SKILL.md not found',
79
+ fix: `Run ${cyan('@dzhechkov/skills-idea2prd update')} to restore SKILL.md.`,
80
+ };
81
+ }
82
+
83
+ // Check for references directory
84
+ const refsDir = path.join(skillDir, 'references');
85
+ let refCount = 0;
86
+ if (fileExists(refsDir)) {
87
+ try {
88
+ const entries = fs.readdirSync(refsDir);
89
+ refCount = entries.filter((e) => e.endsWith('.md')).length;
90
+ } catch {
91
+ // ignore
92
+ }
93
+ }
94
+
95
+ return {
96
+ passed: true,
97
+ detail: `SKILL.md present, ${refCount} references`,
98
+ };
99
+ });
100
+ }
101
+
102
+ function checkSkillExplore(targetDir) {
103
+ return check('Explore skill', () => {
104
+ const skillDir = path.join(targetDir, '.claude', 'skills', 'explore');
105
+
106
+ if (!fileExists(skillDir)) {
107
+ return {
108
+ passed: false,
109
+ detail: '.claude/skills/explore/ directory not found',
110
+ fix: `Run ${cyan('@dzhechkov/skills-idea2prd update')} to restore skill.`,
111
+ };
112
+ }
113
+
114
+ const skillMdPath = path.join(skillDir, 'SKILL.md');
115
+ if (!fileExists(skillMdPath)) {
116
+ return {
117
+ passed: false,
118
+ detail: '.claude/skills/explore/SKILL.md not found',
119
+ fix: `Run ${cyan('@dzhechkov/skills-idea2prd update')} to restore SKILL.md.`,
120
+ };
121
+ }
122
+
123
+ return {
124
+ passed: true,
125
+ detail: 'SKILL.md present',
126
+ };
127
+ });
128
+ }
129
+
130
+ function checkSkillGoap(targetDir) {
131
+ return check('GOAP Research skill', () => {
132
+ const skillDir = path.join(targetDir, '.claude', 'skills', 'goap-research-ed25519');
133
+
134
+ if (!fileExists(skillDir)) {
135
+ return {
136
+ passed: false,
137
+ detail: '.claude/skills/goap-research-ed25519/ directory not found',
138
+ fix: `Run ${cyan('@dzhechkov/skills-idea2prd update')} to restore skill.`,
139
+ };
140
+ }
141
+
142
+ const skillMdPath = path.join(skillDir, 'SKILL.md');
143
+ if (!fileExists(skillMdPath)) {
144
+ return {
145
+ passed: false,
146
+ detail: '.claude/skills/goap-research-ed25519/SKILL.md not found',
147
+ fix: `Run ${cyan('@dzhechkov/skills-idea2prd update')} to restore SKILL.md.`,
148
+ };
149
+ }
150
+
151
+ return {
152
+ passed: true,
153
+ detail: 'SKILL.md present',
154
+ };
155
+ });
156
+ }
157
+
158
+ function checkSkillSolver(targetDir) {
159
+ return check('Problem Solver Enhanced skill', () => {
160
+ const skillDir = path.join(targetDir, '.claude', 'skills', 'problem-solver-enhanced');
161
+
162
+ if (!fileExists(skillDir)) {
163
+ return {
164
+ passed: false,
165
+ detail: '.claude/skills/problem-solver-enhanced/ directory not found',
166
+ fix: `Run ${cyan('@dzhechkov/skills-idea2prd update')} to restore skill.`,
167
+ };
168
+ }
169
+
170
+ const skillMdPath = path.join(skillDir, 'SKILL.md');
171
+ if (!fileExists(skillMdPath)) {
172
+ return {
173
+ passed: false,
174
+ detail: '.claude/skills/problem-solver-enhanced/SKILL.md not found',
175
+ fix: `Run ${cyan('@dzhechkov/skills-idea2prd update')} to restore SKILL.md.`,
176
+ };
177
+ }
178
+
179
+ return {
180
+ passed: true,
181
+ detail: 'SKILL.md present',
182
+ };
183
+ });
184
+ }
185
+
186
+ function checkCommandPresent(targetDir) {
187
+ return check('Idea2PRD Manual command', () => {
188
+ const commandsDir = path.join(targetDir, '.claude', 'commands');
189
+
190
+ if (!fileExists(commandsDir)) {
191
+ return {
192
+ passed: false,
193
+ detail: '.claude/commands/ directory not found',
194
+ fix: `Run ${cyan('@dzhechkov/skills-idea2prd update')} to restore command.`,
195
+ };
196
+ }
197
+
198
+ let entries;
199
+ try {
200
+ entries = fs.readdirSync(commandsDir);
201
+ } catch {
202
+ return {
203
+ passed: false,
204
+ detail: 'Cannot read .claude/commands/ directory',
205
+ fix: 'Check directory permissions.',
206
+ };
207
+ }
208
+
209
+ const analystCommands = entries.filter(
210
+ (e) => e.startsWith('idea2prd-manual') && e.endsWith('.md')
211
+ );
212
+
213
+ if (analystCommands.length === 0) {
214
+ return {
215
+ passed: false,
216
+ detail: 'No Idea2PRD Manual command files found (expected idea2prd-manual*.md)',
217
+ fix: `Run ${cyan('@dzhechkov/skills-idea2prd update')} to restore command.`,
218
+ };
219
+ }
220
+
221
+ return {
222
+ passed: true,
223
+ detail: `${analystCommands.length} command(s): ${analystCommands.join(', ')}`,
224
+ };
225
+ });
226
+ }
227
+
228
+ function checkKeysariumIntegration(targetDir) {
229
+ return check('Keysarium integration', () => {
230
+ const keysariumPath = path.join(targetDir, '.keysarium.json');
231
+
232
+ if (!fileExists(keysariumPath)) {
233
+ return {
234
+ passed: true,
235
+ detail: 'Not installed (standalone Idea2PRD Manual mode)',
236
+ };
237
+ }
238
+
239
+ const keysariumManifest = readJSON(keysariumPath);
240
+ if (!keysariumManifest) {
241
+ return {
242
+ passed: true,
243
+ detail: 'Detected but manifest unreadable',
244
+ };
245
+ }
246
+
247
+ return {
248
+ passed: true,
249
+ detail: `Active (Keysarium v${keysariumManifest.version})`,
250
+ };
251
+ });
252
+ }
253
+
254
+ // ---------------------------------------------------------------------------
255
+ // Main command
256
+ // ---------------------------------------------------------------------------
257
+
258
+ async function run(options) {
259
+ const { targetDir } = options;
260
+ const manifestPath = path.join(targetDir, MANIFEST_FILE);
261
+
262
+ // ── a) Check manifest exists ──────────────────────────────────────────
263
+ if (!fileExists(manifestPath)) {
264
+ logError('Idea2PRD Manual skill pack is not installed in this directory.');
265
+ info(`Run ${cyan('@dzhechkov/skills-idea2prd init')} to install.`);
266
+ process.exit(1);
267
+ }
268
+
269
+ const manifest = readManifest(targetDir);
270
+ if (!manifest) {
271
+ logError(`Failed to read ${MANIFEST_FILE} \u2014 file may be corrupted.`);
272
+ process.exit(1);
273
+ }
274
+
275
+ console.log('');
276
+ info(bold(`Running health checks for @dzhechkov/skills-idea2prd v${manifest.version}...`));
277
+ console.log('');
278
+
279
+ // ── b) Run all checks ─────────────────────────────────────────────────
280
+ const results = [
281
+ checkFilesExist(manifest, targetDir),
282
+ checkSkillAnalyst(targetDir),
283
+ checkSkillExplore(targetDir),
284
+ checkSkillGoap(targetDir),
285
+ checkSkillSolver(targetDir),
286
+ checkCommandPresent(targetDir),
287
+ checkKeysariumIntegration(targetDir),
288
+ ];
289
+
290
+ // ── c) Display results ────────────────────────────────────────────────
291
+ let passedCount = 0;
292
+ const failures = [];
293
+
294
+ for (const result of results) {
295
+ const icon = result.passed ? green('\u2713') : red('\u2717');
296
+ const statusColor = result.passed ? green : red;
297
+ const detailStr = result.detail ? dim(` \u2014 ${result.detail}`) : '';
298
+
299
+ console.log(` ${icon} ${statusColor(result.name)}${detailStr}`);
300
+
301
+ if (result.passed) {
302
+ passedCount++;
303
+ } else {
304
+ failures.push(result);
305
+ }
306
+ }
307
+
308
+ // ── d) Summary ────────────────────────────────────────────────────────
309
+ console.log('');
310
+ const total = results.length;
311
+
312
+ if (passedCount === total) {
313
+ success(bold(`${passedCount}/${total} checks passed \u2014 Idea2PRD Manual installation is healthy!`));
314
+ console.log('');
315
+ process.exit(0);
316
+ }
317
+
318
+ warn(bold(`${passedCount}/${total} checks passed`));
319
+ console.log('');
320
+
321
+ // ── e) Show fix suggestions ───────────────────────────────────────────
322
+ console.log(bold('Fix suggestions:'));
323
+ console.log('');
324
+
325
+ for (const failure of failures) {
326
+ console.log(` ${red('\u2717')} ${bold(failure.name)}`);
327
+ if (failure.detail) {
328
+ console.log(` ${dim(failure.detail)}`);
329
+ }
330
+ if (failure.fix) {
331
+ console.log(` ${yellow('Fix:')} ${failure.fix}`);
332
+ }
333
+ console.log('');
334
+ }
335
+
336
+ process.exit(1);
337
+ }
338
+
339
+ module.exports = run;
340
+ module.exports.run = run;