@skhema/cli 0.3.1
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 +163 -0
- package/bin/skhema.js +2 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +92 -0
- package/dist/commands/agent.d.ts +3 -0
- package/dist/commands/agent.d.ts.map +1 -0
- package/dist/commands/agent.js +154 -0
- package/dist/commands/api.d.ts +19 -0
- package/dist/commands/api.d.ts.map +1 -0
- package/dist/commands/api.js +97 -0
- package/dist/commands/auth.d.ts +3 -0
- package/dist/commands/auth.d.ts.map +1 -0
- package/dist/commands/auth.js +403 -0
- package/dist/commands/component.d.ts +3 -0
- package/dist/commands/component.d.ts.map +1 -0
- package/dist/commands/component.js +221 -0
- package/dist/commands/contribute.d.ts +3 -0
- package/dist/commands/contribute.d.ts.map +1 -0
- package/dist/commands/contribute.js +318 -0
- package/dist/commands/element.d.ts +7 -0
- package/dist/commands/element.d.ts.map +1 -0
- package/dist/commands/element.js +167 -0
- package/dist/commands/export.d.ts +9 -0
- package/dist/commands/export.d.ts.map +1 -0
- package/dist/commands/export.js +42 -0
- package/dist/commands/init.d.ts +49 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +275 -0
- package/dist/commands/link.d.ts +8 -0
- package/dist/commands/link.d.ts.map +1 -0
- package/dist/commands/link.js +70 -0
- package/dist/commands/resource.d.ts +3 -0
- package/dist/commands/resource.d.ts.map +1 -0
- package/dist/commands/resource.js +88 -0
- package/dist/commands/skills.d.ts +3 -0
- package/dist/commands/skills.d.ts.map +1 -0
- package/dist/commands/skills.js +113 -0
- package/dist/commands/strategy.d.ts +3 -0
- package/dist/commands/strategy.d.ts.map +1 -0
- package/dist/commands/strategy.js +143 -0
- package/dist/commands/webhook.d.ts +3 -0
- package/dist/commands/webhook.d.ts.map +1 -0
- package/dist/commands/webhook.js +77 -0
- package/dist/commands/workspace.d.ts +8 -0
- package/dist/commands/workspace.d.ts.map +1 -0
- package/dist/commands/workspace.js +219 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1 -0
- package/dist/lib/api/client.d.ts +27 -0
- package/dist/lib/api/client.d.ts.map +1 -0
- package/dist/lib/api/client.js +71 -0
- package/dist/lib/api/command-helpers.d.ts +27 -0
- package/dist/lib/api/command-helpers.d.ts.map +1 -0
- package/dist/lib/api/command-helpers.js +77 -0
- package/dist/lib/api/credential-context.d.ts +3 -0
- package/dist/lib/api/credential-context.d.ts.map +1 -0
- package/dist/lib/api/credential-context.js +13 -0
- package/dist/lib/api/export-cli.d.ts +14 -0
- package/dist/lib/api/export-cli.d.ts.map +1 -0
- package/dist/lib/api/export-cli.js +26 -0
- package/dist/lib/api/formats.d.ts +12 -0
- package/dist/lib/api/formats.d.ts.map +1 -0
- package/dist/lib/api/formats.js +18 -0
- package/dist/lib/api/passthrough.d.ts +34 -0
- package/dist/lib/api/passthrough.d.ts.map +1 -0
- package/dist/lib/api/passthrough.js +106 -0
- package/dist/lib/api/payload.d.ts +16 -0
- package/dist/lib/api/payload.d.ts.map +1 -0
- package/dist/lib/api/payload.js +53 -0
- package/dist/lib/api/run-command.d.ts +69 -0
- package/dist/lib/api/run-command.d.ts.map +1 -0
- package/dist/lib/api/run-command.js +127 -0
- package/dist/lib/api/scope.d.ts +8 -0
- package/dist/lib/api/scope.d.ts.map +1 -0
- package/dist/lib/api/scope.js +16 -0
- package/dist/lib/api/transfer.d.ts +57 -0
- package/dist/lib/api/transfer.d.ts.map +1 -0
- package/dist/lib/api/transfer.js +153 -0
- package/dist/lib/auth/api-key-admin.d.ts +39 -0
- package/dist/lib/auth/api-key-admin.d.ts.map +1 -0
- package/dist/lib/auth/api-key-admin.js +66 -0
- package/dist/lib/auth/api-key-store.d.ts +8 -0
- package/dist/lib/auth/api-key-store.d.ts.map +1 -0
- package/dist/lib/auth/api-key-store.js +109 -0
- package/dist/lib/auth/device-flow.d.ts +4 -0
- package/dist/lib/auth/device-flow.d.ts.map +1 -0
- package/dist/lib/auth/device-flow.js +109 -0
- package/dist/lib/auth/entitlements.d.ts +16 -0
- package/dist/lib/auth/entitlements.d.ts.map +1 -0
- package/dist/lib/auth/entitlements.js +89 -0
- package/dist/lib/auth/localhost-flow.d.ts +4 -0
- package/dist/lib/auth/localhost-flow.d.ts.map +1 -0
- package/dist/lib/auth/localhost-flow.js +134 -0
- package/dist/lib/auth/oauth-client.d.ts +33 -0
- package/dist/lib/auth/oauth-client.d.ts.map +1 -0
- package/dist/lib/auth/oauth-client.js +96 -0
- package/dist/lib/auth/token-store.d.ts +6 -0
- package/dist/lib/auth/token-store.d.ts.map +1 -0
- package/dist/lib/auth/token-store.js +136 -0
- package/dist/lib/auth/types.d.ts +49 -0
- package/dist/lib/auth/types.d.ts.map +1 -0
- package/dist/lib/auth/types.js +1 -0
- package/dist/lib/banner.d.ts +2 -0
- package/dist/lib/banner.d.ts.map +1 -0
- package/dist/lib/banner.js +82 -0
- package/dist/lib/config-store.d.ts +23 -0
- package/dist/lib/config-store.d.ts.map +1 -0
- package/dist/lib/config-store.js +53 -0
- package/dist/lib/config.d.ts +20 -0
- package/dist/lib/config.d.ts.map +1 -0
- package/dist/lib/config.js +33 -0
- package/dist/lib/contribute/author-resolver.d.ts +13 -0
- package/dist/lib/contribute/author-resolver.d.ts.map +1 -0
- package/dist/lib/contribute/author-resolver.js +63 -0
- package/dist/lib/contribute/embed-generator.d.ts +4 -0
- package/dist/lib/contribute/embed-generator.d.ts.map +1 -0
- package/dist/lib/contribute/embed-generator.js +108 -0
- package/dist/lib/contribute/link-generator.d.ts +11 -0
- package/dist/lib/contribute/link-generator.d.ts.map +1 -0
- package/dist/lib/contribute/link-generator.js +119 -0
- package/dist/lib/contribute/method-schema.d.ts +239 -0
- package/dist/lib/contribute/method-schema.d.ts.map +1 -0
- package/dist/lib/contribute/method-schema.js +172 -0
- package/dist/lib/contribute/profile-resolver.d.ts +2 -0
- package/dist/lib/contribute/profile-resolver.d.ts.map +1 -0
- package/dist/lib/contribute/profile-resolver.js +25 -0
- package/dist/lib/contribute/types.d.ts +91 -0
- package/dist/lib/contribute/types.d.ts.map +1 -0
- package/dist/lib/contribute/types.js +1 -0
- package/dist/lib/mcp/registrar.d.ts +26 -0
- package/dist/lib/mcp/registrar.d.ts.map +1 -0
- package/dist/lib/mcp/registrar.js +69 -0
- package/dist/lib/mcp/registry.d.ts +54 -0
- package/dist/lib/mcp/registry.d.ts.map +1 -0
- package/dist/lib/mcp/registry.js +105 -0
- package/dist/lib/open.d.ts +2 -0
- package/dist/lib/open.d.ts.map +1 -0
- package/dist/lib/open.js +24 -0
- package/dist/lib/output.d.ts +25 -0
- package/dist/lib/output.d.ts.map +1 -0
- package/dist/lib/output.js +74 -0
- package/dist/lib/skills/installer.d.ts +4 -0
- package/dist/lib/skills/installer.d.ts.map +1 -0
- package/dist/lib/skills/installer.js +100 -0
- package/dist/lib/skills/lock.d.ts +4 -0
- package/dist/lib/skills/lock.d.ts.map +1 -0
- package/dist/lib/skills/lock.js +28 -0
- package/dist/lib/skills/platform-detect.d.ts +4 -0
- package/dist/lib/skills/platform-detect.d.ts.map +1 -0
- package/dist/lib/skills/platform-detect.js +89 -0
- package/dist/lib/skills/types.d.ts +29 -0
- package/dist/lib/skills/types.d.ts.map +1 -0
- package/dist/lib/skills/types.js +1 -0
- package/dist/postinstall.d.ts +2 -0
- package/dist/postinstall.d.ts.map +1 -0
- package/dist/postinstall.js +11 -0
- package/package.json +67 -0
- package/skills/.manifest.json +15 -0
- package/skills/skhema-challenge-framing/SKILL.md +28 -0
- package/skills/skhema-coherence-check/SKILL.md +28 -0
- package/skills/skhema-element-decomposition/SKILL.md +28 -0
- package/skills/skhema-element-writer/SKILL.md +20 -0
- package/skills/skhema-judgment-audit/SKILL.md +28 -0
- package/skills/skhema-semantic-sharpening/SKILL.md +28 -0
- package/skills/skhema-strategy-advisor/SKILL.md +20 -0
- package/skills/skhema-workspace-navigator/SKILL.md +20 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
let globalOptions = {};
|
|
3
|
+
export function setGlobalOptions(options) {
|
|
4
|
+
globalOptions = { ...globalOptions, ...options };
|
|
5
|
+
}
|
|
6
|
+
export function getGlobalOptions() {
|
|
7
|
+
return globalOptions;
|
|
8
|
+
}
|
|
9
|
+
export function formatResult(result) {
|
|
10
|
+
if (globalOptions.json) {
|
|
11
|
+
return JSON.stringify(result, null, 2);
|
|
12
|
+
}
|
|
13
|
+
if (!result.success && result.error) {
|
|
14
|
+
return chalk.red(`Error: ${result.error}`);
|
|
15
|
+
}
|
|
16
|
+
return '';
|
|
17
|
+
}
|
|
18
|
+
export function outputSuccess(data, command) {
|
|
19
|
+
const result = {
|
|
20
|
+
success: true,
|
|
21
|
+
data,
|
|
22
|
+
metadata: {
|
|
23
|
+
timestamp: new Date().toISOString(),
|
|
24
|
+
command,
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
if (globalOptions.json) {
|
|
28
|
+
console.log(JSON.stringify(result, null, 2));
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
export function outputError(error, command) {
|
|
32
|
+
const result = {
|
|
33
|
+
success: false,
|
|
34
|
+
error,
|
|
35
|
+
metadata: {
|
|
36
|
+
timestamp: new Date().toISOString(),
|
|
37
|
+
command,
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
if (globalOptions.json) {
|
|
41
|
+
console.log(JSON.stringify(result, null, 2));
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
console.error(chalk.red(`Error: ${error}`));
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
export function log(message) {
|
|
48
|
+
if (!globalOptions.quiet && !globalOptions.json) {
|
|
49
|
+
console.log(message);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
export function logVerbose(message) {
|
|
53
|
+
if (globalOptions.verbose && !globalOptions.json) {
|
|
54
|
+
console.log(chalk.dim(message));
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
export function logHeader(title) {
|
|
58
|
+
if (!globalOptions.quiet && !globalOptions.json) {
|
|
59
|
+
console.log(chalk.bold.cyan(title));
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
export function logTable(headers, rows, columnWidths) {
|
|
63
|
+
if (globalOptions.json || globalOptions.quiet)
|
|
64
|
+
return;
|
|
65
|
+
const widths = columnWidths ||
|
|
66
|
+
headers.map((h, i) => Math.max(h.length, ...rows.map((r) => (r[i] || '').length)));
|
|
67
|
+
const headerLine = headers.map((h, i) => h.padEnd(widths[i])).join(' | ');
|
|
68
|
+
const separator = widths.map((w) => '-'.repeat(w)).join('-+-');
|
|
69
|
+
console.log(headerLine);
|
|
70
|
+
console.log(separator);
|
|
71
|
+
rows.forEach((row) => {
|
|
72
|
+
console.log(row.map((cell, i) => (cell || '').padEnd(widths[i])).join(' | '));
|
|
73
|
+
});
|
|
74
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { DetectedPlatform, InstallResult } from './types.js';
|
|
2
|
+
export declare function installSkills(platforms: DetectedPlatform[]): Promise<InstallResult[]>;
|
|
3
|
+
export declare function updateSkills(platforms: DetectedPlatform[]): Promise<InstallResult[]>;
|
|
4
|
+
//# sourceMappingURL=installer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"installer.d.ts","sourceRoot":"","sources":["../../../src/lib/skills/installer.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAgFjE,wBAAsB,aAAa,CACjC,SAAS,EAAE,gBAAgB,EAAE,GAC5B,OAAO,CAAC,aAAa,EAAE,CAAC,CA0C1B;AAED,wBAAsB,YAAY,CAChC,SAAS,EAAE,gBAAgB,EAAE,GAC5B,OAAO,CAAC,aAAa,EAAE,CAAC,CAG1B"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import crypto from 'crypto';
|
|
2
|
+
import fs from 'fs';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
import { fileURLToPath } from 'url';
|
|
5
|
+
import { readLock, writeLock } from './lock.js';
|
|
6
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = path.dirname(__filename);
|
|
8
|
+
function getBundledSkillsDir() {
|
|
9
|
+
// Navigate from dist/lib/skills/installer.js to skills/
|
|
10
|
+
return path.resolve(__dirname, '..', '..', '..', 'skills');
|
|
11
|
+
}
|
|
12
|
+
function getFileChecksum(content) {
|
|
13
|
+
return crypto.createHash('sha256').update(content).digest('hex').slice(0, 16);
|
|
14
|
+
}
|
|
15
|
+
function getBundledSkills() {
|
|
16
|
+
const skillsDir = getBundledSkillsDir();
|
|
17
|
+
if (!fs.existsSync(skillsDir))
|
|
18
|
+
return [];
|
|
19
|
+
return fs
|
|
20
|
+
.readdirSync(skillsDir, { withFileTypes: true })
|
|
21
|
+
.filter((entry) => entry.isDirectory())
|
|
22
|
+
.map((entry) => ({
|
|
23
|
+
name: entry.name,
|
|
24
|
+
dir: path.join(skillsDir, entry.name),
|
|
25
|
+
}));
|
|
26
|
+
}
|
|
27
|
+
function copySkillToPlatform(skillDir, skillName, platform) {
|
|
28
|
+
const targetDir = path.join(platform.skillsDir, skillName);
|
|
29
|
+
const sourceFile = path.join(skillDir, 'SKILL.md');
|
|
30
|
+
const targetFile = path.join(targetDir, 'SKILL.md');
|
|
31
|
+
if (!fs.existsSync(sourceFile)) {
|
|
32
|
+
return { action: 'skipped', targetPath: targetDir };
|
|
33
|
+
}
|
|
34
|
+
const sourceContent = fs.readFileSync(sourceFile, 'utf-8');
|
|
35
|
+
// Check if target exists and compare content
|
|
36
|
+
if (fs.existsSync(targetFile)) {
|
|
37
|
+
const existingContent = fs.readFileSync(targetFile, 'utf-8');
|
|
38
|
+
if (existingContent === sourceContent) {
|
|
39
|
+
return { action: 'skipped', targetPath: targetDir };
|
|
40
|
+
}
|
|
41
|
+
// Content differs — update
|
|
42
|
+
fs.writeFileSync(targetFile, sourceContent);
|
|
43
|
+
return { action: 'updated', targetPath: targetDir };
|
|
44
|
+
}
|
|
45
|
+
// New install
|
|
46
|
+
fs.mkdirSync(targetDir, { recursive: true });
|
|
47
|
+
fs.writeFileSync(targetFile, sourceContent);
|
|
48
|
+
// Copy additional files recursively if they exist
|
|
49
|
+
copyAdditionalFiles(skillDir, targetDir);
|
|
50
|
+
return { action: 'installed', targetPath: targetDir };
|
|
51
|
+
}
|
|
52
|
+
function copyAdditionalFiles(sourceDir, targetDir) {
|
|
53
|
+
const entries = fs.readdirSync(sourceDir, { withFileTypes: true });
|
|
54
|
+
for (const entry of entries) {
|
|
55
|
+
if (entry.name === 'SKILL.md')
|
|
56
|
+
continue; // Already handled
|
|
57
|
+
const sourcePath = path.join(sourceDir, entry.name);
|
|
58
|
+
const targetPath = path.join(targetDir, entry.name);
|
|
59
|
+
if (entry.isDirectory()) {
|
|
60
|
+
fs.mkdirSync(targetPath, { recursive: true });
|
|
61
|
+
copyAdditionalFiles(sourcePath, targetPath);
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
fs.copyFileSync(sourcePath, targetPath);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
export async function installSkills(platforms) {
|
|
69
|
+
const skills = getBundledSkills();
|
|
70
|
+
const results = [];
|
|
71
|
+
for (const platform of platforms) {
|
|
72
|
+
// Ensure skills directory exists
|
|
73
|
+
fs.mkdirSync(platform.skillsDir, { recursive: true });
|
|
74
|
+
const lock = readLock(platform);
|
|
75
|
+
for (const skill of skills) {
|
|
76
|
+
const { action, targetPath } = copySkillToPlatform(skill.dir, skill.name, platform);
|
|
77
|
+
results.push({
|
|
78
|
+
platform,
|
|
79
|
+
skill: skill.name,
|
|
80
|
+
action,
|
|
81
|
+
targetPath,
|
|
82
|
+
});
|
|
83
|
+
// Update lock file
|
|
84
|
+
if (action !== 'skipped') {
|
|
85
|
+
const sourceContent = fs.readFileSync(path.join(skill.dir, 'SKILL.md'), 'utf-8');
|
|
86
|
+
lock.skills[skill.name] = {
|
|
87
|
+
version: '0.1.0',
|
|
88
|
+
checksum: getFileChecksum(sourceContent),
|
|
89
|
+
installedAt: new Date().toISOString(),
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
writeLock(platform, lock);
|
|
94
|
+
}
|
|
95
|
+
return results;
|
|
96
|
+
}
|
|
97
|
+
export async function updateSkills(platforms) {
|
|
98
|
+
// Update uses the same logic as install — content comparison handles skip/update
|
|
99
|
+
return installSkills(platforms);
|
|
100
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lock.d.ts","sourceRoot":"","sources":["../../../src/lib/skills/lock.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAM7D,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,GAAG,SAAS,CAiB9D;AAED,wBAAgB,SAAS,CAAC,QAAQ,EAAE,gBAAgB,EAAE,IAAI,EAAE,SAAS,GAAG,IAAI,CAI3E"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import { SKILL_LOCK_FILE } from '../config.js';
|
|
4
|
+
function getLockFilePath(platform) {
|
|
5
|
+
return path.join(platform.skillsDir, SKILL_LOCK_FILE);
|
|
6
|
+
}
|
|
7
|
+
export function readLock(platform) {
|
|
8
|
+
const lockPath = getLockFilePath(platform);
|
|
9
|
+
try {
|
|
10
|
+
if (fs.existsSync(lockPath)) {
|
|
11
|
+
const data = fs.readFileSync(lockPath, 'utf-8');
|
|
12
|
+
return JSON.parse(data);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
catch {
|
|
16
|
+
// Corrupted lock file — start fresh
|
|
17
|
+
}
|
|
18
|
+
return {
|
|
19
|
+
version: '1',
|
|
20
|
+
installedAt: new Date().toISOString(),
|
|
21
|
+
skills: {},
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export function writeLock(platform, lock) {
|
|
25
|
+
const lockPath = getLockFilePath(platform);
|
|
26
|
+
lock.installedAt = new Date().toISOString();
|
|
27
|
+
fs.writeFileSync(lockPath, JSON.stringify(lock, null, 2) + '\n');
|
|
28
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platform-detect.d.ts","sourceRoot":"","sources":["../../../src/lib/skills/platform-detect.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAgFlD,wBAAgB,eAAe,IAAI,gBAAgB,EAAE,CAKpD;AAED,wBAAgB,eAAe,CAAC,EAAE,EAAE,MAAM,GAAG,gBAAgB,GAAG,SAAS,CAExE"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import os from 'os';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
// All providers below adopt the Anthropic Agent Skills convention:
|
|
5
|
+
// `<config-dir>/skills/<skill-name>/SKILL.md` with YAML frontmatter.
|
|
6
|
+
// `~/.agents/skills/` is the emerging universal alias (read by Gemini CLI + Warp).
|
|
7
|
+
const PLATFORMS = [
|
|
8
|
+
{
|
|
9
|
+
id: 'agents',
|
|
10
|
+
name: 'Universal (.agents)',
|
|
11
|
+
configDir: path.join(os.homedir(), '.agents'),
|
|
12
|
+
skillsDir: path.join(os.homedir(), '.agents', 'skills'),
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
id: 'claude',
|
|
16
|
+
name: 'Claude Code',
|
|
17
|
+
configDir: path.join(os.homedir(), '.claude'),
|
|
18
|
+
skillsDir: path.join(os.homedir(), '.claude', 'skills'),
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
id: 'codex',
|
|
22
|
+
name: 'Codex',
|
|
23
|
+
configDir: path.join(os.homedir(), '.codex'),
|
|
24
|
+
skillsDir: path.join(os.homedir(), '.codex', 'skills'),
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
id: 'gemini',
|
|
28
|
+
name: 'Gemini CLI',
|
|
29
|
+
configDir: path.join(os.homedir(), '.gemini'),
|
|
30
|
+
skillsDir: path.join(os.homedir(), '.gemini', 'skills'),
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
id: 'warp',
|
|
34
|
+
name: 'Warp',
|
|
35
|
+
configDir: path.join(os.homedir(), '.warp'),
|
|
36
|
+
skillsDir: path.join(os.homedir(), '.warp', 'skills'),
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
id: 'cursor',
|
|
40
|
+
name: 'Cursor',
|
|
41
|
+
configDir: path.join(os.homedir(), '.cursor'),
|
|
42
|
+
skillsDir: path.join(os.homedir(), '.cursor', 'skills'),
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
id: 'copilot',
|
|
46
|
+
name: 'GitHub Copilot',
|
|
47
|
+
configDir: path.join(os.homedir(), '.copilot'),
|
|
48
|
+
skillsDir: path.join(os.homedir(), '.copilot', 'skills'),
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
id: 'factory',
|
|
52
|
+
name: 'Factory',
|
|
53
|
+
configDir: path.join(os.homedir(), '.factory'),
|
|
54
|
+
skillsDir: path.join(os.homedir(), '.factory', 'skills'),
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
id: 'opencode',
|
|
58
|
+
name: 'OpenCode',
|
|
59
|
+
configDir: path.join(os.homedir(), '.opencode'),
|
|
60
|
+
skillsDir: path.join(os.homedir(), '.opencode', 'skills'),
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
id: 'antigravity',
|
|
64
|
+
name: 'Antigravity',
|
|
65
|
+
configDir: path.join(os.homedir(), '.antigravity'),
|
|
66
|
+
skillsDir: path.join(os.homedir(), '.antigravity', 'skills'),
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
id: 'continue',
|
|
70
|
+
name: 'Continue',
|
|
71
|
+
configDir: path.join(os.homedir(), '.continue'),
|
|
72
|
+
skillsDir: path.join(os.homedir(), '.continue', 'skills'),
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
id: 'cline',
|
|
76
|
+
name: 'Cline',
|
|
77
|
+
configDir: path.join(os.homedir(), '.cline'),
|
|
78
|
+
skillsDir: path.join(os.homedir(), '.cline', 'skills'),
|
|
79
|
+
},
|
|
80
|
+
];
|
|
81
|
+
export function detectPlatforms() {
|
|
82
|
+
return PLATFORMS.map((platform) => ({
|
|
83
|
+
...platform,
|
|
84
|
+
detected: fs.existsSync(platform.configDir),
|
|
85
|
+
}));
|
|
86
|
+
}
|
|
87
|
+
export function getPlatformById(id) {
|
|
88
|
+
return detectPlatforms().find((p) => p.id === id);
|
|
89
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export interface DetectedPlatform {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
configDir: string;
|
|
5
|
+
skillsDir: string;
|
|
6
|
+
detected: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface SkillManifest {
|
|
9
|
+
name: string;
|
|
10
|
+
description: string;
|
|
11
|
+
version: string;
|
|
12
|
+
files: string[];
|
|
13
|
+
}
|
|
14
|
+
export interface InstallResult {
|
|
15
|
+
platform: DetectedPlatform;
|
|
16
|
+
skill: string;
|
|
17
|
+
action: 'installed' | 'updated' | 'skipped';
|
|
18
|
+
targetPath: string;
|
|
19
|
+
}
|
|
20
|
+
export interface SkillLock {
|
|
21
|
+
version: string;
|
|
22
|
+
installedAt: string;
|
|
23
|
+
skills: Record<string, {
|
|
24
|
+
version: string;
|
|
25
|
+
checksum: string;
|
|
26
|
+
installedAt: string;
|
|
27
|
+
}>;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/skills/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,OAAO,CAAA;CAClB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,MAAM,EAAE,CAAA;CAChB;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,gBAAgB,CAAA;IAC1B,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,WAAW,GAAG,SAAS,GAAG,SAAS,CAAA;IAC3C,UAAU,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,CAAA;IACf,WAAW,EAAE,MAAM,CAAA;IACnB,MAAM,EAAE,MAAM,CACZ,MAAM,EACN;QACE,OAAO,EAAE,MAAM,CAAA;QACf,QAAQ,EAAE,MAAM,CAAA;QAChB,WAAW,EAAE,MAAM,CAAA;KACpB,CACF,CAAA;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"postinstall.d.ts","sourceRoot":"","sources":["../src/postinstall.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,KAAK,SAAuB,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const isTTY = process.stdout.isTTY;
|
|
3
|
+
if (isTTY) {
|
|
4
|
+
console.log('');
|
|
5
|
+
console.log(' \x1b[36m@skhema/cli\x1b[0m installed successfully!');
|
|
6
|
+
console.log('');
|
|
7
|
+
console.log(' Get started:');
|
|
8
|
+
console.log(' \x1b[1mskhema auth login\x1b[0m Authenticate with Skhema');
|
|
9
|
+
console.log(' \x1b[1mskhema skills install\x1b[0m Install AI skills to your agent platforms');
|
|
10
|
+
console.log('');
|
|
11
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@skhema/cli",
|
|
3
|
+
"version": "0.3.1",
|
|
4
|
+
"description": "Skhema CLI - Authentication and AI skills management for agent platforms",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"bin": {
|
|
9
|
+
"skhema": "./bin/skhema.js"
|
|
10
|
+
},
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"import": "./dist/index.js"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist",
|
|
19
|
+
"bin",
|
|
20
|
+
"skills"
|
|
21
|
+
],
|
|
22
|
+
"scripts": {
|
|
23
|
+
"dev": "tsc --watch",
|
|
24
|
+
"build": "tsc",
|
|
25
|
+
"lint": "eslint .",
|
|
26
|
+
"lint:fix": "eslint . --fix",
|
|
27
|
+
"format": "prettier --write .",
|
|
28
|
+
"format:check": "prettier --check .",
|
|
29
|
+
"typecheck": "tsc --noEmit",
|
|
30
|
+
"test": "vitest run",
|
|
31
|
+
"test:watch": "vitest",
|
|
32
|
+
"clean": "rm -rf dist node_modules skills",
|
|
33
|
+
"clean:dist": "rm -rf dist",
|
|
34
|
+
"sync-skills": "tsx scripts/sync-skills.ts",
|
|
35
|
+
"prebuild": "npm run clean:dist && npm run sync-skills",
|
|
36
|
+
"prepack": "npm run sync-skills",
|
|
37
|
+
"check": "npm run typecheck && npm run lint && npm run format:check",
|
|
38
|
+
"check:fix": "npm run format && npm run lint:fix",
|
|
39
|
+
"prepublishOnly": "npm run build",
|
|
40
|
+
"postinstall": "node dist/postinstall.js || true"
|
|
41
|
+
},
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"chalk": "^5.3.0",
|
|
44
|
+
"commander": "^12.0.0",
|
|
45
|
+
"ora": "^8.0.0",
|
|
46
|
+
"@skhema/agent-sdk": "0.1.4",
|
|
47
|
+
"@skhema/sdk": "0.1.2"
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@skhema/linter": "2.2.0",
|
|
51
|
+
"@skhema/prettier-config": "1.0.0",
|
|
52
|
+
"@types/node": "^22.0.0",
|
|
53
|
+
"eslint": "^9.0.0",
|
|
54
|
+
"prettier": "^3.0.0",
|
|
55
|
+
"prettier-plugin-organize-imports": "^4.3.0",
|
|
56
|
+
"tsx": "^4.7.0",
|
|
57
|
+
"typescript": "^5.0.0",
|
|
58
|
+
"vitest": "^4.0.0"
|
|
59
|
+
},
|
|
60
|
+
"engines": {
|
|
61
|
+
"node": ">=18.0.0"
|
|
62
|
+
},
|
|
63
|
+
"publishConfig": {
|
|
64
|
+
"access": "public"
|
|
65
|
+
},
|
|
66
|
+
"homepage": "https://skhema.com/docs/api"
|
|
67
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"syncedAt": "2026-07-09T00:22:20.025Z",
|
|
3
|
+
"source": "/Users/michaellovell/Desktop/GitHub/skhema-skills",
|
|
4
|
+
"sourceSha": "77561c7dbde8602ca799e5224c65ea18675ee37b",
|
|
5
|
+
"skills": [
|
|
6
|
+
"skhema-challenge-framing",
|
|
7
|
+
"skhema-coherence-check",
|
|
8
|
+
"skhema-element-decomposition",
|
|
9
|
+
"skhema-element-writer",
|
|
10
|
+
"skhema-judgment-audit",
|
|
11
|
+
"skhema-semantic-sharpening",
|
|
12
|
+
"skhema-strategy-advisor",
|
|
13
|
+
"skhema-workspace-navigator"
|
|
14
|
+
]
|
|
15
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: skhema-challenge-framing
|
|
3
|
+
description: "Guide strategic challenge articulation—avoid symptoms, ensure actionable and bounded problem statements."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Challenge Framing
|
|
7
|
+
|
|
8
|
+
Guide users through articulating strategic challenges with precision.
|
|
9
|
+
|
|
10
|
+
## When to Use
|
|
11
|
+
|
|
12
|
+
- Starting a new strategy process
|
|
13
|
+
- When a problem feels vague or overwhelming
|
|
14
|
+
- When stakeholders disagree on "the real issue"
|
|
15
|
+
|
|
16
|
+
## Key Principles
|
|
17
|
+
|
|
18
|
+
- Challenges are not symptoms
|
|
19
|
+
- A well-framed challenge is specific, bounded, and actionable
|
|
20
|
+
- The framing itself is a strategic choice
|
|
21
|
+
|
|
22
|
+
## Process
|
|
23
|
+
|
|
24
|
+
TODO: Define the step-by-step process
|
|
25
|
+
|
|
26
|
+
## Examples --> what does good look like?
|
|
27
|
+
|
|
28
|
+
TODO: Add worked examples
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: skhema-coherence-check
|
|
3
|
+
description: "Examine strategic elements for internal consistency—flag contradictions, tensions, or gaps between decisions."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Coherence Check
|
|
7
|
+
|
|
8
|
+
Validate that a set of strategic elements form a coherent whole.
|
|
9
|
+
|
|
10
|
+
## When to Use
|
|
11
|
+
|
|
12
|
+
- After multiple elements have been defined
|
|
13
|
+
- When strategy feels fragmented
|
|
14
|
+
- Before communicating strategy to others
|
|
15
|
+
|
|
16
|
+
## Key Principles
|
|
17
|
+
|
|
18
|
+
- Coherence is not automatic—it must be checked
|
|
19
|
+
- Tensions may be acceptable if acknowledged
|
|
20
|
+
- Gaps are often invisible until explicitly sought
|
|
21
|
+
|
|
22
|
+
## Check Types
|
|
23
|
+
|
|
24
|
+
TODO: Categories of coherence issues
|
|
25
|
+
|
|
26
|
+
## Process
|
|
27
|
+
|
|
28
|
+
TODO: How to systematically check for coherence
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: skhema-element-decomposition
|
|
3
|
+
description: "Break strategic questions into discrete judgment elements—surface individual decisions and their dependencies."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Element Decomposition
|
|
7
|
+
|
|
8
|
+
Help users decompose strategy into its constituent judgment elements.
|
|
9
|
+
|
|
10
|
+
## When to Use
|
|
11
|
+
|
|
12
|
+
- After a challenge has been framed
|
|
13
|
+
- When facing a complex strategic question
|
|
14
|
+
- To create clarity on what decisions actually need to be made
|
|
15
|
+
|
|
16
|
+
## Key Principles
|
|
17
|
+
|
|
18
|
+
- Each element represents a single judgment or decision
|
|
19
|
+
- Elements have dependencies and sequences
|
|
20
|
+
- Decomposition reveals hidden complexity
|
|
21
|
+
|
|
22
|
+
## Process
|
|
23
|
+
|
|
24
|
+
TODO: Define the decomposition method
|
|
25
|
+
|
|
26
|
+
## Element Types
|
|
27
|
+
|
|
28
|
+
TODO: Categorize types of strategic elements
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: skhema-element-writer
|
|
3
|
+
description: Use when creating or editing Skhema elements, structuring element content, organizing elements into components, or applying strategy frameworks during element authoring.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Skhema Element Writer
|
|
7
|
+
|
|
8
|
+
A skill for creating and managing Skhema elements — the building blocks of your product strategy.
|
|
9
|
+
|
|
10
|
+
## Capabilities
|
|
11
|
+
|
|
12
|
+
- Create new elements with proper structure
|
|
13
|
+
- Edit existing element content
|
|
14
|
+
- Organize elements into components
|
|
15
|
+
- Apply strategy frameworks to element creation
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
This skill is automatically available when installed to your agent platform.
|
|
20
|
+
Ask your AI assistant to create or edit Skhema elements.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: skhema-judgment-audit
|
|
3
|
+
description: "Surface assumptions, evidence quality, and confidence levels for strategic elements. Distinguish facts from beliefs."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Judgment Audit
|
|
7
|
+
|
|
8
|
+
Examine the foundations of strategic judgments and decisions.
|
|
9
|
+
|
|
10
|
+
## When to Use
|
|
11
|
+
|
|
12
|
+
- Validating critical strategic elements
|
|
13
|
+
- When confidence in a decision is unclear
|
|
14
|
+
- Before committing significant resources
|
|
15
|
+
|
|
16
|
+
## Key Principles
|
|
17
|
+
|
|
18
|
+
- Every judgment rests on assumptions
|
|
19
|
+
- Evidence varies in quality and relevance
|
|
20
|
+
- Distinguishing facts from beliefs prevents overconfidence
|
|
21
|
+
|
|
22
|
+
## Audit Dimensions
|
|
23
|
+
|
|
24
|
+
TODO: Define what to examine in each judgment
|
|
25
|
+
|
|
26
|
+
## Confidence Framework
|
|
27
|
+
|
|
28
|
+
TODO: How to assess and communicate confidence levels
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: skhema-semantic-sharpening
|
|
3
|
+
description: "Review strategy language for ambiguity and vague terms. Ensure precise meaning and shared understanding."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Semantic Sharpening
|
|
7
|
+
|
|
8
|
+
Review and refine strategic language for clarity and precision.
|
|
9
|
+
|
|
10
|
+
## When to Use
|
|
11
|
+
|
|
12
|
+
- Reviewing strategy documents or statements
|
|
13
|
+
- When team members interpret terms differently
|
|
14
|
+
- Before finalizing strategic commitments
|
|
15
|
+
|
|
16
|
+
## Key Principles
|
|
17
|
+
|
|
18
|
+
- Ambiguity is the enemy of execution
|
|
19
|
+
- Many strategy failures are semantic failures
|
|
20
|
+
- Precision enables accountability
|
|
21
|
+
|
|
22
|
+
## Common Patterns
|
|
23
|
+
|
|
24
|
+
TODO: Document common semantic traps
|
|
25
|
+
|
|
26
|
+
## Techniques --> what does good look like?
|
|
27
|
+
|
|
28
|
+
TODO: Methods for sharpening language
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: skhema-strategy-advisor
|
|
3
|
+
description: Use when developing or refining product strategy in Skhema, including positioning, market fit analysis, competitive evaluation, and strategic recommendations.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Skhema Strategy Advisor
|
|
7
|
+
|
|
8
|
+
A skill that helps you develop and refine product strategies using the Skhema framework.
|
|
9
|
+
|
|
10
|
+
## Capabilities
|
|
11
|
+
|
|
12
|
+
- Analyze product positioning and market fit
|
|
13
|
+
- Generate strategic recommendations
|
|
14
|
+
- Evaluate competitive landscapes
|
|
15
|
+
- Create actionable strategy documents
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
This skill is automatically available when installed to your agent platform.
|
|
20
|
+
Ask your AI assistant about product strategy, positioning, or competitive analysis.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: skhema-workspace-navigator
|
|
3
|
+
description: Use when navigating a Skhema workspace, inspecting workspace structure, searching workspace content, understanding hierarchy, or moving between related elements.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Skhema Workspace Navigator
|
|
7
|
+
|
|
8
|
+
A skill for navigating and understanding your Skhema workspace structure.
|
|
9
|
+
|
|
10
|
+
## Capabilities
|
|
11
|
+
|
|
12
|
+
- Browse workspace components and elements
|
|
13
|
+
- Search across workspace content
|
|
14
|
+
- Understand workspace hierarchy
|
|
15
|
+
- Navigate between related elements
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
This skill is automatically available when installed to your agent platform.
|
|
20
|
+
Ask your AI assistant to help you navigate your Skhema workspace.
|