@alaagh/brainkit 2.0.0 → 2.0.2

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/CHANGELOG.md CHANGED
@@ -2,6 +2,17 @@
2
2
 
3
3
  All notable changes to this project are documented here.
4
4
 
5
+ ## [2.0.2] - 2026-03-20
6
+
7
+ ### Added
8
+
9
+ - Comprehensive failure path tests added for scripts and CLI edge cases.
10
+
11
+ ### Fixed
12
+
13
+ - CLI option parsing hardened for missing values (`--dest`, `--mode`).
14
+ - CI steps split for better attribution.
15
+
5
16
  ## [2.0.0] - 2026-02-14
6
17
 
7
18
  ### Added
package/README.md CHANGED
@@ -5,45 +5,44 @@
5
5
  [![npm version](https://img.shields.io/npm/v/%40alaagh%2Fbrainkit)](https://www.npmjs.com/package/@alaagh/brainkit)
6
6
  [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](./LICENSE)
7
7
 
8
- `brainkit` is an installable npm package for AI-ready assets:
8
+ Install production-ready AI skills with npm
9
9
 
10
- - skills
11
- - skill artifacts (`.skill`)
12
- - tool registry space (future)
10
+ ## Why Brainkit
13
11
 
14
- It currently includes one production skill: `threejs-performance-optimizer`.
12
+ `brainkit` packages AI skills so teams can install, version, and reuse them through a single npm package.
13
+ It keeps skill delivery simple: discover skills, install artifacts or source, and integrate them into existing workflows.
15
14
 
16
- ## Install with npm
15
+ ## Quickstart
17
16
 
18
17
  ```bash
19
18
  npm install @alaagh/brainkit
19
+ npx brainkit list
20
+ npx brainkit install threejs-performance-optimizer --dest ./skills
20
21
  ```
21
22
 
22
- ## Install the skill
23
+ ## JavaScript API
23
24
 
24
- 1. List available skills:
25
+ ```js
26
+ import { listSkills, installSkill } from "@alaagh/brainkit";
25
27
 
26
- ```bash
27
- npx brainkit list
28
+ const skills = listSkills();
29
+ await installSkill("threejs-performance-optimizer", "./local-skills");
28
30
  ```
29
31
 
30
- 2. Install the packaged skill artifact:
32
+ ```ts
33
+ import { listSkills, installSkill } from "@alaagh/brainkit";
34
+ import type { InstallResult } from "@alaagh/brainkit";
31
35
 
32
- ```bash
33
- npx brainkit install threejs-performance-optimizer --dest ~/.config/opencode/skills
36
+ const skills: string[] = listSkills();
37
+ const result: InstallResult = await installSkill(
38
+ "threejs-performance-optimizer",
39
+ "./local-skills",
40
+ );
34
41
  ```
35
42
 
36
- This creates:
37
-
38
- `~/.config/opencode/skills/threejs-performance-optimizer.skill`
39
-
40
- 3. Optional: install source folder instead of `.skill` artifact:
41
-
42
- ```bash
43
- npx brainkit install threejs-performance-optimizer --mode source --dest ~/.config/opencode/skills
44
- ```
43
+ See `docs/API_REFERENCE.md` for all exported functions.
45
44
 
46
- ## CLI quick reference
45
+ ## CLI reference
47
46
 
48
47
  ```bash
49
48
  brainkit list
@@ -53,18 +52,11 @@ brainkit where threejs-performance-optimizer
53
52
  brainkit install <skill|all> --dest <path> [--mode artifact|source]
54
53
  ```
55
54
 
56
- ## JavaScript API
55
+ ## What's included
57
56
 
58
- ```js
59
- import { listSkills, installSkill } from "@alaagh/brainkit";
60
-
61
- const skills = listSkills();
62
- await installSkill("threejs-performance-optimizer", "./local-skills");
63
- ```
64
-
65
- ## What is included today
66
-
67
- - `threejs-performance-optimizer`: profile-first optimization playbook for Three.js and React Three Fiber performance.
57
+ - Current production skill: `threejs-performance-optimizer`
58
+ - Skill artifacts in `.skill` format for direct installation
59
+ - Tool registry space in `tools/manifest.json` for future expansion
68
60
 
69
61
  ## Repository layout
70
62
 
@@ -84,4 +76,8 @@ npm test
84
76
 
85
77
  ## Contributing
86
78
 
87
- See `CONTRIBUTING.md`.
79
+ See `CONTRIBUTING.md` and look for issues labeled `good first issue`.
80
+
81
+ ## License
82
+
83
+ MIT. See `./LICENSE`.
package/dist/cli.js CHANGED
@@ -19,12 +19,18 @@ function parseOptions(argv) {
19
19
  const token = argv[index];
20
20
 
21
21
  if (token === "--dest") {
22
+ if (index + 1 >= argv.length || argv[index + 1].startsWith("--")) {
23
+ throw new Error("Missing value for --dest.");
24
+ }
22
25
  options.dest = argv[index + 1];
23
26
  index += 1;
24
27
  continue;
25
28
  }
26
29
 
27
30
  if (token === "--mode") {
31
+ if (index + 1 >= argv.length || argv[index + 1].startsWith("--")) {
32
+ throw new Error("Missing value for --mode.");
33
+ }
28
34
  options.mode = argv[index + 1];
29
35
  index += 1;
30
36
  continue;
@@ -121,7 +127,11 @@ async function run() {
121
127
 
122
128
  const options = parseOptions(argv.slice(2));
123
129
  if (!options.dest) {
124
- throw new Error("Destination path is required. Use --dest <path>.");
130
+ throw new Error(
131
+ "Missing required option --dest.\n\n" +
132
+ "Example:\n" +
133
+ " brainkit install threejs-performance-optimizer --dest ./my-skills",
134
+ );
125
135
  }
126
136
 
127
137
  if (!["artifact", "source"].includes(options.mode)) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@alaagh/brainkit",
3
- "version": "2.0.0",
4
- "description": "Installable npm bundle of AI skills with CLI and JavaScript API.",
3
+ "version": "2.0.2",
4
+ "description": "Install production-ready AI skills with npm",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",