productkit 1.3.0 → 1.4.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.
package/README.md CHANGED
@@ -96,6 +96,7 @@ These markdown files are your product foundation — share them with your team,
96
96
  | `productkit init <name>` | Scaffold a new project |
97
97
  | `productkit init --existing` | Add Product Kit to the current directory |
98
98
  | `productkit status` | Show progress — which artifacts exist and what's next |
99
+ | `productkit update` | Refresh slash commands to the latest version |
99
100
  | `productkit check` | Verify Claude Code is installed |
100
101
 
101
102
  ## How It Works
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "productkit",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "description": "Slash-command-driven product thinking toolkit for Claude Code",
5
5
  "main": "src/cli.js",
6
6
  "bin": {
package/src/cli.js CHANGED
@@ -5,13 +5,14 @@ const chalk = require('chalk');
5
5
  const initCommand = require('./commands/init');
6
6
  const checkCommand = require('./commands/check');
7
7
  const statusCommand = require('./commands/status');
8
+ const updateCommand = require('./commands/update');
8
9
 
9
10
  const program = new Command();
10
11
 
11
12
  program
12
13
  .name('productkit')
13
14
  .description(chalk.cyan.bold('Product thinking toolkit for Claude Code'))
14
- .version('1.3.0');
15
+ .version('1.4.0');
15
16
 
16
17
  program
17
18
  .command('init [projectName]')
@@ -29,6 +30,11 @@ program
29
30
  .description('Show which artifacts exist and what steps remain')
30
31
  .action(statusCommand);
31
32
 
33
+ program
34
+ .command('update')
35
+ .description('Refresh slash commands to the latest version')
36
+ .action(updateCommand);
37
+
32
38
  program.parse(process.argv);
33
39
 
34
40
  if (process.argv.length === 2) {
@@ -0,0 +1,51 @@
1
+ const fs = require('fs-extra');
2
+ const path = require('path');
3
+ const chalk = require('chalk');
4
+
5
+ async function update() {
6
+ const root = process.cwd();
7
+ const configPath = path.join(root, '.productkit', 'config.json');
8
+
9
+ if (!fs.existsSync(configPath)) {
10
+ console.error(chalk.red('Not a Product Kit project.'));
11
+ console.log('Run: productkit init <name>');
12
+ process.exit(1);
13
+ }
14
+
15
+ const templatesDir = path.join(__dirname, '..', '..', 'templates');
16
+ const commandsDir = path.join(templatesDir, 'commands');
17
+ const targetDir = path.join(root, '.claude', 'commands');
18
+
19
+ fs.ensureDirSync(targetDir);
20
+
21
+ const commandFiles = fs.readdirSync(commandsDir);
22
+ let updated = 0;
23
+ let added = 0;
24
+
25
+ for (const file of commandFiles) {
26
+ const src = path.join(commandsDir, file);
27
+ const dest = path.join(targetDir, file);
28
+ const existed = fs.existsSync(dest);
29
+
30
+ fs.copyFileSync(src, dest);
31
+
32
+ if (existed) {
33
+ updated++;
34
+ } else {
35
+ added++;
36
+ console.log(chalk.green(` + ${file}`));
37
+ }
38
+ }
39
+
40
+ // Update CLAUDE.md
41
+ const claudeSrc = path.join(templatesDir, 'CLAUDE.md');
42
+ const claudeDest = path.join(root, 'CLAUDE.md');
43
+ fs.copyFileSync(claudeSrc, claudeDest);
44
+
45
+ console.log();
46
+ console.log(chalk.green.bold('Slash commands updated!'));
47
+ console.log(` ${updated} updated, ${added} new`);
48
+ console.log();
49
+ }
50
+
51
+ module.exports = update;