konstruct 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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 n3sh
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,77 @@
1
+ # Konstruct
2
+
3
+ Package manager for AI agent skills. Manages the lifecycle of skill directories — discovery, installation, updating, and removal — across one or more AI agent tool directories.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install -g konstruct
9
+ ```
10
+
11
+ ## Quick Start
12
+
13
+ ```bash
14
+ # Initialize a project
15
+ konstruct init
16
+
17
+ # Add a skill from GitHub
18
+ konstruct add github:anthropics/skills/skills/canvas-design#main
19
+
20
+ # Install all skills from skills.json
21
+ konstruct install
22
+
23
+ # Check for updates
24
+ konstruct update
25
+
26
+ # List installed skills
27
+ konstruct list
28
+ ```
29
+
30
+ ## Commands
31
+
32
+ | Command | Description |
33
+ |---|---|
34
+ | `konstruct init` | Create `skills.json` and `konstruct.config.json` |
35
+ | `konstruct add <source>` | Add a skill from a git or local source |
36
+ | `konstruct install` | Install all skills from `skills.json` |
37
+ | `konstruct update` | Re-install git skills at their manifest refs |
38
+ | `konstruct remove <names...>` | Remove one or more skills by name |
39
+ | `konstruct list` | List all skills in the current manifest |
40
+ | `konstruct defaults` | View and update default agent preferences |
41
+
42
+ ### Global mode
43
+
44
+ All commands support `-g, --global` to operate on `~/.konstruct/` instead of the current directory.
45
+
46
+ ```bash
47
+ konstruct init -g # Set up global config
48
+ konstruct add -g <source> # Install globally
49
+ konstruct list -g # List global skills
50
+ ```
51
+
52
+ ### Options
53
+
54
+ - `-g, --global` — Use global `~/.konstruct/` directory
55
+ - `-s, --ssh` — Use SSH for git cloning (default: HTTPS with auto-retry)
56
+ - `--user` — Add as a userSkill (local, never auto-updated)
57
+ - `--path <path>` — Custom installation path
58
+
59
+ ## Source formats
60
+
61
+ | Format | Example |
62
+ |---|---|
63
+ | GitHub | `github:owner/repo/path#ref` |
64
+ | GitLab | `gitlab:owner/repo#ref` |
65
+ | Generic git | `git:https://host/repo.git#ref` |
66
+ | Local file | `file:./relative/path` |
67
+ | Bare shorthand | `owner/repo` (defaults to GitHub) |
68
+
69
+ ## Supported agents
70
+
71
+ Konstruct installs skills into the appropriate directory for each agent:
72
+
73
+ claude, cursor, windsurf, continue, copilot, gemini, augment, cline, goose, junie, kiro, opencode, openhands, roo, trae, kode, qwen-code, codex, amp, kilo, pochi, neovate, mux, zencoder, adal
74
+
75
+ ## License
76
+
77
+ MIT
package/bin/cli.js ADDED
@@ -0,0 +1,23 @@
1
+ #!/usr/bin/env node
2
+ import { fileURLToPath } from 'node:url';
3
+ import { dirname, resolve } from 'node:path';
4
+
5
+ const __dirname = dirname(fileURLToPath(import.meta.url));
6
+
7
+ // Point to the tsup-bundled output. Falls back to tsx dev shim if dist/ doesn't exist yet.
8
+ const distEntry = resolve(__dirname, '..', 'dist', 'index.js');
9
+
10
+ try {
11
+ // Dynamic import so the path is resolved at runtime
12
+ await import(distEntry);
13
+ } catch {
14
+ // dist/ not built yet — fall back to tsx for development
15
+ const { execFileSync } = await import('node:child_process');
16
+ const projectRoot = resolve(__dirname, '..');
17
+ const tsx = resolve(projectRoot, 'node_modules', '.bin', 'tsx');
18
+ const entrypoint = resolve(projectRoot, 'src', 'cli', 'index.ts');
19
+ execFileSync(tsx, [entrypoint, ...process.argv.slice(2)], {
20
+ stdio: 'inherit',
21
+ env: process.env,
22
+ });
23
+ }