productkit 1.4.0 → 1.5.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 +1 -0
- package/package.json +1 -1
- package/src/cli.js +7 -1
- package/src/commands/reset.js +45 -0
package/README.md
CHANGED
|
@@ -97,6 +97,7 @@ These markdown files are your product foundation — share them with your team,
|
|
|
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
99
|
| `productkit update` | Refresh slash commands to the latest version |
|
|
100
|
+
| `productkit reset` | Remove all artifacts and start over |
|
|
100
101
|
| `productkit check` | Verify Claude Code is installed |
|
|
101
102
|
|
|
102
103
|
## How It Works
|
package/package.json
CHANGED
package/src/cli.js
CHANGED
|
@@ -6,13 +6,14 @@ const initCommand = require('./commands/init');
|
|
|
6
6
|
const checkCommand = require('./commands/check');
|
|
7
7
|
const statusCommand = require('./commands/status');
|
|
8
8
|
const updateCommand = require('./commands/update');
|
|
9
|
+
const resetCommand = require('./commands/reset');
|
|
9
10
|
|
|
10
11
|
const program = new Command();
|
|
11
12
|
|
|
12
13
|
program
|
|
13
14
|
.name('productkit')
|
|
14
15
|
.description(chalk.cyan.bold('Product thinking toolkit for Claude Code'))
|
|
15
|
-
.version('1.
|
|
16
|
+
.version('1.5.0');
|
|
16
17
|
|
|
17
18
|
program
|
|
18
19
|
.command('init [projectName]')
|
|
@@ -35,6 +36,11 @@ program
|
|
|
35
36
|
.description('Refresh slash commands to the latest version')
|
|
36
37
|
.action(updateCommand);
|
|
37
38
|
|
|
39
|
+
program
|
|
40
|
+
.command('reset')
|
|
41
|
+
.description('Remove all artifacts and start over')
|
|
42
|
+
.action(resetCommand);
|
|
43
|
+
|
|
38
44
|
program.parse(process.argv);
|
|
39
45
|
|
|
40
46
|
if (process.argv.length === 2) {
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
const fs = require('fs-extra');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const chalk = require('chalk');
|
|
4
|
+
|
|
5
|
+
const ARTIFACTS = [
|
|
6
|
+
'constitution.md',
|
|
7
|
+
'users.md',
|
|
8
|
+
'problem.md',
|
|
9
|
+
'assumptions.md',
|
|
10
|
+
'solution.md',
|
|
11
|
+
'priorities.md',
|
|
12
|
+
'spec.md',
|
|
13
|
+
];
|
|
14
|
+
|
|
15
|
+
async function reset() {
|
|
16
|
+
const root = process.cwd();
|
|
17
|
+
const configPath = path.join(root, '.productkit', 'config.json');
|
|
18
|
+
|
|
19
|
+
if (!fs.existsSync(configPath)) {
|
|
20
|
+
console.error(chalk.red('Not a Product Kit project.'));
|
|
21
|
+
console.log('Run: productkit init <name>');
|
|
22
|
+
process.exit(1);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
let removed = 0;
|
|
26
|
+
|
|
27
|
+
for (const file of ARTIFACTS) {
|
|
28
|
+
const filePath = path.join(root, file);
|
|
29
|
+
if (fs.existsSync(filePath)) {
|
|
30
|
+
fs.removeSync(filePath);
|
|
31
|
+
console.log(chalk.yellow(` removed ${file}`));
|
|
32
|
+
removed++;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
console.log();
|
|
37
|
+
if (removed > 0) {
|
|
38
|
+
console.log(chalk.green.bold(`Reset complete. ${removed} artifact${removed === 1 ? '' : 's'} removed.`));
|
|
39
|
+
} else {
|
|
40
|
+
console.log(chalk.green.bold('Nothing to reset — no artifacts found.'));
|
|
41
|
+
}
|
|
42
|
+
console.log();
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
module.exports = reset;
|