@codihaus/claude-skills 1.6.25 → 1.6.26

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codihaus/claude-skills",
3
- "version": "1.6.25",
3
+ "version": "1.6.26",
4
4
  "description": "Claude Code skills for software development workflow",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: debrief
3
- description: Customer requirements → market-validated BRD with tiered features
4
- version: 5.0.0
3
+ description: Customer requirements → questionnaire (default) or BRD (with --answers flag)
4
+ version: 5.2.0
5
5
  ---
6
6
 
7
7
  # /debrief - Business Requirements Document
@@ -24,43 +24,42 @@ version: 5.0.0
24
24
  ## Usage
25
25
 
26
26
  ```bash
27
- /debrief "Customer wants..." # New project
28
- /debrief "Add {feature}" # Add feature
29
- /debrief --answers questionnaire.xlsx # Process answers
30
- /debrief --generate-brd questionnaire.xlsx # Generate BRD from existing research
31
- /debrief --questionnaire-only # Questions only
27
+ /debrief "Customer wants..." # New project → questionnaire output
28
+ /debrief "Add {feature}" # Add feature → questionnaire output
29
+ /debrief --answers questionnaire.xlsx # Process answers → CREATE BRD
30
+ /debrief --generate-brd questionnaire.xlsx # Generate BRD from research
32
31
  ```
33
32
 
33
+ **Key principle**:
34
+ - **Without flags**: ONLY outputs questionnaire (no BRD)
35
+ - **With --answers or --generate-brd**: Creates BRD files
36
+
34
37
  ---
35
38
 
36
- ## Output Structure
39
+ ## Output
37
40
 
38
- **Project-wide** `plans/brd/`:
39
- - README.md (all features index)
40
- - context.md (stakeholders, users, constraints)
41
- - references.md (industry, compliance, competitor overview)
42
- - use-cases/{feature}/ (all use cases, grouped)
43
- - changelog.md
41
+ **Default (no flags)**: `questionnaire-{date}.xlsx` only (3 sheets: Summary, Questions, References)
44
42
 
45
- **Feature-specific** `plans/features/{feature}/`:
46
- - README.md (feature overview)
47
- - references.md (market research, evidence, tier validation)
48
- - questionnaire-{date}.xlsx (feature questions)
43
+ **With --answers or --generate-brd**:
44
+ - `plans/brd/` - Project-wide BRD files
45
+ - `plans/brd/use-cases/` - Use cases by feature
46
+ - `plans/features/{feature}/` - Feature-specific files
49
47
 
50
48
  ---
51
49
 
52
50
  ## Key Principles
53
51
 
54
- ### 1. Default Output: Questionnaire Only
52
+ ### 1. Questionnaire First (Default)
55
53
 
56
- **ALWAYS output**: Summary + Questionnaire (3 sheets Excel)
57
- **NEVER auto-create**: BRD files, use cases, feature folders
54
+ **Default behavior (no flags)**:
55
+ - ALWAYS output: Summary + Questionnaire (3 sheets Excel)
56
+ - NEVER auto-create: BRD files, use cases, feature folders
58
57
 
59
- **BRD creation only via**:
60
- - `--answers questionnaire.xlsx` (after customer fills it)
61
- - `--generate-brd questionnaire.xlsx` (from existing research)
58
+ **BRD creation (explicit flags)**:
59
+ - `--answers questionnaire.xlsx` → Creates BRD after customer fills it
60
+ - `--generate-brd questionnaire.xlsx` → Creates BRD from existing research
62
61
 
63
- **Why**: User reviews research first, validates with customer, then creates BRD.
62
+ **Why**: User reviews research first, validates with customer, THEN creates BRD.
64
63
 
65
64
  ### 2. Business Focus ONLY
66
65
 
@@ -78,15 +77,17 @@ version: 5.0.0
78
77
 
79
78
  **If you mention files, code, APIs, or tech → YOU ARE DOING IT WRONG.**
80
79
 
81
- ### 3. Deep Research (Always)
80
+ ### 3. Deep Research + Revalidation (ALWAYS)
82
81
 
83
- **Always thorough**:
84
- - Comparison pages (feature matrix)
85
- - Ecosystems (Chrome, WordPress, GitHub)
86
- - User signals (Reddit, reviews, forums)
87
- - Full evidence per feature
82
+ **Always thorough** (regardless of scope tier):
83
+ 1. Comparison pages (feature matrix)
84
+ 2. **Multi-source revalidation** (MANDATORY):
85
+ - Ecosystems (Chrome, WordPress, GitHub, NPM)
86
+ - User signals (Reddit, reviews, forums)
87
+ - Competitor direct (pricing, features)
88
+ 3. Full evidence per feature (3+ source types)
88
89
 
89
- No quick mode. Always deep.
90
+ **No shortcuts**: MVP/Standard/Full all get same deep research + revalidation.
90
91
 
91
92
  ### 4. Questionnaire = Decision Tool
92
93
 
@@ -106,11 +107,12 @@ Then create BRD via `--answers` or `--generate-brd`.
106
107
  **See** `references/workflow.md` for detailed steps.
107
108
 
108
109
  **Modes**:
109
- - No `plans/brd/` New Project
110
- - `plans/brd/` exists Add Feature
111
- - `--answers {file}` Process Answers
112
- - `--generate-brd {file}` Generate BRD from research
113
- - `--questionnaire-only` → Questions Only
110
+ - New Project: Research + questionnaire (no BRD)
111
+ - Add Feature: Research + questionnaire (no BRD)
112
+ - Process Answers (`--answers`): Create BRD from filled questionnaire
113
+ - Generate BRD (`--generate-brd`): Create BRD from research
114
+
115
+ **Default**: Questionnaire only. BRD requires explicit flag.
114
116
 
115
117
  ---
116
118
 
@@ -1,6 +1,6 @@
1
1
  # Reference Codes
2
2
 
3
- Quick reference for use case naming and codebase discovery.
3
+ Quick reference for use case naming.
4
4
 
5
5
  ---
6
6
 
@@ -32,104 +32,3 @@ Standard codes for `UC-{GROUP}-{NNN}-{slug}.md` naming.
32
32
  **Custom codes**: Define project-specific codes in BRD README (3-5 chars, obvious meaning).
33
33
 
34
34
  **Principle**: Group by user intent, not implementation (PAY not STRIPE, USER not DATABASE).
35
-
36
- ---
37
-
38
- ## Codebase Discovery Patterns
39
-
40
- For existing codebase scanning (detect features and tech stack).
41
-
42
- ### Frontend File Patterns
43
-
44
- **Include**:
45
- ```
46
- **/*.vue # Vue.js
47
- **/*.tsx, **/*.jsx # React / Next.js
48
- **/pages/**/* # Routes
49
- **/app/**/page.tsx # Next.js App Router
50
- **/*.svelte # Svelte
51
- **/*.component.ts # Angular
52
- ```
53
-
54
- **Exclude**:
55
- ```
56
- node_modules/**, dist/**, build/**, .next/**, .nuxt/**
57
- *.min.js, *.bundle.js, *.chunk.js
58
- **/*.test.*, **/*.spec.*, __tests__/**
59
- ```
60
-
61
- ---
62
-
63
- ### Feature Inference from Files
64
-
65
- Map file/folder names to features:
66
-
67
- | Pattern | Feature |
68
- |---------|---------|
69
- | `auth/`, `login.*`, `signin.*` | Authentication |
70
- | `user/`, `profile.*`, `account.*` | User Management |
71
- | `dashboard.*` | Dashboard |
72
- | `payment/`, `checkout.*`, `billing.*` | Payments |
73
- | `subscription/`, `plans.*` | Subscriptions |
74
- | `admin/` | Admin Panel |
75
- | `notification/`, `alerts/` | Notifications |
76
- | `search.*` | Search |
77
- | `cart.*`, `basket.*` | Shopping Cart |
78
- | `order/`, `orders/` | Orders |
79
- | `product/`, `catalog/` | Products |
80
- | `message/`, `chat/`, `inbox/` | Messaging |
81
- | `report/`, `analytics/` | Reporting |
82
- | `upload/`, `files/`, `media/` | File Management |
83
- | `team/`, `organization/` | Team Management |
84
- | `onboarding/`, `wizard/`, `setup/` | Onboarding |
85
- | `help/`, `support/`, `faq/` | Help/Support |
86
-
87
- ---
88
-
89
- ### Tech Stack Detection
90
-
91
- **Package files**:
92
- ```
93
- package.json → Node.js / JavaScript
94
- requirements.txt → Python
95
- Gemfile → Ruby
96
- go.mod → Go
97
- Cargo.toml → Rust
98
- composer.json → PHP
99
- ```
100
-
101
- **Framework detection** (from package.json dependencies):
102
- - `next` → Next.js
103
- - `nuxt` → Nuxt.js
104
- - `vue` → Vue.js
105
- - `react` → React
106
- - `@angular/core` → Angular
107
- - `svelte` → Svelte
108
- - `express` → Express.js
109
- - `nestjs` → NestJS
110
-
111
- ---
112
-
113
- ### Documentation Patterns
114
-
115
- Look for existing docs:
116
- ```
117
- README.md, CLAUDE.md, CONTRIBUTING.md
118
- docs/**/*.md
119
- plans/**/*.md
120
- specifications/**/*.md
121
- .github/**/*.md
122
- ```
123
-
124
- ---
125
-
126
- ## Discovery Strategy
127
-
128
- **For existing codebase**:
129
- 1. Find package.json → Detect framework
130
- 2. Glob frontend files → List pages/components
131
- 3. Match patterns → Infer features
132
- 4. Read docs (README, CLAUDE.md)
133
- 5. Summarize in context.md
134
-
135
- **Output**: Features table with status (exists/missing), tech stack summary
@@ -2,15 +2,17 @@
2
2
 
3
3
  **Mindset**: Evidence-based validation. Features classified by market standards, not personal judgment.
4
4
 
5
- **Methodology**: Comparison-first → Deep validation → Tier classification
5
+ **Methodology**: Comparison-first → Multi-source revalidation (ALWAYS) → Tier classification
6
6
 
7
- **Expected Outcome**: Features with tier (MVP/Standard/Advanced) backed by evidence (competitor presence, user demand, ecosystem signals).
7
+ **Expected Outcome**: Features with tier (MVP/Standard/Advanced) backed by evidence from multiple sources.
8
8
 
9
9
  ---
10
10
 
11
- ## Quick Start (20%)
11
+ ## Research Flow (ALWAYS Deep)
12
12
 
13
- ### Comparison-First Approach
13
+ **No quick mode.** Always do full research with multi-source revalidation, regardless of scope tier.
14
+
15
+ ### Step 1: Comparison-First Approach
14
16
 
15
17
  **Start here** - one comparison page = 10 competitors analyzed:
16
18
 
@@ -30,7 +32,19 @@
30
32
 
31
33
  ---
32
34
 
33
- ### Tier Classification
35
+ ### Step 2: Multi-Source Revalidation (MANDATORY)
36
+
37
+ **Always revalidate** across multiple source types for every feature:
38
+ - Comparison pages (initial)
39
+ - Ecosystems (Chrome, WordPress, GitHub, NPM)
40
+ - User signals (Reddit, G2 reviews, forums)
41
+ - Competitor direct (pricing pages, feature pages)
42
+
43
+ **No shortcuts.** All tiers (MVP/Standard/Full) require full revalidation.
44
+
45
+ ---
46
+
47
+ ### Step 3: Tier Classification
34
48
 
35
49
  **MVP** (80%+ competitors, high demand):
36
50
  - Present in 8+ out of 10 competitors
@@ -67,7 +81,7 @@ Per feature, collect:
67
81
 
68
82
  ---
69
83
 
70
- ## Validation Sources (20%)
84
+ ## Revalidation Sources (ALWAYS Use Multiple)
71
85
 
72
86
  ### Comparison & Alternatives (Primary)
73
87
 
@@ -135,9 +149,11 @@ Per feature, collect:
135
149
 
136
150
  ---
137
151
 
138
- ## Methodology
152
+ ## Methodology (ALWAYS Deep)
139
153
 
140
- ### Phase 1: Comparison Scan (5 min)
154
+ **Process**: Always execute both phases regardless of scope tier (MVP/Standard/Full).
155
+
156
+ ### Phase 1: Comparison Scan
141
157
 
142
158
  **Goal**: Extract feature matrix from comparison pages.
143
159
 
@@ -151,17 +167,19 @@ Per feature, collect:
151
167
 
152
168
  ---
153
169
 
154
- ### Phase 2: Deep Validation (5-10 min per feature)
170
+ ### Phase 2: Multi-Source Revalidation (MANDATORY)
155
171
 
156
- **Goal**: Validate tier with evidence from multiple source types.
172
+ **Goal**: Validate tier with evidence from MULTIPLE source types.
157
173
 
158
- **Approach**: Cross-validate across source categories:
174
+ **ALWAYS cross-validate** across source categories:
159
175
  - Comparison pages (initial)
160
- - Ecosystem (Chrome, WordPress, GitHub)
161
- - User signals (Reddit, reviews)
176
+ - Ecosystems (Chrome, WordPress, GitHub, NPM)
177
+ - User signals (Reddit, reviews, forums)
162
178
  - Competitor direct (pricing, features)
163
179
 
164
- **Output**: Tier classification with evidence and sources
180
+ **No shortcuts**: Every feature needs multi-source validation, even for MVP scope.
181
+
182
+ **Output**: Tier classification with evidence from 3+ source types
165
183
 
166
184
  ---
167
185
 
@@ -52,22 +52,6 @@
52
52
 
53
53
  ---
54
54
 
55
- ## Implementation Resources
56
-
57
- > **For Engineers**: General documentation (feature-specific docs in feature folders)
58
-
59
- ### Platform Documentation
60
- | Technology | Link | Purpose |
61
- |------------|------|---------|
62
- | {Platform/Service} | [Docs](url) | {General purpose} |
63
-
64
- ### Industry Examples
65
- | Company | Link | What to Learn |
66
- |---------|------|---------------|
67
- | {Company} | [Example](url) | {General pattern} |
68
-
69
- ---
70
-
71
55
  ## Notes
72
56
 
73
57
  **Project Goals**:
@@ -80,16 +80,6 @@
80
80
 
81
81
  ---
82
82
 
83
- ## Implementation Resources
84
-
85
- > **For Engineers**: Links specific to this feature
86
-
87
- | Topic | Link | Purpose |
88
- |-------|------|---------|
89
- | {Service} {Feature} API | [Docs](url) | {Implementation} |
90
-
91
- ---
92
-
93
83
  ## Open Questions
94
84
 
95
85
  - {Question requiring customer input}
@@ -10,15 +10,13 @@
10
10
 
11
11
  ## Mode Detection
12
12
 
13
- **Principle**: Behavior changes based on context.
13
+ **Principle**: Default outputs questionnaire only. BRD creation requires explicit flag.
14
14
 
15
15
  **Detection**:
16
- - `--answers {file}` → Process Answers mode
17
- - `--generate-brd {file}` → Generate BRD mode
18
- - `--questionnaire-only`Questionnaire Only mode
19
- - No `plans/brd/`New Project mode
20
- - `plans/brd/` exists → Add Feature mode
21
- - Modifying confirmed UC → Change Request mode
16
+ - `--answers {file}` → Process Answers mode (CREATE BRD)
17
+ - `--generate-brd {file}` → Generate BRD mode (CREATE BRD)
18
+ - New customer request New Project mode (questionnaire only)
19
+ - Adding to existing research Add Feature mode (questionnaire only)
22
20
 
23
21
  **Action**: Execute appropriate workflow for detected mode.
24
22
 
@@ -37,30 +35,33 @@
37
35
  - Reuse → Switch to Generate BRD mode
38
36
  - Fresh → Continue with new research
39
37
 
40
- **Ask 5 questions** (AskUserQuestion):
41
- 1. Project type (new/existing codebase)
42
- 2. Industry (SaaS/E-commerce/Marketplace/etc.)
43
- 3. Target users (B2B/B2C/Internal)
44
- 4. Constraints (timeline/budget/compliance/integrations)
45
- 5. Scope tier (Core/Standard/Full)
46
-
47
- **If existing codebase**: Scan for docs + features (Glob, Read)
38
+ **Ask 4 questions** (AskUserQuestion):
39
+ 1. Industry (SaaS/E-commerce/Marketplace/etc.)
40
+ 2. Target users (B2B/B2C/Internal)
41
+ 3. Constraints (timeline/budget/compliance/integrations)
42
+ 4. **Scope tier** (Core/Standard/Full) - determines WHICH features to include
48
43
 
49
44
  **Output**: Context understanding, scope alignment
50
45
 
51
46
  ---
52
47
 
53
- ### Market Research (Always Deep)
48
+ ### Market Research (ALWAYS Deep + Revalidation)
49
+
50
+ **CRITICAL**: After scope tier chosen, ALWAYS do deep research + multi-source revalidation.
54
51
 
55
52
  **Methodology**: See `research.md` for full process.
56
53
 
57
- **Deep research** (always):
58
- 1. Comparison pages (feature matrix extraction)
59
- 2. Ecosystems (Chrome, WordPress, GitHub, etc.)
60
- 3. User signals (Reddit, reviews, forums)
61
- 4. Full tier classification with evidence
54
+ **Always execute** (same process for ALL scope tiers):
55
+ 1. **Phase 1**: Comparison pages (feature matrix extraction)
56
+ 2. **Phase 2**: Multi-source revalidation (MANDATORY)
57
+ - Ecosystems (Chrome, WordPress, GitHub, NPM)
58
+ - User signals (Reddit, reviews, forums)
59
+ - Competitor direct (pricing, features)
60
+ 3. Full tier classification with evidence from 3+ source types
62
61
 
63
- **Output**: Features with tier classification and evidence
62
+ **No shortcuts**: Core/Standard/Full scope all get identical deep research + revalidation process.
63
+
64
+ **Output**: Features with tier classification and multi-source evidence
64
65
 
65
66
  ---
66
67
 
@@ -90,8 +91,7 @@
90
91
  **Next steps**:
91
92
  1. Review questionnaire
92
93
  2. Send to customer for answers
93
- 3. After answers: `/debrief --answers questionnaire-{date}.xlsx`
94
- 4. BRD will be created from answers
94
+ 3. After answers: `/debrief --answers questionnaire-{date}.xlsx` to create BRD
95
95
 
96
96
  ---
97
97
 
@@ -127,6 +127,8 @@
127
127
 
128
128
  ## Process Answers Mode
129
129
 
130
+ **Trigger**: `/debrief --answers questionnaire.xlsx`
131
+
130
132
  **Goal**: Create BRD from customer-answered questionnaire.
131
133
 
132
134
  **Mindset**: BRD creation mode. Customer validated research, now create structure.
@@ -204,73 +206,26 @@
204
206
 
205
207
  ---
206
208
 
207
- ## Change Request Mode
208
-
209
- **Goal**: Track modifications to confirmed BRD.
210
-
211
- **Mindset**: Traceability mode. Document change rationale and impact.
212
-
213
- ### Process
214
-
215
- **Create CR** (`brd/changes/CR-{NNN}-{slug}.md`):
216
- - Change description
217
- - Reason for change
218
- - Impact analysis (affected UCs)
219
-
220
- **If gaps introduced**: Generate questionnaire at `brd/changes/CR-{NNN}-questionnaire-{date}.xlsx`
221
-
222
- **Update**: Affected use cases, references, changelog
223
-
224
- **Output**: CR document with impact analysis
225
-
226
- ---
227
-
228
209
  ## Generate BRD Mode
229
210
 
211
+ **Trigger**: `/debrief --generate-brd questionnaire.xlsx`
212
+
230
213
  **Goal**: Generate full BRD from existing questionnaire research.
231
214
 
232
215
  **Mindset**: Resumption mode. User reviewed Summary + Questionnaire, ready for full BRD.
233
216
 
234
217
  ### Process
235
218
 
236
- **Check questionnaire validity**:
237
- - Ask: "Found existing research in questionnaire. Use it or start fresh?"
238
- - Reuse (generate from questionnaire)
239
- - Fresh (ignore questionnaire, do new research)
240
-
241
- **If reuse**:
242
- - Execute same process as Process Answers mode
219
+ **Execute same process as Process Answers mode**:
243
220
  - Read questionnaire sheets
244
221
  - Sequence features
245
222
  - Generate use cases
246
223
  - Create BRD structure
247
224
 
248
- **If fresh**:
249
- - Ignore questionnaire
250
- - Run full research flow (New Project or Add Feature mode)
251
-
252
225
  **Output**: BRD files + feature folders
253
226
 
254
227
  ---
255
228
 
256
- ## Questionnaire Only Mode
257
-
258
- **Goal**: Generate questions without creating BRD.
259
-
260
- **Mindset**: Quick mode. Capture questions for customer.
261
-
262
- ### Process
263
-
264
- **Ask**:
265
- - Topic/feature name
266
- - Custom questions (user provides)
267
-
268
- **Generate**: `questionnaire-{date}.xlsx` in current directory
269
-
270
- **Output**: Excel file ready to send
271
-
272
- ---
273
-
274
229
  ## File Organization Principles
275
230
 
276
231
  **Scope-based placement**:
@@ -320,17 +275,17 @@
320
275
 
321
276
  ## Summary
322
277
 
323
- **Workflow adapts to mode**:
324
- - New Project: Full discovery and research
325
- - Add Feature: Focused research, duplicate check
326
- - Generate BRD: Reads existing questionnaire research
327
- - Process Answers: Integration and validation
328
- - Change Request: Impact tracking
329
- - Questionnaire Only: Quick question generation
278
+ **Workflow modes**:
279
+ - New Project: Full discovery and research → questionnaire (no BRD)
280
+ - Add Feature: Focused research, duplicate check → questionnaire (no BRD)
281
+ - Process Answers (`--answers`): Read filled questionnaire → CREATE BRD
282
+ - Generate BRD (`--generate-brd`): Read research questionnaire → CREATE BRD
283
+
284
+ **Default**: Questionnaire only. BRD creation requires explicit flag.
330
285
 
331
286
  **Consistent principles**:
332
- - Business focus (WHAT and WHY)
333
- - Evidence-based validation
334
- - Lean documentation (80/20)
335
- - Scope-based organization
336
- - Customer validation (questionnaire)
287
+ - Business focus (WHAT and WHY, never HOW)
288
+ - Evidence-based validation (multi-source)
289
+ - Always deep research + revalidation
290
+ - Customer validation via questionnaire
291
+ - BRD creation ONLY when user provides filled questionnaire
@@ -36,6 +36,32 @@ questions.json format:
36
36
 
37
37
  import sys
38
38
  import json
39
+ import subprocess
40
+ import os
41
+
42
+ # Check and install openpyxl if missing
43
+ def check_dependencies():
44
+ """Check if openpyxl is installed, install if missing."""
45
+ try:
46
+ import openpyxl
47
+ except ImportError:
48
+ print("Installing required dependency: openpyxl")
49
+
50
+ # Detect pip command (pip3 or pip)
51
+ pip_cmd = 'pip3' if os.system('which pip3 > /dev/null 2>&1') == 0 else 'pip'
52
+
53
+ try:
54
+ subprocess.check_call([pip_cmd, 'install', 'openpyxl'],
55
+ stdout=subprocess.DEVNULL,
56
+ stderr=subprocess.DEVNULL)
57
+ print("✓ openpyxl installed successfully")
58
+ except subprocess.CalledProcessError:
59
+ print("✗ Failed to install openpyxl")
60
+ print(f"Please run: {pip_cmd} install openpyxl")
61
+ sys.exit(1)
62
+
63
+ check_dependencies()
64
+
39
65
  from openpyxl import Workbook
40
66
  from openpyxl.styles import Font, PatternFill, Alignment, Border, Side
41
67
  from openpyxl.utils import get_column_letter
@@ -6,14 +6,35 @@
6
6
 
7
7
  import chalk from 'chalk';
8
8
  import ora from 'ora';
9
+ import { execSync } from 'child_process';
10
+ import fs from 'fs-extra';
11
+ import path from 'path';
9
12
 
10
- import { checkForUpdates, copySkillsToProject, getInstalledSkills } from '../utils/skills.js';
13
+ import { checkForUpdates, copySkillsToProject, getInstalledSkills, cleanupOldSkills } from '../utils/skills.js';
11
14
 
12
15
  export async function update(options) {
13
16
  const projectPath = process.cwd();
14
17
 
15
18
  console.log(chalk.bold('\n📦 Claude Skills Update\n'));
16
19
 
20
+ // Check for npm package updates
21
+ const packageSpinner = ora('Checking npm for latest version...').start();
22
+ try {
23
+ const currentVersion = await getCurrentPackageVersion();
24
+ const latestVersion = await getLatestNpmVersion();
25
+
26
+ if (currentVersion !== latestVersion) {
27
+ packageSpinner.info(`Package update available: ${currentVersion} → ${latestVersion}`);
28
+ console.log(chalk.yellow(`\nTo update the CLI package, run:\n npm install -g @codihaus/claude-skills@latest\n`));
29
+ } else {
30
+ packageSpinner.succeed(`CLI package is up to date (${currentVersion})`);
31
+ }
32
+ } catch (e) {
33
+ packageSpinner.warn('Could not check for CLI updates');
34
+ }
35
+
36
+ console.log('');
37
+
17
38
  // Check for installed skills
18
39
  const installed = await getInstalledSkills(projectPath);
19
40
 
@@ -25,7 +46,7 @@ export async function update(options) {
25
46
  console.log(chalk.gray(`Found ${installed.length} installed skills\n`));
26
47
 
27
48
  // Check for updates
28
- const spinner = ora('Checking for updates...').start();
49
+ const spinner = ora('Checking for skill updates...').start();
29
50
  const updates = await checkForUpdates(projectPath);
30
51
  spinner.stop();
31
52
 
@@ -52,6 +73,13 @@ export async function update(options) {
52
73
 
53
74
  try {
54
75
  const skillNames = updates.map(u => u.name);
76
+
77
+ // Clean up old files first
78
+ updateSpinner.text = 'Cleaning up old skill files...';
79
+ await cleanupOldSkills(projectPath, skillNames);
80
+
81
+ // Copy new versions
82
+ updateSpinner.text = 'Installing updated skills...';
55
83
  const { copied, errors } = await copySkillsToProject(projectPath, skillNames);
56
84
 
57
85
  if (errors.length > 0) {
@@ -70,3 +98,30 @@ export async function update(options) {
70
98
 
71
99
  console.log(chalk.green('\n✅ Update complete!\n'));
72
100
  }
101
+
102
+ /**
103
+ * Get current package version
104
+ */
105
+ async function getCurrentPackageVersion() {
106
+ try {
107
+ const packageJson = await fs.readJson(path.join(import.meta.dirname, '../../package.json'));
108
+ return packageJson.version;
109
+ } catch (e) {
110
+ return 'unknown';
111
+ }
112
+ }
113
+
114
+ /**
115
+ * Get latest version from npm
116
+ */
117
+ async function getLatestNpmVersion() {
118
+ try {
119
+ const result = execSync('npm view @codihaus/claude-skills version', {
120
+ encoding: 'utf8',
121
+ stdio: ['pipe', 'pipe', 'ignore']
122
+ });
123
+ return result.trim();
124
+ } catch (e) {
125
+ throw new Error('Could not fetch latest version from npm');
126
+ }
127
+ }
@@ -243,6 +243,30 @@ export async function removeSkillFromProject(projectPath, skillName) {
243
243
  }
244
244
  }
245
245
 
246
+ /**
247
+ * Clean up old skill files before updating
248
+ * Removes entire skill directory to ensure deleted files are removed
249
+ */
250
+ export async function cleanupOldSkills(projectPath, skillNames) {
251
+ const skillsPath = path.join(projectPath, '.claude', 'skills');
252
+
253
+ if (!await fs.pathExists(skillsPath)) {
254
+ return;
255
+ }
256
+
257
+ for (const skillName of skillNames) {
258
+ const skillPath = path.join(skillsPath, skillName);
259
+
260
+ if (await fs.pathExists(skillPath)) {
261
+ try {
262
+ await fs.remove(skillPath);
263
+ } catch (e) {
264
+ // Ignore errors, will be logged during copy
265
+ }
266
+ }
267
+ }
268
+ }
269
+
246
270
  /**
247
271
  * Check if skills need updating
248
272
  */